query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
However, the type of reference of b is Baap so b.h will always refer to Baap's h
public static void main(String[] args) { Baap b = new Beta(); //Here, b refers to an object of class Beta //so b.getH() will always call the overridden (subclass's method) System.out.println("Baap b = new Beta(): " + b.h/*2*/ + " " + b.getH())/*1*/; // also 1) prints getH(), 2) prints diese mit b.h und b.getH() mit Return Wert Beta bb = (Beta) b; System.out.println("Beta bb = (Beta) b : " + bb.h/*4*/ + " " + bb.getH()/*3*/); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void b(ahd paramahd) {}", "public void b() {\n ((a) this.a).b();\n }", "public t b() {\n return a(this.a);\n }", "public abstract BoundType b();", "MagReference getHvRef();", "public void b(World paramaqu, BlockPosition paramdt, Block parambec)\r\n/* 27: */ {\r\n/* 28: 47 */ bcm localbcm = paramaqu.s(paramdt);\r\n/* 29: 48 */ if ((localbcm instanceof bdv)) {\r\n/* 30: 49 */ ((bdv)localbcm).h();\r\n/* 31: */ } else {\r\n/* 32: 51 */ super.b(paramaqu, paramdt, parambec);\r\n/* 33: */ }\r\n/* 34: */ }", "public bb b() {\n return a(this.a);\n }", "public interface b {\n}", "public interface b {\n}", "public void b(ahb paramahb)\r\n/* 583: */ {\r\n/* 584:625 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 585:626 */ this.a[i] = amj.b(paramahb.a[i]);\r\n/* 586: */ }\r\n/* 587:628 */ for (i = 0; i < this.b.length; i++) {\r\n/* 588:629 */ this.b[i] = amj.b(paramahb.b[i]);\r\n/* 589: */ }\r\n/* 590:631 */ this.c = paramahb.c;\r\n/* 591: */ }", "private Proof implLeftWeakness(Expression b, Proof p) {\n Proof axm1 = axm1(p.lastExpr(), b); //a -> b -> a\n return mpBack(axm1, p); //b -> a\n }", "public void l0() {\n b bVar = (b) this.c0.get();\n if (bVar != null) {\n bVar.a();\n }\n }", "@Override\n public void b() {\n }", "private static void m831a(C0741g<?> gVar, C0747b bVar) {\n gVar.mo9477a(C0743i.f718b, (C0739e<? super Object>) bVar);\n gVar.mo9476a(C0743i.f718b, (C0738d) bVar);\n gVar.mo9474a(C0743i.f718b, (C0736b) bVar);\n }", "public static Note getB() {return (Note)B.clone();}", "public Lechuga(Hamburguesa h){\n this.hamburguesa = h;\n }", "public interface HbInterfaceInternal {\n\t/**\n\t * The cluster path is a relative path from the parent device with the following format:\n\t * &lt;cluster type&gt;/&lt;instance id&gt;\n\t * \n\t * @return the relative path from the parent device with the following format:\n\t * &lt;cluster type&gt;/&lt;instance id&gt;\n\t */\n\tpublic String getPath();\n\n\t/**\n\t * Get all the attributes\n\t * \n\t * @return a collection of attributes\n\t */\n\tpublic Collection<HbAttributeInternal> attributes();\n\n\t/**\n\t * Get attribute by name\n\t * \n\t * @param name\n\t * attribute name\n\t * @return the suitable attribute or null if they are no attribute available\n\t * with the given name\n\t */\n\tpublic HbAttributeInternal getAttribute(String name);\n\t\n}", "void mo2508a(bxb bxb);", "@Override\n\tpublic void b() {\n\n\t}", "public an b() {\n return a(this.a);\n }", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "protected a bi() {\n return new a(this);\n }", "public interface bdp {\n\n /* renamed from: a */\n public static final bdp f3422a = new bdo();\n\n /* renamed from: a */\n bdm mo1784a(akh akh);\n}", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "public interface b {\n void H_();\n\n void I_();\n\n void J_();\n\n void a(C0063d dVar);\n\n void a(byte[] bArr);\n\n void b(boolean z);\n }", "public abstract Binding getCommonType(Binding b);", "@Override\n\tpublic void bbb() {\n\t\t\n\t}", "public void hiliteByReference(String ref) {\n\t}", "public abstract C0631bt mo9227aB();", "public Integer getBh() {\r\n return bh;\r\n }", "public abstract byte getReferenceKind();", "public ae bab() {\n return (ae) this.descriptor$delegate.G(this, apP[0]);\n }", "private void attachHeader(SIPHeader h) {\n if (h == null) throw new IllegalArgumentException(\"null header!\");\n try {\n if (h instanceof SIPHeaderList) {\n SIPHeaderList hl = (SIPHeaderList) h;\n if (hl.isEmpty()) {\n return;\n }\n }\n attachHeader(h,false,false);\n } catch ( SIPDuplicateHeaderException ex) {\n // InternalErrorHandler.handleException(ex);\n }\n }", "static void go(Base b) {\n\t\tb.add(8);\n\t}", "public interface InterB {\n String a = \"B\";\n}", "public abstract BoundType a();", "public BoundType b() {\n throw new IllegalStateException();\n }", "public interface bj\n extends bl\n{\n\n public abstract void a(a a1);\n\n public abstract void b(a a1);\n\n public abstract Ad c();\n\n public abstract String d();\n\n public abstract a e();\n\n public abstract b f();\n\n // Unreferenced inner class com/vungle/publisher/bj$a\n /* block-local class not found */\n class a {}\n\n\n // Unreferenced inner class com/vungle/publisher/bj$b\n /* block-local class not found */\n class b {}\n\n}", "public Vector2 getAnchorB(Vector2 out_b) {\n float[] floats4 = getFloats4();\n JniConstraintType.pinJointGetAnchorB(nativeAddress, floats4);\n return out_b.set(floats4[0], floats4[1]);\n }", "public abstract void mo9244b(C0620bi biVar);", "@Override\n public void func_104112_b() {\n \n }", "public af bab() {\n return (af) this.descriptor$delegate.G(this, apP[0]);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public BoundType b() {\n throw new AssertionError(\"this statement should be unreachable\");\n }", "public interface B{\n String getName();\n}", "void getReference(Configuration c)\n {\n c_ref= c;\n }", "public abstract B zzjo();", "b(a aVar) {\n super(0);\n this.this$0 = aVar;\n }", "public void ref() {\n\n\t}", "public np a()\r\n/* 33: */ {\r\n/* 34:49 */ return this.b;\r\n/* 35: */ }", "void method_5902(ahb var1) {\r\n this.field_5516 = var1;\r\n super();\r\n }", "public BigInteger bawah(){\n if(bawah!=null)\n return bawah.data;\n else{\n return null;\n }\n }", "@Override\n\tpublic void visit(PartB partB) {\n\n\t}", "public void hasA(Bike b)\n {\n\t\tSystem.out.println(\"bike cc is: \"+b.getCc());\n\t\tSystem.out.println(\"bike colour is: \"+b.getColour());\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 b() {\n e$a e$a;\n try {\n e$a = this.b;\n }\n catch (IOException iOException) {\n return;\n }\n Object object = this.c;\n e$a.b(object);\n }", "protected void h() {}", "public ahb(ahd paramahd)\r\n/* 12: */ {\r\n/* 13: 36 */ this.d = paramahd;\r\n/* 14: */ }", "Symbol getRef();", "public a getFallback() {\n return new b();\n }", "public Halfedge ELgethash(int b) {\r\n\t\tHalfedge he;\r\n\r\n\t\tif (b < 0 || b >= ELhashsize)\r\n\t\t\treturn null;\r\n\t\the = ELhash[b];\r\n\r\n\t\tif (he == null || he.ELedge != DELETED) {\r\n\t\t\treturn he;\r\n\t\t}\r\n\r\n\t\t/* Hash table points to deleted half edge. Patch as necessary. */\r\n\t\tELhash[b] = null;\r\n\t\tif ((he.ELrefcnt -= 1) == 0)\r\n\t\t\the = null;\r\n\t\treturn null;\r\n\t}", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "public void b() {\r\n }", "public T caseDefinitionReference(DefinitionReference object)\n {\n return null;\n }", "protected void b(dh paramdh) {}", "public void a(b bVar, Object obj) throws IOException, IllegalAccessException {\n Object a2 = this.f10078f.a(bVar);\n if (a2 != null || !this.f10081i) {\n this.f10076d.set(obj, a2);\n }\n }", "private VerbBridge() {\r\n\t\tvB = null;\r\n\t}", "@Override\n\tpublic void b1() {\n\t\t\n\t}", "public static void main(String[] args) {\n B40 b = new B40(); // to not get an error above line should be in test\n A40 a = new A40();\n a = (A40) b;\n System.out.println(a);\n System.out.println(b);\n\n }", "public void e(android.arch.persistence.a.b bVar) {\n android.arch.persistence.a.b bVar2 = bVar;\n HashMap hashMap = new HashMap(2);\n hashMap.put(\"work_spec_id\", new android.arch.persistence.room.b.b.a(\"work_spec_id\", \"TEXT\", true, 1));\n hashMap.put(\"prerequisite_id\", new android.arch.persistence.room.b.b.a(\"prerequisite_id\", \"TEXT\", true, 2));\n HashSet hashSet = new HashSet(2);\n hashSet.add(new android.arch.persistence.room.b.b.b(\"WorkSpec\", \"CASCADE\", \"CASCADE\", Arrays.asList(new String[]{\"work_spec_id\"}), Arrays.asList(new String[]{\"id\"})));\n hashSet.add(new android.arch.persistence.room.b.b.b(\"WorkSpec\", \"CASCADE\", \"CASCADE\", Arrays.asList(new String[]{\"prerequisite_id\"}), Arrays.asList(new String[]{\"id\"})));\n HashSet hashSet2 = new HashSet(2);\n hashSet2.add(new d(\"index_Dependency_work_spec_id\", false, Arrays.asList(new String[]{\"work_spec_id\"})));\n hashSet2.add(new d(\"index_Dependency_prerequisite_id\", false, Arrays.asList(new String[]{\"prerequisite_id\"})));\n android.arch.persistence.room.b.b bVar3 = new android.arch.persistence.room.b.b(\"Dependency\", hashMap, hashSet, hashSet2);\n android.arch.persistence.room.b.b a = android.arch.persistence.room.b.b.a(bVar2, \"Dependency\");\n StringBuilder stringBuilder;\n if (bVar3.equals(a)) {\n hashMap = new HashMap(23);\n hashMap.put(\"id\", new android.arch.persistence.room.b.b.a(\"id\", \"TEXT\", true, 1));\n hashMap.put(\"state\", new android.arch.persistence.room.b.b.a(\"state\", \"INTEGER\", true, 0));\n hashMap.put(\"worker_class_name\", new android.arch.persistence.room.b.b.a(\"worker_class_name\", \"TEXT\", true, 0));\n hashMap.put(\"input_merger_class_name\", new android.arch.persistence.room.b.b.a(\"input_merger_class_name\", \"TEXT\", false, 0));\n hashMap.put(\"input\", new android.arch.persistence.room.b.b.a(\"input\", \"BLOB\", true, 0));\n hashMap.put(\"output\", new android.arch.persistence.room.b.b.a(\"output\", \"BLOB\", true, 0));\n hashMap.put(\"initial_delay\", new android.arch.persistence.room.b.b.a(\"initial_delay\", \"INTEGER\", true, 0));\n hashMap.put(\"interval_duration\", new android.arch.persistence.room.b.b.a(\"interval_duration\", \"INTEGER\", true, 0));\n hashMap.put(\"flex_duration\", new android.arch.persistence.room.b.b.a(\"flex_duration\", \"INTEGER\", true, 0));\n hashMap.put(\"run_attempt_count\", new android.arch.persistence.room.b.b.a(\"run_attempt_count\", \"INTEGER\", true, 0));\n hashMap.put(\"backoff_policy\", new android.arch.persistence.room.b.b.a(\"backoff_policy\", \"INTEGER\", true, 0));\n hashMap.put(\"backoff_delay_duration\", new android.arch.persistence.room.b.b.a(\"backoff_delay_duration\", \"INTEGER\", true, 0));\n hashMap.put(\"period_start_time\", new android.arch.persistence.room.b.b.a(\"period_start_time\", \"INTEGER\", true, 0));\n hashMap.put(\"minimum_retention_duration\", new android.arch.persistence.room.b.b.a(\"minimum_retention_duration\", \"INTEGER\", true, 0));\n hashMap.put(\"schedule_requested_at\", new android.arch.persistence.room.b.b.a(\"schedule_requested_at\", \"INTEGER\", true, 0));\n hashMap.put(\"required_network_type\", new android.arch.persistence.room.b.b.a(\"required_network_type\", \"INTEGER\", false, 0));\n hashMap.put(\"requires_charging\", new android.arch.persistence.room.b.b.a(\"requires_charging\", \"INTEGER\", true, 0));\n hashMap.put(\"requires_device_idle\", new android.arch.persistence.room.b.b.a(\"requires_device_idle\", \"INTEGER\", true, 0));\n hashMap.put(\"requires_battery_not_low\", new android.arch.persistence.room.b.b.a(\"requires_battery_not_low\", \"INTEGER\", true, 0));\n hashMap.put(\"requires_storage_not_low\", new android.arch.persistence.room.b.b.a(\"requires_storage_not_low\", \"INTEGER\", true, 0));\n hashMap.put(\"trigger_content_update_delay\", new android.arch.persistence.room.b.b.a(\"trigger_content_update_delay\", \"INTEGER\", true, 0));\n hashMap.put(\"trigger_max_content_delay\", new android.arch.persistence.room.b.b.a(\"trigger_max_content_delay\", \"INTEGER\", true, 0));\n hashMap.put(\"content_uri_triggers\", new android.arch.persistence.room.b.b.a(\"content_uri_triggers\", \"BLOB\", false, 0));\n hashSet = new HashSet(0);\n hashSet2 = new HashSet(1);\n hashSet2.add(new d(\"index_WorkSpec_schedule_requested_at\", false, Arrays.asList(new String[]{\"schedule_requested_at\"})));\n bVar3 = new android.arch.persistence.room.b.b(\"WorkSpec\", hashMap, hashSet, hashSet2);\n a = android.arch.persistence.room.b.b.a(bVar2, \"WorkSpec\");\n if (bVar3.equals(a)) {\n hashMap = new HashMap(2);\n hashMap.put(\"tag\", new android.arch.persistence.room.b.b.a(\"tag\", \"TEXT\", true, 1));\n hashMap.put(\"work_spec_id\", new android.arch.persistence.room.b.b.a(\"work_spec_id\", \"TEXT\", true, 2));\n hashSet = new HashSet(1);\n hashSet.add(new android.arch.persistence.room.b.b.b(\"WorkSpec\", \"CASCADE\", \"CASCADE\", Arrays.asList(new String[]{\"work_spec_id\"}), Arrays.asList(new String[]{\"id\"})));\n hashSet2 = new HashSet(1);\n hashSet2.add(new d(\"index_WorkTag_work_spec_id\", false, Arrays.asList(new String[]{\"work_spec_id\"})));\n bVar3 = new android.arch.persistence.room.b.b(\"WorkTag\", hashMap, hashSet, hashSet2);\n a = android.arch.persistence.room.b.b.a(bVar2, \"WorkTag\");\n if (bVar3.equals(a)) {\n hashMap = new HashMap(2);\n hashMap.put(\"work_spec_id\", new android.arch.persistence.room.b.b.a(\"work_spec_id\", \"TEXT\", true, 1));\n hashMap.put(\"system_id\", new android.arch.persistence.room.b.b.a(\"system_id\", \"INTEGER\", true, 0));\n hashSet = new HashSet(1);\n hashSet.add(new android.arch.persistence.room.b.b.b(\"WorkSpec\", \"CASCADE\", \"CASCADE\", Arrays.asList(new String[]{\"work_spec_id\"}), Arrays.asList(new String[]{\"id\"})));\n bVar3 = new android.arch.persistence.room.b.b(\"SystemIdInfo\", hashMap, hashSet, new HashSet(0));\n a = android.arch.persistence.room.b.b.a(bVar2, \"SystemIdInfo\");\n if (bVar3.equals(a)) {\n hashMap = new HashMap(2);\n hashMap.put(\"name\", new android.arch.persistence.room.b.b.a(\"name\", \"TEXT\", true, 1));\n hashMap.put(\"work_spec_id\", new android.arch.persistence.room.b.b.a(\"work_spec_id\", \"TEXT\", true, 2));\n HashSet hashSet3 = new HashSet(1);\n hashSet3.add(new android.arch.persistence.room.b.b.b(\"WorkSpec\", \"CASCADE\", \"CASCADE\", Arrays.asList(new String[]{\"work_spec_id\"}), Arrays.asList(new String[]{\"id\"})));\n hashSet = new HashSet(1);\n hashSet.add(new d(\"index_WorkName_work_spec_id\", false, Arrays.asList(new String[]{\"work_spec_id\"})));\n android.arch.persistence.room.b.b bVar4 = new android.arch.persistence.room.b.b(\"WorkName\", hashMap, hashSet3, hashSet);\n android.arch.persistence.room.b.b a2 = android.arch.persistence.room.b.b.a(bVar2, \"WorkName\");\n if (!bVar4.equals(a2)) {\n stringBuilder = new StringBuilder();\n stringBuilder.append(\"Migration didn't properly handle WorkName(androidx.work.impl.model.WorkName).\\n Expected:\\n\");\n stringBuilder.append(bVar4);\n stringBuilder.append(\"\\n Found:\\n\");\n stringBuilder.append(a2);\n throw new IllegalStateException(stringBuilder.toString());\n }\n return;\n }\n stringBuilder = new StringBuilder();\n stringBuilder.append(\"Migration didn't properly handle SystemIdInfo(androidx.work.impl.model.SystemIdInfo).\\n Expected:\\n\");\n stringBuilder.append(bVar3);\n stringBuilder.append(\"\\n Found:\\n\");\n stringBuilder.append(a);\n throw new IllegalStateException(stringBuilder.toString());\n }\n stringBuilder = new StringBuilder();\n stringBuilder.append(\"Migration didn't properly handle WorkTag(androidx.work.impl.model.WorkTag).\\n Expected:\\n\");\n stringBuilder.append(bVar3);\n stringBuilder.append(\"\\n Found:\\n\");\n stringBuilder.append(a);\n throw new IllegalStateException(stringBuilder.toString());\n }\n stringBuilder = new StringBuilder();\n stringBuilder.append(\"Migration didn't properly handle WorkSpec(androidx.work.impl.model.WorkSpec).\\n Expected:\\n\");\n stringBuilder.append(bVar3);\n stringBuilder.append(\"\\n Found:\\n\");\n stringBuilder.append(a);\n throw new IllegalStateException(stringBuilder.toString());\n }\n stringBuilder = new StringBuilder();\n stringBuilder.append(\"Migration didn't properly handle Dependency(androidx.work.impl.model.Dependency).\\n Expected:\\n\");\n stringBuilder.append(bVar3);\n stringBuilder.append(\"\\n Found:\\n\");\n stringBuilder.append(a);\n throw new IllegalStateException(stringBuilder.toString());\n }", "public interface HealingObject {}", "public /* synthetic */ void mo7209b(as asVar, bp bpVar) throws bv {\n m21417a(asVar, (bc) bpVar);\n }", "public E ur() {\n return h.this.fAb;\n }", "protected void b(Drawable drawable)\n {\n class b {}\n\n if (j != null)\n {\n j.a(drawable);\n }\n }", "@Override\n\tpublic void b2() {\n\t\t\n\t}", "public int func_176881_a() {\n/* */ return this.field_176893_h;\n/* */ }", "private void b(int paramInt)\r\n/* 193: */ {\r\n/* 194:203 */ this.h.a(a(paramInt));\r\n/* 195: */ }", "@Override\n\tpublic AbstractValue glb(AbstractValue a) {\n\t\tSignAbstValue b = (SignAbstValue) a;\n\n\t\tif (this.equals(BottomAbstractValue.getInstance()) || b.equals(BottomAbstractValue.getInstance())) {\n\t\t\treturn BottomAbstractValue.getInstance();\n\t\t}\n\n\t\tif (this.equals(b)) {\n\t\t\treturn this;\n\t\t}\n\n\t\treturn SignAbstValue.TOP;\n\t}", "private void m678b(byte b) {\n byte[] bArr = this.f523r;\n bArr[0] = b;\n this.f552g.mo502b(bArr);\n }", "public Float getBh() {\r\n return bh;\r\n }", "public buu(bos bos, bux bux) {\n super(buv.a, bos);\n this.h = bux;\n }", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "private void parseHRefs (URL page, String name, URL base) throws IOException {\n Reader r = source.getReader (page);\n URL[] refs = ParseURLs.parse (r, page);\n \n String b = base.toExternalForm();\n for (int i = 0; i < refs.length; i++) {\n String e = refs[i].toExternalForm ();\n int hash = e.indexOf ('#');\n if (hash >= 0) {\n e = e.substring (0, hash);\n }\n if (e.startsWith (b)) {\n String s = e.substring (b.length ());\n Collection c = (Collection)deps.get (name);\n if (c == null) {\n c = new ArrayList ();\n deps.put (name, c);\n }\n c.add (s.intern ());\n }\n }\n r.close (); \n }", "private void a() {\n if (this.a == null && this.c == null) {\n return;\n }\n xh xh2 = (xh)this.g.get();\n if (!this.i && this.a != null && xh2 != null) {\n xh2.a(this);\n this.i = true;\n }\n if (this.f != null) {\n this.b(this.f);\n return;\n }\n if (this.d == null) return;\n this.d.a(this);\n }", "public final void b() {\n int b2;\n if (this.d) {\n b2 = this.a.c();\n } else {\n b2 = this.a.b();\n }\n this.c = b2;\n }", "BElementStructure createBElementStructure();", "public /* synthetic */ void mo7208a(as asVar, bp bpVar) throws bv {\n m21419b(asVar, (bc) bpVar);\n }", "public com.shopee.app.ui.refund.b b() {\n return this.f24962c;\n }", "public void visit(Have h);", "public void b() {\n }", "public void b() {\n }", "void addHadithReferenceNo(Object newHadithReferenceNo);", "public int b() {\n return this.f2076a.a();\n }", "public interface EjbReference extends NamedInformation, InjectionCapable {\n \n /** \n * Get the type of the EJB (Session, Entity or Message-Driven). \n * @return the type of the EJB.\n */\n public String getType();\n\n /**\n * Set the type of the EJB. Allowed values are Session, Entity or\n * Message-driven.\n * @param the type of the EJB.\n */\n public void setType(String type);\n\n /** \n * Gets the home classname of the referee EJB. \n * @return the class name of the EJB home.\n */\n public String getEjbHomeInterface();\n\n /** \n * Sets the local or remote home classname of the referee EJB. \n * @param the class name of the EJB home.\n */\n public void setEjbHomeInterface(String ejbHomeInterface);\n\n /** \n * Gets the local or remote interface classname of the referee EJB. \n * @return the classname of the EJB remote object.\n */\n public String getEjbInterface();\n\n /** \n * Sets the local or remote bean interface classname of the referee EJB. \n * @param the classname of the EJB remote object.\n */\n public void setEjbInterface(String ejbInterface);\n \n /** \n * Gets the link name of the reference. For use when linking to an EJB \n * within a J2EE application. \n * @return the link name.\n */\n public String getLinkName();\n\n /** \n * Sets the link name of the reference. For use when linking to an EJB \n * within a J2EE application. \n * @param the link name.\n */\n public void setLinkName(String linkName);\n \n /**\n * Tests if the reference to the referree EJB is through local or \n * remote interface\n * @return true if using the local interfaces\n */\n public boolean isLocal();\n \n /**\n * Sets whether the reference uses the local or remote interfaces of \n * the referring EJB\n * @param true if using the local interface\n */\n public void setLocal(boolean isLocal);\n \n /**\n * Set the referring bundle, i.e. the bundle within which this\n * EJB reference is declared. \n */\n public void setReferringBundleDescriptor(BundleDescriptor referringBundle);\n\n /**\n * Get the referring bundle, i.e. the bundle within which this\n * EJB reference is declared. \n */\n public BundleDescriptor getReferringBundleDescriptor();\n \n /**\n * Set the jndi name for this ejb reference\n */\n public void setJndiName(String jndiName);\n \n /**\n * @return the jndi name for this ejb reference\n */\n public String getJndiName();\n\n public boolean hasJndiName();\n\n public boolean hasLookupName();\n public String getLookupName();\n \n public EjbDescriptor getEjbDescriptor();\n public void setEjbDescriptor(EjbDescriptor descriptor);\n\n /**\n * @return true if the EJB reference is a 30 client view\n */\n public boolean isEJB30ClientView();\n\n}", "public interface lh extends lg {\n void a(int i, int i2, int i3, int i4, int i5, int i6, byte[] bArr);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public final b a() {\n return this.f2081b;\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public static BigB getBigB()\r\n{\treturn bigB;\t\r\n}" ]
[ "0.5760162", "0.56714755", "0.54906285", "0.5480289", "0.5438917", "0.5430128", "0.5428197", "0.54005575", "0.54005575", "0.5400227", "0.53536654", "0.52887976", "0.5283663", "0.5281222", "0.5277332", "0.5268807", "0.5264003", "0.52555037", "0.52462023", "0.52306324", "0.5228667", "0.52097106", "0.52013427", "0.51631826", "0.5145374", "0.51447767", "0.51426196", "0.51425934", "0.5139754", "0.50996566", "0.50898236", "0.50893515", "0.5085192", "0.5083087", "0.50728875", "0.5069572", "0.50686866", "0.50685567", "0.5065782", "0.5065473", "0.506405", "0.5062178", "0.50602293", "0.5052082", "0.5047982", "0.50472385", "0.50333136", "0.5021099", "0.5019471", "0.50169784", "0.5016438", "0.50070566", "0.49907994", "0.49861738", "0.49839428", "0.49839428", "0.49675006", "0.49639064", "0.49635795", "0.49602634", "0.4959217", "0.4948713", "0.49482706", "0.49407816", "0.49400583", "0.49359256", "0.49259463", "0.49241266", "0.4922812", "0.49118987", "0.49115565", "0.4908197", "0.49046436", "0.4902609", "0.48805264", "0.48794815", "0.48771238", "0.4875339", "0.4868566", "0.4868511", "0.48642805", "0.48624328", "0.48586434", "0.48581704", "0.48507476", "0.48498288", "0.48442033", "0.4836684", "0.4835859", "0.48243624", "0.48184562", "0.48184562", "0.48112565", "0.48109692", "0.48091316", "0.48008755", "0.47985417", "0.47960553", "0.4795486", "0.4788844" ]
0.5199437
23
lnd must be ready
@Override public void work() { if (!lnd_.isRpcReady()) return; if (!started_) { // NOTE: start protocol to recover in-flight payments' state: // - get all payments w/ 'sending' state from db // - get all payments from lnd // - find 'sending' payments within lnd payments // - update found payments, reset state for not-found // - delete all payments from lnd to clear it // - started_ = true, can process new payments now if (!starting_) { starting_ = true; List<Job> sendingJobs = dao_.getSendingJobs(); checkPayments(sendingJobs); } return; } if (!notified_ && nextWorkTime_ > System.currentTimeMillis()) return; // reset notified_ = false; List<Job> pending = dao_.getPendingJobs(System.currentTimeMillis()); for (Job job: pending) { WalletData.SendPayment p = (WalletData.SendPayment)job.objects.get(0); if (p.paymentHashHex() != null || p.isKeysend()) { queryRoutes(job, p); } else if (p.paymentRequest() != null) { decodePayment(job, p); } } nextWorkTime_ = System.currentTimeMillis() + WORK_INTERVAL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void ready();", "@Override\n public boolean isReady() {\n return true;\n }", "@Override\n public boolean isReady() {\n return true;\n }", "void isReady();", "void isReady();", "@Override\r\n\t\t\tpublic boolean isReady() {\n\t\t\t\treturn false;\r\n\t\t\t}", "@Override\n\t\tpublic boolean isReady() {\n\t\t\treturn false;\n\t\t}", "@Override\n\t\tpublic boolean isReady() {\n\t\t\treturn false;\n\t\t}", "public void nativeReady() {\n\t\t_startSem.release();\n\t}", "@Override\r\n public void init_loop() {\r\n }", "@Override\r\n public void init_loop() {\r\n }", "@Override\r\n\tpublic void sssDoLwTestInit() {\n\r\n\t}", "public boolean ready();", "@Override\n\tpublic boolean isReady() {\n\t\treturn false;\n\t}", "public abstract boolean inReady() throws JVMIOException;", "public void beginLoad(int libraryCount);", "@Override\n public void init_loop() {}", "protected synchronized boolean isLabelReady() {\n\t\treturn label != null;\r\n\t}", "protected void initialize() {\r\n\r\n Robot.pneumatics.pneuOpen();\r\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "@Override\n public void init_loop() {\n }", "boolean isReady();", "boolean isReady();", "boolean isReady();", "private void initialize() {\n\t\t\n\t}", "public void initHandle() {\n if(handle == null) {\n /* try {\n handle = ContextHolder.getInstance().getHandlePool().borrowObject();\n } catch (Exception e) {\n handle = new cublasHandle();\n JCublas2.cublasCreate(handle);\n handleFromPool = false;\n }*/\n handle = new cublasHandle();\n JCublas2.cublasCreate(handle);\n handleFromPool = false;\n // associateHandle();\n }\n\n }", "private void initialize() {\n\t}", "@Override\n public void init() {\n tol = new TeleOpLibrary();\n tol.init(this);\n telemetry.addLine(\"Initializing complete.\");\n telemetry.update();\n }", "public void setup(LdBookCB cb);", "public void autonomousInit() {\n \n }", "public boolean isReady();", "public boolean isReady();", "boolean initialized();", "public void onModuleLoad() {\n\n\t\tJsonpRequestBuilder requestBuilder = new JsonpRequestBuilder();\n\t\t// requestBuilder.setTimeout(10000);\n//\t\trequestBuilder.requestObject(SERVER_URL, new Jazz10RequestCallback());\n\n\t}", "public void initDevice() {\r\n\t\t\r\n\t}", "private void initialize() {\n }", "public void libraryLoaded();", "private static void init() {\n __lib = new JnaGmpLib();\n }", "protected void initialize() {\n \tthis.running= false;\n }", "private void waitUntilReady() {\n\t\t\twhile (deque.isEmpty() && loadThread.isAlive()) {\n//\t\t\t\ttry {\n//\t\t\t\t\tThread.sleep(100);\n//\t\t\t\t} catch (InterruptedException e) {\n//\t\t\t\t\tExceptionUtils.throwAsRuntimeException(e);\n//\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n public void setLoadOnStartup(int los) {\n }", "public void autonomousInit() {\n }", "public void autonomousInit() {\n }", "@Override\n public void runInit() {\n }", "public void landFromLatch() {\n }", "@Override\n public void autonomousInit() {\n }", "@Override\n public void autonomousInit() {\n }", "public void onOppoSystemReady() {\n warn(\"onOppoSystemReady\");\n }", "@Override\r\n\t\t\tpublic void onReadyChange(boolean ready) {\n\r\n\t\t\t}", "@Override\n public void autonomousInit() {\n \n }", "void imReady();", "public void init(GL2 gl) {\n\t}", "private void init() {\n\n\n\n }", "public void autonomousInit() {\n\t\t\n\t}", "public void onInitializeComplete() {\n }", "private void initDataLoader() {\n\t}", "public void initialize() {\r\n }", "@Override\r\n\tpublic void onInit(int status) {\n\t\t\r\n\t}", "public boolean initialized() {\n return true;\r\n }", "private void _init() {\n }", "public void InitLinearLV() throws Exception{\n\tcommandExec c1 = new commandExec();\n\tc1.runCommand(\"lvcreate -n LinearLV -l 50%VG /dev/TargetVG\" );\n}", "@Override\n public void init_loop() {\n smDrive.init_loop();\n smArm.init_loop();\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tGLProfile.initSingleton();\n\t\t\t\twhile (!GLProfile.isInitialized()) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}", "private void init() {\n\n\t}", "private void init() {\n }", "public void initialize() {\n\t}", "public void initialize() {\n\t}", "protected void initialize() {\n\t\tsquaredInputs = false;\n\t\t// SmartDashboard.putString(\"DB/LED 0\", \"TeleOpDrive is init\");\n\t}", "protected void initialize() {\n \tSystem.out.println(\"HoldGear STARTING!!\");\n }", "@Override\npublic void onInit(int status) {\n\t\n\t\t\t\t\t\t\t\t}", "private void initHardware(){\n }", "protected abstract void initialize();", "protected void _init(){}", "protected void initialize() { \tthePrintSystem.printWithTimestamp(getClass().getName()); \n\tthis.isDone = false;\n\t\n\ttheLoader.setSetpoint(1.5);\n\t\n }", "public void beginDL(int dlnum)\r\n\t{\r\n\r\n\t\t//if (dlnum > 0 && gl.isList(dlnum)) {\r\n\t\t//\tgl.deleteLists(dlnum, 1);\r\n\t\t//}\r\n\t\tgl.glNewList(dlnum, GL_COMPILE_AND_EXECUTE);\r\n\t}", "protected void checkInitialized() {\n \tcheckState(this.breeder!=null && this.threads!=null, \"Local state was not correctly set after being deserialized.\");\n }", "public abstract boolean init();", "public void init() {\n // TODO start asynchronous download of heavy resources\n }", "public void initialize () {\n\n }", "private void init() throws LWJGLException {\n gameLogic.init(window);\n }", "public boolean limeAvailable();", "public void autonomousInit() {\n \tNetworkCommAssembly.start();\n }", "public abstract void initialize();", "public abstract void initialize();", "public abstract void initialize();", "@Override\r\n public void initialize(List<Gdl> description) {\r\n try {\r\n \tdescription = sanitizeDistinct(description);\r\n\t\t\tpropNet = OptimizingPropNetFactory.create(description);\r\n\t\t\t//propNet.renderToFile(\"propnet.dot\");\r\n\t\t\troles = propNet.getRoles();\r\n\t\t\tinitPropnetVars();\r\n\t\t\tfor (Component c : propNet.getComponents()) {\r\n\t\t\t\tc.crystalize();\r\n\t\t\t}\r\n } catch (InterruptedException e) {\r\n throw new RuntimeException(e);\r\n }\r\n }", "protected abstract boolean init();" ]
[ "0.59829897", "0.5862426", "0.5836489", "0.58303344", "0.58303344", "0.57747763", "0.5713609", "0.5713609", "0.56896836", "0.56695676", "0.56695676", "0.5667692", "0.56576747", "0.5655243", "0.5630367", "0.55788666", "0.5569819", "0.5565842", "0.555607", "0.55503523", "0.55503523", "0.55503523", "0.55503523", "0.55503523", "0.55503523", "0.55503523", "0.55503523", "0.55503523", "0.55503523", "0.55503523", "0.55503523", "0.55503523", "0.55503523", "0.55503523", "0.55503523", "0.5547604", "0.5547604", "0.5547604", "0.55429363", "0.5519081", "0.54944414", "0.5467107", "0.5466301", "0.5465729", "0.5458491", "0.5458491", "0.54542583", "0.5452403", "0.54412264", "0.54195416", "0.5418348", "0.5407125", "0.53878355", "0.5372694", "0.53714186", "0.53644174", "0.53644174", "0.53602546", "0.5358087", "0.5350555", "0.5350555", "0.5344718", "0.53414893", "0.5336037", "0.5330925", "0.53288144", "0.5325482", "0.53237885", "0.53114676", "0.53068495", "0.53056765", "0.5291701", "0.52785814", "0.5277195", "0.52741176", "0.52738106", "0.52734435", "0.5267113", "0.52662253", "0.52602065", "0.52602065", "0.525814", "0.525632", "0.52561903", "0.5255588", "0.5255192", "0.52490693", "0.5248689", "0.52451736", "0.5243615", "0.52373743", "0.52371794", "0.5235265", "0.52258164", "0.52222174", "0.5221036", "0.5215536", "0.5215536", "0.5215536", "0.52143115", "0.5212972" ]
0.0
-1
Compare values with largest number
public static void main(String[] args) { Scanner val = new Scanner(System.in); int num1 = val.nextInt(); int num2 = val.nextInt(); int num3 = val.nextInt(); val.close(); num1 = (num2 > num1)? num2:num1; num3 = (num3 > num1)? num3:num1; System.out.println(num3); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double largestNumber(double[] a) {\n\t\tdouble max = a[0];\n\t\tdouble no = 0;\n\t\tfor (int index = 1; index < a.length; index++) {\n\t\t\tif (max > a[index] && max > a[index + 1]) {\n\t\t\t\tno = max;\n\t\t\t\tbreak;\n\t\t\t} else if (a[index] > max && a[index] > a[index + 1]) {\n\t\t\t\tno = a[index];\n\t\t\t\tbreak;\n\t\t\t} else if (a[index + 1] > max && a[index + 1] > a[index]) {\n\t\t\t\tno = a[index + 1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn no;\n\t}", "@Test\n\tpublic void testMaximumNumber() {\n\t\tdouble tmpRndVal = 0.0;\n\t\tdouble tmpRndVal2 = 0.0;\n\t\tdouble tmpResult = 0.0;\n\t\t\n\t\t//testing with negative numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = doubleRandomNegativeNumbers();\n\t\t\ttmpRndVal2 = doubleRandomNegativeNumbers();\n\t\t\ttmpResult = Math.max(tmpRndVal, tmpRndVal2);\n\t\t\tassertTrue( (tmpResult == ac.maximumNumber(tmpRndVal, tmpRndVal2))\n\t\t\t\t\t|| (0.0 == ac.maximumNumber(tmpRndVal, tmpRndVal2)) );\n\t\t}\n\t\t\n\t\t//testing with positive numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = doubleRandomPositiveNumbers();\n\t\t\ttmpRndVal2 = doubleRandomPositiveNumbers();\n\t\t\ttmpResult = Math.max(tmpRndVal, tmpRndVal2);\n\t\t\tassertTrue((tmpResult == ac.maximumNumber(tmpRndVal, tmpRndVal2))\n\t\t\t|| (0.0 == ac.maximumNumber(tmpRndVal, tmpRndVal2)) \n\t\t\t|| (-0.123456789 == ac.maximumNumber(tmpRndVal, tmpRndVal2)));\n\t\t}\n\t\t\n\t\t//testing with zero\n\t\tdouble zero = 0.0;\n\t\tdouble inpResult = 0.0;\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tinpResult = Math.max(zero, zero);\n\t\t\t//System.out.println(inpResult + \" ############\");\n\t\t\tassertTrue( (inpResult == ac.maximumNumber(zero, zero)) );\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n int[] arr={24,34,56,98,2,59};\r\n int val =arr [0];\r\n for(int i=0;i<arr.length;i++){\r\n \t if(arr[i]>val){\r\n \t\t val=arr[i];\r\n \t }\r\n }\r\n System.out.println(\"largest value\"+ val);\r\n\t}", "public static void main(String[] args) {\n\n int a = 34;\n int b = 45;\n int c = 78;\n\n if (a >= b && a >= c)\n System.out.println(a + \" is a largest number\");\n else if (b >= a && b >= c)\n System.out.println(b + \" is a largest number\");\n else\n System.out.println(c + \" is a largest number\");\n}", "public static int pointFree(double[] numbers){\n String completeString = \"\";\n String redactedString = \"\";\n int newArray[] = new int[numbers.length];\n int greatestValue=0;\n \n \n \n for (double x : numbers) {\n int currentValue;\n \n completeString = String.valueOf(x);\n redactedString = completeString.replaceAll(\"\\\\.\",\"\");\n currentValue = Integer.parseInt(redactedString);\n for (int i = 0; i < newArray.length; i++) {\n \n newArray[i]=currentValue;\n \n \n }\n greatestValue=newArray[0];\n for (int i = 0; i < newArray.length; i++) {\n if(newArray[i]>greatestValue){\n greatestValue=newArray[i];\n \n }\n \n }\n \n \n }\n return greatestValue;\n \n }", "public double biggest(ArrayList<Double> numbers) {\n\t\tif(numbers == null) {\n\t\t\treturn -1;\n\t\t} else if (numbers.size() < 3 || numbers.size() % 2 == 0) {\n\t\t\treturn -1;\n\t\t}\n\t\tdouble first = numbers.get(0);\n\t\tdouble middle = numbers.get((int) Math.floor(numbers.size() / 2));\n\t\tdouble last = numbers.get(numbers.size() -1);\n\t\tdouble maximum = (first > middle && first > last) ? first :\n\t\t(middle > last) ? middle :\n\t\tlast;\n\t\treturn maximum;\t\t// default return value to ensure compilation\n\t}", "public int determineHighestVal() {\n if (playerCards[0].value > playerCards[1].value) {\n return playerCards[0].value;\n }\n return playerCards[1].value;\n\n }", "int max() {\n\t\t// added my sort method in the beginning to sort out array\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\n\t\t\t\tif (array[j - 1] > array[j]) {\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finds the last term in the array --> if array is sorted then the last\n\t\t// term should be max\n\t\tint x = array[array.length - 1];\n\t\treturn x;\n\t}", "@Test\n\tpublic void testMaxSmallerBigger(){\n\t int min=3, mid=5, max=10, bigger=Integer.MAX_VALUE, smaller=Integer.MIN_VALUE;\n\t assertEquals( bigger, MaxDiTre.max(max, smaller, bigger) );\n\t}", "public final boolean greaterThan() {\n\n\t\tif (size > 1) {\n\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tif (secondTopMostValue > topMostValue) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private void getMaxValue(){\n maxValue = array[0];\n for(int preIndex = -1; preIndex<number; preIndex++){\n for(int sufIndex = preIndex+1; sufIndex<=number;sufIndex++){\n long maxTmp = getPrefixValue(preIndex)^getSuffixCValue(sufIndex);\n if(maxTmp>maxValue){\n maxValue = maxTmp;\n }\n }\n }\n System.out.println(maxValue);\n }", "private double getMaxNumber(ArrayList<Double> provinceValues)\n {\n Double max = 0.0;\n\n for (Double type : provinceValues)\n {\n if (type > max)\n {\n max = type;\n }\n }\n return max;\n }", "private static int[] findGreatestNumInArray(int[] array) {\r\n\t\tint maxValue = Integer.MIN_VALUE;\r\n \r\n\t\tint secondValue = Integer.MIN_VALUE;\r\n\t\t\r\n\t\tint thirdValue = Integer.MIN_VALUE;\r\n\t\t\r\n\t int[] result = new int[2];\r\n\t \r\n\t int[] result2 = new int[3];\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\t\t\tif (array[i] > maxValue) {\r\n\t\t\t\tthirdValue = secondValue;\r\n\t\t\t\tsecondValue = maxValue;\r\n\t\t\t\tmaxValue = array[i];\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if(array[i]>secondValue)\r\n\t\t\t{\r\n\t\t\t\tsecondValue = array[i];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if(array[i]>thirdValue)\r\n\t\t\t{\r\n\t\t\t\tthirdValue = array[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\tallowResult( result,maxValue,secondValue);\r\n\t\t\r\n\t\tallowResult( result2,maxValue,secondValue,thirdValue);\r\n\t\t//return maxValue;\r\n\t\treturn result2;\r\n\t}", "public static int max(int[] numbers) {\n\t\tint max = numbers[0];\n\t\tfor(int i = 0; i < numbers.length; i++) {\n\t\t\t// 7 < 4\n\t\t\tif(max < numbers[i]) {\n\t\t\t// 7\n\t\t\t\tmax = numbers[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn max;\n\t}", "public static void main(String[] args) {\nint arr[]=new int[] {10,20,36,50,30};\nint max=0,i;\nfor(i=0;i<arr.length;i++)\n{\n\tif(arr[i]>max)\n\t{\n\t\tmax=arr[i];\n\t}\n}\nSystem.out.println(max);\n\t}", "@Test\n\tpublic void testSmallerBiggerMax(){\n\t int min=3, mid=5, max=10, bigger=Integer.MAX_VALUE, smaller=Integer.MIN_VALUE;\n\t assertEquals( bigger, MaxDiTre.max(smaller, bigger, max) );\n\t}", "@Test\n\tpublic void testBiggerMaxSmaller(){\n\t int min=3, mid=5, max=10, bigger=Integer.MAX_VALUE, smaller=Integer.MIN_VALUE;\n\t assertEquals( bigger, MaxDiTre.max(bigger, max, smaller) );\n\t}", "public int best(){\n List<Integer> points = count();\n Integer max = 0;\n for (Integer p: points){\n if (p <= 21 && max < p){\n max = p;\n }\n }\n return max;\n }", "public static int findLargest(ArrayList<Integer> numbers){ \r\n\t\tint largest = numbers.get(0); \r\n\t\tfor(int s : numbers){ \r\n\t\t\tif(s > largest){ \r\n\t\t\t\tlargest = s; \r\n\t\t\t} \r\n\t\t} \r\n\t\treturn largest;\r\n\t}", "private int largestCard(Card[] cards) {\n int i;\n\n // Initialize maximum element\n int max = 0;\n\n // Traverse array elements from second and\n // compare every element with current max\n for (i = 1; i < cards.length; i++)\n if (cards[i].getDenomination() > cards[max].getDenomination())\n max = i;\n\n return max;\n }", "private int getBestGuess(double values[]){\n int maxIndex=0;\n double max=0;\n for(int i=0;i<4;i++){\n if(values[i]>max) {\n max = values[i];\n maxIndex=i;\n }\n }\n return maxIndex+1;\n }", "static double getMax(double a, double b) {\n\t\treturn (a > b) ? a : b;\n\t}", "public void biggestPalindromeNumber() {\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < palindromeNumbers.size(); i++) {\n\t\t\tfor (int j = 1; j < palindromeNumbers.size(); j++) {\n\t\t\t\tif (palindromeNumbers.get(j) > palindromeNumbers.get(i)) {\n\t\t\t\t\ttemp = palindromeNumbers.get(j);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Largest Palindrome : \" + temp);\n\t}", "public static int maxValue(int[] numArr) {\r\n\t\tint temp = numArr[0] > numArr[1] ? numArr[0] : numArr[1];\r\n\t\tfor (int i = 2; i < numArr.length; i++) {\r\n\t\t\ttemp = temp > numArr[i] ? temp : numArr[i];\r\n\t\t}\r\n\t\treturn temp;\r\n\t}", "public int getMaximun(){\n int highGrade = grades[0]; //assumi que grades[0] é a maior nota\n //faz o loop pelo array de notas\n for(int grade: grades){\n //se a nota for maior que highGrade. atribui essa nota a highGrade\n if(grade > highGrade){\n highGrade = grade; //nota mais alta\n }\n }\n \n return highGrade;\n }", "public int maxValue(List<List<Integer>> positions) {\n int value = 0;\n for (final List<Integer> values : positions) {\n final int temp = Collections.max(values).intValue();\n if (temp > value) {\n value = temp;\n }\n }\n return value;\n }", "public static void main (String[] args) {\n\n Integer a=7,b=4,c=10,d=18;\n\n if (a > b) {\n if(a > c){\n if (a >d){\n System.out.println(a+ \" is biggest\");\n }\n }\n }\n\n if (b > c) {\n if(b > d){\n if (b >a){\n System.out.println(b+ \" is biggest\");\n }\n }\n }\n\n if (c > b) {\n if(c > a){\n if (c >d){\n System.out.println(c+\" is biggest\");\n }\n }\n }\n\n if (d > b) {\n if(d > c){\n if (d >a){\n System.out.println(d+\" is biggest\");\n }\n }\n }\n }", "static int findGreatestValue(int x, int y) {\r\n\t\t\r\n\t\tif(x>y)\r\n\t\t\treturn x;\r\n\t\telse\r\n\t\t return y;\r\n\t}", "public String largestNumber(int[] nums) {\n StringBuilder ret = new StringBuilder();\n ArrayList<Integer> list = new ArrayList<>();\n for(int e: nums) list.add(e);\n\n //sort desc, a=30, b=3, 330 > 303\n Collections.sort(list, new Comparator<Integer>(){\n public int compare(Integer a, Integer b){\n return (\"\"+b+a).compareTo(\"\"+a+b);\n }\n });\n\n for(int e: list) ret.append(e);\n\n //solve corner cases, 0, 0 -> 0\n if(ret.charAt(0) == '0') return \"0\";\n\n return ret.toString();\n }", "public static int maxValue(int [] array){\n int hold = array[0];\n for(int i = 1; i < array.length; i++){\n if(array[i] > hold){\n hold = array[i];\n }\n }\n return hold;\n }", "public static boolean almost_greater(double a, double b, long maxUlps) {\n if (almost_equals(a, b, maxUlps)) {\n return false;\n }\n return a > b;\n }", "int getMax( int max );", "public static int max() {\r\n\r\n\t\tint[] arr1 = ArrayMethods.get5();\r\n\t\tint[] arr2 = ArrayMethods.get5();\r\n\r\n\t\tint sum1 = 0;\r\n\t\tint sum2 = 0;\r\n\r\n\t\tint max = 0;\r\n\r\n\t\tfor (int num : arr1) {\r\n\t\t\tsum1 += num;\r\n\t\t}\r\n\t\tfor (int num : arr2) {\r\n\t\t\tsum2 += num;\r\n\t\t}\r\n\r\n\t\tif (sum1 > sum2) {\r\n\r\n\t\t\tmax = sum1;\r\n\r\n\t\t} else if (sum1 == sum2) {\r\n\r\n\t\t\tmax = sum1;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tmax = sum2;\r\n\t\t}\r\n\t\treturn max;\r\n\t}", "public final boolean greaterThanEquals() {\n\n\t\tif (size > 1) {\n\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tif (secondTopMostValue >= topMostValue) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "int max(int a, int b);", "public static int findLargest(int[] data){\n\t\tint lo=0, hi=data.length-1;\n\t\tint mid = (lo+hi)/2;\n\t\tint N = data.length-1;\n\t\twhile (lo <= hi){\n\t\t\tint val = data[mid];\n\t\t\tif(mid == 0 ) return (val > data[mid+1]) ? mid : -1;\n\t\t\telse if(mid == N) return (val > data[mid-1]) ? mid : -1;\n\t\t\telse{\n\t\t\t\tint prev = data[mid-1];\n\t\t\t\tint next = data[mid+1];\n\t\t\t\tif(prev < val && val < next) lo=mid+1;\n\t\t\t\telse if(prev > val && val > next) hi = mid-1;\n\t\t\t\telse return mid; // prev > val && val > next // is the only other case\n\t\t\t\tmid = (lo+hi)/2;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public int theHighest() {\r\n\t\tint highest = 0;\r\n\t\tfor(int i = 0; i < rows_size; i++) {\r\n\t\t\tfor(int j = 0; j < columns_size; j++) {\r\n\t\t\t\tif(game[i][j].getValue() > highest)\r\n\t\t\t\t\thighest = game[i][j].getValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn highest;\r\n\t}", "@Test\n public void test_max_Integer_Collection3() {\n populate_i3();\n int actual = Selector.max(i3, new CompareIntegerAscending());\n int expected = 8;\n Assert.assertEquals(\"Maximum not found\", expected, actual);\n }", "static int max(int a, int b) {\n\t\treturn a > b ? a : b;\n\t}", "private boolean isGreater(BigInt rhs) {\n if (isPositive && !rhs.isPositive) {\n // rhs is negative and this is positive\n return true;\n } else if (!isPositive && rhs.isPositive) {\n // rhs is positive and this is negative\n return false;\n }\n // The numbers have the same sign\n\n if (number.size() > rhs.number.size()) {\n // This is longer than the other, so this is bigger if it positive\n return isPositive;\n } else if (number.size() < rhs.number.size()) {\n // This is shorter than the other, so the other is bigger if this positive\n return !isPositive;\n }\n\n for (int i = number.size() - 1; i >= 0; --i) {\n if (number.get(i) > rhs.number.get(i)) {\n return isPositive;\n } else if (number.get(i) < rhs.number.get(i)) {\n return !isPositive;\n }\n }\n\n return false;\n }", "@Test\n public void test4() {\n //I want find the max of 5,10,22\n int expected = 22;\n int actual = findMax(22,5,10);\n }", "E maxVal();", "private Integer maximum(Integer dataA, Integer dataB) {\n return dataA > dataB ? dataA : dataB;\n }", "@Test\n public void test_kmax_Integer_Collection3() {\n populate_i3();\n int actual = Selector.kmax(i3, 3, new CompareIntegerAscending());\n int expected = 6;\n Assert.assertEquals(\"3rd maximum not found\", expected, actual);\n }", "private int max(int a, int b) {\n return (a > b) ? a : b;\n }", "public T findHighest(){\n T highest = array[0];\n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()>highest.doubleValue())\n {\n highest = array[i];\n } \n }\n return highest;\n }", "int max(int a, int b) \n { \n return (a > b) ? a : b; \n }", "static int max(int a, int b) {\n return (a > b) ? a : b;\n }", "private int max(int a, int b) {\n\t\treturn a>b?a:b;\n\t}", "public int findMaxValue(Node root) {\n if(root == null) {\n return Integer.MIN_VALUE;\n }\n int output = (int)root.getData();\n int leftOutput = findMaxValue(root.getLeftChildNode());\n int rightOutput = findMaxValue(root.getRightChildNode());\n if(leftOutput > output){\n output = leftOutput;\n }\n if(rightOutput > output) {\n output = rightOutput;\n }\n return output;\n\n }", "public static int max(int[] mainArray) {\r\n\t\tint max1 = 0;\r\n\t\tfor(int greaterThan = 1; greaterThan < mainArray.length; greaterThan ++) {\r\n\r\n\t\t\tif(mainArray[greaterThan]>mainArray[max1]) {\r\n\t\t\t\tmax1 = greaterThan;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn max1;\r\n\t}", "@Test\n public void test7(){\n int expected = 22;\n int actual = findMax(0,22,22);\n Assert.assertEquals(expected, actual);\n }", "int max(int a, int b) {\n return (a > b) ? a : b;\n }", "@Test\n public void whenSecondIsMax() {\n Max max = new Max();\n int rsl = max.max(0, 3, -1);\n assertThat(rsl, is(3));\n }", "int getMax();", "public static int max2(double[] mainArray2) {\r\n\t\tint max2 = 0;\r\n\t\tfor(int greaterThan = 1; greaterThan < mainArray2.length; greaterThan ++) {\r\n\r\n\t\t\tif(mainArray2[greaterThan]>mainArray2[max2]) {\r\n\t\t\t\tmax2 = greaterThan;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn max2;\r\n\t}", "public static int getIndexOfMax(double[] array){\n\n int largest = 0;\n for ( int i = 1; i < array.length; i++ )\n {\n if ( array[i] > array[largest] ) largest = i;\n }\n return largest;\n\n }", "public String largestNumber(int[] nums) {\n for(int i = 0; i < nums.length; i++) {\n for(int j = 0; j < nums.length - i - 1; j++) {\n if (smallerThan(nums[j], nums[j+1])) swap(nums, j, j+1);\n }\n }\n\n String res = \"\";\n if (nums[0] == 0) return \"0\";\n for (Integer num : nums) {\n res += String.valueOf(num);\n }\n return res;\n\n }", "private static int max(int lhs, int rhs) {\r\n return lhs > rhs ? lhs : rhs;\r\n }", "public static void exampleForEach_FindMaximum(int[] numbers) {\r\n\t\tint maxSoFar = numbers[0]; \r\n \r\n // for each loop \r\n for (int num : numbers) \r\n { \r\n if (num > maxSoFar) \r\n { \r\n maxSoFar = num; \r\n } \r\n } \r\n \r\n System.out.println(\"\\nThe highest score is \" + maxSoFar);\r\n\t}", "@Test\n public void whenThirdIsMax() {\n Max max = new Max();\n int rsl = max.max(0, 1, 2);\n assertThat(rsl, is(2));\n }", "public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\nSystem.out.println(\"Please enter first number\");\nint n1=sc.nextInt();\nSystem.out.println(\"Please enter 2nd number\");\nint n2=sc.nextInt();\nSystem.out.println(\"Please enter 3rd number\");\nint n3=sc.nextInt();\n\n\nif(n1>n2 && n1>n3){\n\tSystem.out.println(\"ist number is largest\");\n}\nelse if(n2>n3 && n2>n1){\n\tSystem.out.println(\"2nd number is greatest\");\n}\n\nelse if(n3>n1 && n3>n2)\n{\n\tSystem.out.println(\"3rd is larget\");\n}else{\n\tSystem.out.println(\"none of the numbers are largest\");\n}\n\t\n\t}", "@Test\n\tpublic void testMaxMaxMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( max, MaxDiTre.max(max, max, max) );\n\t}", "public static int max(int[] a) {\n\t\tint b=a[0];\r\n\t\tfor(int i=0;i<a.length;i++) {\r\n\t\t\tif(a[i]>b) {\r\n\t\t\t\tb=a[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn b;\r\n\t}", "public int GetMaxVal();", "public double max(){\r\n\t\t//variable for max val\r\n\t\tdouble max = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the maximum is less than the current index, change max to that value\r\n\t\t\tif (max < this.data[i]){\r\n\t\t\t\tmax = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return the maximum val\r\n\t\treturn max;\r\n\t}", "public int findMaxValue(List<Integer> list) {\n int max = list.get(0);\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i) > max) {\n max = list.get(i);\n }\n }\n return max;\n }", "java.math.BigDecimal getMaximum();", "ComparableExpression<T> max();", "public boolean greaterThan(NumberP other)\n {\n \treturn OperationsCompareTo.CompareDouble(this, other) == 1;\n }", "@Test\n public void whenFirstGreaterThanSecond() {\n Max maximum = new Max();\n int result = maximum.max(2, 1);\n assertThat(result, is(2));\n }", "public int findMax() {\n\t\tint max = (int)data.get(0);\n\t\tfor (int count = 1; count < data.size(); count++)\n\t\t\tif ( (int)data.get(count) > max)\n\t\t\t\tmax = (int)data.get(count);\n\t\treturn max;\n\t}", "@Test\n\tpublic void threeValuesWhenGetMaximumReturnCorrectValue1() {\n\t\tint actualResult = Maximum.testMaximum(12, 4, 6);\n\t\tAssert.assertEquals(12, actualResult);\n\t}", "public static int max(int[] theArray) {\n\n int biggest = theArray[0];\n\n //Converts the array to a list\n List<Integer> values = Arrays.stream(theArray).boxed().collect(Collectors.toList());\n\n //get the biggest by streaming the list and using min which gets the min value by using the Integer Comparator.comparing().\n //which means it will loop through the array and compare all the values for the biggest values\n biggest= values.stream().max(Integer::compare).get();\n\n// //Alternative code does the samething\n// for (int number : theArray) {\n//\n// if (biggest < number) {\n// biggest = number;\n// }\n// }\n\n return biggest;\n\n }", "@Test\n public void test_kmax_Integer_Collection1() {\n populate_i1();\n int actual = Selector.kmax(i1, 1, new CompareIntegerAscending());\n int expected = 8;\n Assert.assertEquals(\"1st maximum not found\", expected, actual);\n }", "@Test\n\tpublic void HeapExtractMaximumtestDifferentPriorities() {\n\t\t Job jarray[]=new Job[5];\n\t\t jarray[0]=new Job(\"job1\",50,1);\n\t\t jarray[1]=new Job(\"job2\",20,2);\n\t\t jarray[2]=new Job(\"job3\",80,3);\n\t\t jarray[3]=new Job(\"job4\",20,4);\n\t\t jarray[4]=new Job(\"job5\",1,5);\n\t\t \n\t\t Job actual=PQHeap.HeapExtractMaximum(jarray);\n\t\t //System.out.println(\"\"+actual);\n\t\t//assertTrue((new Job(\"job1\",20,1)).equals(actual));\n\t\t//assertEquals(new Job(\"job1\",20,1), actual);\n\t\t assertNotEquals(new Job(\"job3\",20,1), actual);\n\t\t//fail(\"Not yet implemented\");\n\t}", "Integer getMaximumResults();", "public abstract int getMaximumValue();", "int getMaximum();", "@Test\n public void whenFirstMoreSecondAndSecondMoreThird() {\n Max maximum = new Max();\n int result = maximum.max(3, 2, 1);\n assertThat(result, is(3));\n }", "static public long max(long[] valarray) {\r\n long max = 0;\r\n for (long i : valarray) {\r\n if (i > max)\r\n max = i;\r\n }\r\n return max;\r\n }", "public static int getMaxValue(int[] numberArray)\n\t{\n\t\tint maxValue = numberArray[0];\n\t\tfor (int i = 1; i < numberArray.length; i++)\n\t\t{\n\t\t\tif (numberArray[i] > maxValue)\n\t\t\t\tmaxValue = numberArray[i];\n\t\t}\n\t\treturn maxValue;\n\t}", "public static int get_max(Integer[] a){\n int max = Integer.MIN_VALUE;\n\n for (int i = 0; i < a.length; i++){\n if (a[i] > max);\n max = a[i];\n }\n return max;\n }", "public static int secondaryArgmax(double[] a) {\n\t\tint mi = argmax(a);\n\t\t// scan left until increasing\n\t\tint i;\n\t\tfor (i=mi-1; i>=0 && a[i]<=a[i+1]; i--);\n\t\tint l = argmax(a,0,i+1);\n\t\tfor (i=mi+1; i<a.length && a[i]<=a[i-1]; i++);\n\t\tint r = argmax(a,i,a.length);\n\t\tif (l==-1) return r;\n\t\tif (r==-1) return l;\n\t\treturn a[l]>=a[r]?l:r;\n\t}", "private static int maxValue(int[] a) {\n\t\tint max_value =0;\r\n\t\tint current_max=0;\r\n\t\t\r\n\t\tfor(int i=0;i<a.length;i++)\r\n\t\t{\r\n\t\t\tcurrent_max += a[i];\r\n\t\t\tmax_value= Math.max(max_value, current_max);\r\n\t\t\tif(a[i]<0)\r\n\t\t\t\tcurrent_max=0;\r\n\t\t}\r\n\t\t\r\n\t\treturn max_value;\r\n\t}", "@Test\n\tpublic void testMaxMinMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( max, MaxDiTre.max(max, min, max) );\n\t}", "static int findHighestNumber(int [] array){\n int highestNumber = array [0];\n for (int x=0; x< array.length; x++){\n if (highestNumber<array[x]){\n highestNumber=array[x];\n }\n }\nreturn highestNumber;\n}", "public int findHighestScore() {\n int highest = 0;\n for (int i = 0; i < allQuizTakers.size(); i++) {\n\n if (allQuizTakers.get(i).getScore(0).compareTo(highest) > 0) {\n highest = (int) allQuizTakers.get(i).getScore(0);\n }\n\n }\n return highest;\n }", "public static int getMax(int[] inputArray){ \n int maxValue = inputArray[0]; \n for(int i=1;i < inputArray.length;i++){ \n if(inputArray[i] > maxValue){ \n maxValue = inputArray[i]; \n } \n } \n return maxValue; \n }", "public int getMax(){ //find the max Score\n\t\tint max = Integer.MIN_VALUE;\n\t for(int i=0; i<scoreList.size(); i++){\n\t if(scoreList.get(i) > max){\n\t max = scoreList.get(i);\n\t }\n\t }\n\t return max;\n\t}", "private int getmax(int red,int green,int blue)\r\n\t{\r\n\t\tif (red>green && red>blue)\r\n\t\t\treturn red;\r\n\t\telse\r\n\t\t\tif (green>blue)\r\n\t\t\t\treturn green;\r\n\t\t\telse\r\n\t\t\t\treturn blue;\r\n\t}", "static int max(int x, int y){\n\t\treturn (x > y)? x : y;\n\t}", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int num1, num2, num3;\n int max = 0;\n \n // if( num1 > num2){\n // max = num1;\n // } elif ()\n\n\n\n }", "@Test\n public void test_max_Integer_Collection1() {\n populate_i1();\n int actual = Selector.max(i1, new CompareIntegerAscending());\n int expected = 8;\n Assert.assertEquals(\"Maximum not found\", expected, actual);\n }", "public final void max() {\n\n\t\tif (size > 1) {\n\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tif (secondTopMostValue > topMostValue) {\n\t\t\t\tpush(secondTopMostValue);\n\t\t\t} else {\n\t\t\t\tpush(topMostValue);\n\t\t\t}\n\t\t}\n\t}", "@In Integer max();", "@In Integer max();", "@Test\n public void test6(){\n int expected = 22;\n int actual = findMax(22,22,22);\n Assert.assertEquals(expected, actual);\n }", "int max();", "public static double max(double[] prices) {\n\t\tdouble biggest = 0;\n\n\t\tfor (int i = 0; i < prices.length; i++) {\n\t\t\tif (prices[i] > biggest) {\n\t\t\t\tbiggest = prices[i];\n\t\t\t}\n\t\t}\n\n\t\treturn biggest\n\t}", "public int maxValue( int[ ] n ) {\n int max = Integer.MIN_VALUE;\n for(int each: n){\n if(each > max){\n max = each;\n }\n }\n return max;\n }" ]
[ "0.6982909", "0.6863735", "0.67158955", "0.6662198", "0.66158956", "0.6591017", "0.6567861", "0.6518906", "0.6509642", "0.65014374", "0.64639837", "0.64552444", "0.6446018", "0.64428425", "0.6419264", "0.6408566", "0.6404517", "0.63789874", "0.6353375", "0.63469666", "0.63390905", "0.6331549", "0.63210595", "0.63070434", "0.6263362", "0.6252032", "0.6248117", "0.622221", "0.62135243", "0.6210412", "0.61968845", "0.6176694", "0.6174546", "0.6172433", "0.6171821", "0.61701214", "0.6160961", "0.6156981", "0.61504865", "0.6148967", "0.6147642", "0.6145588", "0.6141837", "0.6125468", "0.61204153", "0.6110019", "0.6107658", "0.6100043", "0.6098156", "0.6086559", "0.60851353", "0.60778195", "0.6077215", "0.60655683", "0.6064366", "0.6056148", "0.6047141", "0.6042624", "0.60389394", "0.6032618", "0.60239935", "0.6023481", "0.6022903", "0.6015949", "0.60156626", "0.6013126", "0.6007183", "0.6006087", "0.6004604", "0.60022444", "0.5999378", "0.5997254", "0.5974178", "0.59740376", "0.5972182", "0.59696245", "0.5968113", "0.596395", "0.5959055", "0.59567815", "0.5953401", "0.59499013", "0.5943748", "0.5942811", "0.5939112", "0.59386134", "0.5938579", "0.5934126", "0.5931904", "0.59302515", "0.5928543", "0.5927908", "0.59275424", "0.5926573", "0.5923986", "0.59202915", "0.59202915", "0.59158176", "0.59086573", "0.59040457", "0.5901764" ]
0.0
-1
List list = new Vector(); List list = Collections.synchronizedList(new ArrayList());
public static void main(String[] args) { CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<>(); CopyOnWriteArraySet<String> set = new CopyOnWriteArraySet<>(); for (int i = 0; i < 30; i++) { new Thread(()->{ set.add(UUID.randomUUID().toString()); System.out.println(set); },String.valueOf(i)).start(); } /** * 1.故障现象 * java.util.ConcurrentModificationException * 2.导致原因 * 并发争抢修改导致 * 3.解决方案 * List<String> list = new Vector<>(); * List<String> list = Collections.synchronizedList(new ArrayList<>()); * CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<>(); * 4.优化建议 * CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<>(); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unchecked\")\n \tpublic static <T> List<T> createConcurrentList() {\n \t\treturn (List<T>) Collections.synchronizedList(createArrayList());\n \t}", "public static void main(String[] args) {\n\t\tList<Integer> list=Collections.synchronizedList(new ArrayList<>());\n\t\t\n\t\t\n\t}", "private static void concurrentList(){\n\t\tList<Object> unsafeList = new ArrayList<Object>();\n\t\tList<Object> safeList = Collections.synchronizedList(unsafeList);\n\t\t\n\t\t/*\n\t\t * Note that you must manually synchronize the returned list when iterating over it, for example:\n\t\t */\n\t\tsynchronized (safeList) {\n\t\t Iterator<Object> it = safeList.iterator();\n\t\t while (it.hasNext()) {\n\t\t System.out.println(it.next());\n\t\t }\n\t\t}\n\t}", "private static void containerListNotSafe() {\n List<String> list = new CopyOnWriteArrayList<>();\n // 开启了20个线程\n for (int i = 1; i <= 30; i++) {\n new Thread(() -> {\n list.add(UUID.randomUUID().toString().substring(0,8));\n System.out.println(Thread.currentThread().getName()+list);\n }, String.valueOf(i)).start();\n }\n\n // java.util.ConcurrentModificationException 并发修改异常\n //1.故障现象\n //\tjava.util.ConcurrentModificationException 并发修改异常\n //2.导致原因\n //\n //3.解决方案\n //\t3.1 new Vector<>();\n //\t3.2 Collections.synchronizedList(new ArrayList<>());\n //\t3.3 new CopyOnWriteArrayList<>();\n //4.优化方案\n //\n\n // 写时复制\n // CopyOnWrite,容器即写时复制的容器.往一个容器添加元素的时候,不直接往当前容器Object[]添加,而是先将当前容器Object[]进行copy,复制出\n // 一个新的容器,Object[] newElements,然后新的容器Object[] newElements里面添加元素,添加完元素之后,\n // 再将原容器的引用指向新的容器 setArray(newElements);这样做的好处是可以对CopyOnWrite容器进行并发的读,而不需要加锁,\n // 因为当前容器不会添加任何元素.所以CopyOnWrite容器也是一种读写分离的思想,\n\n // /**\n // * Appends the specified element to the end of this list.\n // *\n // * @param e element to be appended to this list\n // * @return {@code true} (as specified by {@link Collection#add})\n // */\n // public boolean add(E e) {\n // final ReentrantLock lock = this.lock;\n // lock.lock();\n // try {\n // Object[] elements = getArray();\n // int len = elements.length;\n // Object[] newElements = Arrays.copyOf(elements, len + 1);\n // newElements[len] = e;\n // setArray(newElements);\n // return true;\n // } finally {\n // lock.unlock();\n // }\n // }\n\n\n }", "public static java.util.List synchronizedList(java.util.List arg0)\n { return null; }", "public static void ArrayListTest()\n\t{\n\t\tArrayList<String> strings = new ArrayList<String>();\n\t\tString[] someStrings = new String[] { \"A\", \"B\", \"C\", \"D\" };\n\t\t\n\t\tstrings.addAll(Arrays.asList(someStrings));\n\t\t\n\t\tfor (String s : strings)\n\t\t{\n\t\t\tSystem.out.println(s);\n\t\t}\n\t\t\n\t\tSystem.out.print(strings.isEmpty());\n\t\t\n\t\tList<String> sync = Collections.synchronizedList(strings);\n\t}", "@SuppressWarnings( { \"rawtypes\", \"unchecked\" } )\n\tprotected static Vector toVector( List list )\n\t{\n\t\tVector v = new Vector( );\n\t\tfor ( Object o : list )\n\t\t{\n\t\t\tv.add( o );\n\t\t}\n\t\treturn v;\n\t}", "public MyArrayList() {\r\n\t\tthis.list=new Object[this.capacity];\r\n\t}", "static void q2(){\n\t\tArrayList<Integer>myList=new ArrayList<>();\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tList<Integer> list = new ArrayList<>();\n\t\tList<Integer> threadSafeList = Collections.synchronizedList(list);\n\t\tSet<Integer> set = new HashSet<>();\n\t\tSet<Integer> threadSafeSet = Collections.synchronizedSet(set);\n\t\tMap<Integer, String> map = new HashMap<>();\n\t\tMap<Integer, String> threadSafeMap = Collections.synchronizedMap(map);\n\t\tCollection<Integer> collection = new ArrayList<>();\n\t\tCollection<Integer> threadSafeCollection = Collections.synchronizedCollection(collection);\n\n\t}", "myArrayList() {\n\t\thead = null;\n\t\ttail = null;\n\t}", "public void vector(List<Student> list)\r\n\t{\r\n\t\tlist.add(s1);\r\n\t\tlist.add(s2);\r\n\t\tlist.add(s3);\r\n\t\tlist.add(s4);\r\n\t\tlist.add(s5);\r\n\t\tlist.add(s6);\r\n\t\tSystem.out.println(\"Objects of Vector\");\r\n\t\tEnumeration<Student> enumeration = Collections.enumeration(list);\r\n\t\twhile (enumeration.hasMoreElements()) \r\n\t\t\tSystem.out.println(enumeration.nextElement()); \r\n\t}", "public static <T> List<T> m66049a(List<T> list) {\n return Collections.unmodifiableList(new ArrayList(list));\n }", "public List() {\n this.list = new Object[MIN_CAPACITY];\n this.n = 0;\n }", "public TempList() {\n list = new ArrayList<T>();\n }", "public List()\n {\n list = new Object [10];\n }", "public SmartList() {\n size = 0;\n storage = null;\n }", "ArrayListOfStrings () {\n list = new ArrayList<String>();\n }", "public MyArrayList ()\r\n {\r\n \tlist = new Object[100];\r\n \tnumElements = 0;\r\n }", "public ArrayList() {\n elements = new Object[DEFAULT_CAPACITY];\n }", "public void setListSynchronsprecher( List<Person> listSynchronsprecher ) {\n\t\tthis.listSynchronsprecher.clear();\n\t\tthis.listSynchronsprecher.addAll( listSynchronsprecher );\n\t}", "private TransferDispatcher() {\n taskList=new Vector();\n }", "public MutiList() {\n\t\tsuper();\n\t\tthis.myList = new ArrayList<>();\n\t}", "static void synced () {\n\t\tList<Integer> linkedList = \n\t\t\t\tCollections.synchronizedList(new LinkedList<Integer>());\n\t\tfor (int i = 0; i < 100; i++) {\n\t\t\tlinkedList.add(i);\n\t\t}\n\t\t// launch a thread to add numbers 100 to 200 to the list\n\t\tnew Thread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tSystem.out.println(\"starting adding numbers\");\n\t\t\t\tfor (int i = 100; i < 200; i++) {\n\t\t\t\t\tlinkedList.add(i);\n\t\t\t\t\ttry { Thread.sleep(1);} \n\t\t\t\t\tcatch (InterruptedException e) {e.printStackTrace();}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"end\");\n\t\t\t}\n\t\t}).start();\n\n\t\t// now run an iterator to go through the linked list that is \n\t\t// synchronized with the linked list object. \n\t\tsynchronized(linkedList) {\n\t\t\tIterator<Integer> iterator = linkedList.iterator();\n\t\t\tSystem.out.println(\"starting iteration\");\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\ttry {Thread.sleep(4);} \n\t\t\t\tcatch (InterruptedException e) {e.printStackTrace();}\n\t\t\t\tSystem.out.println(iterator.next());\n\t\t\t}\t\n\t\t\tSystem.out.println(\"finished iteration\");\n\t\t}\n\t}", "public ArrayListBag() {\n\t\tlist = new ArrayList<T>();\n\t}", "private void initList() {\n\n }", "@SuppressWarnings(\"unchecked\")\r\n public void createList() {\r\n items = new int[MAX_LIST];\r\n NumItems = 0;\r\n }", "private LampManager() {\n lampList = Collections.synchronizedList( new ArrayList<Lamp>());\n }", "public static java.util.Collection synchronizedCollection(java.util.Collection arg0)\n { return null; }", "private Lists() { }", "public MyArrayList() {\n elements = new Object[DEFAULT_CAPACITY];\n }", "public static void addList() {\n\t}", "public MemberList(List members)\n/* 10: */ {\n/* 11:10 */ this.members = members;\n/* 12: */ }", "public ListHolder()\n {\n this.list = new TestList(15, false);\n }", "static /* synthetic */ List m17132a(List list) throws Exception {\n ArrayList arrayList = new ArrayList(list);\n Collections.sort(arrayList, f15631B0);\n return arrayList;\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList() {\n\t\tsize = 0;\n\t\tlist = (E[]) new Object[INIT_SIZE];\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList() {\n\t\tObject[] oList = new Object[INIT_SIZE];\n\t\tlist = (E[]) oList;\n\t\tsize = INIT_SIZE;\n\t}", "public List<New> list();", "abstract protected Object newList( int capacity );", "public static void main3(String[] args) \n\t{\n\t\tLinkedList<Integer> c = new LinkedList<>( );\n\t\tc.add(10);\n\t\tc.add(20);\n\t\tc.add(30);\t\n\t\tList<Integer> list = new ArrayList<Integer>( c );\n\t}", "a(List list) {\n super(1);\n this.$sortedList = list;\n }", "private ConstList(List<T> list) {\n this.list = list;\n }", "public Vector()\r\n {\r\n // initialise instance variables\r\n first = null;\r\n last = null;\r\n count = 0;\r\n }", "public ArrayList()\n {\n list = new int[SIZE];\n length = 0;\n }", "public void add(List<?> list) {\n list.clear();\n pool.offer(list);\n }", "@SuppressWarnings(\"unchecked\")\r\n \tpublic List() {\r\n \t\titems = (T[]) new Object[INIT_LEN];\r\n \t\tnumItems = 0;\r\n \t\tcurrentObject = 0;\r\n \t}", "public ListStack() {\n\t\tlist = new ArrayList<>();\n\t}", "@Test\n\tpublic void createListFromList() {\n\t\tList<String> list = new ArrayList<>();\n\t\tlist.add(\"AAPL\");\n\t\tlist.add(\"MSFT\");\n\n\t\t// Create a copy using constructor of ArrayList\n\t\tList<String> copy = new ArrayList<>(list);\n\n\t\tassertTrue(list.equals(copy));\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList () {\n\t\tcapacity = 10;\n\t\tsize = 0;\n\t\tlist = (E[]) new Object[capacity];\n\t}", "public WeakList() {\r\n }", "List() {\n final int ten = 10;\n list = new int[ten];\n size = 0;\n }", "public void clear(){\n\n \tlist = new ArrayList();\n\n }", "static void unSynced () {\n\t\tList<Integer> linkedList = Collections.synchronizedList(new LinkedList<Integer>());\n\n\t\t// fill it with numbers 1 to 100\n\t\tfor (int i = 0; i < 100; i++) {\n\t\t\tlinkedList.add(i);\n\t\t}\n\n\t\t// launch a thread to add 100 more numbers\n\t\tnew Thread(new Runnable () {\n\t\t\t@Override\n\t\t\tpublic void run () {\n\t\t\t\tSystem.out.println(\"starting adding numbers\");\n\t\t\t\tfor (int i = 100; i < 200; i++) {\n\t\t\t\t\tlinkedList.add(i);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"ending adding numbers\");\n\t\t\t}\n\t\t}).start();\n\n\t\t// try to iterate through the list in parallel with the numbers being added\n\t\t// interleaving occurs and the iterator throws a CME.\n\t\tIterator<Integer> iterator = linkedList.iterator();\n\t\tSystem.out.println(\"starting iteration\");\n\t\twhile (iterator.hasNext()) { \n\t\t\ttry {\n\t\t\t\tThread.sleep(4);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tSystem.out.println(iterator.next());\n\t\t}\n\t\tSystem.out.println(\"finished iteration\");\n\t}", "private static <T> List<T> singletonArrayList(@Nullable T value) {\n @SuppressWarnings(\"unchecked\")\n T[] singleArray = (T[]) new Object[1];\n singleArray[0] = value;\n return Arrays.asList(singleArray);\n }", "public static void main(String[] args) {\n\t\tList mylist = new ArrayList<>();\n\n\t}", "void doVector() {\n Vector<String> v = new Vector<>();//creating vector\n v.add( \"umesh\" );//method of Collection\n v.addElement( \"irfan\" );//method of Vector\n v.addElement( \"kumar\" );\n //traversing elements using Enumeration\n Enumeration e = v.elements(); // creates enumeration objects\n while (e.hasMoreElements()) { //\n System.out.println( e.nextElement() );\n }\n }", "protected Collection<V> newCollection() {\r\n \treturn new ArrayList<V>();\r\n }", "public ListTimer(List<Integer> list){\n\t\tsuper();\n\t\tthis.list = list;\n\t}", "public void synchronize(){ \r\n }", "public MockPersistenceProvider()\n{\n\tobjects = new Vector();\n}", "@SuppressWarnings(\"unchecked\")\n public ArrayList(ArrayList<E> lst) {\n list = (E[])new Object[lst.size()];\n capacity = lst.capacity;\n size = lst.size;\n for(int i = 0; i < size; i++) {\n list[i] = lst.list[i];\n }\n }", "public static void main(String[] args) {\n\t\tVector v1=new Vector(2,8);\n\t\tSystem.out.println(v1.capacity());\n\t\tv1.add(10);\n\t\tv1.add(20);\nv1.add(30);\n\tv1.add(40);\n\tv1.add(50);\n\tv1.add(60);\n\tv1.add(70);\n\tv1.add(80);\n\tv1.add(90);\n\t\tv1.add(10);\n\t\tv1.add(11);\n\t\tArrayList a1=new ArrayList(v1);\n\t\ta1.add(200);\n\t\tSystem.out.println(a1);\n\t\n\n\n\t}", "public static <T> List<T> getOrCreateList(List<T> list) {\n return list == null ? new ArrayList<>() : list;\n }", "public ArrayList() {\n\t\tthis.elements = new Object[5];\n\t\tthis.last = -1;\n\t}", "public List() {\n\t\tthis.head = null; \n\t}", "private List<T> getCompList(){\n\t\tList<T> l = new ArrayList<T>();\n\t\tfor(int i=0; i<list.size(); i++){\n\t\t\tif(indices[i]==1){\n\t\t\t\tl.add(list.get(i));\n\t\t\t}\n\t\t}\n\t\treturn l;\n\t}", "public ContactList()\n {\n myList = new ArrayList<>();\n }", "@SuppressWarnings(\"unchecked\")\n public ArrayList() {\n list = (E[])new Object[DEFAULT_CAP];\n capacity = 10;\n size = 0;\n }", "public Library (){\r\n\t\tthis.inverntory = new List();\r\n\t}", "public TaskList(ArrayList<Task> list) {\n this.list = list;\n }", "public static <T> ArrayList<T> createArrayList() {\n \t\treturn new ArrayList<T>();\n \t}", "List() {\n this.length = 0;\n }", "public ListReferenceBased() {\r\n\t numItems = 0; // declares numItems is 0\r\n\t head = null; // declares head is null\r\n }", "ListType createListType();", "@SuppressWarnings(\"unchecked\")\n private void initAdjList()\n {\n adjList = new ArrayList[v];\n\n for(int i = 0; i < v; i++)\n {\n adjList[i] = new ArrayList<>();\n }\n }", "testarray() {\r\n \tarrayList = new Arraylist();\t\r\n\t}", "public static <T> void genericMethod() {\n ArrayList<T> tList = new ArrayList<>();\r\n }", "@Before\n public void createSimpleList() {\n testList = new SimpleList();\n }", "void contentsSynchronized();", "public DoubledList() {\r\n front = null;\r\n size = 0;\r\n }", "public static <T> List<T> createList (T... args) {\n\tif (args == null) { return new ArrayList<T>(); };\n\treturn new ArrayList<T>(Arrays.asList(args));\n }", "public ArrayList() {\n _size = 0;\n _store = (E[]) new Object[32];\n }", "public static Vector listToVector(List<Double> list) {\n if (list.size() == 3) {\n return new Vector(list.get(0), list.get(1), list.get(2));\n }\n return new Vector(0, 0, 0);\n }", "public NumericObjectArrayList() {\r\n list = new Copiable[10];\r\n count = 0;\r\n }", "Flock() {\n boids = new ArrayList<Boid>(); // Initialize the ArrayList\n }", "Flock() {\n boids = new ArrayList<Boid>(); // Initialize the ArrayList\n }", "public UtillLinkList() {\n\t\tlist = new LinkedList<String>();\n\t}", "public static <T> List<T> createList() {\n\t\treturn Collections.emptyList();\n\t}", "public WaitList(){\n\t}", "public ListPolygone() {\n this.list = new ArrayList();\n }", "public static void init(){\n java.util.Collection<String> collection = new ArrayList<>();\n\n // List Implementation\n // use for ordered collection with duplicates\n // Items can be retrieved and inserted at specific positions (like array)\n //\n // ArrayList:\n // Grows automatically, lookup constant time, add/remove slower\n //\n // LinkedList:\n // Implements List and Queue, add/remove/access at start/end constant time\n // arbitrary index linear time, good if used like queue\n //\n // Vector:\n // Old class before ArrayList, same as ArrayList just slower but thread-safe, not really used\n //\n // Stack:\n // Add/remove from top of stack, extends Vector, not really used, instead ArrayDeque is used\n \n // Common List Methods\n // boolean add(E) | void add(int, E) | E get(int) | void remove(int) | E set(int, E)\n // int indexOf(Object) | int lastIndexOf(Object) - both return -1 if not found\n List<String> list = (List<String>) collection;\n\n // Loop through Collections\n // Old way without generic -> needs casting\n Iterator<String> iter = collection.iterator();\n while(iter.hasNext()){\n System.out.println(iter.next());\n }\n\n // Set Implementation\n // Stores in hash table using hashCode(), add/check constant time\n //\n // HashSet:\n // Groups elements inside buckets if same hashCode\n //\n // TreeSet:\n // In sorted tree structure, always in sorted order, add/check O(log n), implements NavigableSet\n // Looping through will print out in natural order\n\n // No new set methods but collection methods is different for sets (add() can return false)\n //\n // NavigableSet Interface:\n // E lower(E) - return greatest element < e, or null if no such element\n // E floor(E) - return greatest element <= e, ...\n // E ceiling(E) - return smallest element >= e, ...\n // E higher(E) - return smallest element > e, ...\n\n // Queue Implementation\n // Elements added/removed in specific order\n //\n // LinkedList:\n // Double-ended queue, implements List and Queue, not as efficient, has indexes\n //\n // ArrayDeque:\n // ‘pure’ double-ended queue, resizable array, more efficient\n\n // Common Queue Methods\n // Examine and Remove always head of queue\n // Insert always at end of queue\n //\n // Throws exception on failure\n // boolean add(E) | E element() | E remove()\n //\n // Returns special value (null) on failure\n // boolean offer(E) | E peek() | E poll();\n\n // Common ArrayDeque Methods\n // void push(E) | E pop() - throws exception when Empty\n\t\t//\t\tpop() and poll() return same values\n\t\t//\t\tpush() + pop/poll() = stack\n\t\t//\t\toffer() + pop/poll() = queue\n //\n // LinkedList like ArrayDeque\n\n // Map Implementation: (not implementing Collection)\n // Identify values by key\n //\n // HashMap:\n // Keys in hash table using hashCode(), add/retrieve constant time\n //\n // LinkedHashMap:\n // same as HashMap only with an order\n //\n // TreeMap:\n // Keys in sorted tree structure, always sorted, add/check O(log n)\n //\n // Hashtable:\n // Like Vector, old and thread-safe, newer version: HashMap\n\n // Common Map Methods, does not have Collection methods\n // void clear() | boolean isEmpty() | int size()\n //\n // V get(Object) return value mapped by key or null if none\n // V put(K, V) add or replace key/value pair, return previous value or null if none\n // V remove(Object) removes and return value mapped by key, null if none\n //\n // boolean containsKey(Object) | boolean containsValue(Object)\n // Set<K> keySet() | Collection<V> values()\n //\n // V merge(K, V, BiFunction<? super V, ? super V, ? extends V>) - BiFunction decides which value saved to key\n // If key does not exists or value == null -> new value will always be used, BiFunction not called\n // If BiFunction return null -> key will be removed from map\n\n // Sorted Type cannot contain null.\n // TreeMap no null keys, TreeSet no null values\n //\n // ArrayDeque no null values. Null values has special meaning\n // Hashtable no null values and keys. Just because. Too old.\n //\n // Else throws NullPointerException\n\n /* Searching and Sorting */\n List<Comparing> cList = new ArrayList<>();\n\n // If no Comparator specified, List type has to implement Comparable\n // else compiler error\n Collections.sort(cList);\n Collections.sort(cList, new Comparator<Comparing>() {\n public int compare(Comparing t1, Comparing t2){ return 0; }\n });\n\n // Same as sorting\n // Warning: unsorted list results in undefined values\n Collections.binarySearch(cList, new Comparing());\n Collections.binarySearch(cList, new Comparing(), new Comparator<Comparing>() {\n public int compare(Comparing t1, Comparing t2){ return 0; }\n });\n\n // Same applies to sorted collections like: TreeSet, TreeMap\n // Comparator can be passed to constructor\n Set<Comparing> tSet = new TreeSet<>(new Comparator<Comparing>() {\n public int compare(Comparing t1, Comparing t2){ return 0; }\n });\n\n // Throw ClassCastException when adding class that is not implementing Comparable\n tSet.add(new Comparing());\n }", "public <T> void makeArrayList(List<T> list) {\n\t\tList<T> list1 = new ArrayList<T>(); // now we can create the list using \"T\"\n\t\tlist1.addAll(list);\n\t}", "private void CreateStudentList() {\r\n\t\tStudentList=new ArrayList<Student>();\t\r\n}", "public static <E, C extends Collection<E>> SynchronizedMutableCollection<E> of(C collection, Object lock)\n {\n return new SynchronizedMutableCollection<E>(CollectionAdapter.adapt(collection), lock);\n }", "public MyArrayList() {\n data = new Object[10];\n }", "public interface List<T> extends Collection<T> {\n\n public void insert(T element, int index);\n public T replace(T element, int index);\n public T remove(int index);\n public T removeFirst();\n public T removeLast();\n public int indexOf(T element);\n public T get(int index);\n public T first();\n public T last();\n \n}", "public ListDA() {\n elements = new Object[CAPACITY];\n }", "public VotingSystem(){\n votingList = new ArrayList<Voting>();\n }", "@Override\n public void run() {\n super.run();\n synchronized (lock){\n if (MyList.size()!=5) {\n System.out.println(\"当MyList没有到5的时候开始等待...\"+System.currentTimeMillis());\n try {\n lock.wait();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n System.out.println(\"等待结束\"+System.currentTimeMillis());\n for (int i =0 ;i<3;i++){\n MyList.add();\n System.out.println(\"添加元素:\"+MyList.size());\n }\n }\n }\n\n\n }", "public VehicleList() {\n\t\tvehicles = new ArrayList<Vehicle>();\n\t}" ]
[ "0.7255283", "0.71889967", "0.7147631", "0.6872272", "0.653382", "0.6502858", "0.6354238", "0.6206271", "0.6106977", "0.6044963", "0.6011033", "0.595015", "0.5949338", "0.5938644", "0.5907712", "0.58640844", "0.5856065", "0.58477587", "0.5832252", "0.5735379", "0.57306033", "0.57224095", "0.5707369", "0.5707246", "0.5702781", "0.5670497", "0.5643439", "0.56274843", "0.5610261", "0.5588276", "0.5584358", "0.5551842", "0.5548932", "0.5544415", "0.55315125", "0.5529156", "0.5515066", "0.55060095", "0.5505407", "0.55010545", "0.54755265", "0.54752403", "0.547408", "0.54675364", "0.54597265", "0.54561716", "0.54553473", "0.5434374", "0.54210913", "0.54193014", "0.54155844", "0.54128253", "0.541218", "0.540968", "0.5385278", "0.53849393", "0.5376705", "0.5370215", "0.5361844", "0.5350554", "0.53378147", "0.5327225", "0.53239477", "0.53231907", "0.53196186", "0.5308515", "0.53057116", "0.5305023", "0.5290864", "0.5285808", "0.52821404", "0.5280132", "0.52790004", "0.5278592", "0.5276612", "0.5275934", "0.526402", "0.52626854", "0.5261165", "0.5249695", "0.5244821", "0.5244272", "0.5240728", "0.52316195", "0.52313775", "0.52313775", "0.521285", "0.5210796", "0.5204267", "0.5203715", "0.51966584", "0.51938593", "0.519292", "0.5191818", "0.51905346", "0.5189837", "0.5177279", "0.5168906", "0.51678264", "0.51581424" ]
0.5937854
14
boolean returnValue = true;
private synchronized void print4() { try { int jNum = 0; byte[] printText22 = new byte[10240]; byte[] oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setInternationalCharcters('3'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('4'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("FoodCiti"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('4'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("\nOrder No : " + order.getOrderNo()); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(SessionManager.get(getActivity()).getRestaurantName() + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; String location = SessionManager.get(getActivity()).getRestaurantLocation(); int spacecount = commacount(location); oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; if (spacecount >= 1) { oldText = getGbk(location.substring(0, location.indexOf(',')) + "\n" + location.substring(location.indexOf(',') + 1) + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } else { oldText = getGbk(location + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(SessionManager.get(getActivity()).getRestaurantPostalCode() + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("Tel:" + SessionManager.get(getActivity()).getRestaurantPhonenumber()); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; if (order.getOrderSpecialInstruction() != null) { oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(order.getOrderSpecialInstruction()); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(390); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(" " + "GBP" + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // Toast.makeText(getContext(),"Size "+order.getOrderedItemList().size(),Toast.LENGTH_LONG).show(); for (int i = 0; i < order.getOrderedItemList().size(); i++) { OrderedItem orderedItem = order.getOrderedItemList().get(i); oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // int qntity = Integer.parseInt(orderedItem.getQuantity()); oldText = getGbk(" " + orderedItem.getQuantity() + " x " + orderedItem.getItemData().getItemName()); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(390); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; Double total_price = Double.valueOf(orderedItem.getTotalPrice()) * Double.valueOf(orderedItem.getQuantity()); oldText = getGbk(" " + String.format(Locale.getDefault(), "%.2f", total_price) + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; for (int j = 0; j < orderedItem.getSubItemList().size(); j++) { oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(35); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; SubItem subItem = orderedItem.getSubItemList().get(j); String subitemname = subItem.getItemName(); int subItemOrderQty = Integer.parseInt(subItem.getOrderedQuantity()); if (subItemOrderQty > 1) { oldText = getGbk(" " + subItem.getOrderedQuantity() + " x " + subitemname + "\n"); } else { oldText = getGbk(" " + subitemname + "\n"); } System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // By Ravi // oldText = getGbk("........................\n"); // System.arraycopy(oldText, 0, printText22, jNum, oldText.length); // jNum += oldText.length; ////////////////////////////////////////////////////////////////////////////////////////////////////////// /** TODO * change here for print suboptions text * **/ //print text for suboptions items if (subItem.getSubOptions() != null && subItem.getSubOptions().size() > 0) { List<SubOptions> subOptions = subItem.getSubOptions(); for (int k = 0; k < subOptions.size(); k++) { SubOptions options = subOptions.get(k); oldText = getGbk(" - " + options.getName() + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } } } oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; /*oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length;*/ oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("-----------------------\n"); oldText = getGbk("........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("Subtotal : "); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(390); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(" " + String.format(" %.2f", Double.valueOf(order.getOrderSubtotal())) + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; if (Double.valueOf(order.getDiscount()) > 0) { oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("Discount : "); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(390); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(" " + String.format(" %.2f", Double.valueOf(order.getDiscount())) + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } if (Double.valueOf(order.getTax()) > 0) { oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("Service Charge : "); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(390); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; if (order.getTax() != null) { oldText = getGbk(" " + String.format(" %.2f", Double.valueOf(order.getTax())) + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } else { oldText = getGbk(" " + "0.00" + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } } if (!order.getOrderDelivery().equals(Consts.PICK_UP) && Double.valueOf(order.getDeliveryCharges()) > 0) { oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("Delivery Charges : "); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(390); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(" " + String.format(" %.2f", Double.valueOf(order.getDeliveryCharges())) + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("TOTAL Price: "); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(370); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; //Toast.makeText(getActivity(),String.valueOf(order.getOrderTotal()),Toast.LENGTH_LONG).show(); oldText = getGbk(" " + String.format(" %.2f", Double.valueOf(order.getOrderTotal()))); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; if (order.getFreenDrinkText() != null && !TextUtils.isEmpty(order.getFreenDrinkText())) { oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; String freeTxt = "Free " + order.getFreenDrinkText(); oldText = getGbk(freeTxt); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('4'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; /** TODO * change here to print payment method text * **/ //print text for payment method if (order.getOrderPaid().equalsIgnoreCase("paypal") || order.getOrderPaid().equalsIgnoreCase("worldpay")) { oldText = getGbk(order.getOrderPaid() + " PAID " + "\n"); } else { oldText = getGbk(order.getOrderPaid() + " NOT PAID " + "\n"); } // oldText = getGbk("ORDER BY " + order.getOrderPaid() + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('4'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; if (order.getOrderDelivery().equals(Consts.PICK_UP)) { oldText = getGbk("COLLECTION" + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } else { oldText = getGbk("DELIVERY" + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // String strTmp2 = new SimpleDateFormat("dd-MM-yyyy hh:mm a", Locale.UK).format(new Date()); oldText = getGbk(getDate(order.getOrderTime())); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('4'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("Customer Details: " + "\n" + order.getUser().getUserName().toUpperCase() + "\n" + order.getUser().getAddress().toUpperCase() + "\n" + order.getUser().getCity().toUpperCase() + "\n" + order.getUser().getPostalCode().toUpperCase() + "\n" + order.getUser().getPhNo().toUpperCase() ); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("Ref:"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(order.getOrderId()); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("www.foodciti.co.uk"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("\n\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; /*String s = new String(printText22); Toast.makeText(getActivity(),s,Toast.LENGTH_LONG).show();*/ oldText = CutPaper(); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; Intent intent = new Intent(PrintUtils.ACTION_PRINT_REQUEST); intent.putExtra(PrintUtils.PRINT_DATA, printText22); localBroadcastManager.sendBroadcast(intent); // mOutputStream.write(printText22); } catch (Exception ex) { Exlogger exlogger = new Exlogger(); exlogger.setErrorType("Print Error"); exlogger.setErrorMessage(ex.getMessage()); exlogger.setScreenName("OrderInfo->>print4() function"); logger.addException(exlogger); Toast.makeText(getActivity(), ex.getMessage(), Toast.LENGTH_LONG).show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean getReturn();", "public boolean get_return(){\n return local_return;\n }", "boolean doSomething() {\n\t\treturn true;\n\t}", "boolean getVarReturn();", "boolean test();", "boolean test();", "boolean test();", "boolean test() {\n return false; // REPLACE WITH SOLUTION\n }", "public boolean a()\n {\n return true;\n }", "public boolean a()\r\n {\r\n return false;\r\n }", "boolean getResult();", "boolean getResult();", "boolean getResult();", "boolean getResult();", "void setVarReturn(boolean varReturn);", "Boolean conditionResult();", "@Test\n\tpublic void test_returnBooleanFoo_true() {\n\n\t}", "@Override\n public boolean isReturn() {\n return true;\n }", "boolean pass();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "public boolean isReturning(){\n\t\treturn returning;\n\t}", "public static boolean getBooleanTrue() {\n boolean returnValue = false;\n return returnValue;\n }", "Boolean isPassed();", "boolean getIsOk();", "public boolean somethingNew();", "public boolean isReturn() {\n return (isReturn);\n }", "@Override\n\tpublic boolean javaMethodBaseWithBooleanRet() {\n\t\treturn false;\n\t}", "boolean isSuccessful();", "public boolean isSuccess();", "public boolean isSuccess();", "public boolean get_return() {\r\n return local_return;\r\n }", "boolean get();", "@Test\n\tpublic void test_returnBooleanFoo_false() {\n\t}", "public boolean b() {\n return true;\n }", "boolean mo34114a();", "public boolean b()\n {\n return false;\n }", "public boolean b()\n {\n return false;\n }", "public boolean b()\r\n {\r\n return false;\r\n }", "public boolean isReturned() {\r\n\t\treturn isReturned;\r\n\t}", "boolean getBoolean();", "boolean getBoolean();", "public void set_return(boolean param){\n \n // setting primitive attribute tracker to true\n \n if (false) {\n local_returnTracker = false;\n \n } else {\n local_returnTracker = true;\n }\n \n this.local_return=param;\n \n\n }", "boolean mo23707a();", "boolean getValue();", "boolean getSuccess();", "boolean getSuccess();", "boolean getSuccess();", "boolean getSuccess();", "public boolean ci() {\n/* 84 */ return true;\n/* */ }", "public boolean returnStatus(){\n return status;\r\n }", "boolean isAlwaysTrue();", "public boolean getResult() {\r\n\treturn result;\r\n }", "public boolean tom();", "boolean mo38970a();", "public int returnValue() {\n\t\treturn returnValue;\n\t}", "boolean mo1969a();", "public abstract boolean a();", "void boolean1(boolean a);", "public Boolean getResult() {\n return result;\n }", "public boolean result () {\n return m_result;\n }", "boolean mo1489a();", "boolean getBoolValue();", "boolean getBoolValue();", "boolean mo44967d();", "int return0() ;", "public Boolean asBoolean();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "public T returnValue();", "boolean mo202j();", "boolean booleanOf();", "public boolean c()\r\n/* 36: */ {\r\n/* 37:51 */ return false;\r\n/* 38: */ }", "BooleanValue createBooleanValue();", "BooleanValue createBooleanValue();", "BooleanValue createBooleanValue();", "BooleanValue createBooleanValue();", "public boolean getBoolean();", "public void set_return(boolean param) {\r\n\r\n // setting primitive attribute tracker to true\r\n local_returnTracker =\r\n true;\r\n\r\n this.local_return = param;\r\n\r\n\r\n }", "boolean mo44966c();", "boolean mo54442g();", "public void setSuccess(boolean success);", "boolean mo54429b();", "Boolean isInvokeSuccess();", "boolean method_109();", "private CheckBoolean() {\n\t}" ]
[ "0.7621053", "0.76199734", "0.73888505", "0.7333712", "0.7181328", "0.7181328", "0.7181328", "0.71305335", "0.708852", "0.69825774", "0.6982471", "0.6982471", "0.6982471", "0.6982471", "0.69568735", "0.6927141", "0.6872325", "0.68402606", "0.6830471", "0.68129027", "0.68129027", "0.68129027", "0.68129027", "0.68129027", "0.68129027", "0.68129027", "0.6811509", "0.68012214", "0.6796765", "0.67454827", "0.67391366", "0.6726685", "0.6708385", "0.6681172", "0.6676212", "0.6676212", "0.66567445", "0.6637709", "0.66149956", "0.66126966", "0.6611269", "0.6591928", "0.6591928", "0.6587205", "0.65674305", "0.6561264", "0.6561264", "0.6555892", "0.65449595", "0.65414983", "0.65302414", "0.65302414", "0.65302414", "0.65302414", "0.65243876", "0.65188813", "0.6484631", "0.6484097", "0.64838326", "0.6471953", "0.6449383", "0.6423356", "0.64196754", "0.6396047", "0.63952154", "0.63798475", "0.6378614", "0.63783413", "0.63783413", "0.63754815", "0.63731664", "0.6346672", "0.6344741", "0.6344741", "0.6344741", "0.6344741", "0.6344741", "0.6344741", "0.6344741", "0.6344741", "0.6344741", "0.6344741", "0.6344741", "0.6344741", "0.6344539", "0.6340437", "0.6330769", "0.62965566", "0.6285386", "0.6285386", "0.6285386", "0.6285386", "0.6278445", "0.6276203", "0.62728095", "0.62716645", "0.6254072", "0.6242452", "0.623961", "0.62360394", "0.6235856" ]
0.0
-1
A constructor that adds a reference to the parent JDA instance
LavoisierListener(JDA jda) { instance = jda; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Parent() {\n super();\n }", "Parent() {\n\t System.out.println(\"i am from Parent Class\");\n\t }", "public ReferenceDatabaseSettingsGUI(AdminJavaGUI parent) {\n initComponents();\n windowMenu(); \n parentFrame = parent;\n getParentReferenceDatabaseSettings();\n }", "Parent()\n\t{\n\t\tSystem.out.println(\"This is parent's default constructor\");\n\t}", "public Reference() {\n super();\n }", "public MessageBus(MessageBus aParent)\r\n\t{\r\n\t\tthis.parentBus = aParent;\r\n\t}", "protected Agent(final lotus.domino.Agent delegate, final org.openntf.domino.Database parent) {\n\t\tsuper(delegate, parent, NOTES_MACRO);\n\t\tinitialize(delegate);\n\n\t}", "public InteractionClass( ObjectModel model, String name, InteractionClass parent )\n\t{\n\t\tthis.model = model;\n\t\tthis.name = name;\n\t\tthis.qualifiedName = null;\n\t\tthis.handle = null;\n\t\tthis.parent = parent;\n\t\tthis.children = new HashSet<>();\n\t\tthis.parameters = new HashMap<>();\n\t\t\n\t\t// add ourselves to the parent (unless we're the root, in which case we have no parent)\n\t\tif( parent != null )\n\t\t\tparent.addChild( this );\n\t}", "public void setParent(Instance parent) {\r\n \t\tthis.parent = parent;\r\n \t}", "public NamedRuleComponent(AdminViewFrame parent, AccessManager am) {\r\n this(parent, am, null);\r\n }", "protected DBLegalityTool(DBPersistanceController parentController) {\r\n super(parentController);\r\n }", "public SerialConnection(SerialManager parent,SerialParameters parameters)\n {\n\t \tthis.parent = parent;\n\t \tthis.parameters = parameters;\n\t \topen = false;\n\t \tdataHandler = new DataHandler();\n }", "private OpenSimDB() {\n instance = this;\n }", "public DbConnection(DbConnectionBroker parent, Connection child) {\n\t\t_parent = parent;\n\t\t_child = child;\n\t}", "protected AbstractSplinePathBuilder(ScriptingContext parent) {\n\tsuper(parent);\n\tthis.parent = parent;\n }", "public ReferenceBasePUSData() {\n\t\tsuper();\n\t}", "public Closure(Closure parent){\n this.values = new HashMap<>();\n this.parent = parent;\n }", "protected Alias() {\n }", "public ACustomViewer(Composite parent, JasperReportsConfiguration jContext) {\n\t\tsuper(parent, jContext);\n\t}", "protected abstract void construct();", "d(a aVar) {\n super(0);\n this.this$0 = aVar;\n }", "Constructor() {\r\n\t\t \r\n\t }", "public ExampleComponent(Component parent) {\n super(parent);\n }", "public CommandHandler(String name, ICommand parent) {\r\n\t\tsuper(name, parent);\r\n\t\tsubCommands = new Hashtable<String, ICommand>();\r\n\t}", "public JdbTree() {\r\n this(new Object [] {});\r\n }", "protected LibReference() {\n\t}", "public QLearnAgent() {\n\t\tthis(name);\t\n\t}", "public NGATAstro()\n\t{\n\t\tsuper();\n\t\tlogger = LogManager.getLogger(this);\n\t\tinitialiseLoggerReference(logger);\n\t}", "protected Depot() {\n\t\tthis(null);\n\t}", "public TreeNode (TreeNode parent)\r\n {\r\n if (logger.isFineEnabled()) {\r\n logger.fine(\"new TreeNode parent=\" + parent);\r\n }\r\n\r\n if (parent != null) {\r\n parent.addChild(this);\r\n }\r\n }", "DelegateContainer() {\n super();\n }", "public MultaDAO() {\r\n super(MultaDAO.class);\r\n }", "public ConStructorInheritance(){\r\n\t\t\r\n\t\tSystem.out.println(\"Parent Class Constructor\");\r\n\t\t\r\n\t\t\r\n\t}", "public ModuleContext(BasicStaticContext parent)\n {\n defaultFTOptions = new MatchOptions(); // move to basic context?\n if(parent != null)\n copy(parent);\n // for dyn evaluation:\n if(parent instanceof ModuleContext)\n importedModules.add(parent);\n }", "public Dependency(final Reference reference) {\r\n\tthis(reference.getGroupId(), reference.getArtifactId(), reference.getVersion());\r\n }", "public UConnecte() {\n\t\tsuper();\n\t}", "Reference owner();", "a(c cVar) {\n super(0);\n this.this$0 = cVar;\n }", "public Climber(){\n\t\tinst = this;\n\t}", "public void setParent(Concept _parent) { parent = _parent; }", "public DoublyLink() {\n\t\t// TODO Auto-generated constructor stub\n\t}", "public DancingNode()\n {\n L=R=U=D=this;\n }", "public JdbNavTree() {\r\n super(new Object [] {});\r\n commonInit();\r\n }", "public AliasInQueue() {\n\t\tsuper();\n\t}", "public Scope(Scope parent){\r\n\t\tthis. parent = parent;\r\n\t}", "public jImageList(Controls _ctrls, long _Self) { //Add more others news \"_xxx\" params if needed!\n //super(_ctrls.activity);\n context = _ctrls.activity;\n pascalObj = _Self;\n controls = _ctrls;\n }", "protected GaConnector() {\n }", "private JadTool() { }", "protected DPlugin()\n\t{\n\t\t//Instantiate the DLogger object.\n\t\tlog \t\t = new DLogger();\n\t\t//Instantiate the DStorage object.\n\t\tstorageHandler = new DStorage();\n\t}", "public JacobObject() {\n\t\tROT.addObject(this);\n\t}", "public PackageAST(String Name, BaseAST parent) {\n\t\tthis.classes = new TreeMap<String, ClassAST>();\n\t\tthis.cus = new HashSet<CompilationUnit>();\n\t\tthis.packageName = Name;\n\t\tthis.results = new TreeMap<String, MetricResult>();\n\t\tthis.parent = parent;\n\t}", "public LinkNode(DirectoryNode parent, FileNode target, String name) {\n\t\tsuper(parent, name);\n\t\tsuper.setVirtualSourceNode(target);\n\t\t/*link = target;\n\t\tsuper.setOffset(0);\n\t\tif(link != null){\n\t\t\tsuper.setLength(link.getLength());\n\t\t\tsuper.setSourcePath(link.getSourcePath());\t\n\t\t}*/\n\t\tsuper.setOffset(0);\n\t\tif(target != null){\n\t\t\tsuper.setLength(target.getLength());\n\t\t\tsuper.setSourcePath(target.getSourcePath());\n\t\t}\n\t}", "protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {\n super(objRef);\n this.clusterId = software.amazon.jsii.Kernel.get(this, \"clusterId\", software.amazon.jsii.NativeType.forClass(java.lang.String.class));\n this.instanceType = software.amazon.jsii.Kernel.get(this, \"instanceType\", software.amazon.jsii.NativeType.forClass(java.lang.String.class));\n this.autoscalingPolicy = software.amazon.jsii.Kernel.get(this, \"autoscalingPolicy\", software.amazon.jsii.NativeType.forClass(java.lang.String.class));\n this.bidPrice = software.amazon.jsii.Kernel.get(this, \"bidPrice\", software.amazon.jsii.NativeType.forClass(java.lang.String.class));\n this.configurationsJson = software.amazon.jsii.Kernel.get(this, \"configurationsJson\", software.amazon.jsii.NativeType.forClass(java.lang.String.class));\n this.ebsConfig = software.amazon.jsii.Kernel.get(this, \"ebsConfig\", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(imports.aws.EmrInstanceGroupEbsConfig.class)));\n this.ebsOptimized = software.amazon.jsii.Kernel.get(this, \"ebsOptimized\", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));\n this.instanceCount = software.amazon.jsii.Kernel.get(this, \"instanceCount\", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));\n this.name = software.amazon.jsii.Kernel.get(this, \"name\", software.amazon.jsii.NativeType.forClass(java.lang.String.class));\n this.count = software.amazon.jsii.Kernel.get(this, \"count\", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));\n this.dependsOn = software.amazon.jsii.Kernel.get(this, \"dependsOn\", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(com.hashicorp.cdktf.ITerraformDependable.class)));\n this.lifecycle = software.amazon.jsii.Kernel.get(this, \"lifecycle\", software.amazon.jsii.NativeType.forClass(com.hashicorp.cdktf.TerraformResourceLifecycle.class));\n this.provider = software.amazon.jsii.Kernel.get(this, \"provider\", software.amazon.jsii.NativeType.forClass(com.hashicorp.cdktf.TerraformProvider.class));\n }", "c(a aVar) {\n super(0);\n this.this$0 = aVar;\n }", "private AttendantDatabase() {}", "public PlantAI(Creature creature, StuffFactory factory, PlantAI parent) {\n\t\tsuper(creature);\n\t\tthis.factory = factory;\n\t\tthis.parent = parent;\n\t\tif (parent == null)\n\t\t\tthis.children = new ArrayList<PlantAI>();\n\t\telse\n\t\t\tparent.children.add(this);\n\t}", "public _AppDomainImplementation(java.lang.Object instance) throws Throwable {\n super(instance);\n if (instance instanceof JCObject) {\n classInstance = (JCObject) instance;\n } else\n throw new Exception(\"Cannot manage object, it is not a JCObject\");\n }", "public Background(TrainingManager parent, ICommand processor) {\n this.processor = processor;\n this.parent = parent;\n }", "public FieldMetaData(MetaData parent, final String name)\r\n {\r\n super(parent, name);\r\n }", "public DerivedPartOfPerspectivesFKDAOJDBC() {\n \t\n }", "public ARecord() {\n super(A.A);\n }", "public JSONBuilder() {\n\t\tthis(null, null);\n\t}", "public void setParent(PlasticClassPool parent) \n {\n this.parent = parent;\n parent.children.add(this);\n }", "private Builder() {\n super(org.apache.gora.cascading.test.storage.TestRow.SCHEMA$);\n }", "d(b bVar) {\n super(2);\n this.this$0 = bVar;\n }", "public TCgthmaster() {\n super();\n }", "public SqlCommand(java.lang.Object instance) throws Throwable {\n super(instance);\n if (instance instanceof JCObject) {\n classInstance = (JCObject) instance;\n } else\n throw new Exception(\"Cannot manage object, it is not a JCObject\");\n }", "Reproducible newInstance();", "public RXA(Group parent, ModelClassFactory factory) {\r\n super(parent, factory);\r\n init(factory);\r\n }", "public JNDIConnector() {\n super();\n }", "public void jsConstructor(Scriptable source) {\n\t this.source = source;\n\t}", "public void constructor() {\n setEdibleAnimals();\n }", "public Datum() {\n id = idGen.incrementAndGet();\n parentDatumID = null;\n }", "public DomainKnowledge() {\r\n\t\tthis.construct(3);\r\n\t}", "public Descriptor() {\n super(ID);\n }", "private DataSourceConfig(DataSourceConfig parent, Map<String, String> conf) {\n $.copy(parent).to(this);\n init(parent.id, conf, true);\n readOnly = true;\n }", "public Environment(final Turtle turtle, final Environment parent) {\n this.turtle = turtle;\n this.parent = parent;\n }", "public DsaQ()\n\t{\n\t q = new DSAlinkedL();\n\t}", "public Aliases( ) {\n\t}", "public _cls_script_13( AutomatonInstance ta,UserAccount _ua,UserInfo _ui) {\nparent = _cls_script_12._get_cls_script_12_inst( _ua,_ui);\nthis.ta = ta;\n}", "private NfkjBasic()\n\t\t{\n\t\t\t\n\t\t}", "public JobBuilder() {\r\n job = new Job();\r\n }", "public Vbc(java.lang.Object instance) throws Throwable {\n super(instance);\n if (instance instanceof JCObject) {\n classInstance = (JCObject) instance;\n } else\n throw new Exception(\"Cannot manage object, it is not a JCObject\");\n }", "public ReferenceManager(Path base) {\n super(base);\n }", "protected void childInit()\n {\n }", "public PathwayCommonsAccessTool() {\n super(PC_NAME, PC_RESOURCEID, PC_STRUCTURE);\n try {\n this.getToolResource().setResourceURL(new URL(PC_URL));\n this.getToolResource().setResourceLogo(new URL(PC_LOGO));\n this.getToolResource().setResourceElementURL(PC_ELT_URL);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n this.getToolResource().setResourceDescription(PC_DESCRIPTION);\n }", "public OntoBridge()\r\n\t{ \r\n\t}", "public JsonDataset() {\r\n\t\tsuper();\r\n\t\tlogger.trace(\"JsonDataset() - start\");\r\n\t\tlogger.trace(\"JsonDataset() - end\");\r\n\t}", "public Resolver(Resolver parentResolver) {\n\t\tparent = parentResolver;\n\t\tstorage = new Slots();\n\t}", "public Aanbieder() {\r\n\t\t}", "public static void main(String[] args) {\n\n Parent parent = new Parent();\n parent.name=\"asdfasdfas\";\n\n Son son = new Son();\n\n\n }", "public Cross(String owner){\r\n super(owner);\r\n }", "protected TreeProcessor(TreeProcessor parent, ComponentManager manager) {\n this.parent = parent;\n\n // Copy all that can be copied from the parent\n this.enableLogging(parent.getLogger());\n this.context = parent.context;\n this.roleManager = parent.roleManager;\n this.builderSelector = parent.builderSelector;\n this.checkReload = parent.checkReload;\n this.lastModifiedDelay = parent.lastModifiedDelay;\n\n // We have our own CM\n this.manager = manager;\n }", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:49.406 -0500\", hash_original_method = \"E1D3B844E1B48DBC46153D5E5632428F\", hash_generated_method = \"E1D3B844E1B48DBC46153D5E5632428F\")\n \nvoid setParent (Context parent)\n {\n this.parent = parent;\n declarations = null;\n prefixTable = parent.prefixTable;\n uriTable = parent.uriTable;\n elementNameTable = parent.elementNameTable;\n attributeNameTable = parent.attributeNameTable;\n defaultNS = parent.defaultNS;\n declSeen = false;\n declsOK = true;\n }", "public FileDicomBaseInner() {}", "public Scope(Scope parent) {\n this();\n this.parent = parent;\n }", "public Deer(Jungle j, int r, int c, int a) \r\n\t{\r\n\t\tsuper(j,r,c,a);\r\n\t}", "public GseqFactoryImpl() {\n\t\tsuper();\n\t}", "public LinkBuilder() {\n }", "public CLIRequest(CLIRequest parent, String[] argv) {\n this.parent = parent;\n this.argv = argv;\n }" ]
[ "0.6358775", "0.6299422", "0.59706277", "0.59537953", "0.5919605", "0.581985", "0.57945395", "0.57553303", "0.57457966", "0.5745647", "0.5720582", "0.5698625", "0.56379545", "0.5595008", "0.55935496", "0.5574735", "0.55375904", "0.5523305", "0.55084", "0.5507268", "0.5505589", "0.548954", "0.5482087", "0.54779583", "0.5472571", "0.5456304", "0.544067", "0.54381365", "0.53915673", "0.5384406", "0.5378208", "0.53748024", "0.5368335", "0.5366771", "0.5363182", "0.5363104", "0.53561336", "0.5355222", "0.5354252", "0.5347222", "0.5343568", "0.53295946", "0.5329134", "0.5320221", "0.5318209", "0.5313613", "0.5312643", "0.5312574", "0.5305895", "0.5303803", "0.5284576", "0.52772737", "0.5274948", "0.5266991", "0.52665454", "0.5266469", "0.5262396", "0.5257331", "0.5250893", "0.52507955", "0.5240117", "0.5237921", "0.5236854", "0.5236508", "0.52350664", "0.5230703", "0.5228704", "0.52265465", "0.5226403", "0.52190393", "0.52097106", "0.5205271", "0.5205259", "0.5203075", "0.51987696", "0.51934046", "0.5191831", "0.5182714", "0.5180939", "0.5180381", "0.51801", "0.51785094", "0.51695275", "0.51655054", "0.5165497", "0.5153364", "0.5145686", "0.51413643", "0.5141224", "0.5140538", "0.5136389", "0.5135153", "0.51348543", "0.51314485", "0.5128932", "0.5127918", "0.5126948", "0.5125547", "0.5118943", "0.51158035" ]
0.5978528
2
Load answer data into program
private void loadData() { try { URL source = new URL(CSV_URL); URLConnection connect = source.openConnection(); BufferedReader f = new BufferedReader(new InputStreamReader(connect.getInputStream())); header = f.readLine().split(","); // Replace third header with Difficulty Rating header[3] = "Difficulty"; String line; while((line = f.readLine()) != null) { String[] row = line.split(","); // Section: 0, 1, 2, 3 for now, 3 will be WCC int problemNumber = Integer.parseInt(row[0]); int section; int year; String exam = row[1]; String answer = row[2]; if(row.length > 3) { answer += "~" + row[3]; } if(exam.matches("USNCO .*")) { exam = exam.substring(6); year = Integer.parseInt(exam.substring(1, 5)); if(exam.charAt(0) == 'N') { section = 1; } else { section = 0; } } else { year = Integer.parseInt(exam.substring(4, 8)); section = 3; } int id = year*240 + problemNumber*4 + section; data.put(id, answer); } } catch (Exception e) { // Solution given by StackOverflow: https://stackoverflow.com/questions/1149703/ StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); String sStackTrace = sw.toString().substring(0, 800); // stack trace as a string // Send error messages to me instance.retrieveUserById(CREATOR).queue( user -> user.openPrivateChannel().queue( channel -> channel.sendMessage(sStackTrace).queue())); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void readData() throws IOException {\n // as long as there are stuff left, keep reading by sets, which are\n // pairs of description + answer\n while (hasNext()) {\n counter++;\n readSet();\n }\n }", "public void readQuestion()\n\t{\n\t\tnumLines = (int)numScan.nextDouble();\n\t\tquestion = stringScan.nextLine();\n\t}", "private void loadData () {\n try {\n File f = new File(\"arpabet.txt\");\n BufferedReader br = new BufferedReader(new FileReader(f));\n vowels = new HashMap<String, String>();\n consonants = new HashMap<String, String>();\n phonemes = new ArrayList<String>();\n String[] data = new String[3];\n for (String line; (line = br.readLine()) != null; ) {\n if (line.startsWith(\";\")) {\n continue;\n }\n data = line.split(\",\");\n phonemes.add(data[0]);\n if (data[1].compareTo(\"v\") == 0) {\n vowels.put(data[0], data[2]);\n } else {\n consonants.put(data[0], data[2]);\n }\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void loadFromFile(ArrayList<Question> questionsList) {\n String tempString = \"\"; // Holds the \"identifier\" of the line\n String question = \"\"; // text containing actual question\n ArrayList<Integer> scoreList = new ArrayList<>(); // contains scores of questions\n ArrayList<String> answers = new ArrayList<>(); // contains answers of questions\n ArrayList<String> nextQuestions = new ArrayList<>(); // contains next question of current question\n int specialCase = 0; // special case of question\n boolean backExists = false; // boolean indicating if back button does(n't) exist\n Question tempQuestion; // temporary question which is later added to the list\n\n // Attempt to open a the question_data file and read its contents\n try {\n InputStream in = getClass().getResourceAsStream(\"question_data\");\n Scanner sc = new Scanner(in);\n\n while (sc.hasNextLine()) {\n tempString = sc.nextLine();\n if (tempString.equals(\"\")) {\n continue;\n }\n\n switch (tempString.charAt(0)) {\n case '#':\n // Anything beginning with '#' is ignored.\n break;\n case 'Q':\n // 'Q' indicated the text of the question\n question = tempString.substring(3);\n break;\n case 'A':\n // 'A' indicates an answer\n answers.add(tempString.substring(3));\n break;\n case 'B':\n // 'B' indicates if a back button exists or not\n backExists = Boolean.parseBoolean(tempString.substring(3));\n break;\n case 'N':\n // 'N' indicates the next question of every answer\n nextQuestions.add(tempString.substring(3));\n break;\n case 'S':\n // 'S' indicates the score of every answer, can be set to -1 if no score is needed\n scoreList.add(Integer.parseInt(tempString.substring(3)));\n break;\n case 'C':\n // Special case. Every special case (number other than 0) has to be accounted for...\n specialCase = Integer.parseInt(tempString.substring(3));\n break;\n case 'T':\n // 'T' stands for terminate and create. A 'T' should be placed at the end of a\n // question and all of its answers. This indicated the creation of the question.\n\n // Create new question, set its answer, reset all lists, etc.\n tempQuestion = new Question(question, backExists);\n tempQuestion.setSpecialCase(specialCase);\n for (int i = 0; i < answers.size(); i++) {\n tempQuestion\n .addAnswer(answers.get(i), nextQuestions.get(i), scoreList.get(i));\n tempQuestion.setBackAvailable(backExists);\n }\n questionsList.add(tempQuestion);\n answers.clear();\n scoreList.clear();\n nextQuestions.clear();\n specialCase = 0;\n break;\n default:\n break;\n }\n\n }\n } catch (Exception e){\n System.out.println(System.getProperty(\"user.dir\"));\n System.out.println(\"An error occurred while parsing the file, make sure the file exists.\"\n + \"and/or has the correct filename (question_data)\");\n\n }\n }", "private void loadQuestions() throws IOException, FileNotFoundException {\n \t\tquestions = new ArrayList<>();\n \n \t\tBufferedReader br = new BufferedReader(new FileReader(\"QuestionBank.txt\"));\n \n \t\tString question;\n \t\tString[] choices = new String[4];\n \t\tint correctIndex = 0;\n \n \t\tquestion = br.readLine();\n \t\twhile (question != null) {\n \t\t\tfor (byte i = 0; i < 4; ++i) {\n \t\t\t\tchoices[i] = br.readLine();\n \t\t\t\t// -- marks the right answer\n \t\t\t\tif (choices[i].indexOf(\"--\") != -1) {\n \t\t\t\t\tcorrectIndex = i;\n \t\t\t\t}\n \t\t\t}\n \n \t\t\tquestions.add(new Question(question, choices, correctIndex));\n \t\t\tquestion = br.readLine();\n \t\t}\n \t\tbr.close();\n \t}", "void loadData();", "void loadData();", "public void setAnsweredQuestions() {\n\t\tFile file = new File(\"data/answered_questions\");\n\t\tif(!file.exists()) {\n\t\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/answered_questions\");\n\n\t\t\tString answeredQuestions = \"\";\n\t\t\tfor (int i = 0;i<5;i++) {\n\t\t\t\tansweredQuestions = answeredQuestions + \" \" + String.valueOf(_answeredQuestions[i]);\n\t\t\t}\n\t\t\tBashCmdUtil.bashCmdNoOutput(String.format(\"echo \\\"%s\\\" >> data/answered_questions\", answeredQuestions));\n\n\t\t}\n\t\tScanner myReader;\n\t\ttry {\n\t\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/answered_questions\");\n\t\t\tmyReader = new Scanner(file);\n\t\t\twhile(myReader.hasNextLine()) {\n\t\t\t\tString fileLine = myReader.nextLine();\n\t\t\t\tString[] splitFileLine = fileLine.trim().split(\" \");\n\t\t\t\tfor (int i=0; i<5; i++) {\n\t\t\t\t\t_answeredQuestions[i] = Integer.parseInt(splitFileLine[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tmyReader.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "interface Data {\r\n //DataReader.class.getProtectionDomain().getCodeSource().getLocation().getPath() + \"resources/data/\r\n String PATH = \"src/resources/\";\r\n String DATA = PATH + \"data/data.txt\";\r\n int DESCRIPTION_dl = 0;\r\n int TOTAL_QUESTIONS_dl = 1;\r\n int CURRENT_INDEX_dl = 2;\r\n int QUESTIONS_dl = 3;\r\n int POWERS_dl = 4;\r\n int FULLSCREEN_dl = 5;\r\n\r\n static String get(int index){\r\n try{\r\n File dataFile = new File(DATA);\r\n Scanner S = new Scanner(dataFile);\r\n int counter = 0;\r\n while(S.hasNextLine()){\r\n String data = S.nextLine();\r\n if(counter == index){\r\n return data;\r\n }\r\n counter++;\r\n }\r\n S.close();\r\n }catch (FileNotFoundException e){\r\n JOptionPane.showMessageDialog(null, \"ERROR v.1.1 Can't Find data Data File\");\r\n System.out.println(\"An Error Occured.\");\r\n e.printStackTrace();\r\n }\r\n return null;\r\n }\r\n static int strip(String str){\r\n\r\n return Integer.parseInt(str.replaceAll(\"[^0-9]\", \"\"));\r\n }\r\n static int[] strip(String[] str){\r\n int[] array = new int[str.length];\r\n\r\n for (int i = 0; i < str.length; i++) {\r\n// array[i] = Integer.parseInt(str[i].replaceAll(\"[^0-9]\", \"\"));\r\n array[i] = Integer.parseInt(str[i]);\r\n }\r\n return array;\r\n }\r\n static void replace(int index, String str) {\r\n try{\r\n File dataFile = new File(DATA);\r\n Scanner S = new Scanner(dataFile);\r\n ArrayList<String> allLines = new ArrayList<>();\r\n int counter = 0;\r\n while(S.hasNextLine()){\r\n if(counter == index){\r\n allLines.add(str);\r\n S.nextLine();\r\n }else{\r\n allLines.add(S.nextLine());\r\n }\r\n counter++;\r\n }\r\n S.close();\r\n FileWriter dataFileNew = new FileWriter(DATA);\r\n for(String i: allLines){\r\n dataFileNew.write(i + \"\\n\");\r\n }\r\n dataFileNew.close();\r\n }catch (FileNotFoundException e){\r\n System.out.println(\"We can't find the file.\");\r\n e.printStackTrace();\r\n }catch(IOException e){\r\n System.out.println(\"There was an error\");\r\n e.printStackTrace();\r\n }\r\n }\r\n\r\n}", "String askForData();", "public void getData() {\n\t\tfileIO.importRewards();\n\t\tfileIO.getPrefs();\n\t}", "public void loadQuestion() {\r\n\r\n //getting the number of the question stored in variable r\r\n //making sure that a question is not loaded up if the count exceeds the number of total questions\r\n if(count <NUMBER_OF_QUESTIONS) {\r\n int r = numberHolder.get(count);\r\n //creating object that will access the QuestionStore class and retrieve values and passing the value of the random question number to the class\r\n QuestionStore qs = new QuestionStore(r);\r\n //calling methods in order to fill up question text and mutliple choices and load the answer\r\n qs.storeQuestions();\r\n qs.storeChoices();\r\n qs.storeAnswers();\r\n //setting the question and multiple choices\r\n\r\n q.setText(qs.getQuestion());\r\n c1.setText(qs.getChoice1());\r\n c2.setText(qs.getChoice2());\r\n c3.setText(qs.getChoice3());\r\n answer = qs.getAnswer();\r\n }\r\n else{\r\n endGame();\r\n }\r\n\r\n\r\n\r\n\r\n }", "public static void main(){\n \n \n String question = \"There are 10 types of people in this world, those who understand binary and those who don't.\";\n String answer = \"true\";\n \n Question tfQuest = new Question (question, answer);\n tfQuest.getAnswer();\n \n }", "public static void main(String[] args) {\n //Milestone 2\n //create a scanner for reading user input and a random number\n //generator with Config.SEED as the seed\n Scanner sc = new Scanner( System.in );\n Random rdm = new Random( Config.SEED );\n\n \n\n\n //Milestone 3\n //How the program starts depends on the command-line arguments.\n // Command-line arguments can be names of therapists for example:\n // Eliza Joe Laura\n // If no command-line arguments then the therapists name is Eliza\n // and this reads a file with that name and the Config.RESPONSE_FILE_EXTENSION.\n // Example filename: Eliza.rsp\n // If only one command-line argument, then read the responses from \n // the corresponding file with Config.RESPONSE_FILE_EXTENSION. \n // If there is more than one command-line argument then offer them\n // as a list of people to talk with. For the three therapists above the prompt is\n // \"Would you like to speak with Eliza, Joe, or Laura?\"\n // When a user types a name then read the responses from the file which\n // is the selected name and Config.RESPONSE_FILE_EXTENSION extension.\n // Whatever name the user types has the extension appended and\n // is read using loadResponseTable. If loadResponseTable can't load\n // the file then it will report an error.\n String tName = \"Eliza\";\n String usrRes = \"\";\n ArrayList<String> rsp = new ArrayList<String>();\n String r = \"\";\n if( args.length > 0 )\n {\n\t\t\tr = \"Would you like to speak with\";\n\t\t\tfor( int i = 0 ; i < args.length - 1 ; i++ )\n\t\t\t\tr = r + \" \" + args[i] +\",\";\n\t\t\tr = r + \" or \" + args[args.length-1] + \"?\"; \n\t\t\tSystem.out.println( r );\n\t\t\trsp.add( r );\n\t\t\tr = \"\";\n\t\t\t\n\t\t\tusrRes = sc.nextLine();\n\t\t\trsp.add(usrRes);\n\t\t\ttName = usrRes;\n\t\t}\n\t\t\n\t\t\n\t\tString fName = tName + Config.RESPONSE_FILE_EXTENSION;\n\t\t//System.out.println( tName );\n\t\tArrayList<ArrayList<String>> rspTable = loadResponseTable( fName );\n\n\n //Milestone 2\n //name prompt\n \n r = \"Hi I'm \" + tName + \", what is your name?\";\n System.out.println( r );\n rsp.add( r );\n r = \"\";\n\t\tusrRes = sc.nextLine();\n\t\trsp.add(usrRes);\n\t\t\n String usrName = usrRes;\n \n //Milestone 2\n //welcome prompt\n\t\t\n\t\tr = \"Nice to meet you \" + usrName + \". What is on your mind?\";\n\t\tSystem.out.println( r );\n\t\trsp.add( r );\n\t\tr = \"\";\n \n \n //Milestone 2\n //begin conversation loop\n\t\twhile( true )\n\t\t{\n //Milestone 2\n //obtain user input\n\t\t\tusrRes = sc.nextLine();\n\t\t\trsp.add( usrRes );\n\t\t\t//System.out.println( usrRes );\n\t\t\t\n //Milestone 2\n //prepareInput\n String[] prepedUsrRes = prepareInput(usrRes);\n\n //Milestone 3\n //if no quit words then prepareResponse\n \n \n\n\n //Milestone 2\n //end loop if quit word\n \n /*\n\t\t\tfor( String str : prepedUsrRes )\n\t\t\t\tSystem.out.println( str ); \n ArrayList<String> temp = separatePhrases( usrRes );\n System.out.println( temp.get(0) );\n for( String str : temp )\n\t\t\t\tSystem.out.println( str );\n\t\t\t\t* */\n\t\t\t\n\n if( foundQuitWord( separatePhrases( usrRes ) ) )\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tr = prepareResponse( prepedUsrRes , rdm , rspTable );\n rsp.add( r );\n System.out.println( r );\n r = \"\";\n\t\t}\n\n\n //Milestone 2\n //ending prompt\n r = \"Goodbye \" + usrName + \".\";\n System.out.println( r );\n rsp.add( r );\n r = \"\";\n\n \n //Milestone 3\n //Save all conversation (user and system responses) starting\n //with this program saying \"Hi I'm...\" and concludes with\n //\"Goodbye <name>.\".\n //Always prompt the user to see if they would like to save a \n //record of the conversation. If the user enters a y or Y as the \n //first non-whitespace character then prompt for filename and save, \n //otherwise don't save dialog. After successfully saving a dialog \n //print the message \"Thanks again for talking! Our conversation is saved in: <filename>\".\n //If saveDialog throws an IOException then catch it, print out the error:\n // \"Unable to save conversation to: \" <name of file> \n //Repeat the code prompting the user if they want to save the dialog.\n\t\tSystem.out.println( \"Would you like to save a copy of this dialog? [y/n]\" );\n\t\tusrRes = sc.nextLine();\n\t\tboolean done = false;\n\t\twhile( !done )\n\t\t{\n\t\t\tif ( usrRes.charAt(0) == 'Y' || usrRes.charAt(0) == 'y' )\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tsaveDialog( rsp , tName + \"_dialog.txt\" );\n\t\t\t\t\tdone = true;\n\t\t\t\t}\n\t\t\t\tcatch( IOException e )\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println( \"Unable to save conversation to: <\" + tName + \"_dialog.txt>. Would you like to try again?[y/n]\" );\n\t\t\t\t\tusrRes = sc.nextLine();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t \n }", "public static void loadProgramData() {\n\r\n try {\r\n File f = new File(\"DetailsOfVaccination.txt.txt\"); //Accessing the file\r\n Scanner read = new Scanner(f);\r\n while (read.hasNextLine()) { //Print data in the file line by line\r\n String data = read.nextLine();\r\n System.out.println(data);\r\n }\r\n read.close();\r\n }\r\n catch (FileNotFoundException e) { //Runs if there was an error\r\n System.out.println(\"An error occurred while reading data from the file.\");\r\n e.printStackTrace();\r\n }\r\n }", "public void initializeAnswer(){\n\t\ttry{Element root = new XmlReader().parse(Gdx.files.internal(xmlFile));\n\t\tElement artist = root.getChildByName(formatName(game.getArtist()));\n\t\tElement quesNum = artist.getChildByName(Integer.toString(game.getQuestion()));\n\t\tArray<Element> answerCA = quesNum.getChildrenByName(\"Correct\");\n\t\tSystem.out.println(\"The size of the correct array is \" + answerCA.size);\n\t\tfor (int i = 0; i <answerCA.size; i++){\n\t\t\tcorrectA.add(answerCA.get(i).getText());\n\t\t}\n\t\t}\n\t\tcatch(IOException e){\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n\n File file = new File(\"8ball.txt\");\n Scanner eightBall = new Scanner(file); //Scanner data created to read from file\n\n ArrayList<String> resps = new ArrayList<>(); //ArrayList created to hold entries\n\n //entries read and stored\n while(eightBall.hasNext()){\n resps.add(eightBall.nextLine());\n }\n\n Scanner kbd = new Scanner(System.in); //Scanner kbd created to read input from user\n\n Magic8Ball disp; //holds reference to a Magic8Ball object\n String userEntry; //hold user's entry\n\n do {\n System.out.println(\"Enter a yes or no question:\");\n kbd.nextLine();\n disp = new Magic8Ball(resps);\n System.out.println(disp.getResp());\n System.out.println(\"Enter quit to stop asking questions or enter any other phrase to continue doing so:\");\n userEntry = kbd.nextLine();\n }while(!(userEntry.equals(\"quit\")));\n\n }", "private void loadData() {\n\t\tlogger.trace(\"loadData() is called\");\n\t\t\n\t\ttry {\n\t\t\tFileInputStream fileIn = new FileInputStream(\"server-info.dat\");\n\t\t\tObjectInputStream in = new ObjectInputStream(fileIn);\n\t\t\tjokeFile = (String ) in.readObject();\n\t\t\tkkServerPort = (int) in.readObject();\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\tjokeFile = \"kk-jokes.txt\";\n\t\t\tkkServerPort = 5555;\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.err.println(\"server-info.dat file is likely missing but it should be created automatically when this app is closed.\");\n\t\t\tlogger.info(\"server-info.dat file is likely missing but it should be created automatically when this app is closed.\");\n\t\t}\t\n\t}", "@Override\n public void demonstrate() throws IOException {\n try (var consoleInput = new Scanner(System.in);\n var out = new DataOutputStream(new FileOutputStream(\"employeeBinary.dat\"))) {\n Employee staff[] = readData(consoleInput, PromptUser.Yes);\n writeData(staff, out);\n } \n catch(Exception e) {\n \n }\n \n // retrieve all records into a new array\n try\n {\n Employee[] staff = readEmployees();\n printEmployees(staff);\n }\n catch (Exception e) {\n \n }\n }", "public static void main(String args[])\n{\n\n\n ArrayList al = adventLibrary.readData(\"day9.txt\");\n long data1[] = adventLibrary.longArray1CSV( al );\n\n System.out.print( \"part 1: \" );\n IntComputer amp1 = new IntComputer( data1 );\n amp1.process();\n //amp1.dataDump();\n\n}", "public List<Answer> loadAnswers() {\r\n\t\tScanner scanner = null;\r\n\t\ttry {\r\n\t\t\t// Creating scanner that reads the questions.txt file.\r\n\t\t\tscanner = new Scanner(new File(\"javaAnswers.txt\"));\r\n\t\t\t// Loop that goes over the file and adding each line as a string element to the\r\n\t\t\t// list. The result is full list with the questions.\r\n\t\t\twhile (scanner.hasNextLine()) {\r\n\t\t\t\tAnswer a = new Answer();\r\n\t\t\t\ta.setPossibleAnswer(scanner.nextLine());\r\n\t\t\t\tpossibleAnswers.add(a);\r\n\t\t\t}\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// Closing the scanner.\r\n\t\tfinally {\r\n\t\t\tscanner.close();\r\n\t\t}\r\n\t\treturn possibleAnswers;\r\n\t}", "public static void main(String[] args) throws IOException\r\n\t{\n\t\tReadData readdataobj = new ReadData();\r\n\t\treaddataobj.readData();\r\n\t}", "@Override\n\tpublic ArrayList<Question> loadQuestions() {\n\n\t\tArrayList<Question> questionArray = new ArrayList<Question>();\n\t\ttry {\n\t\t\tFileInputStream fileInputStream = context\n\t\t\t\t\t.openFileInput(QUESTION_BANK);\n\t\t\tInputStreamReader inputStreamReader = new InputStreamReader(\n\t\t\t\t\tfileInputStream);\n\t\t\tType listType = new TypeToken<ArrayList<Question>>() {\n\t\t\t}.getType();\n\t\t\tGsonBuilder builder = new GsonBuilder();\n\n\t\t\t// Gson does not serialize/deserialize dates with milisecond\n\t\t\t// precision unless specified\n\t\t\tGson gson = builder.setDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\")\n\t\t\t\t\t.create();\n\t\t\tbuilder.serializeNulls(); // Show fields with null values\n\n\t\t\tArrayList<Question> list = gson.fromJson(inputStreamReader,\n\t\t\t\t\tlistType);\n\t\t\tquestionArray = list;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn questionArray;\n\t}", "public static void main(String[] args) throws IOException{\n\t\tInputStreamReader asker = new InputStreamReader(System.in);\n\t\tBufferedReader br = new BufferedReader(asker);\n\t\t\n\t\t/**System.out.println(\"Would you prefer to type in data or give the \"\n\t\t\t\t+ \"name of a file holding the data? (Please use either data or file as your answer)\");\n\t\t\n\t\tString input = br.readLine();\n\t\tdouble [] number = new double [input.length()];\n\t\t\n\t\tif (input.equals(\"data\")){\n\t\t\tSystem.out.println(\"Please enter a series of numbers separated by a space: \");\n\t\t\tString numberEntry = br.readLine();\n\t\t\tnumberEntry = numberEntry.replaceAll(\"\\\\s\",\"\");\n\t\t\tfor(int i = 0; i<numberEntry.length(); i++)\n\t\t\t\tnumber[i]=Double.parseDouble(numberEntry.substring(i,i+1));\n\t\t\t}\n\t\t\n\t\tif (input.equals(\"file\")){\n\t\t\tSystem.out.println(\"Please enter the name of the file to be read from: \");\n\t\t\tString fileToBeReadFrom = br.readLine();\n\t\t\tFileReader fr = new FileReader(fileToBeReadFrom);\n\t\t\tSystem.out.println(\"Please enter the name of the new file you would like to write the analysis data to:\");\n\t\t\tString newFile = br.readLine();\n\t\t\tFileOutputStream fos = new FileOutputStream(newFile);\n\t\t\tPrintWriter pw = new PrintWriter(fos, true);\n\t\t}*/\n\t\t\t\n\t\tSystem.out.println(\"Would you prefer to type in data or give the \"\n\t\t+ \"name of a file holding the data? (Please use either data or file as your answer)\");\n\n\t\tString input = br.readLine();\n\t\tString numberEntry = \"\";\n\t\tdouble [] number = new double [input.length()];\n\n\t\tif (input.equals(\"data\")){\n\t\t\tSystem.out.println(\"Please enter a series of numbers separated by a space: \");\n\t\t\tnumberEntry = br.readLine();\n\t\t\tnumberEntry = numberEntry.replaceAll(\"\\\\s\",\"\");\n\t\t\tfor(int i = 0; i<numberEntry.length(); i++)\n\t\t\t\tnumber[i]=Double.parseDouble(numberEntry.substring(i,i+1));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < number.length; i++){\n\t\t\tSystem.out.println(number[i]);\n\t\t}\n\t\tbr.close();\n\n\t}", "public static void main(String[] args) {\r\n\t\tSolver m = new Solver();\r\n\t\t\r\n\r\n\r\n\t\ttry {\r\n\t\t\tm.readData(\"data/Test_case_1.in\");\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\r\n\t\tint answer = m.solve(\"data/Test_case_1.in\");\r\n\r\n\t\tSystem.out.println(answer);\r\n\t\t\r\n\r\n\r\n\t}", "private void loadTimingInformation()\n\t{\n\t\ttry\n\t\t{\n\t\t\tFile loadFile = new File(\"asdasda.save\");\n\t\t\tif(loadFile.exists())\n\t\t\t{\n\t\t\t\tqueryList.clear();\n\t\t\t\tScanner textScanner = new Scanner(loadFile);\n\t\t\t\twhile(textScanner.hasNext())\n\t\t\t\t{\n\t\t\t\t\tString query = textScanner.nextLine();\n\t\t\t\t\tlong queryTime = Long.parseLong(textScanner.nextLine());\n\t\t\t\t\tqueryList.add(new QueryInfo(query, queryTime));\n\t\t\t\t}\n\t\t\t\ttextScanner.close();\n\t\t\t\tJOptionPane.showMessageDialog(getAppFrame(), queryList.size() + \" QueryInfo objects were loaded into the application\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(getAppFrame(), \"File not present. No QueryInfo objects loaded\");\n\t\t\t}\n\t\t}\n\t\tcatch(IOException currentError)\n\t\t{\n\t\t\tdataController.displayErrors(currentError);\n\t\t}\n\t}", "public static void Load() {\n System.out.println(\"LOADED DATA:\");\n try {\n File object = new File(\"Output.txt\");\n Scanner reader = new Scanner(object);\n while (reader.hasNextLine()) {\n String info = reader.nextLine();\n System.out.println(info);\n }\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"An error occurred\");\n e.printStackTrace();\n }\n System.out.println(\"|--------------------------------------------------------------| \");\n\n }", "void loadExperiment();", "void readInput() {\n\t\ttry {\n\t\t\tBufferedReader input = new BufferedReader(new InputStreamReader(System.in));\n\t\t\t\n\t\t\tString line = input.readLine();\n\t\t\tString [] numbers = line.split(\" \");\n\n\t\t\tlenA = Integer.parseInt(numbers[0]);\n\t\t\tlenB = Integer.parseInt(numbers[1]); \n\n\t\t\twordA = input.readLine().toLowerCase(); \n\t\t\twordB = input.readLine().toLowerCase();\n\n\t\t\tg = Integer.parseInt(input.readLine());\n\n\t\t\tString key; \n\t\t\tString [] chars;\n\t\t\tpenaltyMap = new HashMap<String, Integer>();\n\n\t\t\tfor(int i=0;i<676;i++) {\n\t\t\t\tline = input.readLine();\n\t\t\t\tchars = line.split(\" \");\n\t\t\t\tkey = chars[0] + \" \" + chars[1];\n\t\t\t\tpenaltyMap.put(key, Integer.parseInt(chars[2]));\n\n\t\t\t}\n\n\t\t\tinput.close();\n\n\t\t} catch (IOException io) {\n\t\t\tio.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) {\n HashMap<Integer,String> questions = new HashMap<Integer, String>();\n try\n// reading file\n {\n int count = 0;\n File quiz = new File(\"quizzer.txt\");\n Scanner reader = new Scanner(quiz);\n while (reader.hasNextLine())\n {\n questions.put(count,reader.nextLine());\n count++;\n }\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n//asking user for their name\n System.out.println(\"Enter Your name.\");\n String userName = scan.nextLine();\n// generating questions to ask\n int[] questionsToAsk = randomQuestionCollection(5,questions.size()-1);\n int score = 0;\n for(int i=0; i<questionsToAsk.length;i++) {\n String[] splitQuestion = questions.get(questionsToAsk[i]).split(\",\");\n if (askQuestion(splitQuestion) == 1) {\n System.out.println(\"Correct\");\n score++;\n }\n }\n// printing score\n System.out.println(userName+ \" you correctly answered \"+score + \"questions\");\n }", "static void backtocheckpoint1() {\n System.out.println(\"You came back to the main entrance of challenge 1...Are you ready to restart this challenge?\");\n strings = responses.nextLine();\n Door1challenge();\n }", "public void run() {\n\t\t\tString clientMessage;\n\t\t\twhile(true)\n\t\t\t{\n\t\t\t\ttry {\n\t\t\t\t\t// Read instruction\n\t\t\t\t\tclientMessage = reader.readLine();\n\t\t\t\t\taddText(clientMessage + \": \");\n\t\t\t\t\t\n\t\t\t\t\t// User input \n\t\t\t\t\tif(clientMessage.equals(\"User input\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tuserInput2 = reader.readLine();\n\t\t\t\t\t\taddText(userInput2);\n\t\t\t\t\t\t// Check whether all UserInput match\n\t\t\t\t if(!userInput2.equals(\"No word\"))// user must input\n\t\t\t\t {\n\t\t\t\t \tanswer.add(userInput2);// Add to answer pool\n\t\t\t\t \tif(answer.size() >= connectionPool.size())// All user has inputed, Check answer\n\t\t\t\t \t{\n\t\t\t\t \t\tboolean same = true;\n\t\t\t\t \t\tString s = answer.get(0);\n\t\t\t\t \t\tfor(String i : answer)\n\t\t\t\t \t\t{\n\t\t\t\t \t\t\tif(!s.equals(i))\n\t\t\t\t \t\t\t{\n\t\t\t\t \t\t\t\tsame = false;\n\t\t\t\t \t\t\t\tbreak;\n\t\t\t\t \t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t \t\t// If all same , than correct\n\t\t\t\t \t\tif(same)\n\t\t\t\t \t\t\tcorrect(true);\n\t\t\t\t \t\telse\n\t\t\t\t \t\t\tcorrect(false);\n\t\t\t\t \t\t// Clear answer pool\n\t\t\t\t \t\tanswer.clear();\n\t\t\t\t \t}\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public static void main(String[] args) {\n\t \t\n GestionQuestion question = new GestionQuestion();\t \n String[] tab;\n int alea = question.getRdmNumber(); \n \n Scanner sc = new Scanner(System.in);\n \n \n System.out.println(question.getQuestion());\n System.out.println(\"Duo Carre Hexa\");\n String str = sc.nextLine();\n// while(str.equals(\"Duo\") || str.compareTo(\"Carre\")!=0 || str.compareTo(\"Hexa\")!=0){\n// \tstr = sc.nextLine();\n// \tSystem.out.println(\"Vous avez tapé :\" + str);\n// \tSystem.out.println(\"Duo Carre Hexa\");\n// }\n \n if(str.compareTo(\"Duo\")==0){\n \tSystem.out.println(question.getQuestion());\n \ttab=question.getAleaObjectQuestion(alea).duo();\n \t\n }else if(str.compareTo(\"Carre\")==0){\n \tSystem.out.println(question.getQuestion());\n \ttab=question.getAleaObjectQuestion(alea).carre();\n }else{\n \tSystem.out.println(question.getQuestion());\n \ttab=question.getAleaObjectQuestion(alea).hexa();\n }\n for(int i=0; i<tab.length;i++){\n \tSystem.out.println(tab[i]);\n }\n int nb = sc.nextInt();\n String[] tabReponse;\n tabReponse = question.getAleaObjectQuestion(alea).getQuestionReponse();\n \n if(question.getAleaObjectQuestion(alea).bonneReponse(tabReponse[nb])){\n \tSystem.out.println(\"Bravo !\");\n }\n else{\n \tSystem.out.println(\"Faux !\");\n }\n\t}", "public void loadData() {\n if (this.model != null) {\n\n this.dataLayout.setVisibility(View.VISIBLE);\n this.emptyText.setVisibility(View.GONE);\n\n\n if (this.model.getSolution() != null) {\n this.solutionView.setText(this.model.getSolution());\n }\n if (this.model.getArguments() != null) {\n this.argumentsView.setText(this.model.getArguments());\n }\n if (this.model.getQuestion() != null) {\n this.questionView.setText(\n String.valueOf(this.model.getQuestion().getId()));\n }\n } else {\n this.dataLayout.setVisibility(View.GONE);\n this.emptyText.setVisibility(View.VISIBLE);\n }\n }", "public static void main(String[] args) throws IOException {\n\n\n QuizModel quiz = new QuizModel();\n QuizView quizView = new QuizView();\n QuizController quizMasterController = new QuizController(quiz,quizView);\n //quizMasterController.viewMessage();\n //quizMasterController.getQuiz();\n //quizView.loginPage();\n quiz.generateQuestion();\n\n quiz.uploadFiles();\n QuizRepository quizRepository1 = new QuizRepository();\n quizRepository1.getQuizFile();\n }", "public void loadData ( ) {\n\t\tinvokeSafe ( \"loadData\" );\n\t}", "private void loadHelpContent() {\n\t\tGson gson = new GsonBuilder().setPrettyPrinting().create();\n\t\tBufferedReader br;\n\t\ttry {\n\t\t\tbr = new BufferedReader(\n\t\t\t\t\tnew UnicodeReader(new FileInputStream(new File(getHelpContentFilePath())), \"UTF-8\"));\n\t\t\tsx3ConfigurationHelp = gson.fromJson(br, SX3ConfiguartionHelp.class);\n\t\t\tSX3Manager.getInstance().setSx3ConfiguartionHelp(sx3ConfigurationHelp);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tsx3ConfigurationHelp = new SX3ConfiguartionHelp();\n\t\t\tSX3Manager.getInstance().addLog(\"<span style='color:red;'>\" + e.getMessage() + \".</span><br>\");\n\n\t\t}\n\t}", "private void getParameters() {\r\n\t\ttry {\r\n\t\t\tp_encoding = \"ISO-8859-1\";\r\n\t\t\tp_page_encoding = \"utf-8\";\r\n\t\t\tp_labels_data_file = \"resources/units/labels.txt\";\r\n\t\t\tp_multiplier_data_file = \"resources/units/muldata.txt\";\r\n\t\t\tp_category_data_file = \"resources/units/catdata.txt\";\r\n\t\t\tp_unit_data_file = \"resources/units/unitdata.txt\";\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treadDataFile(0, p_multiplier_data_file); //read data from external text file\r\n\t\treadDataFile(1, p_category_data_file); //read data from external text file\r\n\t\treadDataFile(2, p_unit_data_file); //read data from external text file\r\n\t\treadDataFile(3, p_labels_data_file); //read data from external text file\r\n\t}", "public void initializeQuestion(){\n\t\ttry{Element root = new XmlReader().parse(Gdx.files.internal(xmlFile));\n\t\tElement artist = root.getChildByName(formatName(game.getArtist()));\n\t\tElement quesNum = artist.getChildByName(Integer.toString(game.getQuestion()));\n\t\tElement question = quesNum.getChildByName(\"Question\");\n\t\tques = question.getText();\n\t\t}\n\t\tcatch(IOException e){\n\t\t}\n\t}", "protected abstract void loadData();", "private void initData() {\n Resources resources = context.getResources();\n settingTitles = resources.getStringArray(R.array.setting_array);\n selectAccent = resources.getStringArray(R.array.accent_array);\n selectAccentDisplay = resources.getStringArray(R.array.accent_display_array);\n selectSpeaker = resources.getStringArray(R.array.speaker_array);\n selectSpeakerDisplay = resources.getStringArray(R.array.speaker_display_array);\n\n positive = resources.getString(R.string.positive);\n negative = resources.getString(R.string.negative);\n answerUnKnown = resources.getString(R.string.unknown);\n answerCalling = resources.getString(R.string.calling);\n answerOpen = resources.getString(R.string.opening);\n answerFound = resources.getString(R.string.founded);\n answerNotFound = resources.getString(R.string.not_found);\n\n String systemLanguage = Util.getSystemLanguage(context).toLowerCase();\n if (systemLanguage.equalsIgnoreCase(\"zh_cn\")) {\n isEnglishEnvironment = false;\n }\n }", "private void readQuizData(InputStream is) {\n // array to read in file lines\n List<String> lines = new ArrayList<>();\n\n // read file lines in\n try {\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));\n String line;\n\n while ((line = bufferedReader.readLine()) != null){\n lines.add(line);\n }\n\n bufferedReader.close();\n is.close();\n } catch (Exception e){\n // log an error if fails\n Log.e(\"QUIZ_DATA_READING\", \"Failed while trying to read in text file.\");\n }\n\n // shuffle lines so terms are in different order\n Collections.shuffle(lines);\n\n // read terms into hashmap and ArrayList by splitting on colons\n for (String line : lines){\n String termAndDef[] = line.split(\":\");\n quizList.add(termAndDef);\n quizMap.put(termAndDef[0], termAndDef[1]);\n }\n }", "public static void main(final String[] args) {\n // instantiate this Quiz\n Quiz q = new Quiz();\n // code to read the test cases input file\n Scanner s = new Scanner(System.in);\n // check if there is one more line to process\n while (s.hasNext()) {\n // read the line\n String line = s.nextLine();\n // split the line using space\n String[] tokens = line.split(\" \");\n // based on the list operation\n // invoke the\n // corresponding method\n switch (tokens[0]) {\n case \"LOAD_QUESTIONS\":\n System.out.println(\"|----------------|\");\n System.out.println(\"| Load Questions |\");\n System.out.println(\n \"|----------------|\");\n loadQuestions(s, q,\n Integer.parseInt(tokens[1]));\n break;\n case \"START_QUIZ\":\n System.out.println(\"|------------|\");\n System.out.println(\"| Start Quiz |\");\n System.out.println(\"|------------|\");\n startQuiz(s, q, Integer.parseInt(tokens[1]));\n break;\n case \"SCORE_REPORT\":\n System.out.println(\"|--------------|\");\n System.out.println(\"| Score Report |\");\n System.out.println(\"|--------------|\");\n displayScore(q);\n break;\n default:\n break;\n }\n }\n }", "public void answer(Properties answers) {\n/* 56 */ setAnswer(answers);\n/* 57 */ QuestionParser.parseManageAllianceQuestion(this);\n/* */ }", "public void populateListFromFile() \n\t{\n\t\tBufferedReader bufferedReader = null;\n\t\tallQuestions = new ArrayList<ArrayList<String>>();\n\t\tquestionAndAnswers = new ArrayList<String>();\n\n\t\ttry {\n\t\t bufferedReader = new BufferedReader(new FileReader(\"questions.txt\"));\n\t\t String line = \"\";\n\t\t \n\t\t while ((line = bufferedReader.readLine()) != null) \n\t\t {\t\t\t \t\n\t\t \tif(line.length() > 0)\n\t\t \t\tquestionAndAnswers.add(line);\n\t\t \telse if (line.length() == 0)\n\t\t \t{\n\t\t \t\tallQuestions.add(questionAndAnswers);\n\t\t \t\tquestionAndAnswers = new ArrayList<String>();\n\t\t \t}\n\t\t } \n\t\t} catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t}\n\t}", "void singleModeLoading( File dataPath, File resultsPath, int scenarioNumber );", "public Main(String[] lines) {\n System.out.print(loadInput(lines));\n }", "protected void loadData()\n {\n }", "public static void main(String[] args) throws IOException, SQLException {\n\t\treadFile rf = new readFile();\n\t\trf.create();\n\t\trf.readData();\n\t\t//String sql = \"select * from examSelect\";\n\t\t//rf.select(sql);\n//\t\trf.test();\n\t\t//rf.readItem();\n\t}", "public List<String> loadCorrectAnswers() {\r\n\t\tScanner scanner = null;\r\n\t\ttry {\r\n\t\t\t// Creating scanner that reads the questions.txt file.\r\n\t\t\tscanner = new Scanner(new File(\"javaCorrectAnswers.txt\"));\r\n\t\t\t// Loop that goes over the file and adding each line as a string element to the\r\n\t\t\t// list. The result is full list with the questions.\r\n\t\t\twhile (scanner.hasNextLine()) {\r\n\r\n\t\t\t\tcorrectAnswers.add(scanner.nextLine());\r\n\t\t\t}\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// Closing the scanner.\r\n\t\tfinally {\r\n\t\t\tscanner.close();\r\n\t\t}\r\n\t\treturn correctAnswers;\r\n\t}", "private void loadText() {\n\t\ttext1 = app.loadStrings(\"./data/imports/TXT 1.txt\");\n\t\ttext2 = app.loadStrings(\"./data/imports/TXT 2.txt\");\n\t}", "private void readData() {\n // set the values from the stored data\n // initially these are not set, so we need to query for \"containsKey\"...\n if (isTrue(Variable.MAXTRACKS_ENABLED)) {\n jsMaxTracks.setEnabled(true);\n jcbMaxTracks.setSelected(true);\n } else {\n jsMaxTracks.setEnabled(false);\n jcbMaxTracks.setSelected(false);\n }\n if (data.containsKey(Variable.MAXTRACKS)) {\n jsMaxTracks.setValue((Integer) data.get(Variable.MAXTRACKS));\n }\n if (isTrue(Variable.MAXSIZE_ENABLED)) {\n jsMaxSize.setEnabled(true);\n jcbMaxSize.setSelected(true);\n } else {\n jsMaxSize.setEnabled(false);\n jcbMaxSize.setSelected(false);\n }\n if (data.containsKey(Variable.MAXSIZE)) {\n jsMaxSize.setValue((Integer) data.get(Variable.MAXSIZE));\n }\n if (isTrue(Variable.MAXLENGTH_ENABLED)) {\n jsMaxLength.setEnabled(true);\n jcbMaxLength.setSelected(true);\n } else {\n jsMaxLength.setEnabled(false);\n jcbMaxLength.setSelected(false);\n }\n if (data.containsKey(Variable.MAXLENGTH)) {\n jsMaxLength.setValue((Integer) data.get(Variable.MAXLENGTH));\n }\n if (isTrue(Variable.ONE_MEDIA_ENABLED)) {\n jcbMedia.setEnabled(true);\n jcbOneMedia.setSelected(true);\n jcbConvertMedia.setEnabled(true);\n } else {\n jcbMedia.setEnabled(false);\n jcbOneMedia.setSelected(false);\n jcbConvertMedia.setEnabled(false);\n }\n // Check if pacpl can be used, do it every time the dialog starts as the\n // user might have installed it by now\n boolean bPACPLAvailable = UtilPrepareParty.checkPACPL((String) data\n .get(Variable.CONVERT_COMMAND));\n if (!bPACPLAvailable) {\n // disable media conversion if pacpl is not found\n jcbConvertMedia.setEnabled(false);\n }\n // don't set Convert to on from data if PACPL became unavailable\n if (isTrue(Variable.CONVERT_MEDIA) && bPACPLAvailable) {\n jcbConvertMedia.setSelected(true);\n } else {\n jcbConvertMedia.setSelected(false);\n }\n if (data.containsKey(Variable.ONE_MEDIA)) {\n jcbMedia.setSelectedItem(data.get(Variable.ONE_MEDIA));\n } else {\n // default to MP3 initially\n jcbMedia.setSelectedItem(\"mp3\");\n }\n if (data.containsKey(Variable.RATING_LEVEL)) {\n jsRatingLevel.setValue((Integer) data.get(Variable.RATING_LEVEL));\n }\n if (isTrue(Variable.NORMALIZE_FILENAME)) {\n jcbNormalizeFilename.setSelected(true);\n } else {\n jcbNormalizeFilename.setSelected(false);\n }\n }", "static void take_the_input() throws IOException{\n\t\tSystem.out.print(\"ENTER THE ADDRESS : \");\n\n\t\taddress = hexa_to_deci(scan.readLine());\n\t\tSystem.out.println();\n\n\t\twhile(true){\n\t\t\tprint_the_address(address);\n\t\t\tString instruction = scan.readLine();\n\t\t\tint label_size = check_for_label(instruction);\n\t\t\tinstruction = instruction.substring(label_size);\n\t\t\tmemory.put(address, instruction);\n\t\t\tif(stop_instruction(instruction))\n\t\t\t\tbreak;\n\t\t\taddress+=size_of_code(instruction);\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"DO YOU WANT TO ENTER ANY FURTHUR CODE (Y/N) : \");\n\t\tString choice = scan.readLine();\n\t\tSystem.out.println();\n\t\tif(choice.equals(\"Y\"))\n\t\t\ttake_the_input();\n\t}", "public void makeData() {\n\t\tFile file = null;\r\n try {\r\n if (!m.getDataFolder().exists()) { //Check if the directory of the plugin exists...\r\n \tm.getDataFolder().mkdirs(); //If not making one.\r\n }\r\n file = new File(m.getDataFolder(), \"data.yml\"); // Defining file to data.yml NOTE: This file has to be also in your Project, even if it's empty.\r\n if (!file.exists()) { //Check if it exists\r\n \tm.getLogger().info(\"data.yml not found, creating!\"); //Log that it is creating\r\n \tm.saveResource(\"data.yml\", true); //Saving the resource, This is all by Java done no Spigot noeeded. \r\n } else {\r\n \tm.getLogger().info(\"data.yml found, loading!\"); //If it is already there, load it.\r\n \t//TODO: Loading...\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();//If something returned a NPE or something it will print a stacktrace...\r\n }\r\n\t}", "public abstract void loadData();", "public abstract void loadData();", "public static void main(String[] args) throws IOException {\n\t\tBufferedReader bin = new BufferedReader(\n\t\t\t\tnew InputStreamReader(System.in));\n\t\tCompleteGraph l = new CompleteGraph();\n\t\tl.readData(bin);\n\t\tl.calculate();\n\t\tl.printRes();\n\t}", "public static HashMap<String, GoldQuery> loadQueriesAnswers(String queries) throws IOException {\n\t\t\n\t\t/* determine answers file based on input file */\n\t\t\n\t\tString answers = null;\n\t\t\n\t\tif (queries.contains(\"train_queries_2009\")) answers = queriesPath+\"train_results_2009.tab\";\n\t\telse if (queries.contains(\"train_queries_2010\")) answers = queriesPath+\"train_results_2010.tab\";\n\t\telse if (queries.contains(\"train_queries_2011\")) answers = queriesPath+\"train_results_2011.tab\";\n\t\telse if (queries.contains(\"test_queries_2009\")) answers = queriesPath+\"test_results_2009.tab\";\n\t\telse if (queries.contains(\"test_queries_2010\")) answers = queriesPath+\"test_results_2010.tab\";\n\t\telse if (queries.contains(\"test_queries_2011\")) answers = queriesPath+\"test_results_2011.tab\";\n\t\t\n\t\tSystem.out.println(\"Loading queries answers from: \" + answers);\n\t\t\n\t\tBufferedReader input;\n\t\tHashMap<String, GoldQuery> queriesAnswers = new HashMap<String, GoldQuery>();\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tinput = new BufferedReader(new FileReader(answers));\n\t\t\tString line = null;\n\t\t \n\t\t\twhile (( line = input.readLine()) != null){\t\t\t\t\n\t\t\t\tString[] contents = line.split(\"\\t\");\n\t\t\t\tGoldQuery gold = new GoldQuery(contents[0], contents[1], contents[2]);\n\t\t\t\tqueriesAnswers.put(contents[0], gold);\n\t\t\t}\n\t\t\t\n\t\t} catch (FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\treturn queriesAnswers;\t\t\n\t}", "public static void main(String[] args) {\n\t\tfileName = args[0];\n\t\t//set up file name for the data:\n\t\ttry {\n\t\t\treader = new Scanner(new File(args[1]));\n\t\t\t\n\t\t\t//create a new program, then parse, print, and execute:\n\t\t\tProgram p = new Program();\n\t\t\tp.parse();\n\t\t\tp.print();\n\t\t\tSystem.out.println(\"---PROGRAM OUTPUT---\");\n\t\t\tp.execute();\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"ERROR reading data file \" + args[1]);\n\t\t\te.printStackTrace();\n\t\t} finally{\n\t\t\treader.close();\n\t\t}\n\t}", "public static void main(String[] args) {\n try {\n readHouseTxt();\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n\n\n\n }", "public DataParser() throws IOException {\n cem = loadCEM();\n summits = readSummitsFrom(new File(\"alps.txt\"));\n }", "public void load(JFrame anAppFrame)\n {\n if (TRACE)\n System.out.println(\"DataGenModel: load options file\");\n\n // get file for model update\n String inputFn = getInputFilename(anAppFrame);\n if (inputFn.length() == 0)\n return;\n\n // do model update\n if (readData(inputFn) == false)\n {\n JOptionPane.showMessageDialog(\n anAppFrame,\n \"Error opening selected options file.\",\n \"Notice\",\n JOptionPane.INFORMATION_MESSAGE,\n null);\n }\n }", "public void reload() {\n FileConfiguration config = plugin.getConfig();\n\n // Set up answers\n answers = new HashMap<>();\n if(config.contains(\"answers\")) {\n Map<String, Object> answersConfig = config.getConfigurationSection(\"answers\").getValues(true);\n for (Map.Entry<String, Object> entry : answersConfig.entrySet()) {\n if(entry.getValue() instanceof String) {\n answers.put(entry.getKey(), (String) entry.getValue());\n } else {\n logger.info(\"Invalid value for answer ID \" + entry.getKey());\n }\n }\n } else {\n logger.info(\"The config does not have answers! Not even for your existence!\");\n }\n\n // Set up questions\n questions = new HashMap<>();\n if(config.contains(\"questions\")) {\n Map<String, Object> questionsConfig = config.getConfigurationSection(\"questions\").getValues(true);\n for (Map.Entry<String, Object> entry : questionsConfig.entrySet()) {\n String answerID = \"\";\n if(entry.getValue() instanceof Integer) {\n answerID = entry.getValue().toString();\n } else if(entry.getValue() instanceof String) {\n answerID = (String) entry.getValue();\n } else if(answerID.isEmpty()) {\n logger.info(\"Invalid value for question regex \" + entry.getKey());\n continue;\n }\n\n if(questions.containsKey(entry.getKey()) && !answers.containsKey(answerID)) {\n logger.warning(\"Answer ID \" + entry.getValue() + \" not found\");\n } else {\n questions.put(entry.getKey(), answerID);\n }\n }\n\n logger.info(\"Registered \" + questions.size() + \" questions\");\n } else {\n logger.info(\"The config does not have questions!\");\n }\n\n commands = new HashMap<>();\n if(config.contains(\"listen-commands\")) {\n Map<String, Object> cmdsConfig = config.getConfigurationSection(\"listen-commands\").getValues(false);\n for (Map.Entry<String, Object> entry : cmdsConfig.entrySet()) {\n String cmdName = entry.getKey().toLowerCase();\n if(commands.containsKey(cmdName)) continue;\n\n CommandConfig newCmd = new CommandConfig(cmdName);\n ConfigurationSection ms = config.getConfigurationSection(\"listen-commands\").getConfigurationSection(cmdName);\n if(ms == null) continue;\n\n if(ms.contains(\"cancel\")) newCmd.cancel = ms.getBoolean(\"cancel\");\n if(ms.contains(\"tell-staff\")) newCmd.tellStaff = ms.getBoolean(\"tell-staff\");\n if(ms.contains(\"args-offset\")) newCmd.offset = ms.getInt(\"args-offset\");\n commands.put(cmdName, newCmd);\n logger.info(\"Listening to command '\" + cmdName + \"'\");\n }\n }\n }", "public void quiz() {\n\t\t\t\t\tcorrectans = 0;\n\t\t\t\t\tint k = 0;\n\t\t\t\t\tint j = 0;\n\t\t\t\t\tint M = 0;\n\t\t\t\t\tj = readDifficulty();\n\t\t\t\t\tM = readProblemType();\n\t\t\t\t\t//ask the student to solve 10 different problems, as determined by the problem type\n\t\t\t for(int i = 0; i < 10; i++ ) {\n\t\t\t \t//contain two numbers sampled from a uniform random distribution with bounds determined by the problem difficulty\n\t\t\t \tint x = rand.nextInt(j); \n\t\t\t\t int y = rand.nextInt(j);\n\t\t\t\t int O = askquestion(j, M,x,y);\n\t\t\t\t if(M == 4) {\n\t\t\t\t \t float floatans = readdivision();\n\t\t\t\t \tk = divisionsol(floatans, x, y);\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t int userin = readResponse();\n\t\t\t k = isnanswercorrect(O , userin);\n\t\t\t }\n\t\t\t if(k == 1) {\n\t\t\t \t correctans++;\n\t\t\t }\n\t\t\t }\n\t\t\t int L = 0;\n\t\t\t L = displayCompletionMessage(correctans);\n\t\t\t if ( L == 1) {\n\t\t\t \tquiz();\n\t\t\t }\n\t\t\t else {\n\t\t\t \treturn;\n\t\t\t }\n\t\t\t \n\t\t\t\t}", "public List<Question> loadQuestions() {\r\n\t\tScanner scanner = null;\r\n\t\ttry {\r\n\t\t\t// Creating scanner that reads the questions.txt file.\r\n\t\t\tscanner = new Scanner(new File(\"javaQuestions.txt\"));\r\n\t\t\t// Loop that goes over the file and adding each line as a string element to the\r\n\t\t\t// list. The result is full list with the questions.\r\n\t\t\twhile (scanner.hasNextLine()) {\r\n\t\t\t\tQuestion q = new Question();\r\n\t\t\t\tq.setQuestion(scanner.nextLine());\r\n\t\t\t\tquestions.add(q);\r\n\t\t\t}\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// Closing the scanner.\r\n\t\tfinally {\r\n\t\t\tscanner.close();\r\n\t\t}\r\n\t\treturn questions;\r\n\t}", "private void reloadData() {\n if (DataFile == null)\n DataFile = new File(dataFolder, DATAFILENAME);\n Data = YamlConfiguration.loadConfiguration(DataFile);\n }", "public void initializeQuestionArray(){\n\t\tFile file = new File (\"Questions.txt\");\n\t\tquestions.clear();\n\t\ttry {\n //\n // Create a new Scanner object which will read the data \n // from the file passed in. To check if there are more \n // line to read from it we check by calling the \n // scanner.hasNextLine() method. We then read line one \n // by one till all line is read.\n //\n Scanner scanner = new Scanner(file);\n while (scanner.hasNextLine()) {\n Question q = new Question(scanner.nextLine(), scanner.nextLine());\n\t\t\t\tquestions.add(q);\n\t\t\t\t\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\t}", "public static void main(String[] args){\r\n try {\r\n AnalizadorSintactico asin = new AnalizadorSintactico(\r\n new AnalizadorLexico( new FileReader(args[0])));\r\n Object result = asin.parse().value;\r\n System.out.println(\"\\n*** Resultados finales ***\");\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "public static void main(String args[])\n {\n try (DataOutputStream dout = new DataOutputStream(new FileOutputStream(\"Test.data\")))\n {\n dout.writeDouble(98.6);\n dout.writeInt(42);\n dout.writeBoolean(true);\n } catch(FileNotFoundException exc){\n System.out.println(\"Error: File not found Exception - \" + exc);\n return;\n } catch(IOException exc){\n System.out.println(\"I/O exception - \" + exc);\n }\n\n //now read the data back\n try (DataInputStream din = new DataInputStream(new FileInputStream(\"Test.data\")))\n {\n double d = din.readDouble();\n int i = din.readInt();\n boolean b = din.readBoolean();\n\n System.out.println(\"here are the values: \" + d + \", \" + i + \", \" + b);\n } catch (FileNotFoundException exc) {\n System.out.println(\"Error: read error, file not found - \" + exc);\n return;\n } catch(IOException exc) {\n System.out.println(\"Error: I/O readfile - \" + exc);\n }\n }", "public static void readfile() {\r\n\t\t// read input file\r\n\t\ttry {\r\n\t\t File inputObj = new File(\"input.txt\");\r\n\t\t Scanner inputReader = new Scanner(inputObj);\r\n\t\t int i = 0;\r\n\t\t while (inputReader.hasNextLine()) {\r\n\t\t String str = inputReader.nextLine();\r\n\t\t str = str.trim();\r\n\t\t if(i == 0) {\r\n\t\t \tnumQ = Integer.parseInt(str);\r\n\t\t \torign_queries = new String[numQ];\r\n\t\t \t//queries = new ArrayList<ArrayList<String>>();\r\n\t\t }\r\n\t\t else if(i == numQ + 1) {\r\n\t\t \tnumKB = Integer.parseInt(str);\r\n\t\t \torign_sentences = new String[numKB];\r\n\t\t \t//sentences = new ArrayList<ArrayList<String>>();\r\n\t\t }\r\n\t\t else if(0 < i && i< numQ + 1) {\t\r\n\t\t \torign_queries[i-1] = str;\r\n\t\t \t//queries.add(toCNF(str));\r\n\t\t }\r\n\t\t else {\r\n\t\t \torign_sentences[i-2-numQ] = str;\r\n\t\t \t//sentences.add(toCNF(str));\r\n\t\t }\t\t \r\n\t\t i++;\r\n\t\t }\r\n\t\t inputReader.close();\r\n\t\t } catch (FileNotFoundException e) {\r\n\t\t System.out.println(\"An error occurred when opening the input file.\");\r\n\t\t }\r\n\t}", "private void extractDataFromBundle() {\n Intent intent = getIntent();\n Bundle bundle = intent.getBundleExtra(MainActivity.PRACTICE_GAME_BUNDLE_KEY);\n\n mDifficulty = (Difficulty) bundle.getSerializable(MainActivity.DIFFICULTY_KEY);\n mPlayerGamePiece = (GamePiece) bundle.getSerializable(MainActivity.GAME_PIECE_KEY);\n\n }", "public void initData() {\n\t\tnotes = new ArrayList<>();\n\t\t//place to read notes e.g from file\n\t}", "public static void main (String args[]){\n SplData();\n }", "public static void main (String[] args) throws IOException {\n File inFile = new File(\"/Users/kbye10/Documents/CS 250 test files/sample1.data\");\r\n FileInputStream inStream = new FileInputStream(inFile);\r\n\r\n //set up an array to read data in\r\n int fileSize = (int)inFile.length();\r\n byte[] byteArray = new byte[fileSize];\r\n\r\n //read data in and display them\r\n inStream.read(byteArray);\r\n for (int i = 0; i < fileSize; i++) {\r\n System.out.println(byteArray[i]);\r\n }\r\n\r\n inStream.close();\r\n }", "public abstract String promptSelectionFromAnswers(final String question, final List<String> answers) throws JVMIOException;", "private void parseData() {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t \n\t\tString name ;\n\t\tint kor , eng , mat ;\n\t\tint tot ;\n\t\tdouble avg ;\n\t\tboolean gender ; \t\t\n\t\t//\n\t\tString fileName = \"학생성적.dat\";\n\t\ttry (\n\t\t\t\tFileInputStream in = new FileInputStream(fileName);\n\t\t\t\tDataInputStream dis = new DataInputStream(in);\n\t\t\t\t){\n\t\t\t\n\t\t\tname = dis.readUTF();\n\t\t\tkor = dis.readInt();\n\t\t\teng = dis.readInt();\n\t\t\tmat = dis.readInt();\n\t\t\ttot = dis.readInt();\n\t\t\tavg = dis.readDouble();\n\t\t\tgender = dis.readBoolean();\n\t\t\t\n\t\t\tSystem.out.printf(\"%s,%d,%d,%d,%d,%.2f,%b\\n\"\n\t\t\t\t\t, name, kor, eng,mat,tot,avg,gender);\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t System.out.println(e.toString());\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"END\");\n\t}", "private void loadApplication() throws Exception{\n\t\t\n\t\tBufferedReader br = new BufferedReader(new FileReader(this.appfile));\n\t\tString line;\n\t\t\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tif (line.equals(\"Date\")){\n\t\t\t\tline = br.readLine();\n\t\t\t\tsetDate(line);\n\t\t\t}\n\t\t\telse if (line.equals(\"GPA\")){\n\t\t\t\tline = br.readLine();\n\t\t\t\tdouble newGPA = Double.parseDouble(line);\n\t\t\t\tsetGPA(newGPA);\n\t\t\t}\n\t\t\telse if (line.equals(\"Education Level\")){\n\t\t\t\tline = br.readLine();\n\t\t\t\tsetEducationLevel(line);\n\t\t\t}\n\t\t\telse if (line.equals(\"Status\")){\n\t\t\t\tline = br.readLine();\n\t\t\t\tsetStatus(line);\n\t\t\t}\n\t\t\telse if (line.equals(\"Priority\")){\n\t\t\t\tline = br.readLine();\n\t\t\t\tint newPriority = Integer.parseInt(line);\n\t\t\t\tsetPriority(newPriority);\n\t\t\t}\n\t\t}\n\t\tbr.close();\t\n\t}", "public static void main(String[] args) {\n\n String inputFile = \"data/input.txt\";\n String outputFile = \"data/output.txt\";\n String studentInfo = \"data/students_info.txt\";\n String studentData = \"\";\n BufferedReader reader = null;\n String[] data = null;\n boolean sex = false;\n try {\n reader = new BufferedReader(new FileReader(studentInfo));\n studentData = reader.readLine();\n data = studentData.split(\" \");\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n \n if (data[3].equals(\"1\")) {\n sex = true;\n }\n\n Student testStudent1 = new Student(Integer.parseInt(data[0]),data[1],sex,Integer.parseInt(data[3]));\n\n testStudent1.doHomework(inputFile,outputFile,\"Со\");\n\n }", "public static void solve(){\n try {\r\n Rete env = new Rete();\r\n env.clear();\r\n env.batch(\"sudoku.clp\");\r\n\t\t\tenv.batch(\"solve.clp\");\r\n env.batch(\"output-frills.clp\");\r\n env.batch(\"guess.clp\");\r\n env.batch(\"grid3x3-p1.clp\");\r\n\t env.eval(\"(open \\\"test.txt\\\" output \\\"w\\\")\");\r\n env.reset();\r\n env.eval(\"(assert (try guess))\");\r\n env.run();\r\n env.eval(\"(close output)\");\r\n } catch (JessException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n }\r\n System.out.println(\"ok\");\r\n FileReader fr;\r\n try {\r\n int r = 0,c = 0;\r\n fr = new FileReader(\"test.txt\");\r\n Scanner sc = new Scanner(fr);\r\n \r\n while (sc.hasNextInt()){\r\n int next = sc.nextInt();\r\n int i = id[r][c];\r\n gui.setSudokuValue(i-1, next);\r\n c++;\r\n if (c >= 6){\r\n c = 0; r++;\r\n }\r\n }\r\n } catch (Exception e){\r\n }\r\n \r\n }", "public void loadData() {\n Path path= Paths.get(filename);\n Stream<String> lines;\n try {\n lines= Files.lines(path);\n lines.forEach(ln->{\n String[] s=ln.split(\";\");\n if(s.length==3){\n try {\n super.save(new Teme(Integer.parseInt(s[0]),Integer.parseInt(s[1]),s[2]));\n } catch (ValidationException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }else\n System.out.println(\"linie corupta in fisierul teme.txt\");});\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n Kendaraan.data();\n }", "public void loadState(ObjectInput in) throws IOException {\n\t\t// loda deikto values\n\t\tdk.loadState(in);\n\t\t// load interpreter values\n\t\tinterpreter.globalActorBox=in.readFloat();\n\t\tinterpreter.globalPropBox=in.readFloat();\n\t\tinterpreter.globalStageBox=in.readFloat();\n\t\tinterpreter.globalEventBox=in.readFloat();\n\t\tinterpreter.globalVerbBox=in.readFloat();\n\t\tinterpreter.globalBNumberBox=in.readFloat();\n\n\t\t// load ticks\n\t\tcMoments = in.readInt();\n\t\t// load inactivity counter\n\t\tcInactivity = in.readInt();\n\t\t// load inactivity counter for the player\n\t\tplayerInactivity = in.readInt();\n\t\t// load storyIsOver\n\t\tstoryIsOver = in.readBoolean();\n\t\tisEpilogueNow = in.readBoolean();\n\t\tisHappilyDone = in.readBoolean();\n\t\tisPenultimateDone = in.readBoolean();\n\n\t\ttry {\n\t\t\t// load storybook\n\t\t\tint size = in.readInt();\n\t\t\tDeikto.checkByteArraySize(size*4);\n\t\t\thistoryBook.clear();\n\t\t\tfor(int i=0;i<size;i++)\n\t\t\t\thistoryBook.add((Sentence)in.readObject());\n\t\t\t//save random seeds\n\t\t\trandom = (Random)in.readObject();\n\t\t\tinterpreter.scriptRandom.setSeed(in.readLong());\n\t\t\t// load alarms\n\t\t\tsize = in.readInt();\n\t\t\tDeikto.checkByteArraySize(size*16);\n\t\t\talarms.clear();\n\t\t\tfor(int i=0;i<size;i++)\n\t\t\t\talarms.add((Alarm)in.readObject());\n\t\t\tsize = in.readInt();\n\t\t\tDeikto.checkByteArraySize(size*16);\n\t\t\tstorybookQueue.clear();\n\t\t\tstorybook.clear();\n\t\t\tfor(int i=0;i<size;i++)\n\t\t\t\tstorybook.add(in.readUTF());\n\t\t\tstorybookQueue.addAll(storybook);\n\t\t} catch(ClassNotFoundException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "void load();", "void load();", "private void printAnswerResults(){\n\t\tSystem.out.print(\"\\nCorrect Answer Set: \" + q.getCorrectAnswers().toString());\n\t\tSystem.out.print(\"\\nCorrect Answers: \"+correctAnswers+\n\t\t\t\t\t\t \"\\nWrong Answers: \"+wrongAnswers);\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n File f = new File(\"dict2.txt\");\n Scanner readFile = new Scanner(f);\n ArrayList<String> dictionary = new ArrayList<String>();\n \n while (readFile.hasNext()) {\n dictionary.add(readFile.next());\n }\n \n HangmanLogic logic = new HangmanLogic(dictionary);\n HangmanUserInterface game = new HangmanUserInterface(logic);\n game.start();\n }", "public DataIO(ArrayList<quizImpl> ql) {\n writeToFile(ql);\n }", "private void loadInformation(){\n\t\ttry{\n\t\t\tFileReader fr = new FileReader(\"SpaceProgramGaussDistribution.txt\");\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\tScanner sc = new Scanner(br);\n\t\t\t\n\t\t\tString info = \"\";\n\t\t\t\n\t\t\twhile(sc.hasNextLine()){\n\t\t\t\tinfo += sc.nextLine();\n\t\t\t}\n\t\t\t\n\t\t\tString split[] = info.split(\"#\");\n\t\t\t\n\t\t\tfor(int i = 0; i < split.length; i++){\n\t\t\t\tpopulationInfo += split[i]+\"\\n\";\n\t\t\t}\n\t\t\tsc.close();\n\t\t\tbr.close();\n\t\t\tfr.close();\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(\"File not found: SpaceProgramGaussDistribution.txt\");\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n\n\t\tFileReader r = new FileReader(\"D:\\\\SUREN\\\\Common\\\\DATA\\\\data.txt\");\n\t\tBufferedReader bfr= new BufferedReader(r);\n\t\tString x=\"\";\n\t\tSystem.out.println(bfr.readLine());\n\t\t\n\t\twhile((x=bfr.readLine())!=null)\n\t\t{\n\t\t\tSystem.out.println(x);\n\t\t}\n\t\tbfr.close();\n\t\t\n\t}", "@Override\n\tvoid getData() {\n\t\tSystem.out.println(\"Enter Brand\");\n\t\tbrand=a.next();\n\t\tSystem.out.println(\"Enter model\");\n\t\tmodel=a.next();\n\t\tSystem.out.println(\"Enter CC\");\n\t\tcc=a.nextDouble();\n\t}", "private void verificaData() {\n\t\t\n\t}", "private void takeInUserInput(){\n\t\t// only take in input when it is in the ANSWERING phase\n\t\tif(spellList.status == QuizState.Answering){\n\t\t\tspellList.setAnswer(getAndClrInput());\n\t\t\tspellList.status = QuizState.Answered;\n\t\t\tansChecker=spellList.getAnswerChecker();\n\t\t\tansChecker.execute();\n\t\t}\t\n\n\t}", "private void initiliaze() {\r\n\t\tthis.inputFile = cd.getInputFile();\r\n\t\tthis.flowcell = cd.getFlowcell();\r\n\t\tthis.totalNumberOfTicks = cd.getOptions().getTotalNumberOfTicks();\r\n\t\tthis.outputFile = cd.getOutputFile();\r\n\t\tthis.statistics = cd.getStatistic();\r\n\t}", "public static void main(String[] args){\n\t\trandomizeText(\"newenergy_part.dat\");\n\t}", "@Override\n\tpublic void nhap() {\n\t\tScanner reader = new Scanner(System.in);\n\t\tSystem.out.println(\" so cmnd:\");\n\t\tthis.cmnd = reader.nextLine();\n\t\tSystem.out.println(\" nhap ho ten khach hang:\");\n\t\tthis.hoTenKhachHang = reader.nextLine();\n\t\tSystem.out.println(\" so tien gui:\");\n\t\tthis.soTienGui = Double.parseDouble(reader.nextLine());\n\t\tSystem.out.println(\" nhap ngay lap:\");\n\t\tthis.ngayLap = reader.nextLine();\n\t\tSystem.out.println(\" lai suat:\");\n\t\tthis.laiSuat = Double.parseDouble(reader.nextLine());\n\t\tSystem.out.println(\" so thang gui:\");\n\t\tthis.soThangGui = Integer.parseInt(reader.nextLine());\n\t\tSystem.out.println(\" nhap ky han:\");\n\t\tthis.kyHan = Integer.parseInt(reader.nextLine());\n\t}", "public static void main(String[] args){\n Task task;\n Data data;\n Data temp = new Data();\n\n ChainHash<Integer, Data> hash = new ChainHash<Integer, Data>(13);\n\n do {\n switch (task = SelectTask()) {\n\n case ADD :\n data = new Data();\n data.scanData(\"삽입\", Data.NO | Data.NAME);\n hash.add(data.keyCode(), data);\n break;\n\n case REMOVE :\n temp.scanData(\"삭제\", Data.NO);\n hash.remove(temp.keyCode());\n break;\n\n case SEARCH :\n temp.scanData(\"검색\", Data.NO);\n Data tempData = hash.search(temp.keyCode());\n if (tempData != null) {\n System.out.println(\"그 번호의 이름은 \" + tempData + \"입니다.\");\n } else {\n System.out.println(\"해당 데이터가 없습니다.\");\n }\n break;\n\n case DUMP :\n hash.dump();\n break;\n }\n } while (task != Task.TERMINATE);\n }", "private void setAnswers()\n {\n StringBuilder answers = new StringBuilder(256);\n String[] correctAnswers = getResources().getStringArray(R.array.correct_answers);\n TextView answer_view = (TextView) findViewById(R.id.answers);\n for(int i = 0 ; i < correctAnswers.length; i++)\n {\n answers.append(correctAnswers[i]);\n }\n answer_view.setText(answers.toString());\n }", "public static void main(String[] args) {\n\n if (args.length < 2 || args.length > 3) {\n System.out.println(\"Usage: BuildDemoData <dir> <file> [<jenaflag>]\");\n System.out.println(\"where <dir> is the output directory\");\n System.out.println(\"where <file> is a properties file\");\n System.out.println(\"where <jenaflag> is any value\");\n System.exit(0);\n }\n\n Properties dataProps = new Properties();\n\n try {\n File props = new File(args[1]);\n FileInputStream fis = new FileInputStream(props);\n dataProps.load((InputStream) fis);\n } catch (Exception e) {\n System.err.println(e.toString());\n e.printStackTrace();\n }\n\n \tModel model = ModelFactory.createDefaultModel();\n try {\n model = getModelFromFiles(dataProps);\n } catch (Exception e) {\n System.err.println(e.toString());\n e.printStackTrace();\n }\n \n System.out.println(\"Writing no inferencing model...\");\n writeModel(model, args[0] + \"simileDemoNoInference.rdf\");\n System.out.println(\"Uninferenced model contains \" + model.size() + \" statements\");\n\n System.out.println(\"Inferencing...\"); \t\n if (args.length == 2) {\n Reasoner reasoner = new SimileReasoner();\n writeModel(reasoner.process(model), args[0] + \"simileDemoMappingInference.rdf\");\n } else {\n Reasoner reasoner = new JenaReasoner();\n writeModel(reasoner.process(model), args[0] + \"simileDemoJenaInference.rdf\");\n }\n \n System.out.println(\"Inferenced model contains \" + model.size() + \" statements\");\n }", "private void addQuestion() {\n Question q = new Question(\n \"¿Quien propuso la prueba del camino básico ?\", \"Tom McCabe\", \"Tom Robert\", \"Tom Charlie\", \"Tom McCabe\");\n this.addQuestion(q);\n\n\n Question q1 = new Question(\"¿Qué es una prueba de Caja negra y que errores desean encontrar en las categorías?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \" determina la funcionalidad del sistema\", \" determina la funcionalidad del sistema\");\n this.addQuestion(q1);\n Question q2 = new Question(\"¿Qué es la complejidad ciclomática es una métrica de calidad software?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \"basada en el cálculo del número\", \"basada en el cálculo del número\");\n this.addQuestion(q2);\n //preguntas del quiz II\n Question q3=new Question(\"Las pruebas de caja blanca buscan revisar los caminos, condiciones, \" +\n \"particiones de control y datos, de las funciones o módulos del sistema; \" +\n \"para lo cual el grupo de diseño de pruebas debe:\",\n \"Conformar un grupo de personas para que use el sistema nuevo\",\n \"Ejecutar sistema nuevo con los datos usados en el sistema actual\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\");\n this.addQuestion(q3);\n Question q4=new Question(\"¿Las pruebas unitarias son llamadas?\",\n \"Pruebas del camino\", \"Pruebas modulares\",\n \"Pruebas de complejidad\", \"Pruebas modulares\");\n this.addQuestion(q4);\n Question q5=new Question(\"¿Qué es una prueba de camino básico?\",\n \"Hace una cobertura de declaraciones del código\",\n \"Permite determinar si un modulo esta listo\",\n \"Técnica de pueba de caja blanca\",\n \"Técnica de pueba de caja blanca\" );\n this.addQuestion(q5);\n Question q6=new Question(\"Prueba de camino es propuesta:\", \"Tom McCabe\", \"McCall \", \"Pressman\",\n \"Tom McCabe\");\n this.addQuestion(q6);\n Question q7=new Question(\"¿Qué es complejidad ciclomatica?\",\"Grafo de flujo\",\"Programming\",\n \"Metrica\",\"Metrica\");\n this.addQuestion(q7);\n //preguntas del quiz III\n Question q8 = new Question(\n \"¿Se le llama prueba de regresión?\", \"Se tienen que hacer nuevas pruebas donde se han probado antes\",\n \"Manten informes detallados de las pruebas\", \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\");\n this.addQuestion(q8);\n Question q9 = new Question(\"¿Cómo se realizan las pruebas de regresión?\",\n \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\", \"A través de herramientas de automatización de pruebas\", \"A través de herramientas de automatización de pruebas\");\n this.addQuestion(q9);\n Question q10 = new Question(\"¿Cuándo ya hay falta de tiempo para ejecutar casos de prueba ya ejecutadas se dejan?\",\n \"En primer plano\", \"En segundo plano\", \"En tercer plano\", \"En segundo plano\");\n this.addQuestion(q10);\n //preguntas del quiz IV\n Question q11 = new Question(\n \"¿En qué se enfocan las pruebas funcionales?\",\n \"Enfocarse en los requisitos funcionales\", \"Enfocarse en los requisitos no funcionales\",\n \"Verificar la apropiada aceptación de datos\", \"Enfocarse en los requisitos funcionales\");\n this.addQuestion(q11);\n Question q12 = new Question(\"Las metas de estas pruebas son:\", \"Verificar la apropiada aceptación de datos\",\n \"Verificar el procesamiento\", \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\",\n \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\");\n this.addQuestion(q12);\n Question q13 = new Question(\"¿En qué estan basadas este tipo de pruebas?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Técnicas de cajas negra\", \"Técnicas de cajas negra\");\n this.addQuestion(q13);\n //preguntas del quiz V\n Question q14 = new Question(\n \"¿Cúal es el objetivo de esta técnica?\", \"Identificar errores introducidos por la combinación de programas probados unitariamente\",\n \"Decide qué acciones tomar cuando se descubren problemas\",\n \"Verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Identificar errores introducidos por la combinación de programas probados unitariamente\");\n this.addQuestion(q14);\n Question q15 = new Question(\"¿Cúal es la descripción de la Prueba?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\");\n this.addQuestion(q15);\n Question q16 = new Question(\"Por cada caso de prueba ejecutado:\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Comparar el resultado esperado con el resultado obtenido\", \"Comparar el resultado esperado con el resultado obtenido\");\n this.addQuestion(q16);\n //preguntas del quiz VI\n Question q17 = new Question(\n \"Este tipo de pruebas sirven para garantizar que la calidad del código es realmente óptima:\",\n \"Pruebas Unitarias\", \"Pruebas de Calidad de Código\",\n \"Pruebas de Regresión\", \"Pruebas de Calidad de Código\");\n this.addQuestion(q17);\n Question q18 = new Question(\"Pruebas de Calidad de código sirven para: \",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Verificar que las especificaciones de diseño sean alcanzadas\",\n \"Garantizar la probabilidad de tener errores o bugs en la codificación\", \"Garantizar la probabilidad de tener errores o bugs en la codificación\");\n this.addQuestion(q18);\n Question q19 = new Question(\"Este análisis nos indica el porcentaje que nuestro código desarrollado ha sido probado por las pruebas unitarias\",\n \"Cobertura\", \"Focalización\", \"Regresión\", \"Cobertura\");\n this.addQuestion(q19);\n\n Question q20 = new Question( \"¿Qué significa V(G)?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Regiones\");\n this.addQuestion(q20);\n\n Question q21 = new Question( \"¿Qué significa A?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Aristas\");\n this.addQuestion(q21);\n\n Question q22 = new Question( \"¿Qué significa N?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Nodos\");\n this.addQuestion(q22);\n\n Question q23 = new Question( \"¿Qué significa P?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos Predicado\", \"Número de Nodos Predicado\");\n this.addQuestion(q23);\n Question q24 = new Question( \"De cuantás formas se puede calcular la complejidad ciclomatica V(G):\",\n \"3\", \"1\", \"2\", \"3\");\n this.addQuestion(q24);\n\n // END\n }" ]
[ "0.61766297", "0.6150806", "0.5977766", "0.5976423", "0.59274155", "0.58778036", "0.58778036", "0.5844642", "0.58321124", "0.5796271", "0.5782386", "0.57492834", "0.5722469", "0.5642073", "0.5641588", "0.5635279", "0.55793136", "0.5528215", "0.55194646", "0.5514423", "0.54881924", "0.546618", "0.5434535", "0.5425476", "0.54056126", "0.5396002", "0.5395662", "0.53855693", "0.5380923", "0.5379028", "0.5368603", "0.534754", "0.5337391", "0.53299695", "0.5325076", "0.5311401", "0.530901", "0.530512", "0.52969354", "0.5290867", "0.5288606", "0.5284365", "0.52831805", "0.52767015", "0.52750117", "0.5272117", "0.5264071", "0.5248169", "0.5241122", "0.5238366", "0.5230545", "0.5224863", "0.5215361", "0.52110386", "0.520926", "0.520926", "0.51967204", "0.51852757", "0.51841235", "0.51834446", "0.5174701", "0.5172385", "0.5166279", "0.51622534", "0.5136144", "0.5135118", "0.5129158", "0.51258093", "0.5122554", "0.5113926", "0.51095635", "0.51095146", "0.5103867", "0.5100247", "0.5085877", "0.50814694", "0.50796276", "0.50746983", "0.50734764", "0.5072578", "0.5071915", "0.5069746", "0.5065491", "0.5061964", "0.5061964", "0.5052291", "0.5047864", "0.504401", "0.5038751", "0.50364035", "0.50301576", "0.5026145", "0.502388", "0.50191456", "0.5013139", "0.5011975", "0.5009038", "0.500714", "0.5002554", "0.49938574" ]
0.5360267
31
A method to print out the help message
private void printHelpMessage(Message msg, String[] parameters) { // No parameters if(parameters.length == 1) { MessageEmbed embed = new MessageEmbed(null, "*Current Commands*", "**$help:** Display the help page for all commands." + "\n\n**$query [-s PART_CODE] [-y YEARS] [-p PROBLEMS]**: Query a USNCO Locals " + "or Nationals problem. A part code, year range, or problem range is optional. For more " + "information, type `$help query`. The query command returns an embed containing " + "an image of the problem and various attributes. For more information on attributes, " + "type `$help attributes`.", null, msg.getTimeCreated().plusSeconds(5), MESSAGE_COLOR, null, null, AUTHOR_INFO, null, FOOTER, null, null); MessageChannel ch = msg.getChannel(); ch.sendMessage(embed).queue(); } else { String command = parameters[1]; if(!command.equals("query") && !command.equals("attributes")) { MessageChannel ch = msg.getChannel(); ch.sendMessage("The command you queried either does not have a" + "help page or does not exist. For general help, type $help.").queue(); } else if(command.equals("attributes")) { MessageEmbed embed = new MessageEmbed(null, "*Query Attributes*", "*Attributes: Source, Problem, Answer, Difficulty, " + "Problem Image*" + "\n\nSource: the year and test type of the test. " + "For example, `2020 USNCO Nationals Part I`. Will " + "come in the format [year] USNCO [Locals, Nationals " + "Part I, or Nationals Part II]." + "\n\nProblem: The problem number for the problem (i.e. 60)" + "\n\nAnswer: An answer with spoiler tags for the problem, if the " + "problem is multiple choice (from Part I or Locals). For example," + "the answer could look like ||B||." + "\n\nDifficulty: There are five different difficulty ratings." + "\n\t\t * **Unrated**: There is no data on the difficulty on the problem." + "\n\t\t * **Easy**: On an exam, more than two-thirds of test takers got it right." + "\n\t\t * **Medium**: On an exam, over half of test takers got it right." + "\n\t\t * **Hard**: On an exam, less than half of test takers got it right." + "\n\t\t * **Insane**: On an exam, less than one-third of test takers got it right." + "\n\nBelow is an example image of a query result.", null, msg.getTimeCreated().plusSeconds(5), MESSAGE_COLOR, null, null, AUTHOR_INFO, null, FOOTER, EXAMPLE_IMAGE, null); MessageChannel ch = msg.getChannel(); ch.sendMessage(embed).queue(); } else { MessageEmbed embed = new MessageEmbed(null, "*Query Problems*", "**query: ** `query [-s PART_CODE] [-y YEARS] [-p PROBLEMS]`" + "\n\nQuery a USNCO Locals or Nationals problem." + "\n\n" + "-s, -section __part code__: " + "\n\tOptional, restricts the part of the USNCO problems" + "\n\tqueried. Can be either 0, 1, or 2. See explanation below:" + "\n\t\t * Code 0: Locals (Part 0 like pre-nationals)" + "\n\t\t * Code 1: Nationals Part I" + "\n\t\t * Code 2: Nationals Part II" + "\n\nDefault queries only query Locals and Nationals Part I, " + "\n\tMake sure that -s comes before -y or -p." + "\n\n" + "-y, -year __year range__: " + "\n\tOptional, restricts the year range. Year range should" + "\n\tbe formatted as either a single year or two years with" + "\n\ta dash in between (i.e. 2000 or 2003-2007). Inclusive." + "\n\n" + "-p, -problem __problem range__: " + "\n\tOptional, restricts the problem range. Problem range" + "\n\tshould be formatted as either a single problem number" + "\n\tor two problem numbers with a dash in between " + "\n\t(i.e. 60 or 12-17). Inclusive." + "\n\nNote that part 2 values should be between 1-8" + "\n\n" + "**Usage Examples**" + "\n\n" + "`$query`: grabs a random problem from locals/nationals part I.\n" + "`$query -s 2:` grabs a random problem from nationals part II\n" + "`$query -s 0 -y 2005 -p 60`: problem #60 from 2005 USNCO Locals.\n" + "`$query -s 2 -y 2010 -p 6`: problem #6 from 2010 USNCO Part II\n" + "`$query -y 2010-2020 -p 25-30`: grabs a random kinetics question\n" + "\tfrom the past 10 years.", null, msg.getTimeCreated().plusSeconds(5), MESSAGE_COLOR, null, null, AUTHOR_INFO, null, FOOTER, null, null); MessageChannel ch = msg.getChannel(); ch.sendMessage(embed).queue(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void printHelp();", "private void printHelp() \n {\n Logger.Log(\"You have somehow ended up in this strange, magical land. But really you just want to go home.\");\n Logger.Log(\"\");\n Logger.Log(\"Your command words are:\");\n parser.showCommands();\n Logger.Log(\"You may view your inventory or your companions\");\n }", "@Override\n public void printHelp() {\n\n }", "private void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around at the university.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }", "private void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around in a dense woods.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }", "private void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around at the prision.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n System.out.println(parser.showCommands());\n }", "private void printHelp() \n {\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }", "public void showHelp();", "public void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around at the university.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n System.out.println(\" go quit help\");\n }", "public static void printHelp() {\n System.out.println(\"Usage:\");\n System.out.println(\"To create a user, post a message.\");\n System.out.println(\"<user name> [command] | <another user name>\");\n System.out.println(\"<user name> -> message - post a message\");\n System.out.println(\"<user name> - read timeline messages\");\n System.out.println(\"<user name> follows <another user name> - follow another user\");\n System.out.println(\"<user name> wall - display users wall\");\n System.out.println(\"-help - help\");\n System.out.println(\"exit - exit the program\");\n }", "public void help() {\n\t\tString format = \"%-20s%s%n\";\n\t\tString[] commands = new String[5];\n\t\tcommands[0] = \"help\";\n\t\tcommands[1] = \"learn\";\n\t\tcommands[2] = \"alphabet:create\";\n\t\tcommands[3] = \"alphabet:destroy\";\n\t\tcommands[4] = \"alphabet:compose\";\n\n\t\tString[] explanation = new String[5];\n\t\texplanation[0] = \"display this message\";\n\t\texplanation[1] = \"starts a learning process. Note: with a large alphabet, this\\ncan take a \"\n\t\t\t\t+ \"very long time!\";\n\t\texplanation[2] = \"creates an alphabet. Currently only working for Android, the\\n\"\n\t\t\t\t+ \"creation of an iOS alphabet has to be done more or less manually\";\n\t\texplanation[3] = \"deletes an existing alphabet\";\n\t\texplanation[4] = \"composes an alphabet from existing window dumps.\";\n\n\t\tfor (int i = 0; i < commands.length; i++) {\n\t\t\tSystem.out.printf(format, commands[i], explanation[i]);\n\t\t}\n\t}", "String getHelpString();", "public abstract void printHelp(List<String> args);", "private void printHelp() {\n System.out.println(\"Your available command words are:\");\n parser.showCommands();\n }", "public String getHelp();", "@Override\n public String showHelp()\n {\n return new String(ChatColour.RED + \"Usage: \" + ChatColour.AQUA + this.getName());\n }", "private String printHelp()//refactored\n { String result = \"\";\n result += \"\\n\";\n result += \"You are weak if you have to ask me\\n\";\n result += \"Try not to die, while i´am mocking you.\\n\";\n result += \"\\n\";\n result += \"\" + currentRoom.getDescription() + \"\\n\"; //new\n result += \"\\nExits: \" + currentRoom.getExitDescription() + \"\\n\";//new\n result += \"\\nCommand words:\\n\";\n result += ValidAction.getValidCommandWords();\n result += \"\\n\";\n \n return result;\n }", "private static void displayHelp(){\n System.out.println(\"-host hostaddress: \\n\" +\n \" connect the host and run the game \\n\" +\n \"-help: \\n\" +\n \" display the help information \\n\" +\n \"-images: \\n\" +\n \" display the images directory \\n\" +\n \"-sound: \\n\" +\n \" display the sounds file directory \\n\"\n\n );\n }", "@Override\n \t\t\t\tpublic void doHelp() {\n \n \t\t\t\t}", "private static void DisplayHelp() {\r\n System.out.println();\r\n System.out.println(\"Usage: Consumes messages from a topic/queue\");\r\n System.out.println();\r\n System.out.println(\" SampleConsumerJava [ < response_file ]\");\r\n System.out.println();\r\n return;\r\n }", "private void printHelp() {\r\n\t\tSystem.out.println(\"Flag Param Details\");\r\n\t\tSystem.out.println(\" -f **x** Add a filter. 'x' is the board letter.\");\r\n\t\tSystem.out.println(\" Can have 0 or more stars before and after the board letter.\");\r\n\t\tSystem.out.println(\" -h Print this message.\");\r\n\t\tSystem.out.println(\" -q Quit interactive session.\");\r\n\t\tSystem.out.println(\" -n xx Display xx number of words.\");\r\n\t\tSystem.out.println(\" -n all Display all words.\");\r\n\t\tSystem.out.println(\" -r Repeat last search.\");\r\n\t\tSystem.out.println(\" -s len Words are sorted by length.\");\r\n\t\tSystem.out.println(\" -s alpha Words are sorted alphapetically.\");\r\n\t\t// System.out.println(\"\");\r\n\t}", "private void showHelp() {\n System.out.println(\"new: \");\n System.out.println(\"new chess and throw the chess bevor away\");\n System.out.println(\"move from to:\");\n System.out.println(\"take the pawn from position from to position to \");\n System.out.println(\"print:\");\n System.out.println(\"print the chess now \");\n System.out.println(\"help:\");\n System.out.println(\"show help\");\n System.out.println(\"quit:\");\n System.out.println(\"quit out\");\n }", "public void help();", "public static void printHelpGuide() {\n printDivider();\n System.out.println(\"Help arrives!\\n\");\n printUserGuide();\n printDivider();\n }", "String getHelpText();", "@Override\r\n\tprotected String getHelpInfor() {\n\t\treturn \"\";\r\n\t}", "void help();", "private void help() {\n usage(0);\n }", "public void printHelp() {\n System.out.println(\". - jeden znak (bez znaku nowej linii)\");\n System.out.println(\".* - zero lub więcej znaków\");\n System.out.println(\"\\\\w* - zero lub więcej słów\");\n }", "private static void displayHelp(){\n System.out.println(\"1. (R)eport\");\n System.out.println(\"2. (M)inimum Spanning Tree\");\n System.out.println(\"3. (S)hortest Path from i j\");\n System.out.println(\"4. (D)own i j\");\n System.out.println(\"5. (U)p i j\");\n System.out.println(\"6. (C)hange Weight i j x\");\n System.out.println(\"7. (E)ulerian\");\n System.out.println(\"8. (Q)uit\");\n }", "@Override\n public void help() {\n\n }", "private void printHelp()//Method was given\n {\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }", "private void printHelp(Options options) {\n\t\tHelpFormatter formatter = new HelpFormatter();\r\n\t\tString header = \"CLI for Message Counter program\\n\\n\";\r\n\t\tString footer = \"End of the help\\n\";\r\n\t\tformatter.printHelp(\"ChatCounter\", header, options, footer, true);\r\n\t}", "private void help() {\n HelpFormatter formater = new HelpFormatter();\n\n formater.printHelp(\"Main\", options);\n System.exit(0);\n }", "public static void printInventoryHelpMessage() {\n\n UI.printEmptyLine();\n System.out.println(\"Here is a list of Inventory commands: \");\n\n UI.printEmptyLine();\n int[] lengthPara = {10,60,50};\n printer(new String[]{HELP_HEADER_COMMAND, HELP_HEADER_DESCRIPTION, HELP_HEADER_FORMAT}, lengthPara);\n UI.showLongLine();\n printer(new String[]{HELP_COMMAND, INVENTORY_HELP_DESCRIPTION, MARK_BLANK}, lengthPara);\n printer(new String[]{ADD_COMMAND, INVENTORY_ADD_DESCRIPTION, INVENTORY_ADD_FORMAT}, lengthPara);\n printer(new String[]{LIST_COMMAND, INVENTORY_LIST_DESCRIPTION, INVENTORY_LIST_FORMAT}, lengthPara);\n printer(new String[]{DELETE_COMMAND, INVENTORY_DELETE_DESCRIPTION, INVENTORY_DELETE_FORMAT}, lengthPara);\n printer(new String[]{RETURN_COMMAND, RETURN_DESCRIPTION, MARK_BLANK}, lengthPara);\n }", "protected void helpPage() {\n \n System.out.println(\"Commands:\");\n System.out.println(\"\\tQ [filename]\\t\\t\\tquit and save to filename\"); \n System.out.println(\"\\t ~ is used for a space character\" ); \n System.out.println(\"\\tb [STRING] [INDEX]\\t\\tinsert [STRING] \" +\n \"before [INDEX]\");\n System.out.println(\"\\tr [START] [STOP]\\t\\tremove all charecters\" +\n \" from index start to stop\");\n System.out.println(\"\\td [CHAR]\\t\\t\\tremove all [CHAR] elements \" +\n \"in the list\");\n System.out.println(\"\\tr [CHAR1] [CHAR2]\\t\\treplace all \" + \n \"[CHAR1]'s with [CHAR2]\");\n System.out.println(\"\\tz\\t\\t\\t\\trandomly run other commands several\" +\n \" times\");\n System.out.println(\"\\tp [INDEX] [CLIPBOARD]\\t\\tpaste from \" +\n \"clipboard number [CLIPBOARD] to message index [INDEX]\");\n System.out.println(\"\\tc [START] [STOP] [CLIPBOARD]\\t\" + \n \"copy message values from index [START] to [STOP] to \" + \n \"clipboard [CLIPBOARD]\");\n System.out.println(\"\\tx [STOP] [START] [CLIPBOARD]\\tcut from \" +\n \"message index [START] to [STOP] to clipboard [CLIPBOARD]\");\n System.out.println(\"\\th\\t\\t\\t\\tmeans to show this help page\");\n }", "private static void help() {\n\t\tHelpFormatter formater = new HelpFormatter();\n\t\tformater.printHelp(\"Main\", options);\n\t\tSystem.exit(0);\n\t}", "public static void displayHelp() {\n\t\thelp = getInstance();\n\t\tUIMain.popUpHelp(commandList, inputCommand);\t\n\t\tLoggingLogic.logging(HELP_MESSAGE);\n\t}", "private void helpService() {\n output.println(\"Help command\");\n output.println(\"-calc <number> \\t Calculates the value of pi based on <number> points; quit \\t Exit from program \");\n }", "public void printHelpCommands(){\r\n\t\t//Construct the help command output\r\n\t\tprintAsTable(\"exit\",\t\t \t\t\t\t\"Exit the program.\");\r\n\t\tprintAsTable(\"help\",\t\t \t\t\t\t\"Print out the usage.\");\r\n\t\tprintAsTable(\"host\",\t\t\t\t\t\t\"Enumerate all hosts.\");\r\n\t\tprintAsTable(\"host hname info\", \t\t\t\"Show info of host name.\");\r\n\t\tprintAsTable(\"host hname datastore\", \t\t\"Enumerate datastores of host hname.\");\r\n\t\tprintAsTable(\"host hname network\", \t\t\t\"Enumerate networks of host hname.\");\r\n\t\tprintAsTable(\"vm\", \t\t\t\t\t\t\t\"Enumerate all virtual machines.\");\r\n\t\tprintAsTable(\"vm vname info\", \t\t\t\t\"Show info of VM vname.\");\r\n\t\tprintAsTable(\"vm vname on\", \t\t\t\t\"Power on VM vname and wait until task completes.\");\r\n\t\tprintAsTable(\"vm vname off\", \t\t\t\t\"Power off VM vname and wait until task completes.\");\r\n\t\tprintAsTable(\"vm vname shutdown\", \t\t\t\"Shutdown guest of VM vname.\");\t\t\t\r\n\t}", "public void printHelp() throws IOException {\n\n HelpFormatter hf = new HelpFormatter();\n hf.setShellCommand(m_name);\n hf.setGroup(m_options);\n hf.print();\n }", "private static void help() {\n HelpFormatter formater = new HelpFormatter();\n formater.printHelp(\"SGD-SVM\", options);\n System.exit(0);\n }", "private static void help() {\n System.out.println(USAGE); \n System.exit(0);\n }", "private void showHelp() {\n \tHelpFormatter formatter = new HelpFormatter();\n \tformatter.printHelp( \"java -cp moustache.jar Main\", options );\n }", "public static void help() {\n System.out.println(line(\"*\", 80));\n System.out.println(\"SUPPORTED COMMANDS\");\n System.out.println(\"All commands below are case insensitive\");\n System.out.println();\n System.out.println(\"\\tSELECT * FROM table_name; Display all records in the table.\");\n System.out.println(\"\\tSELECT * FROM table_name WHERE rowid = <value>; Display records whose rowid is <id>.\");\n System.out.println(\"\\tDROP TABLE table_name; Remove table data and its schema.\");\n System.out.println(\"\\tVERSION; Show the program version.\");\n System.out.println(\"\\tHELP; Show this help information\");\n System.out.println(\"\\tEXIT; Exit the program\");\n System.out.println();\n System.out.println();\n System.out.println(line(\"*\", 80));\n }", "public String showHelp() {\r\n return ctrlDomain.getHidatoDescription();\r\n }", "public abstract String getHelpInfo();", "private void help() {\n System.out.println(\"PLACE X,Y,F #Placing the robot in (X,Y) facing F. \\n\" +\n \"\\tX and Y are numbers between 0 AND 5, F is NORTH, EAST, WEST, SOUTH directions\\n\" +\n \"MOVE #Move one position towards the current direction\\n\" +\n \"LEFT #Turn left\\n\" +\n \"RIGHT #Turn right\\n\" +\n \"REPORT #Prints current position and the direction\\n\" +\n \"HELP #Help menu\");\n }", "private void printHelp() {\n TablePrinter helpTableHead = new TablePrinter(\"Command Name : \", \"textconvert\");\n helpTableHead.addRow(\"SYNOPSIS : \", \"textconvert [OPTION]...\");\n helpTableHead.addRow(\"DESCRIPTION : \", \"Convert text/file to Binary, Hexadecimal, Base64.\");\n helpTableHead.print();\n TablePrinter helpTable = new TablePrinter(\"Short Opt\", \"Long Opt\", \"Argument\", \"Desc\", \"Short Option Example\", \"Long Option Example\");\n helpTable.addRow(\"-h\", \"--help\", \"not required\", \"Show this help.\", \"help -h\", \"help --help\");\n helpTable.addRow(\"-f\", \"--file\", \"required\", \"Path to file\", \"textconvert -f /PATH/TO/FILE\", \"textconvert --file /PATH/TO/FILE\");\n helpTable.addRow(\"-ttb\", \"--texttobinary\", \"not required\", \"Convert text to Binary\", \"textconvert -ttb -f /PATH/TO/FILE\", \"textconvert --texttobinary --file /PATH/To/File\");\n helpTable.addRow(\"-btt\", \"--binarytotext\", \"not required\", \"Convert Binary to text\", \"textconvert -btt -f /PATH/To/FileWithBinaryData\", \"textconvert --binarytotext --file /PATH/To/FileWithBinaryData\");\n helpTable.print();\n this.done = true;\n }", "public void help() {\n System.out.println(\"Type 'commands' to list all \" +\n \"available commands\");\n System.out.println(\"Type 'start' to play game\");\n System.out.println(\"Player to remove the last stone loses!\");\n System.out.println();\n }", "public void printUsage() {\n System.out.println(\"\\nHelp Invoked on \");\n System.out.println(\"[-hfs] \");\n System.out.println(\"\");\n\n System.out.println(\"Usage: \");\n System.out.println(\"-d [true|false]\");\n System.out.println(\"-f URL-file-pathame\");\n System.out.println(\"-h: invoke help\");\n System.out.println(\"-i: URL-list-input-source [ DEFAULT | USER | FILE ]\");\n System.out.println(\"-s URL-list-separator\");\n }", "private static void help() {\n\t\t\n\t\tTask[] taskList = createTaskList();\n\t\t\n\t\tSystem.out.println(\"\\n---------------------------------[ HELP ]--------\"\n\t\t\t\t+ \"------------------------------\\n\");\n\t\t\n\t\t// Post1 Display help (Polymorphism)\n\t\tfor (Task task : taskList) {\n\t\t\ttask.displayHelp();\n\t\t}\n\t\t\n\t}", "public static void help() {\n\n\t\tSystem.out.println(\"--help--Input format should be as below\" + \n\t\t \"\\njava -jar passgen.jar -l\" + \n\t\t\t\t \"\\n\" +\n\t\t\t\t \"\\njava -jar passgen.jar -l\" + \"\\n(where l= length of password)\" + \n\t\t\t\t \"\\n\");\n\n\t}", "protected String getHelp() {\r\n return UIManager.getInstance().localize(\"renderingHelp\", \"Help description\");\r\n }", "private static void printHelp(CmdLineParser parser) {\n\tSystem.out.print(\"Usage: Main \");\n\tparser.printSingleLineUsage(System.out);\n\tSystem.out.println(\"\\n\");\n\tparser.printUsage(System.out);\n\tSystem.out.println(\"\");\n\treturn;\n }", "private void printUsage() {\n \n // new formatter\n HelpFormatter formatter = new HelpFormatter();\n \n // add the text and print\n formatter.printHelp(\"arara [file [--log] [--verbose] [--timeout N] [--language L] | --help | --version]\", commandLineOptions);\n }", "private void help() {\n for (GameMainCommandType commandType : GameMainCommandType.values()) {\n System.out.printf(\"%-12s%s\\n\", commandType.getCommand(), commandType.getInfo());\n }\n System.out.println();\n }", "private void print_help_and_exit() {\n System.out.println(\"A bunch of simple directus admin cli commands\");\n System.out.println(\"requires DIRECTUS_API_HOST and DIRECTUS_ADMIN_TOKEN environment variables to be set\");\n System.out.println();\n\n COMMAND_METHODS.values().forEach(c -> {\n for (String desriptionLine : c.descriptionLines) {\n System.out.println(desriptionLine);\n }\n System.out.println();\n });\n\n System.out.println();\n System.exit(-1);\n }", "private static void printHelp() {\n getConsole().println(\"Keycheck\\n\" +\n \"\\n\" +\n \"Usage:\\n\" +\n \" keycheck.jar parameter1 parameter2 ... file1 file2 ...\\n\" +\n \"Example:\\n\" +\n \" java -jar keycheck.jar -\" + PARAMETER_BASE + \" -\" + PARAMETER_BITS + \" file1.csv file2.csv\" +\n \"\\n\" +\n \"Parameters:\\n\" +\n \" -\" + PARAMETER_GENERATE + \" [512|1024] Generate \" + GENERATED_KEY_COUNT + \" keys\\n\" +\n \" -\" + PARAMETER_NEW_FORMAT + \" New format will be use to load keys from file\\n\" +\n \" -\" + PARAMETER_TRANSFORM + \" Transform all keys to new format to file 'CARD_ICSN.csv'\\n\" +\n \" -\" + PARAMETER_BASE + \" Check base stats of keys\\n\" +\n \" -\" + PARAMETER_BITS + \" Generate statistics for all bits\\n\" +\n \" -\" + PARAMETER_BYTES + \" Generate statistics for all bytes\\n\" +\n \" -\" + PARAMETER_DIFFERENCE + \" Check primes difference\\n\" +\n \" -\" + PARAMETER_STRENGTH + \" Check primes strength\\n\" +\n \" -\" + PARAMETER_TIME + \" Generate time statistics\\n\" +\n \" -\" + PARAMETER_ALL + \" Generate all statistics and check all tests.\\n\");\n }", "private static void displayHelp()\r\n {\r\n System.out.println(\"Usage: \");\r\n System.out.println(\"======\");\r\n System.out.println(\"\");\r\n System.out.println(\" -i=<file> : The input file name\");\r\n System.out.println(\" -o=<file> : The output file name\");\r\n System.out.println(\" -e : Write the output as embedded glTF\");\r\n System.out.println(\" -b : Write the output as binary glTF\");\r\n System.out.println(\" -c=<type> : The indices component type. \"\r\n + \"The <type> may be GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT \"\r\n + \"or GL_UNSIGNED_INT. The default is GL_UNSIGNED_SHORT\");\r\n System.out.println(\" -m : Create one mesh per primitive, \"\r\n + \"each attached to its own node.\");\r\n System.out.println(\" -h : Print this message.\");\r\n System.out.println(\" -v=<number> : The target glTF version. \"\r\n + \"The <number> may be 1 or 2. The default is 2.\");\r\n System.out.println(\"\");\r\n System.out.println(\"Example: \");\r\n System.out.println(\"========\");\r\n System.out.println(\"\");\r\n System.out.println(\" ObjToGltf -b -i=C:/Input/Example.obj \" \r\n + \"-o=C:/Output/Example.glb\");\r\n }", "@Override\n\tpublic String textHelp() {\n\t\treturn \" HELP: Muestra esta ayuda.\"+\n\t\t\t\tSystem.getProperty(\"line.separator\");\n\t}", "public String getHelp() {\r\n String res = \"You can use the following commands:\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"north\\\" to go towards the north\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"south\\\" to go towards the south\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"east\\\" to go towards the south\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"west\\\" to go towards the south\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"attack\\\" to attack a monster\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"look\\\" to look around in the room\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"search\\\" to search the room for treasure\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"use\\\" to use somthing in your inventory\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"gear\\\" to see what gear you got equipped\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"inventory\\\" to see what gear you have in your inventory\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"savegame\\\" to save your progress\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"stop\\\" to quit the game.\" + System.lineSeparator();\r\n return res;\r\n }", "protected void help() {\n println(\"go - Begin execution at Start or resume execution from current pc location\");\n println(\"go <loc1> - Begin execution at <loc1>\");\n println(\"step - Execute next step\");\n println(\"dump <loc1> <loc2> - Dump memory locations from (including) <loc1> - <loc2>\");\n println(\"dumpr - Dump a table of registers\");\n println(\"exit - Exit debugger\");\n println(\"deas <loc1> <loc2> - Deassmble memory locations from (including) <loc1> - <loc2>\");\n println(\"brkt - List the current break point table\");\n println(\"sbrk <loc1> - Set break point at <loc1>\");\n println(\"cbrk <loc1> - Clear break point at <loc1>\");\n println(\"cbrkt - Clear breakpoint table\");\n println(\"help - Print a summary of debugger commands\");\n println(\"chngr <r#> <value> - Change the value of register <r#> to <value>\");\n println(\"chngm <loc1 <value> - Change the value of memory loaction <loc1> to <value>\");\n }", "private static void printHelp(){\r\n System.out.println(\"\\n\\n\\t\\t\\t ----HELP---\\n\\n\" +\r\n \"\\nYou can set the length of password like this \\n\" +\r\n \"\\t java -jar nipunpassgen.jar -l (where l is length of password) \\n\\n\" +\r\n \"\\nYou can also specifiy the which type of word your want to use like this-->\\n\" +\r\n \"\\t Type java -jar nipunpassgen.jar -l -tttt \\n \" +\r\n \"Here 1st t will set uselowercase true \\t 2nd t set useUppercase true\\n\" +\r\n \"\\t 3rd t set useDigit True \\t and 4th t set useSpecial Char true\\n\" +\r\n \"You can use 't' or 'T' for setting the true and 'f' or 'F' for setting the false\\n\" +\r\n \"You can pass -c flag at the end of command for directly copy the password in your\\n\" +\r\n \"clipboard without showing in console like this \\t java -jar nipunpassgen.jar -c \\t this will copy a\\n\" +\r\n \"random 8 digit password in your clipboard .\");\r\n }", "private void showHelp() {\n\t\tJOptionPane.showMessageDialog(this, \"Created by Mario Bobić\", \"About File Encryptor\", JOptionPane.INFORMATION_MESSAGE);\n\t}", "public static void help() {\n System.out.println(printLine(\"*\",120));\n System.out.println(\"SUPPORTED COMMANDS\");\n System.out.println(\"All commands below are case insensitive\");\n System.out.println();\n System.out.println(\"\\tSHOW TABLES; Display all tables in the schema.\");\n //System.out.println(\"\\tSELECT table_name FROM kavibase_tables; Display all records in the table.\");\n System.out.println(\"\\tCREATE TABLE table_name (column_name data_type [PRIMARY KEY] [NOT NULL],.); Create a table.\");\n System.out.println(\"\\tINSERT INTO TABLE (column_list) table_name VALUES (value_list); Insert a record into table.\");\n System.out.println(\"\\tDELETE FROM TABLE table_name WHERE row_id=key_value; Delete a record from a table.\");\n System.out.println(\"\\tSELECT * FROM table_name; Display all records in the table.\");\n System.out.println(\"\\tSELECT * FROM table_name WHERE rowid = <value>; Display records whose rowid is <id>.\");\n System.out.println(\"\\tDROP TABLE table_name; Remove table data and its schema.\");\n System.out.println(\"\\tVERSION; Show the program version.\");\n System.out.println(\"\\tHELP; Show this help information\");\n System.out.println(\"\\tEXIT; Exit the program\");\n System.out.println(\"\\tQUIT; Exit the program\");\n System.out.println();\n System.out.println();\n System.out.println(printLine(\"*\",120));\n }", "protected String getHelpText() {\n return \"\";\n }", "private static void printHelp(Options options) {\n HelpFormatter formatter = new HelpFormatter();\n String header = \"Generates the JSON file to send to Drupal.\";\n formatter.printHelp(120, \"drupal-builder\", header, options, \"\", true);\n }", "private static void help() {\n System.out.println(\"usage: pgen <project name> <args>\");\n System.out.println(\"Arguments:\");\n System.out.println(\"\\t-h | -help : help menu\");\n System.out.println(\"\\t-s | -size <example file amount> : the amount of example files to create. Defaults to 2\");\n System.out.println(\"\\t-t | -template <template> : the template to use. Defaults to java_default\");\n System.out.println(\"\\t\\tValid Templates:\");\n System.out.println(\"\\t\\t\\t* java_default\");\n System.out.println(\"\\t\\t\\t* cpp_default\");\n System.out.println(\"\\t-kattis : fetches the problems from Kattis and creates a makefile and test script for them\");\n System.out.println(\"\\t-local : fetches nothing and creates empty example files\");\n System.exit(0);\n }", "public String help() {\r\n\t\t\tif(this.inBattle()) {\r\n\t\t\t\treturn \"You can use the commands [attack] and [escape] while in battle.\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn \"You can use the commands: \\n\" + this.getPlayer().getPlayerCommands().keySet().toString() + \".\";\r\n\t\t\t}\r\n\t\t}", "public void showHelp() {\n\tString shortFormat = \"%16s -- %-20s %n\";\n\tString longFormat = \"%16s -- %-40s %n\";\n System.out.printf(shortFormat, \"ls\", \"list matched tariffs\");\n System.out.printf(shortFormat, \"ls all\", \"list all tariffs\");\n System.out.printf(shortFormat, \"clear\", \"reset filters\");\n System.out.printf(shortFormat, \"exit\", \"exit the program\");\n System.out.printf(longFormat, \"field min max\",\n \"filter tariffs with field having\"\n + \"value between min and max\");\n System.out.println(\"\\nList of available fields:\\n\");\n filterCommands.stream().forEach(System.out::println);\n }", "private static void help() {\n System.out.println(\"Supported Command List:\");\n System.out.println(\"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\");\n System.out.println(\"To draw canvas press: C <width> <height>\");\n System.out.println(\"To draw rectangle press: R <x1> <y1> <x2> <y2>\");\n System.out.println(\"To draw Line press : L <x1> <y1> <x2> <y2>\");\n System.out.println(\"To fill canvas press : B <x> <y> <c>\");\n System.out.println(\"To quit press: Q\");\n System.out.println(\"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\");\n System.out.println();\n }", "public static void help() {\n\tSystem.out.println(\"-- Avaible options --\");\n\tSystem.out.println(\"-- [arg]: Required argument\");\n\tSystem.out.println(\"-- {arg}: Optional argument\");\n\tSystem.out.println(\"* -s {file} Save the game into a file\");\n\tSystem.out.println(\"* -r {file} Play or Replay a game from a file\");\n\tSystem.out.println(\"* -a [file] Play a binary file or a game file\");\n\tSystem.out.println(\"* -n [file] Create a random game file\");\n\tSystem.out.println(\"* -t [size] Specify the size of the board\");\n\tSystem.out.println(\"* -k Solve the game with the IA solver\");\n\tSystem.out.println(\"* -m Solve the game with the MinMax/AlphaBeta algorithm\");\n\tSystem.out.println(\"----------------------------------------------\");\n\tSystem.out.println(\". Press Enter to Start or Restart\");\n\tSystem.out.println(\". Press Z to Undo the last move\");\n\tSystem.out.println(\"\");\n }", "private void printHelp(Options options) {\n HelpFormatter formatter = new HelpFormatter();\n formatter.setWidth(79);\n formatter.setOptionComparator(Comparator.comparingInt(this::getOptionOrder));\n formatter.printHelp(\"protostuff-compiler [options] proto_files\", options);\n }", "private void helpAbout() {\n JOptionPane.showMessageDialog(this, new ConsoleWindow_AboutBoxPanel1(), \"About\", JOptionPane.PLAIN_MESSAGE);\n }", "public void showHelp(CommandSender sender) {\n\t\t\n\t}", "public static String helpText() {\n return \"Company options:\\n\"\n + String.format(\"%-80s %s\\n\", \"list\", \"Lists whole company\")\n + String.format(\"%-80s %s\\n\", \"add [first name] [surname] [male|female] [birth date (dd.mm.yyyy)] [position]\", \"Creates new employee\")\n + String.format(\"%-80s %s\\n\", \"delete [id]\", \"Deletes employee with specified id\")\n + String.format(\"%-80s %s\\n\", \"sort --first_name\", \"Sort employees by first name\")\n + String.format(\"%-80s %s\\n\", \"sort --age\", \"Sort employees by age\")\n + String.format(\"%-80s %s\\n\", \"export\", \"Export current state of company to YAML file\")\n + String.format(\"%-80s %s\\n\", \"exit\", \"Exit the program\")\n + String.format(\"%-80s %s\\n\", \"help\", \"Show this help text\");\n }", "@Override\n public String getHelp() {\n return name;\n }", "private static void printCliHelp(String message) {\n \t\tSystem.out.println(message);\n \t\tHelpFormatter formatter = new HelpFormatter();\n\t\tformatter.printHelp(\"java -jar OsmPbfMetadata.jar\", createOptions());\n \t\tSystem.exit(-1);\n \t}", "public static void help() {\n System.out.println(\"MENU : \");\n System.out.println(\"Step 1 to create a default character.\"); // create and display a character\n System.out.println(\"Step 2 to display characters.\");\n System.out.println(\"Step 3 to choice a character for list his details. \");\n System.out.println(\"Step 4 to start fight between 2 characters\");\n System.out.println(\"step 5 to remove a character.\");\n System.out.println(\"step 6 to create a Warrior.\");\n System.out.println(\"step 7 to create a Wizard.\");\n System.out.println(\"step 8 to create a Thief.\");\n System.out.println(\"Step 9 to exit the game. \");\n System.out.println(\"Step 0 for help ....\");\n\n }", "public static void printHelp(Parser parser) {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around at the university.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }", "static void printHelp(String processname)\r\n\t{\n\t\tHelpFormatter formatter = new HelpFormatter();\r\n\t\tformatter.printHelp(processname, options);\r\n\r\n\t\tSystem.exit(0);\r\n\t}", "@Override\n public void help()\n {\n System.out.println(\"\\tcd [DEST]\");\n }", "void printUsage(){\n\t\tSystem.out.println(\"Usage: RefactorCalculator [prettyPrint.tsv] [tokenfile.ccfxprep] [cloneM.tsv] [lineM.tsv]\");\n\t\tSystem.out.println(\"Type -h for help.\");\n\t\tSystem.exit(1); //error\n\t}", "private void doHelp()\r\n {\r\n Help.showHelp(page, ref, null);\r\n }", "public String produceHelpMessage() {\n\t\t// first calculate how much space is necessary for the options\n\t\tint maxlen = 0;\n\t\tfor (OptionContainer oc : options) {\n\t\t\tfinal String shorta = oc.getShort();\n\t\t\tfinal String longa = oc.getLong();\n\t\t\tint len = 0;\n\t\t\tif (shorta != null)\n\t\t\t\tlen += shorta.length() + 1 + 1;\n\t\t\tif (longa != null)\n\t\t\t\tlen += longa.length() + 1 + (longa.charAt(0) == 'X' ? 0 : 1) + 1;\n\t\t\t// yes, we don't care about branch mispredictions here ;)\n\t\t\tif (maxlen < len)\n\t\t\t\tmaxlen = len;\n\t\t}\n\n\t\t// get the individual strings\n\t\tfinal StringBuilder ret = new StringBuilder();\n\t\tfor (OptionContainer oc : options) {\n\t\t\tret.append(produceHelpMessage(oc, maxlen));\n\t\t}\n\n\t\treturn ret.toString();\n\t}", "public String showHelp() {\n String helpMessage = \"I don't know nothin' about other commands but \"\n + \"here are the list of commands I understand!\\n\"\n + \"help: displays the list of commands available\\n\"\n + \"\\n\"\n + \"list: displays the list of tasks you have\\n\"\n + \"\\n\"\n + \"find *keyword*: displays the tasks with that keyword\\n\"\n + \"eg find karate\\n\"\n + \"\\n\"\n + \"todo *task description*: adds a task without any\\n\"\n + \"date/time attached to it\\n\" + \"eg todo scold spongebob\\n\"\n + \"\\n\"\n + \"deadline *task description* /by *date+time*: adds a\\n\"\n + \"task that needs to be done before a specific date and time\\n\"\n + \"(date and time to be written in yyyy-mm-dd HHMM format)\\n\"\n + \"eg deadline build spaceship /by 2019-10-15 2359\\n\"\n + \"\\n\"\n + \"event *task description* /at *date+time*: adds a task that\\n\"\n + \"starts at a specific time and ends at a specific time\\n\"\n + \"(date and time to be written in yyyy-mm-dd HHMM format)\\n\"\n + \"eg event karate competition /at 2019-10-15 1200\\n\"\n + \"\\n\"\n + \"done *task number*: marks the task with that number as done\\n\"\n + \"eg done 1\\n\"\n + \"\\n\"\n + \"delete *task number*: deletes the task with that number from the list\\n\"\n + \"eg delete 1\\n\"\n + \"\\n\"\n + \"update *task number* /name *task name*: updates the name of the task with \"\n + \"that number from the list\\n\" + \"update 1 /name help spongebob\\n\"\n + \"\\n\"\n + \"update *task number* /date *task date*: (only for deadline or event tasks!) \"\n + \"updates the date and time of the task with that number from the list\\n\"\n + \"update 1 /date 2020-02-20 1200\\n\"\n + \"\\n\"\n + \"bye: ends the session\";\n return helpMessage;\n }", "private SlackerOutput handleHelp() {\n logger.debug(\"Handling help request\");\n List<WorkflowMetadata> metadata = registry.getWorkflowMetadata();\n Collections.sort(metadata, new Comparator<WorkflowMetadata>() {\n @Override\n public int compare(WorkflowMetadata m1, WorkflowMetadata m2) {\n String p1 = StringUtils.join(m1.getPath(), \"::\");\n String p2 = StringUtils.join(m2.getPath(), \"::\");\n return p1.compareTo(p2);\n }\n });\n StringBuilder sb = new StringBuilder(\"I can understand:\\n\");\n for (WorkflowMetadata wm : metadata) {\n sb.append(StringUtils.join(wm.getPath(), \" \"))\n .append(\" \")\n .append(trimToEmpty(wm.getArgsSpecification()))\n .append(\"\\n\").append(\" \")\n .append(trimToEmpty(wm.getName()))\n .append(\" - \").append(trimToEmpty(wm.getDescription()))\n .append(\"\\n\");\n }\n return new TextOutput(sb.toString());\n }", "private static void printHelp(final Options options) {\n\t\tHelpFormatter formatter = new HelpFormatter();\n\t\tformatter.printHelp(\"lsc\", options);\n\t}", "private static void help() {\n\t\tSystem.out.println(\"\\n----------------------------------\");\n\t\tSystem.out.println(\"---Regatta Calculator Commands----\");\n\t\tSystem.out.println(\"----------------------------------\");\n\t\tSystem.out.println(\"addtype -- Adds a boat type and handicap to file. Format: name:lowHandicap:highHandicap\");\n\t\tSystem.out.println(\"format -- Provides a sample format for how input files should be arranged.\");\n\t\tSystem.out.println(\"help -- Lists every command that can be used to process regattas.\");\n\t\tSystem.out.println(\"podium -- Lists the results of the regatta, assuming one has been processed.\");\n\t\tSystem.out.println(\"regatta [inputfile] -- Accepts an input file as a parameter, this processes the regatta results outlined in the file.\");\n\t\tSystem.out.println(\"types -- lists every available boat type.\");\n\t\tSystem.out.println(\"write [outputfile] -- Takes the results of the regatta and writes them to the file passed as a parameter.\");\n\t\tSystem.out.println(\"----------------------------------\\n\");\n\t}", "private static String getHelp() {\n StringBuffer sb = new StringBuffer();\n\n // License\n //sb.append(License.get());\n\n // Usage\n sb.append(\"Usage: java -cp dist/jcore.jar -mx2G eu.fbk.fm.profiling.extractors.LSA.LSM input threshold size dim idf\\n\\n\");\n\n // Arguments\n sb.append(\"Arguments:\\n\");\n sb.append(\"\\tinput\\t\\t-> root of files from which to read the model\\n\");\n sb.append(\"\\tthreshold\\t-> similarity threshold\\n\");\n sb.append(\"\\tsize\\t\\t-> number of similar terms to return\\n\");\n sb.append(\"\\tdim\\t\\t-> number of dimensions\\n\");\n sb.append(\"\\tidf\\t\\t-> if true rescale using the idf\\n\");\n //sb.append(\"\\tterm\\t\\t-> input term\\n\");\n\n // Arguments\n //sb.append(\"Arguments:\\n\");\n\n return sb.toString();\n }", "public String textHelp() {\t\t\n\t\tString s = \"RUN: Ejecuta todas las instrucciones\";\n\t\treturn s;\n\t}", "final private static void usage_print () {\n\t\tSystem.out.println (NAME + ' ' + VERSION + ' ' + COPYRIGHT) ;\n\t\tSystem.out.println () ;\n\n\t\tSystem.out.println (\n\t\t \"Usage: java bcmixin.Main [<options>] <modelname> <equationname>\"\n\t\t) ;\n\n\t\tSystem.out.println () ;\n\t\tSystem.out.println (\"where [<options>] include any of the following:\") ;\n\t\tSystem.out.println () ;\n\t\tSystem.out.println (\" -help\") ;\n\t\tSystem.out.println (\" Prints this helpful message, then exits.\") ;\n\t\tSystem.out.println () ;\n\t\tSystem.out.println (\" where <modelname> means the model name that you want to work on.\") ;\n\t\tSystem.out.println () ;\n\t\tSystem.out.println (\"where <equationname> provides the equation name, which must end with .equation.\") ;\n\t\tSystem.out.println () ;\n }", "private static void help(){\r\n System.out.println(\"\\n\\t Something Went Wrong\\nType\\t java -jar nipunpassgen.jar -h\\t for mor info\");\r\n System.exit(0);\r\n }", "public String help() {\n\t\t\treturn \"\\nc-m-n backtracking test game.\\n\"\n\t\t\t\t\t\t\t+ \"Moves are integers in the range 0..\"\n\t\t\t\t\t\t\t+ getMM()\n\t\t\t\t\t\t\t+ \"\\nFind \"\n\t\t\t\t\t\t\t+ getCC()\n\t\t\t\t\t\t\t+ \" numbers that sum to \"\n\t\t\t\t\t\t\t+ getNN()\n\t\t\t\t\t\t\t+ \"\\nIf both or neither succeed, game is a draw. 0 quits.\\n\";\n\t\t}", "@Override\n\tpublic String getHelp() {\n\n\t\treturn \"EXAMINE|EXAMINAR\";\n\t}", "public String getHelp() {\n\t\tStringBuffer help = new StringBuffer(256);\n\t\thelp.append(ConsoleMsg.CONSOLE_HELP_CONTROLLING_CONSOLE_HEADING);\n\t\thelp.append(newline);\n\t\thelp.append(tab);\n\t\thelp.append(\"more - \"); //$NON-NLS-1$\n\t\thelp.append(ConsoleMsg.CONSOLE_HELP_MORE);\n\t\thelp.append(newline);\n\t\treturn help.toString();\n\t}", "@Override\n\tpublic String getHelp()\n\t{\n\t\treturn \"<html>Enter two before values and one after value<br>\"\n\t\t\t\t+ \"from the solution. Click the calculate button<br>\"\n\t\t\t\t+ \"to find the remaining after value.</html>\";\n\t}", "public String getHelp(){\r\n\t\tString out=\"\";\r\n\r\n\t\tout+=this.beforeTextHelp;\r\n\r\n\t\t//uso\r\n\t\tout += \"\\nUsage: \"+this.programName+\" \";\r\n\t\t//short arg\r\n\t\tout += \"[\";\r\n\t\tint i = 0;\r\n\t\twhile(i<opts.size()){\r\n\t\t\tout += \"-\"+opts.get(i).getArgument();\r\n\t\t\tif(i<opts.size()-1){out+=\"|\";}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tout += \"] \";\r\n\r\n\t\t//long arg\r\n\t\tout += \"[\";\r\n\t\ti = 0;\r\n\t\twhile(i<opts.size()){\r\n\t\t\tout += \"--\"+opts.get(i).getLongArgument();\r\n\t\t\tif(i<opts.size()-1){out+=\"|\";}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tout += \"]\\n\\n\";\r\n\r\n\t\tout += \"*\\tArgument required\\n\";\r\n\t\tout += \"**\\tValue required\\n\\n\";\r\n\r\n\t\t//lista degli argomenti\r\n\t\ti = 0;\r\n\t\twhile(i<opts.size()){\r\n\t\t\tout += \"-\"+opts.get(i).getArgument()+\"\\t\"; //short arg\r\n\t\t\tif(opts.get(i).getLongArgument().equals(null)){out += \"\\t\\t\";}else{out += \"--\"+opts.get(i).getLongArgument()+\"\\t\";} //long arg\r\n\t\t\tout += opts.get(i).getDescription()+\"\\n\";//description\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tout +=\"\\n\";\t\r\n\r\n\t\tout+=this.afterTextHelp;\r\n\r\n\t\tout +=\"\\n\";\r\n\t\treturn out;\r\n\t}", "public static void printHelp(String helpDisplay) {\n printMessage(helpDisplay);\n }", "@Override\r\n\tpublic String getHelp() {\n\t\treturn \"QUIT|SALIR\";\r\n\t}" ]
[ "0.8836242", "0.85331684", "0.8478557", "0.83347934", "0.8316819", "0.8307558", "0.8243017", "0.8239322", "0.8224657", "0.8204919", "0.8184006", "0.81792295", "0.8172836", "0.81561935", "0.8114366", "0.81087106", "0.81049263", "0.8079019", "0.80702466", "0.8050532", "0.8048589", "0.8027572", "0.8025644", "0.7984125", "0.79289985", "0.79065114", "0.7897434", "0.789496", "0.78862524", "0.78581965", "0.7842352", "0.78302664", "0.7829684", "0.7826463", "0.7781574", "0.7775547", "0.77661425", "0.7760003", "0.7754878", "0.77422523", "0.7729847", "0.7729726", "0.77142", "0.7702614", "0.7700771", "0.76923144", "0.76879704", "0.7672302", "0.76351076", "0.76309204", "0.7625681", "0.76246995", "0.76144016", "0.7601482", "0.7600465", "0.75985026", "0.75926924", "0.7592054", "0.7589861", "0.7567649", "0.75605065", "0.75579965", "0.75572693", "0.7529028", "0.75198716", "0.75163", "0.75157243", "0.751096", "0.7508625", "0.7481594", "0.74805814", "0.7477032", "0.7474417", "0.7452417", "0.74403477", "0.74389094", "0.7424736", "0.7424492", "0.7415413", "0.7415388", "0.7413638", "0.7400284", "0.73942035", "0.73605186", "0.73530215", "0.7330675", "0.7326938", "0.731355", "0.729417", "0.72855896", "0.72845525", "0.7282543", "0.7281538", "0.727391", "0.7266935", "0.72599804", "0.7255406", "0.72515976", "0.72268814", "0.71975356", "0.71881616" ]
0.0
-1
A method to get a random value within a range
private int getValue(int lowerBound, int upperBound) { int problemRange = upperBound - lowerBound + 1; return lowerBound + rng.nextInt(problemRange); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int customRandom(int range)\n {\n \tint random = (int)(Math.random()*10)%range;\n\t\n\treturn random;\n }", "private int _getRandomFromRange(int min, int max) {\n\t \n return min + random_.nextInt(max - min + 1);\n }", "public int getRandomNumberInInterval() {\n\t\treturn getRandomNumberUsingNextInt(min, max);\n\t}", "private static int randomBetween(Random r, int min, int max) {\n return r.nextInt(max - min) + min;\n }", "public static double rangedRandom(double a){\n\t\treturn -a + Calc.random(a * 2);\n\t}", "float getRandomValue(float min, float max)\r\n\t{\n\t\tRandom r = new Random(/*SEED!!!*/);\r\n\t\t//get a float between 0 and 1 then multiply it by the min/max difference.\r\n\t\tfloat num = r.nextFloat();\r\n\t\tnum = num * (max-min) + min;\r\n\t\treturn num;\r\n\t}", "private int randBetween(int start, int end) {\n\t\treturn start + (int)Math.round(Math.random() * (end - start));\n\t}", "int getRandom(int max);", "private double generateRandomValue(int min, int max) {\n\t\tdouble number = (Math.random() * max * 100) / 100 + min;\n\t\treturn number;\n\t}", "public int getRandom(int bound) {\n return ThreadLocalRandom.current().nextInt(bound);\n }", "private int getRandomNumberInRange(int min, int max) {\r\n\r\n\t\tRandom r = new Random();\r\n\t\treturn ((r.nextInt(max - min) + 1) + min)*40;\r\n\t}", "abstract public RandomRange getPlunderRange(Unit attacker);", "private static int getRandomNumber(int min, int max) \n { //generates a random number within a range\n return (min + rand.nextInt((max - min) + 1));\n }", "private int rand(int lower, int higher) {\n\t\treturn lower + (int) ((higher - lower + 1) * Math.random());\n\t\t\n\t}", "@Test\n public void testGetRandomRange() {\n // XXX what should be tested?\n // bad values to the range?\n // min == max?\n Assert.assertTrue(true);\n }", "private int randomRange(int min, int max) {\n\t\tRandom random = new Random();\n\t\treturn random.nextInt((max - min) + 1) + min;\n\t}", "public int randomValueFromClosedInterval(int min, int max, MersenneTwisterFast random)\n {\n if (max - min < 0) // we had an overflow\n {\n int l = 0;\n do l = random.nextInt();\n while(l < min || l > max);\n return l;\n }\n else return min + random.nextInt(max - min + 1);\n }", "public int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n}", "private int randomGen(int upperBound) {\n\t\tRandom r = new Random();\n\t\treturn r.nextInt(upperBound);\n\t}", "private int getRandomNumberInRange(int min, int max) {\n Random rand = new Random();\n return rand.nextInt((max - min) + 1) + min;\n }", "private int rand(int lower, int upper) {\n return lower + (int)(Math.random() * ((upper - lower) + 1));\n }", "public static int getRndInt(int upperBound){\n\t\tRandom randomNumber; \n\t\trandomNumber = new Random(); \n\t\tint z = randomNumber.nextInt(upperBound);\n\t\treturn z;\n\t}", "public int originalgetRandomPositiveInt(int min, int max){\r\n int number = getRandomPositiveInt(); \r\n return (int)number%(max - min + 1)+min;\r\n }", "private int randomNumber(int high, int low){\n \t\t Random r = new Random();\n \t\t return (r.nextInt(high-low) + low);\n \t }", "public static int randomNumber100(){\r\n int max = 100;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public int randBetween(int start, int end) {\n\t\treturn start + (int) Math.round(Math.random() * (end - start));\n\t}", "public int randomGQ() {\n\t\treturn(getRandomInteger(10,100));\n\t}", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "int getRandom(int limit){\n Random rand = new Random();\n int upperBound = limit;\n return rand.nextInt(upperBound) + 1;\n }", "public static int randomNumber(){\r\n int max = 10;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "private static int randomNumberBetween(final int start, final int end) {\n\t\treturn start + (int) Math.round(Math.random() * (end - start));\n\t}", "public int randomInRange(int low, int high)\n {\n return ((int) (Math.random() * (high - low + 1)) + low);\n }", "public static int getRandIntBetween(int lowerBound, int upperBound) {\n return rand.nextInt(upperBound - lowerBound)+lowerBound;\n }", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "public static int randomRound(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n return randNum;\r\n }", "public static int randBetween(int start, int end) {\n return start + (int)Math.round(Math.random() * (end - start));\n }", "public void getRange()\n\t{\n\t\tint start = randInt(0, 9);\n\t\tint end = randInt(0, 9);\t\t\n\t\tint startNode = start<=end?start:end;\n\t\tint endNode = start>end?start:end;\n\t\tSystem.out.println(\"Start : \"+startNode+\" End : \"+endNode);\n\t}", "public static int getRandom(int min, int max){\n\t int x = (int)(Math.random()*((max-min)+1))+min;\n\t return x;\n\t}", "private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}", "private static int getRandomNumberInRange(int min, int max) {\n\n if (min >= max) {\n throw new IllegalArgumentException(\"max must be greater than min\");\n }\n Random r = new Random();\n return r.nextInt((max - min) + 1) + min;\n }", "public int randomWithRange(){\n\r\n\t\tint[] diceRolls = new int[4];//roll four 6-sided dices\r\n\t\tint range;\r\n\t\tfor(int i = 0; i<diceRolls.length;i++) {\r\n\t\t\t//add each dice i rolled into an array\r\n\t\t\trange = 6;\r\n\t\t\tdiceRolls[i] = (int)(Math.random() * range) + 1;//assign a number btw 1-6\r\n\t\t}\r\n\t\tint smallest=diceRolls[0];\r\n\t\tfor(int i = 1; i<diceRolls.length; i++) {//will check for the smallest rolled dice\r\n\t\t\tif(diceRolls[i]<smallest) \r\n\t\t\t\tsmallest=diceRolls[i];\t\t\r\n\t\t}\r\n\t\tint sum=0;\r\n\t\tfor(int i = 0; i<diceRolls.length;i++) {//adds up all the sum\r\n\t\t\tsum = sum+diceRolls[i];\r\n\t\t}\r\n\t\treturn sum-smallest;//subtract by the smallest dice from the sum\r\n\t}", "private int randomAge() {\n \tint low = 18;\n \tint high = 100;\n \tint offset = high - low;\n \tRandom r = new Random();\n \treturn r.nextInt(offset) + low;\n \t\n }", "public static int randomNumber50(){\r\n int max = 50;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static int getRandomBetween(int lb, int ub)\n\t{\n\t\tRandom generator = new Random();\n\t\tint ret = generator.nextInt(ub+1-lb) + lb;\n\n\t\treturn ret;\n\t}", "private int random(int from, int to) {\n return from + (int) (Math.random() * (to - from + 1));\n }", "public static int intSample(int range) throws IllegalArgumentException {\n return random_.nextInt(range);\n }", "public int nextInt(int range) {\n int i = Math.abs(rand.nextInt());\n return (i % (range));\n }", "private int randomInt(int lower, int upper) {\n\t\treturn (int) ((upper - lower + 1) * Math.random()) + lower;\n\t}", "private static int random(int min, int max) {\r\n\t\tRandom rand = java.util.concurrent.ThreadLocalRandom.current();\r\n\t\treturn min + (int) (rand.nextDouble()*(max-min));\r\n\t}", "public int compete() {\r\n\t\tint max = 20;\r\n\t\tint min = 10;\r\n\t\tRandom Rand = new Random();\r\n\t\tint ranNum = Rand.nextInt(max - min) + min;\r\n\t\treturn ranNum;\r\n\t}", "private int getRandomWithExclusion(int bound, List<Integer> exclude) {\n int random = Constants.RAND.nextInt(bound - exclude.size());\n for (int ex : exclude) {\n if (random < ex) break;\n random++;\n }\n return random;\n \n }", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "protected int random(int min, int max) {\n\t\treturn this.rand.nextInt(max-min) + min;\n\t}", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "public static int randomNumber(int start, int end) {\n long range = (long) end - (long) start + 1;\n // compute a fraction of the range, 0 <= frac < range\n long fraction = (long) (range * RANDOM.nextDouble());\n return (int) (fraction + start);\n }", "private static int randInt(int lower, int upper) {\n\t\tRandom random = new Random();\n\t\treturn random.nextInt((upper - lower) + 1) + lower;\n\t}", "private static int randInt(final int min, final int max) {\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n return rand.nextInt((max - min) + 1) + min;\n }", "protected static int randBetween(int min, int max) {\n\t\tRandom rand = new Random();\n\t\treturn rand.nextInt(max - (min + 1)) + min;\n\t}", "private int getRandomInteger(int start, int end){\n\t\tif (start > end) {\n\t\t\tthrow new IllegalArgumentException(\"Start cannot exceed End.\");\n\t\t}\n\t\tRandom random = new Random();\n\t\tlong range = (long)end - (long)start + 1;\n\t\tlong fraction = (long)(range * random.nextDouble());\n\t\tint randomNumber = (int)(fraction + start); \n\t\treturn(randomNumber);\n\t}", "int randomIntInRange(int min, int max) {\n\t\tRandom rand = new Random();\n\t\treturn rand.nextInt(max + 1 - min) + min;\n\t}", "private double getRandomDouble(double min, double max)\r\n\t{\r\n\t\tdouble randNum = Math.random() * (max - min) + min;\r\n\t\treturn randNum;\r\n\t}", "public int getRandomNumber(int bound1, int bound2) {\n int min = Math.min(bound1, bound2);\n int max = Math.max(bound1, bound2);\n //math.random gives random number from 0 to 1\n return (int) (min + (Math.random() * (max - min)));\n }", "public int getRandomInt(int upper) {\n int retVal = myRandom.nextInt() % upper;\n if (retVal < 0) {\n retVal += upper;\n }\n return (retVal);\n }", "private static int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n }", "private static int myRandom(int low, int high) {\n return (int) (Math.random() * (high + 1 - low) + low);\n }", "private static double randomGenerator(double min, double max) {\n return (double)java.lang.Math.random() * (max - min +1) + min;\n }", "static int getRandomDelta() {\n int d = rand.nextInt(100);\n if (d < 50) {\n return -1;\n } else {\n return 1;\n }\n }", "static int getRandint(int min, int max) {\r\n\t\tRandom r = new Random();\r\n\t\treturn r.nextInt((max - min) + 1) + min;\r\n\t}", "public static int getInt(int lower, int upper) {\r\n return random.nextInt(upper - lower) + lower;\r\n }", "private int randomInt(final int start, final int end) {\n return random.nextInt(end - start + 1) + start;\n }", "public static int getRandomNumber(int min, int max){\r\n Random r = new Random();\r\n return r.nextInt((max - min) +1) + min;\r\n }", "private Integer randomBilirrubina(){\n\t\t\tint Min = 0, Max = 14;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}", "public static int generatRandomPositiveNegitiveValue(int max , int min) {\n\t int ii = -min + (int) (Math.random() * ((max - (-min)) + 1));\n\t return ii;\n\t}", "@Override\r\n public Double getValue() {\r\n return Math.random()*Integer.MAX_VALUE;\r\n \r\n }", "T getRandomAllowedValue();", "public static double rng(double min, double max) {\r\n\r\n return (Math.random() * ((max - min) + 1)) + min;\r\n }", "private int generateWholoeNumInRange( int min, int max ) {\r\n\r\n // Evaluate random number from min to max including min and max\r\n return (int)(Math.random()*(max - min + 1) + min);\r\n\r\n }", "public RangeRandom(final float min, final float max) {\n this.max = max;\n this.min = min;\n this.random = new Random(System.nanoTime());\n }", "public double rand (double min, double max) {\r\n\t\tdouble r = rand();\r\n\t\tr = min + (max - min) * r;\r\n\t\treturn r;\r\n\t}", "public static double newRand(double low, double high) {\n //Calculates the range from high to low\n double range = high - low;\n\n //Calculates a value within the range\n double value = range * Math.random();\n\n //Returns the relevant value\n return high - value;\n }", "public static int RandomNumber(int min, int max){\n Random random = new Random();\n int randomNum = random.nextInt((max - min)+1)+min;\n return randomNum;\n }", "public float randomize() {\n return nextFloat(this.min, this.max);\n }", "protected Random get_rand_value()\n {\n return rand;\n }", "public double random(double theMin, double theMax, CCInterpolator theInterpolator) {\n\t\treturn theMin + random(theInterpolator) * (theMax - theMin);\n\t}", "public int randint(int max, int min)\n {\n Random rand = new Random();\n int randomNum = rand.nextInt((max - min) + 1) + min;\n return randomNum;\n }", "public int getRandomNumber(int lowerLimit, int upperLimit)\n {\n int num = random.nextInt(upperLimit);\n // repeat while the number is lower than the lower limit.\n while(num < lowerLimit){\n num = random.nextInt(upperLimit);\n }\n return num;\n }", "public static int randomNumberAlg(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public float randomQual() {\n\t\treturn((float) getRandomInteger(30,250));\n\t}", "public static int getRandomBalance(){\n return rand.nextInt(1000000);\n }", "private int randomIntRange(int min, int max) {\r\n Random random = new Random();\r\n if (min < 0 || max < 0) {\r\n return (random.nextInt(Math.abs(max - min)) + Math.abs(min) + 1) * -1;\r\n }\r\n return random.nextInt(max - min) + min + 1;\r\n }", "public static int diceRoll() {\n int max = 20;\n int min = 1;\n int range = max - min + 1;\n int rand = (int) (Math.random() * range) + min;\n return rand;\n }", "public long randBetween(long l, long m) {\n\t\treturn l + (long) Math.round(Math.random() * (m - l));\n\t}", "public double getRandom(){\n\t\treturn random.nextDouble();\n\t}", "public int getNextIntRange(int[] range) {\n\t\tint low = Math.min(range[0], range[1]);\r\n\t\tint high = Math.max(range[0], range[1]);\r\n\t\tint val = (int)((high - low)*this.rand.nextDouble() + (double)low);\r\n\t\treturn val;\r\n\t}", "public static void main(String[] args) {\n int min=100;\n int max=999;\n int random = (int) (min + Math.random() * (max - min));\n int a=random%10;\n int a1=(random/10)%10;\n int a2=(random/100)%10;\n System.out.println(\"Число = \" +random +\" наибольшее число = \" +Math.max(a, Math.max(a1,a2)));\n}", "private int alea(final int valeurMin,\n final int valeurMax) {\n Random r = new Random();\n return valeurMin + r.nextInt(valeurMax - valeurMin);\n }", "public static double random() {\r\n return uniform();\r\n }", "public static void main(String[] args) {\n// System.out.println(Math.floor(12.34));/\n// System.out.println(Math.(12.34));/\n// System.out.println(Math.ceil(12.34));/\n// System.out.println(Math.ceil(12.34));/\n int start=5;\n int end=66;\n int i=start+(int)(Math.round(Math.random()*(end-start)) );\n System.out.println(i);\n }", "public static int randomPosition(){\r\n int max = 4;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n int pos = randNum;\r\n \r\n return pos;\r\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}" ]
[ "0.75973296", "0.73689204", "0.7355706", "0.73053247", "0.7255473", "0.71772355", "0.71658367", "0.70838153", "0.70410717", "0.70400995", "0.70379484", "0.70335454", "0.6987245", "0.6965747", "0.6964726", "0.69549984", "0.694985", "0.6938311", "0.69274753", "0.6925244", "0.6914997", "0.69060564", "0.689532", "0.6860261", "0.68521243", "0.684955", "0.68483275", "0.6833478", "0.6830316", "0.68039733", "0.68011546", "0.6798317", "0.6774898", "0.67707425", "0.6770668", "0.6762885", "0.6755937", "0.67432255", "0.67304486", "0.6729142", "0.6724293", "0.67206115", "0.67128384", "0.6707838", "0.6699004", "0.66840833", "0.66781986", "0.66533196", "0.66519195", "0.6645872", "0.6641995", "0.6639225", "0.6613765", "0.660092", "0.65851414", "0.65839523", "0.6575001", "0.6571733", "0.656733", "0.6567197", "0.65591013", "0.6554595", "0.65511113", "0.6551111", "0.65492785", "0.6538291", "0.65329355", "0.6529401", "0.6524999", "0.65194595", "0.65154636", "0.65135914", "0.65034294", "0.6501403", "0.6491806", "0.6482355", "0.64745915", "0.64707136", "0.64559805", "0.64484614", "0.6446924", "0.6446366", "0.6440722", "0.64256656", "0.64127696", "0.64123726", "0.6392651", "0.6388902", "0.63883185", "0.6383681", "0.6380879", "0.6375308", "0.6367548", "0.63628244", "0.6354614", "0.6349084", "0.6328456", "0.631058", "0.62980515", "0.62957036" ]
0.65674686
58
A method to query a USNCO problem
private void queryImage(Message msg, int actualYear, int actualProblem, int section) { // Query from GitHub String sectionVal; String sectionDescription; switch(section) { case 0: sectionVal = "locals"; sectionDescription = "Locals"; break; case 1: sectionVal = "part_i"; sectionDescription = "Nationals Part I"; break; default: sectionVal = "part_ii"; sectionDescription = "Nationals Part II"; break; } List<MessageEmbed.Field> fields = new ArrayList<>(); int problemID = actualYear*240 + actualProblem*4 + section; fields.add(new MessageEmbed.Field(header[1], actualYear + " USNCO " + sectionDescription, false)); fields.add(new MessageEmbed.Field(header[0], "" + actualProblem, true)); if(data.containsKey(problemID)) { String[] info = data.get(problemID).split("~"); fields.add(new MessageEmbed.Field(header[2], "||" + info[0] + "||", true)); if(info.length < 2) { fields.add(new MessageEmbed.Field(header[3], "Unrated", true)); } else { double percent = Double.parseDouble(info[1].substring(0, info[1].length() - 1)); if(percent > 66.6) { fields.add(new MessageEmbed.Field(header[3], "Easy (" + percent + "%)", true)); } else if(percent > 50.0) { fields.add(new MessageEmbed.Field(header[3], "Normal (" + percent + "%)", true)); } else if(percent > 33.3) { fields.add(new MessageEmbed.Field(header[3], "Hard (" + percent + "%)", true)); } else { fields.add(new MessageEmbed.Field(header[3], "Insane (" + percent + "%)", true)); } } } String url = "https://raw.githubusercontent.com/thewindsofwinter/usnco-problems/master/tests/" + sectionVal + "/" + actualYear + "/" + actualProblem + ".png"; MessageEmbed.ImageInfo image = new MessageEmbed.ImageInfo(url, null, 1200, 673); MessageEmbed embed = new MessageEmbed(null, null, null, null, msg.getTimeCreated().plusSeconds(5), MESSAGE_COLOR, null, null, AUTHOR_INFO, null, FOOTER, image, fields); MessageChannel ch = msg.getChannel(); ch.sendMessage(embed).queue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Query query();", "public String susi(String query) throws Exception {\n\n \t\tthis.query = query;\n \t\tif (this.query != \"\") {\n \t\t\tString url = this.susiUrl + \"?q=\" +this.query;\n\n \t\t\tURL urlObj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) urlObj.openConnection();\n\n con.setRequestMethod(\"GET\");\n\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n\n int responseCode = con.getResponseCode();\n String response = \"\";\n\t\t\tif (responseCode == 200) {\n response = buildReponse(con);\n\t\t\t} else {\n\t\t response = \"{'error': 'Looks like there is a problem in susi replying.'}\";\n\t\t\t}\n\n\t\t\treturn response;\n \t\t} else {\n \t\t\treturn \"{'error': 'Please ask susi something.'}\";\n \t\t}\n \t}", "private void queryProblems(Message msg, String[] parameters) {\n if(data.isEmpty())\n loadData();\n\n // Bounds on the problem number and year number\n resetParams();\n\n int section = -1;\n int currentOption = -1;\n\n int success = 0;\n for(int i = 1; i < parameters.length; i++) {\n if(success == -1)\n return;\n\n String parameter = parameters[i];\n\n switch(currentOption) {\n case 0:\n success = restrictYear(msg, parameter, section);\n currentOption = -1;\n break;\n case 1:\n success = restrictProblem(msg, parameter);\n currentOption = -1;\n break;\n case 2:\n section = restrictSection(msg, parameter);\n // If -1, we need to break to avoid errors\n success = section;\n currentOption = -1;\n break;\n default:\n if (parameter.matches(\"-y(ear)?\")) {\n currentOption = 0;\n } else if (parameter.matches(\"-p(roblem)?\")) {\n currentOption = 1;\n } else if(parameter.matches(\"-s(ection)?\")) {\n currentOption = 2;\n } else {\n MessageChannel ch = msg.getChannel();\n ch.sendMessage(\"`Error: Invalid option in query [not -s, -y, or -p]. Query terminated.`\").queue();\n return;\n }\n }\n }\n\n // Check if last command is in error\n if(success == -1)\n return;\n\n // Assign section if none selected\n if(section == -1) {\n section = rng.nextInt(2);\n lowerYear = LOWER_YEARS[section];\n upperYear = UPPER_YEARS[section];\n }\n\n int problem = getValue(lowerProblem, upperProblem);\n int year = getValue(lowerYear, upperYear);\n\n queryImage(msg, year, problem, section);\n }", "Problem readGeneralProblem(ElementId elementId) throws DatabaseException;", "public Integer requestPlatinumUsers() throws java.rmi.RemoteException {\n\tInteger result = null;\n\ttry {\n\t\t\n\t\tlogIt(\"Get users from platinum called\");\n\t\t\n\t\t// 1. Check if processing enabled\n\t\tif (!isProcessingEnabled())\n\t\t\treturn result;\n\n\t\t// 2. Create query\n\t\tKeyGeneratorAccessBean keygen = new KeyGeneratorAccessBean();\n\t\tint locIdQuery = keygen.getNextKey(QRYGENSEQ);\n\t\ttry {\n\t\t\tPIEQueryAccessBean query = new PIEQueryAccessBean(locIdQuery, REQUESTTYPES.IOTV, OPERATIONTYPES.INF,\n\t\t\t\tSTATUSTYPES.PREPARE, EXTSTATUSTYPES.WAIT, new java.sql.Timestamp(new java.util.Date().getTime()));\n\n\t\t\tKeyGeneratorAccessBean loggen = new KeyGeneratorAccessBean();\n\t\t\tPIEQueryLogAccessBean log = new PIEQueryLogAccessBean(loggen.getNextKey(LOGGENSEQ),\n\t\t\t\tlocIdQuery, \"I\", ERRORTYPES.USERS_REQUEST, \"Users request\", new java.sql.Timestamp(new java.util.Date().getTime()));\n\n\t\t\tquery.setStatus(STATUSTYPES.PREPAREOK);\n\t\t\tquery.commitCopyHelper();\n\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t// Cannot create query - fatal ....\n\t\t\tSystem.out.println(\"PLATINUM-SYNC: cannot create query\");\n\t\t\tthrow e;\n\t\t}\n\t\tlogIt(\"Creating request header with id=\" + locIdQuery);\n\t\tresult = new Integer(locIdQuery);\n\t\t\t\n\t} catch( Exception e ) {\n\t\tthrow new java.rmi.RemoteException( \"PLATINUM-SYNC: Unknown error while sending resources to platinum\", e );\n\t}\n\treturn result;\n}", "Query queryOn(Connection connection);", "public String createProjectQuery(long airQualityAnalysisCO,long airQualityAnalysisNOX,long airQualityAnalysisVOC,\n\t\t\tString area, boolean capacityProject, String city, String county, String dotDistrict, int federalFiscalYear, \n\t\t\tString federalFunctionalClassifications,String fundProjectType,String highwayRoadwayName, String limitFrom, \n\t\t\tString limitTo, int networkYear, int numberExistingLanes, String projectDescription, String projectID,\n\t\t\tString projectName, String projectPhases, String projectType, String remarks, String scopeOfProduct, \n\t\t\tString sponsorAgency, String stateSystemRoad, long numberMiles, int numberProjectedLanes\n\t\t\t) \n\t{\n\t\tString query = \"INSERT INTO USERS VALUES('\"+ airQualityAnalysisCO + \"','\"+ airQualityAnalysisNOX + \"','\" + airQualityAnalysisVOC + \n\t\t\t\t\"','\" + area + \"','\" + capacityProject+ \"','\" + city + \"','\" + county + \"','\" + dotDistrict + \"','\"+ federalFiscalYear + \n\t\t\t\t\"','\"+ federalFunctionalClassifications + \"','\"+ fundProjectType + \"','\"+ highwayRoadwayName + \"','\"+ limitFrom + \"','\"\n\t\t\t\t+ limitTo + \"','\"+networkYear + \"','\"+ \"','\" + numberExistingLanes + \"','\" + projectDescription + \"','\"+projectID + \n\t\t\t\t\"','\"+projectName + \"','\" + projectPhases + \"','\"+projectType + \"','\"+remarks + \"','\" + scopeOfProduct\n\t\t\t\t+ \"','\"+sponsorAgency + \"','\"+stateSystemRoad + \"','\"+ numberMiles +\"','\" + numberProjectedLanes + \"')\";\n\t\tSystem.out.println(query);\n\t\treturn query;\n\t}", "@Override\n\tpublic String fetchProblemStatement() {\n\t\tDocument doc;\n\n\t\ttry {\n\t\t\tString u = getUrl();\n\t\t\tdoc = Jsoup.connect(u).timeout(10000).get();\n\n\t\t\tElements problems = doc\n\t\t\t\t\t.getElementsByClass(\"primary-colum-width-left\");\n\n\t\t\tthis.setProblemStatement(problems.html());\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"codechef: Error fetching Problem Statement \"\n\t\t\t\t\t+ problemId + \" -> \" + e.getMessage());\n\t\t\t// e.printStackTrace();\n\t\t}\n\n\t\tSystem.out.println(\"codechef: fetched problem \" + problemId);\n\n\t\treturn this.problemStatement;\n\t}", "public static void querying(String constructQuery2) {\n\t\t//construct the new query\n\t\t//String constructQuery2 = prefix+\" \"+select+\" \"+selectValues+\" \"+where+openBracket+openBracket+\" \"+local+\" \"+service+\" \"+openBracket+\" \"+remote+\" \"+closeBracket+closeBracket;\n\t\t//constructQuery2 = constructQuery2+\" UNION \"+\" \"+openBracket+\" \"+local+\" \"+service+\" \"+openBracket+\" \"+remote+\" \"+closeBracket+closeBracket+closeBracket;\n\t\t\n\t\tSystem.out.println(constructQuery2);\n\t\tQuery query2 = QueryFactory.create(constructQuery2);\n\t\tQueryExecution qe2 = QueryExecutionFactory.sparqlService(\n\t\t\t\t\"http://localhost:3030/USNA/query\", query2);\n\t\t\n\t\tResultSet results1 = qe2.execSelect();\n\t\tif(constantOutput == \"\") {\n\t\t\tResultSetFormatter.out(System.out, results1);\n\t\t}else {\n\t\t\tString NS = \"http://www.usna.org/ns#\";\n\t\t\tModel rdfssExample = ModelFactory.createDefaultModel();\n\t\t\tString [] constant = constantOutput.trim().split(\" \");\n\t\t\t\n\t\t\tString [] headers = selectValues.split(\" \");\n\t\t System.out.println(\"--------------------------------------------------------------------------------------------------------------------------------------------\");\n\t\t\tfor(int i = 0; i< headers.length; i++) {\n\t\t\t\t//System.out.print(headers[i].substring(1,headers[i].length()).trim()+\"\\t\\t\\t\\t\\t\\t\");\n\t\t\t\tSystem.out.print(headers[i].substring(1,headers[i].length()).trim()+\"\\t\\t\\t\\t\\t\\t\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"----------------------------------------------------------------------------------------------------------------------------------------------\");\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t int count = 0;\n\t\t while ( results1.hasNext() ) {\n\t\t \t //Resource Response = rdfssExample.createResource(NS+constant[count]);\n\t\t \t \n\t\t QuerySolution soln = results1.nextSolution();\n\t\t Resource first = soln.getResource(headers[0].substring(1,headers[0].length()).trim());\n\t\t //Resource second = soln.getResource(headers[1].substring(1,headers[1].length()).trim());\n\t\t //Resource third = soln.getResource(headers[2].substring(1,headers[2].length()).trim());\n\t\t //Resource fourth = soln.getResource(headers[3].substring(1,headers[3].length()).trim());\n\t\t for(int i=0; i< constant.length; i++) {\n\t\t \t Resource Response = rdfssExample.createResource(NS+constant[i]);\n\t\t \t System.out.format(\"%10s %50s\",first, Response);\n\t\t \t System.out.println();\n\t\t\t\t\t //count++;\n\t\t }\n\t\t //System.out.format(\"%10s %50s\",first, Response);\n\t\t //System.out.format(\"%10s\",first);\n\t\t\t\t System.out.println();\n\t\t\t\t //count++;\n\t\t\t\t \n\t\t\t\t //System.out.println(count);\n\t\t \n\t\t }\n\t\t } finally {\n\t\t \t qe2.close();\n\t\t}\n\t\t\t \n\t\t}\t\t \n\t}", "public Integer requestPlatinumResources() throws java.rmi.RemoteException {\n\tInteger result = null;\n\ttry {\n\t\t\n\t\tlogIt(\"Get resources from platinum called\");\n\t\t\n\t\t// 1. Check if processing enabled\n\t\tif (!isProcessingEnabled())\n\t\t\treturn result;\n\n\t\t// 2. Create query\n\t\tKeyGeneratorAccessBean keygen = new KeyGeneratorAccessBean();\n\t\tint locIdQuery = keygen.getNextKey(QRYGENSEQ);\n\t\ttry {\n\t\t\tPIEQueryAccessBean query = new PIEQueryAccessBean(locIdQuery, REQUESTTYPES.IRES, OPERATIONTYPES.INF,\n\t\t\t\tSTATUSTYPES.PREPARE, EXTSTATUSTYPES.WAIT, new java.sql.Timestamp(new java.util.Date().getTime()));\n\t\t\t\n\t\t\tKeyGeneratorAccessBean loggen = new KeyGeneratorAccessBean();\n\t\t\tPIEQueryLogAccessBean log = new PIEQueryLogAccessBean(loggen.getNextKey(LOGGENSEQ),\n\t\t\t\tlocIdQuery, \"I\", ERRORTYPES.RESOURCES_REQUEST, \"Resources request\", new java.sql.Timestamp(new java.util.Date().getTime()));\n\n\t\t\tquery.setStatus(STATUSTYPES.PREPAREOK);\n\t\t\tquery.commitCopyHelper();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// Cannot create query - fatal ....\n\t\t\tSystem.out.println(\"PLATINUM-SYNC: cannot create query\");\n\t\t\tthrow e;\n\t\t}\n\t\tlogIt(\"Creating request header with id=\" + locIdQuery);\n\t\tresult = new Integer(locIdQuery);\n\t\t\t\n\t} catch( Exception e ) {\n\t\tthrow new java.rmi.RemoteException( \"PLATINUM-SYNC: Unknown error while sending resources to platinum\", e );\n\t}\n\treturn result;\n}", "public void obtenerPosicionesSolicitud(Solicitud solicitud)\n throws MareException {\n UtilidadesLog.info(\" DAOSolicitudes.obtenerPosicionesSolicitud(Solici\"\n +\"tud solicitud):Entrada\");\n\n BelcorpService bs;\n RecordSet respuesta;\n String codigoError;\n StringBuffer query = new StringBuffer();\n\n try {\n bs = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError = CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError));\n }\n\n try {\n //jrivas 20/7/2006 (indDevolucion) DBLG5000974 / DBLG5000981 / DBLG5001011\n //jrivas 1/8/2006 (indAnulacion) DBLG50001003\n if (!solicitud.getIndDevolucion() && !solicitud.getIndAnulacion()) {\n query.append(\" SELECT OID_SOLI_POSI, \");\n query.append(\" ESPO_OID_ESTA_POSI, \");\n //jrivas 27/04/2006 INC DBLG50000354\n //query.append(\" VAL_PREC_CATA_TOTA_LOCA_UNID, \");\n query.append(\" NUM_UNID_POR_ATEN, \");\n query.append(\" NUM_UNID_COMPR, \");\n query.append(\" VAL_PREC_CATA_UNIT_LOCA, \");\n //jrivas 27/04/2006 INC DBLG50000354\n //query.append(\" VAL_PREC_CONT_UNIT_LOCA, \");\n query.append(\" IND_CTRL_STOC, \");\n query.append(\" IND_CTRL_LIQU, \");\n query.append(\" IND_LIMI_VENT, \");\n query.append(\" NUM_UNID_DEMA_REAL, \");\n query.append(\" MAPR_OID_MARC_PROD, \");\n query.append(\" UNEG_OID_UNID_NEGO, \");\n query.append(\" NEGO_OID_NEGO, \");\n query.append(\" GENE_OID_GENE, \");\n query.append(\" SGEN_OID_SUPE_GENE, \");\n query.append(\" TOFE_OID_TIPO_OFER, \");\n query.append(\" CIVI_OID_CICLO_VIDA, \");\n query.append(\" SP.NUM_UNID_DEMA, \");\n query.append(\" PR.OID_PROD, \");\n query.append(\" VAL_PREC_FACT_UNIT_LOCA, \");\n query.append(\" VAL_PREC_NETO_UNIT_LOCA \");\n \n // sapaza -- COL-SiCC-2013-0030 -- 28/11/2013 \n query.append(\" ,OFDE_OID_DETA_OFER \");\n \n query.append(\" FROM PED_SOLIC_POSIC SP, \");\n query.append(\" MAE_PRODU PR, \");\n query.append(\" PRE_OFERT_DETAL OD \");\n query.append(\" WHERE SP.PROD_OID_PROD = PR.OID_PROD \");\n query.append(\" AND SP.OFDE_OID_DETA_OFER = OD.OID_DETA_OFER(+) \");\n query.append(\" AND SP.SOCA_OID_SOLI_CABE = \").append(solicitud.getOidSolicitud());\n } else {\n query.append(\" SELECT OID_SOLI_POSI, ESPO_OID_ESTA_POSI, NUM_UNID_POR_ATEN, NUM_UNID_COMPR, \");\n query.append(\" VAL_PREC_CATA_UNIT_LOCA, IND_CTRL_STOC, IND_CTRL_LIQU, IND_LIMI_VENT, \");\n query.append(\" NUM_UNID_DEMA_REAL, MAPR_OID_MARC_PROD, UNEG_OID_UNID_NEGO, \");\n query.append(\" NEGO_OID_NEGO, GENE_OID_GENE, SGEN_OID_SUPE_GENE, \");\n query.append(\" A.CIVI_OID_CICLO_VIDA, A.TOFE_OID_TIPO_OFER, SP.NUM_UNID_DEMA, \");\n query.append(\" PR.OID_PROD, VAL_PREC_FACT_UNIT_LOCA, VAL_PREC_NETO_UNIT_LOCA \");\n \n // sapaza -- COL-SiCC-2013-0030 -- 28/11/2013 \n query.append(\" ,OFDE_OID_DETA_OFER \");\n \n // sapaza -- PER-SiCC-2011-0279 -- 07/06/2011\n if(solicitud.isValidaReemplazo()) {\n query.append(\" ,(SELECT COUNT(1) FROM pre_matri_factu mf, PRE_MATRI_REEMP mr \");\n query.append(\" WHERE mf.OID_MATR_FACT = mr.MAFA_OID_COD_REEM \"); \n query.append(\" AND mf.ofde_oid_deta_ofer = SP.OFDE_OID_DETA_OFER) COD_REEM \");\n }\n \n query.append(\" FROM PED_SOLIC_POSIC SP, \");\n query.append(\" MAE_PRODU PR, \");\n query.append(\" (SELECT DISTINCT OD.CIVI_OID_CICLO_VIDA, OD.TOFE_OID_TIPO_OFER, \");\n query.append(\" OD.PROD_OID_PROD \");\n query.append(\" FROM PRE_OFERT_DETAL OD, \");\n query.append(\" PRE_OFERT O, \");\n query.append(\" PRE_MATRI_FACTU_CABEC MFC \");\n query.append(\" WHERE OD.OFER_OID_OFER = O.OID_OFER \");\n query.append(\" AND O.MFCA_OID_CABE = MFC.OID_CABE \");\n query.append(\" AND MFC.PERD_OID_PERI = \");\n query.append(\" (SELECT DISTINCT SC3.PERD_OID_PERI \");\n query.append(\" FROM PED_SOLIC_POSIC SP, \");\n query.append(\" PED_SOLIC_CABEC SC, \");\n query.append(\" PED_SOLIC_CABEC SC2, \");\n query.append(\" PED_SOLIC_CABEC SC3 \");\n query.append(\" WHERE SC.OID_SOLI_CABE = \").append(solicitud.getOidSolicitud());\n query.append(\" AND SP.SOCA_OID_SOLI_CABE = SC.OID_SOLI_CABE \");\n query.append(\" AND SC.SOCA_OID_DOCU_REFE = SC2.OID_SOLI_CABE \");\n query.append(\" AND SC3.SOCA_OID_SOLI_CABE = SC2.OID_SOLI_CABE \");\n query.append(\" AND OD.VAL_CODI_VENT = SP.VAL_CODI_VENT \");\n query.append(\" AND OD.PROD_OID_PROD = SP.PROD_OID_PROD)) A \");\n query.append(\" WHERE SP.PROD_OID_PROD = PR.OID_PROD \");\n query.append(\" AND SP.SOCA_OID_SOLI_CABE = \").append(solicitud.getOidSolicitud());\n query.append(\" AND A.PROD_OID_PROD = SP.PROD_OID_PROD \");\n }\n\n respuesta = bs.dbService.executeStaticQuery(query.toString());\n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"******* Posiciones \" + respuesta); \n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError = CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError));\n }\n\n if (respuesta.esVacio()) {\n solicitud.setPosiciones(new Posicion[0]);\n } else {\n Posicion[] posiciones = new Posicion[respuesta.getRowCount()];\n\n for (int i = 0; i < respuesta.getRowCount(); i++) {\n posiciones[i] = new Posicion();\n posiciones[i].setSolicitud(solicitud);\n posiciones[i].setOidPosicion(new Long(((BigDecimal) \n respuesta.getValueAt(i, \"OID_SOLI_POSI\")).longValue()));\n\n {\n BigDecimal oidPosicion = (BigDecimal) respuesta\n .getValueAt(i, \"ESPO_OID_ESTA_POSI\");\n posiciones[i].setEstado((oidPosicion != null) ? new Long(\n oidPosicion.longValue()) : null);\n }\n\n //jrivas 27/04/2006 INC DBLG50000354\n /*{\n BigDecimal precio1 = (BigDecimal) respuesta\n .getValueAt(i, \"VAL_PREC_CATA_TOTA_LOCA_UNID\");\n posiciones[i].setPrecioCatalogTotalUniDemandaReal(\n (precio1 != null) ? precio1 : new BigDecimal(0));\n }*/\n\n {\n BigDecimal unidadesPorAtender = (BigDecimal) respuesta\n .getValueAt(i, \"NUM_UNID_POR_ATEN\");\n posiciones[i].setUnidadesPorAtender(\n (unidadesPorAtender != null) ? new Long(\n unidadesPorAtender.longValue()) : new Long(0));\n }\n\n {\n BigDecimal unidadesComprometidas = (BigDecimal) respuesta\n .getValueAt(i, \"NUM_UNID_COMPR\");\n posiciones[i].setUnidadesComprometidas(\n (unidadesComprometidas != null) ? new Long(\n unidadesComprometidas.longValue()) : new Long(0));\n }\n\n {\n BigDecimal precio2 = (BigDecimal) respuesta\n .getValueAt(i, \"VAL_PREC_CATA_UNIT_LOCA\");\n posiciones[i].setPrecioCatalogoUnitarioLocal(\n (precio2 != null) ? precio2 : new BigDecimal(0));\n }\n\n //jrivas 27/04/2006 INC DBLG50000354\n /* BigDecimal precio3 = (BigDecimal) respuesta\n .getValueAt(i, \"VAL_PREC_CONT_UNIT_LOCA\");\n posiciones[i].setPrecioContableUnitarioLocal(\n (precio3 != null) ? precio3 : new BigDecimal(0));*/\n\n\n {\n BigDecimal controlStock = (BigDecimal) respuesta\n .getValueAt(i, \"IND_CTRL_STOC\");\n\n if (controlStock == null) {\n posiciones[i].setControlStock(false);\n } else {\n if (controlStock.intValue() == 1) {\n posiciones[i].setControlStock(true);\n } else {\n posiciones[i].setControlStock(false);\n }\n }\n }\n\n {\n BigDecimal controlLiquidacion = (BigDecimal) respuesta\n .getValueAt(i, \"IND_CTRL_LIQU\");\n\n if (controlLiquidacion == null) {\n posiciones[i].setControlLiquidacion(false);\n } else {\n if (controlLiquidacion.intValue() == 1) {\n posiciones[i].setControlLiquidacion(true);\n } else {\n posiciones[i].setControlLiquidacion(false);\n }\n }\n }\n\n {\n BigDecimal limiteVenta = (BigDecimal) respuesta\n .getValueAt(i, \"IND_LIMI_VENT\");\n\n if (limiteVenta == null) {\n posiciones[i].setLimiteVenta(false);\n } else {\n if (limiteVenta.intValue() == 1) {\n posiciones[i].setLimiteVenta(true);\n } else {\n posiciones[i].setLimiteVenta(false);\n }\n }\n }\n\n {\n BigDecimal unidades = (BigDecimal) respuesta\n .getValueAt(i, \"NUM_UNID_DEMA_REAL\");\n posiciones[i].setUnidadesDemandaReal((unidades != null) \n ? new Long(unidades.longValue()) : new Long(0));\n }\n\n {\n BigDecimal oidMarcaProducto = (BigDecimal) respuesta\n .getValueAt(i, \"MAPR_OID_MARC_PROD\");\n posiciones[i].setOidMarcaProducto(\n (oidMarcaProducto != null) ? new Long(oidMarcaProducto\n .longValue()) : null);\n }\n\n {\n BigDecimal oidUnidadNegocio = (BigDecimal) respuesta\n .getValueAt(i, \"UNEG_OID_UNID_NEGO\");\n posiciones[i].setOidUnidadNegocio(\n (oidUnidadNegocio != null) ? new Long(oidUnidadNegocio\n .longValue()) : null);\n }\n\n {\n BigDecimal oidNegocio = (BigDecimal) respuesta\n .getValueAt(i, \"NEGO_OID_NEGO\");\n posiciones[i].setOidNegocio((oidNegocio != null) \n ? new Long(oidNegocio.longValue()) : null);\n }\n\n {\n BigDecimal oidGenerico = (BigDecimal) respuesta\n .getValueAt(i, \"GENE_OID_GENE\");\n posiciones[i].setOidGenerico((oidGenerico != null) \n ? new Long(oidGenerico.longValue()) : null);\n }\n\n {\n BigDecimal oidSuperGenerico = (BigDecimal) respuesta \n .getValueAt(i, \"SGEN_OID_SUPE_GENE\");\n posiciones[i].setOidSuperGenerico(\n (oidSuperGenerico != null) ? new Long(oidSuperGenerico\n .longValue()) : null);\n }\n\n BigDecimal uniDemandadas = (BigDecimal) respuesta\n .getValueAt(i, \"NUM_UNID_DEMA\");\n posiciones[i].setUnidadesDemandadas((uniDemandadas != null) \n ? new Long(uniDemandadas.longValue()) : new Long(0));\n\n posiciones[i].setOidProducto(new Long(((BigDecimal) respuesta\n .getValueAt(i, \"OID_PROD\")).longValue()));\n \n BigDecimal oidTipoOferta = (BigDecimal) respuesta \n .getValueAt(i, \"TOFE_OID_TIPO_OFER\"); \n posiciones[i].setOidTipoOferta(\n (oidTipoOferta != null) ? new Long(oidTipoOferta\n .longValue()) : null);\n \n BigDecimal oidCicloVida = (BigDecimal) respuesta \n .getValueAt(i, \"CIVI_OID_CICLO_VIDA\"); \n posiciones[i].setOidCicloVida(\n (oidCicloVida != null) ? new Long(oidCicloVida\n .longValue()) : null);\n \n posiciones[i].setPrecioFacturaUnitarioLocal((BigDecimal) respuesta\n .getValueAt(i, \"VAL_PREC_FACT_UNIT_LOCA\"));\n \n posiciones[i].setPrecioNetoUnitarioLocal((BigDecimal) respuesta\n .getValueAt(i, \"VAL_PREC_NETO_UNIT_LOCA\"));\n \n // sapaza -- PER-SiCC-2011-0279 -- 07/06/2011\n if (solicitud.getIndDevolucion() && solicitud.isValidaReemplazo()) { \n BigDecimal codigoReemplazo = (BigDecimal) respuesta.getValueAt(i, \"COD_REEM\");\n \n if (codigoReemplazo == null) {\n posiciones[i].setProductoReemplazo(false);\n } else {\n if (codigoReemplazo.intValue() > 0) {\n posiciones[i].setProductoReemplazo(true);\n } else {\n posiciones[i].setProductoReemplazo(false);\n }\n }\n } else \n posiciones[i].setProductoReemplazo(false);\n \n // sapaza -- COL-SiCC-2013-0030 -- 28/11/2013 \n BigDecimal oidDetalleOferta = (BigDecimal) respuesta \n .getValueAt(i, \"OFDE_OID_DETA_OFER\"); \n posiciones[i].setOidDetalleOferta(\n (oidDetalleOferta != null) ? new Long(oidDetalleOferta.longValue()) : null); \n \n } // posiciones\n\n solicitud.setPosiciones(posiciones);\n }\n UtilidadesLog.info(\" DAOSolicitudes.obtenerPosicionesSolicitud(Solici\"\n +\"tud solicitud):Salida\");\n }", "public void iniciarProduccion(){\n try {\n Connection conn = Conectar.conectar();\n Statement st = conn.createStatement();\n ResultSet rs = st.executeQuery(\"select nick from usuarios where nick in(select usuario from construcciones) or nick \"\n +\"in(select usuario from investigaciones) or nick in(select usuario from movimientos)\");\n\n while(rs.next()){\n produccion.add(new Construcciones(rs.getString(1)));\n System.out.println(rs.getString(1));\n }\n\n st.close();\n rs.close();\n conn.close();\n\n }catch(SQLException e){\n System.out.println(\"Fallo actualizacion de produccion.\");\n }\n}", "private Simulation getSimulationSQL(QueryHashtable dbc, Connection con,User user, KeyValue simKey) \r\n\t\t\t\tthrows SQLException,DataAccessException,ObjectNotFoundException {\r\n\r\n\tString sql;\r\n\tField[] f = {userTable.userid,new cbit.sql.StarField(simTable)};\r\n\tTable[] t = {simTable,userTable};\r\n\tString condition = simTable.id.getQualifiedColName() + \" = \" + simKey +\r\n\t\t\t\" AND \" + userTable.id.getQualifiedColName() + \" = \" + simTable.ownerRef.getQualifiedColName();\r\n\tsql = DatabasePolicySQL.enforceOwnershipSelect(user,f,t,(LeftOuterJoin)null,condition,null);\r\n//System.out.println(sql);\r\n\tSimulation simulation = null;\r\n\tStatement stmt = con.createStatement();\r\n\ttry {\r\n\t\tResultSet rset = stmt.executeQuery(sql);\r\n\r\n\t\tif (rset.next()) {\r\n\t\t\t//\r\n\t\t\t// note: must call simulationTable.getSimulation() first (rset.getBytes(language) must be called first)\r\n\t\t\t//\r\n\t\t\ttry {\r\n\t\t\t\tsimulation = simTable.getSimulation(dbc, rset,con,user,mathDB,dbSyntax);\r\n\t\t\t}catch (PropertyVetoException e){\r\n\t\t\t\tlg.error(e.getMessage(),e);\r\n\t\t\t\tthrow new DataAccessException(e.getMessage());\r\n\t\t\t}\t\t\t\r\n\t\t} else {\r\n\t\t\tthrow new org.vcell.util.ObjectNotFoundException(\"Simulation id=\" + simKey + \" not found for user '\" + user + \"'\");\r\n\t\t}\r\n\t} finally {\r\n\t\tstmt.close(); // Release resources include resultset\r\n\t}\r\n\treturn simulation;\r\n}", "ObstacleQuery createObstacleQuery();", "WorldUps.UQuery getQueries(int index);", "public int getProblemId(String title) {\n int problemId = -1;\n String query = \"select id from problem where title=? \";\n try (Connection myConn = Database.getConnection();\n PreparedStatement statement = myConn.prepareStatement(query);) {\n statement.setString(1, title);\n try (ResultSet rs = statement.executeQuery();) {\n if (rs.next()) problemId = rs.getInt(\"id\");\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return problemId;\n }", "public Coup coupIA() {\n\n int propriete = TypeCoup.CONT.getValue();\n int bloque = Bloque.NONBLOQUE.getValue();\n Term A = intArrayToList(plateau1);\n Term B = intArrayToList(plateau2);\n Term C = intArrayToList(piecesDispos);\n Variable D = new Variable(\"D\");\n Variable E = new Variable(\"E\");\n Variable F = new Variable(\"F\");\n Variable G = new Variable(\"G\");\n Variable H = new Variable(\"H\");\n org.jpl7.Integer I = new org.jpl7.Integer(co.getValue());\n q1 = new Query(\"choixCoupEtJoue\", new Term[] {A, B, C, D, E, F, G, H, I});\n\n\n if (q1.hasSolution()) {\n Map<String, Term> solution = q1.oneSolution();\n int caseJ = solution.get(\"D\").intValue();\n int pion = solution.get(\"E\").intValue();\n Term[] plateau1 = listToTermArray(solution.get(\"F\"));\n Term[] plateau2 = listToTermArray(solution.get(\"G\"));\n Term[] piecesDispos = listToTermArray(solution.get(\"H\"));\n for (int i = 0; i < 16; i++) {\n if (i < 8) {\n this.piecesDispos[i] = piecesDispos[i].intValue();\n }\n this.plateau1[i] = plateau1[i].intValue();\n this.plateau2[i] = plateau2[i].intValue();\n }\n\n int ligne = caseJ / 4;\n int colonne = caseJ % 4;\n\n if (pion == 1 || pion == 5) {\n pion = 1;\n }\n if (pion == 2 || pion == 6) {\n pion = 0;\n }\n if (pion == 3 || pion == 7) {\n pion = 2;\n }\n if (pion == 4 || pion == 8) {\n pion = 3;\n }\n\n\n Term J = intArrayToList(this.plateau1);\n q1 = new Query(\"gagne\", new Term[] {J});\n System.out.println(q1.hasSolution() ? \"Gagné\" : \"\");\n if (q1.hasSolution()) {\n propriete = 1;\n }\n return new Coup(bloque,ligne, colonne, pion, propriete);\n }\n System.out.println(\"Bloqué\");\n return new Coup(1,0, 0, 0, 3);\n }", "@Test\r\n\tpublic void CT03ConsultarLivroComRaNulo() {\r\n\t\ttry {\r\n\t\t\t// cenario\r\n\t\t\t@SuppressWarnings(\"unused\")\r\n\t\t\tUsuario usuario;\r\n\t\t\t// acao\r\n\t\t\tusuario = ObtemUsuario.comRA_nulo();\r\n\t\t} catch (RuntimeException e) {\r\n\t\t\t// verificacao\r\n\t\t\tassertEquals(\"RA inválido\", e.getMessage());\r\n\t\t}\r\n\t}", "void query(int u, int v) {\n int lca = lca2(u, v, spar, dep);\n// out.println(query_up(u, lca) + \" dv\");\n// out.println(query_up(v, lca) + \" ds\");\n int ans = query_up(u, lca) + query_up(v, lca); // One part of path\n out.println(ans);\n// if (temp > ans) ans = temp; // take the maximum of both paths\n// printf(\"%d\\n\", ans);\n }", "HumidityQuery createHumidityQuery();", "@Test\n public void testQuery() {\n DataSetArgument lArgs = new DataSetArgument();\n lArgs.add( \"aMsgId\", \"100\" );\n\n QuerySet lQs = QuerySetFactory.getInstance()\n .executeQuery( \"com.mxi.mx.integration.query.process.LookupQueueId\", lArgs );\n\n Assert.assertEquals( \"Row Count\", 1, lQs.getRowCount() );\n\n lQs.next();\n\n Assert.assertEquals( \"Queue Id\", 1000, lQs.getInt( \"queue_id\" ) );\n }", "private synchronized String processGet(String query) {\r\n\t\tString[] valuesCommand = query.split(\" \");\r\n\t\tif ( valuesCommand.length != 2 )\r\n\t\t\treturn \"ERROR Bad syntaxe command GET - Usage : GET id\";\r\n\t\tString id = valuesCommand[1];\r\n\t\tif ( !this.bank.existAccount(id) ) {\r\n\t\t\treturn \"ERROR Account doesn't exist\";\r\n\t\t}\r\n\t\tdouble solde = this.bank.getSolde(id);\r\n\t\treturn \"SOLDE \" + solde + \" \" + this.bank.getLastOperation(id);\r\n\t}", "pb4server.QueryInfoByWorldAskReq getQueryInfoByWorldAskReq();", "public String issueGetRequest(String query) {\n URL url;\n String result = \"\";\n\n return \"valid\";\n /**\n * Todo: When server API is up and running uncomment this.\n *\n * try { url = new URL(server + \"?\" + query); BufferedReader br = new\n * BufferedReader(new InputStreamReader(url.openStream())); String\n * strTemp = \"\";\n * \n * while (null != (strTemp = br.readLine())) { result = strTemp; }\n * \n * } catch (Exception e) { e.printStackTrace(); }\n * \n * return result;\n */\n }", "public void cacheResult(suiluppo_equip_allocation suiluppo_equip_allocation);", "@ActionTrigger(action=\"QUERY\")\n\t\tpublic void spriden_Query()\n\t\t{\n\t\t\t\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tclearBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tclearBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tclearBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tenterQuery();\n//\t\t\t\tif ( SupportClasses.SQLFORMS.FormSuccess().not() )\n//\t\t\t\t{\n//\t\t\t\t\t\n//\t\t\t\t\tthrow new ApplicationException();\n//\t\t\t\t}\n\t\t\t}", "public FlowUnit getInputUnit(FlowUnit u, String arg) throws Exception\n\t\t{\n\t\tfor(FlowConn c:conns)\n\t\t\tif(c.toUnit==u && c.toArg.equals(arg))\n\t\t\t\treturn c.fromUnit;\n\t\treturn null;\n//\t\tthrow new Exception(\"Input not connected - \"+arg);\n\t\t}", "@Override\r\n public VehiculoModel consultarVehiculo(String placa) {\n Connection conn = null;\r\n VehiculoModel vehiculo = null; //defino un objeto de vehiculo como nulo\r\n try{\r\n conn = Conexion.getConnection();\r\n String sql = \"Select * from vehiculo where vehPlaca=?\";\r\n PreparedStatement statement = conn.prepareStatement(sql); //se prepara para la query\r\n statement.setString(1, placa);\r\n ResultSet result = statement.executeQuery(sql);\r\n while(result.next()){\r\n vehiculo = new VehiculoModel(result.getString(1), result.getString(2), result.getString(3), \r\n result.getInt(4), result.getInt(5), result.getString(6), result.getInt(7));\r\n }\r\n } catch (SQLException ex) {\r\n JOptionPane.showMessageDialog(null, \"Codigo : \" + ex.getErrorCode() + \"\\nError: \" + ex.getMessage());\r\n }\r\n \r\n return vehiculo;\r\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate CompoundQuery handleQuery() throws Exception{\n\t\tif (this.resultant != null && this.resultant.getResultsContainer() != null){\n\t\t\t//compoundQuery = (CompoundQuery) resultant.getAssociatedQuery();\n\t\t\tViewable view = newCompoundQuery.getAssociatedView();\n\t\t\tResultsContainer resultsContainer = this.resultant.getResultsContainer();\n\t\t\tsampleCrit = null;\n\t Collection sampleIDs = new ArrayList(); \n\t\t\t//Get the samples from the resultset object\n\t\t\tif(resultsContainer!= null){\n\t\t\t\tCollection samples = null;\n\t\t\t\tif(resultsContainer != null &&resultsContainer instanceof DimensionalViewContainer){\t\t\t\t\n\t\t\t\t\tDimensionalViewContainer dimensionalViewContainer = (DimensionalViewContainer)resultsContainer;\n\t\t\t\t\t\tCopyNumberSingleViewResultsContainer copyNumberSingleViewContainer = dimensionalViewContainer.getCopyNumberSingleViewContainer();\n\t\t\t\t\t\tGeneExprSingleViewResultsContainer geneExprSingleViewContainer = dimensionalViewContainer.getGeneExprSingleViewContainer();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(copyNumberSingleViewContainer!= null){\n\t\t\t\t\t\t\tSet<BioSpecimenIdentifierDE> biospecimenIDs = copyNumberSingleViewContainer.getAllBiospecimenLabels();\n\t\t\t\t \t\tfor (BioSpecimenIdentifierDE bioSpecimen: biospecimenIDs) {\n\t\t\t\t \t\t\tif(bioSpecimen.getSpecimenName()!= null){\n\t\t\t\t \t\t\t\tsampleIDs.add(new SampleIDDE(bioSpecimen.getSpecimenName()));\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(geneExprSingleViewContainer!= null){\n\t\t\t\t\t\t\tSet<BioSpecimenIdentifierDE> biospecimenIDs = geneExprSingleViewContainer.getAllBiospecimenLabels();\n\t\t\t\t \t\tfor (BioSpecimenIdentifierDE bioSpecimen: biospecimenIDs) {\n\t\t\t\t \t\t\tif(bioSpecimen.getSpecimenName()!= null){\n\t\t\t\t \t\t\t\t\tsampleIDs.add(new SampleIDDE(bioSpecimen.getSpecimenName()));\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t \t\tsampleCrit = new SampleCriteria();\n\t\t \t\t\tsampleCrit.setSampleIDs(sampleIDs);\n\n AddConstrainsToQueriesHelper constrainedSamplesHandler= new AddConstrainsToQueriesHelper();\n constrainedSamplesHandler.constrainQueryWithSamples(newCompoundQuery,sampleCrit);\n\t\t\t\tnewCompoundQuery = getShowAllValuesQuery(newCompoundQuery);\n\t\t\t\tnewCompoundQuery.setAssociatedView(view);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn newCompoundQuery;\n\t\t}", "private String getQuerySelecaoBonusPulaPula()\n\t{\n\t\tString result = \n\t\t\t\"SELECT \" +\n\t\t\t\" ID_CODIGO_NACIONAL, \" +\n\t\t\t\" VLR_BONUS_MINUTO, \" +\n\t\t\t\" VLR_BONUS_MINUTO_FF \" +\n\t\t\t\"FROM \" +\n\t\t\t\" TBL_GER_BONUS_PULA_PULA \";\n\t\t\n\t\treturn result;\n\t}", "@Override\r\n\tpublic String getCpQueryStatusLine(int asCuu) {\r\n\t\treturn String.format(\"TAPE %03X ON TAPE %03X\", asCuu, asCuu);\r\n\t}", "private boolean getEstadoProceso(int indiceProceso ,int CodEmp, int CodLoc, int CodCot){\n boolean blnRes=false;\n java.sql.Connection conLoc;\n java.sql.ResultSet rstLoc;\n java.sql.Statement stmLoc;\n try{ //null=No tiene;P=Pendiente;C=Completa\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(),objParSis.getUsuarioBaseDatos(),objParSis.getClaveBaseDatos());\n if(conLoc!=null){\n stmLoc = conLoc.createStatement();\n strSql=\"\";\n strSql+=\" SELECT a1.co_emp,a1.co_loc,a1.co_cot, \\n\";\n strSql+=\" CASE WHEN a1.st_solResInv IS NULL THEN 'N' ELSE a1.st_solResInv END as st_solResInv \\n\";\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\n strSql+=\" WHERE a1.co_emp=\"+CodEmp+\" AND a1.co_loc=\"+CodLoc+\" AND a1.co_cot=\"+CodCot+\" \\n\";\n rstLoc = stmLoc.executeQuery(strSql);\n if(rstLoc.next()){\n switch(indiceProceso){\n case 1: \n if(rstLoc.getString(\"st_solResInv\").equals(\"N\")) \n blnRes=true; \n break;\n case 2: \n if(rstLoc.getString(\"st_solResInv\").equals(\"P\"))\n blnRes=true;\n break;\n case 3: \n if(rstLoc.getString(\"st_solResInv\").equals(\"C\"))\n blnRes=true;\n break;\n } \n }\n rstLoc.close();\n rstLoc=null;\n stmLoc.close();\n stmLoc=null;\n conLoc.close();\n conLoc=null;\n }\n \n }\n catch (java.sql.SQLException e){\n blnRes=false;\n objUti.mostrarMsgErr_F1(this, e);\n }\n catch (Exception e){\n blnRes=false;\n objUti.mostrarMsgErr_F1(this, e);\n }\n return blnRes;\n }", "String query();", "public long query(Date timestamp, String user, String hostname, Long referral, String questionText, InputMode mode);", "public String consultaEqCiudad() {\n\t\tString res = \"\";\n\t\tString query = \"SELECT E.NOMBRE, C.NOMBRE FROM EQUIPOS E, CIUDADES C WHERE E.COD_CIUDAD == C.CODIGO\";\n\n\t\tConnection con = null;\n\t\tPreparedStatement pstmt = null;\n\t\tResultSet rslt = null;\n\n\t\ttry {\n\t\t\tcon = acceso.getConnection();\n\t\t\tpstmt = con.prepareStatement(query);\n\t\t\trslt = pstmt.executeQuery();\n\n\t\t\twhile (rslt.next()) {\n\t\t\t\tres = res + rslt.getString(1) + \" - \" + rslt.getString(2) + \"\\n\";\n\t\t\t}\n\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (rslt != null)\n\t\t\t\t\trslt.close();\n\t\t\t\tif (pstmt != null)\n\t\t\t\t\tpstmt.close();\n\t\t\t\tif (con != null)\n\t\t\t\t\tcon.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\treturn res;\n\t}", "public static void analyzeRuleComponentsQueries() throws SQLException\r\n\t{\r\n\t\tStatement stat = conn.createStatement();\r\n \r\n ResultSet result = stat.executeQuery(\"SELECT * FROM fraud.afm_fraudscorerecord_afm_rulecomponentrecord\");\r\n \r\n while (result.next())\r\n {\r\n \tString queryId = result.getString(\"afm_fraudscorerecord_recordId\");\r\n \tString ruleId = result.getString(\"ruleComponentRecords_componentId\");\r\n \t\r\n \t\r\n \t\tStatement stat2 = conn.createStatement();\r\n \t\r\n \t\tResultSet s = stat2.executeQuery(\"SELECT * FROM fraud.afm_fraudscorerecord where recordId='\"+queryId+\"';\");\r\n \t \t\t\r\n \t\t\r\n \t\twhile (s.next())\r\n \t\t{\r\n \t\t\t\tSystem.out.print(new Date(s.getInt(\"timestamp\")));\r\n \t\t\t\tSystem.out.print(\" UserID: \" +s.getString(\"userId\"));\r\n \t\t\tSystem.out.print(\" Query Type: \" + s.getString(\"queryType\"));\r\n \t\t\t//System.out.print(\" Amount: \" + s.getDouble(\"transactionAmount\"));\r\n \t\t}\r\n \t\t\r\n \t\t\r\n \t\tResultSet t = stat2.executeQuery(\"SELECT * FROM fraud.afm_rulecomponentrecord where componentId='\"+ruleId+\"';\");\r\n \t\r\n \t\t\r\n \t\twhile (t.next())\r\n \t\t{\r\n \t\t\tSystem.out.print(\" >>>>> Rule Name: \" + t.getString(\"ruleLongName\"));\r\n \t\t\t//System.out.print(\" Amount: \" + s.getDouble(\"transactionAmount\"));\r\n \t\t}\r\n \t\r\n \t\r\n \tSystem.out.println();\r\n \t}\r\n \t\r\n stat.close();\r\n \r\n\t}", "public String getResult(){\n \tString result = \"OK\";\n System.out.print(this.mainQuery);\n Query query = QueryFactory.create(this.mainQuery);\n Query querycount = QueryFactory.create(this.countQuery);\n //System.out.println(this.countQuery);\n QueryExecution qexecCount = QueryExecutionFactory.create(querycount, Initialisation.getModel());\n QueryExecution qexec = QueryExecutionFactory.create(query, Initialisation.getModel());\n try{\n \torg.apache.jena.query.ResultSet results = qexec.execSelect();\n //////////////////////////\n org.apache.jena.query.ResultSet resultsCount = qexecCount.execSelect();\n \tint compteur = 0;\n while (resultsCount.hasNext()){\n QuerySolution soln = resultsCount.nextSolution();\n compteur = soln.getLiteral(\"count\").getInt();\n }\n //System.out.println(\"Compteur = \"+compteur );\n if(compteur>1){\n return \"NONE\";\n }\n else if (compteur==0){\n return \"NF\";\n }\n /////////////////////////\n \twhile (results.hasNext()){\n \t\tcompteur++;\n \t\tQuerySolution soln = results.nextSolution();\n \t\tLiteral title = soln.getLiteral(\"label\");\n \t\tLiteral comment = soln.getLiteral(\"comment\");\n \t\tthis.title = title.getString().replace(\"-\",\" \");\n \t\ttry{\n \t\tthis.comment = comment.getString();\n \t\t}\n \t\tcatch(NullPointerException e){\n \t\t\tthis.comment = \"There is not any summary available for this film.\";\n \t\t}\n \t}\n\n }\n finally{\n \tqexec.close();\n }\n \n return result;\n }", "private String getq_nn(String object_type, ArrayList<String> other_param) {\n\t\tString txt = \"\";\n\t\tString building_id = null;\n\t\tint k = 0;\n\t\tString query = null;\n\t\ttry {\n\t\t\tbuilding_id = other_param.get(0);\n\t\t\tk = Integer.parseInt(other_param.get(1));\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t\ttxt += \"Invalid parameters!\";\n\t\t}\n\t\t\n\t\tif(object_type.equals(\"building\")) {\n\t\t\tquery = \"SELECT b1.b_id as id, glength( LineStringFromWKB(LineString( \" +\n\t\t\t\t\t\t\t\t\t\t\"Centroid(b1.pol), b2.center))) as dist \" +\n\t\t\t\t\t\"FROM building b1, (SELECT b_id, Centroid(pol) as center \" +\n\t\t\t\t\t\t\t\t\t\t\"FROM building \" +\n\t\t\t\t\t\t\t\t\t\t\"WHERE b_id='\"+ building_id +\"' ) as b2 \" +\n\t\t\t\t\t\"WHERE b1.b_id <> b2.b_id \" +\n\t\t\t\t\t\"AND b1.fire=0 \" +\n\t\t\t\t\t\"ORDER BY dist ASC \" +\n\t\t\t\t\t\"LIMIT \"+ k +\";\";\n\t\t}\n\t\telse if(object_type.equals(\"firehydrant\")) {\n\t\t\tquery = \"SELECT h.h_id as id, glength( LineStringFromWKB(LineString( \" +\n\t\t\t\t\t\t\t\t\t\t\"geo, b.center))) as dist \" +\n\t\t\t\t\t\"FROM hydrant h, (SELECT b_id, Centroid(pol) as center \" +\n\t\t\t\t\t\t\t\t\t\t\"FROM building \" +\n\t\t\t\t\t\t\t\t\t\t\"WHERE b_id='\"+ building_id +\"' ) as b \" +\n\t\t\t\t\t\"ORDER BY dist ASC \" +\n\t\t\t\t\t\"LIMIT \"+ k +\";\";\n\t\t}\n\t\telse if(object_type.equals(\"firebuilding\")) {\n\t\t\tquery = \"SELECT b1.b_id as id, glength( LineStringFromWKB(LineString( \" +\n\t\t\t\t\t\t\t\t\t\t\"Centroid(b1.pol), b2.center))) as dist \" +\n\t\t\t\t\t\"FROM building b1, (SELECT b_id, Centroid(pol) as center \" +\n\t\t\t\t\t\t\t\t\t\t\"FROM building \" +\n\t\t\t\t\t\t\t\t\t\t\"WHERE b_id='\"+ building_id +\"' ) as b2 \" +\n\t\t\t\t\t\"WHERE b1.b_id <> b2.b_id \" +\n\t\t\t\t\t\"AND b1.fire=1 \" +\n\t\t\t\t\t\"ORDER BY dist ASC \" +\n\t\t\t\t\t\"LIMIT \"+ k +\";\";\n\t\t}\n\t\telse { txt += \"Invalid parameters!\"; }\n\t\t\n\t\tif(query != null) {\n\t\t\ttry {\n\t\t\t\tResultSet rs = this.exec_query(query);\n\t\t\t\twhile(rs.next()) {\n\t\t\t\t\ttxt += \"\\n\" + rs.getString(\"id\");\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\tSystem.out.println(\"SQL Error!\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.txt_area.append(txt);\n\t\treturn txt;\n\t}", "Jugador consultarGanador();", "public void okFind()\n {\n ASPManager mgr = getASPManager();\n\n trans.clear();\n q = trans.addQuery(headblk);\n q.addWhereCondition(\"WO_NO<(SELECT Number_Serie_API.Get_Last_Wo_Number FROM DUAL) AND CONTRACT IN(SELECT User_Allowed_Site_API.Authorized(CONTRACT) FROM DUAL)\");\n q.addWhereCondition(\"CONNECTION_TYPE_DB = 'EQUIPMENT'\");\n q.includeMeta(\"ALL\");\n\n // nimhlk - Begin\n if (mgr.dataTransfered())\n {\n ASPBuffer retBuffer = mgr.getTransferedData();\n if (retBuffer.itemExists(\"WO_NO\"))\n {\n String ret_wo_no = retBuffer.getValue(\"WO_NO\");\n q.addWhereCondition(\"WO_NO = ?\");\n q.addParameter(\"WO_NO\",ret_wo_no);\n }\n else\n q.addOrCondition(mgr.getTransferedData());\n }\n // nimhlk - End\n\n mgr.querySubmit(trans,headblk);\n\n if (headset.countRows() == 0)\n {\n mgr.showAlert(mgr.translate(\"PCMWACTIVESEPARATENODATA: No data found.\"));\n headset.clear();\n }\n if (headset.countRows() == 1)\n {\n lay.setLayoutMode(lay.SINGLE_LAYOUT);\n }\n mgr.createSearchURL(headblk);\n }", "public static void main(String[] args) throws Exception {\n\t\tString folderURL = \"C:\\\\Users\\\\Administrator\\\\Google ÔÆ¶ËÓ²ÅÌ\\\\Slides\\\\CS686\\\\A2\\\\SodukoProblem\\\\problems\\\\\";\n\t\tList<String> nameList = Loader.getAllSdURLFromFolder(folderURL);\n\t\tList<Solution> record = new ArrayList<Solution>();\n\t\tfor (String name:nameList)\n\t\t{\n\t\t\t//System.out.println(name);\n\t\t\tBoard board = Loader.loadInitialBoard(name);\n\t\t\tSudokuSolver solver = SudokuSolver.getInstance();\n\t\t\tSolution solution = solver.solve(board);\n\t\t\trecord.add(solution);\n\t\t\tSystem.out.print(solution.initNum+\" \");\n\t\t\tSystem.out.print(solution.cntState+\" \");\n\t\t\t//System.out.println(solution.board);\n\t\t\tSystem.out.println(solution.isFinished?\"Finished\":\"Failed\");\n\t\t\tif (solution.cntState>0)\n\t\t\t{\n\t\t\t\tSystem.out.println(board);\n\t\t\t\tSystem.out.println(solution.board);\n\t\t\t}\n\t\t\t//if (!solution.isFinished) break;\n\t\t}\n\t\t//printStatistics(record);\n\t\t\n\t}", "public String validarAsociacion(String nombre, String dpi, String codigo_cuenta, String codigo_cliente) {\n String mensaje = \"\";\n DM_Cliente dmcli = new DM_Cliente();\n DM_Solicitud dmsol = new DM_Solicitud();\n try {\n Cliente cliente = dmcli.validarCliente(nombre, dpi);\n PreparedStatement PrSt;\n ResultSet rs = null;\n String Query = \"SELECT * FROM Cuenta WHERE Codigo = ?\";\n PrSt = conexion.prepareStatement(Query);\n PrSt.setString(1, codigo_cuenta);\n if (cliente != null) {\n rs = PrSt.executeQuery();\n if (rs.next()) {\n java.util.Date d = new java.util.Date();\n java.sql.Date fecha = new java.sql.Date(d.getTime());\n Solicitud solicitud = new Solicitud();\n solicitud.setEmisor(codigo_cliente);\n solicitud.setReceptor(cliente.getCodigo());\n solicitud.setCodigo_cuenta(codigo_cuenta);\n solicitud.setEstado(\"Pendiente\");\n solicitud.setFecha(fecha);\n mensaje = dmsol.agregarSolicitud(solicitud);\n } else {\n mensaje = \"La cuenta no existe\";\n }\n } else {\n mensaje = \"El dueño de la cuenta no existe\";\n }\n PrSt.close();\n rs.close();\n } catch (SQLException e) {\n System.out.println(e.toString());\n }\n return mensaje;\n }", "public static void main(String[] args) throws SQLException, ClassNotFoundException {\r\n Statement s = DBConnect.connection.createStatement();\r\n String selTable1 = \"SELECT Item AS rslt, Desc1 As rslt2 FROM item_master WHERE Item = '\" + getSkuInput() + \"'\";\r\n s.execute(selTable1);\r\n ResultSet rs1 = s.getResultSet();\r\n if (rs1.next() && Integer.parseInt(rs1.getString(\"rslt\")) >= 702630 && Integer.parseInt(rs1.getString(\"rslt\")) <= 702672) {\r\n rproSKU = rs1.getString(\"rslt\");\r\n prodName = rs1.getString(\"rslt2\");\r\n // prodCost = rs1.getString(\"rslt3\");\r\n skuRslt = \"good\";\r\n } else {\r\n skuRslt = \"bad\";\r\n prodName = \"No Name Available\";\r\n }\r\n }", "private void enviarCorreoSolicitudDenegada(int CodEmp, int CodLoc, int CodCot){\n java.sql.Connection conLoc;\n java.sql.Statement stmLoc;\n java.sql.ResultSet rstLoc;\n try{\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(), objParSis.getUsuarioBaseDatos(), objParSis.getClaveBaseDatos());\n if(conLoc!=null){\n stmLoc=conLoc.createStatement();\n strSql= \" SELECT a2.tx_corEle \\n\";\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\n strSql+=\" INNER JOIN tbm_usr as a2 ON (a1.co_usrIng=a2.co_usr) \\n\";\n strSql+=\" WHERE a1.co_emp=\"+CodEmp+\" AND a1.co_loc=\"+CodLoc+\" AND a1.co_cot=\"+CodCot+\" \";\n rstLoc = stmLoc.executeQuery(strSql);\n if(rstLoc.next()){\n objCorEle.enviarCorreoMasivo(rstLoc.getString(\"tx_corEle\"), \"Sistema de Reservas: \", \"La solicitud de reserva, que corresponde a la cotizacion \"+CodCot+\" ha sido denegada.\");\n }\n rstLoc.close();\n rstLoc=null;\n stmLoc.close();\n stmLoc=null;\n conLoc.close();\n conLoc=null;\n }\n }\n catch (java.sql.SQLException e) { \n \n objUti.mostrarMsgErr_F1(this, e); \n }\n catch(Exception Evt){ \n objUti.mostrarMsgErr_F1(this, Evt);\n } \n }", "public int buscarCuenta (String cuenta){// busca el dni de los jugadores pasando un parametro cuenta valido\r\n\t\tString cadena=\"SELECT Dni_Jugador FROM jugadores where Cuenta_Bancaria='\"+cuenta+\"'\";\r\n\t\ttry{\r\n\t\t\tthis.abrir();\r\n\t\t\ts=c.createStatement(); // similar al anterior\r\n\t\t\treg=s.executeQuery(cadena);\r\n\t\t\twhile(reg.next()){ //mientras exista un próximo registro, retorna 1 o 0 si no hay mas registros\r\n\t\t\t\ts.close();\r\n\t\t\t\tthis.cerrar();\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t\ts.close();\r\n\t\t\tthis.cerrar();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tcatch ( SQLException e){\r\n\t\t\tthis.cerrar();\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t}", "public void query() throws Exception{\n\t\tm_service = new DistrictService();\n\t\t//String queryStr=\"~`~`~`~`~`~@~#\";\n\t\t//String queryStr=\"~`PK~`京北~`~`~`~@~#\";\n\t\t//查询用的类似Queery,查询条件是Query里面的,位置按照Query里面的来\n\t\t//String saveStr = \"~`哈迪~`达鲁~`哥本~`~`~`C~`9898~`9898~`0~`~`0~`~`从DHL地区表中导入~`N~`N~`N~`~`~`~`~`~`~`EMS~`~`~@~#\";\t\n\n\t\tString queryStr = \"~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`EMS~`~`~@~#\";\t\n\t\tDecoder objPD = new Decoder(queryStr);\n\t\tString objReturn = \tm_service.query(objPD);\n\t\tSystem.out.println(objReturn);\n\t}", "public void Query() {\n }", "@Override\n\tpublic int queryOneticketornotBycode(String code) {\n\t\treturn 0;\n\t}", "private boolean validaTerminalesLSSegunEmpresaLocal(int CodEmp,int CodLoc, int CodCot){\n boolean blnRes=true;\n java.sql.Statement stmLoc;\n java.sql.ResultSet rstLoc;\n java.sql.Connection conLoc;\n try{\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(), objParSis.getUsuarioBaseDatos(), objParSis.getClaveBaseDatos());\n if (conLoc!=null){\n stmLoc=conLoc.createStatement();\n strSql=\"\"; \n strSql+=\" SELECT a1.co_emp, a1.co_loc, a1.co_cot, a2.tx_codALt, trim(SUBSTR (UPPER(a2.tx_codalt), length(a2.tx_codalt) ,1)) as terminal,\\n\";\n strSql+=\" CASE WHEN ( (trim(SUBSTR (UPPER(a3.tx_codalt), length(a3.tx_codalt) ,1)) IN ( \\n\";\n strSql+=\" SELECT UPPER(trim(tx_cad)) FROM tbm_reginv WHERE co_emp=\"+CodEmp+\" AND co_loc=\"+CodLoc+\" \\n\";\n strSql+=\" AND co_tipdoc=228 AND co_usr=(SELECT co_usrIng from tbm_cabCotVen WHERE co_emp=\"+CodEmp+\" AND co_loc=\"+CodLoc+\" AND co_cot=\"+CodCot+\" ) AND st_reg='A' /* AND st_tipmov='C' */ \\n\";\n strSql+=\" ))) THEN 'S' ELSE 'N' END as isterL \\n\";\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\n strSql+=\" INNER JOIN tbm_detCotVen as a2 ON (a1.co_emp=a2.co_emp AND a1.co_loc=a2.co_loc AND a1.co_cot=a2.co_cot) \\n\";\n strSql+=\" INNER JOIN tbm_inv as a3 ON (a2.co_emp=a3.co_emp AND a2.co_itm=a3.co_itm) \\n\";\n strSql+=\" WHERE a1.co_emp=\"+CodEmp+\" and a1.co_loc=\"+CodLoc+\" and a1.co_cot=\"+CodCot+\" \\n\";\n System.out.println(\"validaTerminalesLSSegunEmpresaLocal... \"+ strSql);\n rstLoc = stmLoc.executeQuery(strSql);\n while(rstLoc.next()){\n if(rstLoc.getString(\"terminal\").equals(\"L\") ){\n if(rstLoc.getString(\"isterL\").equals(\"N\")){\n blnRes=false;\n } \n }\n }\n rstLoc.close();\n rstLoc=null;\n stmLoc.close();\n stmLoc=null;\n conLoc.close();\n conLoc=null;\n }\n }\n catch (java.sql.SQLException e){\n objUti.mostrarMsgErr_F1(this, e);\n blnRes=false; \n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(null, e);\n blnRes=false;\n }\n return blnRes;\n }", "String queryInformation(String tableName,String queryname){\n Connection con = GetDBConnection.connectDB(\"booklibrarymanager\",\"root\",\"HanDong85\");\n String tar;\n if(tableName.equals(\"authorinformation\"))\n tar = \"author\";\n else if(tableName.equals(\"classificationinformation\"))\n tar = \"classification\";\n else tar = \"press\";\n String sql = \"select \" + tar + \"Id\" + \" from \" + tableName + \" where \";\n if(tableName.equals(\"authorinformation\"))\n sql += \"authorName = ?;\";\n else if(tableName.equals(\"classificationinformation\"))\n sql += \"classifcationName = ?;\";\n else sql += \"pressName = ?;\";\n System.out.println(sql);\n PreparedStatement preSQL;\n try{\n preSQL = con.prepareStatement(sql);\n preSQL.setString(1,queryname);\n ResultSet rs = preSQL.executeQuery();\n rs.beforeFirst();\n if(rs.next()){\n String ans = rs.getString(1);\n GetDBConnection.closeCon(con);\n return ans;\n }\n else{\n GetDBConnection.closeCon(con);\n return ERROR_TIP;\n }\n }\n catch (SQLException e){\n GetDBConnection.closeCon(con);\n return ERROR_TIP;\n }\n }", "private String getQuerySelecaoClientesRebarba()\n\t{\n\t\tString result = \n\t\t\t\"SELECT \"\n\t\t\t+\t\" P_ASSINANTE.IDT_MSISDN, \" \n\t\t\t+\t\" P_ASSINANTE.IDT_PROMOCAO, \"\n\t\t\t+\t\" P_ASSINANTE.DAT_EXECUCAO, \" \n\t\t\t+\t\" P_ASSINANTE.DAT_ENTRADA_PROMOCAO, \"\n\t\t\t+\t\" P_ASSINANTE.IND_SUSPENSO, \"\n\t\t\t+\t\" P_ASSINANTE.IND_ISENTO_LIMITE, \"\n\t\t\t+\t\" ASSINANTE.IDT_STATUS, \" \n\t\t\t+\t\" ASSINANTE.VLR_SALDO_PRINCIPAL, \" \n\t\t\t+\t\" ASSINANTE.DAT_EXPIRACAO_PRINCIPAL, \" \n\t\t\t+\t\" PROMOCAO.IND_ZERAR_SALDO_BONUS, \" \n\t\t\t+\t\" PROMOCAO.IND_ZERAR_SALDO_SMS, \" \n\t\t\t+\t\" PROMOCAO.IND_ZERAR_SALDO_GPRS, \" \n\t\t\t//A divisao por 60 deve-se a alteracao da carga de CDRs para preencher os valores da \n\t\t\t//TBL_GER_TOTALIZACAO_PULA_PULA em segundos e nao minutos, de forma a diminuir a perda de precisao.\n\t\t\t+\t\" NVL(MINUTOS.MIN_CREDITO, 0)/60 AS MIN_CREDITO, \" \n\t\t\t+\t\" NVL(MINUTOS.MIN_FF, 0)/60 AS MIN_FF \" \n\t\t\t+\t\"FROM \"\n\t\t\t+\t\" TBL_APR_ASSINANTE ASSINANTE, \"\n\t\t\t+\t\" TBL_GER_PROMOCAO PROMOCAO, \" \n\t\t\t+\t\" TBL_GER_PROMOCAO_ASSINANTE P_ASSINANTE, \" \n\t\t\t+\t\" TBL_GER_TOTALIZACAO_PULA_PULA MINUTOS \"\n\t\t\t+\t\"WHERE \"\n\t\t\t+\t\" ASSINANTE.IDT_MSISDN = P_ASSINANTE.IDT_MSISDN AND \"\n\t\t\t+\t\" P_ASSINANTE.IDT_PROMOCAO = PROMOCAO.IDT_PROMOCAO AND \"\n\t\t\t+\t\" P_ASSINANTE.IDT_MSISDN = MINUTOS.IDT_MSISDN (+) AND \"\n\t\t\t+\t\" P_ASSINANTE.IDT_PROMOCAO = ? AND \"\n\t\t\t//Descartar assinantes que entraram na promocao no mes da execucao\n\t\t\t+\t\" MINUTOS.DAT_MES (+) = ? AND \"\n\t\t\t+\t\" P_ASSINANTE.DAT_ENTRADA_PROMOCAO < ? AND \"\n\t\t\t+\t\" PROMOCAO.IDT_CATEGORIA = \" \n\t\t\t+\t\tString.valueOf(ID_CATEGORIA_PULA_PULA) + \" AND \"\n\t\t\t//PONTO DE ATENCAO: Verificar pela fila de recargas e nao pela tabela de recargas devido aos\n\t\t\t//agendamentos (Se a execucao na fila de recargas ainda nao tiver sido realizada, o registro na\n\t\t\t//fila sera duplicado)\n\t\t\t+\t\" NOT EXISTS \"\n\t\t\t+\t\" ( \"\n\t\t\t+\t\" SELECT 1 \" \n\t\t\t+\t\" FROM \"\n\t\t\t+\t\" TBL_REC_FILA_RECARGAS RECARGAS \" \n\t\t\t+\t\" WHERE \" \n\t\t\t+\t\" RECARGAS.IDT_MSISDN = P_ASSINANTE.IDT_MSISDN AND \"\n\t\t\t+\t\" RECARGAS.TIP_TRANSACAO = ? AND \"\n\t\t\t+\t\" RECARGAS.IDT_STATUS_PROCESSAMENTO IN \" \n\t\t\t+\t\" (\" \n\t\t\t+\t\t\t\tString.valueOf(REC_STATUS_NAO_EXECUTADO) + \", \" \n\t\t\t+\t\t\t\tString.valueOf(REC_STATUS_OK) + \", \"\n\t\t\t+\t\t\t\tString.valueOf(REC_STATUS_TESTE_PULA_PULA) \n\t\t\t+\t\" ) AND \"\n\t\t\t+\t\" RECARGAS.DAT_EXECUCAO >= ? AND \"\n\t\t\t+\t\" RECARGAS.DAT_EXECUCAO < ? \"\n\t\t\t+\t\" ) AND \"\n\t\t\t//Descartar assinantes que nao possuem ligacoes\n\t\t\t+\t\" NOT EXISTS \"\n\t\t\t+\t\" ( \"\n\t\t\t+\t\" SELECT 1 \" \n\t\t\t+\t\" FROM \"\n\t\t\t+\t\" TBL_GER_HISTORICO_PULA_PULA HISTORICO \" \n\t\t\t+\t\" WHERE \" \n\t\t\t+\t\" HISTORICO.IDT_MSISDN = P_ASSINANTE.IDT_MSISDN AND \"\n\t\t\t+\t\" HISTORICO.DAT_EXECUCAO BETWEEN ? AND ? AND \" \n\t\t\t+\t\" HISTORICO.IDT_CODIGO_RETORNO = \" + String.valueOf(RET_PULA_PULA_LIGACOES_NOK) \n\t\t\t+\t\" ) \";\n\n\t\treturn result;\n\t}", "@ActionTrigger(action=\"QUERY_RECS\")\n\t\tpublic void spriden_QueryRecs()\n\t\t{\n\t\t\t\n\n\t\t\t\tSpridenAdapter spridenElement = (SpridenAdapter)this.getFormModel().getSpriden().getRowAdapter(true);\n\t\t\t\tSgbstdnAdapter sgbstdnElement = (SgbstdnAdapter)this.getFormModel().getSgbstdn().getRowAdapter(true);\n\t\t\t\tSovlcurAdapter sovlcurElement = (SovlcurAdapter)this.getFormModel().getSovlcur().getRowAdapter(true);\n\n\t\t\t\tif(spridenElement!=null && sgbstdnElement!=null && sovlcurElement!=null){\n\n\t\t\t\ttry { \n\t\t\t\t\tMessageServices.setMessageLevel(OracleMessagesLevel.decodeMessageLevel(5));\n\t\t\t\t// \n\t\t\t\tnextBlock();\n\t\t\t\t// soundex\n\t\t\t\tnextBlock();\n\t\t\t\t// spraddr \n\t\t\t\texecuteQuery();\n\t\t\t\tnextBlock();\n\t\t\t\t// sgbstdn \n\t\t\t\texecuteQuery();\n\t\t\t\tnextBlock();\n\t\t\t\t// sfbetrm \n\t\t\t\texecuteQuery();\n\t\t\t\t// execute the query on sovlcur and sovlfos \n\t\t\t\tgetFormModel().getSCurriculaSummary().setSummaryPidm(spridenElement.getSpridenPidm());\n\t\t\t\tgetFormModel().getSCurriculaSummary().setSummaryCode(SbCurriculumStr.fLearner());\n\t\t\t\tgetFormModel().getSCurriculaSummary().setSummaryKeySeqno(toNumber(99));\n\t\t\t\tgetFormModel().getSCurriculaSummary().setSummaryTermCode(sgbstdnElement.getSgbstdnTermCodeEff());\n\t\t\t\tgetFormModel().getSCurriculaSummary().setSummaryEndTerm(SbLearner.fQueryEnd(spridenElement.getSpridenPidm(), sgbstdnElement.getSgbstdnTermCodeEff()));\n\t\t\t\tif ( !sgbstdnElement.getSgbstdnTermCodeEff().isNull() )\n\t\t\t\t{\n\t\t\t\t\t// Create SOTVCUR since this is a learner curriculum \n\t\t\t\t\tSoklcur.pCreateSotvcur(/*pPidm=>*/getFormModel().getSCurriculaSummary().getSummaryPidm(), /*pTermCode=>*/getFormModel().getSCurriculaSummary().getSummaryTermCode(), /*pLmodCode=>*/getFormModel().getSCurriculaSummary().getSummaryCode());\n\t\t\t\t\t// Now execute the query on summary blocks \n\t\t\t\t\tgoBlock(\"SOVLCUR\");\n\t\t\t\t\texecuteQuery();\n\t\t\t\t\tif ( !sovlcurElement.getSummaryRowid().isNull() )\n\t\t\t\t\t{\n\t\t\t\t\t\tgoBlock(\"SOVLFOS\");\n\t\t\t\t\t\texecuteQuery();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tgoBlock(\"SOVLFOS\");\n\t\t\t\t\t\tclearBlock();\n\t\t\t\t\t}\n\t\t\t\t\tgoBlock(\"SFBETRM\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tgoBlock(\"SOVLFOS\");\n\t\t\t\t\tclearBlock();\n\t\t\t\t\tgoBlock(\"SOVLCUR\");\n\t\t\t\t\tclearBlock();\n\t\t\t\t}\n\t\t\t\t// - sgbstdn term is not null \n\t\t\t\tgoBlock(\"SFBETRM\");\n\t\t\t\tpreviousBlock();\n\t\t\t\t// sgbstdn\n\t\t\t\tpreviousBlock();\n\t\t\t\t// spraddr\n\t\t\t\tpreviousBlock();\n\t\t\t\t// soundex \n\t\t\t\tpreviousBlock();\n\t\t\t\t// spriden \n\t\t\t\t// \n\t\t\t\t\n\t\t\t\t} finally {\n\t\t\t\t\t\t\t\n\t\t\t\t\tMessageServices.setMessageLevel(OracleMessagesLevel.decodeMessageLevel(0));\n\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}", "@Query\n\tpublic UinEntity findUnusedUin();", "@Test\n public void testQuery() throws Exception {\n\n // Create a second requirement on CHECK 1\n EventKey lReq2Event = new EventKey( 4650, 999 );\n EvtEventTable lEvtEvent = EvtEventTable.create( lReq2Event );\n lEvtEvent.setEventSdesc( \"requirement 2 on check 1\" );\n lEvtEvent.setHEvent( StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1.getEventKey() );\n lEvtEvent.setNhEvent( StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1.getEventKey() );\n lEvtEvent.setHistBool( false );\n lEvtEvent.insert();\n\n TaskKey lReq2Task = new TaskKey( lReq2Event );\n SchedStaskTable lSchedStask = SchedStaskTable.create( lReq2Task );\n lSchedStask.setTaskClass( RefTaskClassKey.REQ );\n lSchedStask.insert();\n\n // Associate loose JIC tasks with labour requirements to a check\n StationCapacityData.assignTaskToCheck(\n StationCapacityData.Task.Labour.TASK_WITH_AVAILABLE_LABOUR_ON_DAY_1,\n StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1,\n StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1_REQUIREMENT );\n StationCapacityData.assignTaskToCheck(\n StationCapacityData.Task.Labour.TASK_WITH_UNAVAILABLE_LABOUR_ON_DAY_1,\n StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1,\n StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1_REQUIREMENT );\n StationCapacityData.assignTaskToCheck(\n StationCapacityData.Task.Labour.TASK_WITH_WARNING_LABOUR_ON_DAY_1,\n StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1, lReq2Task );\n\n // Execute the query\n DataSet lDs = execute( StationCapacityData.Location.YOW_LINE, StationCapacityData.DAY_DT_1 );\n\n // Ensure five are returned - the table will have two labour skills for the check, two labour\n // rows for requirement 1 and one labour row for requirement 2\n\n MxAssert.assertEquals( \"Number of retrieved rows\", 5, lDs.getRowCount() );\n\n // Assert that the contents of the 4 rows\n assertRow( lDs, StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1, RefLabourSkillKey.ENG,\n 21.0 );\n assertRow( lDs, StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1, RefLabourSkillKey.LBR,\n 5.0 );\n assertRow( lDs, StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1_REQUIREMENT,\n RefLabourSkillKey.ENG, 12.0 );\n assertRow( lDs, StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1_REQUIREMENT,\n RefLabourSkillKey.LBR, 5.0 );\n assertRow( lDs, lReq2Task, RefLabourSkillKey.ENG, 9.0 );\n\n // unassign the jobcards from the requirement\n StationCapacityData.unassignTaskFromCheck(\n StationCapacityData.Task.Labour.TASK_WITH_AVAILABLE_LABOUR_ON_DAY_1 );\n StationCapacityData.unassignTaskFromCheck(\n StationCapacityData.Task.Labour.TASK_WITH_UNAVAILABLE_LABOUR_ON_DAY_1 );\n StationCapacityData.unassignTaskFromCheck(\n StationCapacityData.Task.Labour.TASK_WITH_WARNING_LABOUR_ON_DAY_1 );\n\n // Delete the second requirement\n lSchedStask.delete();\n lEvtEvent.delete();\n }", "@Override\n\tpublic String getProblem() {\n\t\treturn \"Le circuit est vide\";\n\t}", "public int checkNIC(String NIC) {\n try {\n con = (Connection) DriverManager.getConnection(url, this.usernamel, this.passwordl);\n String query = \"SELECT NIC FROM user\";\n pst = (com.mysql.jdbc.PreparedStatement) con.prepareStatement(query);\n rs = pst.executeQuery();\n while (rs.next()) {\n if (NIC.equals(rs.getString(1))) {\n return 0;\n\n }\n }\n return 1;\n\n } catch (Exception e) {\n //System.out.print(e);\n return 2;\n } finally {\n try {\n if (pst != null) {\n pst.close();\n }\n if (con != null) {\n con.close();\n }\n } catch (Exception e) {\n }\n\n }\n }", "public void queryConstant(Aerospike as) {\n Statement s = as.constStatement;\n try (RecordSet rs = as.client.query(null, s)) {\n if (rs.next()) {\n as.hitCount++;\n } else {\n as.missCount++;\n }\n }\n }", "public static void main(String[] args) {\n\t\tSession s2=util.getSession();\r\n\t\tQuery qry=s2.getNamedQuery(\"q2\");\r\n\t\t//Query qry=s2.getNamedQuery(\"q3\");\r\n\t\t//qry.setInteger(0, 50);\r\n\t\tList<Object[]> lust=qry.list();\r\n\t\tfor(Object[] row:lust) {\r\n\t\t\tSystem.out.println(Arrays.toString(row));\r\n\t\t}\r\n\t\tSystem.out.println(\"Completed\");\r\n\t}", "public boolean existeorden(String ordenservicio){\n boolean existe=false;\n \n conex con=new conex(); \n ResultSet rsR = null; \n String myQuery = \"select tipocorte from to_estetica where (estatus='ABIERTA' or estatus='CERRADA') and tipocorte='\"+ordenservicio+\"'\";\n System.out.println(\"\"+myQuery);\n try {\n Statement st = con.getConnection().createStatement();\n rsR = st.executeQuery(myQuery);\n while(rsR.next()) { \n existe=true; \n } \n rsR.close(); \n st.close();\n con.desconectar();\n } catch (SQLException ex) { \n existe=true; \n JOptionPane.showMessageDialog(null, \"Error al obtener los datos: \"+ex, \"Error\", JOptionPane.ERROR_MESSAGE);\n } \n \n return existe;\n }", "private String stageDetailsFromDB(String queryString){\n\t\tString RET=\"\";\n\t\ttry\n\t\t{\n\t\t\tcon = Globals.getDatasource().getConnection();\n\t\t\tps = con.prepareStatement(queryString); \n\t\t\tresult = ps.executeQuery();\n\t\t\tif (result.first()) {\n\t\t\t\tRET = result.getString(1);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch(SQLException sqle){sqle.printStackTrace();}\n\t\tfinally {\n\t\t Globals.closeQuietly(con, ps, result);\n\t\t}\n\t\treturn RET;\n\t}", "static ResultSet dataOphalen(String querry) {\n //declaratie anders kan er niks worden gereturnt\n ResultSet rs = null;\n try {\n Statement stmt = connectieMaken().createStatement(); //\n rs = stmt.executeQuery(querry);\n } catch (SQLException se) {\n se.printStackTrace();\n }\n return rs;\n }", "private boolean validaTerminalesLReservaLocal(int CodEmp,int CodLoc, int CodCot){\n boolean blnRes=true;\n java.sql.Statement stmLoc;\n java.sql.ResultSet rstLoc;\n java.sql.Connection conLoc;\n try{\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(), objParSis.getUsuarioBaseDatos(), objParSis.getClaveBaseDatos());\n if (conLoc!=null){\n stmLoc=conLoc.createStatement();\n strSql=\"\"; \n strSql+=\" SELECT a1.co_emp, a1.co_loc, a1.co_cot, a2.tx_codALt, trim(SUBSTR (UPPER(a2.tx_codalt), length(a2.tx_codalt) ,1)) as terminal \\n\";\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\n strSql+=\" INNER JOIN tbm_detCotVen as a2 ON (a1.co_emp=a2.co_emp AND a1.co_loc=a2.co_loc AND a1.co_cot=a2.co_cot) \\n\";\n strSql+=\" INNER JOIN tbm_inv as a3 ON (a2.co_emp=a3.co_emp AND a2.co_itm=a3.co_itm) \\n\";\n strSql+=\" WHERE a1.co_emp=\"+CodEmp+\" and a1.co_loc=\"+CodLoc+\" and a1.co_cot=\"+CodCot+\" \\n\";\n System.out.println(\"validaTerminalesLReservaLocal... \"+ strSql);\n rstLoc = stmLoc.executeQuery(strSql);\n while(rstLoc.next()){\n if(rstLoc.getString(\"terminal\").equals(\"L\")){\n blnRes=false;\n }\n }\n rstLoc.close();\n rstLoc=null;\n stmLoc.close();\n stmLoc=null;\n conLoc.close();\n conLoc=null;\n }\n }\n catch (java.sql.SQLException e){\n objUti.mostrarMsgErr_F1(this, e);\n blnRes=false; \n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(null, e);\n blnRes=false;\n }\n return blnRes;\n }", "public static void main(String[] args) throws IOException {\n BufferedReader bufferedReader = new BufferedReader(new FileReader(UFTest.class.getResource(\"/\").getPath()+\"1.5/largeUF.txt\"));\n String str = bufferedReader.readLine();\n UFLJWQU uf = new UFLJWQU(Integer.parseInt(str));\n long beginTime =System.currentTimeMillis();\n while ((str = bufferedReader.readLine())!=null){\n String[] array = str.split(\" \");\n int p = Integer.parseInt(array[0]);\n int q = Integer.parseInt(array[1]);\n if(uf.connected(p,q)) continue;\n uf.union(p,q);\n// System.out.println(p+\" -- \"+q);\n }\n System.out.println(uf.count());\n System.out.println(\"cost time :\"+(System.currentTimeMillis() - beginTime));\n }", "public static void main(String[] args) {\n\t\tNQueensProblem nQueen=new NQueensProblem();\n\t\tint board[][]=new int[N][N];\n\t\tnQueen.inputData(board);\n\t\tif(solveQueenProblem(board,0))\n\t\tnQueen.printResult(board);\n\t\telse {\n\t\t\tSystem.out.println(\"Not Exist\");\n\t\t}\n\n\t}", "protected String createFindBy(String nume) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"SELECT \");\n\t\tsb.append(\" * \");\n\t\tsb.append(\" FROM \");\n\t\tsb.append(type.getSimpleName());\n\t\tsb.append(\" WHERE \");\n\t\treturn sb.toString();\n\t}", "public void registraPoliticasCond (Long codPropuesta, ReformaTributariaInput reformaIn, Collection deudas, ReformaTributariaOutput reformaOut)throws Exception{\n \t\n Connection conn = null;\n CallableStatement call = null;\n try{ \n conn = this.getConnection();\n //codPropuesta=null;//prueba que pasa\n //reformaIn=null;\n \t int canal=0;\n \t int tipoConvenio=0;\n \t int garantia=0;\n\t\t \tIterator itera = deudas.iterator();\n\t\t \t//System.out.println(\"<-------------------------------------Ingreso a registrar opciones--------------------------------------->\");\n\t\t while(itera.hasNext()) {\n\t\t \t\n\t\t \tDeudaWeb elemento = (DeudaWeb) itera.next();\n\t\t \t\n\t\t \t/*System.out.println(\"codPropuesta--->\"+codPropuesta);\n\t\t \tSystem.out.println(\"getIsIntranet--->\"+reformaIn.getIsIntranet());\n\t\t \tSystem.out.println(\"getPagoTotalConvenio--->\"+reformaIn.getPagoTotalConvenio());\n\t\t \tSystem.out.println(\"getComportamientoConvenio--->\"+reformaIn.getComportamientoConvenio());\n\t\t \tSystem.out.println(\"getRutContribuyente--->\"+reformaIn.getRutContribuyente());\n\t\t \tSystem.out.println(\"getTieneGarantia--->\"+reformaIn.getTieneGarantia());\n\t\t \tSystem.out.println(\"getTipoContribuyente--->\"+elemento.getTipoContribuyente());\n\t\t \tSystem.out.println(\"getTipoFormulario--->\"+elemento.getTipoFormulario());\n\t\t \tSystem.out.println(\"getRutRol--->\"+elemento.getRutRol());\n\t\t \tSystem.out.println(\"getFolio--->\"+elemento.getFolio());\n\t\t \tSystem.out.println(\"getFechaVencimiento--->\"+elemento.getFechaVencimiento());\n\t\t \tSystem.out.println(\"getFechaAntiguedad--->\"+elemento.getFechaAntiguedad());\n\t\t \tSystem.out.println(\"getPorcentajeCondonacionMultas--->\"+elemento.getPorcentajeCondonacionMultas());\n\t\t \tSystem.out.println(\"getPorcentajeCondonacionIntereses--->\"+elemento.getPorcentajeCondonacionIntereses());\n\t\t \tSystem.out.println(\"getBeneficioPp--->\"+reformaOut.getBeneficioPp());\n\t\t \tSystem.out.println(\"getMinCuotaContado--->\"+reformaOut.getMinCuotaContado());\n\t\t \tSystem.out.println(\"getMaxCuota--->\"+reformaOut.getMaxCuota());*/\n\t\t \t\n\t\t \tcall = conn.prepareCall(\"{call PKG_REFORMA_TRIBUTARIA.INSERTA_CONDICION_CNV(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}\");\n\t\t \t\n\t\t \t\n\t\t \t\n\t\t \t//obtengo canal\n\t\t \tif (reformaIn.getIsIntranet().booleanValue()){\n\t\t \t\tcanal=1;//presencial\n\t\t \t}else {\n\t\t \t\tcanal=2;//internet\n\t\t \t}\n\t\t \t\n\t\t \t//obtengo tipo convenio\n\t\t \tif (reformaIn.getPagoTotalConvenio().booleanValue()){\n\t\t \t\ttipoConvenio=1;//total\n\t\t \t}else{\n\t\t \t\ttipoConvenio=2;//parcial\n\t\t \t}\n\t\t \t\n\t\t \t//obtengo garantia\n\t\t \tif (reformaIn.getTieneGarantia().booleanValue()){\n\t\t \t\tgarantia=1;//con garatia\n\t\t \t}else{\n\t\t \t\tgarantia=2;//sin garantia\n\t\t \t}\n\t\t \t\n\t\t \t\n\t\t \tcall.setLong(1, codPropuesta.longValue());\n\t\t \tcall.setLong(2, canal);//canal;\n\t\t \tcall.setLong(3, tipoConvenio);//Tipo convenio Pago total-pago parcial\n\t\t \tcall.setLong(4, reformaIn.getComportamientoConvenio().longValue());//comportamiento Bueno=1 / Regular=2 / Malo=3\n\t\t \tcall.setLong(5, reformaIn.getRutContribuyente().longValue());//rut evaluado;\n\t\t \tcall.setLong(6, garantia);//embargo / o garantia\n\t\t \tcall.setLong(7, elemento.getTipoContribuyente());//cliente_tipo;\n\t\t \tcall.setLong(8, elemento.getTipoFormulario());//tipo_forulario;\n\t\t \tcall.setLong(9, elemento.getRutRol());//rut_rol;\n\t\t \tcall.setLong(10, elemento.getFolio());//form_folio;\n\t\t \tcall.setDate(11,elemento.getFechaVencimiento());//fecha_vcto;\n\t\t \tcall.setDate(12,elemento.getFechaAntiguedad());//fecha_antiguedad;\n\t\t \tcall.setLong(13, elemento.getPorcentajeCondonacionMultas());//porcentaje condonacion multas\n\t\t \tcall.setLong(14, elemento.getPorcentajeCondonacionIntereses());//porcentaje condonacion intereses\n\t\t \tcall.setLong(15, reformaOut.getBeneficioPp().longValue());//beneficio pronto pago o incentivo al pago;\n\t\t \tcall.setLong(16, reformaOut.getMinCuotaContado().longValue());//porcentaje minimo cuota contado\n\t\t \tcall.setLong(17, reformaOut.getMaxCuota().longValue());//porcentaje maximo cuotas\n\t\t \tcall.setNull(18, OracleTypes.VARCHAR);//error\n\t\t \t\n\t\t \tcall.execute();\n\t\t \t\n\t }\n\t\t \n\t\t call.close(); \n }catch (Exception e) {\n e.printStackTrace();\n }finally{\n this.closeConnection();\n }\t\t \n \t\n }", "public void testbusquedaLOM_ESVSQL() {\n// \ttry{\n//// \t\tindexarODEs();\n// \t\tQuerySimpleVO paramBusq= new QuerySimpleVO();\n// \t\t\tparamBusq.setIdioma(\"es\");\n// \t\t\tparamBusq.setLenguajeQuery(\"VSQL\");\n// \t\t\tparamBusq.setNumResultados(new Integer(100));\n// \t\t\tparamBusq.setQuery(\"cinco\");\n// \t\t\tDocumentosLOM_ESVO respuesta =this.servicio.busquedaLOM_ESVSQL(paramBusq);\n// \t\t\tif (respuesta.getResultados()!=null)\n// \t\t\t\tassertEquals(respuesta.getResultados().length, 1);\n// \t}catch(Exception e){\n// \t\t \tlogger.error(\"ERROR: fallo en test buscador-->\",e);\n// \t\t\tthrow new RuntimeException(e);\n// \t}finally{\n// \t\teliminarODE(new String [] { \"asdf\",\"hjkl\"});\n// \t}\n \t String prueba = null; \n \t\tassertNull(prueba);\n }", "public void rellenarDevoluciones(DTOSolicitudValidacion dtoSolicitud)\n throws MareException{\n UtilidadesLog.info(\"DAOSolicitudes.rellenarDevoluciones(DTOSolicitudValidacion dtoSolicitud):Entrada\");\n Long oidConsolidado = null, oidPeriodo = null;\n RecordSet rs;\n StringBuffer query = new StringBuffer();\n\n query.append(\" SELECT MAX(SOL_ORIG.OID_SOLI_CABE) OID_SOLI_CABE, MAX(SOL_ORIG.PERD_OID_PERI) PERD_OID_PERI \");\n\n query.append(\" FROM PED_SOLIC_CABEC SOL_DEVO, \");\n query.append(\" PED_SOLIC_CABEC SOL_ORIG, \");\n query.append(\" PED_SOLIC_CABEC SOL_DEVUELTA, \");\n query.append(\" INC_SOLIC_CONCU_PUNTA SCP, \");\n query.append(\" PED_TIPO_SOLIC_PAIS PTSP, \");\n query.append(\" PED_TIPO_SOLIC PTS \");\n \n query.append(\" WHERE SOL_DEVO.OID_SOLI_CABE = \" + dtoSolicitud.getOidSolicitud().toString() );\n query.append(\" AND SOL_DEVO.SOCA_OID_DOCU_REFE = SOL_ORIG.OID_SOLI_CABE \");\n query.append(\" AND SOL_ORIG.OID_SOLI_CABE = SOL_DEVUELTA.SOCA_OID_SOLI_CABE \");\n query.append(\" AND SOL_DEVUELTA.OID_SOLI_CABE = SCP.SOCA_OID_SOLI_CABE \");\n query.append(\" AND SOL_DEVO.TSPA_OID_TIPO_SOLI_PAIS = PTSP.OID_TIPO_SOLI_PAIS \");\n query.append(\" AND PTSP.TSOL_OID_TIPO_SOLI = PTS.OID_TIPO_SOLI \");\n query.append(\" AND PTS.IND_DEVO = 1 \");\n \n try {\n rs = BelcorpService.getInstance().dbService.executeStaticQuery(query.toString());\n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS));\n }\n \n if(! rs.esVacio() ){\n oidConsolidado = rs.getValueAt(0,\"OID_SOLI_CABE\" )!=null?\n new Long( ((BigDecimal)rs.getValueAt(0,\"OID_SOLI_CABE\" ) ).longValue() ):null;\n }\n \n if( oidConsolidado != null ){\n oidPeriodo = rs.getValueAt(0,\"PERD_OID_PERI\" )!=null?\n new Long( ((BigDecimal)rs.getValueAt(0,\"PERD_OID_PERI\" ) ).longValue() ):null; \n \n dtoSolicitud.setOidSolicitud( oidConsolidado );\n dtoSolicitud.setOidPeriodo( oidPeriodo );\n }\n\n UtilidadesLog.info(\"DAOSolicitudes.rellenarDevoluciones(DTOSolicitudValidacion dtoSolicitud):Salida\");\n }", "private boolean consultarCotizacionesParaFacturar(java.sql.Connection conn, int intCodSeg){\r\n boolean blnRes=false;\r\n java.sql.Statement stmLoc,stmLoc01;\r\n stbDocRelEmpRem = new StringBuffer();\r\n arlDocGenDat = new ArrayList();\r\n objZafGenOD = new GenOD.ZafGenOdPryTra() ;\r\n objModDatGenFac = new Librerias.ZafGenFacAut.ZafModDatGenFac(objParSis, jifCnt);\r\n objStkInv = new Librerias.ZafStkInv.ZafStkInv(objParSis);\r\n objCnfDoc = new Librerias.ZafCnfDoc.ZafCnfDoc(objParSis,null);\r\n objCfgSer.cargaDatosIpHostServicios(0, intCodSer);\r\n java.sql.ResultSet rstLoc,rstLoc01;\r\n String strMerIngEgr=\"\",strTipIngEgr=\"\";\r\n blnIsComSol = false;\r\n try{\r\n stmLoc=conn.createStatement();\r\n strSql=\"\";\r\n strSql+=\" SELECT a2.co_seg, a3.tx_corEle, \\n\";\r\n strSql+=\" a1.co_emp, a1.co_loc, a1.co_cot, a1.fe_cot, a1.co_cli, a1.co_ven, a1.tx_ate, a1.co_forpag, \\n\";\r\n strSql+=\" a1.nd_sub, a1.nd_poriva, a1.nd_valdes, a1.tx_obs1, a1.tx_obs2, a1.st_reg, a1.fe_ing, \\n\";\r\n strSql+=\" a1.fe_ultmod, a1.co_usring, a1.co_usrmod, a1.nd_tot, a1.ne_val, a1.nd_valiva, a1.tx_numped, \\n\";\r\n strSql+=\" a1.st_regrep, a1.tx_obssolaut, a1.tx_obsautsol, a1.st_aut, a1.tx_nomcli, a1.fe_procon, \\n\";\r\n strSql+=\" a1.co_locrelsoldevven, a1.co_tipdocrelsoldevven, a1.co_docrelsoldevven, \\n\";\r\n strSql+=\" a1.st_docconmersaldemdebfac, a1.fe_val, a1.co_tipcre, a1.tx_dirclifac, a1.tx_dircliguirem, \\n\";\r\n strSql+=\" a1.co_forret, a1.tx_vehret, a1.tx_choret, \\n\";\r\n strSql+=\" CASE WHEN a1.tx_momgenfac IS NULL THEN 'M' ELSE a1.tx_momgenfac END as tx_momgenfac, \\n\";\r\n strSql+=\" a1.nd_valComSol,a1.nd_subIvaCer,a1.nd_subIvaGra,a1.nd_porComSol,a1.st_solFacPar, a1.tx_tipCot \\n\";\r\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\r\n strSql+=\" INNER JOIN tbm_cabSegMovInv as a2 ON (a1.co_emp=a2.co_empRelCabCotVen AND a1.co_loc=a2.co_locRelCabCotVen AND \\n\";\r\n strSql+=\" a1.co_cot=a2.co_cotRelCabCotVen) \\n\";\r\n strSql+=\" INNER JOIN tbm_usr as a3 ON (a1.co_usrIng=a3.co_usr) \\n\";\r\n strSql+=\" WHERE a2.co_seg=\"+intCodSeg+\" AND a2.co_empRelCabCotVen IS NOT NULL AND a1.st_reg!='F' \\n\"; /* LISTO PARA FACTURAR */\r\n strSql+=\" AND a1.st_autSolResInv IS NULL \";\r\n strSql+=\" ORDER BY a1.co_emp, a1.co_loc \\n\";\r\n System.out.println(\"consultarCotizacionesParaFacturar... \\n\" + strSql);\r\n rstLoc=stmLoc.executeQuery(strSql);\r\n while(rstLoc.next()){\r\n CodEmpGenFac = rstLoc.getInt(\"co_emp\");\r\n if(rstLoc.getInt(\"co_emp\")==2 && rstLoc.getInt(\"co_loc\")==4){\r\n blnIsComSol=true;\r\n }\r\n// dblPorComSol=objUti.redondear(rstLoc.getDouble(\"nd_porComSol\"), objParSis.getDecimalesMostrar());\r\n// dblBaseIva=objUti.redondear(rstLoc.getDouble(\"nd_subIvaGra\"), objParSis.getDecimalesMostrar());\r\n\r\n obtenerDatosFactura(conn, rstLoc.getInt(\"co_emp\"),rstLoc.getInt(\"co_loc\"),rstLoc.getInt(\"co_cot\"));\r\n objZafCtaCtb_dat = new ZafCtaCtb_dat(objParSis,rstLoc.getInt(\"co_emp\"),rstLoc.getInt(\"co_loc\"), intCodTipDocFacEle);\r\n cargarTipEmp(conn, rstLoc);\r\n Configurartabla();\r\n configurarTablaPago();\r\n refrescaDatos2(conn,rstLoc, rstLoc.getInt(\"co_emp\"), rstLoc.getInt(\"co_loc\"));\r\n CalculoPago(conn, rstLoc); // TOTALES CARGADO????? \r\n CalculoPago2(conn, rstLoc);\r\n// refrescaDatos2(conn,rstLoc, rstLoc.getInt(\"co_emp\"), rstLoc.getInt(\"co_loc\"));\r\n FormaRetencion(conn, rstLoc.getInt(\"co_emp\"));\r\n stmLoc01=conn.createStatement();\r\n strSql = \"SELECT st_meringegrfisbod, tx_natdoc FROM tbm_cabtipdoc WHERE co_emp=\" + rstLoc.getInt(\"co_emp\") + \" \"\r\n + \" and co_loc=\"+rstLoc.getInt(\"co_loc\")+\" and co_tipDoc=\" + intCodTipDocFacEle;\r\n rstLoc01 = stmLoc01.executeQuery(strSql);\r\n if (rstLoc01.next()) {\r\n strMerIngEgr = rstLoc01.getString(\"st_meringegrfisbod\");\r\n strTipIngEgr = rstLoc01.getString(\"tx_natdoc\");\r\n }\r\n rstLoc01.close();\r\n rstLoc01=null;\r\n stmLoc01.close();\r\n stmLoc01=null;\r\n //dblPorComSol=0.00,dblBaseIva=0.00;\r\n\r\n System.out.println(\"st_reg= \" + rstLoc.getString(\"st_reg\").toString());\r\n\r\n if(rstLoc.getString(\"st_reg\").equals(\"L\") && (rstLoc.getString(\"tx_momGenFac\").equals(\"F\") || rstLoc.getString(\"tx_momGenFac\").equals(\"M\") )){ // INMACONSA SE FACTURA POR AKI\r\n if(insertarCabFac(conn,rstLoc)){\r\n if (insertarDetFac(conn,rstLoc,intCodSeg)) {\r\n calculaPag(conn, rstLoc);\r\n if (insertarPagFac(conn,rstLoc, intCodTipDocFacEle, intCodDoc)) {\r\n if(insertarDiario(conn,rstLoc, intCodTipDocFacEle, intCodDoc)) {\r\n if (objInvItm._getExiItmSer(conn, rstLoc.getInt(\"co_emp\"),rstLoc.getInt(\"co_loc\"), intCodTipDocFacEle, intCodDoc)) {\r\n if(asignaNumeroFac(conn, rstLoc.getInt(\"co_emp\"),rstLoc.getInt(\"co_loc\"), intCodTipDocFacEle, intCodDoc, rstLoc.getInt(\"co_cot\") )){\r\n if(insertarTablaSeguimiento(conn,rstLoc,intCodTipDocFacEle,intCodDoc)){\r\n if(prepararEgreso(conn,rstLoc,rstLoc.getInt(\"co_emp\"),rstLoc.getInt(\"co_loc\"), intCodTipDocFacEle, intCodDoc) ){\r\n// if(objModDatGenFac.cuadraStockSegunMovimientos(conn, rstLoc.getInt(\"co_emp\"), rstLoc.getInt(\"co_loc\"), intCodTipDocFacEle, intCodDoc)){\r\n System.err.println(\"<----- antes costear ----->\");\r\n if(objUti.costearDocumento(jifCnt, objParSis, conn, rstLoc.getInt(\"co_emp\"), rstLoc.getInt(\"co_loc\"), intCodTipDocFacEle, intCodDoc)){\r\n System.err.println(\"<----- despues costear ----->\");\r\n if(revisarInvBodNegativos(conn, rstLoc.getInt(\"co_emp\"), rstLoc.getInt(\"co_loc\"), intCodTipDocFacEle, intCodDoc)){\r\n System.out.println(\"ANTES OD \");\r\n if(objZafGenOD.generarODLocal(conn, rstLoc.getInt(\"co_emp\"), rstLoc.getInt(\"co_loc\"), intCodTipDocFacEle, intCodDoc,true)){\r\n if(objDatItm.preLiberarItems(conn, rstLoc.getInt(\"co_emp\"), rstLoc.getInt(\"co_loc\"), rstLoc.getInt(\"co_cot\"))){\r\n blnRes=true;\r\n guardaDocumentosGenerado(rstLoc,intCodTipDocFacEle,intNumFacElec,intCodDoc,rstLoc.getString(\"tx_corEle\")); // PARA EL CORREO ELECTRONICO\r\n System.out.println(\"GENERO: \"+rstLoc.getInt(\"co_emp\")+\" - \"+rstLoc.getInt(\"co_loc\")+\" - \"+rstLoc.getInt(\"co_cot\")+\"FACTURA: \"+intCodTipDocFacEle+\"-\"+intCodDoc);\r\n }else{blnRes=false;}\r\n }else{blnRes=false;}\r\n }else{blnRes=false;}\r\n }else{System.out.println(\"costeo Error\"); blnRes=false; }\r\n// }else{ System.out.println(\"cuadraStockSegunMovimientos Error\"); blnRes = false;}\r\n }else{blnRes=false;}\r\n }else{blnRes=false;}\r\n }else{blnRes=false;}\r\n }else{blnRes=false;}\r\n }else{blnRes=false;}\r\n }else{blnRes=false;}\r\n }else{blnRes=false;}\r\n }else{blnRes=false;}\r\n\r\n if(blnRes==false){\r\n objCorEle.enviarCorreoMasivo(strCorEleTo,\"ERROR.... \",\"Revisar Seguimiento: \"+rstLoc.getInt(\"co_seg\")+\"cotizacion Emp:\"+rstLoc.getInt(\"co_emp\")+\" Loc:\"+rstLoc.getInt(\"co_loc\")+\" Cot:\" + rstLoc.getInt(\"co_cot\"));\r\n }\r\n }\r\n else if(rstLoc.getString(\"tx_momGenFac\").equals(\"P\")){\r\n// if(obtenerFacturaSeguimiento(conn,intCodSeg)){\r\n// if(actualizarDetFac(conn,rstLoc)){\r\n// if(prepararEgreso(conn,rstLoc,rstLoc.getInt(\"co_emp\"),rstLoc.getInt(\"co_loc\"), intCodTipDocFacEle, intCodDoc) ){\r\n// if(!objZafGenOD.validarODExs(conn, rstLoc.getInt(\"co_emp\"), rstLoc.getInt(\"co_loc\"), intCodTipDocFacEle, intCodDoc)){\r\n// if(objZafGenOD.generarNumODFacIni(conn, rstLoc.getInt(\"co_emp\"), rstLoc.getInt(\"co_loc\"), intCodTipDocFacEle, intCodDoc)){\r\n// if(revisarInvBodNegativos(conn, rstLoc.getInt(\"co_emp\"), rstLoc.getInt(\"co_loc\"), intCodTipDocFacEle, intCodDoc)){\r\n// blnRes=true;\r\n// }else{blnRes=false;}\r\n// }else{blnRes=false;}\r\n// }else{ blnRes=true; }\r\n// }\r\n// }\r\n// }\r\n blnRes=false;\r\n }\r\n else{\r\n objCorEle.enviarCorreoMasivo(strCorEleTo, \"FACTURA AUTOMATICA ESTADO INCORRECTO.... \",\"Revisar Seguimiento: \"+rstLoc.getInt(\"co_seg\"));\r\n }\r\n\r\n\r\n\r\n\r\n if(blnRes==false){\r\n System.out.println(\"FALLO!!! \"+rstLoc.getInt(\"co_emp\")+\" - \"+rstLoc.getInt(\"co_loc\")+\" - \"+rstLoc.getInt(\"co_cot\"));\r\n }\r\n objZafCtaCtb_dat = null;\r\n }\r\n if(blnRes){\r\n enviaCorreosElectronicos();\r\n// enviaImprimirOdLocal(conn);\r\n enviarPulsoFacturacionElectronica();\r\n System.err.println(\"GUARDA!!!! \");\r\n }\r\n else{\r\n System.err.println(\"ERROR!!!! \");\r\n }\r\n \r\n stmLoc.close();\r\n stmLoc=null;\r\n rstLoc.close();\r\n rstLoc=null;\r\n }\r\n catch (SQLException Evt) {\r\n blnRes = false;\r\n objUti.mostrarMsgErr_F1(jifCnt, Evt);\r\n } \r\n catch (Exception Evt) {\r\n blnRes = false;\r\n objUti.mostrarMsgErr_F1(jifCnt, Evt);\r\n }\r\n return blnRes;\r\n }", "public static String consultaSQL(String usr) throws Exception {\r\n\t\tString cc = \"jdbc:postgresql://10.1.0.158:5432/app_permisos?user=adm_svcyachay&password=_50STg-FGh2h\";\r\n\t\tConnection conexion = null;\r\n\t\tStatement comando = null;\r\n\t\tResultSet resultado = null;\r\n\t\ttry {\r\n\t\t\tClass.forName(\"org.postgresql.Driver\");\r\n\t\t\tconexion = DriverManager.getConnection(cc);\r\n\t\t\tcomando = conexion.createStatement();\r\n\t\t\tresultado = comando\r\n\t\t\t\t\t.executeQuery(\"SELECT per_id FROM app_usuario WHERE usu_login = '\"\r\n\t\t\t\t\t\t\t+ usr + \"';\");\r\n\t\t\tif (resultado.next()) {\r\n\t\t\t\treturn resultado.getString(\"per_id\");\r\n\t\t\t} else {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new Exception(e.getMessage());\r\n\t\t} finally {\r\n\t\t\tif (resultado != null)\r\n\t\t\t\tresultado.close();\r\n\t\t\tif (comando != null)\r\n\t\t\t\tcomando.close();\r\n\t\t\tif (conexion != null)\r\n\t\t\t\tconexion.close();\r\n\t\t}\r\n\t}", "public IsochroneQuery(Config config) {\n this.config = config;\n this.connection = config!= null ? config.getConnection() : null;\n // initConstants();\n }", "public String Execomando(String Comsql) {\n String Mensaje = \"\";\n /* sino retorna nada es porque todo esta bien */\n try {\n PreparedStatement pstm = con.prepareStatement(Comsql);\n pstm.execute();\n pstm.close();\n } catch (SQLException e) {\n Mensaje = e.toString();\n }\n return Mensaje;\n }", "private void querys() {\n\t try {\r\n\t\tBoxYieldRptFactory.getRemoteInstance().SteDate();\r\n\t } catch (EASBizException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n\t } catch (BOSException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n\t }\r\n\t}", "public void PrepararBaseDatos() { \r\n try{ \r\n conexion=DriverManager.getConnection(\"jdbc:ucanaccess://\"+this.NOMBRE_BASE_DE_DATOS,this.USUARIO_BASE_DE_DATOS,this.CLAVE_BASE_DE_DATOS);\r\n \r\n } \r\n catch (Exception e) { \r\n JOptionPane.showMessageDialog(null,\"Error al realizar la conexion \"+e);\r\n } \r\n try { \r\n sentencia=conexion.createStatement( \r\n ResultSet.TYPE_SCROLL_INSENSITIVE, \r\n ResultSet.CONCUR_READ_ONLY); \r\n \r\n System.out.println(\"Se ha establecido la conexión correctamente\");\r\n } \r\n catch (Exception e) { \r\n JOptionPane.showMessageDialog(null,\"Error al crear el objeto sentencia \"+e);\r\n } \r\n }", "public static void test() {\n\t\t\n\t\tSystem.out.println(\"\\n\\n------------ TESTING CODE ASSIGNMENT 4D --------------\\n\\n\");\n\t\t\n\t\t\n\t\tEntityManagerFactory entityManagerFactory = PersistenceUtil.getEntityManagerFactory();\n\t\tEntityManager entityManager = entityManagerFactory.createEntityManager();\n\t\t\n\t\tentityManager.getTransaction().begin();\n\t\n\t\tSQLInterceptor.resetSelectCount();\n\t\t\n//\t\tSystem.out.println(\"Executing efficient query of task 2b:\");\n\t\tJPQLQueries jpqlQueries = new JPQLQueries(entityManager);\n\t\tjpqlQueries.getComputerUsage();\n\t\t\n\t\tSQLInterceptor.printSelectCount();\n\t\t\n\t\tentityManager.getTransaction().commit();\n\t\tentityManager.close();\n\t}", "public static boolean querycou(String text) {\n\t\ttry {\n\t\t\tps = conn.prepareStatement(\"select Cno from course where Cno = ?\");\n\t\t\tps.setString(1, text);\n\t\t\trs = ps.executeQuery();\n\t\t\t\n\t\t\tif(rs.next()){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn false;\n\t}", "@Test(timeout = 4000)\n public void test02() throws Throwable {\n NetworkHandling.sendDataOnTcp((EvoSuiteLocalAddress) null, (byte[]) null);\n String string0 = SQLUtil.normalize(\" Y*-X>Nz.q@~K^o8Z]v\", false);\n assertEquals(\"Y * - X > Nz.q @ ~ K ^ o8Z ] v\", string0);\n \n boolean boolean0 = SQLUtil.isQuery(\"fwX.WrSyJ>:+F-&9\");\n assertFalse(boolean0);\n }", "private boolean validaItemsServicio(int CodEmp, int CodLoc, int CodCot){\n java.sql.Statement stmLoc;\n java.sql.ResultSet rstLoc;\n java.sql.Connection conLoc;\n boolean blnRes=true;\n try{\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(), objParSis.getUsuarioBaseDatos(), objParSis.getClaveBaseDatos());\n if (conLoc != null) {\n stmLoc=conLoc.createStatement();\n strSql=\"\";\n strSql+=\" SELECT a1.co_emp, a1.co_loc, a1.co_cot \\n\";\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\n strSql+=\" INNER JOIN tbm_detCotVen as a2 ON (a1.co_emp=a2.co_emp AND a1.co_loc=a2.co_loc AND a1.co_cot=a2.co_cot) \\n\";\n strSql+=\" INNER JOIN tbm_inv as a3 ON (a2.co_emp=a3.co_emp AND a2.co_itm=a3.co_itm) \\n\";\n strSql+=\" WHERE a1.co_emp=\"+CodEmp+\" AND a1.co_loc=\"+CodLoc+\" AND a1.co_cot=\"+CodCot+\" AND (a3.st_ser='S' OR a3.st_ser='T' OR a3.st_ser='O') \\n\";\n rstLoc=stmLoc.executeQuery(strSql);\n if(rstLoc.next()){\n blnRes=false;\n }\n rstLoc.close();\n rstLoc=null;\n stmLoc.close();\n stmLoc=null;\n }\n conLoc.close();\n conLoc=null;\n }\n catch (java.sql.SQLException e){\n objUti.mostrarMsgErr_F1(this, e);\n blnRes=false; \n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(this, e);\n blnRes=false;\n }\n return blnRes;\n }", "@Test(timeout = 4000)\n public void test067() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.queryAndSimplify(\"eBTux<g'kc|{F(x_]e\", (Connection) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "public static String think(HttpServletRequest request) throws Exception {\n String entrenador=request.getParameter(\"entrenador\");\r\n String[] posicion=new String[16];\r\n String[] nombre=new String[16];\r\n for(int i=0;i<16;i++) {\r\n posicion[i]=request.getParameter(\"posicion\"+(i+1));\r\n nombre[i]=request.getParameter(\"nombre\"+(i+1)).replace(\"'\",\"''\");\r\n }\r\n String nombreequipo=request.getParameter(\"nombreequipo\");\r\n String[] extras=request.getParameter(\"extras\").split(\"#\");\r\n\r\n\t\t//cuerpo\r\n DBManager2 dbman=new DBManager2();\r\n if(dbman.executeValue(\"select count(*) from lebb_equipos where equipo='\"+nombreequipo+\"'\").equals(\"0\")) {\r\n\t\t\tdbman.executeUpdate(\"insert into lebb_equipos values('\"+nombreequipo+\"','\"+extras[5]+\"',\"+Integer.parseInt(extras[0])+\",\"+Integer.parseInt(extras[1])+\",\"+Integer.parseInt(extras[2])+\",\"+Integer.parseInt(extras[3])+\",'\"+extras[4]+\"',\"+Integer.parseInt(extras[6])+\",'\"+entrenador+\"','')\");\r\n\t\t\tStringBuilder sb=new StringBuilder(\"insert into lebb_jugadores values\");\r\n\t\t\tfor(int i=0;i<16;i++)\r\n\t\t\t\tif((nombre[i].length()>0)&&(posicion[i].length()>0))\r\n\t\t\t\t\tsb.append(\"(\"+(i+1)+\",'\"+nombreequipo+\"','\"+nombre[i]+\"','\"+posicion[i]+\"','',0,0,0,0,0,'','ok'),\");\r\n\t\t\tdbman.executeUpdate(sb.toString().substring(0,sb.length()-1));\r\n\t\t}\r\n ResultSet2 equipos=dbman.executeQuery(\"select * from lebb_equipos where entrenador='\"+entrenador+\"'\");\r\n dbman.close();\r\n return \"main.do\";\r\n }", "public Long obtenerUAporcodigo(Long oidMarca, Long oidCanal, Long oidPais,\n String codsgv, String codRegion, String codZona, String codSeccion,\n String codTer) throws MareException {\n \n UtilidadesLog.info(\"DAOZON.obtenerUAporcodigo(Long oidMarca, Long oidCanal, Long oidPais, String codsgv, String codRegion, String codZona, String codSeccion, String codTer): Entrada\");\n \n BigDecimal result;\n BelcorpService belcorpService;\n RecordSet respuestaRecordSet = null;\n Vector parametros = new Vector();\n\n StringBuffer stringBuffer = null;\n\n try {\n belcorpService = BelcorpService.getInstance();\n\n if (checkStr(codSeccion) && checkStr(codZona) &&\n checkStr(codRegion) && checkStr(codsgv) &&\n checkStr(codTer)) {\n //Chequeo sobre CodSGV,Region,Zona,Seccion. Para Territorio\n stringBuffer = new StringBuffer(\"SELECT T.OID_TERR as UA\");\n stringBuffer.append(\n \" FROM ZON_SUB_GEREN_VENTA SGV, ZON_REGIO R, ZON_ZONA Z, ZON_SECCI S, ZON_TERRI T, ZON_TERRI_ADMIN TA \");\n stringBuffer.append(\" WHERE \");\n stringBuffer.append(\" SGV.CANA_OID_CANA = \" +\n oidCanal.toString());\n stringBuffer.append(\" AND SGV.MARC_OID_MARC = \" +\n oidMarca.toString());\n stringBuffer.append(\" AND SGV.PAIS_OID_PAIS = \" +\n oidPais.toString());\n stringBuffer.append(\" AND SGV.COD_SUBG_VENT = '\" + codsgv +\n \"' \");\n stringBuffer.append(\" AND R.COD_REGI = '\" + codRegion + \"' \");\n stringBuffer.append(\" AND Z.COD_ZONA = '\" + codZona + \"' \");\n stringBuffer.append(\" AND S.COD_SECC = '\" + codSeccion + \"' \");\n stringBuffer.append(\" AND T.COD_TERR = '\" + codTer + \"' \");\n stringBuffer.append(\n \" AND R.ZSGV_OID_SUBG_VENT = SGV.OID_SUBG_VENT \");\n stringBuffer.append(\" AND Z.ZORG_OID_REGI = R.OID_REGI \");\n stringBuffer.append(\" AND S.ZZON_OID_ZONA = Z.OID_ZONA \");\n stringBuffer.append(\" AND TA.ZSCC_OID_SECC = S.OID_SECC \");\n stringBuffer.append(\" AND TA.TERR_OID_TERR = T.OID_TERR \"); \n stringBuffer.append(\" AND SGV.IND_BORR = 0 \");\n stringBuffer.append(\" AND R.IND_BORR = 0 \");\n stringBuffer.append(\" AND Z.IND_BORR = 0 \");\n stringBuffer.append(\" AND S.IND_BORR = 0 \");\n stringBuffer.append(\" AND T.IND_BORR = 0 \");\n stringBuffer.append(\" AND TA.IND_BORR = 0 \");\n \n respuestaRecordSet = belcorpService.dbService.executeStaticQuery(stringBuffer.toString());\n } else if (checkStr(codSeccion) && checkStr(codZona) &&\n checkStr(codRegion) && checkStr(codsgv)) {\n //Chequeo sobre CodSGV,Region,Zona,Seccion. Para Territorio\n stringBuffer = new StringBuffer(\"SELECT S.OID_SECC as UA\");\n stringBuffer.append(\n \" FROM ZON_SUB_GEREN_VENTA SGV, ZON_REGIO R, ZON_ZONA Z, ZON_SECCI S\");\n stringBuffer.append(\" WHERE \");\n stringBuffer.append(\" SGV.CANA_OID_CANA = \" +\n oidCanal.toString());\n stringBuffer.append(\" AND SGV.MARC_OID_MARC = \" +\n oidMarca.toString());\n stringBuffer.append(\" AND SGV.PAIS_OID_PAIS = \" +\n oidPais.toString());\n stringBuffer.append(\" AND SGV.COD_SUBG_VENT = '\" + codsgv +\n \"' \");\n stringBuffer.append(\" AND R.COD_REGI = '\" + codRegion + \"' \");\n stringBuffer.append(\" AND Z.COD_ZONA = '\" + codZona + \"' \");\n stringBuffer.append(\" AND S.COD_SECC = '\" + codSeccion + \"' \");\n stringBuffer.append(\n \" AND R.ZSGV_OID_SUBG_VENT = SGV.OID_SUBG_VENT \");\n stringBuffer.append(\" AND Z.ZORG_OID_REGI = R.OID_REGI \");\n stringBuffer.append(\" AND S.ZZON_OID_ZONA = Z.OID_ZONA \");\n stringBuffer.append(\" AND SGV.IND_BORR = 0 \");\n stringBuffer.append(\" AND R.IND_BORR = 0 \");\n stringBuffer.append(\" AND Z.IND_BORR = 0 \");\n stringBuffer.append(\" AND S.IND_BORR = 0 \");\n \n respuestaRecordSet = belcorpService.dbService.executeStaticQuery(stringBuffer.toString());\n } else if (checkStr(codsgv) && checkStr(codRegion) &&\n checkStr(codZona)) {\n //Chequeo sobre codSgv,Region,Zona. Para Seccion\n stringBuffer = new StringBuffer(\"SELECT Z.OID_ZONA as UA\");\n stringBuffer.append(\n \" FROM ZON_SUB_GEREN_VENTA SGV, ZON_REGIO R, ZON_ZONA Z\");\n stringBuffer.append(\" WHERE \");\n stringBuffer.append(\" SGV.CANA_OID_CANA = \" +\n oidCanal.toString());\n stringBuffer.append(\" AND SGV.MARC_OID_MARC = \" +\n oidMarca.toString());\n stringBuffer.append(\" AND SGV.PAIS_OID_PAIS = \" +\n oidPais.toString());\n stringBuffer.append(\" AND SGV.COD_SUBG_VENT = '\" + codsgv +\n \"' \");\n stringBuffer.append(\" AND R.COD_REGI = '\" + codRegion + \"' \");\n stringBuffer.append(\" AND Z.COD_ZONA = '\" + codZona + \"' \");\n stringBuffer.append(\n \" AND R.ZSGV_OID_SUBG_VENT = SGV.OID_SUBG_VENT \");\n stringBuffer.append(\" AND Z.ZORG_OID_REGI = R.OID_REGI \");\n stringBuffer.append(\" AND SGV.IND_BORR = 0 \");\n stringBuffer.append(\" AND R.IND_BORR = 0 \");\n stringBuffer.append(\" AND Z.IND_BORR = 0 \");\n \n respuestaRecordSet = belcorpService.dbService.executeStaticQuery(stringBuffer.toString());\n } else if (checkStr(codsgv) && checkStr(codRegion)) {\n //Chequeo sobre codSgv,Region. Para Zona.\n stringBuffer = new StringBuffer(\"SELECT R.OID_REGI as UA\");\n stringBuffer.append(\n \" FROM ZON_SUB_GEREN_VENTA SGV, ZON_REGIO R\");\n stringBuffer.append(\" WHERE \");\n stringBuffer.append(\" SGV.CANA_OID_CANA = \" +\n oidCanal.toString());\n stringBuffer.append(\" AND SGV.MARC_OID_MARC = \" +\n oidMarca.toString());\n stringBuffer.append(\" AND SGV.PAIS_OID_PAIS = \" +\n oidPais.toString());\n stringBuffer.append(\" AND SGV.COD_SUBG_VENT = '\" + codsgv +\n \"' \");\n stringBuffer.append(\" AND R.COD_REGI = '\" + codRegion + \"' \");\n stringBuffer.append(\n \" AND R.ZSGV_OID_SUBG_VENT = SGV.OID_SUBG_VENT \");\n stringBuffer.append(\" AND SGV.IND_BORR = 0 \");\n stringBuffer.append(\" AND R.IND_BORR = 0 \");\n \n respuestaRecordSet = belcorpService.dbService.executeStaticQuery(stringBuffer.toString());\n } else if (checkStr(codsgv)) {\n //Chequeo sobre codSgv. Para Region\n stringBuffer = new StringBuffer(\n \"SELECT SGV.OID_SUBG_VENT as UA\");\n stringBuffer.append(\" FROM ZON_SUB_GEREN_VENTA SGV\");\n stringBuffer.append(\" WHERE \");\n stringBuffer.append(\" SGV.CANA_OID_CANA = \" +\n oidCanal.toString());\n stringBuffer.append(\" AND SGV.MARC_OID_MARC = \" +\n oidMarca.toString());\n stringBuffer.append(\" AND SGV.PAIS_OID_PAIS = \" +\n oidPais.toString());\n stringBuffer.append(\" AND SGV.COD_SUBG_VENT = '\" + codsgv + \"' \");\n stringBuffer.append(\" AND SGV.IND_BORR = 0 \");\n \n respuestaRecordSet = belcorpService.dbService.executeStaticQuery(stringBuffer.toString());\n }\n } catch (MareMiiServiceNotFoundException serviceNotFoundException) {\n codigoError = CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE;\n throw new MareException(serviceNotFoundException,\n UtilidadesError.armarCodigoError(codigoError));\n } catch (Exception exception) {\n codigoError = CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS;\n throw new MareException(exception,\n UtilidadesError.armarCodigoError(codigoError));\n }\n\n if (respuestaRecordSet.esVacio()) {\n UtilidadesLog.info(\"DAOZON.obtenerUAporcodigo(Long oidMarca, Long oidCanal, Long oidPais, String codsgv, String codRegion, String codZona, String codSeccion, String codTer): Salida\");\n return null;\n } else {\n result = (BigDecimal) respuestaRecordSet.getValueAt(0, \"UA\");\n }\n UtilidadesLog.info(\"DAOZON.obtenerUAporcodigo(Long oidMarca, Long oidCanal, Long oidPais, String codsgv, String codRegion, String codZona, String codSeccion, String codTer): Salida\");\n return new Long(result.longValue());\n }", "@Override\n\tpublic Collection<String> consultarLineaComercialClasificacionAsignacionMasivaIngresar(String codigoClasificacion,String nivelClasificacion,String valorTipoLineaComercial,Long codigoLinPad,Long codigoLinCom)throws SICException{\n\t\tLogeable.LOG_SICV2.info(\"Entr� a consultar Linea Comercial Clasificacion Asignacion Masiva Ingresar : {}\",codigoClasificacion);\n\t\tStringBuilder query = null;\n\t\tSQLQuery sqlQuery = null;\n\t\tSession session=null;\n\t\tString divDep=\" ) \";\n\t\ttry {\n\t\t\tsession = hibernateH.getHibernateSession();\n\t\t\tsession.clear();\n\t\t\tquery = new StringBuilder(\" SELECT t1.CODIGOCLASIFICACION \");\n\t\t\t\n\t\t\tquery.append(\" FROM ( \");\n\t\t\tif(nivelClasificacion.equals(SICConstantes.TIPCLA_DIVISION)){\n\t\t\t\tquery.append(\" select clasificac2_.CODIGOCLASIFICACION \");\n\t\t\t\tquery.append(\" from SCSPETCLASIFICACION clasificac2_ \");\n\t\t\t\tquery.append(\" where clasificac2_.estadoClasificacion = '\"+SICConstantes.ESTADO_ACTIVO_NUMERICO+\"' \");\n\t\t\t\t\n\t\t\t\tquery.append(\" and ( clasificac2_.codigoClasificacionPadre in ( \");\n\t\t\t\tdivDep+=\" ) ) \";\n\t\t\t}\n\t\t\t\n\t\t\tquery.append(\" select clasificac3_.CODIGOCLASIFICACION \");\n\t\t\tquery.append(\" from SCSPETCLASIFICACION clasificac3_ \");\n\t\t\tquery.append(\" where clasificac3_.estadoClasificacion = '\"+SICConstantes.ESTADO_ACTIVO_NUMERICO+\"' \");\n\t\t\t\n\t\t\tif(nivelClasificacion.equals(SICConstantes.TIPCLA_CLASIFICACION)){\n\t\t\t\tquery.append(\" and clasificac3_.codigoClasificacion IN (\"+codigoClasificacion+\") \"+divDep+\" t1 \");\n\t\t\t}else{\n\t\t\t\tquery.append(\" and clasificac3_.codigoClasificacionPadre IN (\"+codigoClasificacion+\") \"+divDep+\" t1 \");\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tquery.append(\" where t1.CODIGOCLASIFICACION NOT IN(\t \");\n\t\t\tquery.append(\" select distinct lineacomer0_.CODIGOCLASIFICACION \");\n\t\t\tquery.append(\" from SCADMTLINCOMCLA lineacomer0_, SCADMTLINCOM lineacomer1_ \");\n\t\t\tquery.append(\" where lineacomer1_.CODIGOLINEACOMERCIAL=lineacomer0_.CODIGOLINEACOMERCIAL \");\n\t\t\tquery.append(\" and lineacomer1_.NIVEL=0 and lineacomer1_.ESTADO='\"+SICConstantes.ESTADO_ACTIVO_NUMERICO+\"' \");\n\t\t\tif(codigoLinPad != null){\n\t\t\t\tquery.append(\" and lineacomer1_.CODIGOLINEACOMERCIAL NOT IN( \"+codigoLinPad+\" ) \");\n\t\t\t}\n\t\t\tquery.append(\" and lineacomer0_.ESTADO='\"+SICConstantes.ESTADO_ACTIVO_NUMERICO+\"' and lineacomer1_.VALORTIPOLINEACOMERCIAL='\"+valorTipoLineaComercial+\"' \");\n\t\t\tquery.append(\" and ( lineacomer0_.CODIGOCLASIFICACION in ( \");\n\t\t\tif(nivelClasificacion.equals(SICConstantes.TIPCLA_DIVISION)){\n\t\t\t\tquery.append(\" select clasificac2_.CODIGOCLASIFICACION \");\n\t\t\t\tquery.append(\" from SCSPETCLASIFICACION clasificac2_ \");\n\t\t\t\tquery.append(\" where clasificac2_.estadoClasificacion = '\"+SICConstantes.ESTADO_ACTIVO_NUMERICO+\"' \");\n\t\t\t\tquery.append(\" and ( clasificac2_.codigoClasificacionPadre in ( \");\n\t\t\t}\n\t\t\t\n\t\t\tquery.append(\" select clasificac3_.CODIGOCLASIFICACION \");\n\t\t\tquery.append(\" from SCSPETCLASIFICACION clasificac3_ \");\n\t\t\tquery.append(\" where clasificac3_.estadoClasificacion = '\"+SICConstantes.ESTADO_ACTIVO_NUMERICO+\"' \");\n\t\t\tif(nivelClasificacion.equals(SICConstantes.TIPCLA_CLASIFICACION)){\n\t\t\t\tquery.append(\" and clasificac3_.codigoClasificacion IN (\"+codigoClasificacion+\") \"+divDep+\" ) )\");\n\t\t\t}else{\n\t\t\t\tquery.append(\" and clasificac3_.codigoClasificacionPadre IN (\"+codigoClasificacion+\") \"+divDep+\" ) ) \");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t///CODIGO EXTRA\n\t\t\tif(codigoLinPad != null){\n\t\t\t\tquery.append(\" and t1.CODIGOCLASIFICACION NOT IN(\t \");\n\t\t\t\tquery.append(\" SELECT CODIGOCLASIFICACION FROM SCADMTLINCOMCLA LCC, SCADMTLINCOM LC\t \");\n\t\t\t\tquery.append(\" where LCC.CODIGOCLASIFICACION IN(\t \");\n\t\t\t\tif(nivelClasificacion.equals(SICConstantes.TIPCLA_DIVISION)){\n\t\t\t\t\tquery.append(\" select clasificac2_.CODIGOCLASIFICACION \");\n\t\t\t\t\tquery.append(\" from SCSPETCLASIFICACION clasificac2_ \");\n\t\t\t\t\tquery.append(\" where clasificac2_.estadoClasificacion = '\"+SICConstantes.ESTADO_ACTIVO_NUMERICO+\"' \");\n\t\t\t\t\tquery.append(\" and ( clasificac2_.codigoClasificacionPadre in ( \");\n\t\t\t\t}\n\t\t\t\tquery.append(\" select clasificac3_.CODIGOCLASIFICACION \");\n\t\t\t\tquery.append(\" from SCSPETCLASIFICACION clasificac3_ \");\n\t\t\t\tquery.append(\" where clasificac3_.estadoClasificacion = '\"+SICConstantes.ESTADO_ACTIVO_NUMERICO+\"' \");\n\t\t\t\t\n\t\t\t\tif(nivelClasificacion.equals(SICConstantes.TIPCLA_CLASIFICACION)){\n\t\t\t\t\tquery.append(\" and clasificac3_.codigoClasificacion IN (\"+codigoClasificacion+\"\"+divDep+\" \");\n\t\t\t\t}else{\n\t\t\t\t\tquery.append(\" and clasificac3_.codigoClasificacionPadre IN (\"+codigoClasificacion+\") \"+divDep+\" \");\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tquery.append(\" AND LCC.ESTADO='1' \");\n\t\t\t\tquery.append(\" AND LCC.CODIGOLINEACOMERCIAL=LC.CODIGOLINEACOMERCIAL \");\n\t\t\t\tquery.append(\" AND LC.CODIGOLINEACOMERCIALPADRE = \"+codigoLinPad);\n\t\t\t\tquery.append(\" AND LCC.CODIGOLINEACOMERCIAL NOT IN (\"+codigoLinCom+\") )\");\n\t\t\t\tif(nivelClasificacion.equals(SICConstantes.TIPCLA_CLASIFICACION)){\n\t\t\t\t\tquery.append(\" ) \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\n//\t\t\tsqlQuery.setParameter(\"estadoClasificacion\", SICConstantes.ESTADO_ACTIVO_NUMERICO);\n//\t\t\tsqlQuery.setParameter(\"codigoClasificacion\", codigoClasificacion);\n//\t\t\tsqlQuery.setParameter(\"valorTipoLineaComercial\", valorTipoLineaComercial);\n\t\t\t\n\t\t\tsqlQuery = hibernateH.getHibernateSession().createSQLQuery(query.toString());\n//\t\t\tsqlQuery.addEntity(\"vista\", ClasificacionDTO.class);\n\t\t\t\n//\t\t\tclasificacionDTOs =sqlQuery.list();\n\t\t\treturn sqlQuery.list();\n\n\t\t} catch (Exception e) {\n\t\t\tLogeable.LOG_SICV2.info(\"Error al consultar clasificaciones asignacion masiva {}\", e);\n\t\t\tthrow new SICException(\"Error al consultar clasificaciones asignacion masiva {}\", e);\n\t\t}\n//\t\treturn clasificacionDTOs;\n\t\t\n\t}", "public void select(Connection conn, HttpGauceRequest greq, HttpGauceResponse gres) throws ServletException, Exception {\n\t\tCallableStatement cstmt = null;\n\t\tResultSet rs = null;\n\t\t\n\t\tString iParamEmpno = fParamEmpno;\n\t\tString iParamIp = fParamIp;\n\t\t\n\t\tint v_rowcnt = 0;\n\n\t\t/*\n\t\t * 검색시 필요한 조건\n\t\t */\n\t\t\n\t\tString sClient_sid = HDUtil.nullCheckStr(greq.getParameter(\"sClient_sid\"));\t// 매출처 SID\n\t\tString sClient_nm = HDUtil.nullCheckStr(greq.getParameter(\"sClient_nm\")); \t// LIKE\n\t\tString sSal_dam_sid = HDUtil.nullCheckStr(greq.getParameter(\"sSal_dam_sid\")); \t// 영업담당자 코드 \n\t\tString sUse_yn = HDUtil.nullCheckStr(greq.getParameter(\"sUse_yn\"));\t\t\t// 사용유무 \n\t\t\n\t\t//StringUtil.printMsg(\"대리점 이름\",sClient_nm,this);\n\t\t//StringUtil.printMsg(\"영업담당자 코드 \",sSal_dam_sid,this);\n\t\t//StringUtil.printMsg(\"사용유무 \",sUse_yn,this);\n\t\ttry {\n\t\t\tint sCnt1 = 1;\n\t\t\tGauceInputStream gis = greq.getGauceInputStream();\n\t\t\tGauceOutputStream gos = gres.getGauceOutputStream();\n\t\t\t//Component 로부터 전송된 입력스트림의 Output GauceDataSet의 배열을 반환\n\t\t\tGauceDataSet[] dSets = gis.readAllOutput();\n\t\t\t\n\t\t\tfor(int i=0; i<dSets.length;i++){\n\t\t\t\t//StringUtil.printMsg(\" 컴포넌트의 데이터셋 네임 \",dSets[i].getName(),this);\t\t\n\t\t\t\t//O:DS1=ds1,O:DS2=ds2,O:DS3=ds3)\n\t\t\t\tif(dSets[i].getName().equals(\"ds1\")){\n\t\t \t\tGauceDataSet ds1 = gis.read(\"DS1\");\n\t\t\t\t\tif (!\"\".equals(sClient_nm)) { // 대리점코드/명\n\t\t\t\t \t\t arr_sql[1].append(\"\t\t AND (T1.client_cd LIKE ? OR T1.client_nm LIKE ?)\t\\n\");\t//매출처코드\n\t\t\t\t\t}\n\t\t\t\t\tif (!\"\".equals(sSal_dam_sid)) { // 영업담당자명/코드\n\t\t\t\t \t\t arr_sql[1].append(\"\t\t AND T2.sal_dam_sid = ? \t\t\t\t\t\t\\n\");\t// 영업담당자 \n\t\t\t\t\t}\n\t\t\t\t\tif (!\"\".equals(sUse_yn)) { // 사용유무 \n\t\t\t\t \t\t arr_sql[1].append(\"\t\t AND T1.use_yn = ? \t\t\t\t\t\\n\");\t// 사용여부 \n\t\t\t\t\t}\n\t\t\t \t\t arr_sql[1].append(\"\t\t ORDER BY T1.client_nm, T1.client_cd\t\t\t\t\t\\n\");\n\t\n\t\t\t \t\tcstmt = conn.prepareCall(arr_sql[1].toString()); \n\t\t\t \t\t \t\n\t\t\t\t \t// 조건\n\t\t\t \t\tif (!\"\".equals(sClient_nm)) {\n\t\t\t\t \t\tcstmt.setString(sCnt1++, sClient_nm + \"%\");\t\t// 매출처코드\n\t\t\t\t \t\tcstmt.setString(sCnt1++, sClient_nm + \"%\");\t\t// 매출처명\n\t\t\t\t \t\t \n\t\t\t\t\t}\n\t\t\t\t\tif (!\"\".equals(sSal_dam_sid)) { \n\t\t\t\t\t\tcstmt.setString(sCnt1++, sSal_dam_sid );\t\t\t// 영업담당자 \n\t\t\t\t\t}\n\t\t\t\t\tif (!\"\".equals(sUse_yn)) { \n\t\t\t\t \t\t cstmt.setString(sCnt1++, sUse_yn);\t\t\t\t// 사용여부 \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\trs = cstmt.executeQuery(); \n\t\t \t\t\tgos.write(getDataSet(rs, ds1));// DataSet set\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * 계약정보\n\t\t\t\t */\n\t\t\t\tif(dSets[i].getName().equals(\"ds2\")){\n\t\t \t\tGauceDataSet ds1 = gis.read(\"DS2\");\n\t\t\t\t\t \n\t\t\t\t\tif (!\"\".equals(sClient_sid)) { \n\t\t\t\t\t\tarr_sql[2].append(\"\t\tAND T1.client_sid = ?\t\\n\");\t// 대리점SID\n\t\t\t\t \t\t \n\t\t\t\t\t} else if (\"\".equals(sClient_sid)) {\n\t\t\t\t\t\tarr_sql[2].append(\"\t\tAND T1.client_sid = 0 \\n\");\n\t\t\t\t\t}\n\t\t\t \t\t arr_sql[2].append(\"\t\tORDER BY T1.cont_date\");\t\n\t\n\t\t\t \t\t // 쿼리 실행\n\t\t\t \t\t//StringUtil.printMsg(\"QUERY\",arr_sql[2].toString(),this);\n\t\t\t \t\tcstmt = conn.prepareCall(arr_sql[2].toString()); \n\t\t\t \t\t\n\t\t\t \t\t// 조건\n\t\t\t \t\tif (!\"\".equals(sClient_sid)) { \n\t\t\t\t \t\tcstmt.setString(sCnt1++, sClient_sid);\t\t\t// 대리점 SID\n\t\t\t\t\t}\n\t\t\t \t\t\n\t\t\t \t\trs = cstmt.executeQuery(); \n\t\t \t\t\tgos.write(getDataSet(rs, ds1));// DataSet set\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t\t/*\n\t\t\t\t * 지점정보\n\t\t\t\t */\n\t\t\t\tif(dSets[i].getName().equals(\"ds3\")){\n\t\t \t\tGauceDataSet ds1 = gis.read(\"DS3\");\n\t\t\t\t\tif (!\"\".equals(sClient_sid)) { // 대리점코드/명\n\t\t\t\t \t\t arr_sql[3].append(\"WHERE T1.client_sid = ?\t\t\\n\");\t// 매출처코드\n\t\t\t\t \t\t \n\t\t\t\t\t} else if (\"\".equals(sClient_sid)) {\n\t\t\t\t\t\tarr_sql[3].append(\"WHERE T1.client_sid = 0\t\t\\n\");\t// 매출처코드\n\t\t\t\t\t}\n\t\t\t \t\t arr_sql[3] .append(\"ORDER BY T1.branch_cd\t\t\t\\n\");\n\t\t\n\t\t\t \t\tcstmt = conn.prepareCall(arr_sql[3].toString()); \n\t\t\t\t \t\t\n\t\t\t \t\t// 조건\n\t\t\t \t\tif (!\"\".equals(sClient_sid)) {\n\t\t\t \t\t\tcstmt.setString(sCnt1++, sClient_sid);\t\t\t// 대리점 SID\n\t\t\t\t\t}\n\t\t\t \t\t\n\t\t\t \t\trs = cstmt.executeQuery(); \n\t\t \t\t\tgos.write(getDataSet(rs, ds1));// DataSet set\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * 수수료율\n\t\t\t\t */\n\t\t\t\tif(dSets[i].getName().equals(\"ds4\")){\n\t\t \t\tGauceDataSet ds1 = gis.read(\"DS4\");\n\t\t\t\t\t\t \n\t\t\t\t\tif (!\"\".equals(sClient_sid)) { // 대리점코드/명\n\t\t\t\t \t\tarr_sql[14].append(\"\tAND T1.CLIENT_SID = ?\t\t\t\\n\");\n\t\t\t\t \t\t \n\t\t\t\t\t} else if (\"\".equals(sClient_sid)) {\n\t\t\t\t\t\tarr_sql[14].append(\"WHERE T1.client_sid = 0\t\t\\n\");\t// 매출처코드\n\t\t\t\t\t}\n\t\t\t \t\t arr_sql[14] .append(\"ORDER BY T1.FR_DATE\t\t\t\\n\");\n\t\n\t\t\t \t\tcstmt = conn.prepareCall(arr_sql[14].toString());\n\t\t\t \t\t\n\t\t\t \t\t// 조건\n\t\t\t \t\tif (!\"\".equals(sClient_sid)) {\n\t\t\t \t\t\tcstmt.setString(sCnt1++, sClient_sid);\t\t\t// 대리점 SID\n\t\t\t\t\t}\n\t\t\t \t\t\n\t\t\t \t\trs = cstmt.executeQuery(); \n\t\t \t\t\tgos.write(getDataSet(rs, ds1));// DataSet set\n\t\t\t\t}\n\t\t\t\t\tsCnt1 = 1;\n\t\t\t\t}\n\t\t}catch (SQLException sqle){\n\t\t\t//res.writeException(\"ERROR\", sqle.getErrorCode()+\"\", sqle.getMessage());\n\t\t\tthrow sqle;\n\t\t} catch (Exception e){\n\t\t\t//res.writeException(\"ERROR\", \"\", e.toString());\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tif(rs!=null) rs.close();\n\t\t\tif(cstmt!=null) cstmt.close();\n\t\t}\t\n\t}", "String getInter_contestable();", "public static void main(String[] args) {\n SudokuBoard board = null;\n board = new SudokuBoard(9);\n /*try {\n board.read();\n } catch (InvalidNumberInCellException | OutOfRangeException e) {\n e.printStackTrace();\n }*/\n SudokuGenerator gen = null;\n gen = new SudokuGenerator(SudokuGenerator.Difficulty.EASY, 9);\n gen.generate(board);\n gen.removeCells(board, 25);\n board.print();\n SudokuSolver2 solver = new SudokuSolver2();\n int res = solver.uniqueSolution(board);\n if(res == 0 || res == 1) System.out.print(\"No \");\n System.out.print(\"té solució\");\n if(res != 0) System.out.println(\" única\");\n solver.solve(board).print();\n\n\n\n }", "public Long obtenerUniGeoPorUBIGEO(String ubigeo, Long pais)\n throws MareException {\n \n UtilidadesLog.info(\"DAOZON.obtenerUniGeoPorUBIGEO(String ubigeo, Long pais): Entrada\");\n \n BelcorpService bs;\n RecordSet resultado = new RecordSet();\n StringBuffer query = new StringBuffer();\n UtilidadesLog.debug(\"ubigeo \" + ubigeo);\n\n try {\n bs = BelcorpService.getInstance();\n } catch (Exception re) {\n throw new MareException(re,\n UtilidadesError.armarCodigoError(\n CodigosError.ERROR_AL_LOCALIZAR_UN_COMPONENTE_EJB));\n }\n\n query.append(\" select OID_VALO_ESTR_GEOP \");\n query.append(\" from ZON_VALOR_ESTRU_GEOPO a \");\n query.append(armarWhereStr(ubigeo));\n query.append(\" and PAIS_OID_PAIS = \" + pais);\n query.append(\" and IND_BORR = 0 \");\n\n try {\n resultado = bs.dbService.executeStaticQuery(query.toString());\n UtilidadesLog.debug(\"resultado \" + resultado.toString());\n } catch (Exception e) {\n throw new MareException(e,\n UtilidadesError.armarCodigoError(\n CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS));\n }\n\n if (resultado.esVacio()) {\n UtilidadesLog.info(\"DAOZON.obtenerUniGeoPorUBIGEO(String ubigeo, Long pais): Salida\");\n return null;\n } else {\n Vector idResultado = resultado.getColumn(0);\n UtilidadesLog.info(\"DAOZON.obtenerUniGeoPorUBIGEO(String ubigeo, Long pais): Salida\");\n return new Long(((BigDecimal) idResultado.elementAt(0)).longValue());\n }\n }", "public static short[][] solvePuzzle(short[][] puzzle) {\r\n\r\n\t\tECMatrix matrix = _translateToECMatrix(puzzle);\r\n\t\t\r\n\t\tboolean status = ECUtil.findExactCover(matrix);\r\n\t\t\r\n\t\tSystem.out.println(\"result is \"+ status );\r\n\t\tshort[][] result = translateResult(matrix.getExactCoverPartition());\r\n\t\t\r\n\t\treturn result;\r\n\t}", "private String getQuerySelecaoClientes() \n\t{\n\t\tString result = \n\t\t\t\"SELECT \"\n\t\t\t+\t\" P_ASSINANTE.IDT_MSISDN, \" \n\t\t\t+\t\" P_ASSINANTE.IDT_PROMOCAO, \"\n\t\t\t+\t\" P_ASSINANTE.DAT_EXECUCAO, \" \n\t\t\t+\t\" P_ASSINANTE.DAT_ENTRADA_PROMOCAO, \"\n\t\t\t+\t\" P_ASSINANTE.IND_SUSPENSO, \"\n\t\t\t+\t\" P_ASSINANTE.IND_ISENTO_LIMITE, \"\n\t\t\t+\t\" ASSINANTE.IDT_STATUS, \" \n\t\t\t+\t\" ASSINANTE.VLR_SALDO_PRINCIPAL, \" \n\t\t\t+\t\" ASSINANTE.DAT_EXPIRACAO_PRINCIPAL, \" \n\t\t\t+\t\" PROMOCAO.IND_ZERAR_SALDO_BONUS, \" \n\t\t\t+\t\" PROMOCAO.IND_ZERAR_SALDO_SMS, \" \n\t\t\t+\t\" PROMOCAO.IND_ZERAR_SALDO_GPRS, \" \n\t\t\t//A divisao por 60 deve-se a alteracao da carga de CDRs para preencher os valores da \n\t\t\t//TBL_GER_TOTALIZACAO_PULA_PULA em segundos e nao minutos, de forma a diminuir a perda de precisao.\n\t\t\t+\t\" NVL(MINUTOS.MIN_CREDITO, 0)/60 AS MIN_CREDITO, \" \n\t\t\t+\t\" NVL(MINUTOS.MIN_FF, 0)/60 AS MIN_FF \" \n\t\t\t+\t\"FROM \"\n\t\t\t+\t\" TBL_APR_ASSINANTE ASSINANTE, \"\n\t\t\t+\t\" TBL_GER_PROMOCAO_ASSINANTE P_ASSINANTE, \" \n\t\t\t+\t\" TBL_GER_PROMOCAO PROMOCAO, \"\n\t\t\t+\t\" TBL_GER_TOTALIZACAO_PULA_PULA MINUTOS \"\n\t\t\t+\t\"WHERE \"\n\t\t\t+\t\" ASSINANTE.IDT_MSISDN = P_ASSINANTE.IDT_MSISDN AND \"\n\t\t\t+\t\" P_ASSINANTE.IDT_PROMOCAO = PROMOCAO.IDT_PROMOCAO AND \"\n\t\t\t+\t\" P_ASSINANTE.IDT_MSISDN = MINUTOS.IDT_MSISDN (+) AND \"\n\t\t\t+\t\" P_ASSINANTE.DAT_EXECUCAO <= ? AND \"\n\t\t\t+\t\" PROMOCAO.IDT_CATEGORIA = \" \n\t\t\t+\t\tString.valueOf(ID_CATEGORIA_PULA_PULA) + \" AND \"\n\t\t\t+\t\" MINUTOS.DAT_MES (+) = ? AND \"\n\t\t\t//PONTO DE ATENCAO: Verificar pela fila de recargas e nao pela tabela de recargas devido aos\n\t\t\t//agendamentos (Se a execucao na fila de recargas ainda nao tiver sido realizada, o registro na\n\t\t\t//fila sera duplicado)\n\t\t\t+\t\" NOT EXISTS \"\n\t\t\t+\t\" ( \"\n\t\t\t+\t\" SELECT 1 \" \n\t\t\t+\t\" FROM \"\n\t\t\t+\t\" TBL_REC_FILA_RECARGAS RECARGAS \" \n\t\t\t+\t\" WHERE \" \n\t\t\t+\t\" RECARGAS.IDT_MSISDN = P_ASSINANTE.IDT_MSISDN AND \"\n\t\t\t+\t\" RECARGAS.TIP_TRANSACAO = ? AND \"\n\t\t\t+\t\" RECARGAS.IDT_STATUS_PROCESSAMENTO IN \" \n\t\t\t+\t\" (\" \n\t\t\t+ String.valueOf(REC_STATUS_NAO_EXECUTADO) + \", \" \n\t\t\t+ String.valueOf(REC_STATUS_OK) + \", \"\n\t\t\t+ String.valueOf(REC_STATUS_TESTE_PULA_PULA) \n\t\t\t+\t\" ) AND \"\n\t\t\t+\t\" RECARGAS.DAT_EXECUCAO >= ? AND \"\n\t\t\t+\t\" RECARGAS.DAT_EXECUCAO < ? \"\n\t\t\t+\t\" ) AND \"\n\t\t\t//Descartar assinantes que ja foram processados na data de execucao atual ou que nao possuem\n\t\t\t//ligacoes\n\t\t\t+\t\" NOT EXISTS \"\n\t\t\t+\t\" ( \"\n\t\t\t+\t\" SELECT 1 \" \n\t\t\t+\t\" FROM \"\n\t\t\t+\t\" TBL_GER_HISTORICO_PULA_PULA HISTORICO \" \n\t\t\t+\t\" WHERE \" \n\t\t\t+\t\" HISTORICO.IDT_MSISDN = P_ASSINANTE.IDT_MSISDN AND \"\n\t\t\t+\t\" ( \" \n\t\t\t+\t\" HISTORICO.DAT_EXECUCAO = ? OR \"\n\t\t\t+\t\" ( \"\n\t\t\t+\t\" HISTORICO.DAT_EXECUCAO BETWEEN ? AND ? AND \" \n\t\t\t+\t\" HISTORICO.IDT_CODIGO_RETORNO = \" + String.valueOf(RET_PULA_PULA_LIGACOES_NOK) \n\t\t\t+\t\" ) \"\n\t\t\t+\t\" ) \"\n\t\t\t+\t\" ) \";\n\t\t\n\t\treturn result;\n\t}", "public int findGameTypeBySerialNo(String serialNo) throws ApplicationException;", "protected NbaSearchVO lookupWork() throws NbaBaseException {\t//SPR2992 changed method signature\n\t\t//NBA213 deleted code\n\t\t\tNbaSearchVO searchVO = new NbaSearchVO();\n\t\t\tString entryPoints[] = { NbaVpmsAdaptor.EP_REIN_PRIMARY_SEARCH_FIELDS, NbaVpmsAdaptor.EP_REIN_SECONDARY_SEARCH_FIELDS };\n\t\t\tfor (int i = 0; i < entryPoints.length; i++) {\n\t\t\t\tNbaVpmsResultsData data = getDataFromVpms(entryPoints[i]);\n\t\t\t\t//begin SPR2806\n\t\t\t\tArrayList aList = data.getResultsData();\n\t\t\t\t//check if sufficient lob data is present on work, if not just skip this matching criteria\n\t\t\t\tif (!checkLobPresence(getWork().getNbaLob(), aList)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsetLookupDataFound(true);\t//SPR2992\t\t\t\t\t\n\t\t\t\tsearchVO.setNbaLob(getNbaLobForLookup(aList));\n\t\t\t\t//Code moved ALS5171\n\t\t\t\t// end SPR2806\n\t\t\t\tif (getWork().getTransaction().getWorkType().equalsIgnoreCase(A_WT_REINSURANCE)) {\n\t\t\t\t\tsearchVO.setWorkType(A_WT_TEMP_REINSURANCE);\n\t\t\t\t\tsearchVO.setStatus(A_STATUS_REINSURANCE_INDEXED);//ALS5171\n\t\t\t\t} else {\n\t\t\t\t\tsearchVO.setWorkType(A_WT_REINSURANCE);\n\t\t\t\t\tif(isAdditionalInfo) {//ALS5494\n\t\t\t\t\t\tsearchVO.setQueue(END_QUEUE);//ALS5494\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsearchVO.setStatus(A_STATUS_REINSURANCE_ORDERED);//ALS5171\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsearchVO.setResultClassName(\"NbaTransactionSearchResultVO\");\n\t\t\t\tsearchVO = lookupWork(getUser(), searchVO);\t//SPR3009, NBA213\n\t\t if (searchVO.isMaxResultsExceeded()){\t//NBA146\n\t\t throw new NbaBaseException(NbaBaseException.SEARCH_RESULT_EXCEEDED_SIZE, NbaExceptionType.FATAL);\t//NBA146\n\t\t }\t//NBA146\n\t\t\t\tif (!(searchVO.getSearchResults().isEmpty())) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn searchVO;\n\t\t//NBA213 deleted code\n\t}", "public void Consultar(String query) {\n try {\n conectionSql();\n preparedStatement = conection.prepareStatement(query);\n } catch (Exception e) {\n// MessageEmergent(\"Fail Consultar(): \"+e.getMessage());\n }\n }", "private String getConsulta(int indice) {\r\n\t\tString sql = \"\";\r\n\t\tStringBuffer variables = new StringBuffer();\r\n\t\tinParams = ((TxParams)todo.get(indice)).getParams().entrada;\r\n\t\toutParams = ((TxParams)todo.get(indice)).getParams().salida;\r\n\t\tif ((inParams == null || inParams.size() == 0) && (outParams == null || outParams.size() == 0))\r\n\t\t\tsql = \"{call \" + consultas[indice] + \"}\";\r\n\t\telse {\r\n\t\t\t//Por cada parametro de entrada corresponde un ?\r\n\t\t\t//Ojo que tambien hay que considerar los de salida si es necesario\r\n\t\t\t//pero no esta cubierto en esta primera etapa\r\n\t\t\tif (inParams != null) {\r\n\t\t\t\tfor (int i = 0; i < inParams.size(); i++)\r\n\t\t\t\t\tvariables.append(\"?,\");\r\n\t\t\t}\r\n\t\t\tif (outParams != null) {\r\n\t\t\t\tfor (int i = 0; i < outParams.size(); i++)\r\n\t\t\t\t\tvariables.append(\"?,\");\r\n\t\t\t}\r\n\t\t\tString listaVars = variables.toString();\r\n\t\t\tlistaVars = listaVars.substring(0, listaVars.length() - 1);\r\n\t\t\tsql = \"{call \" + consultas[indice] + \"(\" + listaVars + \")}\";\r\n\t\t}\r\n\t\treturn sql;\r\n\t}", "public JSONObject getProblem (String title){\n JSONObject problem = new JSONObject();\n String query=\"select p.id, p.title,p.statement,p.category,p.difficulty,t.test_in,t.test_out from problem p inner join problem_test t on p.id = t.id_problem where p.title=? limit 1\";\n\n try {\n Connection myConn = Database.getConnection();\n PreparedStatement statement = myConn.prepareStatement(query);\n statement.setString(1, title);\n\n ResultSet resultSet = statement.executeQuery();\n while (resultSet.next()) {\n problem.put(\"id\",resultSet.getInt(\"id\"));\n problem.put(\"title\",resultSet.getString(\"title\"));\n problem.put(\"statement\",resultSet.getString(\"statement\"));\n problem.put(\"category\",resultSet.getInt(\"category\"));\n problem.put(\"difficulty\",resultSet.getString(\"difficulty\"));\n problem.put(\"test_in\",resultSet.getString(\"test_in\"));\n problem.put(\"test_out\",resultSet.getString(\"test_out\"));\n\n }\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n return problem;\n }", "public void incomingSearchRequest(APDUEvent e)\n {\n LOGGER.finer(\"Processing incomingSearch_Request\");\n \n SearchRequest_type search_request = (SearchRequest_type) (e.getPDU().o);\n \n // Create a search response\n PDU_type pdu = new PDU_type();\n pdu.which=PDU_type.searchresponse_CID;\n SearchResponse_type response = new SearchResponse_type();\n pdu.o = response;\n \n int ssub = search_request.smallSetUpperBound.intValue();\n int lslb = search_request.largeSetLowerBound.intValue();\n int mspn = search_request.mediumSetPresentNumber.intValue();\n \n LOGGER.finer(\"ssub = \" + ssub + \" lslb = \" + lslb + \" mspn = \" + mspn);\n \n response.referenceId = search_request.referenceId; \n \n // Assume failure unless something below sets to true\n response.searchStatus = Boolean.FALSE;\n \n RootNode rn = null;\n \n try\n {\n switch(search_request.query.which)\n {\n case Query_type.type_0_CID:\n LOGGER.finer(\"Processing Any Query\");\n // Any\n break;\n case Query_type.type_1_CID:\n case Query_type.type_101_CID:\n // RPN query\n LOGGER.finer(\"Processing RPN Query\");\n rn = com.k_int.z3950.util.RPN2Internal.zRPNStructure2RootNode\n \t ((RPNQuery_type)(search_request.query.o));\n break;\n case Query_type.type_2_CID:\n case Query_type.type_100_CID:\n case Query_type.type_102_CID:\n LOGGER.finer(\"Processing OctetString Query\");\n // Octet String\n break;\n }\n \n if ( rn != null )\n {\n LOGGER.finer(\"Got root node\");\n \n IRQuery q = new IRQuery();\n q.collections = search_request.databaseNames;\n q.query = new com.k_int.IR.QueryModels.RPNTree(rn);\n \n // Process the query\n LOGGER.finer(\"Create Search Task with query:\" + q);\n SearchTask st = search_service.createTask\n \t (q, search_request.referenceId);\n \t\n \n // Evaluate the query, waiting 10 seconds for the task to complete. \n \t//We really want to be\n // able to pass in a predicate to wait for here, \n \t//e.g. evaluate(10000, \"NumHits > 100 OR Status=Complete\");\n LOGGER.finer(\"Evaluate Search Task\");\n try\n {\n st.evaluate(10000);\n }\n catch ( TimeoutExceededException tee )\n {\n LOGGER.finer(\"Timeout exceeded waiting for search to complete\");\n }\n \n if ( search_request.resultSetName != null ) {\n \t LOGGER.finer(\"putting st with name \" + \n \t\t\t search_request.resultSetName);\n \t active_searches.put(search_request.resultSetName, st);\n \t}\n \tactive_searches.put(\"Default\", st);\n \t\n // Result records processing\n int result_count = st.getTaskResultSet().getFragmentCount();\n LOGGER.finer(\"result count is \"+result_count);\n \n // Number of hits\n response.resultCount = BigInteger.valueOf(result_count);\n \n // Figure out Search Status\n if ( ( st.getTaskStatusCode() != SearchTask.TASK_FAILURE ) )\n {\n response.searchStatus = Boolean.TRUE;\n }\n else\n {\n // Figure out Result Set Status\n switch ( st.getTaskStatusCode() )\n {\n case SearchTask.TASK_EXECUTING_ASYNC:\n case SearchTask.TASK_EXECUTING_SYNC:\n // resultSetStatus = 2 (interim) Partial results available, \n \t\t//not necessarily valid\n response.resultSetStatus = BigInteger.valueOf(2);\n break;\n case SearchTask.TASK_FAILURE:\n // resultSetStatus = 3 (none) No result set\n response.resultSetStatus = BigInteger.valueOf(3);\n break;\n }\n }\n \n LOGGER.finer(\"Is \"+result_count+\" <= \"+lslb +\" or <= \"+ssub);\n \n if ( ( result_count <= lslb ) || ( result_count <= ssub ) )\n {\n LOGGER.finer(\"Yep\");\n \n int start = 1;\n int count = ( result_count <= ssub ? result_count : mspn );\n \n if ( count > 0 )\n \t {\n \t\t LOGGER.finer(\"Asking for \"+count+\n \t\t\t \" response records from \"+start);\n \t\t LOGGER.finer(\"Search request default = \" \n \t\t\t + search_request.preferredRecordSyntax);\n \t\t response.records = createRecordsFor\n \t\t (st, search_request.preferredRecordSyntax, start, \n \t\t count, GeoProfile.BREIF_SET);\n \t\t \n \n \t\t if (response.records.which == \n \t\t Records_type.responserecords_CID ){\n \t\t LOGGER.finer(\"We have records\");\n \t\t \n \t\t // Looks like we managed to present some records OK..\n \t\t response.numberOfRecordsReturned = \n \t\t\t BigInteger.valueOf(((Vector)\n \t\t\t\t\t (response.records.o)).size());\n \t\t response.nextResultSetPosition = \n \t\t\t BigInteger.valueOf(count+1);\n \t\t response.presentStatus = BigInteger.valueOf(0);\n \t\t } else { // Non surrogate diagnostics ( Single or Multiple )\n \t\t \n \t\t LOGGER.finer(\"Diagnostics\");\n \t\t response.presentStatus = BigInteger.valueOf(5);\n \t\t response.numberOfRecordsReturned = \n \t\t\t BigInteger.valueOf(0);\n \t\t response.nextResultSetPosition = \n \t\t\t BigInteger.valueOf(1);\n \t\t }\n \t } else {\n \t\t LOGGER.finer(\"No need to piggyback records....\");\n \t\t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t\t response.nextResultSetPosition = BigInteger.valueOf(1);\n \t\t response.presentStatus = BigInteger.valueOf(0);\n \t }\n } else {\n \t response.presentStatus = BigInteger.valueOf(5);\n \t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t response.nextResultSetPosition = BigInteger.valueOf(1); \t\n \t}\n }\n else\n \t LOGGER.finer(\"Unable to process query into root node\");\n }\n catch ( com.k_int.IR.InvalidQueryException iqe )\n \t{\n \t // Need to send a diagnostic\n \t iqe.printStackTrace();\n \t response.resultCount = BigInteger.valueOf(0);\n \t response.presentStatus = BigInteger.valueOf(5); // Failure\n \t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t response.nextResultSetPosition = BigInteger.valueOf(0);\n \t response.resultSetStatus = BigInteger.valueOf(3);\n \t // No result set available\n \t response.records = createNSD(null, iqe.toString());\n \t}\n catch ( SearchException se )\n \t{\n \t // We need to populate a diagnostic here\n \t LOGGER.finer(\"Search returning diagnostic. Reason:\"+se.toString());\n \t se.printStackTrace();\n \t response.resultCount = BigInteger.valueOf(0);\n \t response.presentStatus = BigInteger.valueOf(5); // Failure\n \t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t response.nextResultSetPosition = BigInteger.valueOf(0);\n \t response.resultSetStatus = BigInteger.valueOf(3); \n \t // No result set available\n \t response.records = createNSD((String)(se.additional), \n \t\t\t\t\t se.toString());\n \t}\n \n LOGGER.finer(\"Send search response : \");\n try\n \t{\n \t assoc.encodeAndSend(pdu);\n \t}\n catch ( java.io.IOException ioe )\n \t{\n \t ioe.printStackTrace();\n \t} \n }", "public ResultSet hacerConsulta(String query) throws SQLException{\n Statement st = conexion.createStatement();//para poder hacer la consulta a la base necesitamos un objeto de la clase Statement \n ResultSet rs = st.executeQuery(query); //el objeto st realiza la consulta y retorna el resultado en un objeto de la clase ResultSet\n return rs; // devolvemos la consulta al main\n }", "public RecordSet obtenerTiposCargoPorEtapa(es.indra.sicc.util.DTOOID dtoe) throws MareException{\n UtilidadesLog.info(\"DAOParametrizacionCOB.obtenerTiposCargoPorEtapa(es.indra.sicc.util.DTOOID dtoe): Entrada\");\n \n RecordSet rs = new RecordSet();\n StringBuffer query = new StringBuffer();\n BelcorpService bs;\n try\n { bs = BelcorpService.getInstance();\n }\n catch(MareMiiServiceNotFoundException ex)\n { throw new MareException(ex, UtilidadesError.armarCodigoError(CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE));\n }\n\n // gPineda - V-COB006 - 30/01/2007\n //query.append(\" SELECT OID_ETAP_DEUD_TIPO_CARG AS OID, VAL_DESC descripcion \");\n query.append(\" SELECT oid_etap_deud_tipo_carg AS OID, NVL(val_desc, gen.VAL_I18N) descripcion \");\n query.append(\" FROM cob_etapa_deuda_tipo_cargo etapTipoCar, \");\n query.append(\" \t\t ccc_tipo_cargo_abono tipoCar, \");\n query.append(\" \t\t gen_i18n_sicc_pais gen \");\n query.append(\" WHERE ETDE_OID_ETAP_DEUD = \" + dtoe.getOid() );\n query.append(\" \t and etapTipoCar.TCAB_OID_TIPO_CARG_ABON = tipoCar.OID_TIPO_CARG_ABON \");\n query.append(\" \t\t and gen.VAL_OID = tipoCar.OID_TIPO_CARG_ABON \");\n query.append(\" \t\t and gen.ATTR_ENTI = 'CCC_TIPO_CARGO_ABONO' \");\n query.append(\" \t\t and gen.ATTR_NUM_ATRI = 1 \");\n query.append(\" ORDER BY descripcion \");\n \n try \n { rs = bs.dbService.executeStaticQuery(query.toString());\n }\n catch (Exception ex) \n { throw new MareException(ex, UtilidadesError.armarCodigoError(CodigosError.ERROR_DE_ACCESO_A_BASE_DE_DATOS));\n }\n \n UtilidadesLog.info(\"DAOParametrizacionCOB.obtenerTiposCargoPorEtapa(es.indra.sicc.util.DTOOID dtoe): Salida\");\n \n return rs; \n }", "private static void consultaProduto() throws Exception {\r\n boolean erro;\r\n int id;\r\n Produto p;\r\n Categoria c;\r\n System.out.println(\"\\t** Consultar produto **\\n\");\r\n do {\r\n erro = false;\r\n System.out.print(\"ID do produto a ser consultado: \");\r\n id = read.nextInt();\r\n if (id <= 0) {\r\n erro = true;\r\n System.out.println(\"ID Inválida! \");\r\n }\r\n System.out.println();\r\n } while (erro);\r\n p = arqProdutos.pesquisar(id - 1);\r\n if (p != null && p.getID() != -1) {\r\n c = arqCategorias.pesquisar(p.idCategoria - 1);\r\n System.out.println(\r\n \"Id: \" + p.getID()\r\n + \"\\nNome: \" + p.nomeProduto\r\n + \"\\nDescricao: \" + p.descricao\r\n + \"\\nPreco: \" + tf.format(p.preco)\r\n + \"\\nMarca: \" + p.marca\r\n + \"\\nOrigem: \" + p.origem\r\n );\r\n if (c != null) {\r\n System.out.println(\"Categoria: \" + c.nome);\r\n } else {\r\n System.out.println(\"Categoria: \" + p.idCategoria);\r\n }\r\n } else {\r\n System.out.println(\"Produto não encontrado!\");\r\n }\r\n }", "private String idsConstrain(ArrayList <String> uids){\n String query = \"\";\n if(uids.size() > 0){\n query = \" ( \" \n // If uids used are PMC ids, remove PMC part - not recognized by Entrez utilites! \n + uids.get(0).replace(\"PMC\", \"\") \n + \"[UID] \";\n\n for(int i = 1; i < uids.size() ; i++){\n query += \"OR \" \n // If uids used are PMC ids, remove PMC part - not recognized by Entrez utilites! \n + uids.get(i).replace(\"PMC\", \"\") \n + \"[UID] \";\n }\n query += \") \"; \n }\n return query; \n }", "public String[] busquedaUsuarioXusuario(String usu){\n\t\tconectar();\n\t\t\n\t\tString[] salida=new String[]{usu};\n\t\ttry {\n\n\t\t\tStatement consulta;\n\t\t\tconsulta = con.createStatement();\n\n\t\t\tResultSet tabla = consulta.executeQuery(\"select usuario from \"+dtbs+\".usuarios where Usuario like '%\"+usu+\"%' and usuarios.admin=0\");\n\t\t\t\n\t\t\tint size=0;\n\t\t\twhile (tabla.next()) {\n\t\t\t\t\n\t\t\t\tsize++;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\ttabla.beforeFirst();\n\t\t\tsalida=new String[size];\n\t\t\tint index=1;\n\t\t\twhile (tabla.next()) {\n\t\t\t\tString usuario= tabla.getString(1);\n\n\t\t\t\tsalida[index-1]=usuario;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn salida;\n\t\t} catch (SQLException e) {\n\t\t\tPrincipal.getInstancePrincipal().registrarErrorDB(\"< ERROR CONBUS 53> En la conexion con la base de datos\"+e);\n\t\t\tcloseConnection();\n\t\t\treturn salida;\n\t\t}\n\t\t\n\t\t\n\t}", "public java.sql.ResultSet consultaporespecialidad(String CodigoEspecialidad){\r\n java.sql.ResultSet rs=null;\r\n Statement st = null;\r\n try{\r\n \tConexion con=new Conexion();\r\n \tst = con.conn.createStatement();\r\n \trs=st.executeQuery(\"select phm.codigo,phm.horas,phm.fechas,phm.NombrePaciente,pes.nombre_especialidad,pmd.nombre,pmd.apellidos,phm.estado,pes.codigo,pmd.codigo from pyp_horariomedico phm,pyp_medico pmd,pyp_especialidad pes where pes.codigo=\"+CodigoEspecialidad+\" and phm.codMedico_fk=pmd.codigo and pmd.codEspe_fk=pes.codigo and phm.fechas >= CURDATE() ORDER BY phm.fechas,phm.horas\");\r\n }\r\n catch(Exception ex){\r\n \tSystem.out.println(\"Error en PYP_MetodoConsultasAsignacion>>consultaporespecialidad \"+ex);\r\n }\t\r\n return rs;\r\n }" ]
[ "0.55613244", "0.5428159", "0.541852", "0.5391133", "0.53482777", "0.5298249", "0.5256226", "0.5215686", "0.52028286", "0.5165698", "0.5151723", "0.51313573", "0.5103518", "0.50899047", "0.5059625", "0.5040657", "0.50326234", "0.50304765", "0.50262433", "0.50065285", "0.4981653", "0.49777412", "0.49602082", "0.4959708", "0.49576715", "0.49390465", "0.49324036", "0.49149832", "0.49093473", "0.48949903", "0.48944578", "0.48872256", "0.48810476", "0.4875231", "0.48671505", "0.48624307", "0.4857594", "0.48547876", "0.48304623", "0.4820779", "0.4819469", "0.4807329", "0.4802819", "0.48004156", "0.47971958", "0.47942153", "0.47940525", "0.47859722", "0.4783898", "0.47795162", "0.47794205", "0.47723767", "0.47722372", "0.4770193", "0.4753701", "0.47494164", "0.47434425", "0.47430468", "0.4736699", "0.47207436", "0.47166663", "0.4709171", "0.4701809", "0.47016805", "0.4700717", "0.4700332", "0.46999958", "0.46948624", "0.46925014", "0.46923336", "0.46918875", "0.4691392", "0.46820873", "0.46771598", "0.46769673", "0.466503", "0.46642426", "0.46617746", "0.46613893", "0.46611544", "0.4656766", "0.46516982", "0.46509275", "0.4647793", "0.46441543", "0.46416742", "0.46371803", "0.4634256", "0.462319", "0.46229807", "0.4622121", "0.46207723", "0.46197075", "0.46193412", "0.46099767", "0.4608889", "0.46014094", "0.46012765", "0.45943543", "0.45938426" ]
0.48901302
31
A method to reset year, problem, and restriction parameters to their original value
private void resetParams() { lowerYear = 1999; upperYear = 2020; yearRestriction = false; lowerProblem = 1; upperProblem = 60; problemRestriction = false; partTwo = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setYear(int _year) { year = _year; }", "public void inputTempForYear() {\n\t\t\n\t\tfor (int i=0; i<12; i++)\n\t\t\tinputTempForMonth(i);\n\t}", "public void setYear(int year){\r\n\t\ttry{\r\n\t\t\tif(year>=1900)\r\n\t\t\tthis.year = year;\r\n\t\t\telse\r\n\t\t\t\tthrow new cardYearException();\r\n\t\t}catch(cardYearException ex){\r\n\t\t\tSystem.out.println(\"Baseball Cards weren't invented \"\r\n\t\t\t\t\t+ \"before 1900!\");\r\n\t\t\tSystem.out.print(\"Please enter a valid year: \");\r\n\t\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\tint retry = input.nextInt();\r\n\t\t\t\tsetYear(retry);\r\n\t\t}\r\n\t}", "private int restrictYear(Message msg, String parameter, int section) {\n int[] years = setYearRestriction(msg, parameter, section);\n\n if (years[0] == ERROR_CODE[0]) {\n return -1;\n }\n\n yearRestriction = true;\n lowerYear = years[0];\n upperYear = years[1];\n return 0;\n }", "public void setYear (int yr) {\n year = yr;\n }", "public void setYear(int value) {\r\n this.year = value;\r\n }", "public void setYear(int year) {\n\tthis.year = year;\n}", "public void setYear(int value) {\n\tthis.year = value;\n }", "@Override\n\tpublic void setYear(int year) throws RARException {\n\t\tthis.year = year;\n\t}", "public void setYear(int y){\n\t\tyear = y ; \n\t}", "public void setYear(int year)\n {\n this.year = year;\n }", "public void setYear(int year) throws InvalidDateException {\r\n\t\tif (year <= 2100 & year >= 2000) {\r\n\t\t\tthis.year = year;\r\n\t\t} else {\r\n\t\t\tthrow new InvalidDateException(\"Please enter a realistic year for the date (between 2000 and 2100) !\");\r\n\t\t}\r\n\t}", "public void setYear(int year)\r\n\t{\r\n\t\tthis.year = year;\r\n\t}", "public void setPrevYear()\n\t{\n\t\tm_calendar.set(Calendar.YEAR,getYear()-1);\n\n\t}", "public void setYear(int year) {\r\n this.year = year;\r\n }", "public void removeAllOriginalReleaseYear() {\r\n\t\tBase.removeAll(this.model, this.getResource(), ORIGINALRELEASEYEAR);\r\n\t}", "public void setDocumentYear(int documentYear);", "public void setYear(int year) {\n this.year = year;\n }", "public void setYear(int r1) throws java.lang.IllegalArgumentException {\n /*\n // Can't load method instructions: Load method exception: null in method: gov.nist.javax.sip.header.SIPDate.setYear(int):void, dex: in method: gov.nist.javax.sip.header.SIPDate.setYear(int):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: gov.nist.javax.sip.header.SIPDate.setYear(int):void\");\n }", "public static void resetParams()\n {\n Debug = false;\n SpecOption = false;\n MyspecOption = false;\n Spec2Option = false;\n Myspec2Option = false;\n SpecFile = \"\";\n WriteASTFlag = false;\n LabelFlag = false;\n ReportLabelsFlag = false;\n LabelRoot = \"Lbl_\";\n FairnessOption = \"\";\n FairAlgorithm = false;\n CheckTermination = false;\n NoOld = false;\n Nocfg = false;\n NoDoneDisjunct = false;\n optionsInFile = false;\n versionOption = null;\n inputVersionNumber = PcalParams.versionWeight;\n PcalTLAGen.wrapColumn = 78;\n PcalTLAGen.ssWrapColumn = 45;\n tlaPcalMapping = null ;\n \n }", "public void setYear(int year) \n\t{\n\t\tthis.year = year;\n\t}", "@Override\n\tpublic void setYear(int year) {\n\t\t_esfShooterAffiliationChrono.setYear(year);\n\t}", "public void setOriginalReleaseYear(java.lang.Integer value) {\r\n\t\tBase.set(this.model, this.getResource(), ORIGINALRELEASEYEAR, value);\r\n\t}", "public void setYear(Integer year) {\r\n this.year = year;\r\n }", "public void setYear(Integer year) {\r\n this.year = year;\r\n }", "public void setYear(String year)\r\n {\r\n this.year = year; \r\n }", "public void setYear(Integer year) {\n this.year = year;\n }", "public void setYear(Integer year) {\n this.year = year;\n }", "public void setYear(Integer year) {\n this.year = year;\n }", "public void setYearmade(int yearmade)\n {\n if(checker.acceptYearmade(Integer.toString(yearmade)))\n this.yearmade = yearmade;\n else\n this.yearmade = 0;\n }", "public void reset(){\r\n maxDate = null;\r\n minDate = null;\r\n }", "@Test\r\n\tpublic void testSetYear() {\r\n\t\tmeetingu1.setYear(3);\r\n\t\tassertTrue(meetingu1.getYear() == 3);\r\n\t}", "public ConcreteYear(int year) {\r\n if (year > 0) {\r\n this.year = year;\r\n }\r\n }", "public void setYear(int Year) {\n\t this.year= Year;\n\t}", "public void setYear(int year) {\n\t\tthis.year = year;\n\t}", "public void setYear(int year) {\n\t\tthis.year = year;\n\t}", "public void setYear(final int year) {\n\t\tthis.year = year;\n\t}", "public void setYear(short value) {\n this.year = value;\n }", "public void setYear(int year) {\n\t\tthis.date.setYear(year);\n\t}", "public YearToCentury() // defining method YearToCentury\r\n\t{\r\n\t\tyear =0; // value of year =0\r\n\t}", "public static void resetValues() {\r\n\t\t// System.out.println(\"ExPar.resetValues()\");\r\n\t\tString cn = \"de.pxlab.pxl.ExPar\";\r\n\t\ttry {\r\n\t\t\tClass cls = Class.forName(cn);\r\n\t\t\tField[] fld = cls.getFields();\r\n\t\t\tint n2 = fld.length;\r\n\t\t\tfor (int j = 0; j < n2; j++) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tObject p = fld[j].get(null);\r\n\t\t\t\t\tif (p instanceof de.pxlab.pxl.ExPar) {\r\n\t\t\t\t\t\t// System.out.println(\"ExPar.resetValue(): \" +\r\n\t\t\t\t\t\t// fld[j].getName() + \" = \" +\r\n\t\t\t\t\t\t// ((ExPar)p).defaultValue.toString());\r\n\t\t\t\t\t\t((ExPar) p)\r\n\t\t\t\t\t\t\t\t.setValue((ExParValue) (((ExPar) p).defaultValue\r\n\t\t\t\t\t\t\t\t\t\t.clone()));\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (NullPointerException npx) {\r\n\t\t\t\t} catch (IllegalAccessException iax) {\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (ClassNotFoundException cnfe) {\r\n\t\t\tSystem.out.println(\"ExPar.resetValues(): Oh! Class \" + cn\r\n\t\t\t\t\t+ \" not found!\");\r\n\t\t}\r\n\t\tsetDate();\r\n\t\tif (Base.hasDisplayDeviceFrameDuration()) {\r\n\t\t\tVideoFrameDuration.set(Base.getDisplayDeviceFrameDuration());\r\n\t\t}\r\n\t}", "public void setYearLevel(int newYearLevel){\r\n yearLevel = newYearLevel;\r\n }", "public void setYear(short value) {\n this.year = value;\n }", "public static void setOriginalReleaseYear(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.lang.Integer value) {\r\n\t\tBase.set(model, instanceResource, ORIGINALRELEASEYEAR, value);\r\n\t}", "public void setYearParam(String yearParam) {\r\n this.yearParam = yearParam;\r\n }", "private void fillYearFields() {\n\n\t\tfor (int i = 1990; i <= 2100; i++) {\n\t\t\tyearFieldDf.addItem(i);\n\t\t\tyearFieldDt.addItem(i);\n\t\t}\n\t}", "public void initializeYears() {\n int j, k;\n WaterPurityReport earliest = _purityReportData.get(1);\n WaterPurityReport latest = _purityReportData.get(_purityReportData.getCount());\n if (earliest != null) {\n// j = earliest.getDate().toInstant().atZone(ZoneId.of(\"EST\")).toLocalDate().getYear();\n// k = latest.getDate().toInstant().atZone(ZoneId.of(\"EST\")).toLocalDate().getYear();\n\n Calendar cal = Calendar.getInstance();\n cal.setTime(earliest.getDate());\n j = cal.get(Calendar.YEAR);\n cal.setTime(latest.getDate());\n k = cal.get(Calendar.YEAR);\n dataGraphYear.setItems(FXCollections.observableArrayList(IntStream.range(j, k+1).boxed().collect(Collectors.toList())));\n }\n }", "void unsetAppliesPeriod();", "public boolean setYear(int newYear, boolean check) {\n\t\tthis.year = newYear;\n\t\tdeltatIsValid = false;\n\t\tthis.jd = swe_julday(this.year, this.month, this.day, this.hour, this.calType); // ->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// erzeugt\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// JD\n\t\tif (check) {\n\t\t\tdouble oldMonth = this.month;\n\t\t\tdouble oldDay = this.day;\n\t\t\tIDate dt = swe_revjul(this.jd, this.calType); // -> erzeugt neues\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Datum\n\t\t\tthis.year = dt.year;\n\t\t\tthis.month = dt.month;\n\t\t\tthis.day = dt.day;\n\t\t\tthis.hour = dt.hour;\n\t\t\treturn (this.year == newYear && this.month == oldMonth && this.day == oldDay);\n\t\t}\n\t\treturn true;\n\t}", "@Override\r\n\tpublic void reset() {\r\n\t\tsuper.reset();\r\n\t\tresetMomentObservation();\r\n\t\texpectations.reset();\r\n\t}", "public void setCurrentYear(BigDecimal currentYear) {\n this.currentYear = currentYear;\n }", "public void setPeriod(int periodInYears) {\nnumberOfPayments = periodInYears * MONTHS;\n}", "public void setYear(short value) {\n this.year = value;\n }", "public void setYear(short value) {\n this.year = value;\n }", "public void setYear(short value) {\n this.year = value;\n }", "public void removeAllRecordingYear() {\r\n\t\tBase.removeAll(this.model, this.getResource(), RECORDINGYEAR);\r\n\t}", "public RetirementYears(int year, double preTB, double postTB, double Total){\n \n this.year = year;\n this.preTB = preTB;\n this.postTB = postTB;\n this.Total = Total;\n }", "public Computus(int x){\n year = x;\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 final void set( int yyyy, int mm, int dd)\n {\n set (yyyy, mm, dd, CHECK);\n }", "public Calendar setReservationDate(){\n\t\t\n\t\t\n\t\tint currentMonth = Calendar.getInstance().get(Calendar.MONTH)+1; //Month starts from zero in Java\n\t\tint currentYear = Calendar.getInstance().get(Calendar.YEAR);\n\t\tint currentDate = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);\n\t\tint currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);\n\t\tint currentMinute = Calendar.getInstance().get(Calendar.MINUTE);\n\t\t\n\t\t\n\t\tSystem.out.println(\"Current Year \"+ currentYear );\n\t\tSystem.out.println(\"Current Month \"+ currentMonth );\n\t\tSystem.out.println(\"Today's date \"+ currentDate );\n\t\tSystem.out.println(\"Current Hour \"+ currentHour );\n\t\tSystem.out.println(\"Current Minute \"+ currentMinute );\n\t\tSystem.out.println(\"\\t---\\t---\\t---\\t---\\t---\");\n\t\tint inputMonth, inputYear, inputDate, inputHour, inputMinute;\n\t\t\n\t\tCalendar reserveDate = Calendar.getInstance();\n\t\t\n\t\tSystem.out.print(\"Enter the year: \");\n\t\tinputYear = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputYear < currentYear){\n\t\t\tSystem.out.println(\"Old year entry is not allowed !\\n\");\n\t\t\tSystem.out.print(\"Enter the year: \");\n\t\t\tinputYear = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\t\n\t\treserveDate.set(Calendar.YEAR,inputYear); \n\t\n\t\tSystem.out.print(\"Enter the month: \");\n\t\tinputMonth = scan.nextInt();\t\n\t\tscan.nextLine();\n\t\t\n\t\twhile (inputMonth < 1 || inputMonth > 12){\n\t\t\tSystem.out.println(\"Invalid Month entry!\");\n\t\t\tSystem.out.print(\"Enter the month again: \");\n\t\t\tinputMonth = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputMonth < currentMonth) && (inputYear == currentYear)){\n\t\t\t\t\t\n\t\t\tSystem.out.println(\"Old month entry is not allowed !\\n\");\n\t\t\tSystem.out.print(\"Enter the month: \");\n\t\t\tinputMonth = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t\t\n\t\t}\n\t\treserveDate.set(Calendar.MONTH,inputMonth-1);//MONTH is from 0 to 11.\n\t\t\n\t\tSystem.out.print(\"Enter the date for reservation: \");\n\t\tinputDate = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputDate < 1 || inputDate > 31){\n\t\t\tSystem.out.println(\"Invalid date entry!\");\n\t\t\tSystem.out.print(\"Enter the date again: \");\n\t\t\tinputDate = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputDate < currentDate) && (inputMonth == currentMonth)&&(inputYear==currentYear)){\n\t\t\tSystem.out.println(\"Past Day is not allowed!\\n\");\n\t\t\tSystem.out.print(\"Enter the date for reservation: \");\n\t\t\tinputDate = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\treserveDate.set(Calendar.DAY_OF_MONTH,inputDate);\n\t\t\n\t\tSystem.out.print(\"Enter hour (24-hr format): \");\n\t\tinputHour = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputHour < 0 || inputHour > 23){\n\t\t\tSystem.out.println(\"Invalid hour entry!\");\n\t\t\tSystem.out.print(\"Enter the hour again: \");\n\t\t\tinputHour = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile(inputHour < currentHour && inputDate == currentDate&&inputMonth == currentMonth&&inputYear==currentYear){\n\t\t\t\n\t\t\tif (inputHour < 0 && inputHour > 23){\n\t\t\t\tSystem.out.println(\"Invalid Hour entry\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Past hour is not allowed!\\n\");\n\t\t\t\tSystem.out.print(\"Enter hour (24-hr format): \");\n\t\t\t\tinputHour = scan.nextInt();\n\t\t\t\tscan.nextLine();\n\t\t\t}\n\t\t}\n\t\treserveDate.set(Calendar.HOUR_OF_DAY,inputHour); //This uses 24 hour clock\n\t\t\n\t\tSystem.out.print(\"Enter minute: \");\n\t\tinputMinute = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile(inputMinute < 0 || inputMinute > 59){\n\t\t\tSystem.out.println(\"Invalid Minute entry\");\n\t\t\tSystem.out.print(\"Enter minute again: \");\n\t\t\tinputMinute = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputMinute-currentMinute) <= 0 && inputHour == currentHour){\n\t\t\t\n\t\t\t//System.out.println(\"Reservation can only be made 30 minutes earlier or invalid input !\");\n\t\t\tSystem.out.print(\"Invalid minute\");\n\t\t\tSystem.out.print(\"Enter minute again: \");\n\t\t\tinputMinute = scan.nextInt();\t\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\treserveDate.set(Calendar.MINUTE,inputMinute);\n\t\tSystem.out.println(\"Date Reserved!\");\n\t\treturn reserveDate;\n\t}", "public void resetForm(){\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\tDate currentDate = new Date();\n\t\tsetNxSelect(\"r1\");\n\t\tresetFormB4135 = \"\";\n\t\tthoigian_thang=String.valueOf(currentDate.getMonth() +1); \n\t\tthoigian_nam=String.valueOf(currentDate.getYear()+1900);\n\t\ttungay = sdf.format(currentDate);\n\t\tdenngay = sdf.format(currentDate);\n\t\tmathang_maso=null;\n\t\thangSX_maso=null;\n\t\tnuocSX_maso=null;\n\t\tnct_maso=null;\n\t\tnkp_maso=null;\n\t\tmathang_ma=null;\n\t\tdmtTen = \"\";\n\t\thangSX_ma=\"\";\n\t\tnuocSX_ma=\"\";\n\t\tnct_ma=\"\";\n\t\tnkp_ma=\"\";\n\t\tlthuoc_ma=\"\";\n\t\tplthuoc_ma=\"\";\n\t\tdonvi_ma=\"\";\n\t\trefreshDmLoaiThuoc();\n\t\trefreshDmPhanLoaiThuoc();\n\t\trefreshDmThuoc();\n\t}", "public void removeOriginalReleaseYear(java.lang.Integer value) {\r\n\t\tBase.remove(this.model, this.getResource(), ORIGINALRELEASEYEAR, value);\r\n\t}", "private void correctParameter(){\n \tint ifObtuse;\r\n \tif(initialState.v0_direction>90)ifObtuse=1;\r\n \telse ifObtuse=0;\r\n \tdouble v0=initialState.v0_val;\r\n \tdouble r0=initialState.r0_val;\r\n \tdouble sintheta2=Math.sin(Math.toRadians(initialState.v0_direction))*Math.sin(Math.toRadians(initialState.v0_direction));\r\n \tdouble eccentricityMG=Math.sqrt(center.massG*center.massG-2*center.massG*v0*v0*r0*sintheta2+v0*v0*v0*v0*r0*r0*sintheta2);\r\n \tdouble cosmiu0=-(v0*v0*r0*sintheta2-center.massG)/eccentricityMG;\r\n \tpe=(v0*v0*r0*r0*sintheta2)/(center.massG+eccentricityMG);\r\n \tap=(v0*v0*r0*r0*sintheta2)/(center.massG-eccentricityMG);\r\n \tsemimajorAxis=(ap+pe)/2;\r\n \tsemiminorAxis=Math.sqrt(ap*pe);\r\n \tsemifocallength=(ap-pe)/2;\r\n \tSystem.out.println(semimajorAxis+\",\"+semiminorAxis+\",\"+semifocallength);\r\n \teccentricity=eccentricityMG/center.massG;\r\n \tperiod=2*Math.PI*Math.sqrt(semimajorAxis*semimajorAxis*semimajorAxis/(center.massG));\r\n \trotate=(360-Math.toDegrees(Math.acos(cosmiu0)));\r\n \torbitCalculator.angleDelta=(Math.toDegrees(Math.acos(cosmiu0))+360);\r\n \trotate=rotate+initialState.r0_direction;\r\n \t\r\n \tif(ifObtuse==1) {\r\n \t\tdouble rbuf=rotate;\r\n \t\trotate=initialState.r0_direction-rotate;\r\n \t\torbitCalculator.angleDelta+=(2*rbuf-initialState.r0_direction);\r\n \t}\r\n \tfor(;;) {\r\n \t\tif(rotate>360)rotate=rotate-360;\r\n \t\telse break;\r\n \t}\r\n \tfor(;;) {\r\n \t\tif(rotate<0)rotate=rotate+360;\r\n \t\telse break;\r\n \t}\r\n \t/*\r\n \tpe=initialState.r0_val;\r\n rotate=initialState.r0_direction;\r\n ap=(initialState.v0_val*initialState.v0_val*pe*pe)/(2*center.massG-initialState.v0_val*initialState.v0_val*pe);\r\n peSpeed=initialState.v0_val;\r\n apSpeed=(2*center.massG-initialState.v0_val*initialState.v0_val*pe)/(initialState.v0_val*pe);\r\n if(ap<pe){\r\n double lf=ap;ap=pe;pe=lf;\r\n lf=apSpeed;apSpeed=peSpeed;peSpeed=lf;\r\n }\r\n semimajorAxis=(ap+pe)/2;\r\n semifocallength=(ap-pe)/2;\r\n semiminorAxis=Math.sqrt(ap*pe);\r\n eccentricity=semifocallength/semimajorAxis;\r\n period=2*Math.PI*Math.sqrt(semimajorAxis*semimajorAxis*semimajorAxis/(center.massG));*/\r\n }", "public void setNextYear()\n\t{\n\t\tm_calendar.set(Calendar.YEAR,getYear()+1);\n\t\tsetDay(getYear(),getMonthInteger(),1);\n\n\t}", "public void setOriginalReleaseYear( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), ORIGINALRELEASEYEAR, value);\r\n\t}", "void unsetValuePeriod();", "public void setYears(int years) {\n this.years = years;\n }", "Year createYear();", "public static void setOriginalReleaseYear( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(model, instanceResource, ORIGINALRELEASEYEAR, value);\r\n\t}", "public void setIndicatorForYear(int requestedYear, Indicator data)\n {\n int incrementYear;\n if (indicators[0] == null)\n {\n indicators[0] = data;\n return;\n }\n incrementYear = indicators[0].getYear();\n for (int i = 0; i < indicators.length; i++)\n {\n if (incrementYear == requestedYear)\n {\n indicators[i] = data;\n return;\n }\n incrementYear++;\n }\n throw new IllegalArgumentException();\n }", "public void setYear(short value) {\r\n this.year = value;\r\n }", "private void resetValues() {\n teamAScoreInt = 0;\n teamBScoreInt = 0;\n teamAFoulScoreInt = 0;\n teamBFoulScoreInt = 0;\n }", "@FXML\n private void changeYear()\n {\n year = cmbYear.getValue();\n fillCalendar();\n setYear();\n parentContr.updatePieChart();\n\n }", "public final void set( int yyyy, int mm, int dd, int how)\n {\n if ( this.yyyy == yyyy && this.mm == mm && this.dd == dd ) return;\n this.yyyy = yyyy;\n this.mm = mm;\n this.dd = dd;\n switch ( how )\n {\n case CHECK:\n if ( !isValid(yyyy,mm,dd) )\n throw new IllegalArgumentException(\"invalid date: \"\n + yyyy + \"/\" + mm + \"/\" + dd);\n break;\n\n case NORMALISE:\n normalise();\n break;\n\n case BYPASSCHECK:\n break;\n } // end switch\n\n toOrdinal();\n }", "public void reset() {\r\n reset(params);\r\n }", "public Builder clearAcademicYear() {\n if (academicYearBuilder_ == null) {\n academicYear_ = null;\n onChanged();\n } else {\n academicYear_ = null;\n academicYearBuilder_ = null;\n }\n\n return this;\n }", "public void reset() {\n delta = 0.0;\n solucionActual = null;\n mejorSolucion = null;\n solucionVecina = null;\n iteracionesDiferenteTemperatura = 0;\n iteracionesMismaTemperatura = 0;\n esquemaReduccion = 0;\n vecindad = null;\n temperatura = 0.0;\n temperaturaInicial = 0.0;\n tipoProblema = 0;\n alfa = 0;\n beta = 0;\n }", "public void setYear(String year) {\n this.year = year;\n }", "public void setYear(String year) {\n this.year = year;\n }", "public void setYear(short value) {\n this.year = value;\n }", "public void setSelectedYear(int selectedYear) {\n this.selectedYear = selectedYear;\n }", "public void resetValor();", "public boolean setYear(int newYear) {\n\t\tthis.year = newYear;\n\t\tdeltatIsValid = false;\n\t\tthis.jd = swe_julday(this.year, this.month, this.day, this.hour, this.calType); // ->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// erzeugt\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// JD\n\t\treturn true;\n\t}", "@Override\n\tpublic void oneYearAgo(int year) {\n\n\t}", "protected final void normalise()\n {\n // yyyy, mm, dd must be set at this point\n if ( isValid(yyyy,mm,dd) ) return;\n else if ( mm > 12 )\n {\n yyyy += (mm-1) / 12;\n mm = ((mm-1) % 12) + 1;\n if ( isValid(yyyy,mm,dd) ) return;\n }\n else if ( mm <= 0 )\n {\n // Java's definition of modulus means we need to handle negatives as a special case.\n yyyy -= -mm / 12 + 1;\n mm = 12 - (-mm % 12);\n if ( isValid(yyyy,mm,dd) ) return;\n }\n if ( isValid(yyyy,mm,01) )\n {\n int olddd = dd;\n dd = 1;\n toOrdinal();\n ordinal += olddd - 1;\n toGregorian();\n if ( isValid(yyyy,mm,dd) ) return;\n }\n\n throw new IllegalArgumentException(\"date cannot be normalised: \"\n + yyyy + \"/\" + mm + \"/\" + dd);\n\n }", "void resetMyTeam(Team team);", "public void makeValidDate() {\n\t\tdouble jd = swe_julday(this.year, this.month, this.day, this.hour, SE_GREG_CAL);\n\t\tIDate dt = swe_revjul(jd, SE_GREG_CAL);\n\t\tthis.year = dt.year;\n\t\tthis.month = dt.month;\n\t\tthis.day = dt.day;\n\t\tthis.hour = dt.hour;\n\t}", "public void increaseYearsWorked() {\n ++yearsWorked;\n }", "public void setMinYearAmount(int minYearAmount) {\r\n this.minYearAmount = minYearAmount;\r\n updateYearMenu();\r\n }", "public void setStartYear(java.math.BigInteger startYear) {\r\n this.startYear = startYear;\r\n }", "@Override\r\n\tpublic boolean updateReviewOfPastYearDetails(ExemptTeamMember exemptTeamMember, int year) {\n\t\treturn exemptTeamMemberDAO.updateReviewOfPastYearDetails(exemptTeamMember,year);\r\n\t}", "public void setExpirationYear(java.math.BigInteger expirationYear) {\r\n this.expirationYear = expirationYear;\r\n }", "public static void reset() {\r\n\t\t// System.out.println(\"ExPar.reset()\");\r\n\t\t// new RuntimeException().printStackTrace();\r\n\t\truntimePars.clear();\r\n\t\tresetValues();\r\n\t\tGlobalAssignments.exec();\r\n\t}", "public DueDateBuilder setYear(int year) {\n this.year = year;\n return this;\n }", "public void resetChangeableArrays(int[] reg)\n {\n valList = new LinkedList<Integer>();\n possibilityList = new LinkedList<Point>();\n for(int j = 0; j<accumulator.length; j ++)Arrays.fill(accumulator[j],0);\n //accumulator = zeroAccumulator;\n region = reg;\n \n }", "public YearProfit(){}", "@Override\n public void resetAllValues() {\n }", "public void setGregorianChange(int year, int month, int day) {\n\t\tthis.year = year;\n\t\tthis.month = month;\n\t\tthis.day = day;\n\t\tdeltatIsValid = false;\n\t\tthis.calType = SE_GREG_CAL;\n\t\tif (this.year < year || (this.year == year && this.month < month)\n\t\t\t\t|| (this.year == year && this.month == month && this.day < day)) {\n\t\t\tthis.calType = SE_JUL_CAL;\n\t\t}\n\t\tthis.jdCO = swe_julday(year, month, day, 0., SE_GREG_CAL);\n\t\tthis.jd = swe_julday(this.year, this.month, this.day, this.hour, this.calType);\n\t}", "public void setIndepYear(int indepYear) {\n\n this.indepYear = indepYear;\n }" ]
[ "0.65275615", "0.6162822", "0.6144697", "0.61259294", "0.6055855", "0.6013104", "0.6007035", "0.59928924", "0.59585834", "0.59047645", "0.58721936", "0.58694136", "0.5855274", "0.5848585", "0.58383906", "0.58254445", "0.57638866", "0.5758579", "0.5756033", "0.57522064", "0.5737425", "0.57225186", "0.57135963", "0.5702576", "0.5702576", "0.56985426", "0.56374276", "0.56374276", "0.56374276", "0.56238866", "0.5614776", "0.5594252", "0.5592034", "0.55852383", "0.5584151", "0.5584151", "0.55366534", "0.55140847", "0.5489996", "0.54827917", "0.5478466", "0.54678977", "0.54358923", "0.54348856", "0.5428331", "0.54232484", "0.5414053", "0.5406864", "0.5386504", "0.53737813", "0.53683186", "0.5366622", "0.5364319", "0.5364319", "0.5364319", "0.53584105", "0.534061", "0.5332701", "0.5308953", "0.53046316", "0.5300791", "0.52995974", "0.5293443", "0.5280226", "0.52770925", "0.52630395", "0.5257518", "0.52575064", "0.52568203", "0.5245808", "0.5228845", "0.522057", "0.5216014", "0.5207858", "0.5200381", "0.519731", "0.5189655", "0.5188866", "0.5188631", "0.5188631", "0.51765907", "0.51756126", "0.5171318", "0.5169472", "0.5162221", "0.5158926", "0.5146128", "0.51387095", "0.5132482", "0.5131159", "0.5127563", "0.51137", "0.51015264", "0.50953543", "0.5091958", "0.5087097", "0.5087025", "0.5085179", "0.50750685", "0.50739664" ]
0.82811934
0
A method to restrict the year range problems are queried from
private int restrictYear(Message msg, String parameter, int section) { int[] years = setYearRestriction(msg, parameter, section); if (years[0] == ERROR_CODE[0]) { return -1; } yearRestriction = true; lowerYear = years[0]; upperYear = years[1]; return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String dateRangeRestriction(String startDate, String endDate){\r\n String restriction = \"\";\r\n String[] startDateParts = startDate.split(\"/\");\r\n String[] endDateParts = endDate.split(\"/\");\r\n int prevYear = Integer.parseInt(endDateParts[0]) - 1; //year previus to End year\r\n int nextYear = Integer.parseInt(startDateParts[0]) + 1; //year next to End year\r\n if(prevYear-nextYear > 1){ // For intermediate years we may not care about days and months\r\n restriction += \" PubDate-Year:[\" + nextYear + \" TO \" + prevYear + \"] OR \";\r\n }\r\n if(endDateParts[0].equals(startDateParts[0])){ // Year of start and end is the same\r\n restriction += \"( +PubDate-Year:\" + endDateParts[0] \r\n + \" +PubDate-Month:[\" + startDateParts[1] + \" TO \" + endDateParts[1] \r\n + \"] +PubDate-Day:[\" + startDateParts[2] + \" TO \" + endDateParts[2] + \"])\";\r\n } else {\r\n restriction += \"( +PubDate-Year:\" + endDateParts[0] \r\n + \" +PubDate-Month:[ 01 TO \" + endDateParts[1] \r\n + \"] +PubDate-Day:[ 01 TO \" + endDateParts[2] + \"]) OR \"\r\n + \"( +PubDate-Year:\" + startDateParts[0] \r\n + \" +PubDate-Month:[ \" + startDateParts[1] + \" TO 12\" \r\n + \"] +PubDate-Day:[ \" + startDateParts[2] + \" TO 31 ])\";\r\n }\r\n restriction = \"(\" + restriction + \")\";\r\n return restriction;\r\n }", "private boolean exceedRange(int year) {\n\t\tboolean exceeds = false;\n\t\tint currentYear = Calendar.getInstance().get(Calendar.YEAR);\n\t\tint upperRange = currentYear + RANGE_LIMIT;\n\t\tint lowerRange = currentYear - RANGE_LIMIT;\n\t\t\n\t\tif(year < lowerRange || year > upperRange){\n\t\t\texceeds = true;\n\t\t}\n\t\treturn exceeds;\n\t}", "public DatePickerYearRange(short yearFrom, short yearTo)\n\t{\n\t\tsuper();\n\t\tthis.yearFrom = yearFrom;\n\t\tthis.yearTo = yearTo;\n\t\tthis.controlTo = DatePickerYearRangeControl.ABSOLUTE;\n\t\tthis.controlFrom = DatePickerYearRangeControl.ABSOLUTE;\n\t}", "public void setYear(int year) throws InvalidDateException {\r\n\t\tif (year <= 2100 & year >= 2000) {\r\n\t\t\tthis.year = year;\r\n\t\t} else {\r\n\t\t\tthrow new InvalidDateException(\"Please enter a realistic year for the date (between 2000 and 2100) !\");\r\n\t\t}\r\n\t}", "private static Boolean checkYear(){\r\n try{\r\n int year = Integer.parseInt(yearField.getText().trim());\r\n int now = LocalDate.now().getYear();\r\n \r\n if(LocalDate.now().getMonth().compareTo(Month.SEPTEMBER) < 0){\r\n now--;\r\n }\r\n //SIS stores the schedule for last 3 years only \r\n if(year <= now && year >= now - 3 ){\r\n return true;\r\n }\r\n }\r\n catch(Exception e){\r\n Logger.getLogger(\"Year checker\").log(Level.WARNING, \"Exception while resolving the year \", e);\r\n }\r\n return false;\r\n }", "@Test\n public void test_MinguoDate_range_yeaOfEra() {\n assertEquals(ValueRange.of(1, ChronoField.YEAR.range().getMaximum() - YEARS_BEHIND),\n MinguoDate.of(1, 1, 1).range(ChronoField.YEAR_OF_ERA));\n assertEquals(ValueRange.of(1, -ChronoField.YEAR.range().getMinimum() + 1 + YEARS_BEHIND),\n MinguoDate.of(-1, 1, 1).range(ChronoField.YEAR_OF_ERA));\n }", "private void checkYearDeviation() {\n val yearDeviation = config.getInt(\"year_deviation\");\n\n checkArgument(yearDeviation > 0, \"year_deviation is less than or equal to 0!\");\n }", "public int getEndingYear()\n {\n return -1;\n }", "public void setYear(int _year) { year = _year; }", "public void setYear(int value) {\r\n this.year = value;\r\n }", "public void setYear(Integer year) {\r\n this.year = year;\r\n }", "public void setYear(Integer year) {\r\n this.year = year;\r\n }", "public void setYear(Integer year) {\n this.year = year;\n }", "public void setYear(Integer year) {\n this.year = year;\n }", "public void setYear(Integer year) {\n this.year = year;\n }", "public DatePickerYearRange(short yearFrom, short yearTo,\n\t\t\tDatePickerYearRangeControl controlFrom, DatePickerYearRangeControl controlTo)\n\t{\n\t\tsuper();\n\t\tthis.yearFrom = yearFrom;\n\t\tthis.yearTo = yearTo;\n\t\tthis.controlTo = controlTo == null ? DatePickerYearRangeControl.ABSOLUTE : controlTo;\n\t\tthis.controlFrom = controlFrom == null ? DatePickerYearRangeControl.ABSOLUTE : controlFrom;\n\t}", "public void setStartYear(int startYear) {\n\t\tthis.startYear = startYear;\n\t}", "public void setYear(int year)\n {\n this.year = year;\n }", "public void setYear(int value) {\n\tthis.year = value;\n }", "public void setYear(int year) {\r\n this.year = year;\r\n }", "public void setYear(int year) {\n this.year = year;\n }", "public void setYear(int year) {\n\tthis.year = year;\n}", "public void setYear(String year)\r\n {\r\n this.year = year; \r\n }", "@Property\n void nonCenturialLeapYearTest(@ForAll(\"nonCenturialLeapYears\") int year){\n assertThat(ly.isLeapYear(year));\n }", "@Property\n void centurialNonLeapYearTest(@ForAll(\"centurialNonLeapYears\") int year){\n assertThat(!ly.isLeapYear(year));\n }", "public void checkYear()\n {\n //Rat\n if (year == 1900 || year == 1912 || year == 1924 || year == 1936 || year == 1948 || year == 1960 || year == 1972 || year == 1984 || year == 1996 || year == 2008 || year == 2020)\n {System.out.println(\"Born in the year of the Rat\");}\n //Ox\n else if (year == 1901 || year == 1913 || year == 1925 || year == 1937 || year == 1949 || year == 1961 || year == 1973 || year == 1985 || year == 1997 || year == 2009 || year == 2021)\n {System.out.println(\"Born in the year of the Ox\");}\n //tiger\n else if (year == 1902 || year == 1914 || year == 1926 || year == 1938 || year == 1950 || year == 1962 || year == 1974 || year == 1986 || year == 1998 || year == 2010 || year == 2022)\n {System.out.println(\"Born in the year of the Tiger\");}\n //Hare\n else if (year == 1903 || year == 1915 || year == 1927 || year == 1939 || year == 1951 || year == 1963 || year == 1975 || year == 1987 || year == 1999 || year == 2011 || year == 2023)\n {System.out.println(\"Born in the year of the Hare/Rabbit\");}\n //Dragon\n else if (year == 1904 || year == 1916 || year == 1928 || year == 1940 || year == 1952 || year == 1964 || year == 1976 || year == 1988 || year == 2000 || year == 2012 || year == 2024)\n {System.out.println(\"Born in the year of the Dragon\");}\n //Snake\n else if (year == 1905 || year == 1917 || year == 1929 || year == 1941 || year == 1953 || year == 1965 || year == 1977 || year == 1989 || year == 2001 || year == 2012 || year == 2025)\n {System.out.println(\"Born in the year of the Snake\");}\n //Horse\n else if (year == 1906 || year == 1918 || year == 1930 || year == 1942 || year == 1954 || year == 1966 || year == 1978 || year == 1990 || year == 2002 || year == 2013 || year == 2026)\n {System.out.println(\"Born in the year of the Horse\");}\n //Ram\n else if (year == 1907 || year == 1919 || year == 1931 || year == 1943 || year == 1955 || year == 1967 || year == 1979 || year == 1991 || year == 2003 || year == 2014 || year == 2027)\n {System.out.println(\"Born in the year of the Ram\");}\n //Monkey\n else if (year == 1908 || year == 1920 || year == 1932 || year == 1944 || year == 1956 || year == 1968 || year == 1980 || year == 1992 || year == 2004 || year == 2015 || year == 2028)\n {System.out.println(\"Born in the year of the Monkey\");}\n //Rooster\n else if (year == 1909 || year == 1921 || year == 1933 || year == 1945 || year == 1957 || year == 1969 || year == 1981 || year == 1993 || year == 2005 || year == 2016 || year == 2029)\n {System.out.println(\"Born in the year of the Rooster\");}\n //Dog\n else if (year == 1910 || year == 1922 || year == 1934 || year == 1946 || year == 1958 || year == 1970 || year == 1982 || year == 1994 || year == 2006 || year == 2017 || year == 2030)\n {System.out.println(\"Born in the year of the Dog\");}\n //Pig\n else if (year == 1911 || year == 1923 || year == 1935 || year == 1947 || year == 1959 || year == 1971 || year == 1983 || year == 1995 || year == 2007 || year == 2018 || year == 2031)\n {System.out.println(\"Born in the year of the Pig\");}\n }", "@Property\n void nonCenturialNonLeapyearTest(@ForAll(\"nonCenturialNonLeapyears\") int year){\n assertThat(!ly.isLeapYear(year));\n }", "@Test\n public void testSpecificYear() {\n context = new MockServletContext();\n context.setInitParameter(ConfigService.MESHRDF_YEAR, \"2018\");\n context.setInitParameter(ConfigService.MESHRDF_INTERIM, \"true\");\n configService = new ConfigServiceImpl(context);\n\n ValidYears years = configService.getValidYears();\n\n assertThat(years.getCurrent(), equalTo(2018));\n assertThat(years.getInterim(), equalTo(2019));\n }", "public void test_compareAsYear_basic() {\n // ## Arrange ##\n String fromRes = \"2008-09-14 12:34:56\";\n String toRes = \"2008-11-18 18:34:56\";\n FromToOption option = createOption();\n\n // ## Act ##\n option.compareAsYear();\n Date fromDate = option.filterFromDate(DfTypeUtil.toDate(fromRes));\n Date toDate = option.filterToDate(DfTypeUtil.toDate(toRes));\n\n // ## Assert ##\n assertEquals(ConditionKey.CK_GREATER_EQUAL, option.getFromDateConditionKey());\n assertEquals(ConditionKey.CK_LESS_THAN, option.getToDateConditionKey());\n assertEquals(\"2008-01-01 00:00:00\", DfTypeUtil.toString(fromDate, \"yyyy-MM-dd HH:mm:ss\"));\n assertEquals(\"2009-01-01 00:00:00\", DfTypeUtil.toString(toDate, \"yyyy-MM-dd HH:mm:ss\"));\n }", "public ArrayList<Book> listYear99() {\n ArrayList<Book> booksBefore1999 = new ArrayList<>();\n for (Book book : bookList) {\n if (book.getYear() < 1999) {\n booksBefore1999.add(book);\n\n }\n }\n return booksBefore1999;\n }", "public DatePickerYearRange(short yearFrom, short yearTo, boolean yearRelativeToToday)\n\t{\n\t\tsuper();\n\t\tthis.yearFrom = yearFrom;\n\t\tthis.yearTo = yearTo;\n\t\tthis.controlTo =\n\t\t\tyearRelativeToToday ? DatePickerYearRangeControl.RELATIVE_TODAY\n\t\t\t\t: DatePickerYearRangeControl.RELATIVE_SELECTED_YEAR;\n\t\tthis.controlFrom =\n\t\t\tyearRelativeToToday ? DatePickerYearRangeControl.RELATIVE_TODAY\n\t\t\t\t: DatePickerYearRangeControl.RELATIVE_SELECTED_YEAR;\n\t}", "public void initializeYears() {\n int j, k;\n WaterPurityReport earliest = _purityReportData.get(1);\n WaterPurityReport latest = _purityReportData.get(_purityReportData.getCount());\n if (earliest != null) {\n// j = earliest.getDate().toInstant().atZone(ZoneId.of(\"EST\")).toLocalDate().getYear();\n// k = latest.getDate().toInstant().atZone(ZoneId.of(\"EST\")).toLocalDate().getYear();\n\n Calendar cal = Calendar.getInstance();\n cal.setTime(earliest.getDate());\n j = cal.get(Calendar.YEAR);\n cal.setTime(latest.getDate());\n k = cal.get(Calendar.YEAR);\n dataGraphYear.setItems(FXCollections.observableArrayList(IntStream.range(j, k+1).boxed().collect(Collectors.toList())));\n }\n }", "private boolean acceptDayG(DayG day) {\r\n if(day.getYear() != endDate.get(Calendar.YEAR))\r\n return false;\r\n \r\n int dayOfYear = day.getCalendar().get(Calendar.DAY_OF_YEAR);\r\n if(dayOfYear == acceptedDatesRange[0] || dayOfYear == \r\n acceptedDatesRange[1] || (dayOfYear < acceptedDatesRange[1] &&\r\n dayOfYear > acceptedDatesRange[0])) {\r\n \r\n //MiscStuff.writeToLog(\"\" + dayOfYear + \" \" + acceptedDatesRange[0] +\r\n // \" \" + acceptedDatesRange[1]); //print year.....................................................................................\r\n return true;\r\n }\r\n return false;\r\n }", "@Test\n void calculatePeriodRangeOver2Years() throws ParseException {\n LocalDate testDateStart = LocalDate.parse(\"2013-03-07\");\n LocalDate testDateEnd = LocalDate.parse(\"2017-12-17\");\n Map<String, String> periodMap = datesHelper.calculatePeriodRange(testDateStart, testDateEnd, false);\n assertEquals(\"57 months\", periodMap.get(PERIOD_START));\n assertEquals(\"17 December 2017\", periodMap.get(PERIOD_END));\n }", "public void setYear(String year) {\n this.year = year;\n }", "public void setYear(String year) {\n this.year = year;\n }", "public void setYear(int year)\r\n\t{\r\n\t\tthis.year = year;\r\n\t}", "public int getStartingYear()\n {\n return 2013;\n }", "public void setYear(short value) {\n this.year = value;\n }", "public void setDocumentYear(int documentYear);", "public void setYear (int yr) {\n year = yr;\n }", "private void setUp() {\r\n Calendar calendar1 = Calendar.getInstance();\r\n calendar1.set((endDate.get(Calendar.YEAR)), \r\n (endDate.get(Calendar.MONTH)), (endDate.get(Calendar.DAY_OF_MONTH)));\r\n calendar1.roll(Calendar.DAY_OF_YEAR, -6);\r\n \r\n Calendar calendar2 = Calendar.getInstance();\r\n calendar2.set((endDate.get(Calendar.YEAR)), \r\n (endDate.get(Calendar.MONTH)), (endDate.get(Calendar.DAY_OF_MONTH)));\r\n \r\n acceptedDatesRange[0] = calendar1.get(Calendar.DAY_OF_YEAR);\r\n acceptedDatesRange[1] = calendar2.get(Calendar.DAY_OF_YEAR); \r\n \r\n if(acceptedDatesRange[1] < 7) {\r\n acceptedDatesRange[0] = 1; \r\n }\r\n \r\n //MiscStuff.writeToLog(\"Ranges set \" + calendar1.get\r\n // (Calendar.DAY_OF_YEAR) + \" \" + calendar2.get(Calendar.DAY_OF_YEAR));\r\n }", "public ConcreteYear(int year) {\r\n if (year > 0) {\r\n this.year = year;\r\n }\r\n }", "public String getResponseYearsRange() throws Exception {\n\t\treturn this.xqueryUtil.getResponseYearsRange();\n\t}", "public void setYearsUntilTenure(int yearsUntilTenure){\n m_yearsUntilTenure = yearsUntilTenure;\n }", "@Override\n\tpublic void setYear(int year) throws RARException {\n\t\tthis.year = year;\n\t}", "public void setQualificationYear(Integer qualificationYear) {\n this.qualificationYear = qualificationYear;\n }", "int getYear();", "protected static String goodSearchYear(String YearCheck) throws Exception\n {\n String[] Year;\n try{\n Year = YearCheck.split(\"\\\\s+\");\n if (Year.length > 1 /*|| ID[0].equals(\"\")*/) {\n throw new Exception(\"ERROR: The Year must be 1 word only\\n\");\n }\n if (!(Year[0].equals(\"\")) && Year[0].length() !=4){\n throw new Exception(\"ERROR: Year entered but it is not 4 digits\");\n }\n if (!(Year[0].matches(\"[0-9]+\"))) {\n throw new Exception(\"ERROR: Year must only contain numbers\");\n }\n return Year[0];\n } catch (Exception e){\n throw new Exception(e.getMessage());\n }\n }", "public void setYear(int year) \n\t{\n\t\tthis.year = year;\n\t}", "protected boolean isInYearEndLowerBound(Date runDate, String yearEndPeriodLowerBound, String lastDayOfFiscalYear) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"MMdd\");\n String today = sdf.format(runDate);\n return today.compareTo(yearEndPeriodLowerBound) >= 0 && today.compareTo(lastDayOfFiscalYear) <= 0;\n }", "@Override\n\tpublic void oneYearAgo(int year) {\n\n\t}", "public static void main(String[] args) {\n\n\t\tLocalDate current =LocalDate.now();\n\tLocalDate ld =\tLocalDate.of(1989, 11, 30);\n\t\t\n\tPeriod pd =\tPeriod.between(current, ld);\n\tSystem.out.println(pd.getYears());\n\t}", "public void setYear(short value) {\n this.year = value;\n }", "public void setStartYear(java.math.BigInteger startYear) {\r\n this.startYear = startYear;\r\n }", "public boolean isALeapYear(int year){\n\n if (((year%4 == 0) && (year%100!=0)) || (year%400==0)){\n return true;\n }\n return false;\n }", "public void setYear(int year){\r\n\t\ttry{\r\n\t\t\tif(year>=1900)\r\n\t\t\tthis.year = year;\r\n\t\t\telse\r\n\t\t\t\tthrow new cardYearException();\r\n\t\t}catch(cardYearException ex){\r\n\t\t\tSystem.out.println(\"Baseball Cards weren't invented \"\r\n\t\t\t\t\t+ \"before 1900!\");\r\n\t\t\tSystem.out.print(\"Please enter a valid year: \");\r\n\t\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\tint retry = input.nextInt();\r\n\t\t\t\tsetYear(retry);\r\n\t\t}\r\n\t}", "public void setEndYear(int endYear) {\n\t\tthis.endYear = endYear;\n\t}", "public void setYears(int years) {\n this.years = years;\n }", "public void setYear(short value) {\n this.year = value;\n }", "public void setYear(short value) {\n this.year = value;\n }", "public void setYear(short value) {\n this.year = value;\n }", "protected void checkMappingReleaseYear(RecordUrlData record) {\n checkMainMapping(record, RECORD_FACTORY.getMappingReleaseYear(record));\n }", "private boolean validateInputs(String iStart, String iEnd, String country, String type) {\n \thideErrors();\n \tint validStart;\n \tint validEnd;\n boolean valid = true;\n// \t//will not occur due to UI interface\n// if (isComboBoxEmpty(type)) {\n// \tvalid = false;\n// \tT3_type_error_Text.setVisible(true);\n// }\n if (isComboBoxEmpty(country)) {\n \tvalid = false;\n \tT3_country_error_Text.setVisible(true);\n }\n \t//checking if start year and end year are set\n if (isComboBoxEmpty(iStart)){\n //start is empty\n T3_start_year_error_Text.setVisible(true);\n valid = false;\n }\n if (isComboBoxEmpty(iEnd)){\n //end is empty\n T3_end_year_error_Text.setVisible(true);\n valid = false;\n }\n \tif (valid){\n //if years are not empty and valid perform further testing\n \t\t//fetch valid data range\n \tPair<String,String> validRange = DatasetHandler.getValidRange(type, country);\n \tvalidStart = Integer.parseInt(validRange.getKey());\n \tvalidEnd = Integer.parseInt(validRange.getValue());\n //check year range validity\n \t\tint start = Integer.parseInt(iStart);\n \t\tint end = Integer.parseInt(iEnd);\n \tif (start>=end) {\n \t\tT3_range_error_Text.setText(\"Start year should be < end year\");\n \t\tT3_range_error_Text.setVisible(true);\n \t\tvalid=false;\n \t}\n// \t//will not occur due to UI interface\n// \telse if (start<validStart) {\n// \t\tT3_range_error_Text.setText(\"Start year should be >= \" + Integer.toString(validStart));\n// \t\tT3_range_error_Text.setVisible(true);\n// \t\tvalid=false;\n// \t}else if (end>validEnd) {\n// \t\tT3_range_error_Text.setText(\"End year should be <= \" + Integer.toString(validEnd));\n// \t\tT3_range_error_Text.setVisible(true);\n// \t\tvalid=false;\n// \t}\n \t}\n// \t//will not occur due to UI interface\n// \tif(isComboBoxEmpty(type)) {\n// \t\t//if type is not set\n// T3_type_error_Text.setVisible(true);\n// \t}\n \t\n if(isComboBoxEmpty(country)) {\n //if country is not set\n T3_country_error_Text.setVisible(true);\n }\n \treturn valid;\n }", "public boolean isSupportYear() {\r\n return true;\r\n }", "public void setIndepYear(int indepYear) {\n\n this.indepYear = indepYear;\n }", "private void fillYearFields() {\n\n\t\tfor (int i = 1990; i <= 2100; i++) {\n\t\t\tyearFieldDf.addItem(i);\n\t\t\tyearFieldDt.addItem(i);\n\t\t}\n\t}", "@Override\n\tpublic void setYear(int year) {\n\t\t_esfShooterAffiliationChrono.setYear(year);\n\t}", "public void setMinYearAmount(int minYearAmount) {\r\n this.minYearAmount = minYearAmount;\r\n updateYearMenu();\r\n }", "public void setNumberOfYears(int numberOfYears) {\n this.numberOfYears = numberOfYears;\n }", "public void setYear(int year) {\n\t\tthis.year = year;\n\t}", "public void setYear(int year) {\n\t\tthis.year = year;\n\t}", "java.lang.String getEndDateYYYY();", "public boolean LeapYearValidation(int year) {\r\n\t\tif (year >= 1582 && year <= 9999)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\r\n\t}", "TCpyYearCheck selectOneByExample(TCpyYearCheckExample example);", "public int getYear() { return year; }", "public int getYear() { return year; }", "public void setYear(int Year) {\n\t this.year= Year;\n\t}", "int getYears();", "Year createYear();", "public void testNumericDateFilter() throws Exception {\n // pub date of Lucene in Action, Second Edition and\n // JUnit in ACtion, Second Edition is May 2010\n Filter filter = NumericRangeFilter.newIntRange(\"pubmonth\",\n 201001,\n 201006,\n true,\n true);\n assertEquals(2, TestUtil.hitCount(searcher, allBooks, filter));\n }", "public void set2DigitYearStart(final Date startDate) {\n\t\tparseAmbiguousDatesAsAfter(startDate);\n\t}", "@Override\n public int getYear() {\n return this.deadline.getYear();\n }", "public void loadYear()\r\n\t{\r\n \t try{\r\n\r\n\t\t \t\tcboYear.removeAllItems();\r\n\t\t \t }catch(Exception ce){System.out.println(ce);}\r\n\r\n\r\n \t cboYear.addItem(\"Select a Year\");\r\n\r\n\t\t for(int i=2000;i<=2099;i++)\r\n\t\t {\r\n\t\t\tcboYear.addItem(String.valueOf(i));\r\n\t\t }\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tMonthDay month=MonthDay.now();\n\t\tLocalDate d=month.atYear(2015);\n\t\tSystem.out.println(d);\n\t\tMonthDay m=MonthDay.parse(\"--02-29\");\n\t\tboolean b=m.isValidYear(2019);\n\t\tSystem.out.println(b);\n\t\tlong n= month.get(ChronoField.MONTH_OF_YEAR);\n\t\tSystem.out.println(\"month of the year is:\"+n);\n\t\tValueRange r1=month.range(ChronoField.MONTH_OF_YEAR);\n\t\tSystem.out.println(r1);\n\t\tValueRange r2=month.range(ChronoField.DAY_OF_MONTH);\n\t\tSystem.out.println(r2);\n\n\t}", "Integer getTenYear();", "private static boolean checkIfYearContinue(Sheet sheet) {\r\n String last = sheet.getCellAt(\"A\" + sheet.getRowCount()).getTextValue(); \r\n return !last.equals(\"end\");\r\n }", "public abstract String reportLeapYear(int year);", "TCpyYearCheck selectByPrimaryKey(Integer id);", "public Integer getQualificationYear() {\n return qualificationYear;\n }", "public void setYearParam(String yearParam) {\r\n this.yearParam = yearParam;\r\n }", "public int getDocumentYear();", "public boolean setYear(int newYear) {\n\t\tthis.year = newYear;\n\t\tdeltatIsValid = false;\n\t\tthis.jd = swe_julday(this.year, this.month, this.day, this.hour, this.calType); // ->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// erzeugt\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// JD\n\t\treturn true;\n\t}", "public void setYear(String year) {\n\t\tthis.year = year;\n\t}", "public void sortBasedYearService();", "public int getMinYearAmount() {\r\n return minYearAmount;\r\n }", "@Test\n public void isLeapYear() {\n assertFalse(Deadline.isLeapYear(Integer.parseInt(VALID_YEAR_2018)));\n\n // Valid leap year -> returns true\n assertTrue(Deadline.isLeapYear(Integer.parseInt(LEAP_YEAR_2020)));\n\n // Valid year divisible by 4 but is common year -> returns false\n assertFalse(Deadline.isLeapYear(Integer.parseInt(NON_LEAP_YEAR_2100)));\n\n // Valid year divisible by 100 but is leap year -> returns true\n assertTrue(Deadline.isLeapYear(Integer.parseInt(LEAP_YEAR_2400)));\n }", "public YearProfit(){}", "public void setYearFounded(int yearFounded) {\n\t\tthis.yearFounded = yearFounded;\n\t}", "@Test(expected = IllegalArgumentException.class)\n public void testGetExpensesByTypeAndYearInFuture() {\n\tString type = \"WEEKLY\";\n\tYear year = Year.of(2020);\n\texpenseManager.getExpensesByTypeAndYear(type, year);\n }" ]
[ "0.6461501", "0.64567184", "0.6359415", "0.6349753", "0.63127935", "0.61866397", "0.6178176", "0.60279995", "0.6016391", "0.5997309", "0.5984758", "0.5984758", "0.5975242", "0.5975242", "0.5975242", "0.5932926", "0.58727413", "0.5850893", "0.5844806", "0.5839853", "0.5825709", "0.5810766", "0.5809467", "0.5809313", "0.58079535", "0.57948613", "0.5793665", "0.57698417", "0.57569706", "0.5751513", "0.5745556", "0.5741623", "0.5729538", "0.5715775", "0.57062864", "0.57062864", "0.57044965", "0.5704157", "0.56922275", "0.5689365", "0.5687808", "0.56843996", "0.5674516", "0.5670141", "0.565815", "0.5642096", "0.56360483", "0.5626065", "0.5624607", "0.5624302", "0.5620153", "0.5611645", "0.56107706", "0.56100893", "0.5592658", "0.55836546", "0.55779475", "0.5573192", "0.5567917", "0.5550827", "0.5550827", "0.5550827", "0.5547829", "0.55476683", "0.55400175", "0.55392873", "0.55369943", "0.55368894", "0.5536722", "0.5536321", "0.5532068", "0.5532068", "0.5528436", "0.5520899", "0.55166525", "0.5511676", "0.5511676", "0.55054986", "0.55048746", "0.5503788", "0.54710895", "0.5456958", "0.54547286", "0.5449793", "0.54425", "0.5427606", "0.542479", "0.5421472", "0.5420516", "0.5419641", "0.5419587", "0.5419415", "0.5415107", "0.541284", "0.54094005", "0.5405366", "0.54044425", "0.54026365", "0.5400456", "0.5397953" ]
0.74214554
0
A method to restrict the problem range problems are queried from
private int restrictProblem(Message msg, String parameter) { int[] problems = setProblemRestriction(msg, parameter); if (problems[0] == ERROR_CODE[0]) { return -1; } problemRestriction = true; lowerProblem = problems[0]; upperProblem = problems[1]; return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Range controlLimits();", "@Override\n public boolean isRange() {\n return false;\n }", "private void setDefaultValidRange ()\r\n\t{\r\n\t\tm_lowerBounds = Integer.MIN_VALUE;\r\n\t\tm_upperBounds = Integer.MAX_VALUE;\r\n\t}", "void calculateRange() {\n //TODO: See Rules\n }", "Limits limits();", "private int restrictSection(Message msg, String parameter) {\n int sec = Integer.parseInt(parameter);\n\n if(sec > 2) {\n MessageChannel ch = msg.getChannel();\n ch.sendMessage(\"`Error: Invalid query [section not 0-2]. Query terminated.`\").queue();\n return -1;\n }\n else if(sec == 2) {\n partTwo = true;\n upperProblem = 8;\n }\n\n return sec;\n }", "private void add_range(Question q)\n\t{\n\t\tlog.debug(\"Question \" + q.getQid() + \" is getting checked for ranges\");\n\t\tString min = doc.selectSingleNode(\"//document/question_attributes/rows/row[qid=\" + q.getQid() + \" and attribute='min_num_value_n']/value\").getText();\n\t\tString max = doc.selectSingleNode(\"//document/question_attributes/rows/row[qid=\" + q.getQid() + \" and attribute='max_num_value_n']/value\").getText();\n\n\t\tif (min != \"\") {\n\t\t\tq.setFloat_range_min(min);\n\t\t}\n\t\tif (max != \"\") {\n\t\t\tq.setFloat_range_max(max);\n\t\t}\n\t\tlog.debug(\"range check finished\");\n\t}", "@Override\n public void addEvictionGuard(RangeSet<Long> ranges) {\n\n }", "public void includeDomainInRangeCalculator(IntegerRangeCalculator i)\r\n\t{\r\n\t\ti.include(start);\r\n\t\tif(data.length>0) i.include(start+data.length-1);\r\n\t}", "private void queryProblems(Message msg, String[] parameters) {\n if(data.isEmpty())\n loadData();\n\n // Bounds on the problem number and year number\n resetParams();\n\n int section = -1;\n int currentOption = -1;\n\n int success = 0;\n for(int i = 1; i < parameters.length; i++) {\n if(success == -1)\n return;\n\n String parameter = parameters[i];\n\n switch(currentOption) {\n case 0:\n success = restrictYear(msg, parameter, section);\n currentOption = -1;\n break;\n case 1:\n success = restrictProblem(msg, parameter);\n currentOption = -1;\n break;\n case 2:\n section = restrictSection(msg, parameter);\n // If -1, we need to break to avoid errors\n success = section;\n currentOption = -1;\n break;\n default:\n if (parameter.matches(\"-y(ear)?\")) {\n currentOption = 0;\n } else if (parameter.matches(\"-p(roblem)?\")) {\n currentOption = 1;\n } else if(parameter.matches(\"-s(ection)?\")) {\n currentOption = 2;\n } else {\n MessageChannel ch = msg.getChannel();\n ch.sendMessage(\"`Error: Invalid option in query [not -s, -y, or -p]. Query terminated.`\").queue();\n return;\n }\n }\n }\n\n // Check if last command is in error\n if(success == -1)\n return;\n\n // Assign section if none selected\n if(section == -1) {\n section = rng.nextInt(2);\n lowerYear = LOWER_YEARS[section];\n upperYear = UPPER_YEARS[section];\n }\n\n int problem = getValue(lowerProblem, upperProblem);\n int year = getValue(lowerYear, upperYear);\n\n queryImage(msg, year, problem, section);\n }", "@Test(timeout = 4000)\n public void test28() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, (-2147483648L), 1146L);\n long long0 = range0.getBegin();\n assertEquals((-2147483648L), long0);\n \n boolean boolean0 = range0.equals(\"number of entries must be <= Integer.MAX_VALUE\");\n assertFalse(boolean0);\n \n Range range1 = Range.of((-2147483648L));\n List<Range> list0 = range1.complement(range0);\n assertEquals(0, list0.size());\n }", "@Test\r\n\tpublic void getByRange_RangeInAll_Success() {\r\n\r\n\t\tSelectionCriteria criteria = getSelectionCriteria();\r\n\t\tgetContentList();\r\n\t\tList<String> content = service.getByCriteria(criteria);\r\n\t\tAssert.assertEquals(7, content.size());\r\n\t\tAssert.assertEquals(USER_INPUT[2], content.get(0));\r\n\t\tservice.clearAll();\r\n\t}", "int getRange();", "public void setRangeOfCheck(String[] rangeOfCheck) {\n this.rangeOfCheck = rangeOfCheck;\n }", "public int askPermitToGetBetweenVisible();", "protected final boolean rangeTestFailed(int value) {\n\tboolean test1 =\n\t (reqminSet && (reqminClosed? (value < reqmin): (value <= reqmin)))\n\t || (minSet && (minClosed? (value < min): (value <= min)));\n\tboolean test2 =\n\t (reqmaxSet && (reqmaxClosed? (value > reqmax): (value >= reqmax)))\n\t || (maxSet && (maxClosed? (value > max): (value >= max)));\n\treturn (test1 || test2);\n }", "private boolean isRangeValid() {\n\n\t\tboolean valid = true;\n\n\t\tif (getRange() == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\tLong.parseLong(getRange());\n\t\t} catch (NumberFormatException nfe) {\n\t\t\tvalid = false;\n\t\t}\n\n\t\tvalid = valid || getRange().compareToIgnoreCase(CCLConstants.INDIRECT_RANGE_ALL) == 0;\n\n\t\treturn valid;\n\t}", "public void setValidRange (int lowerBounds, int upperBounds)\r\n\t{\r\n\t\tm_lowerBounds = lowerBounds;\r\n\t\tm_upperBounds = upperBounds;\r\n\t}", "private static void checkFromToBounds(int paramInt1, int paramInt2, int paramInt3) {\n/* 386 */ if (paramInt2 > paramInt3) {\n/* 387 */ throw new ArrayIndexOutOfBoundsException(\"origin(\" + paramInt2 + \") > fence(\" + paramInt3 + \")\");\n/* */ }\n/* */ \n/* 390 */ if (paramInt2 < 0) {\n/* 391 */ throw new ArrayIndexOutOfBoundsException(paramInt2);\n/* */ }\n/* 393 */ if (paramInt3 > paramInt1) {\n/* 394 */ throw new ArrayIndexOutOfBoundsException(paramInt3);\n/* */ }\n/* */ }", "public SettingInteger setValidRange(int min, int max) { _minValue = min; _maxValue = max; return this; }", "private void notEligibleForRealMin() {\n eligibleForRealMin = false;\n }", "private List<T> findRange(RequestData requestData) {\n javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();\n cq.select(cq.from(getEntityClass()));\n javax.persistence.Query q = getEntityManager().createQuery(cq);\n q.setMaxResults(requestData.getLength());\n q.setFirstResult(requestData.getStart());\n return q.getResultList();\n }", "private boolean hasValidBounds() {\n\n\n\n return false;\n }", "private Constraint doNotExceedFloorCapacity(ConstraintFactory factory) {\n return factory.from(TaskAssignment.class)\n .filter(TaskAssignment::isTaskAssigned)\n .join(Shift.class)\n .filter(((taskAssignment, shift) -> taskAssignment.getShift() == shift))\n .groupBy(((taskAssignment, shift) -> shift))\n .join(Person.class)\n .filter((Shift::isPersonAssigned))\n .groupBy(((shift, person) -> shift), countBi())\n .filter(((shift, integer) -> integer > 40))\n .penalizeConfigurable(\"Floor capacity conflict\");\n }", "public void changeConstraintsToMoreThan() throws IloException {\n /*\n IloRange notes:\n for expr == rhs, set lb = ub = rhs\n for expr <= rhs, set lb = -infinity and ub = rhs\n for expr >= rhs, set lb = rhs and ub = infinity\n */\n for (int i = 0; i < matrix.getNrows(); i++) {\n IloRange rangedExpression = matrix.getRange(i);\n if (rangedExpression.getLB() <= Double.NEGATIVE_INFINITY) {\n rangedExpression.setBounds(-rangedExpression.getLB(), Double.POSITIVE_INFINITY);\n for (int j = 0; j < matrix.getNrows(); j++) {\n matrix.setNZ(i, j, -matrix.getNZ(i, j));\n }\n }\n }\n }", "boolean isLimited();", "@Override\n public int ask(String question, ArrayList<Integer> range) {\n int value = 0;\n try {\n value = super.ask(question, range);\n } catch (MenuOutException moe) {\n System.out.println(moe.getMessage());\n } catch (NumberFormatException nfe) {\n System.out.println(\"Введите корректные данные\");\n }\n return value;\n }", "@Test(timeout = 4000)\n public void test002() throws Throwable {\n long long0 = 785L;\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n // Undeclared exception!\n try { \n Range.of(range_CoordinateSystem0, 9223372036854775806L, (-128L));\n fail(\"Expecting exception: IndexOutOfBoundsException\");\n \n } catch(IndexOutOfBoundsException e) {\n //\n // given length -129 would make range [9223372036854775805 - ? ] beyond max allowed end offset\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "void checkRange(Long value) throws TdtTranslationException {\r\n\t\tif (hasRange) {\r\n\t\t\tif ((value.compareTo(minimum) < 0)\r\n\t\t\t\t\t|| (value.compareTo(maximum) > 0)) {\r\n\t\t\t\tthrow new TdtTranslationException(\"Value {\" + value\r\n\t\t\t\t\t\t+ \"} out of range [{\" + minimum + \"},{\" + maximum\r\n\t\t\t\t\t\t+ \"}] in field \" + getId());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public Range findRangeBounds(CategoryDataset dataset) { return findRangeBounds(dataset, true); }", "public void checkBounds(Scope scope) {\n}", "Range alarmLimits();", "@Override\n\tpublic void CheckBounds() {\n\t\t\n\t}", "@Override\n\t@Deprecated\n\tprotected final void rangeCheck ( int from , int to ) {\n\t}", "private static boolean checkTaskBounds(int task) {\r\n\t\t\tboolean isInBound;\r\n\t\t\t\r\n\t\t\tif ((task < 0) || (task > 7)) {\r\n\t\t\t\t//isInBound = false;\r\n\t\t\t\tif (task == -1) {\r\n\t\t\t\t\tisInBound = true;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tisInBound = false;\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tisInBound = true;\r\n\t\t\t}\r\n\t\t\treturn isInBound;\r\n\t\t}", "protected void setUsedRange(int _start, int _end) throws Exception {\n if (_start < 0 || _end >= size || _start > _end) {\n throw new Exception(\"Invalid range! Start must be 0 or larger, end must be \" + \"inside allowed memory range.\");\n }\n\n start = _start;\n end = _end;\n }", "ValueRangeConstraint createValueRangeConstraint();", "boolean getIsLimited();", "@Test\n\tpublic void seperateRangeTest() {\n\n\t\tsetup();\n\t\tSystem.out.println(\"seperate range test\");\n\t\tZipCodeRange z1 = new ZipCodeRange(new ZipCode(94133), new ZipCode(94133));\n\t\tZipCodeRange z2 = new ZipCodeRange(new ZipCode(94200), new ZipCode(94299));\n\t\tZipCodeRange z3 = new ZipCodeRange(new ZipCode(94600), new ZipCode(94699));\n\n\t\t// Testing\n\t\tZipRangeControl zrc = new ZipRangeControl();\n\t\tzrc.processNewRange(z1);\n\t\tzrc.processNewRange(z2);\n\t\tzrc.processNewRange(z3);\n\n\t\tZipCodeRange z4 = new ZipCodeRange(new ZipCode(94200), new ZipCode(94399));\n\t\trequiredList.add(z1);\n\t\trequiredList.add(z2);\n\t\trequiredList.add(z3);\n\n\t\tZipCodeRange[] ziparray = new ZipCodeRange[requiredList.size()];\n\t\tList<ZipCodeRange> zlist = zrc.getFinalZipRanges();\n\n\t\tfor (int i = 0; i < requiredList.size(); i++) {\n\t\t\tAssert.assertThat(\"Lower Limit match failed at entry\" + i, requiredList.get(i).lower.zipcode,\n\t\t\t\t\torg.hamcrest.CoreMatchers.equalTo(zlist.get(i).lower.zipcode));\n\t\t\tAssert.assertThat(\"Upper Limit match failed at entry\" + i, requiredList.get(i).upper.zipcode,\n\t\t\t\t\torg.hamcrest.CoreMatchers.equalTo(zlist.get(i).upper.zipcode));\n\t\t}\n\t\tclimax();\n\n\t}", "public void changeConstraintsToLessThan() throws IloException {\n /*\n IloRange notes:\n for expr == rhs, set lb = ub = rhs\n for expr <= rhs, set lb = -infinity and ub = rhs\n for expr >= rhs, set lb = rhs and ub = infinity\n */\n for (int i = 0; i < matrix.getNrows(); i++) {\n IloRange rangedExpression = matrix.getRange(i);\n if (rangedExpression.getUB() >= Double.POSITIVE_INFINITY) {\n rangedExpression.setBounds(Double.NEGATIVE_INFINITY, -rangedExpression.getUB());\n for (int j = 0; j < matrix.getNrows(); j++) {\n matrix.setNZ(i, j, -matrix.getNZ(i, j));\n }\n }\n }\n }", "private int checkRange(int number,int range){\n return (number+range)%range;\n }", "private String useRangeFormat(Unit units, int lowerBound, int upperBound) {\n return lowerBound + \" to \" + upperBound + getUnits(units, upperBound);\n }", "private void checkBound(int lowerBound, int upperBound) {\n\t\tSet setKeys = Utility.vocabHM.keySet();\n\t\tIterator i = setKeys.iterator();\n\n\t\twhile (i.hasNext()) {\n\t\t\tString s = (String) i.next();\n\t\t\tInteger df = (Integer) Utility.vocabHM.get(s);\n\n\t\t\tif ((df.intValue() <= lowerBound) || (df.intValue() >= upperBound))\n\t\t\t\ti.remove();\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test10() throws Throwable {\n Range range0 = Range.of(0L);\n range0.toString();\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.ZERO_BASED;\n range0.getEnd(range_CoordinateSystem0);\n range0.getEnd();\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.ZERO_BASED;\n range0.getEnd(range_CoordinateSystem1);\n range0.iterator();\n Range.of((-1233L), 0L);\n // Undeclared exception!\n try { \n Range.of(range_CoordinateSystem1, 0L, (-1233L));\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // length can not be negative\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "@Test(timeout = 4000)\n public void test13() throws Throwable {\n long long0 = (-1259L);\n Range range0 = Range.of((-1259L), 255L);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n range0.toString(range_CoordinateSystem0);\n Range range1 = Range.of((-1259L));\n range1.getEnd();\n range1.getEnd();\n Range range2 = range0.intersection(range1);\n List<Range> list0 = range2.split(255L);\n List<Range> list1 = range2.complementFrom(list0);\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.SPACE_BASED;\n Range range3 = Range.of(range_CoordinateSystem1, (-1259L), 0L);\n range3.endsBefore(range0);\n Consumer<Object> consumer0 = (Consumer<Object>) mock(Consumer.class, new ViolatedAssumptionAnswer());\n range0.forEach(consumer0);\n range2.complementFrom(list1);\n // Undeclared exception!\n try { \n Range.of(0L, (-1259L));\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // length can not be negative\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "public void setLowerBound (int lowerBound) throws ModelException;", "@Override\n\tprotected void setLowerBound() {\n\t\t\n\t}", "DbQuery setRangeFilter(int startValue, int endValue) {\n return setRangeFilter((double) startValue, (double) endValue);\n }", "@Test(timeout = 4000)\n public void test24() throws Throwable {\n Range.Builder range_Builder0 = new Range.Builder();\n range_Builder0.contractBegin(0L);\n Range.Builder range_Builder1 = new Range.Builder(0L);\n range_Builder0.copy();\n Range range0 = range_Builder0.build();\n range_Builder0.shift(243L);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n linkedList0.add(range0);\n long long0 = 127L;\n Range range1 = Range.of((-636L), 127L);\n range1.isSubRangeOf(range0);\n // Undeclared exception!\n try { \n Range.parseRange(\"\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // can not parse into a Range\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "private void defaultMTriggerEffectRangeShouldNotBeFound(String filter) throws Exception {\n restMTriggerEffectRangeMockMvc.perform(get(\"/api/m-trigger-effect-ranges?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restMTriggerEffectRangeMockMvc.perform(get(\"/api/m-trigger-effect-ranges/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(content().string(\"0\"));\n }", "public abstract void selectIndexRange(int min, int max);", "@Test(timeout = 4000)\n public void test38() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 0L, 4294967295L);\n long long0 = new Long(0L);\n Range range1 = Range.of(4294967295L);\n long long1 = range1.getBegin();\n assertEquals(4294967295L, long1);\n \n Consumer<Long> consumer0 = (Consumer<Long>) mock(Consumer.class, new ViolatedAssumptionAnswer());\n range1.forEach(consumer0);\n List<Range> list0 = range0.complement(range1);\n List<Range> list1 = range0.complementFrom(list0);\n Range range2 = Range.ofLength(2147483647L);\n range1.intersection(range0);\n Range range3 = Range.of(range_CoordinateSystem0, 0L, 4294967295L);\n range3.getEnd();\n boolean boolean0 = range2.intersects(range0);\n boolean boolean1 = range2.equals(\"numbeg of entries must be <= Integer.MAX_VALUE\");\n assertFalse(boolean1 == boolean0);\n \n Range range4 = Range.of(0L);\n assertFalse(range4.isEmpty());\n \n Range range5 = Range.of(1566L);\n List<Range> list2 = range5.complement(range2);\n assertFalse(list2.equals((Object)list0));\n assertTrue(list2.equals((Object)list1));\n }", "private Query getIntRange(final String fieldName, String[] range) {\n int lower = Integer.parseInt(range[0]);\n int upper = Integer.parseInt(range[1]);\n return IntPoint.newRangeQuery(fieldName, lower, upper);\n }", "public NotInRangeColumnConstraint(String name, T minValue, T maxValue,\n\t\t\tEditorProvider<T> editorProvider, String group) {\n\t\tsuper(name, minValue, maxValue, editorProvider, group);\n\t}", "private int getLowerBound(Object problem, int upperbound)\n {\n Graph tsp = (Graph)problem;\n if (weight == null)\n weight = new double[tsp.size()];\n hki = new HeldKarpIterative( tsp, included, includedT, excluded, excludedT, iterations, weight, upperbound);\n hki.compute();\n tour = hki.isTour();\n bound = hki.getBound();\n hasRun = true;\n// System.out.println(hki.debugDump());\n return bound;\n }", "private void checkStartLimit(int start, int limit) {\r\n if (start > limit) {\r\n throw new IllegalArgumentException(\r\n \"Start is greater than limit. start:\" + start + \"; limit:\" + limit);\r\n }\r\n if (start < 0) {\r\n throw new IllegalArgumentException(\"Start is negative. start:\" + start);\r\n }\r\n if (limit > length()) {\r\n throw new IllegalArgumentException(\"Limit is greater than length. limit:\" + limit);\r\n }\r\n }", "public void setRange(boolean range) {\r\n this.range = range;\r\n }", "public boolean isWhitelisted(Range<Integer> range) {\n return this.meta.encloses(range);\n }", "public boolean overlapsRange(Range range) {\n/* 334 */ if (range == null) {\n/* 335 */ return false;\n/* */ }\n/* 337 */ return (range.containsLong(this.min) || range.containsLong(this.max) || containsLong(range.getMinimumLong()));\n/* */ }", "public void setRange(Range range) { setRange(range, true, true); }", "public static void main(String[] args) {\n\n\t\tint [] numbers = {1,2,3,4,5,6,7,8,9,10};\n\n\t\tint Startrange = 3;\n\t\tint Endrange = 7;\n\n\t\tfor(int i = 0; i < numbers.length; ++i) {\n\n\t\t\tif (!(numbers[i] > Startrange && numbers[i] < Endrange )){\n\t\t\t\tSystem.out.print(numbers[i] + \" \");\n\t\t\t}\t\n\n\t\t}\n\n\t}", "@Test(timeout = 4000)\n public void test17() throws Throwable {\n Range.Builder range_Builder0 = new Range.Builder();\n range_Builder0.contractBegin(0L);\n range_Builder0.copy();\n range_Builder0.copy();\n Range range0 = range_Builder0.build();\n long long0 = 265L;\n range_Builder0.shift(265L);\n Consumer<Object> consumer0 = (Consumer<Object>) mock(Consumer.class, new ViolatedAssumptionAnswer());\n range0.forEach(consumer0);\n Range range1 = Range.of(0L);\n List<Range> list0 = range0.complement(range1);\n List<Range> list1 = range0.complementFrom(list0);\n List<Range> list2 = range0.complementFrom(list1);\n List<Range> list3 = range0.complementFrom(list2);\n range0.complementFrom(list3);\n Range.of((-1147L), 0L);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range2 = Range.of(range_CoordinateSystem0, 0L, 0L);\n Range range3 = range2.intersection(range0);\n range0.getEnd();\n range3.intersects(range0);\n // Undeclared exception!\n try { \n Range.parseRange(\"q)fxUX9s]Tp\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // can not parse q)fxUX9s]Tp into a Range\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "@Test(timeout = 4000)\n public void test038() throws Throwable {\n Range range0 = Range.of(12599011L);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n Range range1 = range0.asRange();\n Range.CoordinateSystem.values();\n // Undeclared exception!\n try { \n range1.intersection((Range) null);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // Null Range used in intersection operation.\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "@Test(timeout = 4000)\n public void test14() throws Throwable {\n Range range0 = Range.of((-1259L));\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n range0.toString(range_CoordinateSystem0);\n Range range1 = Range.of((-1259L));\n long long0 = new Long((-1259L));\n range1.getEnd();\n Range range2 = range0.intersection(range1);\n List<Range> list0 = range2.split(255L);\n range2.complementFrom(list0);\n Range range3 = range1.asRange();\n String string0 = null;\n range3.intersection(range1);\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.RESIDUE_BASED;\n range2.getEnd(range_CoordinateSystem1);\n // Undeclared exception!\n try { \n Range.parseRange(\"[ -1259 .. -1258 ]/SB\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // can not parse [ -1259 .. -1258 ]/SB into a Range\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "@Test\n public void testGetRandomRange() {\n // XXX what should be tested?\n // bad values to the range?\n // min == max?\n Assert.assertTrue(true);\n }", "protected final boolean rangeTestNeeded() {\n\treturn needRangeTest;\n }", "@Test(timeout = 4000)\n public void test25() throws Throwable {\n Range.Builder range_Builder0 = new Range.Builder();\n range_Builder0.contractBegin(0L);\n range_Builder0.copy();\n range_Builder0.copy();\n Range range0 = range_Builder0.build();\n range_Builder0.shift(265L);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n linkedList0.add(range0);\n range0.complementFrom(linkedList0);\n Range range1 = Range.of((-3234L));\n range0.isSubRangeOf(range1);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n range0.complementFrom(linkedList0);\n range1.intersects(range0);\n // Undeclared exception!\n try { \n Range.Comparators.valueOf(\"TGa_,[\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // No enum constant org.jcvi.jillion.core.Range.Comparators.TGa_,[\n //\n verifyException(\"java.lang.Enum\", e);\n }\n }", "@Test(timeout = 4000)\n public void test053() throws Throwable {\n Range range0 = Range.of((-2147483648L));\n Range range1 = Range.of(1845L);\n boolean boolean0 = range0.isSubRangeOf(range1);\n assertFalse(boolean0);\n \n range0.getBegin();\n assertTrue(range0.isEmpty());\n }", "@Test(timeout = 4000)\n public void test04() throws Throwable {\n Range.CoordinateSystem.values();\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n Range.Builder range_Builder0 = new Range.Builder(range_CoordinateSystem0, 0L, 0L);\n Range range0 = Range.ofLength(0L);\n range0.getBegin(range_CoordinateSystem0);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n linkedList0.spliterator();\n range0.complementFrom(linkedList0);\n range_Builder0.contractBegin(0L);\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.RESIDUE_BASED;\n // Undeclared exception!\n try { \n Range.parseRange(\"\", range_CoordinateSystem1);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // can not parse into a Range\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "@Test(timeout = 4000)\n public void test11() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, (-1521L), (-1521L));\n Range range1 = Range.ofLength(357L);\n List<Range> list0 = range0.complement(range1);\n assertFalse(range0.isEmpty());\n assertTrue(list0.contains(range0));\n assertFalse(range1.isEmpty());\n }", "@Test(timeout = 4000)\n public void test00() throws Throwable {\n Range.Comparators.values();\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n Range.of(range_CoordinateSystem0, (-5250L), 2383L);\n // Undeclared exception!\n try { \n Range.parseRange(\"\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // can not parse into a Range\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "@Test(timeout = 4000)\n public void test27() throws Throwable {\n Range range0 = Range.of(0L);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.ZERO_BASED;\n range0.getBegin(range_CoordinateSystem0);\n Range range1 = Range.of(0L);\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.SPACE_BASED;\n Range range2 = Range.of(range_CoordinateSystem1, 0L, 0L);\n Object object0 = new Object();\n range2.equals(object0);\n range2.complement(range1);\n Range.CoordinateSystem range_CoordinateSystem2 = Range.CoordinateSystem.ZERO_BASED;\n Range range3 = Range.of(range_CoordinateSystem2, 1L, 1L);\n Range.Builder range_Builder0 = new Range.Builder(range3);\n // Undeclared exception!\n try { \n range_Builder0.contractEnd(977L);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // length can not be negative\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "List<Videogioco> doRetriveVideogiocoAllRange(int min, int max);", "private int restrictYear(Message msg, String parameter, int section) {\n int[] years = setYearRestriction(msg, parameter, section);\n\n if (years[0] == ERROR_CODE[0]) {\n return -1;\n }\n\n yearRestriction = true;\n lowerYear = years[0];\n upperYear = years[1];\n return 0;\n }", "@Test(timeout = 4000)\n public void test22() throws Throwable {\n Range.Builder range_Builder0 = new Range.Builder();\n Range.Builder range_Builder1 = range_Builder0.contractBegin(0L);\n Range.Builder range_Builder2 = new Range.Builder(0L);\n range_Builder0.copy();\n Range range0 = range_Builder0.build();\n range_Builder0.shift(265L);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n linkedList0.add(range0);\n range_Builder0.expandBegin(1734L);\n range0.equals(range_Builder1);\n Range.Builder range_Builder3 = new Range.Builder();\n range_Builder0.copy();\n Range range1 = Range.ofLength(2147483647L);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.ZERO_BASED;\n range1.getBegin(range_CoordinateSystem0);\n Range.Comparators.values();\n // Undeclared exception!\n try { \n Range.of(range_CoordinateSystem0, 2147483647L, 430L);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // length can not be negative\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "@Test(timeout = 4000)\n public void test40() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.ZERO_BASED;\n Range range0 = Range.of(0L, 0L);\n Range.Builder range_Builder0 = new Range.Builder(range0);\n Range.Builder range_Builder1 = range_Builder0.copy();\n Range range1 = range_Builder1.build();\n range_Builder1.shift(9223372036854775807L);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n linkedList0.add(range0);\n linkedList0.add(range0);\n Range.Builder range_Builder2 = range_Builder0.expandBegin((-636L));\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.RESIDUE_BASED;\n range0.getBegin(range_CoordinateSystem1);\n range0.equals(linkedList0);\n Range.of(2139L, 2139L);\n Range range2 = Range.of(1124L);\n List<Range> list0 = range1.complement(range2);\n Range range3 = Range.of(range_CoordinateSystem0, (-636L), 1734L);\n range3.complementFrom(list0);\n Range.of(9223372036854775807L);\n Range range4 = Range.of((-23L), 0L);\n range4.equals(range3);\n range2.complement(range4);\n // Undeclared exception!\n try { \n range_Builder2.build();\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // length can not be negative\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "public NotInRangeColumnConstraint(T minValue, T maxValue, EditorProvider<T> editorProvider) {\n\t\tthis(\"Not In Range\", minValue, maxValue, editorProvider, \"number\");\n\t}", "DbQuery setRangeFilter(long startValue, long endValue) {\n return setRangeFilter((double) startValue, (double) endValue);\n }", "@Test(timeout = 4000)\n public void test022() throws Throwable {\n Range range0 = Range.of((-81L));\n Range range1 = Range.of((-1L));\n boolean boolean0 = range0.equals(range1);\n assertFalse(boolean0);\n \n Range.Comparators.values();\n long long0 = range0.getBegin();\n assertEquals((-81L), long0);\n \n List<Range> list0 = range1.complement(range0);\n assertFalse(range1.isEmpty());\n assertTrue(list0.contains(range1));\n }", "public boolean isRangeUnavailable()\r\n {\r\n return statusObj.value == STATUS_CANDIDATE_RANGE_UNAVAILABLE;\r\n }", "public boolean whitelist(Range<Integer> range) {\n meta.add(range);\n return isWhitelisted(range);\n }", "NumericRangeFilter(double p_min, double p_max) {\n maximum = p_max;\n minimum = p_min;\n }", "@Test(timeout = 4000)\n public void test035() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range.of(range_CoordinateSystem0, (-2147483648L), (-2147483648L));\n // Undeclared exception!\n try { \n Range.of(range_CoordinateSystem0, 3993L, (-2147483648L));\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // length can not be negative\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "@Test\n public void test_range_Integer_Collection4() {\n populate_i3();\n Collection<Integer> actual = Selector.range(i3, 4, 8, new CompareIntegerAscending());\n Collection<Integer> expected = new ArrayList<Integer>();\n expected.add(8);\n expected.add(7);\n expected.add(6);\n expected.add(5);\n expected.add(4);\n Assert.assertEquals(\"Did not find range correctly\", expected, actual);\n }", "int getProblemCategory();", "private double checkBounds(double param, int i) {\n if (param < low[i]) {\n return low[i];\n } else if (param > high[i]) {\n return high[i];\n } else {\n return param;\n }\n }", "@Test(timeout = 4000)\n public void test003() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.ZERO_BASED;\n // Undeclared exception!\n try { \n Range.of(range_CoordinateSystem0, 2147483646L, (-9223372036854775808L));\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // Range coordinates 2147483646, -9223372036854775808 are not valid Zero Based coordinates\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "protected RestrictionsFailCLI() {\n\t\tsuper(FOLDER, FOLDER + \"../restrictions/restrictionsAll.sf\");\n\t}", "@Test(timeout = 4000)\n public void test048() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 32740L, 2147483647L);\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.RESIDUE_BASED;\n range0.toString(range_CoordinateSystem1);\n range0.toString();\n Range range1 = Range.parseRange(\"[ 32740 .. 2147483646 ]/0B\", range_CoordinateSystem1);\n range0.isSubRangeOf(range1);\n range1.equals(range0);\n range0.equals(\"[ 32740 .. 2147483646 ]/0B\");\n // Undeclared exception!\n try { \n Range.Comparators.valueOf(\"org.jcvi.jillion.core.Range$UnsignedByteStartLongLengthRange\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // No enum constant org.jcvi.jillion.core.Range.Comparators.org.jcvi.jillion.core.Range$UnsignedByteStartLongLengthRange\n //\n verifyException(\"java.lang.Enum\", e);\n }\n }", "private void validateParameter(){\n\t\tif(hrNum > upperBound){\n\t\t\thrNum = upperBound;\n\t\t}\n\t\telse if(hrNum < lowerBound){\n\t\t\thrNum = lowerBound;\n\t\t}\n\t}", "public void tensionRangeCheck(){\n if(motor.get() < 0){\n if(Bottom_Limit_Switch.get() | tenPot.pidGet()> tenPotMAX ){\n motor.set(0.0);\n }\n }else if(motor.get() > 0){\n if(Top_Limit_Switch.get() | tenPot.pidGet()< tenPotMIN){\n motor.set(0.0);\n }\n }\n }", "private static boolean checkOccurrenceRange(int min1, int max1, int min2, int max2) {\n/* 1159 */ if (min1 >= min2 && (max2 == -1 || (max1 != -1 && max1 <= max2)))\n/* */ {\n/* */ \n/* 1162 */ return true;\n/* */ }\n/* 1164 */ return false;\n/* */ }", "@Test(timeout = 4000)\n public void test26() throws Throwable {\n Range range0 = Range.of((-1264L), 255L);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n range0.toString(range_CoordinateSystem0);\n Range range1 = Range.of((-1264L));\n range1.getEnd();\n range1.getEnd();\n List<Range> list0 = range1.split(255L);\n range0.complementFrom(list0);\n Range range2 = Range.of(range_CoordinateSystem0, (-1264L), 0L);\n range2.endsBefore(range0);\n Long.max((-1264L), (-3100L));\n range1.equals(range0);\n Range.Comparators.values();\n range1.getEnd();\n range0.getEnd(range_CoordinateSystem0);\n Range.Builder range_Builder0 = new Range.Builder();\n Range.Builder range_Builder1 = null;\n try {\n range_Builder1 = new Range.Builder(range_CoordinateSystem0, 255L, 248L);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // length can not be negative\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "@Override\n\tpublic int getRange() {\n\t\treturn range;\n\t}", "protected abstract R getRange(E entry);", "@AutoEscape\n public String getModelIndexRangePolicy();", "@Test(timeout = 4000)\n public void test42() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, (-2147483648L), 1146L);\n long long0 = range0.getBegin();\n assertEquals((-2147483648L), long0);\n \n Range range1 = Range.of(1146L);\n boolean boolean0 = range1.endsBefore(range0);\n Consumer<Object> consumer0 = (Consumer<Object>) mock(Consumer.class, new ViolatedAssumptionAnswer());\n range1.forEach(consumer0);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n List<Range> list0 = range1.complementFrom(linkedList0);\n range0.complementFrom(list0);\n Range range2 = Range.ofLength(1146L);\n Range range3 = range2.intersection(range1);\n long long1 = range1.getEnd();\n assertEquals(1146L, long1);\n \n boolean boolean1 = range0.intersects(range2);\n boolean boolean2 = range1.equals(range2);\n assertFalse(boolean2 == boolean1);\n \n range0.getEnd();\n Range.of(2641L);\n List<Range> list1 = range0.complement(range2);\n assertEquals(1, list1.size());\n \n boolean boolean3 = range3.startsBefore(range1);\n assertTrue(boolean3 == boolean0);\n assertTrue(range3.isEmpty());\n assertFalse(boolean3);\n }", "public int getEffectiveRange() {\n return effectiveRange;\n }", "@Test(timeout = 4000)\n public void test046() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 32740L, 2147483647L);\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.RESIDUE_BASED;\n range0.toString(range_CoordinateSystem1);\n range0.toString();\n Range range1 = Range.parseRange(\"[ 32740 .. 2147483646 ]/0B\", range_CoordinateSystem1);\n range1.startsBefore(range0);\n range1.equals(range0);\n range0.equals(\"[ 32740 .. 2147483646 ]/0B\");\n // Undeclared exception!\n try { \n Range.Comparators.valueOf(\"org.jcvi.jillion.core.Range$UnsignedByteStartLongLengthRange\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // No enum constant org.jcvi.jillion.core.Range.Comparators.org.jcvi.jillion.core.Range$UnsignedByteStartLongLengthRange\n //\n verifyException(\"java.lang.Enum\", e);\n }\n }", "public double rangeFrom(MWC.GenericData.WorldLocation other)\r\n\t{\n\t\treturn INVALID_RANGE;\r\n\t}" ]
[ "0.6051895", "0.59386593", "0.574081", "0.5694922", "0.5655285", "0.56469244", "0.5617134", "0.5489708", "0.5472333", "0.5461008", "0.5432687", "0.54020053", "0.5387173", "0.5363844", "0.53595334", "0.5352464", "0.53450567", "0.5326257", "0.5324107", "0.5307986", "0.528972", "0.5273298", "0.5265276", "0.5255247", "0.5245601", "0.5243342", "0.5236153", "0.5232292", "0.5231985", "0.52319396", "0.5219625", "0.5204948", "0.5170563", "0.5163413", "0.5139175", "0.51365006", "0.513271", "0.51261", "0.51248455", "0.5117638", "0.51070607", "0.50990665", "0.5098562", "0.509786", "0.508392", "0.50773615", "0.50759333", "0.506602", "0.5065268", "0.50605595", "0.5038643", "0.50330156", "0.5030574", "0.5018316", "0.50140077", "0.50091094", "0.5004191", "0.5002615", "0.49964848", "0.4993767", "0.49912062", "0.4988074", "0.49880692", "0.49822697", "0.4981514", "0.4979174", "0.49766785", "0.4974804", "0.49704695", "0.49660766", "0.4963684", "0.4959748", "0.49524823", "0.49508744", "0.4946908", "0.49459592", "0.49381703", "0.49373034", "0.49369138", "0.49352714", "0.4935128", "0.49342412", "0.4932713", "0.49279982", "0.49252817", "0.4921125", "0.4920031", "0.49173865", "0.49168676", "0.49156976", "0.49152714", "0.49126297", "0.490708", "0.49014267", "0.49013385", "0.48882872", "0.48870316", "0.48752728", "0.48737547", "0.4872628" ]
0.6296766
0
A method to restrict the test (local, part I, part II) our problems are queried from
private int restrictSection(Message msg, String parameter) { int sec = Integer.parseInt(parameter); if(sec > 2) { MessageChannel ch = msg.getChannel(); ch.sendMessage("`Error: Invalid query [section not 0-2]. Query terminated.`").queue(); return -1; } else if(sec == 2) { partTwo = true; upperProblem = 8; } return sec; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean needsProblem();", "@Test\n public void testAircraftPartNoNotApplicable777() throws Exception {\n\n String lTaskApplSqlLdesc = \"rootpart.part_no_oem <> 777\";\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 applicable\n lResult = execute( OFF_WING_ENGINE, lTaskApplSqlLdesc );\n assertEquals( 1, lResult );\n }", "@Test\n public void testAircraftPartNoOnlyApplicableOffWing() throws Exception {\n\n String lTaskApplSqlLdesc = \"rootpart.part_no_oem <> 787 AND rootpart.part_no_oem <> 777\";\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 not applicable\n lResult = execute( ON_WING_ENGINE_787, lTaskApplSqlLdesc );\n assertEquals( 0, lResult );\n\n // verify off wing engine is applicable\n lResult = execute( OFF_WING_ENGINE, lTaskApplSqlLdesc );\n assertEquals( 1, lResult );\n }", "private int restrictProblem(Message msg, String parameter) {\n int[] problems = setProblemRestriction(msg, parameter);\n\n if (problems[0] == ERROR_CODE[0]) {\n return -1;\n }\n\n problemRestriction = true;\n lowerProblem = problems[0];\n upperProblem = problems[1];\n return 0;\n }", "@Test\n public void testSubsequentRunsWithUnsatisfiableConstraint() {\n System.out.println(\" - test subsequent runs with unsatisfiable constraint\");\n // set constraint\n problem.addMandatoryConstraint(new NeverSatisfiedConstraintStub());\n // create and add listeners\n AcceptedMovesListener l1 = new AcceptedMovesListener();\n AcceptedMovesListener l2 = new AcceptedMovesListener();\n AcceptedMovesListener l3 = new AcceptedMovesListener();\n searchLowTemp.addSearchListener(l1);\n searchMedTemp.addSearchListener(l2);\n searchHighTemp.addSearchListener(l3);\n // perform multiple runs (maximizing objective)\n System.out.format(\" - low temperature (T = %.7f)\\n\", LOW_TEMP);\n multiRunWithMaximumRuntime(searchLowTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l1.getTotalAcceptedMoves(), l1.getTotalRejectedMoves());\n System.out.format(\" - medium temperature (T = %.7f)\\n\", MED_TEMP);\n multiRunWithMaximumRuntime(searchMedTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l2.getTotalAcceptedMoves(), l2.getTotalRejectedMoves());\n System.out.format(\" - high temperature (T = %.7f)\\n\", HIGH_TEMP);\n multiRunWithMaximumRuntime(searchHighTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l3.getTotalAcceptedMoves(), l3.getTotalRejectedMoves());\n // verify\n assertNull(searchLowTemp.getBestSolution());\n assertNull(searchMedTemp.getBestSolution());\n assertNull(searchHighTemp.getBestSolution());\n }", "@Test\n public void testAircraftPartNoNotApplicable787() throws Exception {\n\n String lTaskApplSqlLdesc = \"rootpart.part_no_oem <> 787\";\n\n // verify on wing engine 777 is applicable\n int lResult = execute( ON_WING_ENGINE_777, lTaskApplSqlLdesc );\n assertEquals( 1, lResult );\n\n // verify on wing engine 787 is not applicable\n lResult = execute( ON_WING_ENGINE_787, lTaskApplSqlLdesc );\n assertEquals( 0, lResult );\n\n // verify off wing engine is applicable\n lResult = execute( OFF_WING_ENGINE, lTaskApplSqlLdesc );\n assertEquals( 1, lResult );\n }", "@Test\n public void testAircraftPartNoApplicable777() throws Exception {\n\n String lTaskApplSqlLdesc = \"rootpart.part_no_oem = 777\";\n\n // verify on wing engine 777 is applicable\n int lResult = execute( ON_WING_ENGINE_777, lTaskApplSqlLdesc );\n assertEquals( 1, lResult );\n\n // verify on wing engine 787 is not applicable\n lResult = execute( ON_WING_ENGINE_787, lTaskApplSqlLdesc );\n assertEquals( 0, lResult );\n\n // verify off wing engine is not applicable\n lResult = execute( OFF_WING_ENGINE, lTaskApplSqlLdesc );\n assertEquals( 0, lResult );\n }", "public void testOutputIsVaild()\n {\n Collection<Puzzle> puzzles = new ArrayList<Puzzle>();\n\n puzzles = (Collection<Puzzle>) Config.get(\"Puzzles\", puzzles);\n\n for (Puzzle puzzle : puzzles)\n {\n byte[] grid = puzzle.getData();\n GridSolver cs = new GridSolver(grid);\n cs.solveGrid();\n assertTrue(new GridChecker(cs.getDataSolution()).checkGrid());\n }\n }", "private void queryProblems(Message msg, String[] parameters) {\n if(data.isEmpty())\n loadData();\n\n // Bounds on the problem number and year number\n resetParams();\n\n int section = -1;\n int currentOption = -1;\n\n int success = 0;\n for(int i = 1; i < parameters.length; i++) {\n if(success == -1)\n return;\n\n String parameter = parameters[i];\n\n switch(currentOption) {\n case 0:\n success = restrictYear(msg, parameter, section);\n currentOption = -1;\n break;\n case 1:\n success = restrictProblem(msg, parameter);\n currentOption = -1;\n break;\n case 2:\n section = restrictSection(msg, parameter);\n // If -1, we need to break to avoid errors\n success = section;\n currentOption = -1;\n break;\n default:\n if (parameter.matches(\"-y(ear)?\")) {\n currentOption = 0;\n } else if (parameter.matches(\"-p(roblem)?\")) {\n currentOption = 1;\n } else if(parameter.matches(\"-s(ection)?\")) {\n currentOption = 2;\n } else {\n MessageChannel ch = msg.getChannel();\n ch.sendMessage(\"`Error: Invalid option in query [not -s, -y, or -p]. Query terminated.`\").queue();\n return;\n }\n }\n }\n\n // Check if last command is in error\n if(success == -1)\n return;\n\n // Assign section if none selected\n if(section == -1) {\n section = rng.nextInt(2);\n lowerYear = LOWER_YEARS[section];\n upperYear = UPPER_YEARS[section];\n }\n\n int problem = getValue(lowerProblem, upperProblem);\n int year = getValue(lowerYear, upperYear);\n\n queryImage(msg, year, problem, section);\n }", "private void checkIsBetterSolution() {\n if (solution == null) {\n solution = generateSolution();\n //Si la solucion que propone esta iteracion es mejor que las anteriores la guardamos como mejor solucion\n } else if (getHealthFromAvailableWorkers(availableWorkersHours, errorPoints.size()) < solution.getHealth()) {\n solution = generateSolution();\n }\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\tpublic void testGetQuestionsWithPrivateReplies() {\n\t\tList<QnaQuestion> questions = questionLogic.getQuestionsWithPrivateReplies(LOCATION1_ID);\n\t\tAssert.assertEquals(1, questions.size());\n\t\tAssert.assertTrue(questions.contains(tdp.question2_location1));\n\t}", "private void validateQuery(boolean safe, Ignite node) {\n // Get node lost and remaining partitions.\n IgniteCache<?, ?> cache = node.cache(DEFAULT_CACHE_NAME);\n\n Collection<Integer> lostParts = cache.lostPartitions();\n\n int part = cache.lostPartitions().stream().findFirst().orElseThrow(AssertionError::new);\n\n Integer remainingPart = null;\n\n for (int i = 0; i < node.affinity(DEFAULT_CACHE_NAME).partitions(); i++) {\n if (lostParts.contains(i))\n continue;\n\n remainingPart = i;\n\n break;\n }\n\n assertNotNull(\"Failed to find a partition that isn't lost\", remainingPart);\n\n // 1. Check query against all partitions.\n validateQuery0(safe, node);\n\n // 2. Check query against LOST partition.\n validateQuery0(safe, node, part);\n\n // 3. Check query on remaining partition.\n checkQueryPasses(node, false, remainingPart);\n\n if (shouldExecuteLocalQuery(node, remainingPart))\n checkQueryPasses(node, true, remainingPart);\n\n // 4. Check query over two partitions - normal and LOST.\n validateQuery0(safe, node, part, remainingPart);\n }", "@Test\n public void computerOffensive() throws IOException {\n Board field = new Board(\"CP----\"\n + \"-P--C-\"\n + \"-P----\"\n + \"-C----\"\n + \"-P--C-\"\n + \"------\");\n\n assertTrue(field.evaluate(false) < 0);\n\n // Vorteil fuer Spieler in Spalte 1\n Board field2 = new Board(\"CP----\"\n + \"-PC-C-\"\n + \"-P--P-\"\n + \"------\"\n + \"-PC-C-\"\n + \"------\");\n\n assertTrue(field2.evaluate(false) < 0);\n\n // Vorteil Computer in Zeile 0, 2\n // Vorteil Spieler in Zeile 2\n Board field3 = new Board(\"PC----\"\n + \"-PC-C-\"\n + \"-P--P-\"\n + \"-C----\"\n + \"-P--C-\"\n + \"------\");\n\n assertTrue(field3.evaluate(false) > 0);\n }", "@Test\n public void testSubsequentRunsWithPenalizingConstraint() {\n System.out.println(\" - test subsequent runs with penalizing constraint\");\n // set constraint\n problem.addPenalizingConstraint(constraint);\n // create and add listeners\n AcceptedMovesListener l1 = new AcceptedMovesListener();\n AcceptedMovesListener l2 = new AcceptedMovesListener();\n AcceptedMovesListener l3 = new AcceptedMovesListener();\n searchLowTemp.addSearchListener(l1);\n searchMedTemp.addSearchListener(l2);\n searchHighTemp.addSearchListener(l3);\n // perform 3 times as many runs as usual for this harder problem (maximizing objective)\n System.out.format(\" - low temperature (T = %.7f)\\n\", LOW_TEMP);\n multiRunWithMaximumRuntime(searchLowTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, 3*NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l1.getTotalAcceptedMoves(), l1.getTotalRejectedMoves());\n // constraint satisfied ?\n if(problem.getViolatedConstraints(searchLowTemp.getBestSolution()).isEmpty()){\n System.out.println(\" >>> constraint satisfied!\");\n } else {\n System.out.println(\" >>> constraint not satisfied, penalty \"\n + constraint.validate(searchLowTemp.getBestSolution(), data).getPenalty());\n }\n System.out.format(\" - medium temperature (T = %.7f)\\n\", MED_TEMP);\n multiRunWithMaximumRuntime(searchMedTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, 3*NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l2.getTotalAcceptedMoves(), l2.getTotalRejectedMoves());\n // constraint satisfied ?\n if(problem.getViolatedConstraints(searchMedTemp.getBestSolution()).isEmpty()){\n System.out.println(\" >>> constraint satisfied!\");\n } else {\n System.out.println(\" >>> constraint not satisfied, penalty \"\n + constraint.validate(searchMedTemp.getBestSolution(), data).getPenalty());\n }\n System.out.format(\" - high temperature (T = %.7f)\\n\", HIGH_TEMP);\n multiRunWithMaximumRuntime(searchHighTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, 3*NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l3.getTotalAcceptedMoves(), l3.getTotalRejectedMoves());\n // constraint satisfied ?\n if(problem.getViolatedConstraints(searchHighTemp.getBestSolution()).isEmpty()){\n System.out.println(\" >>> constraint satisfied!\");\n } else {\n System.out.println(\" >>> constraint not satisfied, penalty \"\n + constraint.validate(searchHighTemp.getBestSolution(), data).getPenalty());\n }\n }", "@Test\n public void testSubsequentRunsWithUnsatisfiablePenalizingConstraint() {\n System.out.println(\" - test subsequent runs with unsatisfiable penalizing constraint\");\n // set constraint\n final double penalty = 7.8;\n problem.addPenalizingConstraint(new NeverSatisfiedPenalizingConstraintStub(penalty));\n // perform multiple runs (maximizing objective)\n // perform multiple runs (maximizing objective)\n System.out.format(\" - low temperature (T = %.7f)\\n\", LOW_TEMP);\n multiRunWithMaximumRuntime(searchLowTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" - medium temperature (T = %.7f)\\n\", MED_TEMP);\n multiRunWithMaximumRuntime(searchMedTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" - high temperature (T = %.7f)\\n\", HIGH_TEMP);\n multiRunWithMaximumRuntime(searchHighTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n // verify\n PenalizedEvaluation penEval;\n penEval = (PenalizedEvaluation) searchLowTemp.getBestSolutionEvaluation();\n assertEquals(penalty, penEval.getEvaluation().getValue() - penEval.getValue(), TestConstants.DOUBLE_COMPARISON_PRECISION);\n penEval = (PenalizedEvaluation) searchMedTemp.getBestSolutionEvaluation();\n assertEquals(penalty, penEval.getEvaluation().getValue() - penEval.getValue(), TestConstants.DOUBLE_COMPARISON_PRECISION);\n penEval = (PenalizedEvaluation) searchHighTemp.getBestSolutionEvaluation();\n assertEquals(penalty, penEval.getEvaluation().getValue() - penEval.getValue(), TestConstants.DOUBLE_COMPARISON_PRECISION);\n }", "static void testAProblem(Problem aProblem,Problem optimisedSortProblem){\n\t\t\t\tIndividual originalIndividual = new Individual(aProblem);\n\t\t\t\t//Individual.initialise(originalIndividual.ourProblem.getStrings());\n\t\t\t\toriginalIndividual.gpMaterial.printAll();\n\t\t\t\tIndividualEvaluator indEval = new ByteCodeIndividualEvaluator();\n\t\t\t\tindEval.evaluateIndNoTimeLimit(originalIndividual); // This is our reference individual\n\t\t\t\toriginalIndividual.ourProblem.setBaselineRuntimeAvg(originalIndividual.getRuntimeAvg());\n\t\t\t\t\n\t\t\t\t// create a variant to compare against\n\t\t\t\t//Problem optimisedSortProblem = new Sort1Optimised();\n\t\t\t\tIndividual sortVariant = new Individual(originalIndividual, optimisedSortProblem,null);\n\t\t\t\tindEval.evaluateIndNoTimeLimit(sortVariant);\n\t\t\t\tSystem.out.println(\"Variant \"+sortVariant +\" \"+ sortVariant.getFunctionalityErrorCount()+\" \"+ sortVariant.getRuntimeAvg());\n\t\t\t\tSystem.out.println(\"timeratio: \" + sortVariant.getTimeFitnessRatio()+ \" correctness \"+ sortVariant.getCorrectness());\n\t\t\t\tSystem.out.println(\"Fitness \" + sortVariant.getFitness()+\"\\n\");\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t *\t9 May 2014 (commented out 15 Jan 2015)\n\t\t\t\t * Added to test multithreaded evaluation,\n\t\t\t\t * create a generation of individuals, then evaluate the lot. \n\t\t\t\t * (not needed, bug found in multi-threaded eval, due to programs accessing static methods when collecting results\n\t\t\t\t */\n\t\t\t\t/*for ( int i = 1 ; i < 100 ; i++){\n\t\t\t\t\toptimisedSortProblem = new Sort1Optimised();\n\t\t\t\t\tsortVariant = new Individual(originalIndividual, optimisedSortProblem,null);\n\t\t\t\t\tindEval.evaluateIndNoTimeLimit(sortVariant);\n\t\t\t\t\tSystem.out.println(\"Variant \"+sortVariant +\" \"+ sortVariant.getFunctionalityScore()+\" \"+ sortVariant.getRuntimeAvg());\n\t\t\t\t\tSystem.out.println(\"timeratio: \" + sortVariant.getTimeFitnessRatio()+ \" correctness \"+ sortVariant.getCorrectness());\n\t\t\t\t\tSystem.out.println(\"Fitness \" + sortVariant.getFitness()+\"\\n\");\n\t\t\t\t}*/\n\t}", "private boolean runMultiSampleCase() {\n\t\tArrayList<Candidate> candidates = collectTrioCandidates();\n\n\t\t// Then, check the candidates for all trios around affected individuals.\n\t\tfor (Candidate c : candidates)\n\t\t\tif (isCompatibleWithTriosAroundAffected(c))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "@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 }", "private boolean solutionChecker() {\n\t\t// TODO\n\t\treturn false;\n\n\t}", "@Test\r\n public void testSubtractionAsReversion() {\r\n Application.loadQuestions();\r\n assertTrue(Application.allQuestions.contains(\"21 - 7 = ?\") || Application.allQuestions.contains(\"21 - 14 = ?\"));\r\n }", "public void testSudoku() {\n \t\tfinal Sudoku model = new Sudoku(3);\n \t\tfinal Solution sol = solve(model.rules(), model.puzzle1());\n //\t\tSATISFIABLE\n //\t\tp cnf 1544 6974\n //\t\tprimary variables: 702\n \t\tassertEquals(Solution.Outcome.SATISFIABLE, sol.outcome());\n \t\tassertEquals(702, sol.stats().primaryVariables());\n \t\tassertEquals(1544, sol.stats().variables());\n \t\tassertEquals(6974, sol.stats().clauses());\n \t}", "@Test\n public void testSingleRunWithUnsatisfiablePenalizingConstraint() {\n System.out.println(\" - test single run with unsatisfiable penalizing constraint\");\n // set constraint\n final double penalty = 7.8;\n problem.addPenalizingConstraint(new NeverSatisfiedPenalizingConstraintStub(penalty));\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 PenalizedEvaluation penEval;\n penEval = (PenalizedEvaluation) searchLowTemp.getBestSolutionEvaluation();\n assertEquals(penalty, penEval.getEvaluation().getValue() - penEval.getValue(), TestConstants.DOUBLE_COMPARISON_PRECISION);\n penEval = (PenalizedEvaluation) searchMedTemp.getBestSolutionEvaluation();\n assertEquals(penalty, penEval.getEvaluation().getValue() - penEval.getValue(), TestConstants.DOUBLE_COMPARISON_PRECISION);\n penEval = (PenalizedEvaluation) searchHighTemp.getBestSolutionEvaluation();\n assertEquals(penalty, penEval.getEvaluation().getValue() - penEval.getValue(), TestConstants.DOUBLE_COMPARISON_PRECISION);\n }", "@Test\n\tpublic void integrationTest1() throws Exception {\n\t\tHashSet<String> mistress = loadGrepResults(\"mistress\");\n\t\tHashSet<String> undocumented = loadGrepResults(\"undocumented\");\n\t\tHashSet<String> forced = loadGrepResults(\"!i+am+forced\");\n\t\t\n\t\tHashSet<String> grepFound = new HashSet<String>(mistress);\n\t\tgrepFound.retainAll(undocumented);\n\t\tgrepFound.addAll(forced);\n\t\t\n\t\tCollection<Page> index = queryTest.query(\"mistress & undocumented | (!\\\"I am forced\\\")\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\tassertEquals(indexFound, grepFound);\n\t}", "public void testExercises() {\n\t\tSystem.out.println(\"Exercise 2:\");\n\t\tSATSolver solver = get2Solver();\n\t\tshowClauses(solver);\n\t\ttestLiterals(solver);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Exercise 5:\");\n\t\tsolver = get5Solver();\n\t\tshowClauses(solver);\n\t\ttestLiterals(solver);\n\t}", "@Override\n public String[] getChallengeSolutions(String problem) {\n return null;\n }", "@Test\n\tpublic void integrationTest2() throws Exception {\n\t\tHashSet<String> mistress = loadGrepResults(\"mistress\");\n\t\tHashSet<String> undocumented = loadGrepResults(\"undocumented\");\n\t\tHashSet<String> insane = loadGrepResults(\"insane\");\n\t\tHashSet<String> crazy = loadGrepResults(\"crazy\");\n\t\tHashSet<String> forced = loadGrepResults(\"!i+am+forced\");\n\t\t\n\t\tHashSet<String> grepFound = new HashSet<String>(mistress);\n\t\tgrepFound.retainAll(undocumented);\n\t\tHashSet<String> temp = new HashSet<String>(crazy);\n\t\ttemp.retainAll(forced);\n\t\tgrepFound.addAll(temp);\n\t\tgrepFound.addAll(insane);\n\t\t\n\t\tCollection<Page> index = queryTest.query(\"insane | crazy & !\\\"I am forced\\\" | mistress & undocumented\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\tassertEquals(indexFound, grepFound);\n\t}", "public IP2Problems check(ObservationElements elements) {\n if (elements.getTargetObsComp().isEmpty()) return null; // can't perform this check without a target environment\n\n P2Problems problems = new P2Problems();\n SPTarget scienceTarget = elements.getTargetObsComp().getValue().getBase();\n\n if (!hasScienceObserves(elements.getSequence())) return null; //if there are not observes, ignore this check (SCT-260)\n\n if (scienceTarget == null) { //really unlikely\n problems.addError(PREFIX+\"NO_SCIENCE_TARGET_MSG\", NO_SCIENCE_TARGET_MSG, elements.getTargetObsComponentNode().getValue());\n } else {\n if (\"\".equals(scienceTarget.getTarget().getName().trim())) {\n problems.addError(PREFIX+\"EMPTY_TARGET_NAME_MSG\", EMPTY_TARGET_NAME_MSG, elements.getTargetObsComponentNode().getValue());\n }\n }\n return problems;\n\n }", "boolean canPerformQuest(int currentWorkCred);", "public boolean LocalImprovementDNF (TableVar Variables, TableDat Examples) {\r\n IndDNF solucion = new IndDNF(Variables.getNVars(), Variables);\r\n QualityMeasures res, new_res;\r\n int mejor, cambio;\r\n int[] indices = new int[Variables.getNVars()];\r\n float[] evalua = new float[Variables.getNVars()];\r\n boolean improvement = true;\r\n boolean retValue = false;\r\n int control;\r\n\r\n // Store the pos of the best guy in \"mejor\"\r\n mejor = poblac.getBestGuy();\r\n\r\n // Copy in \"solucion\" the rule to improve\r\n for (int i=0; i<Variables.getNVars(); i++)\r\n for (int j=0; j<=Variables.getNLabelVar(i); j++)\r\n solucion.setCromElemGene(i, j, poblac.getCromElemGene(mejor,i,j));\r\n\r\n // Evaluate de rule and get the measures\r\n solucion.evalInd(this, Variables, Examples, false);\r\n Trials++; // Increment the number of trials\r\n res = solucion.getMedidas();\r\n\r\n control = 1;\r\n\r\n while ((improvement)&&(control<Variables.getNVars())) {\r\n improvement = false; // By now, there is no improvement\r\n for (int i=0; i<Variables.getNVars(); i++) {\r\n indices[i]=i;\r\n // It does not matter if the variable is discrete or continuous\r\n if (solucion.getCromElemGene(i,Variables.getNLabelVar(i))==0)\r\n // If variable does not actually takes part in the rule\r\n evalua[i] = -1;\r\n else {\r\n // The initial value is not stored cause we know the value is 1\r\n solucion.setCromElemGene(i, Variables.getNLabelVar(i),0);\r\n solucion.evalInd(this, Variables, Examples, false);\r\n Trials++;\r\n new_res = solucion.getMedidas();\r\n\r\n if ((new_res.getCnf() >= res.getCnf())&&(new_res.getSup() >= res.getSup())) {\r\n evalua[i] = new_res.getSup();\r\n improvement = true;\r\n }\r\n else\r\n evalua[i]=-1;\r\n // Restore initial values of \"solucion\"\r\n solucion.setCromElemGene(i, Variables.getNLabelVar(i), 1);\r\n }\r\n }\r\n\r\n if (improvement) {\r\n Utils.OrCrecIndex (evalua,0,Variables.getNVars()-1,indices);\r\n cambio = indices[Variables.getNVars()-1];\r\n for (int j=0; j<=Variables.getNLabelVar(cambio); j++)\r\n solucion.setCromElemGene(cambio, j, 0);\r\n\r\n res.setSup(evalua[Variables.getNVars()-1]);\r\n // Important: take into account not to eliminate all the variables of the rule\r\n\r\n // If there is improvement, set return value to true\r\n retValue = true;\r\n control++;\r\n\r\n }\r\n } // End while \"improvement\"\r\n\r\n // Store the new rule if it was improved\r\n if (retValue==true){\r\n for (int i=0; i<Variables.getNVars(); i++)\r\n for (int j=0; j<=Variables.getNLabelVar(i); j++)\r\n poblac.setCromElemGene(mejor, i, j, solucion.getCromElemGene(i,j));\r\n poblac.setIndivEvaluated(mejor,false);\r\n }\r\n\r\n return retValue;\r\n\r\n }", "public String isProblemPolicy(Record inputRecord);", "@Override\n\t\tpublic boolean isValidSolution() {\n\t\t\treturn super.isValidSolution();\n\t\t}", "public void testPigeonhole() {\n \t\tfinal Pigeonhole model = new Pigeonhole();\n \t\tfinal Formula show = model.declarations().and(model.pigeonPerHole());\n \t\tfinal Solution sol = solve(show, model.bounds(10,9));\n //\t\tUNSATISFIABLE\n//\t\tp cnf 1133 1983\n //\t\tprimary variables: 90\n \t\tassertEquals(Solution.Outcome.UNSATISFIABLE, sol.outcome());\n \t\tassertEquals(90, sol.stats().primaryVariables());\n \t\tassertEquals(1133, sol.stats().variables());\n\t\tassertEquals(1983, sol.stats().clauses());\n \t}", "@Test\n\tprivate void checkPossibilityTest() {\n\t\tint[] input = new int[] {1,1,1};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {0,0,3};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {4,2,3};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {2,3,4,2,3};\n Assertions.assertThat(checkPossibility(input)).isFalse();\n\t}", "public boolean canSolve(Class<? extends Problem> problem, Class<? extends Solution> solution);", "@Test\n public void skipTask_noHint() {\n initiateTest(ParticipantType.NOHINT);\n\n // Make sure the search results, paging are hidden and noresults is shown\n validateHidingSearchResults();\n\n // also check the experiment elements\n validateQuestion();\n\n assertFalse(\"Expecting hints element to be hidden\", experimentsPage.hintIsDisplayed());\n }", "@Test\n @WithMockUhUser(username = \"iamtst04\")\n public void optInTest() throws Exception {\n assertFalse(isInCompositeGrouping(GROUPING, tst[0], tst[3]));\n assertTrue(isInBasisGroup(GROUPING, tst[0], tst[3]));\n assertTrue(isInExcludeGroup(GROUPING, tst[0], tst[3]));\n\n //tst[3] opts into Grouping\n mapGSRs(API_BASE + GROUPING + \"/optIn\");\n }", "public boolean LocalImprovementCAN (TableVar Variables, TableDat Examples) {\r\n\r\n Individual solucion = new IndCAN(Variables.getNVars());\r\n QualityMeasures res, new_res;\r\n int best, initialvalue, cambio;\r\n int[] indices = new int[Variables.getNVars()];\r\n float[] evalua = new float[Variables.getNVars()];\r\n boolean improvement = true;\r\n boolean retValue = false;\r\n int control;\r\n \r\n // Store the pos of the best guy\r\n best = poblac.getBestGuy();\r\n \r\n // Copy the rule to improve\r\n for (int i=0; i<Variables.getNVars(); i++)\r\n solucion.setCromElem(i, this.poblac.getCromElem(best,i));\r\n\r\n // Evaluate de rule and get the measures\r\n solucion.evalInd(this, Variables, Examples, false);\r\n Trials++;\r\n res = solucion.getMedidas();\r\n control = 0;\r\n\r\n while (improvement) {\r\n improvement = false; // By now, there is no improvement\r\n for (int i=0; i<Variables.getNVars(); i++) {\r\n indices[i]=i;\r\n if (Variables.getType(i)=='e') {\r\n // Discrete Variable\r\n if (solucion.getCromElem(i)==(Variables.getMax(i)+1)){\r\n // If variable does not actually takes part in the rule\r\n evalua[i] = -1;\r\n } else {\r\n initialvalue = solucion.getCromElem(i);\r\n solucion.setCromElem(i, (int)Variables.getMax(i)+1);\t// Mark Doesn't take part\r\n solucion.evalInd(this, Variables, Examples, false);\r\n Trials++; \r\n new_res = solucion.getMedidas();\r\n\r\n if ((new_res.getCnf() >= res.getCnf())&&(new_res.getSup() >= res.getSup())) {\r\n evalua[i] = new_res.getSup();\r\n improvement = true;\r\n } else {\r\n evalua[i]=-1;\r\n }\r\n // Restore initial values\r\n solucion.setCromElem(i, initialvalue);\r\n }\r\n } else {\r\n // Continuous variable\r\n if (solucion.getCromElem(i)==(Variables.getNLabelVar(i))){\r\n // If variable does not take part\r\n evalua[i] = -1;\r\n } else {\r\n initialvalue = solucion.getCromElem(i);\r\n solucion.setCromElem(i, (int)Variables.getNLabelVar(i));\t// Mark does not take part\r\n solucion.evalInd(this, Variables, Examples, false);\r\n Trials++; \r\n new_res = solucion.getMedidas();\r\n\r\n if ((new_res.getCnf() >= res.getCnf())&&(new_res.getSup() >= res.getSup())) {\r\n evalua[i] = new_res.getSup();\r\n improvement = true;\r\n } else {\r\n evalua[i]=-1;\r\n }\r\n // Restore initial values\r\n solucion.setCromElem(i, initialvalue);\r\n }\r\n }\r\n }\r\n \r\n if (improvement) {\r\n // Sorts in ascendent order to minimise\r\n // \"evalua\" contents the support of each modification; seeking for the better\r\n Utils.OrCrecIndex (evalua,0,Variables.getNVars()-1,indices);\r\n cambio = indices[Variables.getNVars()-1];\r\n if (Variables.getType(cambio)=='e')\r\n solucion.setCromElem(cambio, (int)Variables.getMax(cambio)+1);\r\n else\r\n solucion.setCromElem(cambio, (int)Variables.getNLabelVar(cambio));\r\n res.setSup(evalua[Variables.getNVars()-1]);\r\n \r\n // If there is improvement, set return value to true\r\n retValue = true;\r\n \r\n }\r\n } // End while\r\n\r\n for(int i=0; i<Variables.getNVars(); i++){\r\n if(solucion.getCromElem(i)==Variables.getNLabelVar(i))\r\n control++;\r\n }\r\n\r\n // Store the new rule if it was improved\r\n if ((retValue==true)&&(control!=Variables.getNVars())){\r\n\r\n for (int i=0; i<Variables.getNVars(); i++)\r\n poblac.setCromElem(best, i, solucion.getCromElem(i));\r\n\r\n // Mark the rule as not evaluated\r\n poblac.setIndivEvaluated(best,false);\r\n }\r\n \r\n return retValue;\r\n\r\n }", "boolean isKeepSolutions();", "@Override\n protected long getTestSolution() {\n return 100024;\n }", "public static void other() {\n // This is how to generate test data for the grid. (Use the VisibilityGraph algorithm to generate optimal path lengths)\n// ArrayList<Point> points = ReachableNodes.computeReachable(gridGraph, 5, 5);\n// System.out.println(points.size());\n//\n// generateRandomTestDataAndPrint(gridGraph);\n\n //This is how to conduct a running time / path length test for tha algorithm:\n// TestResult test1 = testAlgorithm(gridGraph, sx, sy, ex, ey, 1, 1);\n// System.out.println(test1);\n// TestResult test2 = testAlgorithm(gridGraph, sx, sy, ex, ey, 30, 25);\n// System.out.println(test2);\n }", "@Test\n\tpublic void testEvilPuzzleGeneration() {\n\t}", "@Test\n public void TEST_FR_SELECT_DIFFICULTY_MAP() {\n Map easyMap = new Map(\"Map1/Map1.tmx\", 1000, \"easy\");\n easyMap.createLanes();\n Map mediumMap = new Map(\"Map1/Map1.tmx\", 1000, \"medium\");\n mediumMap.createLanes();\n Map hardMap = new Map(\"Map1/Map1.tmx\", 1000, \"hard\");\n hardMap.createLanes();\n\n assertTrue((countObstacles(hardMap) >= countObstacles(mediumMap)) && (countObstacles(mediumMap) >= countObstacles(easyMap)));\n assertTrue((countPowerups(hardMap) <= countPowerups(mediumMap)) && (countPowerups(mediumMap) <= countPowerups(easyMap)));\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(groups = { \"Interactive\" })\n public void troubleCases() {\n String defaultBlocks = \"[[1,1,1,\\\"Green\\\",[\\\"S\\\"]],[1,1,2,\\\"Green\\\",[]],[1,1,3,\\\"Green\\\",[]],[1,1,4,\\\"Green\\\",[]]]\";\n ContextValue context = getContext(defaultBlocks);\n LogInfo.begin_track(\"troubleCases\");\n runFormula(executor, \"(:s (: select *) (: select (or (call veryx top this) (call veryx bot this))))\", context,\n selectedSize(2));\n runFormula(executor, \" (: select (or (call veryx top (color green)) (call veryx bot (color green))))\", context,\n selectedSize(2));\n runFormula(executor, \" (: select (and (call veryx top (color green)) (call veryx bot (color green))))\", context,\n selectedSize(0));\n runFormula(executor, \" (: select (call adj top this))\", context, selectedSize(1));\n LogInfo.end_track();\n }", "@Test\n public void testPuzzle3x3Unsolvable() {\n int[][] block = generateBlock(new int[]{1, 2, 3, 4, 6, 5, 7, 8, 0});\n Solver solver = new Solver(new Board(block));\n assertFalse(solver.isSolvable());\n }", "@Test\n\tpublic void testFindFreeFacilityWorkplacesNotAvailible() {\n\t\t// get current date\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.add(Calendar.HOUR, 1);\n\t\t// start is current date + 1\n\t\tDate startDate = cal.getTime();\n\n\t\tcal.add(Calendar.HOUR, 24);\n\t\tDate reservationEndDate = cal.getTime();\n\n\t\tcal.add(Calendar.HOUR, -23);\n\t\tDate findEndDate = cal.getTime();\n\n\t\tdataHelper.createPersistedReservation(\"aID\", Arrays.asList(workplace1.getId(), workplace2.getId()),\n\t\t\t\tstartDate, reservationEndDate);\n\n\t\t// search for 1 workplace\n\t\tRoomQuery query = new RoomQuery(Arrays.asList(new Property(\"WLAN\")), \"\", 1);\n\t\tCollection<FreeFacilityResult> result;\n\t\tresult = bookingManagement.findFreeFacilites(query, startDate, findEndDate, false);\n\n\t\t// should find no room because workplace1 and workplace 2 are not available\n\t\tassertNotNull(result);\n\t\tassertEquals(0, result.size());\n\t}", "@Test\n public void testQuery() throws Exception {\n\n // Create a second requirement on CHECK 1\n EventKey lReq2Event = new EventKey( 4650, 999 );\n EvtEventTable lEvtEvent = EvtEventTable.create( lReq2Event );\n lEvtEvent.setEventSdesc( \"requirement 2 on check 1\" );\n lEvtEvent.setHEvent( StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1.getEventKey() );\n lEvtEvent.setNhEvent( StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1.getEventKey() );\n lEvtEvent.setHistBool( false );\n lEvtEvent.insert();\n\n TaskKey lReq2Task = new TaskKey( lReq2Event );\n SchedStaskTable lSchedStask = SchedStaskTable.create( lReq2Task );\n lSchedStask.setTaskClass( RefTaskClassKey.REQ );\n lSchedStask.insert();\n\n // Associate loose JIC tasks with labour requirements to a check\n StationCapacityData.assignTaskToCheck(\n StationCapacityData.Task.Labour.TASK_WITH_AVAILABLE_LABOUR_ON_DAY_1,\n StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1,\n StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1_REQUIREMENT );\n StationCapacityData.assignTaskToCheck(\n StationCapacityData.Task.Labour.TASK_WITH_UNAVAILABLE_LABOUR_ON_DAY_1,\n StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1,\n StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1_REQUIREMENT );\n StationCapacityData.assignTaskToCheck(\n StationCapacityData.Task.Labour.TASK_WITH_WARNING_LABOUR_ON_DAY_1,\n StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1, lReq2Task );\n\n // Execute the query\n DataSet lDs = execute( StationCapacityData.Location.YOW_LINE, StationCapacityData.DAY_DT_1 );\n\n // Ensure five are returned - the table will have two labour skills for the check, two labour\n // rows for requirement 1 and one labour row for requirement 2\n\n MxAssert.assertEquals( \"Number of retrieved rows\", 5, lDs.getRowCount() );\n\n // Assert that the contents of the 4 rows\n assertRow( lDs, StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1, RefLabourSkillKey.ENG,\n 21.0 );\n assertRow( lDs, StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1, RefLabourSkillKey.LBR,\n 5.0 );\n assertRow( lDs, StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1_REQUIREMENT,\n RefLabourSkillKey.ENG, 12.0 );\n assertRow( lDs, StationCapacityData.Check.CHECK_ON_AIRCRAFT_1_ON_DAY_1_REQUIREMENT,\n RefLabourSkillKey.LBR, 5.0 );\n assertRow( lDs, lReq2Task, RefLabourSkillKey.ENG, 9.0 );\n\n // unassign the jobcards from the requirement\n StationCapacityData.unassignTaskFromCheck(\n StationCapacityData.Task.Labour.TASK_WITH_AVAILABLE_LABOUR_ON_DAY_1 );\n StationCapacityData.unassignTaskFromCheck(\n StationCapacityData.Task.Labour.TASK_WITH_UNAVAILABLE_LABOUR_ON_DAY_1 );\n StationCapacityData.unassignTaskFromCheck(\n StationCapacityData.Task.Labour.TASK_WITH_WARNING_LABOUR_ON_DAY_1 );\n\n // Delete the second requirement\n lSchedStask.delete();\n lEvtEvent.delete();\n }", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "private boolean checkSolutions() {\n\t\tfor (int i = 0; i < population; ++i) {\n\t\t\tif (populationArray.get(i).getFitness() == 0) {\n\t\t\t\tsolution = populationArray.get(i);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Test\r\n public void testDivision() {\r\n Application.loadQuestions();\r\n assertTrue(Application.allQuestions.contains(\"56 / 8 = ?\") || Application.allQuestions.contains(\"56 / 7 = ?\"));\r\n }", "public void testDeletedProblem() throws Exception {\n \n InternalContest contest = new InternalContest();\n\n int numTeams = 2;\n initData(contest, numTeams , 5);\n String [] runsData = {\n\n \"1,1,A,1,No\", //20\n \"2,1,A,3,Yes\", //3 (first yes counts Minutes only)\n \"3,1,A,5,No\", //20\n \"4,1,A,7,Yes\", //20 \n \"5,1,A,9,No\", //20\n \n \"6,1,B,11,No\", //20 (all runs count)\n \"7,1,B,13,No\", //20 (all runs count)\n \n \"8,2,A,30,Yes\", //30\n \n \"9,2,B,35,No\", //20 (all runs count)\n \"10,2,B,40,No\", //20 (all runs count)\n \"11,2,B,45,No\", //20 (all runs count)\n \"12,2,B,50,No\", //20 (all runs count)\n \"13,2,B,55,No\", //20 (all runs count)\n\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team1,0,0\",\n \"1,team2,0,0\"\n };\n\n for (String runInfoLine : runsData) {\n SampleContest.addRunFromInfo(contest, runInfoLine);\n }\n\n Problem probA = contest.getProblems()[0];\n probA.setActive(false);\n contest.updateProblem(probA);\n Problem probA1 = contest.getProblem(probA.getElementId());\n assertEquals(\"probA1 setup\", false, probA1.isActive());\n Problem probA2 = contest.getProblems()[0];\n assertEquals(\"probA2 setup\", false, probA2.isActive());\n confirmRanks(contest, rankData);\n Document document = null;\n\n try {\n DefaultScoringAlgorithm defaultScoringAlgorithm = new DefaultScoringAlgorithm();\n String xmlString = defaultScoringAlgorithm.getStandings(contest, null, log);\n if (debugMode) {\n System.out.println(xmlString);\n }\n // getStandings should always return a well-formed xml\n assertFalse(\"getStandings returned null \", xmlString == null);\n assertFalse(\"getStandings returned empty string \", xmlString.trim().length() == 0);\n\n DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();\n document = documentBuilder.parse(new InputSource(new StringReader(xmlString)));\n\n } catch (Exception e) {\n assertTrue(\"Error in XML output \" + e.getMessage(), true);\n e.printStackTrace();\n }\n \n // skip past nodes to find teamStanding node\n NodeList list = document.getDocumentElement().getChildNodes();\n \n int rankIndex = 0;\n \n for(int i=0; i<list.getLength(); i++) {\n Node node = (Node)list.item(i);\n String name = node.getNodeName();\n if (name.equals(\"teamStanding\")){\n String [] standingsRow = fetchStanding (node);\n// Object[] cols = { \"Rank\", \"Name\", \"Solved\", \"Points\" };\n String [] cols = rankData[rankIndex].split(\",\");\n\n if (debugMode) {\n System.out.println(\"SA rank=\"+standingsRow[0]+\" solved=\"+standingsRow[2]+\" points=\"+standingsRow[3]+\" name=\"+standingsRow[1]);\n System.out.println(\" rank=\"+cols[0]+\" solved=\"+cols[2]+\" points=\"+cols[3]+\" name=\"+cols[1]);\n System.out.println();\n System.out.flush();\n }\n \n compareRanking (rankIndex+1, standingsRow, cols);\n rankIndex++;\n } else if(name.equals(\"standingsHeader\")) {\n String problemCount = node.getAttributes().getNamedItem(\"problemCount\").getNodeValue();\n int problemCountInt = Integer.valueOf(problemCount);\n NodeList list2 = node.getChildNodes();\n int foundProblemCount = -1;\n for(int j=0; j<list2.getLength(); j++) {\n Node node2 = (Node)list2.item(j);\n String name2 = node2.getNodeName();\n if (name2.equals(\"problem\")){\n int id = Integer.valueOf(node2.getAttributes().getNamedItem(\"id\").getNodeValue());\n if (id > foundProblemCount) {\n foundProblemCount = id;\n }\n }\n }\n assertEquals(\"problem list max id\",problemCountInt, foundProblemCount);\n assertEquals(\"problemCount\",\"4\", problemCount);\n }\n }\n\n }", "protected abstract boolean isSatisfiedBy(Design design, AUndertaking t);", "@Test\n @WithMockUhUser(username = \"iamtst06\")\n public void optOutTest() throws Exception {\n assertTrue(isInCompositeGrouping(GROUPING, tst[0], tst[5]));\n assertTrue(isInBasisGroup(GROUPING, tst[0], tst[5]));\n\n //tst[5] opts out of Grouping\n mapGSRs(API_BASE + GROUPING + \"/optOut\");\n }", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }", "public int[][] doHard(int[][] mainArray, int[] forced, ArrayList<ArrayList<Integer>> forbidden, ArrayList<String> tooNear, String errorString) {\r\n\t\t\r\n\t\tSet<Integer> forbiddenSet = new HashSet<Integer>();\r\n\t\tSet<Integer> forcedSet = new HashSet<Integer>();\r\n\t\t\r\n\t\tfor (int counter = 0; counter < 8; counter++) {\r\n\t\t\tforcedSet.add(forced[counter]);\r\n\t\t\tfor (int counter1 = 0; counter< forbidden.get(counter).size();counter++) {\r\n\t\t\t\tforbiddenSet.add(forbidden.get(counter).get(counter1));\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (forbiddenSet.size() == 1) {\r\n\t\t\tif (forbiddenSet.contains(-1)){\r\n\t\t\t\tfor (ArrayList<Integer> mach : forbidden) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tint machIndex = forbidden.indexOf(mach);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (mach.size() == 8) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tOutputWriter.writeFile(forced, 0, \"No valid solution possible!\");\r\n\t\t\t\t\t\tSystem.exit(0);\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\tfor (int forbiddenTask : mach)\r\n\t\t\t\t\t\tforbidden(mainArray, forbiddenTask, machIndex, forced);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}else {\r\n\t\t\t\tOutputWriter.writeFile(forced, 0, \"No valid solution possible!\");\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tfor (ArrayList<Integer> mach : forbidden) {\r\n\t\t\t\t\r\n\t\t\t\tint machIndex = forbidden.indexOf(mach);\r\n\t\t\t\t\r\n\t\t\t\tif (mach.size() == 8) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tOutputWriter.writeFile(forced, 0, \"No valid solution possible!\");\r\n\t\t\t\t\tSystem.exit(0);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfor (int forbiddenTask : mach)\r\n\t\t\t\t\tforbidden(mainArray, forbiddenTask, machIndex, forced);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (forcedSet.size() == 1) {\r\n\t\t\tif (forcedSet.contains(-1)) {\r\n\t\t\t\tfor (int counter = 0; counter < forced.length; counter++) {\r\n\t\t\t\t\tforcedPartial(mainArray, forced, forced[counter], counter);\t\r\n\t\t\t\t}\r\n\t\t\t}else {\r\n\t\t\t\tOutputWriter.writeFile(forced, 0, \"No valid solution possible!\");\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tfor (int counter = 0; counter < forced.length; counter++) {\r\n\t\t\t\tforcedPartial(mainArray, forced, forced[counter], counter);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n/*\t\t\r\n\t\tfor (ArrayList<Integer> mach : forbidden) {\r\n\t\t\t\r\n\t\t\tint machIndex = forbidden.indexOf(mach);\r\n\t\t\t\r\n\t\t\tif (mach.size() == 8) {\r\n\t\t\t\t\r\n\t\t\t\tOutputWriter.writeFile(forced, 0, \"No valid solution possible!\");\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor (int forbiddenTask : mach)\r\n\t\t\t\tforbidden(mainArray, forbiddenTask, machIndex, forced);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n*/\t\t\t\r\n\t\treturn mainArray;\r\n\t}", "@Override\npublic boolean restrictNeighborhood(Solution solution)\n{\n\n\tSolver solver = solution.getSolver();\n\tint nbTotalVars = solver.getNbIntVars() - 1;\n\n\tint n = nbTotalVars - nbRelaxedVars;\n\tboolean b = false;\n\tIntVar var;\n\tselected.clear();\n\twhile (n > 0) {\n\t\tint index = random.nextInt(nbTotalVars);\n\t\tvar = solver.getIntVarQuick(index);\n\t\tif (var != solver.getObjective() && !selected.contains(index)) {\n\t\t\tif (solution.getIntValue(index) != Solution.NULL) {\n\t\t\t\tsolver.LOGGER.info(\"fix \" + var);\n\t\t\t\tsolver.post(solver.eq(var, solution.getIntValue(index)));\n\t\t\t\tb = true;\n\t\t\t}\n\t\t\tselected.add(index);\n\t\t\tn--;\n\t\t}\n\t}\n\treturn b;\n}", "@Test\n\tpublic void othersShouldNotBeAbleToLookAtLeonardsQueryByItsPrivateId() throws Exception {\n\t\tthis.mockMvc.perform(get(\"/user/me/queries/123456789\").accept(MediaType.APPLICATION_JSON)).\n\t\t\t\tandExpect(status().isForbidden());\n\t}", "@Test\n public void solveTest5() throws ContradictionException {\n\n Set<ConstraintInfo> constraints = new HashSet<>();\n Set<Position> vars = new HashSet<>();\n Position[] varArr = new Position[]{\n this.grid.getVariable(0, 6),\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(3, 6),\n this.grid.getVariable(4, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(6, 6),\n this.grid.getVariable(7, 6),\n this.grid.getVariable(7, 5),\n this.grid.getVariable(7, 4),\n this.grid.getVariable(7, 3),\n this.grid.getVariable(7, 2),\n this.grid.getVariable(6, 2),\n this.grid.getVariable(5, 2),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 0)\n };\n vars.addAll(Arrays.asList(varArr));\n ArrayList<Set<Position>> cArr = new ArrayList<>();\n for (int i = 0; i < 14; i++) cArr.add(new HashSet<>());\n add(cArr.get(0), varArr[0], varArr[1]);\n add(cArr.get(1), varArr[0], varArr[1], varArr[2]);\n add(cArr.get(2), varArr[3], varArr[1], varArr[2]);\n add(cArr.get(3), varArr[3], varArr[4], varArr[2]);\n add(cArr.get(4), varArr[3], varArr[4], varArr[5]);\n add(cArr.get(5), varArr[6], varArr[4], varArr[5]);\n add(cArr.get(6), varArr[6], varArr[7], varArr[5], varArr[8], varArr[9]);\n add(cArr.get(7), varArr[8], varArr[9], varArr[10]);\n add(cArr.get(8), varArr[9], varArr[10], varArr[11], varArr[12], varArr[13]);\n add(cArr.get(9), varArr[12], varArr[13]);\n add(cArr.get(10), varArr[13]);\n add(cArr.get(11), varArr[13], varArr[14]);\n add(cArr.get(12), varArr[13], varArr[14], varArr[15]);\n add(cArr.get(13), varArr[14], varArr[15]);\n\n int[] cVal = new int[] { 1,2,2,1,1,1,2,1,2,1,1,2,3,2 };\n for (int i = 0; i < 14; i++) {\n constraints.add(new ConstraintInfo(cArr.get(i), cVal[i]));\n }\n\n MSModel model = new MSModel(constraints, vars);\n\n Set<Position> expectedBombs = new HashSet<>();\n expectedBombs.addAll(Arrays.asList(\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(5, 0),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 2)\n ));\n Set<Position> expectedNoBombs = new HashSet<>();\n expectedNoBombs.addAll(Arrays.asList(\n this.grid.getVariable(6,2),\n this.grid.getVariable(0,6),\n this.grid.getVariable(3,6),\n this.grid.getVariable(4,6),\n this.grid.getVariable(6,6)\n ));\n\n for (Position pos : vars) {\n if (expectedBombs.contains(pos)) {\n assertTrue(model.hasBomb(pos));\n } else {\n assertFalse(model.hasBomb(pos));\n }\n\n if (expectedNoBombs.contains(pos)) {\n assertTrue(model.hasNoBombs(pos));\n } else {\n assertFalse(model.hasNoBombs(pos));\n }\n }\n\n /*\n 00002x???\n 00003x???\n 00002xxx?\n 0000112x?\n 0000001x?\n 1221112x?\n xxxxxxxx?\n ?????????\n */\n }", "private void defaultMChallengeQuestWorldShouldNotBeFound(String filter) throws Exception {\n restMChallengeQuestWorldMockMvc.perform(get(\"/api/m-challenge-quest-worlds?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restMChallengeQuestWorldMockMvc.perform(get(\"/api/m-challenge-quest-worlds/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(content().string(\"0\"));\n }", "private static void setTooNear(int[][] mainArray, int firstTask, int secondTask, ArrayList<String> tooNearArray, int[] forcedList) {\r\n\t\t\r\n\t for (int count = 0 ; count < 8; count++) {\r\n\t \t\tif(forcedList[count] == firstTask) {\r\n\t \t\t\tif (count == 7) { //if machine 8, forbidden next is machine 1.\r\n\t \t\t\t\tif (isForced(count,firstTask,forcedList)) {\r\n\t \t\t\t\t\tif (isForced(count+1, secondTask, forcedList)) {\r\n\t \t\t\t\t\t\tOutputWriter.writeFile(forcedList, 0, \"No valid solution possible!\");\r\n\t \t\t\t\t\t\tSystem.exit(0);\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t\telse {\tmainArray[0][secondTask] = -1;\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t}\r\n\t \t\t\t}else {\r\n\t \t\t\t\tif (isForced(count,firstTask, forcedList)) {\r\n\t \t\t\t\t\tif (isForced(count+1, secondTask, forcedList)) {\r\n\t \t\t\t\t\t\tOutputWriter.writeFile(forcedList, 0, \"No valid solution possible!\");\r\n\t \t\t\t\t\t\tSystem.exit(0);\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t\telse {\tmainArray[count+1][secondTask] = -1;\r\n\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 }\r\n\t}", "public interface IHardConstraint {\n\t\n\tpublic boolean isConstraintViolated(List<Job> jobs, List<Resource> resources, Plan plan);\n\t\t\n}", "public void TestCaseCheck() {\n\t\t//int[] A = {200,400,499,550,600}; //Test Case 1 No rearrangement\n\t\t//int[] A = {200,300,100,500,400}; //Test Case 2 Arrangement needed\n\t\t//int[] A = {100,200,300,300,400}; //Test Case 3 Duplicates\n\t\t//int[] A = {100}; //Test Case 4 One number only\n\t\t//int[] A = {100,200,300,400,500,600}; //Test Case 5 No rearrangement Even\n\t\t//int[] A = {600,500,400,300,200,100}; //Test Case 6 Rearrangement Even\n\t\t//int[] A = {550,500,450,400,350,300,250,200,150,100}; //Test Case 7 10 numbers\n\t\tint[] A = {-300,-200,0,100,200}; //Test Case 8 Negative Numbers\n\t\t\n\t\t\n\t\tSystem.out.println(\"Brute Foce Median result: \" + BruteForceMedian(A));\n\t\tSystem.out.println(\"Partition Median result: \" + Median(A));\n\t}", "@Test\n public void testGetsAroundLocationIII() throws InvalidIdentifierException, DataSourceException {\n // Get limited number of demands from many locations\n //\n LocationOperations lOps = new LocationOperations();\n ProposalOperations sOps = new ProposalOperations();\n\n Location lFirst = new Location();\n lFirst.setPostalCode(RobotResponder.ROBOT_POSTAL_CODE);\n lFirst.setCountryCode(RobotResponder.ROBOT_COUNTRY_CODE);\n lFirst = lOps.createLocation(lFirst);\n\n final Long ownerKey = 45678L;\n final Long storeKey = 78901L;\n Proposal sFirst = new Proposal();\n sFirst.setLocationKey(lFirst.getKey());\n sFirst.setOwnerKey(ownerKey);\n sFirst.setStoreKey(storeKey);\n sFirst = sOps.createProposal(sFirst);\n\n Location lSecond = new Location();\n lSecond.setPostalCode(\"H1H1H1\");\n lSecond.setCountryCode(RobotResponder.ROBOT_COUNTRY_CODE);\n lSecond = lOps.createLocation(lSecond);\n\n Proposal sSecond = new Proposal();\n sSecond.setLocationKey(lSecond.getKey());\n sSecond.setOwnerKey(ownerKey);\n sSecond.setStoreKey(storeKey);\n sOps.createProposal(sSecond);\n\n Proposal sThird = new Proposal();\n sThird.setLocationKey(lSecond.getKey());\n sThird.setOwnerKey(ownerKey);\n sThird.setStoreKey(storeKey);\n sOps.createProposal(sThird);\n\n sFirst = sOps.getProposal(sFirst.getKey(), null, null);\n sSecond = sOps.getProposal(sSecond.getKey(), null, null);\n sThird = sOps.getProposal(sThird.getKey(), null, null);\n\n List<Location> places = new ArrayList<Location>();\n places.add(lFirst);\n places.add(lSecond);\n\n List<Proposal> selection = sOps.getProposals(places, 2); // Should cut to 2 items\n assertNotNull(selection);\n assertEquals(2, selection.size());\n assertEquals(sFirst.getKey(), selection.get(0).getKey());\n // No more test because it appears sometimes sSecond comes back, sometimes sThird comes back\n // FIXME: re-insert the test for sSecond in the returned list when we're sure the issue related ordering on inherited attribute is fixed.\n }", "@Test\n public void testDAM31201001() {\n // In this test case the where clause is specified in a common sql shared in multiple queries.\n testDAM30505001();\n }", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\n\tpublic void getWorksTest() throws Exception {\n\t}", "@Test\n\tpublic void testHardPuzzleGeneration() {\n\t}", "int getProblemCategory();", "@Test\r\n public void testForCNAEIsNotFull() {\r\n createCNAEIsNotFull();\r\n this.sol = new Solution(this.studentList, this.schoolList, this.studentPreferences, this.schoolPreferences);\r\n assertEquals(solutionForCNAEIsNotFull(), sol.getSolution(),\r\n \"Should work\");\r\n }", "public static void test() {\n\t\t\n\t\tSystem.out.println(\"\\n\\n------------ TESTING CODE ASSIGNMENT 4D --------------\\n\\n\");\n\t\t\n\t\t\n\t\tEntityManagerFactory entityManagerFactory = PersistenceUtil.getEntityManagerFactory();\n\t\tEntityManager entityManager = entityManagerFactory.createEntityManager();\n\t\t\n\t\tentityManager.getTransaction().begin();\n\t\n\t\tSQLInterceptor.resetSelectCount();\n\t\t\n//\t\tSystem.out.println(\"Executing efficient query of task 2b:\");\n\t\tJPQLQueries jpqlQueries = new JPQLQueries(entityManager);\n\t\tjpqlQueries.getComputerUsage();\n\t\t\n\t\tSQLInterceptor.printSelectCount();\n\t\t\n\t\tentityManager.getTransaction().commit();\n\t\tentityManager.close();\n\t}", "String getInter_contestable();", "@Test\r\n public void testMultiplication() {\r\n Application.loadQuestions();\r\n assertTrue(Application.allQuestions.contains(\"7 * 8 = ?\") || Application.allQuestions.contains(\"8 * 7 = ?\"));\r\n }", "@Test\n public void z_topDown_TC02() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n Intrebare intrebare3 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"C\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n assertTrue(appService.exists(intrebare3));\n\n try {\n ccir2082MV.evaluator.model.Test test = appService.createNewTest();\n assertTrue(test.getIntrebari().contains(intrebare));\n assertTrue(test.getIntrebari().contains(intrebare1));\n assertTrue(test.getIntrebari().contains(intrebare2));\n assertTrue(test.getIntrebari().contains(intrebare3));\n assertTrue(test.getIntrebari().size() == 5);\n } catch (NotAbleToCreateTestException e) {\n assertTrue(false);\n }\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n }\n }", "boolean getMissingResults();", "public void testProblemClars() throws Exception {\n\n IContest apiContest = createInstance(\"tpc\");\n \n IProblem[] cats = apiContest.getClarificationCategories();\n \n assertEquals(\"Expecting one category \", 1, cats.length);\n\n Problem prob = sampleContest.getGeneralProblem();\n assertEquals(\"Expecting general \", prob.getDisplayName(), cats[0].getName());\n \n }", "int getProblemType();", "@Test(timeout = 4000)\n public void test31() throws Throwable {\n SystemInUtil.addInputLine(\"%I\");\n SystemInUtil.addInputLine(\"fHFff<U\");\n SystemInUtil.addInputLine(\"znot\");\n JSPredicateForm jSPredicateForm0 = new JSPredicateForm();\n jSPredicateForm0.print();\n assertEquals(0, jSPredicateForm0.size());\n }", "@Test\n public void z_topDown_TC03() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n Intrebare intrebare3 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"C\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n assertTrue(appService.exists(intrebare3));\n\n try {\n ccir2082MV.evaluator.model.Test test = appService.createNewTest();\n assertTrue(test.getIntrebari().contains(intrebare));\n assertTrue(test.getIntrebari().contains(intrebare1));\n assertTrue(test.getIntrebari().contains(intrebare2));\n assertTrue(test.getIntrebari().contains(intrebare3));\n assertTrue(test.getIntrebari().size() == 5);\n } catch (NotAbleToCreateTestException e) {\n assertTrue(false);\n }\n\n Statistica statistica = appService.getStatistica();\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"Literatura\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"Literatura\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"M\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"M\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"A\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"A\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"B\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"B\")==1);\n\n assertTrue(statistica.getIntrebariDomenii().containsKey(\"C\"));\n assertTrue(statistica.getIntrebariDomenii().get(\"C\")==1);\n\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n } catch (NotAbleToCreateStatisticsException e) {\n assertTrue(false);\n }\n }", "@Test\n\tpublic void insideRoomTests() {\n\t\t//Tests middle of room\n\t\tSet<BoardCell> testList = board.getAdjList(3, 11);\n\t\tassertEquals(0, testList.size());\n\t\t//Tests a room space that is next to a walkway space\n\t\ttestList = board.getAdjList(16, 10);\n\t\tassertEquals(0, testList.size());\n\n\t}", "@Test(timeout = 4000)\n public void test102() throws Throwable {\n StringBuilder stringBuilder0 = new StringBuilder(763);\n SQLUtil.addRequiredCondition(\" cannot:crate islance, odle ignorwd.\", stringBuilder0);\n assertEquals(\" cannot:crate islance, odle ignorwd.\", stringBuilder0.toString());\n }", "public void testNonPermanentVariableResolvedOkNoBinding() throws Exception\n {\n resolveAndAssertSolutions(\"[[g(x), h(x), (f :- g(X), h(Y))], (?- f), [[]]]\");\n }", "@Override\n protected boolean stoppingCriteriaSatisfied(KPMPSolution generatedSolution, RandomStepFunction stepFunction) {\n numberOfIterations++;\n numberOfIterationsWithoutImprovement++;\n KPMPSolutionChecker solutionChecker = new KPMPSolutionChecker();\n int crossingsOnOriginalPage = solutionChecker.getCrossingNumberOfEdge(bestSolution.getSpineOrder(), bestSolution.getEdgePartition(), originalPageIndex, edge);\n int crossingsOnNewPage = solutionChecker.getCrossingNumberOfEdge(generatedSolution.getSpineOrder(), generatedSolution.getEdgePartition(), newPageIndex, edge);\n if (crossingsOnNewPage < crossingsOnOriginalPage) {\n bestSolution = generatedSolution;\n numberOfIterationsWithoutImprovement = 0;\n\n crossingNumber = crossingNumber - (crossingsOnOriginalPage - crossingsOnNewPage);\n }\n return numberOfIterations >= Main.localSearchIterationLimit || numberOfIterations >= bestSolution.getEdgePartition().size() * bestSolution.getNumberOfPages() || numberOfIterationsWithoutImprovement >= Main.iterationMultiplier || ((System.nanoTime() - Main.START) / 1000000) >= (Main.secondsBeforeStop * 1000) || numberOfIterations >= Main.localSearchIterationLimit;\n }", "@Test\n public void test_get_scenario_names(){\n try {\n TestData X = new TestData(\"project2.opt\");\n Collection<String> x = X.project.get_scenario_names();\n assertEquals(1,x.size());\n assertTrue(x.contains(\"scenarioA\"));\n assertFalse(x.contains(\"scenarioB\"));\n } catch (Exception e) {\n fail(e.getMessage());\n }\n }", "static boolean isSafe(int x, int y, int sol[][]) {\n return (x >= 0 && x < N && y >= 0 &&\n y < N && sol[x][y] == -1);\n }", "@Test\n\t\t\tpublic void besidesRoomTests() {\n\t\t\t\t//Testing walkway space that is next to the kitchen with no door\n\t\t\t\tSet<BoardCell> testList = board.getAdjList(6, 1);\n\t\t\t\tassertEquals(3, testList.size());\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(5, 1)));\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(6, 0)));\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(6, 2)));\n\t\t\t\t//Testing walkway space that is next to two kitchen spaces with no door\n\t\t\t\ttestList = board.getAdjList(6, 20);\n\t\t\t\tassertEquals(2, testList.size());\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(5, 20)));\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(6, 19)));\n\t\t\t\t//Testing walkway space that is between two room spaces and an edge\n\t\t\t\ttestList = board.getAdjList(20, 15);\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(19, 15)));\n\t\t\t\tassertEquals(1, testList.size());\n\n\t\t\t}", "public void solution() {\n\t\t\n\t}", "private static void setForbidden(int[][] mainArray, int machine, int forbiddenTask, int[] forcedList) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tint ignoreVal = -1;\r\n\t\tfor (int counter = 0; counter < mainArray.length; counter++) {\r\n\t\t\tif (counter == forbiddenTask) {\r\n\t\t\t\tif (isForced(machine, forbiddenTask, forcedList)) {\r\n\t\t\t\t\tOutputWriter.writeFile(forcedList, 0, \"No valid solution possible!\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tSystem.exit(0);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tmainArray[machine][counter] = ignoreVal;\r\n\t\t\t\t}\r\n\t\t\t}else {\r\n\t\t\t\tmainArray[machine][counter]=mainArray[machine][counter];\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testFindFreeFacility2WorkplacesNotFullyAvailible() {\n\t\t// get current date\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.add(Calendar.HOUR, 1);\n\t\t// start is current date + 1\n\t\tDate startDate = cal.getTime();\n\n\t\tcal.add(Calendar.HOUR, 24);\n\t\tDate reservationEndDate = cal.getTime();\n\n\t\tcal.add(Calendar.HOUR, -23);\n\t\tDate findEndDate = cal.getTime();\n\n\t\tdataHelper.createPersistedReservation(\"aID\", Arrays.asList(workplace1.getId()), startDate,\n\t\t\t\treservationEndDate);\n\n\t\t// search for 2 workplaces\n\t\tRoomQuery query = new RoomQuery(Arrays.asList(new Property(\"WLAN\")), \"\", 2);\n\t\tCollection<FreeFacilityResult> result;\n\t\tresult = bookingManagement.findFreeFacilites(query, startDate, findEndDate, true);\n\n\t\t// should find no room because room1 is not fullyAvailible\n\t\tassertNotNull(result);\n\t\tassertEquals(0, result.size());\n\t}", "public void runIndividualSpreadsheetTests() {\r\n\r\n\t\t// Make a list of files to be analyzed\r\n\t\tString[] inputFiles = new String[] {\r\n//\t\t\t\t\"salesforecast_TC_IBB.xml\",\r\n//\t\t\t\t\"salesforecast_TC_2Faults.xml\",\r\n//\t\t\t\t\t\t\t\"salesforecast_TC_2FaultsHeavy.xml\",\r\n\t\t\t\t\"SemUnitEx1_DJ.xml\",\r\n\t\t\t\t\"SemUnitEx2_1fault.xml\",\r\n\t\t\t\t\"SemUnitEx2_2fault.xml\",\r\n//\t\t\t\t\"VDEPPreserve_1fault.xml\",\r\n//\t\t\t\t\"VDEPPreserve_2fault.xml\",\r\n//\t\t\t\t\t\t\t\"VDEPPreserve_3fault.xml\",\r\n//\t\t\t\t\"AZA4.xml\",\r\n//\t\t\t\t\"Consultant_form.xml\",\r\n//\t\t\t\t\"Hospital_Payment_Calculation.xml\",\r\n//\t\t\t\t\"Hospital_Payment_Calculation_v2.xml\",\r\n//\t\t\t\t\"Hospital_Payment_Calculation_C3.xml\",\r\n//\t\t\t\t\"11_or_12_diagnoses.xml\",\r\n//\t\t\t\t\"choco_loop.xml\",\r\n//\t\t\t\t\"Paper2.xml\",\r\n//\t\t\t\t\"Test_If.xml\",\r\n//\t\t\t\t\"Test_If2.xml\",\r\n\r\n\t\t};\r\n\r\n\t\tscenarios.add(new Scenario(executionMode.singlethreaded, pruningMode.on, PARALLEL_THREADS, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.levelparallel, pruningMode.on, 2, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, 1, CHOCO3));\r\n\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, 2, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, 4, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic, pruningMode.on, 1, CHOCO3));\r\n\t\tscenarios.add(new Scenario(executionMode.heuristic, pruningMode.on, 2, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic, pruningMode.on, 4, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic, pruningMode.on, PARALLEL_THREADS, true));\r\n//\t\tscenarios.add(new Scenario(executionMode.hybrid, pruningMode.on, 1, CHOCO3));\r\n\t\tscenarios.add(new Scenario(executionMode.hybrid, pruningMode.on, 2, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.hybrid, pruningMode.on, 4, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.levelparallel, pruningMode.on, PARALLEL_THREADS, false));\r\n//\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, PARALLEL_THREADS, false));\r\n//\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, PARALLEL_THREADS, false));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic,pruningMode.on,PARALLEL_THREADS*2));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic,pruningMode.on,0));\r\n\r\n//\t\tinputFiles = new String[]{\"VDEPPreserve_3fault.xml\"};\r\n\r\n\r\n\t\t// Go through the files and run them in different scenarios\r\n\t\tfor (String inputfilename : inputFiles) {\r\n\t\t\trunScenarios(inputFileDirectory, inputfilename, logFileDirectory, scenarios);\r\n\t\t}\r\n\t}", "public ArrayDeque<Resource> isFeasible(ElementInstance fe) {\r\n \tif (!stillFeasible)\r\n \t\treturn null;\r\n Iterator<ActivityWorkGroup> iter = workGroupTable.randomIterator();\r\n while (iter.hasNext()) {\r\n \tActivityWorkGroup wg = iter.next();\r\n \tfinal ArrayDeque<Resource> solution = new ArrayDeque<Resource>(); \r\n if (engine.checkWorkGroup(solution, wg, fe)) {\r\n fe.setExecutionWG(wg);\r\n \t\tfe.getElement().debug(\"Can carry out \\t\" + this + \"\\t\" + wg);\r\n return solution;\r\n } \r\n }\r\n // No valid WG was found\r\n stillFeasible = false;\r\n return null;\r\n\t}", "public void testGetValidTrials() {\n exp = new Experiment(\"10\");\n exp.setMinNTrials(5);\n ArrayList<Trial> toSet = this.createTrials();\n exp.setTrials(toSet);\n assertEquals(\"getValidTrials returns wrong amount\", 15, exp.getValidTrials().size());\n assertEquals(\"getValidTrials returns wrong trial\", \"4\", exp.getValidTrials().get(0).getId());\n assertEquals(\"getValidTrials returns wrong trial\", \"14\", exp.getAllTrials().get(exp.getAllTrials().size()-1).getId());\n }", "private boolean testPersistenceManager (final PersistenceManager pm){\n\t\ttry {\n\t\t\tfinal Iterator it = pm.getExtent(Project.class, true).iterator();\n\t\t} catch (Exception e){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void test() {\n Assert.assertEquals(3L, Problem162.solve(/* change signature to provide required inputs */));\n }", "public static void experiment(String name) {\n \tString probName = \"NQueensProblem\";\n \tList<OptimizationAlgorithm> algs = new ArrayList<>();\n int[] ranges = new int[N];\n Random random = new Random(N);\n for (int i = 0; i < N; i++) {\n \tranges[i] = random.nextInt();\n }\n NQueensFitnessFunction ef = new NQueensFitnessFunction();\n Distribution odd = new DiscretePermutationDistribution(N);\n NeighborFunction nf = new SwapNeighbor();\n MutationFunction mf = new SwapMutation();\n CrossoverFunction cf = new SingleCrossOver();\n Distribution df = new DiscreteDependencyTree(.1); \n \n HillClimbingProblem hcp = new GenericHillClimbingProblem(ef, odd, nf);\n GeneticAlgorithmProblem gap = new GenericGeneticAlgorithmProblem(ef, odd, mf, cf);\n ProbabilisticOptimizationProblem pop = new GenericProbabilisticOptimizationProblem(ef, odd, df);\n \n RandomizedHillClimbing rhc = new RandomizedHillClimbing(hcp); \n SimulatedAnnealing sa = new SimulatedAnnealing(1E1, .1, hcp);\n StandardGeneticAlgorithm ga = new StandardGeneticAlgorithm(200, 0, 10, gap);\n MIMIC mimic = new MIMIC(200, 10, pop);\n \n algs.add(rhc);\n algs.add(sa);\n algs.add(ga);\n algs.add(mimic);\n Experiment newExp = new Experiment();\n \n newExp.experiments(algs, ef, name);\n \n // test temperature for SA\n String paramName = \"Temperature\";\n String algName = \"SA\";\n List<Double> params2 = new ArrayList<>();\n List<OptimizationAlgorithm> algsTest = new ArrayList<>();\n for (double i = 1.0; i < 100.5; i+=1.0){\n \tparams2.add(i);\n \tsa = new SimulatedAnnealing(i, .1, hcp);\n \talgsTest.add(sa);\n }\n newExp.optParams(algsTest, ef, paramName, null, params2, algName, probName);\n \n // test cooling rate for SA\n paramName = \"CoolingRate\";\n params2 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (double i = 0.01; i < 0.51; i+=0.005){\n \tparams2.add(i);\n \tsa = new SimulatedAnnealing(1E1, i, hcp);\n \talgsTest.add(sa);\n }\n newExp.optParams(algsTest, ef, paramName, null, params2, algName, probName);\n \n // test populationSize for GA\n paramName = \"populationSize\";\n algName = \"GA\";\n List<Integer> params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 10; i < 1001; i+=10){\n \tparams1.add(i);\n \tga = new StandardGeneticAlgorithm(i, 0, 10, gap);\n \talgsTest.add(ga);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test toMate for GA\n paramName = \"toMate\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 0; i < 100; i+=1){\n \tparams1.add(i);\n \tga = new StandardGeneticAlgorithm(200, i, 10, gap);\n \talgsTest.add(ga);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test toMutate for GA\n paramName = \"toMutate\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 10; i < 1001; i+=10){\n \tparams1.add(i);\n \tga = new StandardGeneticAlgorithm(200, 0, i, gap);\n \talgsTest.add(ga);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test samples for MIMIC\n paramName = \"samples\";\n algName = \"MIMIC\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 100; i < 1101; i += 10){\n \tparams1.add(i);\n \tmimic = new MIMIC(i, 10, pop);\n \talgsTest.add(mimic);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test tokeep for MIMIC\n paramName = \"tokeeep\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 1; i < 101; i+=1){\n \tparams1.add(i);\n \tmimic = new MIMIC(200, i, pop);\n \talgsTest.add(mimic);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n \n // test different algorithms with various NQueensProblems\n // set up algorithms\n algs = new ArrayList<>();\n ga = new StandardGeneticAlgorithm(150, 98, 70, gap);\n algs.add(rhc);\n algs.add(sa);\n algs.add(ga);\n algs.add(mimic);\n // set up different efs\n List<EvaluationFunction> efs = new ArrayList<>();\n for (int i = 0; i < 50; i++){\n \tef = new NQueensFitnessFunction();\n \tefs.add(ef);\n }\n newExp.voteBest(algs, efs, 2000, probName);\n \n }", "public ProblemList getProblems() {return this.problems;}", "@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 }", "public void nonTestCase(boolean isTestAll) { }", "@Test\n\tvoid test() {\n\t\tassertEquals(0, solution1.solution(2147483647));\n\t\tassertEquals(1, solution1.solution(5));\n\t}", "@Test\n\tpublic void testQuery1() {\n\t}" ]
[ "0.5759807", "0.5632411", "0.5592196", "0.55807394", "0.55704653", "0.5568658", "0.54862475", "0.54737324", "0.54440826", "0.5433054", "0.5429019", "0.54279935", "0.54256517", "0.53538674", "0.5329615", "0.532692", "0.53252614", "0.53053427", "0.5287198", "0.52184004", "0.52033865", "0.5167426", "0.5159194", "0.51457775", "0.51398504", "0.5118743", "0.50931007", "0.5092902", "0.50892335", "0.50767285", "0.5070481", "0.50562847", "0.50556767", "0.5052938", "0.50409436", "0.5031966", "0.50234306", "0.5018834", "0.5018621", "0.50161374", "0.5014119", "0.5011344", "0.50092715", "0.5007571", "0.49734777", "0.49655923", "0.49643305", "0.49594706", "0.49541044", "0.49481246", "0.49417657", "0.4937681", "0.4937201", "0.4927478", "0.49227697", "0.49156997", "0.4915241", "0.49120814", "0.48949406", "0.48894718", "0.4886909", "0.48864695", "0.48847812", "0.4879675", "0.48794314", "0.48789668", "0.48783776", "0.4874195", "0.48723477", "0.48699778", "0.4866741", "0.4854951", "0.48539194", "0.48448747", "0.4831112", "0.48269027", "0.48219433", "0.48208338", "0.48170736", "0.48056564", "0.47998616", "0.47961038", "0.47828755", "0.47811976", "0.47794315", "0.47744697", "0.47737762", "0.4771889", "0.47638732", "0.4763381", "0.47610623", "0.47594357", "0.4755869", "0.47538978", "0.47434738", "0.47434428", "0.47407025", "0.47394586", "0.47384313", "0.47371486" ]
0.5123393
25
A method to query a problem based on user input
private void queryProblems(Message msg, String[] parameters) { if(data.isEmpty()) loadData(); // Bounds on the problem number and year number resetParams(); int section = -1; int currentOption = -1; int success = 0; for(int i = 1; i < parameters.length; i++) { if(success == -1) return; String parameter = parameters[i]; switch(currentOption) { case 0: success = restrictYear(msg, parameter, section); currentOption = -1; break; case 1: success = restrictProblem(msg, parameter); currentOption = -1; break; case 2: section = restrictSection(msg, parameter); // If -1, we need to break to avoid errors success = section; currentOption = -1; break; default: if (parameter.matches("-y(ear)?")) { currentOption = 0; } else if (parameter.matches("-p(roblem)?")) { currentOption = 1; } else if(parameter.matches("-s(ection)?")) { currentOption = 2; } else { MessageChannel ch = msg.getChannel(); ch.sendMessage("`Error: Invalid option in query [not -s, -y, or -p]. Query terminated.`").queue(); return; } } } // Check if last command is in error if(success == -1) return; // Assign section if none selected if(section == -1) { section = rng.nextInt(2); lowerYear = LOWER_YEARS[section]; upperYear = UPPER_YEARS[section]; } int problem = getValue(lowerProblem, upperProblem); int year = getValue(lowerYear, upperYear); queryImage(msg, year, problem, section); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String userInput(String question);", "private static String getQuery(String query) {\n\t\tScanner reader = new Scanner(System.in);\n\t\tString state = \"\";\n\t\twhile (true) {\n\t\t\tSystem.out.println(\"Please Type in a \" + query + \":\");\n\t\t\ttry {\n\t\t\t\tstate = reader.nextLine();\n\t\t\t\treturn state;\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tSystem.out.println(\"Invalid Input\");\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) \r\n {\r\n // TODO: Read the input from the user and call produceAnswer with an equation\r\n \tScanner in = new Scanner(System.in);\r\n \tString problem = in.nextLine();\r\n \tin.close();\r\n \tSystem.out.printf(\"Result: %s\" , produceAnswer(problem));\r\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 }", "private static String getInputQuery() throws IOException {\n\n String inputQuery = \"\";\n\n System.out.print(\"Please enter a search term: \");\n BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in));\n inputQuery = bReader.readLine();\n\n if (inputQuery.length() < 1) {\n // Use the string \"YouTube Developers Live\" as a default.\n inputQuery = \"YouTube Developers Live\";\n }\n return inputQuery;\n }", "public void callHelp() {\n System.out.println(\"Enter emergency number: \");\n String emergencyNeed = input.nextLine();\n this.emergencyNeed = emergencyNeed;\n if (emergencyNeed.equals(police)) {\n System.out.println(\"Calling for police!\");\n }\n else if (emergencyNeed.equals(fire)) {\n System.out.println(\"Calling for fire department!\");\n }\n else if (emergencyNeed.equals(emt)) {\n System.out.println(\"Calling for emt!\");\n }\n else {\n System.out.println(\"Invalid emergency number.\");\n }\n }", "public String askSomething(String question, String titel);", "public static void main(String[] args) {\n String query,input;\n int numberOfInputs;\n Scanner scan=new Scanner(System.in);\n numberOfInputs=scan.nextInt();\n for(int i=0;i<numberOfInputs;i++){\n query=scan.next();\n if(query.equals(\"add\")){\n input=scan.next();\n add(input);\n }\n if(query.equals(\"find\")){\n input=scan.next();\n find(input);\n }\n }\n\n }", "public interface Problem {\n\n TransitionModel transitionModel();\n\n Action[] actions();\n\n State startState();\n\n Board goal();\n\n State generateState(State parentState, Action action) throws IllegalMoveException;\n\n int actionCost();\n\n /**\n * Checks by just comparing\n * the String configuration (of the Board)\n *\n * Replaces the string of the agent with\n * the string that represents an empty space\n * since the position of the agent does not matter\n * when checking the goal state\n * @param solution the node to check\n * @return true if it is the goal\n */\n boolean checkGoal(Node solution);\n}", "public static void checkFromUser() {\n\t\tif (askUser(\"Please type y to execute program and any other key to stop\").contentEquals(\"y\")) {\n\t\t\tSystem.out.println(\"Continuing\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Terminating program\");\n\t\t\tSystem.exit(0); \n\t\t}\n\t\tSystem.out.println(\"Calculating the greatest house income, the greatest income after expenditure and greatest savings from the given 3 families\");\n\t}", "public int askWhatAssistants(int assi);", "static public void woundedSurvivor() {\n System.out.println(\"Maybe you could bring me some food and something to defend myself now that i cant move\");\n System.out.println(\"Do you want to accept his mission: Yes or no\");\n Scanner scan = new Scanner(System.in); //Creates a new scanner\n String input = scan.nextLine(); //Waits for input\n if (input.equalsIgnoreCase(\"yes\")) {\n System.out.println(\"You got a mission, please use the show command for more information\");\n allMissions.addMission(jungle, \"Helping the injured survivor\");\n } else if (input.equalsIgnoreCase(\"no\")) {\n System.out.println(\"Come back again if you change your mind\");\n } else {\n System.out.println(\"Come back again if you change your mind\");\n }\n }", "public static void main(String[] args) {\n String problem = \"Herman\";\n\n // Assign string type variable to solution string\n String result = solution(problem);\n\n //Print solution result\n System.out.println(result);\n }", "public int getProblemId(String title) {\n int problemId = -1;\n String query = \"select id from problem where title=? \";\n try (Connection myConn = Database.getConnection();\n PreparedStatement statement = myConn.prepareStatement(query);) {\n statement.setString(1, title);\n try (ResultSet rs = statement.executeQuery();) {\n if (rs.next()) problemId = rs.getInt(\"id\");\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return problemId;\n }", "@Override\n public void execute() {\n List<Game> games = new GameService().findAllGames();\n boolean loop = true;\n Scanner scanner = new Scanner(System.in);\n while (loop) {\n System.out.println(\"Choose a difficulty level (enter the number) :\");\n Arrays.stream(DifficultyType2.values())\n .forEach(difficultyType2 -> System.out.println(difficultyType2.ordinal() + \". \" + difficultyType2.getDescription()));\n System.out.print(\"Your choice --> \");\n try {\n int i = scanner.nextInt();\n if (i < 0 || i > 4) {\n System.err.println(\"Please, enter a correct number\");\n } else {\n Optional<DifficultyType2> optionalDifficultyType2 = Arrays.stream(DifficultyType2.values())\n .filter(difficultyType2 -> difficultyType2.ordinal() == i)\n .findFirst();\n if (optionalDifficultyType2.isPresent()) {\n List<Game> filteredList = games.stream()\n .filter(g -> Difficulty.equalOrMore(g.getDifficulty(), optionalDifficultyType2.get()))\n .collect(Collectors.toList());\n filteredList.forEach(System.out::println);\n loop = false;\n }\n }\n } catch (InputMismatchException e) {\n System.err.println(\"Please, insert a number\");\n }\n// BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n// while(loop) {\n// System.out.println(\"Choose a difficulty level (enter the number) :\");\n// System.out.println(\"1. Very easy\\n2. Easy\\n3. Average\\n4. Difficult\\n5. Very difficult\");\n// System.out.print(\"Your choice --> \");\n// try {\n// boolean levelValidate = false;\n// String level = \"5\";\n// int i = 0;\n// while(!levelValidate) {\n// level = reader.readLine();\n// i = Integer.parseInt(String.valueOf(level.charAt(0)));\n// if (i < 1 || i > 5){\n// System.err.println(\"Please, enter a correct number\");\n// }\n// else{\n// levelValidate = true;\n// }\n// }\n// final int finalI = i-1;\n// DifficultyType[] difficultyTypes = DifficultyType.values();\n// List<Game> filteredList = games.stream()\n// .filter(g -> Difficulty.equalOrMore(g.getDifficulty(), difficultyTypes[finalI]))\n// .collect(Collectors.toList());\n// filteredList.forEach(System.out::println);\n }\n }", "private static void executeProgram() throws IllegalArgumentException {\n\t\twhile(true) {\n\t\t\tcalculateRoot();\n\t\t\tsc = new Scanner(System.in);\n\t\t\tSystem.out.print(\"Do you want to enter another equation? :\");\n\t\t\tString answer = sc.next();\n\t\t\tif(answer.equalsIgnoreCase(\"no\")) {\n\t\t\t\tSystem.out.println(\"Good bye!!!\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) throws SQLException, IOException {\n CONNECTION = getConnection();\n System.out.println(\"Enter the number of the check task\");\n int number = Integer.parseInt(READER.readLine());\n switch (number) {\n case 2:\n exerciseOne();\n break;\n case 3:\n exerciseTwo();\n break;\n case 4:\n exerciseThree();\n break;\n case 5:\n exerciseFive();\n break;\n case 6:\n exerciseSix();\n break;\n case 7:\n exerciseSeven();\n break;\n case 8:\n exerciseEight();\n break;\n case 9:\n exerciseNine();\n break;\n }\n\n }", "void run() {\n Scanner sc = new Scanner(System.in);\r\n int N = sc.nextInt();\r\n while (N-- > 0)\r\n AddSuggestion(sc.next());\r\n\r\n int Q = sc.nextInt();\r\n while (Q-- > 0)\r\n System.out.println(Query(sc.next() )); // subString \r\n \r\n sc.close();\r\n }", "public int askquestion(int J, int M, int X, int Y){\n\t\t//type of 5 shall result questions that are a randomly mixture of addition, multiplication, subtraction, and division problems\n\t\tif(M == 5) {\n\t\t\tM = 1 + rand.nextInt(4);\n\t\t}\n\t\t\t\t\n\t\t\t\t\tswitch (M) {\n\t\t\t\t\t//type of 1 shall limit the program to generating only addition problems\n\t\t case 1: System.out.println(\"Solve this addition problem:\\n\");\n\t\t\t\t\t\t\tSystem.out.println(\"How much is \" + X + \" plus \" + Y + \" equal\");\n\t\t\t\t\t\t\t M = X+Y;\n\t\t break;\n\t\t // type 2 shall limit the program to generating only multiplication problems.\n\t\t case 2: System.out.println(\"Solve this multiplication problem:\\n\");\n\t\t\t\t\t\t\tSystem.out.println(\"How much is \" + X + \" times \" + Y + \" equal\");\n\t\t\t\t\t\t\tM = X*Y;\n\t\t break;\n\t\t //type of 3 shall limit the program to generating only subtraction problems\n\t\t case 3: System.out.println(\"Solve this subtraction problem:\\n\");\n\t\t\t\t\t\t\tSystem.out.println(\"How much is \" + X + \" minus \" + Y + \" equal\");\n\t\t\t\t\t\t\tM = X-Y;\n\t\t break;\n\t\t // type of 4 shall limit the program to generating only division problems\n\t\t case 4: System.out.println(\"Solve this division problem:\\n\");\n\t\t\t\t\t\t\tSystem.out.println(\"How much is \" + X + \" divided by \" + Y + \" equal\");\n\t\t\t\t\t\t\tM = 0;\n\t\t break;}\n\t\t return M;\n\t\t\t\t}", "String ask();", "private static void search_by_name() {\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\r\n\t\t\tSystem.out.println(\"Project Name: \");\r\n\t\t\tString project_name = input.nextLine();\r\n\t\t\r\n\t\t\tString strSelectProject = String.format(\"SELECT * FROM projects INNER JOIN project_statuses ON \"\r\n\t\t\t\t\t+ \"projects.project_id = project_statuses.project_id;\");\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\t\r\n\t\t\tfetch_all_project_info(stmt, project_name, project_rset);\r\n\t\t/**\r\n\t\t * @exception If entered project name cannot be found in the projects table then an SQLException is thrown\r\n\t\t */\t\t\r\n\t\t} catch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t}", "private static void queryBook(){\n\t\tSystem.out.println(\"===Book Queries Menu===\");\n\t\t\n\t\t/*Display menu options*/\n\t\tSystem.out.println(\"1--> Query Books by Author\");\n\t\tSystem.out.println(\"2--> Query Books by Genre\");\n\t\tSystem.out.println(\"3--> Query Books by Publisher\");\n\t\tSystem.out.println(\"Any other number --> Exit To Main Menu\");\n\t\tSystem.out.println(\"Enter menu option: \");\n\t\tint menu_option = getIntegerInput(); //ensures user input is an integer value\n\t\t\n\t\tswitch(menu_option){\n\t\t\tcase 1:\n\t\t\t\tSystem.out.println();\n\t\t\t\tqueryBooksByAuthor();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tSystem.out.println();\n\t\t\t\tqueryBooksByGenre();\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.println();\n\t\t\t\tqueryBooksByPublisher();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}", "public NQueens() {\n\n //Creates a new Scanner which is used for getting input from the console.\n Scanner scanner = new Scanner(System.in);\n\n //Variable for use later.\n String line;\n\n //Simple print to tell the user what we want them to input.\n System.out.print(\"Please enter the number of queens you would like: \");\n\n //This loop will run until the input is \"quit\" or \"exit\". Each time the loop runs it grabs the next line\n //of input from the console and runs the code inside the loop against that.\n while((line = scanner.nextLine()) != null && line != \"quit\" && line != \"exit\") {\n\n //Used to store the n value entered by the user.\n int amount;\n\n try {\n //Parse the string value to an integer.\n amount = Integer.parseInt(line);\n } catch(NumberFormatException e) {\n //Error if the string entered was not a number and ask for input again.\n System.err.println(\"The provided number was not an integer.\");\n System.out.print(\"Please enter the number of queens you would like: \");\n continue;\n }\n\n //Checks that the value of n provided is within the bounds that were specified by the specification.\n if(amount < 11 && amount > 3) {\n\n //Creates a new ProblemCalculator object, passing the value of n that was\n //provided and then telling the calculator to run.\n new ProblemCalculator(amount).run();\n }\n\n //Print out an empty line to keep the console a little cleaner and then ask for another input.\n System.out.println();\n System.out.print(\"Please enter the number of queens you would like: \");\n }\n }", "public static int queryMenuInput(){\n System.out.println(queryMenu);\n String input = sc.nextLine();\n String[] valid = {\"1\",\"2\",\"3\",\"4\"};\n if(Arrays.asList(valid).contains(input)){\n return Integer.parseInt(input);\n } else {\n return -1;\n }\n }", "public<P extends Problem, S extends Solution> S solve(P problem, Class<P> problemClass, Class<S> solutionClass);", "public int readProblemType() {\n\t\t\t\t\tSystem.out.printf(\"What type of arithmetic problem do you want to study:\\n 1:+ \\n 2:* \\n 3:- \\n 4:/ \\n 5:Random \");\n\t\t\t\t\tint j = 0;\n\t\t\t\t\tj = resp.nextInt();\n\t\t\t\t\tswitch (j) {\n\t\t case 1: j = 1; \n\t\t break;\n\t\t case 2: j = 2;\n\t\t break;\n\t\t case 3: j = 3;\n\t\t break;\n\t\t case 4: j = 4;\n\t\t break;\n\t\t case 5: j= 5;\n\t\t \t\tbreak;}\n\t\t return j;\n\t\t\t\t\t\n\t}", "String getAskQuery(String... args);", "public boolean needsProblem();", "public static void main(String[] args) {\n\t\tNQueensProblem nQueen=new NQueensProblem();\n\t\tint board[][]=new int[N][N];\n\t\tnQueen.inputData(board);\n\t\tif(solveQueenProblem(board,0))\n\t\tnQueen.printResult(board);\n\t\telse {\n\t\t\tSystem.out.println(\"Not Exist\");\n\t\t}\n\n\t}", "public static void main(){\n \n \n String question = \"There are 10 types of people in this world, those who understand binary and those who don't.\";\n String answer = \"true\";\n \n Question tfQuest = new Question (question, answer);\n tfQuest.getAnswer();\n \n }", "public void consoleGetOptions(){\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tString input;\n\t\tint diff=0,first=0;\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.print(\"Who starts first (0-Player, 1-Computer): \");\n\t\t\t\tinput=in.readLine();\n\t\t\t\tfirst = Integer.parseInt(input);\n\t\t\t\tif (first<0 || first>1) throw new IllegalArgumentException();\n\t\t\t\tif (first==1) ttt.switchPlayer();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid input\");\n\t\t\t}\n\t\t}while(true);\t\t\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.print(\"Enter AI level (0-Noob, 1-Normal, 2-God Mode): \");\n\t\t\t\tinput=in.readLine();\n\t\t\t\tdiff = Integer.parseInt(input);\n\t\t\t\tif (diff<0 || diff>2) throw new IllegalArgumentException();\n\t\t\t\tttt.setDifficulty(diff);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid input\");\n\t\t\t}\n\t\t}while(true);\t\t\n\t}", "private static String getCountryInput(){\n System.out.println(countryPrompt);\n String s = sc.nextLine();\n while(!query.countryExists(s) && !s.equals(\"x\")){\n System.out.println(\"That country is not available. Please ensure correct spelling and capitalization\");\n System.out.println(countryPrompt);\n System.out.println(\"Enter 'x' to cancel this query\");\n s = sc.nextLine();\n }\n if(s.equals(\"x\")){\n return null;\n } else {\n return s;\n }\n\n }", "public static String getVariable(){\n Scanner kb = new Scanner(System.in);\n String variable = null;\n\n System.out.println(\"Enter the variable you would like to solve for: \");\n variable = kb.nextLine().toLowerCase();\n\n // check to make sure it is a valid variable name\n if( !variable.equals(\"height\") && !variable.equals(\"volume\") && !variable.equals(\"radius\")){\n System.out.println(\"Please enter in a valid variable (i.e. height, volume, or radius)...\");\n getVariable();\n }\n\n return variable;\n }", "private static String getRoomCodeOrQ() {\n Scanner input = new Scanner(System.in);\n System.out.print(\"Enter room code for more details \"\n\t + \"(or (q)uit to exit): \");\n String roomCode = input.next();\n return roomCode;\n }", "public static void main(String[] args) {\n\t\tInputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n\t\tProblemSolver problemSolver = new ProblemSolver();\n\t\tproblemSolver.solveTheProblem(in, out);\t\t\n\t\tout.close();\t\t\n\t}", "private void checkUserInput() {\n }", "public interface SolutionQuery {\n\n Optional<String> getUser();\n\n Optional<String> getTask();\n\n Optional<SolutionStatus> getStatus();\n\n boolean isTest();\n}", "public interface ProblemDefinition {\n\tManifest getInitialState();\n\tString getDescription();\n\tint getBoatSize();\n\tboolean validate(Stack<Node> path);\n}", "void solve(String result);", "public void add(Problem problem);", "private int ask(String input) {\n\n System.out.println(input);\n int p = scan.nextInt();\n if (p < 0 || p > 6) {\n return ask(\"Where would you like to place your next piece?\");\n }\n if (myBoard.getCounters(p) == 6) {\n System.out.println(\"That column is already filled.\");\n return ask(\"Where would you like to place your next piece?\");\n //yay recursion!\n //Also this method probably isn't necessary, but I like it.\n }\n return p;\n }", "public void Query() {\n }", "@Override\n public int ask(String question, ArrayList<Integer> range) {\n int value = 0;\n try {\n value = super.ask(question, range);\n } catch (MenuOutException moe) {\n System.out.println(moe.getMessage());\n } catch (NumberFormatException nfe) {\n System.out.println(\"Введите корректные данные\");\n }\n return value;\n }", "public static void main(String[] args) {\n Scanner ob = new Scanner(System.in);\n Solution solution = null;\n int testcases = ob.nextInt();\n ob.nextLine();\n for (int i = 0; i < testcases; i++) {\n String numsLine = ob.nextLine();\n String[] numsLineParts = numsLine.trim().split(\" \");\n int dimensions = Integer.valueOf(numsLineParts[0]);\n int numOperations = Integer.valueOf(numsLineParts[1]);\n solution = new Solution(dimensions);\n for (int j = 0; j < numOperations; j++) {\n String line = ob.nextLine();\n String[] lineParts = line.split(\" \");\n if (lineParts[0].equals(\"UPDATE\")) {\n solution.update(Integer.valueOf(lineParts[1])-1, Integer.valueOf(lineParts[2])-1, Integer.valueOf(lineParts[3])-1, Integer.valueOf(lineParts[4]));\n }\n if (lineParts[0].equals(\"QUERY\")) {\n solution.query(Integer.valueOf(lineParts[1])-1, Integer.valueOf(lineParts[2])-1, Integer.valueOf(lineParts[3])-1, Integer.valueOf(lineParts[4])-1, Integer.valueOf(lineParts[5])-1, Integer.valueOf(lineParts[6])-1);\n }\n }\n }\n }", "private static void search_by_id() {\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\r\n\t\t\tSystem.out.println(\"Project id: \");\r\n\t\t\tString project_id_str = input.nextLine();\r\n\t\t\r\n\t\t\tString strSelectProject = String.format(\"SELECT * FROM projects INNER JOIN project_statuses ON \"\r\n\t\t\t\t\t+ \"projects.project_id = project_statuses.project_id;\");\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\t\r\n\t\t\tfetch_all_project_info(stmt, project_id_str, project_rset);\r\n\t\t/**\r\n\t\t * @exception If entered project id cannot be found in the projects table then an SQLException is thrown\r\n\t\t */\t\r\n\t\t} catch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t\t\r\n\t}", "@ActionTrigger(action=\"QUERY\")\n\t\tpublic void spriden_Query()\n\t\t{\n\t\t\t\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tclearBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tclearBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tclearBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tenterQuery();\n//\t\t\t\tif ( SupportClasses.SQLFORMS.FormSuccess().not() )\n//\t\t\t\t{\n//\t\t\t\t\t\n//\t\t\t\t\tthrow new ApplicationException();\n//\t\t\t\t}\n\t\t\t}", "Problem readGeneralProblem(ElementId elementId) throws DatabaseException;", "int getProblemType();", "public abstract Rank<String,String> query(String input) throws ClassificationException;", "public boolean canSolve(Class<? extends Problem> problem, Class<? extends Solution> solution);", "String askForData();", "public static void main(String[] args) {\n LinkedList<Ticket> ticketQueue = new LinkedList<>();\n LinkedList<Ticket> resolvedTickets = new LinkedList<>();\n\n Scanner scan = new Scanner(System.in);\n\n while(true){\n\n System.out.println(\"1. Enter Ticket\\n2. Delete Ticket by ID\\n3. Delete Ticket by Issue\\n4. Find Ticket \" +\n \"by Reporter\\n5. Display All Tickets\\n6. View Resolved Tickets\\n7. Quit\");\n Integer task = Integer.parseInt(scan.next());\n\n if (task == 1) {\n //Call addTickets, which will let us enter any number of new tickets\n addTickets(ticketQueue);\n\n } else if (task == 2) {\n //delete a ticket\n // Takes two new arguments - one for a list of matching tickets for a search term, and the list of\n // resolved tickets we'll add to once we delete the ticket.\n deleteTicket(ticketQueue, null, resolvedTickets);\n\n } else if (task == 3) {\n // Ask for the search term and find all matching tickets, then delete from those options.\n System.out.println(\"Enter the search term:\");\n LinkedList<Ticket> matchingTickets = searchDescriptions(ticketQueue);\n deleteTicket(ticketQueue, matchingTickets, resolvedTickets);\n\n } else if (task == 4) {\n // Just displays a list of all tickets opened by a certain employee.\n System.out.println(\"Enter the name of the reporter:\");\n LinkedList<Ticket> matchingTickets = searchByName(ticketQueue);\n printAllTickets(matchingTickets);\n\n } else if (task == 5) {\n // Display all the unresolved tickets.\n printAllTickets(ticketQueue);\n\n } else if (task == 6) {\n // Display all the resolved tickets.\n printAllTickets(resolvedTickets);\n }\n\n else if ( task == 7 ) {\n //Quit. Future prototype may want to save all tickets to a file\n System.out.println(\"Quitting program\");\n break;\n }\n else {\n //this will happen for 3 or any other selection that is a valid int\n //TODO Program crashes if you enter anything else - please fix\n //Default will be print all tickets\n printAllTickets(ticketQueue);\n }\n }\n }", "interface InputField {\r\n\r\n /**\r\n * Since the solve() method must be placed in a class implementing the\r\n * InputField interface, I need a reference to the Console where output,\r\n * solveInfo, tuProlog engine and the ProcessInput thread are placed.\r\n *\r\n * This behaviour will change as soon as there will be no need of\r\n * separate input components for .NET and Java2, i.e. as soon as\r\n * the AltGr bug in Thinlet, preventing the use of italian keycombo\r\n * AltGr + '?' and AltGr + '+' to write '[' and ']', will be solved.\r\n */\r\n void setConsole(ConsoleManager console);\r\n\r\n /**\r\n\t * Get the goal displayed in the input field.\r\n\t * @return The goal displayed in the input field.\r\n\t */\r\n public String getGoal();\r\n\r\n /**\r\n * Add the displayed goal to the history of the requested goals.\r\n */\r\n //public void addGoalToHistory();\r\n\r\n /**\r\n * Enable or disable the possibility of asking for goals to be solved.\r\n *\r\n * @param flag true if the query device has to be enabled, false otherwise.\r\n */\r\n //public void enableSolveCommands(boolean flag);\r\n\r\n}", "Boolean callAskQuery(String name, Map<String, String> params);", "public static void main(String[] args) {\n\t \t\n GestionQuestion question = new GestionQuestion();\t \n String[] tab;\n int alea = question.getRdmNumber(); \n \n Scanner sc = new Scanner(System.in);\n \n \n System.out.println(question.getQuestion());\n System.out.println(\"Duo Carre Hexa\");\n String str = sc.nextLine();\n// while(str.equals(\"Duo\") || str.compareTo(\"Carre\")!=0 || str.compareTo(\"Hexa\")!=0){\n// \tstr = sc.nextLine();\n// \tSystem.out.println(\"Vous avez tapé :\" + str);\n// \tSystem.out.println(\"Duo Carre Hexa\");\n// }\n \n if(str.compareTo(\"Duo\")==0){\n \tSystem.out.println(question.getQuestion());\n \ttab=question.getAleaObjectQuestion(alea).duo();\n \t\n }else if(str.compareTo(\"Carre\")==0){\n \tSystem.out.println(question.getQuestion());\n \ttab=question.getAleaObjectQuestion(alea).carre();\n }else{\n \tSystem.out.println(question.getQuestion());\n \ttab=question.getAleaObjectQuestion(alea).hexa();\n }\n for(int i=0; i<tab.length;i++){\n \tSystem.out.println(tab[i]);\n }\n int nb = sc.nextInt();\n String[] tabReponse;\n tabReponse = question.getAleaObjectQuestion(alea).getQuestionReponse();\n \n if(question.getAleaObjectQuestion(alea).bonneReponse(tabReponse[nb])){\n \tSystem.out.println(\"Bravo !\");\n }\n else{\n \tSystem.out.println(\"Faux !\");\n }\n\t}", "public long query(Date timestamp, String user, String hostname, Long referral, String questionText, InputMode mode);", "public static void main(String[] args)\n\t{\n\t\tScanner in = new Scanner(System.in);\n\t\tStringBuilder answers = new StringBuilder();\n\n\t\tanswers.append(\"PERFECTION OUTPUT\\n\");\n\t\ttry\n\t\t{\n\t\t\tint value;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tvalue = in.nextInt();\n\t\t\t\tif (value == 0) break;\n\n\t\t\t\tanswers.append(solve(value));\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(e);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tanswers.append(\"END OF OUTPUT\");\n\n\t\tSystem.out.println(answers);\n\t}", "public interface QProblem<S extends QState, A extends QAction> {\n\n\t/** Replies the alpha constant used in the QLearning algo.\n\t * \n\t * @return alpha\n\t */\n\tpublic float getAlpha();\n\t\n\t/** Replies the gamma constant used in the QLearning algo.\n\t * \n\t * @return gamma\n\t */\n\tpublic float getGamma();\n\n\t/** Replies the rho constant used in the QLearning algo.\n\t * \n\t * @return rho\n\t */\n\tpublic float getRho();\n\t\n\t/** Replies the nu constant used in the QLearning algo.\n\t * \n\t * @return nu\n\t */\n\t/*public float getNu();\n\t\n\t/** Replies the current state of the problem.\n\t * \n\t * @return the current state of the problem.\n\t */\n\tpublic S getCurrentState();\n\n\t/** Replies a randomly selected state of the problem.\n\t * \n\t * @return a randomly selected state of the problem.\n\t */\n\tpublic S getRandomState();\n\n\t/** Replies all the states of the problem.\n\t * \n\t * @return all the states of the problem.\n\t */\n\tpublic List<S> getAvailableStates();\n\n\t/** Replies all the actions available from the given state.\n\t * \n\t * @param state is the selection state\n\t * @return all the actions for the given <var>state</var>.\n\t */\n\tpublic List<A> getAvailableActionsFor(S state);\n\t\n\t/** \n\t * Evaluate the action executed from the given state and replies\n\t * the feedback.\n\t * \n\t * @param state\n\t * @param action\n\t * @return the feedback\n\t */\n\tpublic QFeedback<S> takedAction();\n\t\n}", "protected abstract String getValidationQuery();", "public String getUserInput(String question) {\r\n System.out.print(question);\r\n return scanner.next();\r\n }", "public static int mainQuery(String x) {\n\t\tif (x.equalsIgnoreCase(\"EXIT\") == true) return 1;\n\t\tif (x.equalsIgnoreCase(\"STU\") == true) return 2;\n\t\tif (x.equalsIgnoreCase(\"FAC\") == true) return 3;\n\t\treturn 0;\n\t}", "public void setupGame() {\r\n // Create the Scanner object for reading input\r\n Scanner keyboard = new Scanner(System.in);\r\n \r\n boolean invalid = true;\r\n \r\n while (invalid) {\r\n System.out.println(\"Select a difficulty: \\n\");\r\n System.out.printf(\"1) Easy%n2) Medium%n3) Hard%n\");\r\n String difficulty = keyboard.nextLine();\r\n\r\n switch (difficulty) {\r\n case \"1\":\r\n invalid = false;\r\n this.grid = new Grid(8,8,8);\r\n this.runGame();\r\n break;\r\n case \"2\":\r\n invalid = false;\r\n this.grid = new Grid(10, 12, 10);\r\n this.runGame();\r\n break;\r\n case \"3\":\r\n invalid = false;\r\n this.grid = new Grid(16, 20, 50);\r\n this.runGame();\r\n break;\r\n default:\r\n System.out.println(\"Please enter a valid choice\");\r\n invalid = true;\r\n break;\r\n }\r\n }\r\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int[] arr = new int[4];\n for (int i = 0; i < 4; i++)\n arr[i] = sc.nextInt();\n \n Q1 q1 = new Q1();\n int[] answer = q1.solution(arr);\n \n for (int i = 0; i < answer.length; i++) {\n System.out.println(answer[i]);\n }\n }", "public int initialAsk(){\n System.out.println(\"Hi, what would you like to do? \");\n System.out.println(\"Please type in the number: \");\n System.out.println(\"1. Add a client to the database \");\n System.out.println(\"2. Add an order to the database \");\n System.out.println(\"3. Display all clients from the database \");\n System.out.println(\"4. Display all orders from the database \");\n System.out.println(\"5. Update the client data \");\n System.out.println(\"6. Update the order data \");\n System.out.println(\"7. Delete the client from a database \");\n System.out.println(\"8. Delete the order from a database \");\n System.out.println(\"9. Find the client\");\n System.out.println(\"10. Find the order\");\n System.out.println(\"11. Finish work/ Close app\");\n return inN.nextInt();\n}", "Question getQuestion();", "private void selectOperator() {\n String query = \"\";\n System.out.print(\"Issue the Select Query: \");\n query = sc.nextLine();\n query.trim();\n if (query.substring(0, 6).compareToIgnoreCase(\"select\") == 0) {\n sqlMngr.selectOp(query);\n } else {\n System.err.println(\"No select statement provided!\");\n }\n }", "String getInput();", "private void gameHelper(int ranNum){\n\t\tif(questionAnsweredCount>=25){\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(\"It is \" + teams[ranNum].getName() + \"'s turn to choose a question\");\n\t\t//find category\n\t\tSystem.out.println(\"Please choose a category you would like to answer: \");\n\t\tint categoryIdx = getCategory();\n\t\t//find points\n\t\tSystem.out.println(\"Please enter the dollar value of the question you wish to answer\");\n\t\tint pointIdx = getPointsIndex();\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t//now check if the question is answer knowing dollar and cat is valid\n\t\tboolean answered = board[categoryIdx][pointIdx].answeredYet();\n\t\tif(!answered){\n\t\t\tint point = points[pointIdx];\n\t\t\tSystem.out.println(board[categoryIdx][pointIdx].getQeustion());\n\t\t\tSystem.out.println(\"Enter your answer. Remember to pose it as a question.\");\n\t\t\tString ans = sc.nextLine();\n\t\t\treadExitCommand(ans); // check if the user wants to exit any point\n\t\t\treadReplayCommand(ans);\n\t\t\tboard[categoryIdx][pointIdx].answerQuestion(ans); //ask Q\n\t\t\tif(!board[categoryIdx][pointIdx].getRight()&&board[categoryIdx][pointIdx].getWarned()){\n\t\t\t\t//not in question format. give one more chance\n\t\t\t\tans = sc.nextLine();\n\t\t\t\treadExitCommand(ans);\n\t\t\t\treadReplayCommand(ans);\n\t\t\t\tboard[categoryIdx][pointIdx].answerQuestion(ans);\n\t\t\t}\n\t\t\tif(board[categoryIdx][pointIdx].getRight()){\n\t\t\t\tSystem.out.println(\"You answered it right! \" + point + \" will be added to your total\");\n\t\t\t\tquestionAnsweredCount+= 10;\n\t\t\t\tteams[ranNum].addDollars(point);\n\t\t\t\tprintDollars();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Wrong Answer!\");\n\t\t\t\tquestionAnsweredCount++; \n\t\t\t\tteams[ranNum].minusDollars(point);\n\t\t\t\tprintDollars();\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Question already answered. Choose it again\");\n\t\t\tgameHelper(ranNum); //same team choose a question again\n\t\t}\n\t\tint nextIdx = (ranNum+1)%(teams.length);\n\t\tgameHelper(nextIdx);\n\t}", "private int restrictProblem(Message msg, String parameter) {\n int[] problems = setProblemRestriction(msg, parameter);\n\n if (problems[0] == ERROR_CODE[0]) {\n return -1;\n }\n\n problemRestriction = true;\n lowerProblem = problems[0];\n upperProblem = problems[1];\n return 0;\n }", "Query query();", "public static void main(String[] args) {\nSystem.out.println(\"enter n\");\n\t\tScanner sc =new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint arr[]=new int[n]; \n\t\tproblem2 pb=new problem2(arr,n);\n\t\tpb.read();\n\t\tpb.display();\n\t\tpb.sort();\n\t\tpb.search();\n\t\t\n\t}", "public static void main(String[] args) {\r\n\t\tint N=1;\r\n\t\tint[][] trust = {};\r\n\t\tSolution sol = new Solution();\r\n\t\tSystem.out.println(sol.findJudge(N, trust));\r\n\t}", "void askDefaultProduction();", "@SuppressWarnings(\"null\")\r\n\tpublic static void main(String[] args) throws SQLException {\r\n\t\tLogger.logMessage(\"------- Program started\");\r\n\t\tSystem.out.println(\"Welcome to the application\");\r\n\t\tSystem.out.println(\"Please, enter your credentials\");\r\n\t\tScanner scanner = new Scanner(System.in);\r\n \r\n\t\tString username = InputHelper.getStringInput(\"Username: \").toLowerCase();\r\n\t\tString password = InputHelper.getStringInput(\"Password: \").toLowerCase();\r\n\t\t\r\n\t\tif (authenticate(username, password)) {\r\n\t\t\tLogger.logMessage(\"user \" + username + \" authenticated succesfully\");\r\n\t\t\tSystem.out.println(\"Welcome \" + username);\r\n\t\t\ttry {\r\n\t\t\t\tConnect.connect(username , password);\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tDBUtil.processException(e);\r\n\t\t\t}\r\n\t\t\tString start = null;\r\n\t\t\twhile (start == null) {\r\n\t\t\t\tString askOne = AskRequests.askLevelOne(scanner);\r\n\t\t\t\tswitch(askOne){\r\n\t\t\t\t\tcase \"M\":\r\n\t\t\t\t\t\tif (admin(username, password)) {\r\n\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" managing the Database\");\r\n\t\t\t\t\t\t\tString manage = null;\r\n\t\t\t\t\t\t\twhile (manage == null) {\r\n\t\t\t\t\t\t\t\tString askManage = AskRequests.askLevelManage(scanner);\r\n\t\t\t\t\t\t\t\tswitch(askManage) {\r\n\t\t\t\t\t\t\t\t\tcase \"A\":\r\n\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" managing Answer's Table\");\r\n\t\t\t\t\t\t\t\t\t\tString answer = null;\r\n\t\t\t\t\t\t\t\t\t\twhile (answer == null) {\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Which operation would you like to perform with the table Answer ?: \");\r\n\t\t\t\t\t\t\t\t\t\t\tString askAnswer = AskRequests.askLevelTwo(scanner);\r\n\t\t\t\t\t\t\t\t\t\t\tswitch (askAnswer) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"C\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Create An Answer\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tnotPossible();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"U\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Update An Answer\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAnswerDAO.update(username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"D\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Delete an answer\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tnotPossible();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"S\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Search an Answer\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tint question_id = InputHelper.getIntegerInput(\"Enter the id of the question you want to search for the answer: \");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAnswerDAO.search(question_id, username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"X\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tanswer = \"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"Q\":\r\n\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" managing Question's Table\");\r\n\t\t\t\t\t\t\t\t\t\tString question = null;\r\n\t\t\t\t\t\t\t\t\t\twhile(question == null) {\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Which operation would you like to perform with the table Question ?: \");\r\n\t\t\t\t\t\t\t\t\t\t\tString askQuestion = AskRequests.askLevelTwo(scanner);\r\n\t\t\t\t\t\t\t\t\t\t\tswitch (askQuestion) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"C\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Create A Question\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tint newKey = QuestionDAO.create(username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAnswerDAO.create(newKey, username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"U\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Update A Question\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tQuestionDAO.update(username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"D\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Delete A Question\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tint oldKey = QuestionDAO.delete(username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAnswerDAO.delete(oldKey, username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"S\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Search A Question\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tint question_id = InputHelper.getIntegerInput(\"Enter the id of the question you want to search: \");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tQuestionDAO.search(question_id, username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"X\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tquestion = \"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"--------Exiting from Question Table Manager\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"T\":\r\n\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" managing Topic's Table\");\r\n\t\t\t\t\t\t\t\t\t\tString topic = null;\r\n\t\t\t\t\t\t\t\t\t\twhile (topic == null) {\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Which operation would you like to perform with the table Question ?: \");\r\n\t\t\t\t\t\t\t\t\t\t\tString askTopic = AskRequests.askLevelTwo(scanner);\r\n\t\t\t\t\t\t\t\t\t\t\tswitch (askTopic) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"C\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Create A Topic\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tnotPossible();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"U\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Update A Topic\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Enter the id of the Question/MCQ Question you want to update: \");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tint key = InputHelper.getIntegerInput(\"Enter the id of the Question/MCQ Question you want to update: \");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tTopicDAO.update(key, username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"D\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Delete A Topic\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tTopicDAO.delete(username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"S\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Search A Topic\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tTopicDAO.search(username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"X\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\ttopic = \"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"--------Exiting from Topic Table Manager\");\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"MQ\":\r\n\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" managing MCQQuestion's Table\");\r\n\t\t\t\t\t\t\t\t\t\tString mcqquestion = null;\r\n\t\t\t\t\t\t\t\t\t\twhile (mcqquestion == null) {\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Which operation would you like to perform with the table MCQQuestion ?: \");\r\n\t\t\t\t\t\t\t\t\t\t\tString askMCQQuestion = AskRequests.askLevelTwo(scanner);\r\n\t\t\t\t\t\t\t\t\t\t\tswitch (askMCQQuestion) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"C\":\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Create A MCQQuestion\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tint newKey = MCQQuestionDAO.create(username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tString next = \"O\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tList <String> lChoice = new ArrayList <String>();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tList <Boolean> lValue = new ArrayList <Boolean>();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\twhile ((lChoice.size() < 4 && lValue.size() > 4) || next.equals(\"O\") ) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (next.equals(\"X\")) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMCQQuestionDAO.delete(newKey, username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tString choice = InputHelper.getStringInput(\"Enter a choice: \");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tBoolean value = InputHelper.getBooleanInput(\"Enter a value \");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (value.toString() == null) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Wrong values entered\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Can not saves theses values\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlChoice.add(choice);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlValue.add(value);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnext = AskRequests.askLevelMCQCreate(scanner);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tMCQChoiceDAO.create(newKey, lChoice, lValue, username, password);\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"U\":\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Update A MCQQuestion\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tMCQQuestionDAO.update(username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"D\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Delete A MCQQuestion\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tint oldKey = InputHelper.getIntegerInput(\"Enter the id of the MCQQuestion you would like to delete :\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tMCQQuestionDAO.delete(oldKey, username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"S\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Search A MCQQuestion\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tint key = InputHelper.getIntegerInput(\"Enter the id of the MCQQuestion you would to search\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tMCQQuestionDAO.search(key, username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"X\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tmcqquestion = \"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"--------Exiting from MCQCQuestion Table Manager\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"C\" :\r\n\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose managing MCQChoice's table\");\r\n\t\t\t\t\t\t\t\t\t\tString mcqchoice = null;\r\n\t\t\t\t\t\t\t\t\t\twhile (mcqchoice == null) {\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Which operation would you like to perform with the table topic ?:\");\r\n\t\t\t\t\t\t\t\t\t\t\tString askMCQChoice = AskRequests.askLevelOne(scanner);\r\n\t\t\t\t\t\t\t\t\t\t\tswitch (askMCQChoice) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"C\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Create A MCQChoice\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tnotPossible();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"U\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Update A MCQChoice\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tint key = InputHelper.getIntegerInput(\"Enter the value of the MCQChoice to update: \");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tMCQChoiceDAO.update(key, username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"D\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Delete A MCQChoice\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tint oldKey = InputHelper.getIntegerInput(\"Enter the id of the choice to delete: \");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tResultSet rs = MCQChoiceDAO.search(oldKey, username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (MCQChoiceDAO.check(rs, oldKey)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMCQChoiceDAO.delete(oldKey, username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Can not delete this choice ; either there is less than 5 choices for the question or the choice is true.\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"S\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" choose Search A MCQChoice\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tint anotherKey = InputHelper.getIntegerInput(\"Enter the id of the question for which you look the choices: \");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tMCQChoiceDAO.search(anotherKey, username, password);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\tcase \"X\" :\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tmcqchoice = \"\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"--------Exiting from MCQChoice Table Manager\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tcase \"X\":\r\n\t\t\t\t\t\t\t\t\t\tmanage = \"\";\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Exiting\");\r\n\t\t\t\t\t\t\t\t\t\tLogger.logMessage(\"--------Exiting from Database Manager\");\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tSystem.out.println(\"Not authorized\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase \"Q\":\r\n\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" performing the quiz\");\r\n\t\t\t\t\t\tSystem.out.println(\"Do you want to read the rules ?: \");\r\n\t\t\t\t\t\tString rule = AskRequests.askBool(scanner);\r\n\t\t\t\t\t\tif (rule.equals(\"Y\")) {\r\n\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" reading the rules\");\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tLogger.logMessage(\"user \" + username + \" not reading the rules\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdouble totalAssociative = 0;\r\n\t\t\t\t\t\tdouble totalOpen = 0;\r\n\t\t\t\t\t\tdouble totalmcq = 0;\r\n\t\t\t\t\t\tboolean quiz = true;\r\n\t\t\t\t\t\tSystem.out.println(\"Would you like to work with topics ?: \");\r\n\t\t\t\t\t\tString work = AskRequests.askBool(scanner);\r\n\t\t\t\t\t\tArrayList <String> topicList = new ArrayList <String>();\r\n\t\t\t\t\t\tswitch (work) {\r\n\t\t\t\t\t\t\tcase \"Y\" :\r\n\t\t\t\t\t\t\t\tString topic = null;\r\n\t\t\t\t\t\t\t\twhile (topic == null) {\r\n\t\t\t\t\t\t\t\t\ttopic = InputHelper.getStringInput(\"Your topic: \");\r\n\t\t\t\t\t\t\t\t\tif (!topic.equals(null) && !topic.equals(\"TOPIC\")) {\r\n\t\t\t\t\t\t\t\t\t\ttopicList.add(topic);\r\n\t\t\t\t\t\t\t\t\t\ttopic = null;\r\n\t\t\t\t\t\t\t\t\t}else if(topic.equals(\"TOPIC\")) {\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\t\t\ttopic = null;\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\tArrayList <ArrayList < ArrayList <String> > > openList = new ArrayList <ArrayList < ArrayList <String> > >();\r\n\t\t\t\t\t\t\t\topenList = OpenQuestion.openQuestionWith(topicList, username, password);\r\n\t\t\t\t\t\t\t\tif (!openList.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\ttotalOpen = OpenQuestion.performWith(openList);\r\n\t\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Can't perform a quiz; there is no question found\");\r\n\t\t\t\t\t\t\t\t\tquiz = false;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tArrayList <ArrayList < ArrayList <ArrayList <String>> > > mcqList = new ArrayList <ArrayList < ArrayList <ArrayList <String>> > >();\r\n\t\t\t\t\t\t\t\tmcqList = MCQQuestion.mcqQuestionWith(topicList, username, password);\r\n\t\t\t\t\t\t\t\tif (!mcqList.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\ttotalmcq = MCQQuestion.performWith(mcqList);\r\n\t\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Can't perform a quiz; there is no question found\");\r\n\t\t\t\t\t\t\t\t\tquiz = false;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault :\r\n\t\t\t\t\t\t\t\tArrayList <ArrayList <String> > openArr = new ArrayList <ArrayList <String> >();\r\n\t\t\t\t\t\t\t\topenArr = OpenQuestion.openQuestionWithout(username, password, 4);\r\n\t\t\t\t\t\t\t\tif (!openArr.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(openArr);\r\n\t\t\t\t\t\t\t\t\ttotalOpen = OpenQuestion.performWithout(openArr);\r\n\t\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Can't perform a quiz; there is no question found\");\r\n\t\t\t\t\t\t\t\t\tquiz = false;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tArrayList <ArrayList <ArrayList <String>> > mcqArr = new ArrayList <ArrayList <ArrayList <String>> >();\r\n\t\t\t\t\t\t\t\tmcqArr = MCQQuestion.mcqQuestionWithout(3, username, password);\r\n\t\t\t\t\t\t\t\tif (!mcqArr.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\ttotalmcq = MCQQuestion.performWithout(mcqArr);\r\n\t\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Can't perform a quiz; there is no question found\");\r\n\t\t\t\t\t\t\t\t\tquiz = false;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (quiz) totalAssociative = (double) AssociativeQuestion.Associative(username, password, 3);\t\t\r\n\t\t\t\t\t\tif (quiz) {\r\n\t\t\t\t\t\t\tdouble total = (totalAssociative + totalOpen + totalmcq) / 3;\r\n\t\t\t\t\t\t\tSystem.out.println(\"Your final grade is: \" + total*100 + \"%.\");\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tSystem.out.println(\"Quiz aborted.\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tcase \"X\":\r\n\t\t\t\t\t\tstart = \"\";\r\n\t\t\t\t\t\tSystem.out.println(\"Exiting\");\r\n\t\t\t\t\t\tLogger.logMessage(\"--------Exiting from the system\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\tSystem.out.println(\"Wrong credentials; not authenticated, exiting\");\r\n\t\t\tLogger.logMessage(\"authentication failure for that user \" + username);\r\n\t\t}\r\n\t\t\r\n\r\n\t\t\r\n\t\tscanner.close();\r\n\t\tLogger.logMessage(\"-------- End of program\");\r\n\r\n\t}", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n Database db = new Database();\n \n while (true) {\n String input = scanner.nextLine();\n if (input.equals(\"Quit\")) {\n break;\n } else if (input.equals(\"Add\")) {\n System.out.print(\"Name: \");\n String name = scanner.nextLine();\n System.out.print(\"Latin Name: \");\n String lname = scanner.nextLine();\n db.add(name, lname);\n } else if (input.equals(\"Observation\")) {\n System.out.print(\"What was observed:? \");\n String name = scanner.nextLine();\n db.addObservant(name);\n } else if (input.equals(\"Show\")) {\n System.out.print(\"What? \");\n String name = scanner.nextLine();\n db.printBird(name);\n } else if (input.equals(\"Statistics\")) {\n db.show();\n }\n \n }\n }", "public String issueGetRequest(String query) {\n URL url;\n String result = \"\";\n\n return \"valid\";\n /**\n * Todo: When server API is up and running uncomment this.\n *\n * try { url = new URL(server + \"?\" + query); BufferedReader br = new\n * BufferedReader(new InputStreamReader(url.openStream())); String\n * strTemp = \"\";\n * \n * while (null != (strTemp = br.readLine())) { result = strTemp; }\n * \n * } catch (Exception e) { e.printStackTrace(); }\n * \n * return result;\n */\n }", "public interface Puzzle {\n public String generatePuzzle();\n\n public String getAnswer();\n}", "private static void generalDetails()\r\n\t{\r\n\t\tSystem.out.println(\"Enter the name of waiter:\");\r\n\t\tname = scan.nextLine();\r\n\t\tSystem.out.println(\"Enter table number:\");\r\n\t\tboolean check = false;\r\n\t\t//while check is false, keep trying to get a valid table number\r\n\t\twhile(check==false)\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\ttableNo = Integer.parseInt(scan.nextLine());\r\n\t\t\t\tcheck = true;\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException e)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Please enter a valid table number!\");\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "public Problem getProblem(int index){\n return problems.getProblem(index);\n }", "@Override\r\n public void getInput() { \r\n \r\n String command;\r\n Scanner inFile = new Scanner(System.in);\r\n \r\n do {\r\n \r\n this.display();\r\n \r\n command = inFile.nextLine();\r\n command = command.trim().toUpperCase();\r\n \r\n switch (command) {\r\n case \"B\":\r\n this.helpMenuControl.displayBoardHelp();\r\n break;\r\n case \"C\":\r\n this.helpMenuControl.displayComputerPlayerHelp();\r\n break;\r\n case \"G\":\r\n this.helpMenuControl.displayGameHelp();\r\n break; \r\n case \"Q\": \r\n break;\r\n default: \r\n new Connect4Error().displayError(\"Invalid command. Please enter a valid command.\");\r\n }\r\n } while (!command.equals(\"Q\")); \r\n }", "public static void main(String[] args) {\n\t\tString[][] relation = {\r\n\t\t\t{\"100\",\"ryan\",\"music\",\"2\"},{\"200\",\"apeach\",\"math\",\"2\"},{\"300\",\"tube\",\"computer\",\"3\"},{\"400\",\"con\",\"computer\",\"4\"},{\"500\",\"muzi\",\"music\",\"3\"},{\"600\",\"apeach\",\"music\",\"2\"}\r\n\t\t};\r\n\r\n\t\tSystem.out.println(solution(relation));\r\n\t}", "public static int facultyQuery(String x){\n\t\tif(x.equalsIgnoreCase(\"EXIT\") == true) return 1;\n\t\tif(x.equalsIgnoreCase(\"ADD\") == true) return 2;\n\t\tif(x.equalsIgnoreCase(\"REMOVE\") == true) return 3;\n\t\tif(x.equalsIgnoreCase(\"FIND\") == true) return 4;\n\t\tif(x.equalsIgnoreCase(\"SCHEDULE\") == true) return 5;\n\t\tif(x.equalsIgnoreCase(\"GRANTS\") == true) return 6;\n\t\treturn 0;\n\t}", "public abstract void solve();", "public static void main(String[] args) {\n\tint n=10;\r\n\tint grade = 3;\r\n\tproblems( n , grade );\r\n\t\r\n\t\r\n}", "static public void main(String[] args){\n\t\tint apples = 1; \n\t\tint bananas = 1;\n\t\tint coconuts = 1;\n\t\tFruitPuzzle fp = new FruitPuzzle();\n\t\tif (fp.test(apples, bananas, coconuts)) {\n\t\t\t//System.out.println(\"Eq result = \" + Integer.toString(apples+bananas+coconuts));\n\t\t\tDebug.printPC(\"\\n Path condition: \");\n\t\t\t//throw new RuntimeException(\"found solution\");\n\t\t}\n\t}", "private void getInput() {\n\t\tSystem.out.println(\"****Welcome to TNEB online Payment*****\");\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter your current unit\");\r\n\t\tunit = scan.nextInt();\r\n\t}", "pb4server.QueryInfoByWorldAskReq getQueryInfoByWorldAskReq();", "private static int userInterface()\n {\n int uinput = 0;\n boolean badInput = true;\n\n System.out.println(\"This program will print a table of x\");\n System.out.println(\"and f(x) for x from 0 to the user\");\n System.out.println(\"inputted integer with f(x) being\");\n System.out.println(\"equal to:\");\n System.out.println(\"x^2 for x < 5\");\n System.out.println(\"x^2 - 3x - 10 for 5 <= x < 10\");\n System.out.println(\"x^2 - 7x - 8 for 10 <= x.\");\n \n Scanner read = new Scanner(System.in);\n System.out.print(\"Enter number of x: \");\n \n while (badInput)\n {\n if (read.hasNextInt())\n {\n uinput = read.nextInt();\n \t \tbadInput = false;\n\n if (uinput <= 0)\n {\n System.out.print(\"Enter a positive integer: \");\n badInput = true;\n }\n }\n else\n {\n \tSystem.out.print(\"Enter a positive integer: \");\n \t \tbadInput = true;\n \t }\n read.nextLine();\n }\n\n return uinput;\n }", "public static void questionnaire() {\n\t\tboolean flag = true;\n\t\tString a = null;\n\t\t//donor's username\n\t\tflag = true;\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tusername = JOptionPane.showInputDialog(null,\"Enter your username: \", \"SIGN UP\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\tif (username.equals(\"null\")) {\n\t\t\t\t\tthrow new NullPointerException();\n\t\t }\n\t\t\t\tflag = false;\n\t\t\t} catch (NullPointerException e) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Please enter a username.\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t flag = true;\n\t\t\t}\t\n\t\t}while (flag);\n\t\ttry {\n\t\t\tResultSet rs = Messages.connect().executeQuery(\"SELECT * FROM Questionnaire \");\n\t\t\twhile (rs.next()) {\n\t\t\t\tint qid = rs.getInt(\"Q_id\");\n\t\t\t\tString r = rs.getString(\"Question\");\n\t\t\t\tdo {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (qid == 1) {\n\t\t\t\t\t\t\tflag = true;\n \t \t\t\t\t\tObject[] opt = {\"Male\", \"Female\"};\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tint g = JOptionPane.showOptionDialog(null,\"Choose your gender: \", \"SIGN UP\", JOptionPane.YES_NO_OPTION,\n\t\t\t\t\t\t\t\t\t\t\tJOptionPane.PLAIN_MESSAGE, null, opt, null);\n\t\t\t\t\t\t\t\t\tif (g == 0) {\n\t\t\t\t\t\t\t\t\t\tgender = \"male\";\n\t\t\t\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t} else if (g == 1){\n\t\t\t\t\t\t\t\t\t\tgender = \"female\";\n\t\t\t\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tthrow new NullPointerException();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (NullPointerException e1) {\n\t\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please choose your gender\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}while (flag);\n\t\t\t\t\t\t\ta = gender;\n\t\t\t\t\t\t} else if (((qid >= 2) && (qid<=12)) || (qid == 14)) {\n\t\t\t\t\t\t\ta = JOptionPane.showInputDialog(null, qid + \". \" + r, \"QUESTIONNAIRE\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\t\t\tif (a.equals(null)) {\n\t\t\t\t\t\t\t\tthrow new NullPointerException();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tint p = JOptionPane.showConfirmDialog(null, qid + \". \" + r, \"QUESTIONNAIRE\", JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\t\t\ta = String.valueOf(p);\n\t\t\t\t\t\t\tif (p == -1) {\n\t\t\t\t\t\t\t\tthrow new NullPointerException();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please insert your answer\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\t\tflag = true;\n\t\t\t\t\t}\n\t\t\t\t} while (flag);\n\t\t\t\tif (checkQuestion(qid, a) == false) {\n\t\t\t\t\t//delete data from data base\n\t\t\t\t\tint d = Messages.connect().executeUpdate(\"DELETE FROM Answers WHERE B_Username ='\" + username + \"'\");\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"We regret to inform you that you are not compatible as a blood donor.\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t} else {\n\t\t\t\t\tinsertAnswers(username, qid, a);\n\t\t\t\t}\n\t\t\t}\n\t\t\trs.close();\n\t\t\tMessages.connect().close();\n\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t\t}", "public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\twhile (scanner.hasNextLine()) {\n\t\t\tString input = scanner.nextLine();\n\t\t\tSystem.out.println(solve(input));\n\t\t\t\n\t\t}\n\t\t\n\t}", "public static void findTask(String input) {\n int taskCount = 1;\n ui.showToUser(ui.DIVIDER, \"Here are the matching tasks in your list:\");\n for (Task task : Tasks) {\n if (task.getDescription().contains(input)){\n ui.showToUser(taskCount + \".\" + task.toString());\n taskCount++;\n }\n }\n ui.showToUser(ui.DIVIDER);\n }", "private static void viewRooms() \n {\n String option, roomCode;\n\n displayMyRooms(\" \");\n\n Scanner input = new Scanner(System.in);\n\n System.out.print(\"Type (v)iew [room code] or \"\n + \"(r)eservations [room code], or (q)uit to exit: \");\n \n option = input.next().toLowerCase();\n \n while (!option.equals(\"q\"))\n {\n if (option.equals(\"v\") || option.equals(\"r\"))\n {\n System.out.print(\"Enter a room code: \");\n roomCode = \" '\" + input.next().toUpperCase() + \"'\";\n\n if(option.equals(\"v\"))\n displayDetailedRooms(roomCode);\n else\n displayDetailedReservations(\"WHERE ro.RoomId = \" + roomCode);\n }\n\n System.out.print(\"Type (v)iew [room code] or \"\n + \"(r)eservations [room code], or (q)uit to exit: \");\n \n option = input.next().toLowerCase();\n }\n \n }", "public QuestInterface getQuest(int q) throws IllegalArgumentException {\n\t\tfor (QuestInterface quest : this.getQuests()) {\n\t\t\tif (quest.getQuestId() == q) {\n\t\t\t\treturn quest;\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalArgumentException(\"No quest found\");\n\t}", "public static void launch(Scanner userinput) {\n int userint; //initializes the variable before hand so it can be modified to catch exception without compile issues\n userint = userinput.nextInt();//handled to take int for the function poschecker\n methods.poschecker(userint);//function to validate if its positive\n }", "private static int HQmenu() {\n\t\tlogger.info(\"Entering HQmenu method -->\");\n\t\tint choice = 0;\n\t\tboolean ok;\n\t\tdo {\n\t\t\tok = true;\n\t\t\tSystem.out.println(\"Money Service HQ\");\n\t\t\tSystem.out.println(\"----------------\");\n\t\t\tSystem.out.println(\"What would you like to do?\");\n\t\t\tSystem.out.println(\"1 - Register a new exchange office\");\n\t\t\tSystem.out.println(\"2 - Get statistics for registered offices\");\n\t\t\tSystem.out.println(\"0 - Exit the HQ application\");\n\n\t\t\tSystem.out.print(\"Enter your choice: \");\n\t\t\tString userChoice = CLIHelper.input.next();\n\n\t\t\ttry {\n\t\t\t\tchoice = Integer.parseInt(userChoice);\n\t\t\t}catch(NumberFormatException e) {\n\t\t\t\tlogger.log(Level.WARNING, \"choice: \" + choice + \" made exception! \" + e);\n\t\t\t\tSystem.out.format(\"Your choice %s is not accepted!\\n\", userChoice);\n\t\t\t\tok = false;\n\t\t\t}\n\t\t}while(!ok);\n\n\t\tlogger.info(\"Exiting HQmenu method <--\");\n\t\treturn choice;\n\t}", "private int insertSearchMenuAnswer()\n {\n boolean valid = false;\n String answer = \"\";\n Scanner content = new Scanner(System.in);\n \n while (!valid)\n {\n menu.searchOptions();\n answer = content.nextLine().trim();\n valid = validation.integerValidation(answer, 1, 3);\n }\n \n int ans = Integer.parseInt(answer);\n return ans;\n }", "@Override\r\n\tpublic void solve() {\n\t\t\r\n\t}", "public static void main(String[] args) throws Exception {\n Scanner scn = new Scanner(System.in);\n int n = scn.nextInt();\n int[][] mat = new int[n][n];\n\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n mat[i][j] = scn.nextInt();\n }\n }\n\n int ele = scn.nextInt();\n\n search(mat, ele);\n }", "String askForCity();", "private String theFunctionThatSolvesAllProblems(String input) throws IOException {\n\n first = new MyInt[9];\n second = new MyInt[9];\n third = new MyInt[9];\n myPointers = new MyIntPointer[7];\n\n M = new MyInt();\n D = new MyInt();\n C = new MyInt();\n L = new MyInt();\n X = new MyInt();\n V = new MyInt();\n I = new MyInt();\n\n hasI = false;\n hasX = false;\n hasC = false;\n hasM = false;\n hasV = false;\n hasL = false;\n hasD = false;\n\n firstLength = 0;\n secondLength = 0;\n thirdLength = 0;\n\n initializeEquation(input);\n\n return arabic();\n\n }" ]
[ "0.61423576", "0.5864194", "0.5753262", "0.5723401", "0.56442285", "0.56279784", "0.56262416", "0.55856955", "0.55575085", "0.55325246", "0.55118245", "0.55029655", "0.5493009", "0.5487937", "0.5478411", "0.54781795", "0.54720646", "0.54460365", "0.5435567", "0.54047483", "0.5400942", "0.5396445", "0.53864515", "0.53603286", "0.534558", "0.5337427", "0.5317653", "0.5299077", "0.52911204", "0.5284123", "0.52804387", "0.5279613", "0.5279585", "0.5275283", "0.52580315", "0.52563936", "0.5256171", "0.52546054", "0.5238533", "0.52186465", "0.5203245", "0.52005404", "0.5198473", "0.5193787", "0.5191965", "0.5190156", "0.5178767", "0.51671", "0.51663285", "0.5165585", "0.51563424", "0.51507723", "0.5149004", "0.51309174", "0.51274014", "0.5121043", "0.5116717", "0.5116207", "0.5113121", "0.5111376", "0.51032543", "0.5098982", "0.50968117", "0.50942916", "0.5093813", "0.50892085", "0.5086253", "0.5083441", "0.5073537", "0.5073293", "0.5055416", "0.5049205", "0.50443405", "0.50417733", "0.50386804", "0.50369716", "0.5033705", "0.50307846", "0.50298", "0.502718", "0.5018984", "0.50150603", "0.50147164", "0.50126314", "0.50115687", "0.5008752", "0.5006251", "0.5004543", "0.5002057", "0.49886787", "0.49868494", "0.4986334", "0.4984148", "0.4983133", "0.49806628", "0.49658647", "0.4965263", "0.49641612", "0.4961241", "0.49523196" ]
0.6413918
0
A method to handle commands overall
private void handleCommand(Message msg, String commands) { String[] tokens = commands.split(" "); String command = tokens[0]; switch(command) { case "query": queryProblems(msg, tokens); break; case "help": printHelpMessage(msg, tokens); break; default: // Implement more commands later break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void handleCommands() {\n for (Command c : commands) {\n try {\n if (!game.isPaused()) {\n switch (c) {\n case INTERACT:\n game.interact();\n break;\n case PRIMARY_ATTACK:\n game.shoot(mouse.getX(), mouse.getY());\n break;\n case SECONDARY_ATTACK:\n game.specialAbility(mouse.getX(), mouse.getY());\n break;\n case PAUSE:\n game.pauseGame();\n break;\n }\n }\n } catch (Exception ignored) { }\n }\n }", "public void handleCommand(String command);", "protected abstract DispatchOutcome dispatchCommand(CommandEnvelope cmd);", "private void commandCheck() {\n\t\t//add user command\n\t\tif(cmd.getText().toLowerCase().equals(\"adduser\")) {\n\t\t\t/*\n\t\t\t * permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\t * There will be more user level commands added in version 2, like changing rename to allow a\n\t\t\t * user to rename themselves, but not any other user. Admins can still rename all users.\n\t\t\t */\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\taddUser();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//delete user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"deluser\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tdelUser();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t};\n\t\t}\n\t\t//rename user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"rename\")) {\n\t\t\t//permissions check: if user is an admin, allow the user o chose a user to rename.\n\t\t\t//If not, allow the user to rename themselves only.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\trename(ALL);\n\t\t\t}\n\t\t\telse {\n\t\t\t\trename(SELF);\n\t\t\t}\n\t\t}\n\t\t//promote user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"promote\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tpromote();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//demote user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"demote\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tdemote();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//the rest of the commands are user level, no permission checking\n\t\telse if(cmd.getText().toLowerCase().equals(\"ccprocess\")) {\n\t\t\tccprocess();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"cprocess\")) {\n\t\t\tcprocess();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"opentill\")) {\n\t\t\topenTill();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"closetill\")) {\n\t\t\tcloseTill();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"opendrawer\")) {\n\t\t\topenDrawer();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"sale\")) {\n\t\t\tsale();\n\t\t}\n\t\t//if the command that was entered does not match any command, return an error.\n\t\telse {\n\t\t\terror(CMD_NOT_FOUND);\n\t\t}\n\t}", "private void processCommands() {\n while (!commandQueue.isEmpty()) {\n var msg = commandQueue.remove();\n treatCommand.parseCommand(msg);\n }\n }", "private boolean processCommand(Command command)//Method was given\n {\n if(command.isUnknown())\n {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n\n String commandWord = command.getCommandWord();\n if (commandWord.equals(\"help\"))\n printHelp();\n else if (commandWord.equals(\"go\"))\n goRoom(command);\n else if (commandWord.equals(\"talk\"))\n talkToCharacter(currentRoom);\n else if (commandWord.equals(\"grab\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Grab what?\");\n }\n else\n {\n grabItem(secondWord);\n }\n }\n else if (commandWord.equals(\"eat\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Eat what?\");\n }\n else\n {\n eatItem(secondWord);\n }\n }\n else if (commandWord.equals(\"inventory\")) \n player.getInventory();\n else if (commandWord.equals(\"drop\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Drop what?\");\n }\n else\n {\n dropItem(secondWord);\n }\n }\n else if (commandWord.equals(\"inspect\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Inspect what?\");\n }\n else\n {\n inspectItem(secondWord);\n }\n }\n else if (commandWord.equals(\"quit\"))\n {\n if(command.hasSecondWord())\n System.out.println(\"Quit what?\");\n else\n return true; // signal that we want to quit\n }\n else if (commandWord.equals(\"look\"))\n {\n System.out.println(currentRoom.longDescription());\n }\n return false;\n }", "public abstract void doCommand(String command);", "private void processCommand(Command command) {\n if (command.commandIsUnknown()) {\n System.out.println(\"I don't know what you mean...\");\n } else {\n String commandWord = command.getCommandWord();\n // process all possible commands\n if (commandWord.equals(\"help\")) {\n printHelp();\n } else if (commandWord.equals(\"go\")) {\n if (!command.hasSecondWord()) {\n System.out.println(\"Go where?\");\n } else {\n goDirection(command);\n }\n } else if (commandWord.equals(\"quit\")) {\n if (command.hasSecondWord()) {\n System.out.println(\"Quit what?\");\n } else {\n finished = true;\n }\n }\n }\n }", "protected void processCommand(String command) throws EmptyException {\n if (command.equals(\"a\")) {\n doAddTask();\n } else if (command.equals(\"r\")) {\n doRemoveTask();\n } else if (command.equals(\"p\")) {\n doViewList();\n } else if (command.equals(\"m\")) {\n //doMarkComplete();\n } else if (command.equals(\"n\")) {\n doCount();\n } else if (command.equals(\"s\")) {\n doSave();\n } else if (command.equals(\"c\")) {\n doClear();\n } else {\n System.out.println(\"Selection not valid...\");\n }\n }", "public String processCommand(Command command) //refactored\n {\n boolean wantToQuit = false;\n //System.out.println(\"hitter boolean\");\n commandWord = command.getAction();//fehler\n //System.out.println(command);\n //System.out.println(\"enum == null\" + (commandWord == null));\n String result = \"\";\n //System.out.println(\"heyho\");\n //System.out.println(result);\n switch(commandWord){\n //case UNKNOWN: return \"I don't know what you mean...\"; break;\n \n case HELP: result += printHelp(); break;\n case GO: result += goRoom(command); break;\n case QUIT: return quit(command);//refactored from refactoring\n default: result += \"I don't know what you mean...\";\n }\n return result;\n }", "protected void mainTask() {\n\t logger.log(1, CLASS, \"-\", \"impl\",\n\t\t \"About to read command\");\n\t try { \n\t\tcommand = (COMMAND)connection.receive();\n\t\tlogger.log(1,CLASS, \"-\", \"impl\",\n\t\t\t \"Received command: \"+(command == null ? \"no-command\" : command.getClass().getName()));\n\t } catch (IOException e) {\n\t\tinitError(\"I/O error while reading command:[\"+e+\"]\",command);\n\t\treturn;\n\t } catch (ClassCastException ce) {\n\t\tinitError(\"Garbled command:[\"+ce+\"]\", command);\n\t\treturn;\n\t } \n\t \n\t // 2. Create a handler.\n\t if (command == null) {\n\t\tinitError(\"No command set\", null);\n\t\treturn;\n\t }\n\n\t if (handlerFactory != null) {\n\t\thandler = handlerFactory.createHandler(connection, command);\n\t\tif (handler == null) {\n\t\t initError(\"Unable to process command [\"+command.getClass().getName()+\"]: No known handler\", command);\n\t\t return;\n\t\t}\n\t \n\t\t// 3. Handle the request - handler may send multiple updates to client over long period\n\t\thandler.handleRequest();\n\t }\t \n\t}", "private void processCommand(String command) {\n if (command.equals(\"1\")) {\n insertItem();\n } else if (command.equals(\"2\")) {\n removeItem();\n } else if (command.equals(\"3\")) {\n viewList();\n } else if (command.equals(\"4\")) {\n saveToDoList();\n } else if (command.equals(\"5\")) {\n loadToDoList();\n } else {\n System.out.println(\"Selection not valid...\");\n }\n }", "private void processCommand(String command) {\n switch (command) {\n case \"reserve\":\n doReserve();\n break;\n case \"view\":\n doView();\n break;\n case \"deposit\":\n doDeposit();\n break;\n }\n }", "private void handleCommand(String commands) throws IOException {\n String[] command = commands.split(String.valueOf(Command.DELIMITER));\n String cmdResult;\n if (command[0].equalsIgnoreCase(String.valueOf(Command.PLAYER_JOINED))) {\n // handlePlayerJoined\n handlePlayerJoined(command[1]);\n } else if (command[0].equalsIgnoreCase(String.valueOf(Command.UPDATE_COLOR))) {\n // handleUpdateColor\n handleColorUpdate(Color.fromString(command[1]));\n } else if (command[0].equalsIgnoreCase(String.valueOf(Command.SYNC_BOARD))) {\n // handleSyncBoard\n updateBoard(command);\n } else if (command[0].equalsIgnoreCase(String.valueOf(Command.MAKE_MOVE))) {\n // handleMakeMove\n handleMove();\n\n\n// } else if (command.equals(Character.toString(ProtocolMessages.EXIT))) {\n// in.close();\n// out.close();\n// sock.close();\n } else {\n clientTUI.showMessage(\"Check your parameters\");\n try {\n sendMessage(\"Unknown Command\");\n } catch (ServerUnavailableException e) {\n e.printStackTrace();\n }\n }\n }", "void mainMenuCommand(String command){\n\t\tString[] strArray=command.split(\"\\\\s\");\n\t\tString mainCommand=strArray[0];\n\t\t\n\t\t// if - else if - else loop to check for the particular command and take actions according those commands\n\t\t\n\t\t\n\t\t// Block to print the song details for given song id\n\t\tif(mainCommand.equals(\"song\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tint songID=Integer.parseInt(strArray[1]);\n\t\t\t\t\tsongFile.printSong(songID);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Enter valid song id!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to print the playlist details for given playlist id\n\t\telse if(mainCommand.equals(\"playlist\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tint playlistID=Integer.parseInt(strArray[1]);\n\t\t\t\t\tsongFile.printPlaylist(playlistID);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Enter valid playlist id!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to whole song list or all playlist depending on the user input\n\t\telse if(mainCommand.equals(\"print\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\tif(subCommand.equals(\"song\")){\n\t\t\t\t\t\tsongFile.printAllSongs();\n\t\t\t\t\t}\n\t\t\t\t\telse if(subCommand.equals(\"playlist\")){\n\t\t\t\t\t\tsongFile.printAllplaylist();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid print command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to perform search for songs in the song list with user given attribute and search terms\n\t\telse if(mainCommand.equals(\"search\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length > 2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\t// Get search string from command\n\t\t\t\t\tString songAttributeValue=command.substring(command.indexOf(\"\\\"\")+1,command.lastIndexOf(\"\\\"\")).toLowerCase(); \n\t\t\t\t\tif(subCommand.equals(\"artist\")||subCommand.equals(\"title\")){\n\t\t\t\t\t\tArrayList<Song> list=songFile.searchSong(subCommand, songAttributeValue);\n\t\t\t\t\t\tsongFile.printArrayList(list);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Command!! \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!No search terms\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid search command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to sort the song list on user given song attribute\n\t\telse if(mainCommand.equals(\"sort\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\tif(subCommand.equals(\"artist\")||subCommand.equals(\"title\")){\n\t\t\t\t\t\tsongFile.sortSongs(subCommand);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid sort command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to create the new playlist and go to playlist menu\n\t\telse if(mainCommand.equals(\"create\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tString playlistName=strArray[1];\n\t\t\t\t\tcurrentPlaylistID=songFile.createPlaylist(playlistName);\n\t\t\t\t\t// Flag which takes to playlist menu / sub menu\n\t\t\t\t\tthis.subMenuFlag=true;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid create command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to edit the given playlist id\n\t\telse if(mainCommand.equals(\"edit\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tcurrentPlaylistID=Integer.parseInt(strArray[1]);\n\t\t\t\t\tif(songFile.isPlaylistIdAvailable(currentPlaylistID)){// currentPlaylistID<songFile.playlistID){\n\t\t\t\t\t\tthis.subMenuFlag=true;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Playlist ID!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid edit command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// For all other invalid commands\n\t\telse{\n\t\t\tSystem.out.println(\"Please enter valid command.\");\n\t\t}\n\t\n\t}", "public void process() {\n int command;\n menu();\n while ((command = getCommand()) != EXIT) {\n switch (command) {\n case ADD_CLIENT: addClient();\n break;\n case ADD_PRODUCT: addProduct();\n break;\n case ADD_SUPPLIER: addSupplier();\n break;\n case ASSIGN_PRODUCT: linkProduct();\n break;\n case UNASSIGN_PRODUCT: unlinkProduct();\n break;\n case ACCEPT_SHIPMENT: acceptShipment();\n break;\n case ACCEPT_ORDER: acceptOrder();\n break;\n case PROCESS_ORDER: processOrder();\n break;\n case CREATE_INVOICE: createInvoice();\n break;\n case PAYMENT: payment();\n break;\n case SHOW_CLIENTS: showClients();\n break;\n case SHOW_PRODUCTS: showProducts();\n break;\n case SHOW_SUPPLIERS: showSuppliers();\n break;\n case SHOW_ORDERS: showOrders();\n break;\n case GET_TRANS: getTransactions();\n break;\n case GET_INVOICE: getInvoices();\n break;\n case SAVE: save();\n break;\n case MENU: menu();\n break;\n case TEST: test();\n break;\n }\n }\n }", "public void commandEntered(String cmd)\n {\n String cleaned = StringUtils.cleanWhiteSpace(cmd.trim());\n String args[] = cleaned.split(\" \");\n \tString c = args[0];\n \n Runnable cb = new Runnable() { public void run() { cbEmptyResponse(); } };\n \n \tif (c.equals(\"name\"))\n cb = new Runnable() { public void run() { cbName(); } };\n else if (c.equals(\"version\")) \n cb = new Runnable() { public void run() { cbVersion(); } };\n else if (c.equals(\"genmove\")) \n cb = new Runnable() { public void run() { cbGenMove(); } };\n else if (c.equals(\"all_legal_moves\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"get_absorb_group\"))\n cb = new Runnable() { public void run() { cbGetAbsorbGroup(); } };\n \n \telse if (c.equals(\"shortest_paths\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \telse if (c.equals(\"shortest_vc_paths\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n else if (c.equals(\"compute_dead_cells\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n else if (c.equals(\"vc-build\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n else if (c.equals(\"vc-build-incremental\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n \n \n else if (c.equals(\"solver-find-winning\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } }; \n \n else if (c.equals(\"find_sealed\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"strengthen_vcs\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n \n else if (c.equals(\"book-depths\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"book-sizes\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"book-scores\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \telse if (c.equals(\"book-priorities\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \n else if (c.equals(\"db-get\")) \n cb = new Runnable() { public void run() { cbDBGet(); } };\n \n else if (c.equals(\"vc-connected-to\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-between-cells\"))\n cb = new Runnable() { public void run() { cbBetweenCells(); } };\n else if (c.equals(\"vc-get-mustplay\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-intersection\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-union\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n else if (c.equals(\"eval_twod\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"eval_resist\")) \n cb = new Runnable() { public void run() { cbEvalResist(); } };\n else if (c.equals(\"eval_resist_delta\")) \n cb = new Runnable() { public void run() { cbEvalResistDelta(); } };\n \telse if (c.equals(\"eval_influence\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \n else if (c.equals(\"mohex-show-rollout\")) \n cb = new Runnable() { public void run() { cbMohexShowRollout(); } };\n else if (c.equals(\"quit\")) \n cb = new Runnable() { public void run() { cbEmptyResponse(); } };\n \n sendCommand(cmd, cb);\n }", "private void processCommand(String command) {\n if (command.equals(\"a\")) {\n doAddTask();\n } else if (command.equals(\"r\")) {\n doRemoveTask();\n } else if (command.equals(\"c\")) {\n doMarkTaskAsCompleted();\n } else if (command.equals(\"m\")) {\n doModifyTask();\n } else if (command.equals(\"v\")) {\n doViewAllTasks();\n } else if (command.equals(\"ct\")) {\n doViewAllCompletedTasks();\n } else if (command.equals(\"s\")) {\n saveTasks();\n } else {\n System.out.println(\"Invalid selection, kindly select from the options available.\");\n }\n }", "Command handleExecute(CommandExecute commandExecute);", "public abstract void onCommand(MessageEvent context) throws Exception;", "private void command(){\n out.println(\"Enter command: \");\n String comInput = in.nextLine();\n\n if (comInput.toLowerCase().equals(\"vote\")) {\n voteCommand();\n }else if (comInput.toLowerCase().equals(\"trade\")){\n tradeCommand();\n }else if (comInput.toLowerCase().equals(\"next\")){\n out.println(waitPrint());\n await();\n// nextRound();\n }else if(comInput.toLowerCase().equals(\"logout\")){\n// login = false;\n logout();\n }\n }", "private void cmdHandler(JSONArray parameter, String cmd) {\n switch (cmd) {\n case \"login\":\n signIn(parameter);\n break;\n case \"time\":\n Date d = new GregorianCalendar().getTime();\n clientResponse(d.toString());\n break;\n case \"ls\":\n listFiles(parameter);\n break;\n case \"who\":\n clientResponse(MailboxServer.getUsersAsString());\n break;\n case \"msg\":\n sendMessage(parameter);\n break;\n case \"exit\":\n signOut();\n break;\n }\n }", "public void analyzeCommand(String cmd)\n {\n commandEntered(cmd);\n }", "private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n CommandWord commandWord = command.getCommandWord();\n\n switch (commandWord) \n {\n case UNKNOWN:\n System.out.println(\"I don't know what you mean...\");\n break;\n\n case HELP:\n printHelp();\n break;\n\n case GO:\n goRoom(command);\n break;\n\n //my command expect when i Quit\n case PICK:\n pickItem();\n break;\n \n //drink the redbull\n case DRINK:\n drink();\n break;\n \n //show inventory\n case SHOW:\n showInventory();\n break;\n \n //show objective\n case GOAL:\n remindGoal();\n break;\n\n case QUIT:\n wantToQuit = quit(command);\n break;\n }\n return wantToQuit;\n }", "public void mainCommands() {\n\t\tint inputId = taskController.getInt(\"Please input the number of your option: \", \"You must input an integer!\");\n\t\tswitch (inputId) {\n\t\tcase 1:\n\t\t\tthis.taskController.showTaskByTime();\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tthis.taskController.filterAProject();\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tthis.taskController.addTask();\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tthis.taskController.EditTask();\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tthis.taskController.removeTask();\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tthis.taskController.saveTaskList();\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tSystem.out.println(\"Thank you for coming, Bye!\");\n\t\t\tthis.exit = true;\n\t\t\t// save the task list before exit all the time.\n\t\t\tthis.taskController.saveTaskList();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"This is not a valid option, please input 1 ~ 7.\");\n\t\t\tbreak;\n\t\t}\n\n\t}", "private void processInput(String command) {\r\n\r\n if (command.equals(\"1\")) {\r\n displayListings();\r\n } else if (command.equals(\"2\")) {\r\n listYourCar();\r\n } else if (command.equals(\"3\")) {\r\n removeYourCar(user);\r\n } else if (command.equals(\"4\")) {\r\n checkIfWon();\r\n } else if (command.equals(\"5\")) {\r\n saveCarListings();\r\n } else if (command.equals(\"6\")) {\r\n exitApp = true;\r\n } else {\r\n System.out.println(\"Invalid selection\");\r\n }\r\n }", "protected void channelRead0(ChannelHandlerContext channelHandlerContext, CommandMessage command) throws Exception {\r\n\r\n final Op cmd = command.op;\r\n\r\n // now do the real work\r\n if (this.verbose) {\r\n final StringBuilder log = new StringBuilder(1024);\r\n log.append(cmd);\r\n if (command.element != null) {\r\n log.append(\" \").append(command.element.getKey());\r\n }\r\n log.append(\" \").append(command.key);\r\n logger.info(log.toString());\r\n }\r\n\r\n final Channel channel = channelHandlerContext.channel();\r\n if (cmd == null) {\r\n handleNoOp(command, channel);\r\n } else {\r\n switch (cmd) {\r\n case GET:\r\n handleGet(command, channel);\r\n break;\r\n case GETS:\r\n handleGets(command, channel);\r\n break;\r\n case APPEND:\r\n handleAppend(command, channel);\r\n break;\r\n case PREPEND:\r\n handlePrepend(command, channel);\r\n break;\r\n case DELETE:\r\n handleDelete(command, channel);\r\n break;\r\n case DECR:\r\n handleDecr(command, channel);\r\n break;\r\n case INCR:\r\n handleIncr(command, channel);\r\n break;\r\n case REPLACE:\r\n handleReplace(command, channel);\r\n break;\r\n case ADD:\r\n handleAdd(command, channel);\r\n break;\r\n case SET:\r\n handleSet(command, channel);\r\n break;\r\n case CAS:\r\n handleCas(command, channel);\r\n break;\r\n case STATS:\r\n handleStats(command, channel);\r\n break;\r\n case VERSION:\r\n handleVersion(command, channel);\r\n break;\r\n case QUIT:\r\n handleQuit(channel);\r\n break;\r\n case FLUSH_ALL:\r\n handleFlush(command, channel);\r\n break;\r\n case VERBOSITY:\r\n handleVerbosity(command, channel);\r\n break;\r\n default:\r\n throw new UnknownCommandException(\"unknown command\");\r\n }\r\n }\r\n }", "public void\n\t\t\thandleCommand(/*@ non_null */ String command);", "private void acceptCommands() {\n\t\tScanner input = new Scanner(System.in);\n\t\tInteractiveCommandParser commandParser = new InteractiveCommandParser(\n\t\t\t\tinput, this);\n\t\tcommandParser.readCommands(); // blocking command reader\n\t}", "public abstract boolean doCommand() throws Exception;", "public interface CommandInterface {\n\n\tpublic static class Commands\n\t{\n\t\tpublic static final String ABORT = \"ABOR\";\n\t\tpublic static final String ACCOUNT_INFO = \"ACCT\";\n\t\tpublic static final String AUTHENTICATION_DATA = \"ADAT\";\n\t\tpublic static final String ALLOCATE_DISK_SPACE = \"ALLO\";\n\t\tpublic static final String APPEND = \"APPE\";\n\t\tpublic static final String AUTHENTICATION_MECHANISM = \"AUTH\";\n\t\tpublic static final String GET_AVAILABLE_SPACE = \"AVBL\";\n\t\tpublic static final String CLEAR_COMMAND_CHANNEL = \"CCC\";\n\t\tpublic static final String CHANGE_TO_PARENT_DIRECTORY = \"CDUP\";\n\t\tpublic static final String CONFIDENTIALITY_PROTECTION_COMMAND = \"CONF\";\n\t\tpublic static final String SERVER_IDENTIFICATION = \"CSID\";\n\t\tpublic static final String CHANGE_WORKING_DIRECTORY = \"CWD\";\n\t\tpublic static final String DELETE_FILE = \"DELE\";\n\t\tpublic static final String GET_DIRECTORY_SIZE = \"DSIZ\";\n\t\tpublic static final String PRIVACY_PROTECTED = \"ENC\";\n\t\tpublic static final String SPECIFY_ADDRESS_AND_PORT = \"EPRT\";\n\t\tpublic static final String ENTER_EXTENDED_PASSIVE_MODE = \"EPSV\";\n\t\tpublic static final String GET_FEATURE_LIST = \"FEAT\";\n\t\tpublic static final String HELP = \"HELP\";\n\t\tpublic static final String GET_HOST_BY_NAME = \"HOST\";\n\t\tpublic static final String LANGUAGE_NEGOTIATION = \"LANG\";\n\t\tpublic static final String GET_FILES_LIST = \"LIST\";\n\t\tpublic static final String SPECIFY_LONGADDRESS_AND_PORT = \"LPRT\";\n\t\tpublic static final String ENTER_LONG_PASSIVE_MODE = \"LPSV\";\n\t\tpublic static final String GET_LAST_MODIFICATION_TIME = \"MDTM\";\n\t\tpublic static final String MODIFY_CREATION_TIME = \"MFCT\";\n\t\tpublic static final String MODIFY_FACT = \"MFF\";\n\t\tpublic static final String MODIFY_MODYFICATION_TIME = \"MFMT\";\n\t\tpublic static final String INTEGRITY_PROTECTION = \"MIC\";\n\t\tpublic static final String MAKE_DIRECTORY = \"MKD\";\n\t\tpublic static final String LIST_A_CONTENT = \"MLSD\";\n\t\tpublic static final String PROVIDES_DATA = \"MLST\";\n\t\tpublic static final String SET_TRANSFER_MODE = \"MODE\";\n\t\tpublic static final String LIST_OF_FILE_NAMES = \"NLST\";\n\t\tpublic static final String NO_OPERATION = \"NOOP\";\n\t\tpublic static final String SELECT_OPTIONS = \"OPTS\";\n\t\tpublic static final String AUTHENTICATION_PASSWORD = \"PASS\";\n\t\tpublic static final String ENTER_PASSIVE_MODE = \"PASV\";\n\t\tpublic static final String PROTECTION_BUFFER_SIZE = \"PBSZ\";\n\t\tpublic static final String SPECIFY_PORT = \"PORT\";\n\t\tpublic static final String DATA_CHANNEL_PROTECTION_LEVEL = \"PROT\";\n\t\tpublic static final String PRINT_WORKING_DIRECTORY = \"PWD\";\n\t\tpublic static final String DISCONNECT = \"QUIT\";\n\t\tpublic static final String REINITIALIZE = \"REIN\";\n\t\tpublic static final String RESTART = \"REST\";\n\t\tpublic static final String RETRIEVE_A_COPY = \"RETR\";\n\t\tpublic static final String REMOVE_DIRECTORY = \"RMD\";\n\t\tpublic static final String REMOVE_DIRECTORY_TREE = \"RMDA\";\n\t\tpublic static final String RENAME_FROM = \"RNFR\";\n\t\tpublic static final String RENAME_TO = \"RNTO\";\n\t\tpublic static final String SITE_SPECIFFIC_COMMAND = \"SITE\";\n\t\tpublic static final String SIZE_OF_FILE = \"SIZE\";\n\t\tpublic static final String MOUNT_FILE_STRUCTURE = \"SMNT\";\n\t\tpublic static final String USE_SINGLE_PORT_PASSIVE_MODE = \"SPSV\";\n\t\tpublic static final String GET_STATUS = \"STAT\";\n\t\tpublic static final String ACCEPT_AND_STORE = \"STOR\";\n\t\tpublic static final String STORE_FILE_UNIQUELY = \"STOU\";\n\t\tpublic static final String SET_FILE_TRANSFER_STRUCT = \"STRU\";\n\t\tpublic static final String GET_SYSTEM_TYPE = \"SYST\";\n\t\tpublic static final String GET_THUMBNAIL = \"THMB\";\n\t\tpublic static final String SET_TRANSFER_TYPE = \"TYPE\";\n\t\tpublic static final String AUTHENTICATION_USERNAME = \"USER\";\n\t}\n\t\n\t/**\n\t * Types of transmission.\n\t * @author P.Gajewski\n\t *\n\t */\n\tpublic static class TransmissionTypes\n\t{\n\t\tpublic static final String BINARY = \"I\";\n\t\tpublic static final String ASCII = \"A\";\n\t}\n\n\t/**\n\t * Inner class for responses from server.\n\t * @author P.Gajewski\n\t *\n\t */\n\tpublic static class ServerResonses\n\t{\n\t\t/**\n\t\t * 1xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PossitivePreliminaryReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"100\";\n\t\t\tpublic static final String RESTART_REPLY = \"110\";\n\t\t\tpublic static final String SERVICE_READY = \"120\";\t\n\t\t\tpublic static final String DATA_CONNECTION_ALREADY_OPENED = \"125\";\n\t\t\tpublic static final String FILE_STATUS_OKAY = \"150\";\n\t\t}\n\t\t\n\t\t/**\n\t\t * 2xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PossitiveCompletionReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"200\";\n\t\t\tpublic static final String SYSTEM_STATUS = \"211\";\n\t\t\tpublic static final String DIRECTORY_STATUS = \"212\";\n\t\t\tpublic static final String FILE_STATUS = \"213\";\n\t\t\tpublic static final String HELP_MESSAGE = \"214\";\n\t\t\tpublic static final String NAME_SYSTEM_TYPE = \"215\";\n\t\t\tpublic static final String READY_FOR_NEW_USER = \"220\";\n\t\t\tpublic static final String SERVICE_CLOSING_CONTROL_CONNECTION = \"221\";\n\t\t\tpublic static final String OPEN_DATA_CONNECTION = \"225\";\t\t\t\n\t\t\tpublic static final String CLOSING_DATA_CONNECTION = \"226\";\n\t\t\tpublic static final String PASSIVE_MODE = \"227\";\n\t\t\tpublic static final String LONG_PASSIVE_MODE = \"228\";\n\t\t\tpublic static final String EXTENDED_PASSIVE_MODE = \"229\";\n\t\t\tpublic static final String USER_LOG_IN = \"230\";\n\t\t\tpublic static final String USER_LOG_OUT = \"231\";\n\t\t\tpublic static final String LOGOUT_NOTED = \"232\";\n\t\t\tpublic static final String REQUESTED_OK = \"250\";\n\t\t\tpublic static final String PATHNAME_CREATED = \"257\";\t\t\t\n\t\t}\n\t\t\n\t\t/**\n\t\t * 3xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PositiveIntermediateReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"300\";\n\t\t\tpublic static final String USERNAME_OK_PASSWORD_NEEDED = \"331\";\n\t\t\tpublic static final String NEED_ACCOUNT_FOR_LOGIN = \"332\";\n\t\t\tpublic static final String REQUESTED_FILE_ACTION = \"350\";\n\t\t}\n\t\t\n\t\t/**\n\t\t * 4xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class TransientNegativeCompletionReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"400\";\n\t\t\tpublic static final String SERVICE_NOT_AVAILABLE = \"421\";\n\t\t\tpublic static final String CANT_OPEN_DATA_CONNECTION = \"425\";\n\t\t\tpublic static final String CONNECTION_CLOSED = \"426\";\n\t\t\tpublic static final String INVALID_USERNAME_OR_PASSWORD = \"430\";\n\t\t\tpublic static final String REQUESTED_HOST_UNAVAILABLE = \"434\";\n\t\t\tpublic static final String REQUESTED_FILE_ACTION_NOT_TAKEN = \"450\";\n\t\t\tpublic static final String LOCAL_ERROR = \"451\";\n\t\t\tpublic static final String FILE_BUSY = \"452\";\t\n\t\t}\n\t\t\n\t\t/**\n\t\t * 5xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PermamentNegativeCompletionReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"500\";\n\t\t\tpublic static final String SYNTAX_ERROR = \"501\";\n\t\t\tpublic static final String COMMAND_NOT_IMPLEMENTED = \"502\";\n\t\t\tpublic static final String BAD_SEQUENCE_OF_COMMANDS = \"503\";\n\t\t\tpublic static final String COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER = \"504\";\n\t\t\tpublic static final String NOT_LOGGED_IN = \"530\";\n\t\t\tpublic static final String NEED_ACCOUNT_FOR_STORING_FILES = \"532\";\n\t\t\tpublic static final String POLICY_REQUIRES_SSL = \"534\";\n\t\t\tpublic static final String FILE_NOT_FOUND = \"550\";\n\t\t\tpublic static final String PAGE_TYPE_UNKNOWN = \"551\";\t\t\t\n\t\t\tpublic static final String EXCEEDED_STORAGE_ALLOCATION = \"552\";\n\t\t\tpublic static final String FILE_NAME_NOT_ALLOWED = \"553\";\t\t\n\t\t}\n\t\t\n\t\t/**\n\t\t * 6xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class ProtectedReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"600\";\n\t\t\tpublic static final String INTEGRITY_PROTECTED_REPLY = \"631\";\n\t\t\tpublic static final String CONFIDENTIALITY_AND_INTEGRITY_PROTECTED_REPLY = \"632\";\t\t\t\n\t\t\tpublic static final String CONFIDENTIALITY_PROTECTED_REPLY = \"633\";\t\t\t\n\t\t}\n\t}\n\t\n\t/**\n\t * Language controller.\n\t */\n\tpublic final static LanguageController lc = LanguageController.getInstance();\n\t\n\tpublic void execute(FTPLexer lexer);\n}", "void doCommands() throws IOException\n\t{\n\t\ttry\n\t\t{\n\t\t\tint id = -1;\n\t\t\tif (hasMoreTokens())\n\t\t\t\tid = nextIntToken();\n\t\t\telse\n\t\t\t\tid = propertyGet(BPNUM);\n\n\t\t\t// get the breakpoint\n\t\t\tint at = breakpointIndexOf(id);\n\t\t\tBreakAction a = breakpointAt(at);\n\n\t\t\t// ready it\n\t\t\ta.clearCommands();\n\t\t\ta.setSilent(false);\n\n\t\t\t// now just pull the commands as they come while not end\n\t\t\tString line = null;\n\t\t\tboolean first = true;\n\t\t\tboolean isEnd = false;\n\n\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\targs.put(\"breakpointNumber\", Integer.toString(id)); //$NON-NLS-1$\n\t\t\tout(getLocalizationManager().getLocalizedTextString(\"typeCommandsForBreakpoint\", args)); //$NON-NLS-1$\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\tdisplayCommandPrompt();\n\t\t\t\tline = readLine().trim();\n\t\t\t isEnd = line.equalsIgnoreCase(\"end\"); //$NON-NLS-1$\n\n\t\t\t\tif (!isEnd)\n\t\t\t\t{\n\t\t\t\t\tif (first && line.equalsIgnoreCase(\"silent\")) //$NON-NLS-1$\n\t\t\t\t\t\ta.setSilent(true);\n\t\t\t\t\telse\n\t\t\t\t\t\ta.addCommand(line);\n\t\t\t\t}\n\t\t\t\tfirst = false;\n\t\t\t}\n\t\t\twhile(!isEnd);\n\t\t}\n\t\tcatch(IndexOutOfBoundsException iob)\n\t\t{\n\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\targs.put(\"breakpointNumber\", m_currentToken); //$NON-NLS-1$\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"noBreakpointNumber\", args)); //$NON-NLS-1$\n\t\t}\n\t\tcatch(NumberFormatException nfe)\n\t\t{\n\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\targs.put(\"token\", m_currentToken); //$NON-NLS-1$\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"badBreakpointNumber\", args)); //$NON-NLS-1$\n\t\t}\n\t\tcatch(NullPointerException npe)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"commandFailed\")); //$NON-NLS-1$\n\t\t}\n\t}", "public void getCommand() {\n\t\t\n\t\tSystem.out.println(\"Enter a command:\");\n\t\tString Input = reader.nextLine(); //takes the user's input and places it in String Input\n\t\t\n\t\t//in the collection of commands, will run loop once for each item in that collection and \n\t\t//stores the item it is looking in the variable created\n\t\tfor (Commandable command : Commands) { \n\t\t\t\n\t\t\tif (command.matchCommand(Input)) {\n\t\t\t\t\n\t\t\t\tcommand.doCommand();\n\t\t\t\treturn;\t//this ends the method to break out of the loop\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Command not recognized\");\n\t}", "private void registerCommands() {\n }", "@Override\n\tpublic void handleServerCmd() {\n\t\t\n\t}", "public interface CommandExecutor {\n /**\n * This method parse a commands from string and call it\n *\n * @param sender ource of the commands\n * @param connectionCommand commands\n * @return true if a valid commands, otherwise false\n */\n default boolean onCommand(CommandSender sender, ConnectionCommand connectionCommand) {\n String[] split = connectionCommand.getCommand().split(\" \");\n\n return onCommand(sender, split[0], Arrays.copyOfRange(split, 1, split.length), connectionCommand.getArgs());\n }\n\n /**\n * Executes the given commands, returning its success\n *\n * @param sender ource of the commands\n * @param command Command which was executed\n * @param args Passed commands arguments\n * @param objects Objects\n * @return true if a valid commands, otherwise false\n */\n boolean onCommand(CommandSender sender, String command, String[] args, Object... objects);\n\n}", "@Override\r\n public void execute(Command command) {\n\r\n }", "void subMenuCommand(String command){\n\t\tString[] strArray=command.split(\"\\\\s\");\n\t\tString mainCommand=strArray[0];\n\t\t\n\t\t// if - else if - else loop to check for the particular command and take actions according those commands\n\t\t\n\t\t// Block to delete the given song id from the current playlist\n\t\tif(mainCommand.equals(\"delete\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tint songID=Integer.parseInt(strArray[1]);\n\t\t\t\t\tPlaylist pl=songFile.playlistArray.get(currentPlaylistID);\n\t\t\t\t\tpl.deleteSong(new Integer(songID));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid delete command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to insert the given song id to current playlist\n\t\telse if(mainCommand.equals(\"insert\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tint songID=Integer.parseInt(strArray[1]);\n\t\t\t\t\tif(songFile.isSongIdAvailable(songID)){//songID<songFile.songID){\n\t\t\t\t\t\tPlaylist pl=songFile.playlistArray.get(currentPlaylistID);\n\t\t\t\t\t\tpl.insertSong(new Integer(songID));\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Song with the given ID does not exists!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid insert command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to print the current playlist \n\t\telse if(mainCommand.equals(\"print\")){\n\t\t\tif(strArray.length==1){\n\t\t\t\tsongFile.printPlaylist(currentPlaylistID);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// Block to sort and print the songs of the current playlist by the given song attribute \n\t\telse if(mainCommand.equals(\"sort\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\tif(subCommand.equals(\"artist\") || subCommand.equals(\"title\")){\n\t\t\t\t\t\tsongFile.sortPlaylistSongs(currentPlaylistID, subCommand);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid sort command!!\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// Block to search the playlist for the songs with user given attributes and search terms\n\t\telse if(mainCommand.equals(\"search\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length>2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\t// Get search string from command\n\t\t\t\t\tString songAttributeValue=command.substring(command.indexOf(\"\\\"\")+1,command.lastIndexOf(\"\\\"\")).toLowerCase();\n\t\t\t\t\tif(subCommand.equals(\"artist\") || subCommand.equals(\"title\")){\n\t\t\t\t\t\tArrayList<Song> list=songFile.searchPlaylist(currentPlaylistID, subCommand, songAttributeValue);\n\t\t\t\t\t\tsongFile.printArrayList(list);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!! No search terms\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid search command!!\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// Block to search the for the songs and insert to the current playlist\n\t\telse if(mainCommand.equals(\"insert_search\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length>2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\t// Get search string from command\n\t\t\t\t\tString songAttributeValue=command.substring(command.indexOf(\"\\\"\")+1,command.lastIndexOf(\"\\\"\")).toLowerCase();\n\t\t\t\t\tif(subCommand.equals(\"artist\") || subCommand.equals(\"title\")){\n\t\t\t\t\t\tArrayList<Song> list=songFile.searchSong(subCommand, songAttributeValue);\n\t\t\t\t\t\tPlaylist playlist=songFile.playlistArray.get(currentPlaylistID);\n\t\t\t\t\t\tif(list!= null && list.size()>0){\n\t\t\t\t\t\t\tfor(Song s:list){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Inserting song:\"+s.getSongArtist());\n\t\t\t\t\t\t\t\tplaylist.insertSong(s.getSongId());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tSystem.out.println(\"No matching songs found!!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!! No search terms\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid insert_search command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block for other invalid commands\n\t\telse{\n\t\t\tSystem.out.println(\"Please enter a valid command.\");\n\t\t}\n\t\t\n\t\n\t}", "private void processCommand(Command command) {\n // Switch construct\n System.out.println(); // formatting\n CommandWord commandWord = command.getCommandWord();\n switch (commandWord) {\n case ATTACK:\n System.out.println(\"You attack the monster!\");\n\n // calculate the damage this enemy will do\n int playerDifferenceHit = player.getMaxHit() - player.getMinHit(); // 5 - 3 = 2. \n int playerMinimumDamage = randomize.getRandomDamage(playerDifferenceHit); // returns 1-3\n int damage = playerDifferenceHit + playerMinimumDamage; // add the minimum damage, to random hit damage.\n\n System.out.println(\"You deal \" +damage+ \" damage!\");\n enemy.removeHealth(damage);\n\n enemyturn(); // let the enemy attack\n break;\n\n case EAT: // reach out to the main game again, then parse the command as usual\n int tempHealth = player.getHealth();\n eatItem(command);\n\n if (tempHealth == player.getHealth()) {\n // The player failed to eat something. Decrease the round\n round--;\n } else {\n // The player succesfully ate and recovered some HP.\n enemyturn(); // let the enemy attack\n }\n break;\n\n case INSPECT:\n System.out.println(\"You have a good look at the enemy:\");\n System.out.println(enemy.getDescription() + \" The enemy has \" + enemy.getHealth() + \" health left.\");\n System.out.println(\"You have a good look at yourself:\");\n System.out.println(\"You have \" + player.getHealth() + \" health left.\");\n round--;\n break;\n\n case RUN:\n System.out.println(\"You try to run...\");\n int canRun = randomize.getRandomNumber(4); // gets back 1 -4\n if (canRun == 4) {\n System.out.println(\".. but fail!\");\n enemyturn(); // let the enemy attack\n } else {\n System.out.println(\".. and succeed!\");\n succeededrun = true;\n }\n break;\n\n default:\n System.out.println(\"That option does not exist! Please try again.\");\n System.out.println(\"Your battle options are: Attack, Eat, Inspect, Run\");\n System.out.println(\"\");\n round--;\n break;\n }\n }", "protected static void doCommand(char cmd, String location, String destination) {\n \n switch (cmd)\n {\n case 'a': case 'A':\n \n for(Iterator<String> i = testGameLayout.locations(); i.hasNext(); ){\n LocationDescription description = testGameLayout.getLocationDescription(i.next());\n if(!description.getItem().equals(\"X\"))\n listOfPossibleItems.add(description.getItem());\n \n }\n break; \n case 'b': case 'B':\n System.out.println(testGameLayout.getLocationDescription(location));\n break;\n case 'c': case 'C':\n int count = 0;\n for(Iterator<String> i = testGameLayout.connections(location); i.hasNext(); ){\n LocationDescription description = testGameLayout.getLocationDescription(i.next());\n listOfConnections[count++]=description.getLocation(); \n }\n break;\n case 'd': case 'D':\n Boolean found = false;\n String newLocation = destination;\n for(Iterator<String> i = testGameLayout.connections(location); i.hasNext(); ){\n LocationDescription description = testGameLayout.getLocationDescription(i.next());\n String possibleLocation = description.getLocation();\n if(possibleLocation.equals(newLocation)){\n currentLocation = newLocation;\n //currentHealth+=description.getHealthChange();\n// if(currentHealth>10)\n// currentHealth=10;\n if(currentLocation.equals(\"Out\"))\n win=true;\n currentHealth--;\n if(currentHealth==0 || getNumConnections(currentLocation)==0)\n lose=true;\n return;\n }\n } \n //System.out.println(\"Sorry that is not an option.\");\n break;\n case 'e': case 'E':\n LocationDescription description = testGameLayout.getLocationDescription(currentLocation);\n if(!description.getItem().equals(\"X\")){\n listOfItems.add(description.getItem());\n myList.push(description.getItem());\n description.setItem(\"X\");\n \n currentHealth+=description.getHealthChange();\n if(currentHealth>10)\n currentHealth=10;\n }\n currentHealth--;\n if(currentHealth==0)\n lose=true;\n break; \n \n case 'f': case 'F':\n String property = destination;\n itemLocation = testGameLayout.search(currentLocation, property);\n break;\n case 'g': case 'G':\n// PrintWriter writer = FileChooser.openPrintWriter();\n// for(Iterator<String> i = testGameLayout.locations(); i.hasNext(); ){\n// LocationDescription description = testGameLayout.getLocationDescription(i.next());\n// for(Iterator<String> title = titles(author); title.hasNext(); ){\n// writer.print(library.get(author).get(title.next()).toString() + \"\\n\" + \"_\" + \"\\n\");\n// }\n// }\n// writer.close();\n testGameLayout.fileWriter(currentLocation, currentHealth);\n break;\n case 'q': case 'Q':\n break;\n default:\n }\n }", "public void onCmd(String cmd) \n {\n \tString split[] = cmd.split(\" \");\n \tif (split.length <= 1)\n \t{\n \t\tacm(\"No command was typed. Use \\\"help\\\" for a list of commands\");\n \t\treturn;\n \t}\n \telse\n \t{\n \t\tfor (ICommand command : commands)\n \t\t{\n \t\t\tif (command.getCommand().equalsIgnoreCase(split[1]))\n \t\t\t{\n \t\t\t\tcommand.onCmd(split);\n \t\t\t\treturn;\n \t\t\t}\n \t\t}\n \t\tacm(\"\\\"\" + split[1] + \"\\\" Unknown command. Use \\\"help\\\" for a list of commands\");\n \t}\n }", "private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n CommandWord commandWord = command.getCommandWord();\n\n if(commandWord == CommandWord.UNKNOWN) {\n Logger.Log(\"I don't know what you mean...\");\n return false;\n }\n \n if (commandWord == CommandWord.HELP) {\n printHelp();\n }\n else if (commandWord == CommandWord.GO) {\n goRoom(command);\n }\n \n else if (commandWord == CommandWord.TAKE) {\n takeItem(command);\n }\n \n else if (commandWord == CommandWord.USE) {\n useItem(command);\n }\n \n else if (commandWord == CommandWord.LOOK) {\n Logger.Log(currentRoom.getLongDescription());\n }\n \n else if (commandWord == CommandWord.VIEW) {\n viewPlayer(command);\n }\n \n else if (commandWord == CommandWord.QUIT) {\n wantToQuit = quit(command);\n }\n // else command not recognised.\n return wantToQuit;\n }", "protected String processCommand(String command)\n {\n switch (command)\n {\n case \"HELLO\":\n return \"h\";\n case \"MOVE N\":\n return \"mn\";\n case \"MOVE S\":\n return \"ms\";\n case \"MOVE E\":\n return \"me\";\n case \"MOVE W\":\n return \"mw\";\n case \"PICKUP\":\n return \"p\";\n case \"LOOK\":\n return \"l\";\n case \"QUIT\":\n return \"q\";\n default:\n return \"i\";\n }\n }", "private void processCommand()\n {\n String vInput = this.aEntryField.getText();\n this.aEntryField.setText(\"\");\n\n this.aEngine.interpretCommand( vInput );\n }", "private static void command() {\n Scanner reader = new Scanner(System.in);\n System.out.print(\"Write action (buy, fill, take):\\n> \");\n String input = reader.next();\n\n switch (input) {\n case \"buy\" :\n buy();\n break;\n case \"fill\" :\n fill();\n break;\n case \"take\" :\n take();\n break;\n default:\n System.out.println(\"not accepted command\");\n }\n }", "public void readCommands() {\n\t\t\n\t\tif(this.initialPoint.getOrientation() == 'N' ||\n\t\t\t\tthis.initialPoint.getOrientation() == 'E' ||\n\t\t\t\tthis.initialPoint.getOrientation() == 'W' ||\n\t\t\t\tthis.initialPoint.getOrientation() == 'S') {\n\n\t\t\tfor(char letter : commands) {\n\t\t\t\tswitch (letter) {\n\t\t\t\tcase 'D':\n\t\t\t\t\tturnRight();\n\t\t\t\t\tprintPosition();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'G':\n\t\t\t\t\tturnLeft();\n\t\t\t\t\tprintPosition();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'A':\n\t\t\t\t\tmoveForward();\n\t\t\t\t\tprintPosition();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// If the sequence of commands contains a letter which is not recognized\n\t\t\t\t\t// the mower will process the next command/letter.\n\t\t\t\t\tSystem.out.println(\"Command not recognized. Admissible values: [D, G, A].\");\n\t\t\t\t\tSystem.out.println(\"Processing next command.\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\tSystem.out.println(\"Orientation not admissible. Stopping program.\");\n\t\t\treturn;\n\t\t}\n\n\t}", "@Override\n public void execute() {\n if(state.getState()!=1) {\n client.printParseMessage();\n return;\n } else if(inputArgs.length < 1) {\n System.out.println(client.strings.getString(\"manage_command_message\"));\n return;\n }\n try {\n client.setDraftTag(inputArgs[0]);\n channel.send(new ReadRequest(client.getDraftTag()));\n ReadReply reply = (ReadReply) channel.receive();\n if(!reply.lines.isEmpty()) {\n String replyLine = reply.lines.get(reply.lines.size() - 1);\n if(Push.CLOSE_LINE.equals(replyLine)) {\n System.out.println(client.strings.getString(\"manage_close_command_message\"));\n return;\n }\n }\n } catch (IOException | ClassNotFoundException ex) {\n Logger.getLogger(ReadCommand.class.getName())\n .log(Level.SEVERE, null, ex);\n }\n state.setState(2);\n }", "public void process() {\r\n\t\tdisplayMenu();\r\n\t\tint command = getCommand();\r\n\t\twhile (command != EXIT) {\r\n\t\t\tswitch (command) {\r\n\t\t\tcase ADD_CUSTOMER:\r\n\t\t\t\taddCustomer();\r\n\t\t\t\tbreak;\r\n\t\t\tcase ADD_MODEL:\r\n\t\t\t\taddWasher();\r\n\t\t\t\tbreak;\r\n\t\t\tcase ADD_TO_INVENTORY:\r\n\t\t\t\taddToInventory();\r\n\t\t\t\tbreak;\r\n\t\t\tcase PURCHASE:\r\n\t\t\t\tpurchase();\r\n\t\t\t\tbreak;\r\n\t\t\tcase LIST_CUSTOMERS:\r\n\t\t\t\tlistCustomers();\r\n\t\t\t\tbreak;\r\n\t\t\tcase LIST_WASHERS:\r\n\t\t\t\tlistWashers();\r\n\t\t\t\tbreak;\r\n\t\t\tcase DISPLAY_TOTAL:\r\n\t\t\t\tdisplayTotal();\r\n\t\t\t\tbreak;\r\n\t\t\tcase SAVE:\r\n\t\t\t\tsave();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tdisplayMenu();\r\n\t\t\tcommand = getCommand();\r\n\t\t}\r\n\t\tSystem.out.println(\"Goodbye.\");\r\n\t}", "public void handleCommand(String command, String args[], Player player){\n\t}", "private void processMainMenuCommand() {\n String command;\n boolean keepgoing = true;\n while (keepgoing) {\n\n System.out.println(\"Hello \" + pickedAccount.getName());\n System.out.println(\"Your balance: \" + pickedAccount.getBalance());\n System.out.println(\"What would you like to do? (quit/reserve/view/deposit)\");\n\n command = input.next();\n command = command.toLowerCase();\n\n if (command.equals(\"quit\")) {\n keepgoing = false;\n } else if (command.equals(\"reserve\") || command.equals(\"view\") || command.equals(\"deposit\")) {\n processCommand(command);\n } else {\n System.out.println(\"Invalid command, try again\");\n }\n }\n }", "@Override\n\tpublic void run() {\n\t\twhile (receivingCommands) {\n\t\t\ttry {\n\t\t\t\tCommandHandler commandHandler = new CommandHandler(readNextLine());\n\t\t\t\tswitch (commandHandler.getCommand()) {\n\t\t\t\tcase REGISTER:\n\t\t\t\t\tString username = commandHandler.getParam(1);\n\t\t\t\t\tString password = commandHandler.getParam(2);\n\t\t\t\t\tfileCatalog.register(username, password);\n\t\t\t\t\tbreak;\n\t\t\t\tcase LOGIN:\n\t\t\t\t\tString username1 = commandHandler.getParam(1);\n\t\t\t\t\tString password1 = commandHandler.getParam(2);\n\t\t\t\t\tjwtToken = fileCatalog.login(username1, password1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase LIST:\n\t\t\t\t\tList<? extends FileDTO> files = fileCatalog.list(jwtToken);\n\t\t\t\t\tfor (FileDTO file : files) {\n\t\t\t\t\t\tprintDetails(file);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DETAILS:\n\t\t\t\t\tString fileName = commandHandler.getParam(1);\n\t\t\t\t\tFileDTO file = fileCatalog.details(jwtToken, fileName);\n\t\t\t\t\tprintDetails(file);\n\t\t\t\t\tbreak;\n\t\t\t\tcase UPR:\n\t\t\t\t\tString pathFileToUploadReadOnly = commandHandler.getParam(1);\n\t\t\t\t\tString newFileNameOnServerReadOnly = commandHandler.getParam(2);\n\t\t\t\t\tfileCatalog.upload(jwtToken, newFileNameOnServerReadOnly, false);\n\t\t\t\t\t// TODO\n\t\t\t\t\tbreak;\n\t\t\t\tcase UPW:\n\t\t\t\t\tString pathFileToUpload = commandHandler.getParam(1);\n\t\t\t\t\tString newFileNameOnServer = commandHandler.getParam(2);\n\t\t\t\t\tfileCatalog.upload(jwtToken, newFileNameOnServer, true);\n\t\t\t\t\t// TODO\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOWN:\n\t\t\t\t\tString fileNameToDL = commandHandler.getParam(1);\n\t\t\t\t\tString targetDirectory = commandHandler.getParam(2);\n\t\t\t\t\tString newNameDL = commandHandler.getParam(3);\n\t\t\t\t\tfileCatalog.download(jwtToken, fileNameToDL, targetDirectory, newNameDL);\n\t\t\t\t\t// TODO\n\t\t\t\t\tbreak;\n\t\t\t\tcase DELETE:\n\t\t\t\t\tString fileNameToDelete = commandHandler.getParam(1);\n\t\t\t\t\tfileCatalog.delete(jwtToken, fileNameToDelete);\n\t\t\t\t\t// TODO\n\t\t\t\t\tbreak;\n\t\t\t\tcase LOGOUT:\n\t\t\t\t\tjwtToken = null;\n\t\t\t\t\tsafePrintln(\"You have been logged out.\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase QUIT:\n\t\t\t\t\treceivingCommands = false;\n\t\t\t\t\tsafePrintln(\"Good bye!\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase HELP:\n\t\t\t\t\tfor (Command command : Command.values()) {\n\t\t\t\t\t\tif (command == Command.UNKNOWN) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsafePrintln(command.toString().toLowerCase());\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsafePrintln(\"Unrecognized command.\");\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tniceErrorPrint(e);\n\t\t\t}\n\t\t}\n\t}", "Commands getElse_commands();", "protected abstract void registerCommands(CommandHandler handler);", "void legalCommand();", "void processGUIInput(String cmd){\n try{\n debugWriter.write(cmd);\n debugWriter.flush();\n //}\n }catch(IOException e){\n //Eat it\n e.printStackTrace();\n //throw new InvalidInteractionsException();\n }\n }", "public void processCommand(Object\tsource,\n\t\t\t\t\t\t\t String\tcommandOriginal,\n\t\t\t\t\t\t\t String\tp1,\n\t\t\t\t\t\t\t String\tp2,\n\t\t\t\t\t\t\t String\tp3,\n\t\t\t\t\t\t\t String\tp4,\n\t\t\t\t\t\t\t String\tp5,\n\t\t\t\t\t\t\t String\tp6,\n\t\t\t\t\t\t\t String\tp7,\n\t\t\t\t\t\t\t String\tp8,\n\t\t\t\t\t\t\t String\tp9,\n\t\t\t\t\t\t\t String\tp10)\n\t{\n\t\tXml xml;\n\t\tString command = commandOriginal.trim().toLowerCase();\n\t\tif (command.isEmpty())\n\t\t\treturn;\t// Nothing to do\n\n//////////\n// Quit\n\t\tif (command.equals(\"quit\")) {\n\t\t\t// Exiting the system\n\t\t\tSystem.exit(0);\n\n\n//////////\n// Back\n\t\t} else if (command.equals(\"back\")) {\n\t\t\t// Navigating back through chain\n\t\t\tm_opbm.navigateBack();\n\t\t\t// Note: For rawedits and edits, use the rawedit_* and edit_* commands below\n\n\n//////////\n// Home\n\t\t} else if (command.equals(\"home\")) {\n\t\t\t// Navigating back through chain\n\t\t\tm_opbm.navigateHome();\n\n\n//////////\n// LeftPanel\n\t\t} else if (command.equals(\"leftpanel\")) {\n\t\t\t// Navigating to a leftpanel\n\t\t\tm_opbm.navigateToLeftPanel(m_opbm.expandMacros(p1));\n\n\n//////////\n// Raw Edit related\n\t\t} else if (command.equals(\"rawedit\")) {\n\t\t\t// Raw editing (full-page edit box) of whatever file is specified\n\t\t\tm_opbm.rawedit(m_opbm.expandMacros(p1));\n\n\t\t} else if (command.equals(\"rawedit_save\")) {\n\t\t\t// Saving the current contents of the active rawedit\n\t\t\tm_opbm.rawEditSave();\n\n\t\t} else if (command.equals(\"rawedit_save_and_close\")) {\n\t\t\t// Saving the current contents of the active rawedit, and returning to the previous panel\n\t\t\tm_opbm.rawEditSaveAndClose();\n\t\t\tm_opbm.navigateBack();\n\n\t\t} else if (command.equals(\"rawedit_close\") || command.equals(\"rawedit_back\")) {\n\t\t\t// Saving the current contents of the active rawedit, and returning to the previous panel\n\t\t\tm_opbm.rawEditClose();\n\t\t\tm_opbm.navigateBack();\n\n\t\t} else if (command.equals(\"rawedit_home\")) {\n\t\t\t// Navigating back through chain\n\t\t\tm_opbm.rawEditClose();\n\t\t\tm_opbm.navigateHome();\n\n\n//////////\n// Edit related\n\t\t} else if (command.equals(\"edit\")) {\n\t\t\t// Raw editing (full-page edit box) of whatever file is specified\n\t\t\tm_opbm.edit(m_opbm.expandMacros(p1));\n\n\t\t} else if (command.equals(\"edit_save\")) {\n\t\t\t// Saving the current contents of the active rawedit\n\t\t\tm_opbm.editSave();\n\n\t\t} else if (command.equals(\"edit_save_and_close\")) {\n\t\t\t// Saving the current contents of the active rawedit, and returning to the previous panel\n\t\t\tm_opbm.editSave();\n\t\t\tm_opbm.editClose();\n\t\t\tm_opbm.navigateBack();\n\n\t\t} else if (command.equals(\"edit_close\") || command.equals(\"edit_back\")) {\n\t\t\t// Saving the current contents of the active rawedit, and returning to the previous panel\n\t\t\tm_opbm.editClose();\n\t\t\tm_opbm.navigateBack();\n\n\t\t} else if (command.equals(\"edit_home\")) {\n\t\t\t// Navigating back through chain\n\t\t\tm_opbm.editClose();\n\t\t\tm_opbm.navigateHome();\n\n\n//////////\n// LISTBOX BUTTONS\n\t\t} else if (command.equals(\"listbox_add\")) {\n\t\t\t// User clicked on the \"add\" listbox button on the flow control input\n\t\t\tm_opbm.listBoxAddCommand();\n\n\t\t} else if (command.equals(\"listbox_delete\")) {\n\t\t\t// User clicked on the \"delete\" listbox button on the flow control input\n\t\t\tm_opbm.listBoxDeleteCommand();\n\n\t\t} else if (command.equals(\"listbox_clone\")) {\n\t\t\t// User clicked on the \"clone\" listbox button on the flow control input\n\t\t\tm_opbm.listBoxCloneCommand();\n\n\t\t} else if (command.equals(\"listbox_move_up\")) {\n\t\t\t// User clicked on the \"Up\" listbox button\n\t\t\tm_opbm.listBoxCommand(\"up\", (PanelRightListbox)source);\n\n\t\t} else if (command.equals(\"listbox_move_down\")) {\n\t\t\t// User clicked on the \"Down\" listbox button\n\t\t\tm_opbm.listBoxCommand(\"down\", (PanelRightListbox)source);\n\n\n//////////\n// LOOKUPBOX BUTTONS\n\t\t} else if (command.equals(\"lookupbox_add\")) {\n\t\t\t// User clicked on the \"add\" listbox button on the flow control input\n\t\t\t// p1 = whereTo\n\t\t\t// p2 = after\n\t\t\t// p3 = whereFrom\n\t\t\t// p4 = allow customs?\n\t\t\tm_opbm.lookupboxAddCommand((PanelRightLookupbox)source, p1, p2, p3, Utils.interpretBooleanAsYesNo(p4, true).equalsIgnoreCase(\"yes\"));\n\n\t\t} else if (command.equals(\"lookupbox_subtract\")) {\n\t\t\t// User clicked on the \"subtract\" listbox button\n\t\t\tm_opbm.lookupboxCommand(\"subtract\", (PanelRightLookupbox)source);\n\n\t\t} else if (command.equals(\"lookupbox_move_up\")) {\n\t\t\t// User clicked on the \"Up\" listbox button\n\t\t\tm_opbm.lookupboxCommand(\"up\", (PanelRightLookupbox)source);\n\n\t\t} else if (command.equals(\"lookupbox_move_down\")) {\n\t\t\t// User clicked on the \"Down\" listbox button\n\t\t\tm_opbm.lookupboxCommand(\"down\", (PanelRightLookupbox)source);\n\n\t\t} else if (command.equals(\"lookupbox_zoom\")) {\n\t\t\t// User clicked on the \"zoom\" listbox button\n\t\t\t// p1 = name of edit to use for display\n\t\t\t// p2 = reference in \"zoom\" field in edit to only show those fields which contain that portion\n\t\t\t// p3 = override for data source (if present)\n\t\t\tp3 = \"\";\n\t\t\tif (p1.equalsIgnoreCase(\"relativeto\"))\n\t\t\t{\n\t\t\t\t// The name isn't a hard-coded name, because it is one of a list.\n\t\t\t\t// We have to find out which name belongs here based on whatever\n\t\t\t\t// one of the list is currently selected.\n\t\t\t\txml = m_opbm.getListboxOrLookupboxSelectedItem((PanelRightLookupbox)source);\n\t\t\t\tif (xml == null)\n\t\t\t\t{ // Cannot execut the command because nothing is selected, or there is no data\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tp1 = m_macroMaster.parseMacros(((PanelRightLookupbox)source).getEditForXml(xml.getName()));\n\t\t\t\tif (p1.contains(\":\"))\n\t\t\t\t{\n\t\t\t\t\t// We have to separate out the edit from the location where the data source is specified\n\t\t\t\t\tp3 = p1.substring(p1.indexOf(\":\") + 1);\n\t\t\t\t\tp1 = p1.substring(0, p1.indexOf(\":\"));\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tp1 = m_macroMaster.parseMacros(p1);\n\n\t\t\t}\n\n\t\t\tif (!p1.isEmpty()) {\n\t\t\t\tm_opbm.lookupboxZoomCommand((PanelRightLookupbox)source, p1, p2, p3);\n\n\t\t\t} else {\n\t\t\t\t// An error, we need an edit to display content\n\t\t\t\tif (p2.isEmpty())\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"No p1 or edits parameter was found for lookupbox_zoom \\\"\" + ((PanelRightLookupbox)source).getName() + \"\\\"\");\n\t\t\t\telse\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"No p1 or edits was found for lookupbox_zoom(\" + p2 +\") \\\"\" + ((PanelRightLookupbox)source).getName() + \"\\\"\");\n\t\t\t}\n\n\t\t} else if (command.equals(\"save_custom\")) {\n\t\t\t// User clicked on the \"zoom\" listbox button on the flow control input\n\t\t\t// p1 = uuid of tupel containing everything to update\n\t\t\tm_opbm.saveCustomCommand(p1);\n\n\t\t} else if (command.equals(\"cancel_custom\")) {\n\t\t\t// User clicked on the \"zoom\" listbox button on the flow control input\n\t\t\t// p1 = uuid of tupel containing everything to update\n\t\t\tm_opbm.cancelCustomCommand(p1);\n\n\n//////////\n// LOOKUPBOX UPDATE\n\t\t} else if (command.equals(\"lookupbox_update\")) {\n\t\t\t// User clicked on a listbox that's related to a lookupbox that needs\n\t\t\t// to have its information updated after the change in entry\n\t\t\tm_opbm.lookupboxUpdateCommand(p1);\n\n\n//////////\n// WEB_BROWSER\n\t\t} else if (command.equals(\"web_browser\")) {\n\t\t\t// Wants to link to the specified web browser address\n\t\t\tm_opbm.webBrowser(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);\n\n//////////\n// BENCHMARKS\n\t\t} else if (command.equals(\"run_atom_benchmark\")) {\n\t\t\tm_opbm.benchmarkRunAtom(null, 1, true, (PanelRightItem)source, m_opbm, m_macroMaster, m_settingsMaster, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);\n\n//////////\n// RESULTS VIEWER\n\t\t} else if (command.equals(\"run_results_viewer_sample\")) {\n\t\t\tm_opbm.createAndShowResultsViewer(\"results_sample.xml\");\n\t\t} else if (command.equals(\"run_results_viewer\")) {\n\t\t\tm_opbm.createAndShowResultsViewer(\"output.xml\");\n\n\n//////////\n// CLOSING BRACE\n\t\t}\n\n\n\t}", "private void registerCommands() {\r\n\t\tif(getSettings().getBoolean(KEY_PREFIX+KEYS.HOME.toString())) {\r\n\t\t\t(new HomeCommand(this)).register();\r\n\t\t\t(new SetHomeCommand(this)).register();\r\n\t\t\t(new DelHomeCommand(this)).register();\r\n\t\t\t(new ListHomesCommand(this)).register();\r\n\t\t\t(new NearbyHomesCommand(this)).register();\r\n\t\t}\r\n\t\t\r\n\t\tif(getSettings().getBoolean(KEY_PREFIX+KEYS.BACK.toString())) {\r\n\t\t\t(new Back(this)).register();\r\n\t\t}\r\n\t\t\r\n\t\tif(getSettings().getBoolean(KEY_PREFIX+KEYS.TPASK.toString())) {\r\n\t\t\t(new TeleportToggle(this)).register();\r\n\t\t\t(new TpAsk(this)).register();\r\n\t\t\t(new TpAskHere(this)).register();\r\n\t\t\t(new TeleportAccept(this)).register();\r\n\t\t\t(new TeleportDeny(this)).register();\r\n\t\t}\r\n\t\t\r\n\t\tif(getSettings().getBoolean(KEY_PREFIX+KEYS.TELEPORT.toString())) {\r\n\t\t\t(new Teleport(this)).register();\r\n\t\t}\r\n\t\t\r\n\t\tif(getSettings().getBoolean(KEY_PREFIX+KEYS.SPEED_SETTING.toString())) {\r\n\t\t\t(new SpeedCommand(this)).register();\r\n\t\t}\r\n\t\t\r\n\t\tif(getSettings().getBoolean(KEY_PREFIX+KEYS.FLY.toString())) {\r\n\t\t\t(new FlyCommand(this)).register();\r\n\t\t}\r\n\t\t\r\n\t\tif(getSettings().getBoolean(KEY_PREFIX+KEYS.GAMEMODE.toString())) {\r\n\t\t\tGameModeCommand gmc = new GameModeCommand(this);\r\n\t\t\tPlayerLoader loader = new PlayerLoader(true, false, false, false);\r\n\t\t\tGameModeLoader gml = new GameModeLoader(true);\r\n\t\t\tgmc.setLoader(gml);\r\n\t\t\tgml.setLoader(loader);\r\n\t\t\tgmc.register();\r\n\t\t}\r\n\t\t\r\n\t\tif(getSettings().getBoolean(KEY_PREFIX+KEYS.PLAYER_CMD.toString())) {\r\n\t\t\t// create command and player loader\r\n\t\t\tPlayerCommand pc = new PlayerCommand();\r\n\t\t\tPlayerLoader playerLoader = new PlayerLoader(true, false, false, false);\r\n\t\t\t\r\n\t\t\t// create components\r\n\t\t\tFeedComponent fc = new FeedComponent();\r\n\t\t\tfc.setLoader(playerLoader);\r\n\t\t\tStarveComponent sc = new StarveComponent();\r\n\t\t\tsc.setLoader(playerLoader);\r\n\t\t\tHealComponent hc = new HealComponent();\r\n\t\t\thc.setLoader(playerLoader);\r\n\t\t\tKillComponent kc = new KillComponent();\r\n\t\t\tkc.setLoader(playerLoader);\r\n\t\t\tBurnComponent bc = new BurnComponent();\r\n\t\t\tbc.setLoader(playerLoader);\r\n\t\t\tExtinguishComponent ec = new ExtinguishComponent();\r\n\t\t\tec.setLoader(playerLoader);\r\n\t\t\tLightningComponent lc = new LightningComponent();\r\n\t\t\tlc.setLoader(playerLoader);\r\n\t\t\tLightningEffectComponent lec = new LightningEffectComponent();\r\n\t\t\tlec.setLoader(playerLoader);\r\n\t\t\t\r\n\t\t\tPlayerLoader gcLoader = new PlayerLoader(false, false, false, false);\r\n\t\t\tBinaryLoader ooc = new BinaryLoader(true, BinaryLoader.BINARY.ENABLE_DISABLE);\r\n\t\t\tooc.setLoader(gcLoader);\r\n\t\t\t\r\n\t\t\tInvincibleComponent gc = new InvincibleComponent();\r\n\t\t\tgc.setLoader(ooc);\r\n\t\t\t\r\n\t\t\t// add components\r\n\t\t\tpc.addComponent(\"feed\", fc);\r\n\t\t\tpc.addComponent(\"starve\", sc);\r\n\t\t\tpc.addComponent(\"heal\", hc);\r\n\t\t\tpc.addComponent(\"invincible\", gc);\r\n\t\t\tpc.addComponent(\"kill\", kc);\r\n\t\t\tpc.addComponent(\"burn\", bc);\r\n\t\t\tpc.addComponent(\"extinguish\", ec);\r\n\t\t\tpc.addComponent(\"lightning\", lc);\r\n\t\t\tpc.addComponent(\"lightningeffect\", lec);\r\n\t\t\t\r\n\t\t\t// register command\r\n\t\t\tpc.register();\r\n\t\t}\r\n\t\t\r\n\t\tif(getSettings().getBoolean(KEY_PREFIX+KEYS.HAT.toString())) {\r\n\t\t\t// /hat command\r\n\t\t\t(new HatCommand()).register();\r\n\t\t}\r\n\t\t\r\n\t\tif(getSettings().getBoolean(KEY_PREFIX+KEYS.WORKBENCH_ENDERCHEST.toString())) {\r\n\t\t\t// /enderchest and /workbench commands\r\n\t\t\tWorkbenchCommand wb = new WorkbenchCommand();\r\n\t\t\twb.setPermission(\"karanteenials.inventory.workbench\");\r\n\t\t\twb.register();\r\n\t\t\t\r\n\t\t\tEnderChestCommand ec = new EnderChestCommand();\r\n\t\t\tec.setPermission(\"karanteenials.inventory.enderchest\");\r\n\t\t\tec.register();\r\n\t\t}\r\n\t\t\r\n\t\tif(getSettings().getBoolean(KEY_PREFIX+KEYS.CLEAR_INVENTORY.toString())) {\r\n\t\t\tClearInventoryCommand cic = new ClearInventoryCommand();\r\n\t\t\tPlayerLoader pl = new PlayerLoader(true, false, false, false);\r\n\t\t\tMaterialLoader ml = new MaterialLoader(true, false, false);\r\n\t\t\tpl.setLoader(ml);\r\n\t\t\tcic.setLoader(pl);\r\n\t\t\tpl.setPermission(\"karanteenials.inventory.clear-multiple\");\r\n\t\t\tcic.setPermission(\"karanteenials.inventory.clear\");\r\n\t\t\tcic.register();\r\n\t\t}\r\n\t\t\r\n\t\t// /nick command\r\n\t\t/*if(getSettings().getBoolean(KEY_PREFIX+KEYS.NICK.toString())) {\r\n\t\t\tNickCommand nc = new NickCommand();\r\n\t\t\tnc.register();\r\n\t\t}*/\r\n\t\t\r\n\t\t\r\n\t\t// /enchant command\r\n\t\tif(getSettings().getBoolean(KEY_PREFIX+KEYS.ENCHANT_COMMAND.toString())) {\r\n\t\t\tEnchantCommand ec = new EnchantCommand();\r\n\t\t\t\r\n\t\t\tGiveEnchantmentComponent gec = new GiveEnchantmentComponent();\r\n\t\t\tgec.setPermission(\"karanteenials.enchant.set\");\r\n\t\t\t\r\n\t\t\tRemoveEnchantmentComponent rec = new RemoveEnchantmentComponent();\r\n\t\t\trec.setPermission(\"karanteenials.enchant.remove\");\r\n\t\t\t\r\n\t\t\tec.addComponent(\"give\", gec);\r\n\t\t\tec.addComponent(\"remove\", rec);\r\n\t\t\t\r\n\t\t\tEnchantmentLoader giveEnchLoader = new EnchantmentLoader();\r\n\t\t\tgec.setLoader(giveEnchLoader);\r\n\t\t\t\r\n\t\t\tEnchantmentLoader removeEnchLoader = new EnchantmentLoader();\r\n\t\t\trec.setLoader(removeEnchLoader);\r\n\t\t\t\r\n\t\t\tLevelLoader ll = new LevelLoader();\r\n\t\t\tgiveEnchLoader.setLoader(ll);\r\n\t\t\t\r\n\t\t\tec.register();\r\n\t\t}\r\n\t\t\r\n\t\t// /rtp command\r\n\t\tif(getSettings().getBoolean(KEY_PREFIX+KEYS.RANDOM_TELEPORT.toString())) {\r\n\t\t\tRandomTeleport rtp = new RandomTeleport();\r\n\t\t\tPlayerLoader pl = new PlayerLoader(true, false, true, false);\r\n\t\t\trtp.setLoader(pl);\r\n\t\t\trtp.register();\r\n\t\t}\r\n\t\t\r\n\t\tif(getSettings().getBoolean(KEY_PREFIX+KEYS.NEAR_COMMAND.toString())) {\r\n\t\t\tNearCommand nc = new NearCommand();\r\n\t\t\tnc.setPermission(\"karanteenials.near\");\r\n\t\t\tnc.register();\r\n\t\t}\r\n\t}", "@Override\r\n public void onMessage(MessageEvent message) {\r\n String newMessage = message.getMessage();\r\n String response;\r\n\r\n //split the message on spaces to identify the command\r\n String[] messageArray = newMessage.split(\" \");\r\n \r\n switch (messageArray[0]) {\r\n case \"!command\":\r\n if (message.getChannel().getOps().contains(message.getUser())) {\r\n if (messageArray.length == 2) {\r\n if (messageArray[1].equals(\"off\")) {\r\n commandsActive = false;\r\n } \r\n if (messageArray[1].equals(\"on\")) {\r\n commandsActive = true;\r\n }\r\n }\r\n }\r\n break;\r\n //command to make a custom command for the bot\r\n case \"!addcom\":\r\n if (commandsActive) {\r\n if (message.getChannel().getOps().contains(message.getUser())) {\r\n response = addCom(messageArray, message.getChannel().getName());\r\n message.getChannel().send().message(response);\r\n } \r\n else {\r\n message.respond(\"You are not allowed to add commands.\");\r\n }\r\n }\r\n break;\r\n case \"!commands\":\r\n if (commandsActive) {\r\n if (messageArray.length ==1) {\r\n ArrayList<String> commands = manager.getCommands(message.getChannel().getName());\r\n String commandList = \"The custom commands available to everyone for this channel are: \";\r\n while (!commands.isEmpty()) {\r\n commandList += commands.remove(0) + \", \";\r\n }\r\n message.getChannel().send().message(commandList);\r\n }\r\n }\r\n break;\r\n //command to delete a custom command from the bot\r\n case \"!delcom\":\r\n if (commandsActive) {\r\n if (message.getChannel().getOps().contains(message.getUser())) {\r\n response = delCom(messageArray[1], message.getChannel().getName());\r\n message.getChannel().send().message(response);\r\n } \r\n else {\r\n message.respond(\"You are not allowed to remove commands.\");\r\n }\r\n }\r\n break;\r\n //command to edit a custom command the bot has\r\n case \"!editcom\":\r\n if (commandsActive) {\r\n if (message.getChannel().getOps().contains(message.getUser())) {\r\n response = editCom(messageArray, message.getChannel().getName());\r\n message.getChannel().send().message(response);\r\n } \r\n else {\r\n message.respond(\"You are not allowed to edit commands.\");\r\n }\r\n }\r\n break;\r\n\r\n //default message handling for custom commands\r\n default:\r\n if (commandsActive) {\r\n if (message.getMessage().startsWith(\"!\") && !messageArray[0].equals(\"!permit\")&& !messageArray[0].equals(\"!spam\")) {\r\n customCommands(message);\r\n }\r\n }\r\n break;\r\n }\r\n }", "private void commandLoop() {\n\t\twhile (true) {\n\t\t\tString s = getString();\n\t\t\tString sl = s.toLowerCase();\n\t\t\tif (sl.startsWith(\"load\") || sl.startsWith(\"save\")) {\n\t\t\t\ts = s.replace(\"\\\"\", \" \").trim();\n\t\t\t}\n\t\t\tString[] split = s.split(\" \");\n\t\t\tif (sl.equals(\"list\")) {\n\t\t\t\tputString(store.toString());\n\t\t\t} else if (sl.equals(\"new\")) {\n\t\t\t\tstore.clear();\n\t\t\t} else if (sl.equals(\"cls\")) {\n\t\t\t\tcls();\n\t\t\t} else if (sl.equals(\"dir\")) {\n\t\t\t\tdir();\n\t\t\t} else if (sl.equals(\"run\")) {\n\t\t\t\tif (runner != null) {\n\t\t\t\t\trunner.dispose();\n\t\t\t\t}\n\t\t\t\trunner = new Runner(store.toArray(), this);\n\t\t\t\trunner.synchronousStart();\n\t\t\t} else if (split[0].toLowerCase().equals(\"save\")) {\n\t\t\t\tString msg = store.save(split[1]);\n\t\t\t\tputString(msg);\n\t\t\t} else if (split[0].toLowerCase().equals(\"load\")) {\n\t\t\t\tString msg = store.load(split[1]);\n\t\t\t\tputString(msg);\n\t\t\t} else {\n\t\t\t\tif (!store.insert(s)) {\n\t\t\t\t\tif (runner == null) {\n\t\t\t\t\t\trunner = new Runner(new String[] {}, this);\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\trunner.executeDirectCommand(s);\n\t\t\t\t\t} catch (Throwable t) {\n\t\t\t\t\t\tputString(\"?ERROR\\n\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void dealWithCommand(MessageReceivedEvent event) {\n List<String> contentSplit = new ArrayList<>(Arrays.asList(event.getMessage().getContentStripped().split(\" \")));\n\n // remove the command part of the message\n contentSplit.remove(0);\n boolean isXpDesired = DetermineArguments.determineIsXpDesired(contentSplit);\n boolean isCollection = DetermineArguments.determineIsCollection(contentSplit);\n long timeToSpend = DetermineArguments.determineTimeToSpend(contentSplit, event.getTextChannel());\n int classLevel = DetermineArguments.determineClassLevel(contentSplit, event.getTextChannel());\n long amountDesired = DetermineArguments.determineAmountDesired(contentSplit, event.getTextChannel());\n\n // be done if something bad was found\n if (timeToSpend == -2 || classLevel == -2 || amountDesired == -2)\n return;\n\n if (contentSplit.isEmpty()) {\n // user did not specify what player they want\n event.getChannel().sendMessage(\"Specify what player you want to analyze.\").queue();\n return;\n }\n String username = contentSplit.get(0);\n WynncraftPlayer player = GetPlayerStats.get(username);\n if (player == null) {\n event.getChannel().sendMessage(\"Either the api is down, or '\" + username + \"' is not a player.\").queue();\n return;\n }\n\n // tell the user we're working on the answer\n event.getMessage().addReaction(\"\\uD83D\\uDEE0\").queue();\n\n List<String> classNames = new ArrayList<>();\n for (WynncraftClass playerClass : player.classes) {\n classNames.add(playerClass.name);\n }\n ChoiceArguments choiceArguments = new ChoiceArguments(\n isXpDesired, isCollection, timeToSpend, amountDesired, classLevel, classNames, player, true);\n\n\n long xpDesiredGivenPerc = 0;\n long emeraldDesiredGivenPerc = 0;\n for (WynncraftClass wynncraftClass : player.classes)\n for (Quest quest : wynncraftClass.questsNotCompleted) {\n if (quest.levelMinimum <= (classLevel == -1 ? wynncraftClass.combatLevel : classLevel)) {\n xpDesiredGivenPerc += quest.xp;\n emeraldDesiredGivenPerc += quest.emerald;\n }\n }\n xpDesiredGivenPerc *= GetAnswers.DEFAULT_PERCENTAGE_AMOUNT;\n emeraldDesiredGivenPerc *= GetAnswers.DEFAULT_PERCENTAGE_AMOUNT;\n\n FinalQuestOptionsAll finalQuestOptionsAll = GetAnswers.getAllFullAnswers(player, choiceArguments);\n String spreadsheetId = SheetsWrite.writeSheet(finalQuestOptionsAll, event.getAuthor().getIdLong(), player.name, true);\n if (spreadsheetId == null) return;\n new QuestRecommendationMessagePlayer(spreadsheetId, finalQuestOptionsAll, event.getChannel(), choiceArguments, xpDesiredGivenPerc, emeraldDesiredGivenPerc);\n\n event.getMessage().removeReaction(\"\\uD83D\\uDEE0\", DiscordBot.client.getSelfUser()).queue();\n }", "private void getGameCommands(){\n\n }", "private void processSingleCmd(final String[] cmdArgs) {\n\n switch (cmdArgs[0].toUpperCase()) {\n\n case \"PLACE\":\n logger.info(\"PLACE - Request received\");\n GridLocation location = new GridLocation( Integer.parseInt(cmdArgs[1]),\n Integer.parseInt(cmdArgs[2]),\n GridLocation.FACING.valueOf(cmdArgs[3]));\n placeHolder = Optional.of( new Robot(location) );\n break;\n\n case \"MOVE\":\n logger.info(\"MOVE - Request received\");\n if (placeHolder.isPresent()) {\n placeHolder.get().move();\n }\n break;\n\n case \"LEFT\":\n logger.info(\"LEFT - Request received\");\n if (placeHolder.isPresent()) {\n placeHolder.get().left();\n }\n break;\n\n case \"RIGHT\":\n logger.info(\"RIGHT - Request received\");\n if (placeHolder.isPresent()) {\n placeHolder.get().right();\n }\n break;\n\n case \"REPORT\":\n logger.info(\"REPORT - Request received\");\n if (placeHolder.isPresent()) {\n placeHolder.get().report();\n }\n break;\n\n default:\n logger.info(\"NO Intelligible - Request received\");\n // Unable to match any command - ignore\n break;\n }\n }", "private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n if(command.isUnknown()) {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n\n String commandWord = command.getCommandWord();\n if (commandWord.equals(\"help\")) {\n printHelp();\n }\n else if (commandWord.equals(\"go\")) {\n player.goRoom(command); \n }\n else if (commandWord.equals(\"look\")) { \n player.look();\n }\n else if (commandWord.equals(\"eat\")) {\n player.eat();\n }\n else if (commandWord.equals(\"quit\")) {\n wantToQuit = quit(command);\n }\n else if (commandWord.equals(\"back\")) {\n player.goBack(); \n }\n else if (commandWord.equals(\"take\")) {\n player.take(command);\n }\n else if (commandWord.equals(\"drop\")) {\n player.drop(command);\n }\n else if (commandWord.equals(\"items\")) {\n player.getItems();\n }\n else if (commandWord.equals(\"equipar\")) {\n player.equipar(command);\n }\n return wantToQuit;\n }", "@Override\r\n\tpublic void command() {\n\t\tSystem.out.println(\"CommandAttack Process\");\r\n\t}", "private void executeCommand(String c) {\n // split command and arguments\n int index = c.indexOf(' ');\n String command = ((index == -1) ? c.toUpperCase() : (c.substring(0, index)).toUpperCase());\n String args = ((index == -1) ? null : c.substring(index + 1));\n\n debugOutput(\"Command: \" + command + \" Args: \" + args);\n\n // dispatcher mechanism for different commands\n switch (command) {\n case \"USER\":\n handleUser(args);\n break;\n\n case \"PASS\":\n handlePass(args);\n break;\n\n case \"CWD\":\n handleCwd(args);\n break;\n\n case \"LIST\":\n handleNlst(args);\n break;\n\n case \"NLST\":\n handleNlst(args);\n break;\n\n case \"PWD\":\n case \"XPWD\":\n handlePwd();\n break;\n\n case \"QUIT\":\n handleQuit();\n break;\n\n case \"PASV\":\n handlePasv();\n break;\n\n case \"EPSV\":\n handleEpsv();\n break;\n\n case \"SYST\":\n handleSyst();\n break;\n\n case \"FEAT\":\n handleFeat();\n break;\n\n case \"PORT\":\n handlePort(args);\n break;\n\n case \"EPRT\":\n handleEPort(args);\n break;\n\n case \"RETR\":\n handleRetr(args);\n break;\n\n case \"MKD\":\n case \"XMKD\":\n handleMkd(args);\n break;\n\n case \"RMD\":\n case \"XRMD\":\n handleRmd(args);\n break;\n\n case \"TYPE\":\n handleType(args);\n break;\n\n case \"STOR\":\n handleStor(args);\n break;\n\n default:\n sendMsgToClient(\"501 Unknown command\");\n break;\n\n }\n\n }", "@Override\r\n\tpublic void handleDataPackage(Command cmd) {\n\t\tif (cmd.getDataType().equals(Command.POSITION)) {\r\n\t\t\thandlePosition((PositionCommand) cmd);\r\n\t\t} else if (cmd.getDataType().equals(Command.HEART)) {\r\n\t\t\thandleHeart((HeartCommand) cmd);\r\n\t\t} else if (cmd.getDataType().equals(Command.BOOT)) {\r\n\t\t\thandBoot((BootCommand) cmd);\r\n\t\t} else if (cmd.getDataType().equals(Command.DEVICE_INFO)) {\r\n\t\t\thandleDeviceInfo((DeviceInfoCommand) cmd);\r\n\t\t}\r\n\t}", "public abstract String getCommand();", "protected boolean onExecute(String command, long hconv)\n {\n return onExecute(command);\n }", "private void putCommands() {\r\n ShellCommand charset = new CharsetCommand();\r\n commands.put(charset.getCommandName(), charset);\r\n ShellCommand symbol = new SymbolCommand();\r\n commands.put(symbol.getCommandName(), symbol);\r\n ShellCommand exit = new ExitCommand();\r\n commands.put(exit.getCommandName(), exit);\r\n ShellCommand cat = new CatCommand();\r\n commands.put(cat.getCommandName(), cat);\r\n ShellCommand copy = new CopyCommand();\r\n commands.put(copy.getCommandName(), copy);\r\n ShellCommand ls = new LsCommand();\r\n commands.put(ls.getCommandName(), ls);\r\n ShellCommand mkdir = new MkdirCommand();\r\n commands.put(mkdir.getCommandName(), mkdir);\r\n ShellCommand hexdump = new HexdumpCommand();\r\n commands.put(hexdump.getCommandName(), hexdump);\r\n ShellCommand tree = new TreeCommand();\r\n commands.put(tree.getCommandName(), tree);\r\n ShellCommand help = new HelpCommand();\r\n commands.put(help.getCommandName(), help);\r\n ShellCommand pwd = new PwdCommand();\r\n commands.put(pwd.getCommandName(), pwd);\r\n ShellCommand cd = new CdCommand();\r\n commands.put(cd.getCommandName(), cd);\r\n ShellCommand pushd = new PushdCommand();\r\n commands.put(pushd.getCommandName(), pushd);\r\n ShellCommand popd = new PopdCommand();\r\n commands.put(popd.getCommandName(), popd);\r\n ShellCommand listd = new ListdCommand();\r\n commands.put(listd.getCommandName(), listd);\r\n ShellCommand dropd = new DropdCommand();\r\n commands.put(dropd.getCommandName(), dropd);\r\n ShellCommand rmtree = new RmtreeCommand();\r\n commands.put(rmtree.getCommandName(), rmtree);\r\n ShellCommand cptree = new CptreeCommand();\r\n commands.put(cptree.getCommandName(), cptree);\r\n ShellCommand massrename = new MassrenameCommand();\r\n commands.put(massrename.getCommandName(), massrename);\r\n }", "public void doNextCommand(String line){\n tokenizer = new Tokenizer(line);\n currentPlayer = checkPlayer(line);\n currentLocation = currentPlayer.getPlayerLocation();\n results = new ArrayList<String>();\n int cmdCnt = 0;\n if(tokenizer.myContainsLower(\"look\")){\n doLook();\n cmdCnt++;\n }\n if(tokenizer.myContainsLower(\"goto\")){\n if(doGoTo()) {\n doLook();\n }\n cmdCnt++;\n }\n if (tokenizer.myContainsLower(\"get\")){\n doGet();\n cmdCnt++;\n }\n if (tokenizer.myContainsLower(\"drop\")) {\n doDrop();\n cmdCnt++;\n }\n if(tokenizer.myContainsLower(\"inv\") || tokenizer.myContains(\"inventory\")){\n doInv();\n cmdCnt++;\n }\n if(tokenizer.myContainsLower(\"health\")){\n results.add(\"Your current level of health is: \" + currentPlayer.getHealth());\n cmdCnt++;\n }\n if(checkForAction()){\n cmdCnt++;\n }\n if(cmdCnt != 1) {\n results = new ArrayList<String>();\n results.add(\"Invalid command.\");\n return;\n }\n currentPlayer.setCurrentLocation(currentLocation);\n checkPlayerHealth();\n }", "@Override\n public Command parseCommand(String commandText, ViewController viewController, Cli cli) throws InvalidCommandException {\n\n System.out.println(this+\": \"+commandText);\n String word = \"\";\n Resource resource;\n String prefix = \"\";\n String suffix = \"\";\n boolean found = false;\n ArrayList<Resource> resources = new ArrayList<>();\n\n if (commandText.length() == 0)\n throw new InvalidCommandException();\n\n commandText = Command.deleteInitSpaces(commandText);\n\n for (int i = 0;i<commandText.length();i++){\n if (commandText.charAt(i) != ' '){\n prefix = prefix + commandText.charAt(i);\n } else {\n for (i++;i<commandText.length();i++)\n suffix = suffix + commandText.charAt(i);\n }\n }\n\n if (prefix.equals(\"coin\") || prefix.equals(\"rock\") || prefix.equals(\"shield\") || prefix.equals(\"servant\")){\n\n resource = Command.fromStringToResource(prefix);\n resources.add(resource);\n\n for (int i = 0;i<suffix.length();i++){\n if (suffix.charAt(i) != ' '){\n word = word + suffix.charAt(i);\n } else {\n resource = Command.fromStringToResource(word);\n if(resource != null )\n for(Resource r : possibleResources)\n if (r == resource)\n resources.add(resource);\n word = \"\";\n }\n }\n resource = Command.fromStringToResource(word);\n if(resource != null )\n for(Resource r : possibleResources)\n if (r == resource)\n resources.add(resource);\n\n if (resources.size() != numberOfWhiteMarbles){\n throw new InvalidCommandException();\n }\n return new WhiteMarbleCommand(resources,cli);\n } else {\n switch (prefix) {\n case \"exit\": {\n return new ExitCommand();\n }\n case \"help\": {\n return new HelpCommand();\n }\n case \"showGameboard\": {\n return new ShowGameBoardCommand(cli);\n }\n case \"showMarket\": {\n return new ShowMarketCommand(cli);\n }\n case \"showPlayer\": {\n\n int n = 0;\n int temp;\n found = false;\n\n for (int i = 0; i < suffix.length() && !found; i++) {\n if (suffix.charAt(i) != ' ') {\n temp = suffix.charAt(i) - '0';\n if (temp < 0 || temp > 9)\n throw new InvalidCommandException();\n n = temp;\n found = true;\n }\n\n }\n if (n < 1 || n > 4)\n throw new InvalidCommandException();\n return new ShowPlayerCommand(n, viewController);\n\n }\n case \"showProductionDecks\": {\n return new ShowProductionDeckCommand(cli);\n }\n case \"showReserve\": {\n return new ShowReserveCommand(cli);\n }\n default: {\n throw new InvalidCommandException();\n }\n }\n }\n }", "public abstract CommandResponse onCommand(CommandSender sender, String label, String[] args);", "private void processCommands(String[] args) {\n int current = 0; //a running total of the parts added to a\n // command\n for (String part : args) {\n command += part;\n if ((part.equals(\";\")) || (part.equals(\"&\"))) { //if it is a delimiter\n if (part.equals(\";\")) { //sequential\n executeSequentially();\n } else { //concurrent\n executeConcurrently();\n }\n } else { //not a delimiter\n if ((current == args.length - 1)) { //contains no delimter in the\n // command (for single commands and the last of a series of\n // commands)\n executeSequentially();//runs as a sequential command\n } else { //not a delmiter and not the end of the commands\n command += \" \"; //add the part to command\n }\n }\n current++;\n }\n }", "private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n if(command.isUnknown()) {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n\n String commandWord = command.getCommandWord();\n if (commandWord.equals(\"help\"))\n printHelp();\n else if (commandWord.equals(\"go\"))\n goRoom(command);\n else if (commandWord.equals(\"quit\"))\n wantToQuit = quit(command);\n\n return wantToQuit;\n }", "final public void basicCommand() throws ParseException {\n if (jj_2_75(4)) {\n if (jj_2_55(4)) {\n jj_consume_token(MOVE);\n numero();\n } else if (jj_2_56(4)) {\n jj_consume_token(RIGHT);\n numero();\n } else if (jj_2_57(4)) {\n jj_consume_token(LEFT);\n numero();\n } else if (jj_2_58(4)) {\n jj_consume_token(ROTATE);\n numero();\n } else if (jj_2_59(4)) {\n jj_consume_token(DROP);\n numero();\n } else if (jj_2_60(4)) {\n jj_consume_token(FREE);\n numero();\n } else if (jj_2_61(4)) {\n jj_consume_token(PICK);\n numero();\n } else if (jj_2_62(4)) {\n jj_consume_token(POP);\n numero();\n } else if (jj_2_63(4)) {\n jj_consume_token(BLOCKEDP);\n } else if (jj_2_64(4)) {\n jj_consume_token(NOP);\n } else if (jj_2_65(4)) {\n jj_consume_token(LOOK);\n if (jj_2_49(4)) {\n jj_consume_token(N);\n } else if (jj_2_50(4)) {\n jj_consume_token(E);\n } else if (jj_2_51(4)) {\n jj_consume_token(W);\n } else if (jj_2_52(4)) {\n jj_consume_token(S);\n } else {\n jj_consume_token(-1);\n throw new ParseException();\n }\n } else if (jj_2_66(4)) {\n jj_consume_token(CHECK);\n if (jj_2_53(4)) {\n jj_consume_token(C);\n } else if (jj_2_54(4)) {\n jj_consume_token(B);\n } else {\n jj_consume_token(-1);\n throw new ParseException();\n }\n numero();\n } else if (jj_2_67(4)) {\n block();\n } else if (jj_2_68(4)) {\n repeat();\n } else if (jj_2_69(4)) {\n conditional();\n } else if (jj_2_70(4)) {\n define();\n } else if (jj_2_71(4)) {\n function();\n } else if (jj_2_72(4)) {\n funcall();\n } else if (jj_2_73(4)) {\n varcall();\n } else {\n jj_consume_token(-1);\n throw new ParseException();\n }\n } else {\n label_13:\n while (true) {\n if (jj_2_74(4)) {\n ;\n } else {\n break label_13;\n }\n jj_consume_token(34);\n }\n }\n }", "@Override\n\tpublic void processCommand(String s)\n\t{\n\t\tif (s.contentEquals(\"atStart\"))\n\t\t{\n\t\t\tprinttest(s);\n\t\t\tSystem.out.println(isAtStart());\n\t\t}\n\t\telse if (s.contentEquals(\"atEnd\"))\n\t\t{\n\t\t\tprinttest(s);\n\t\t\tSystem.out.println(isAtEnd());\n\t\t}\n\t\telse if (s.contentEquals(\"moveToStart\"))\n\t\t{\n\t\t\tmoveToStart();\n\t\t\tprinttest(s);\n\t\t}\n\t\telse if (s.contentEquals(\"moveToEnd\"))\n\t\t{\n\t\t\tmoveToEnd();\n\t\t\tprinttest(s);\n\t\t}\n\t\telse if (s.contentEquals(\"toString\"))\n\t\t{\n\t\t\tprinttest(s);\n\t\t}\n\t\telse if (s.startsWith(\"toStringCursor\"))\n\t\t{\n\t\t\tprinttest(s);\n\t\t}\n\t\telse if (s.contentEquals(\"moveLeft\"))\n\t\t{\n\t\t\tmoveLeft();\n\t\t\tprinttest(s);\n\t\t}\n\t\telse if (s.contentEquals(\"moveRight\"))\n\t\t{\n\t\t\tmoveRight();\n\t\t\tprinttest(s);\n\t\t}\n\t\t\n\t\t//ERROR CHECKING\n\t\telse if(left.isEmpty() && right.isEmpty())\n\t\t{\n\t\t\t//we have no inputted characters\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"Now executing the command \" + s + \"...\");\n\t\t\tSystem.out.println(\"The Results of this command are:\");\n\t\t\tSystem.out.println(\"Sorry but you need to input something before using that command...\");\n\t\t}\n\t\telse if (s.startsWith(\"insertChar\"))\n\t\t{\n\t\t\tinsertChar(s.charAt(s.length() - 1));\n\t\t\tprinttest(s);\n\t\t}\n\t\telse if (s.contentEquals(\"backspace\"))\n\t\t{\n\t\t\tbackspace();\n\t\t\tprinttest(s);\n\t\t}\n\t\telse if (s.contentEquals(\"delete\"))\n\t\t{\n\t\t\tdelete();\n\t\t\tprinttest(s);\n\t\t}\n\t\telse if (s.startsWith(\"search\"))\n\t\t{\n\t\t\tsearch(s.charAt(s.length() - 1));\n\t\t\tprinttest(s);\n\t\t}\n\t\t\n\t\t//ERORR CHECKING\n\t\telse\n\t\t{\n\t\t\t//it is an unaccepted command, doing it this way since we cant pass two strings to printtest\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"Now executing the command \" + s + \"...\");\n\t\t\tSystem.out.println(\"The Results of this command are:\");\n\t\t\tSystem.out.println(\"Sorry but this is not valid command...\");\n\t\t}\n\n\t}", "void processCommand (String command, ZMsg msg);", "public void processCommand() {\n if (cam != null) {\n // No commands if no draw canvas to retrieve them from!\n if (this.cam.getDr().isKeyPressed(KeyEvent.VK_UP) || StdDraw.isKeyPressed(KeyEvent.VK_UP))\n this.setR(this.getR().minus(this.getFacingVector().times(1e8)));\n if (this.cam.getDr().isKeyPressed(KeyEvent.VK_DOWN) || StdDraw.isKeyPressed(KeyEvent.VK_DOWN)) \n this.setR(this.getR().plus(this.getFacingVector().times(1e8)));\n if (this.cam.getDr().isKeyPressed(KeyEvent.VK_LEFT) || StdDraw.isKeyPressed(KeyEvent.VK_LEFT)) \n this.rot += FOV_INCREMENT;\n if (this.cam.getDr().isKeyPressed(KeyEvent.VK_RIGHT) || StdDraw.isKeyPressed(KeyEvent.VK_RIGHT)) \n this.rot -= FOV_INCREMENT; \n }\n }", "protected void handleCommand(List<Command> commands, Command c)\n\t{\n\t\tList<String> uniques = new ArrayList<String>();\n\t\tuniques.add(\"#weapon\");\n\t\tuniques.add(\"#custommagic\");\n\t\tuniques.add(\"#magicskill\");\n\t\tuniques.add(\"#magicboost\");\n\t\t\n\t\tint copystats = -1;\n\n\t\tc = new Command(c.command, c.args);\n\t\tCommand old = null;\n\t\tfor(Command cmd : commands)\n\t\t{\n\t\t\tif(cmd.command.equals(c.command))\n\t\t\t\told = cmd;\n\t\t\t\n\t\t\tif(cmd.command.equals(\"#copystats\"))\n\t\t\t\tcopystats = Integer.parseInt(cmd.args.get(0));\n\t\t}\n\t\t\n\n\t\t// If the unit has #copystats it doesn't have defined stats. Thus we need to fetch value from database\n\t\tif(c.args.size() > 0 && (c.args.get(0).startsWith(\"+\")) && copystats != -1 && old == null)\n\t\t{\n\t\t\tString value = this.nationGen.units.GetValue(copystats + \"\", c.command.substring(1));\n\t\t\tif(value.equals(\"\"))\n\t\t\t\tvalue = \"0\";\n\t\t\t\n\t\t\told = new Command(c.command, value);\n\t\t\tcommands.add(old);\t\n\t\t\t\n\t\t}\n\t\n\t\t\n\t\tif(old != null && !uniques.contains(c.command))\n\t\t{\n\n\t\t\t\n\t\t\t/*\n\t\t\tif(this.tags.contains(\"sacred\") && c.command.equals(\"#gcost\"))\n\t\t\t\tSystem.out.println(c.command + \" \" + c.args);\n\t\t\t*/\n\t\t\tfor(int i = 0; i < c.args.size(); i++)\n\t\t\t{\n\t\t\t\n\t\t\t\tString arg = c.args.get(i);\n\t\t\t\tString oldarg = old.args.get(i);\n\t\t\t\tif(arg.startsWith(\"+\") || (arg.startsWith(\"-\") && !arg.startsWith(\"--\")))\n\t\t\t\t{\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(arg.startsWith(\"+\"))\n\t\t\t\t\t\targ = arg.substring(1);\n\t\t\t\t\t\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\toldarg = \"\" + (Integer.parseInt(oldarg) + Integer.parseInt(arg));\n\t\t\t\t\t\told.args.set(i, oldarg);\n\t\t\t\t\t}\n\t\t\t\t\tcatch(NumberFormatException e)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"FATAL ERROR 1: Argument parsing \" + oldarg + \" + \" + arg + \" on \" + c + \" caused crash.\");\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(arg.startsWith(\"*\"))\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\targ = arg.substring(1);\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\toldarg = \"\" + (int)(Integer.parseInt(oldarg) * Double.parseDouble(arg));\n\t\t\t\t\t\told.args.set(i, oldarg);\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"FATAL ERROR 2: Argument parsing \" + oldarg + \" * \" + arg + \" on \" + c.command + \" caused crash.\");\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(!uniques.contains(c.command))\n\t\t\t\t\t{\n\t\t\t\t\t\toldarg = arg;\n\t\t\t\t\t\told.args.set(i, oldarg);\n\t\t\t\t\t\tcontinue;\n\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\tcommands.add(c);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse \n\t\t{\n\t\t\n\t\t\t\n\t\t\tfor(int i = 0; i < c.args.size(); i++)\n\t\t\t{\n\t\t\t\tif(c.args.get(i).startsWith(\"+\"))\n\t\t\t\t\tc.args.set(i, c.args.get(i).substring(1));\n\t\t\t\telse if(c.args.get(i).startsWith(\"*\"))\n\t\t\t\t\tc.args.set(i, 0 + \"\");\n\n\t\t\t}\n\n\t\t\tcommands.add(c);\n\t\t}\n\t\n\t\t\n\n\t}", "@Override\r\n public void run() {\r\n AccountDTO acct = null;\r\n while (rCmds) {\r\n try {\r\n CmdLine cmdLine = new CmdLine(readNextLine());\r\n switch (cmdLine.getCmd()) {\r\n case HELP:\r\n defineCommandUsage();\r\n break;\r\n case QUIT:\r\n activeUser = null;\r\n rCmds = false;\r\n break;\r\n case REGISTER:\r\n fserver.createAccount(cmdLine.getParameter(0), cmdLine.getParameter(1));\r\n break;\r\n case LOGIN:\r\n login(cmdLine.getParameter(0), cmdLine.getParameter(1), acct);\r\n break;\r\n case LISTMY:\r\n listMy();\r\n break;\r\n case LISTALL:\r\n listAll();\r\n break;\r\n case UPLOAD:\r\n upload(cmdLine.getParameter(0), cmdLine.getParameter(1), cmdLine.getParameter(2));\r\n break;\r\n case DOWNLOAD:\r\n download(cmdLine.getParameter(0));\r\n break;\r\n case CHANGE:\r\n change(cmdLine.getParameter(0), cmdLine.getParameter(1), cmdLine.getParameter(2));\r\n break;\r\n case DELETE:\r\n delete(cmdLine.getParameter(0));\r\n break;\r\n case LOGOUT:\r\n activeUser = null;\r\n lIn = false;\r\n break;\r\n default:\r\n outMgr.println(\"illegal command\");\r\n }\r\n } catch (Exception e) {\r\n outMgr.println(\"Operation failed\");\r\n outMgr.println(e.getMessage());\r\n }\r\n }\r\n }", "public void updateCommands ( ) {\n\t\texecute ( handle -> handle.updateCommands ( ) );\n\t}", "private void commandProgramBasic(String command)\n {\n String[] array = command.split(\" \");\n\n if(array[0].equals(\"init\"))\n {\n System.out.println(\"The program will now read the file.\");\n input.readFile();\n } else if(array[0].equals(\"run\"))\n {\n int runTime = Integer.parseInt(array[1]);\n System.out.println(\"Please wait while the data is stored.\");\n System.out.println(\"The filled data containers will be printed shortly.\");\n input.runProgram(runTime);\n } else if(array[0].equals(\"clear\"))\n {\n System.out.println(\"The data containers will now be cleared.\");\n input.clear();\n } else if(array[0].equals(\"exit\"))\n {\n scanner.close();\n } \n\n askUser();\n }", "public void parseCommand(CommandType command) throws ExecutionException, InterruptedException {\n try {\r\n if (lock.isLocked(new UserSingleType(command.event().getMessageAuthor().asUser().get(), command.event().getServer().get()))) {\r\n command.event().getMessage().delete();\r\n return;\r\n } else if(lock.isChLocked(new UserChannelLockType(new UserSingleType(command.event().getMessageAuthor().asUser().get(), command.event().getServer().get()), command.event().getChannel()))){\r\n command.event().getMessage().delete();\r\n return;\r\n }\r\n }catch (Exception ignored){}\r\n if(command.command().startsWith(prefix)) { // to prevent expressions for unrelated messages\r\n command.api().getServerById(command.event().getServer().get().getId()).get();\r\n if (!command.event().getServer().get().hasPermission(command.api().getYourself(), PermissionType.ADMINISTRATOR)) {// Bot permissions check, without administrator access our bot should be not work\r\n command.event().getMessage().reply(\"This bot cannot be work without Administrator permission.\");\r\n return;\r\n }\r\n if (command.command().equals(prefix + commands[0])) commandAction.commandPing(command);\r\n else if (command.command().equals(prefix + commands[1])) commandAction.commandServer(command);\r\n else if (command.command().equals(prefix + commands[2])) commandAction.commandInf(command);\r\n else if (command.command().equals(prefix + commands[3])) commandAction.commandInvite(command);\r\n else if (command.command().equals(prefix + commands[4])) commandAction.commandKick(command);\r\n else if (command.command().equals(prefix + commands[5])) commandAction.commandBan(command);\r\n else if (command.command().equals(prefix + commands[6])) commandAction.commandMute(command);\r\n else if (command.command().equals(prefix + commands[7])) commandAction.commandUnMute(command);\r\n else if (command.command().equals(prefix + commands[8])) commandAction.commandDef(command);\r\n else if (command.command().equals(prefix + commands[9])) commandAction.commandUnDef(command);\r\n else if (command.command().equals(prefix + commands[10])) commandAction.commandWarn(command);\r\n else if (command.command().equals(prefix + commands[11])) commandAction.commandUnWarn(command);\r\n else if (command.command().equals(prefix + commands[12])) commandAction.commandClear(command);\r\n else if (command.command().equals(prefix + commands[13])) commandAction.commandLock(command, lock);\r\n else if (command.command().equals(prefix + commands[14])) commandAction.commandUnlock(command, lock);\r\n else if (command.command().equals(prefix + commands[15])) commandAction.commandDelete(command);\r\n else if (command.command().equals(prefix + commands[16])) commandAction.commandChLock(command, lock);\r\n else if (command.command().equals(prefix + commands[17])) commandAction.commandChUnlock(command, lock);\r\n else if (command.command().equals(prefix + commands[18])) commandAction.commandUnBanAll(command);\r\n else if (command.command().equals(prefix + commands[19])) commandAction.commandUnlockAll(command, lock);\r\n else if (command.command().equals(prefix + commands[20])) commandAction.commandSet(command);\r\n else if (command.command().equals(prefix + commands[21])) commandAction.commandHelp(command);\r\n }\r\n }", "public void command() {\n List<String> commands = new ArrayList<>();\n commands.add(\": start\");\n commands.add(\": exit\");\n commands.add(\": help\");\n commands.add(\": commands\");\n\n for (String command : commands) {\n System.out.println(command);\n }\n System.out.println();\n }", "private void executeCommand() {\n Command command = null;\n\n switch (commandType) {\n case LIST:\n command = new ListCommand(taskManager, parameterData.getDescription());\n break;\n case DONE:\n command = new DoneCommand(taskManager, parameterData.getTaskNumber());\n break;\n case TODO:\n command = new AddCommand(taskManager, TaskType.TODO, parameterData.getDescription());\n break;\n case DEADLINE:\n command = new AddCommand(taskManager,\n TaskType.DEADLINE, parameterData.getDescription(),\n parameterData.getDateTime());\n break;\n case EVENT:\n command = new AddCommand(taskManager,\n TaskType.EVENT, parameterData.getDescription(),\n parameterData.getDateTime());\n break;\n case DELETE:\n command = new DeleteCommand(taskManager, parameterData.getTaskNumber());\n break;\n case BYE:\n command = new ByeCommand(taskManager);\n break;\n case FIND:\n command = new FindCommand(taskManager,\n parameterData.getFilterString(),\n parameterData.getMatchDate(),\n parameterData.getTimeSearch());\n break;\n case HELP:\n command = new HelpCommand(taskManager);\n break;\n default:\n commandUi.printNoCommandRan();\n }\n\n try {\n command.execute();\n } catch (IndexOutOfBoundsException e) {\n commandUi.printTaskDoneNotInRange();\n } catch (IllegalStateException e) {\n commandUi.printInvalidParameters();\n }\n }", "public interface Commander {\r\n\t\r\n\t/**\r\n\t * This will issue a command. It returns a receipt for the issuance, not for the other all interaction.\r\n\t * @param commandToIssue The command to issue.\r\n\t * @throws things.thinger.SystemException\r\n\t */\r\n\tpublic Receipt issueCommand(Command\t\tcommandToIssue) throws SystemException;\r\n\t\r\n\t/**\r\n\t * Query the reponse progress a command. It is up to the implementation as to when responses are handled. If they\r\n\t * are not handled in a separate thread, it is possible this call with take time to handle responses. The implementation will\r\n\t * make a best-effort to keep InterruptedExceptions from fouling the process. If it successful, the interruption will propagate\r\n\t * as a simple WARNING level SystemException. If not, you could see anything up to a PANIC.\r\n\t * @param commandReceipt The issuance receipt. \r\n\t * @return A response object.\r\n\t * @throws things.thinger.SystemException\r\n\t */\r\n\tpublic CommandResponse queryResponse(Receipt\tcommandReceipt) throws SystemException;\r\n\t\r\n\t\r\n\t/**\r\n\t * Allow the disposal procecure to run. It is safe to call this any time. It will sweep any DISPOSED responses\r\n\t * from the system, which may build up over time. The CommandResponse implementations may or may not call it.\r\n\t * @throws things.thinger.SystemException\r\n\t */\r\n\tpublic void disposal() throws SystemException;\r\n\t\r\n}", "static int onShellCommand(Shell shell, String cmd) {\n char c;\n List<AppOpsManager.PackageOps> ops;\n if (cmd == null) {\n return shell.handleDefaultCommands(cmd);\n }\n PrintWriter pw = shell.getOutPrintWriter();\n PrintWriter err = shell.getErrPrintWriter();\n try {\n int i = 0;\n switch (cmd.hashCode()) {\n case -1703718319:\n if (cmd.equals(\"write-settings\")) {\n c = 4;\n break;\n }\n c = 65535;\n break;\n case -1166702330:\n if (cmd.equals(\"query-op\")) {\n c = 2;\n break;\n }\n c = 65535;\n break;\n case 102230:\n if (cmd.equals(\"get\")) {\n c = 1;\n break;\n }\n c = 65535;\n break;\n case 113762:\n if (cmd.equals(\"set\")) {\n c = 0;\n break;\n }\n c = 65535;\n break;\n case 3540994:\n if (cmd.equals(\"stop\")) {\n c = 7;\n break;\n }\n c = 65535;\n break;\n case 108404047:\n if (cmd.equals(\"reset\")) {\n c = 3;\n break;\n }\n c = 65535;\n break;\n case 109757538:\n if (cmd.equals(\"start\")) {\n c = 6;\n break;\n }\n c = 65535;\n break;\n case 2085703290:\n if (cmd.equals(\"read-settings\")) {\n c = 5;\n break;\n }\n c = 65535;\n break;\n default:\n c = 65535;\n break;\n }\n switch (c) {\n case 0:\n int res = shell.parseUserPackageOp(true, err);\n if (res < 0) {\n return res;\n }\n String modeStr = shell.getNextArg();\n if (modeStr == null) {\n err.println(\"Error: Mode not specified.\");\n return -1;\n }\n int mode = Shell.strModeToMode(modeStr, err);\n if (mode < 0) {\n return -1;\n }\n if (!shell.targetsUid && shell.packageName != null) {\n shell.mInterface.setMode(shell.op, shell.packageUid, shell.packageName, mode);\n return 0;\n } else if (!shell.targetsUid || shell.packageName == null) {\n shell.mInterface.setUidMode(shell.op, shell.nonpackageUid, mode);\n return 0;\n } else {\n try {\n shell.mInterface.setUidMode(shell.op, shell.mInternal.mContext.getPackageManager().getPackageUid(shell.packageName, shell.userId), mode);\n return 0;\n } catch (PackageManager.NameNotFoundException e) {\n return -1;\n }\n }\n case 1:\n int res2 = shell.parseUserPackageOp(false, err);\n if (res2 < 0) {\n return res2;\n }\n List<AppOpsManager.PackageOps> ops2 = new ArrayList<>();\n int[] iArr = null;\n if (shell.packageName != null) {\n List<AppOpsManager.PackageOps> r = shell.mInterface.getUidOps(shell.packageUid, shell.op != -1 ? new int[]{shell.op} : null);\n if (r != null) {\n ops2.addAll(r);\n }\n IAppOpsService iAppOpsService = shell.mInterface;\n int i2 = shell.packageUid;\n String str = shell.packageName;\n if (shell.op != -1) {\n iArr = new int[]{shell.op};\n }\n List<AppOpsManager.PackageOps> r2 = iAppOpsService.getOpsForPackage(i2, str, iArr);\n if (r2 != null) {\n ops2.addAll(r2);\n }\n } else {\n IAppOpsService iAppOpsService2 = shell.mInterface;\n int i3 = shell.nonpackageUid;\n if (shell.op != -1) {\n iArr = new int[]{shell.op};\n }\n ops2 = iAppOpsService2.getUidOps(i3, iArr);\n }\n if (ops2 != null) {\n if (ops2.size() > 0) {\n long now = System.currentTimeMillis();\n int i4 = 0;\n while (i4 < ops2.size()) {\n AppOpsManager.PackageOps packageOps = ops2.get(i4);\n if (packageOps.getPackageName() == null) {\n pw.print(\"Uid mode: \");\n }\n List<AppOpsManager.OpEntry> entries = packageOps.getOps();\n int j = i;\n while (j < entries.size()) {\n AppOpsManager.OpEntry ent = entries.get(j);\n pw.print(AppOpsManager.opToName(ent.getOp()));\n pw.print(\": \");\n pw.print(AppOpsManager.modeToName(ent.getMode()));\n if (ent.getTime() != 0) {\n pw.print(\"; time=\");\n ops = ops2;\n TimeUtils.formatDuration(now - ent.getTime(), pw);\n pw.print(\" ago\");\n } else {\n ops = ops2;\n }\n if (ent.getRejectTime() != 0) {\n pw.print(\"; rejectTime=\");\n TimeUtils.formatDuration(now - ent.getRejectTime(), pw);\n pw.print(\" ago\");\n }\n if (ent.getDuration() == -1) {\n pw.print(\" (running)\");\n } else if (ent.getDuration() != 0) {\n pw.print(\"; duration=\");\n TimeUtils.formatDuration(ent.getDuration(), pw);\n }\n pw.println();\n j++;\n ops2 = ops;\n }\n i4++;\n i = 0;\n }\n return 0;\n }\n }\n pw.println(\"No operations.\");\n if (shell.op <= -1 || shell.op >= 91) {\n return 0;\n }\n pw.println(\"Default mode: \" + AppOpsManager.modeToName(AppOpsManager.opToDefaultMode(shell.op)));\n return 0;\n case 2:\n int res3 = shell.parseUserOpMode(1, err);\n if (res3 < 0) {\n return res3;\n }\n List<AppOpsManager.PackageOps> ops3 = shell.mInterface.getPackagesForOps(new int[]{shell.op});\n if (ops3 == null || ops3.size() <= 0) {\n pw.println(\"No operations.\");\n return 0;\n }\n for (int i5 = 0; i5 < ops3.size(); i5++) {\n AppOpsManager.PackageOps pkg = ops3.get(i5);\n boolean hasMatch = false;\n List<AppOpsManager.OpEntry> entries2 = ops3.get(i5).getOps();\n int j2 = 0;\n while (true) {\n if (j2 < entries2.size()) {\n AppOpsManager.OpEntry ent2 = entries2.get(j2);\n if (ent2.getOp() == shell.op && ent2.getMode() == shell.mode) {\n hasMatch = true;\n } else {\n j2++;\n }\n }\n }\n if (hasMatch) {\n pw.println(pkg.getPackageName());\n }\n }\n return 0;\n case 3:\n String packageName = null;\n int userId = -2;\n while (true) {\n String argument = shell.getNextArg();\n if (argument == null) {\n if (userId == -2) {\n userId = ActivityManager.getCurrentUser();\n }\n shell.mInterface.resetAllModes(userId, packageName);\n pw.print(\"Reset all modes for: \");\n if (userId == -1) {\n pw.print(\"all users\");\n } else {\n pw.print(\"user \");\n pw.print(userId);\n }\n pw.print(\", \");\n if (packageName == null) {\n pw.println(\"all packages\");\n } else {\n pw.print(\"package \");\n pw.println(packageName);\n }\n return 0;\n } else if (\"--user\".equals(argument)) {\n userId = UserHandle.parseUserArg(shell.getNextArgRequired());\n } else if (packageName == null) {\n packageName = argument;\n } else {\n err.println(\"Error: Unsupported argument: \" + argument);\n return -1;\n }\n }\n case 4:\n shell.mInternal.enforceManageAppOpsModes(Binder.getCallingPid(), Binder.getCallingUid(), -1);\n long token = Binder.clearCallingIdentity();\n try {\n synchronized (shell.mInternal) {\n shell.mInternal.mHandler.removeCallbacks(shell.mInternal.mWriteRunner);\n }\n shell.mInternal.writeState();\n pw.println(\"Current settings written.\");\n return 0;\n } finally {\n Binder.restoreCallingIdentity(token);\n }\n case 5:\n shell.mInternal.enforceManageAppOpsModes(Binder.getCallingPid(), Binder.getCallingUid(), -1);\n long token2 = Binder.clearCallingIdentity();\n try {\n shell.mInternal.readState();\n pw.println(\"Last settings read.\");\n return 0;\n } finally {\n Binder.restoreCallingIdentity(token2);\n }\n case 6:\n int res4 = shell.parseUserPackageOp(true, err);\n if (res4 < 0) {\n return res4;\n }\n if (shell.packageName == null) {\n return -1;\n }\n shell.mInterface.startOperation(shell.mToken, shell.op, shell.packageUid, shell.packageName, true);\n return 0;\n case 7:\n int res5 = shell.parseUserPackageOp(true, err);\n if (res5 < 0) {\n return res5;\n }\n if (shell.packageName == null) {\n return -1;\n }\n shell.mInterface.finishOperation(shell.mToken, shell.op, shell.packageUid, shell.packageName);\n return 0;\n default:\n return shell.handleDefaultCommands(cmd);\n }\n } catch (RemoteException e2) {\n pw.println(\"Remote exception: \" + e2);\n return -1;\n }\n }", "java.lang.String getCommand();", "public abstract boolean commandExecution(CommandSender sender, String label, String[] args);", "public abstract Menu execute(String commandKey);", "private void handeComparisonMenuCommands() throws Exception {\n printOptionsMessage();\n\n while (true) {\n String command = scanner.nextLine();\n\n\n\n if (command.equals(\"1\")) {\n toggleSelectedAlgorithm(0);\n } else if (command.equals(\"2\")) {\n toggleSelectedAlgorithm(1);\n } else if (command.equals(\"3\")) {\n toggleSelectedAlgorithm(2);\n } else if (command.equals(\"s\")) {\n intSelect.start();\n startComparison(selected);\n return;\n } else if (command.equals(\"r\")) {\n startComparison(selected);\n return;\n } else if (command.equals(\"x\")) {\n break;\n }\n\n comparisonMenuOptions();\n printOptionsMessage();\n }\n }", "private void handleCommand(String command, Update update){\r\n\t\tSendMessage message= new SendMessage();\t\t\r\n\t\tLong chatId = update.getMessage().getChatId();\r\n\t\tswitch (command){\r\n\t\tcase BotConfig.START_COMMAND:\t\t\t\t\r\n\t\t\tmessage.setText(BotConfig.WELCOME_STRING);\r\n\t\t\tbreak;\r\n\t\tcase BotConfig.HELP_COMMAND:\t\t\t\r\n\t\t\tmessage.setText(BotConfig.HELP_STRING);\r\n\t\t\tbreak;\r\n\t\tcase BotConfig.POLL_COMMAND:\t\t\t\r\n\t\t\tmessage.setText(BotConfig.POLL_STRING);\r\n\t\t\tpoll = new Poll();//Iniciamos la clase...\r\n\t\t\tisPolling = true;//\"Encendemos\" el modo encuesta.\t\t\t\r\n\t\t\tbreak;\r\n\t\tcase BotConfig.POLL_COMMAND_DONE:\r\n\t\t\tisPolling = false;//Reiniciamos la variable al finalizar el comando.\r\n\t\t\thaveQuestion = false;//Reiniciamos la variable para la pregunta.\r\n\t\t\tsendSurvey = true;//Marcamos para enviar la encuesta.\t\t\t\t\r\n\t\t\tmessage.setText(BotConfig.POLL_DONE_STRING);\r\n\t\t\tbreak;\r\n\t\t\r\n\t\t}\t\t\r\n\t\ttry {\r\n\t\t\tmessage.setChatId(chatId);\r\n\t\t\texecute(message);//Enviamos el mensaje... \r\n if (sendSurvey == true){ \t\r\n \t\r\n \texecute(poll.sendFinishedSurvey(chatId, poll.createSurveyString(poll.createSurvey())));//Enviamos encuesta antes de compartir.\r\n \tsendSurvey = false;//Marcamos como no enviada despues de haberlo hecho.\r\n }\r\n } catch (TelegramApiException e) {\r\n \tBotLogger.error(LOGTAG, e);//Guardamos mensaje y lo mostramos en pantalla de la consola.\r\n e.printStackTrace();\r\n }\r\n\t}", "public CommandHandler() {\r\n\t\tcommands.put(\"userinfo\", new UserInfoCommand());\r\n\t\tcommands.put(\"verify\", new VerifyCommand());\r\n\t\tcommands.put(\"ping\", new PingCommand());\r\n\t\tcommands.put(\"rapsheet\", new RapsheetCommand());\r\n\t\tcommands.put(\"bet\", new BetCommand());\r\n\t\tcommands.put(\"buttons\", new ButtonCommand());\r\n\r\n\t\t// for each command in commands\r\n\t\t// call getAlternativeName and assign to that key\r\n\t\tcommands.keySet().stream().forEach(key -> {\r\n\t\t\tList<String> alts = commands.get(key).getAlternativeNames();\r\n\t\t\tif (alts != null)\r\n\t\t\t\talts.forEach(a -> commandAlternative.put(a, key));\r\n\t\t});\r\n\t}", "CommandHandler() {\n registerArgument(new ChallengeCmd());\n registerArgument(new CreateCmd());\n }", "private static void performCommands(Temperature temp) {\n\n boolean keepGoing = true;\n while (keepGoing) {\n try {\n // Call each of the three toString() methods upon temp and\n // display the results.\n System.out.printf(\"\\ntoString() yields %s\", temp.toString());\n System.out.printf(\"\\ntoString(true) yields %s\", temp.toString(true));\n System.out.printf(\"\\ntoString(false) yields %s\\n\", temp.toString(false));\n\n // Prompt user to enter a command.\n System.out.print(\"\\nEnter command (H for help): \");\n String command = input.nextLine().trim();\n if (echo) { System.out.println(command); }\n\n // Parse the entered command.\n char operation = Character.toUpperCase(command.charAt(0));\n String rest = command.substring(1).trim();\n double number;\n char scale;\n if (rest.length() != 0) { \n number = parseOutNum(rest);\n scale = parseOutScale(rest);\n }\n else { \n number = 0;\n scale = ' ';\n }\n\n // Perform the command.\n if (operation == SET_TO_CODE) {\n performSetTo(temp, number, scale);\n }\n else if (operation == CHANGE_BY_CODE) {\n performChangeBy(temp, number, scale);\n }\n else if (operation == DIFF_CODE) {\n performDiff(temp, number, scale);\n }\n else if (operation == HELP_CODE) {\n printHelp();\n }\n else if (operation == QUIT_CODE) {\n keepGoing = false;\n }\n else {\n System.out.println(operation + \" is not a known operation code\");\n }\n }\n catch (Exception e) {\n e.printStackTrace(System.out);\n }\n }\n }", "private String parseAndRespond() {\n\t\tList<String> commands = new ArrayList<String>();\n\t\twhile (input.hasNext()) {\n\t\t\tString inputToken = input.next();\n\t\t\tcommands.add(inputToken);\n\t\t\tcommands.get(commands.size()-1).chars().forEach(p -> System.out.println(p));\n\t\t\t\n\t\t\t/* trap telnet control c */\n\t\t\tString telnetControlC = IntStream.of(65533,65533,65533,65533,6).collect(StringBuilder::new,\n\t\t\t\t\tStringBuilder::appendCodePoint, StringBuilder::append).toString();\n\t\t\tif (inputToken.contains(telnetControlC)) { \n\t\t\t\tSystem.out.println(\"Caught you CTRL+C evil!\");\n\t\t\t\treturn EXIT;\n\t\t\t}\n\t\t\tif (commands.get(commands.size()-1).equals(\".\")) {\n\t\t\t\tcommands.remove(commands.size()-1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif (commands.get(commands.size()-1).equals(EXIT)) return EXIT;\n\t\t\t\n\t\t}\n\t\t\n\t\tString response = \"\";\n\t\t/* I'm not sure if I want to trap an error or let it percolate up yet */\n\t\t\n//\t\ttry {\n\t\t\tresponse = commandInterpreter.interpretCommands(commands);\n//\t\t} catch (IOException e) {\n//\t\t\tlogger.log(Level.WARNING, \"Error interpreting commands\", e);\n//\t\t\tresponse = \"Error occured!\";\n//\t\t}\n\t\toutput.format(\"%s\\n>\",response);\n\t\toutput.flush();\n\t\t\n\n\t\treturn \"\";\n\n\t}", "public abstract void execute(CommandSender sender, String[] args);", "private void extractCommand() throws IllegalCommandException {\n if (userInput.contentEquals(COMMAND_WORD_BYE)) {\n commandType = CommandType.BYE;\n } else if (userInput.startsWith(COMMAND_WORD_LIST)) {\n commandType = CommandType.LIST;\n } else if (userInput.startsWith(COMMAND_WORD_DONE)) {\n commandType = CommandType.DONE;\n } else if (userInput.startsWith(COMMAND_WORD_TODO)) {\n commandType = CommandType.TODO;\n } else if (userInput.startsWith(COMMAND_WORD_DEADLINE)) {\n commandType = CommandType.DEADLINE;\n } else if (userInput.startsWith(COMMAND_WORD_EVENT)) {\n commandType = CommandType.EVENT;\n } else if (userInput.startsWith(COMMAND_WORD_DELETE)) {\n commandType = CommandType.DELETE;\n } else if (userInput.startsWith(COMMAND_WORD_FIND)) {\n commandType = CommandType.FIND;\n } else if (userInput.contentEquals(COMMAND_WORD_HELP)) {\n commandType = CommandType.HELP;\n } else {\n throw new IllegalCommandException();\n }\n }", "protected void executeCommand() {\n // build the type string\n StringBuilder stateString = new StringBuilder();\n StringBuilder moveNamesString = new StringBuilder();\n StringBuilder basicPieceString = new StringBuilder();\n StringBuilder factionRingString = new StringBuilder();\n\n // start the state string\n stateString.append(\"emb2;Activate;2;;;2;;;2;;;;1;false;0;-24;,\");\n basicPieceString.append(\"emb2;;2;;;2;;;2;;;;;false;0;0;\");\n\n String moveImage;\n String move = newMoveList.get(0);\n String moveWithoutSpeed = move.substring(1);\n moveImage = dialHeadingImages.get(moveWithoutSpeed);\n\n String speed = move.substring(0,1);\n String moveCode = move.substring(1,2);\n String moveName = maneuverNames.get(moveCode);\n\n basicPieceString.append(\"D2e_\" + xwsShipName + \".png\");\n basicPieceString.append(\";;false;Front Plate;;;false;;1;1;true;;;\");\n\n moveNamesString.append(moveName).append(\" \").append(speed);\n // add in move names\n stateString.append(moveImage);\n stateString.append(\";empty,\"+moveNamesString);\n\n // finish the type string\n stateString.append(\";false;Chosen Move;;;false;;1;1;true;65,130\");\n Embellishment chosenMoveEmb = (Embellishment)Util.getEmbellishment(piece,\"Layer - Chosen Move\");\n Embellishment chosenSpeedEmb = (Embellishment)Util.getEmbellishment(piece, \"Layer - Chosen Speed\");\n Embellishment fullDialEmb = (Embellishment)Util.getEmbellishment(piece, \"Layer - Front Plate\");\n Embellishment ringEmb = (Embellishment)Util.getEmbellishment(piece, \"Layer - Faction Ring\");\n\n factionRingString.append(\"emb2;;2;;;2;;;2;;;;;false;0;0;DialSelect_\");\n factionRingString.append(faction);\n factionRingString.append(\".png;;false;Faction Ring;;;false;;1;1;true;;;\");\n chosenSpeedEmb.setValue(Integer.parseInt(speed)+1);\n\n String injectDialString = \"\";\n int count=0;\n for(String moveItem : newMoveList) {\n count++;\n injectDialString+= moveItem;\n if(count!=newMoveList.size()) injectDialString+=\",\";\n }\n piece.setProperty(\"dialstring\",injectDialString);\n piece.setProperty(\"shipID\", associatedShipID);\n\n // chosen move embellishment looks like: emb2;Activate;2;;;2;;;2;;;;1;false;0;-24;,mFW.png;empty,move;false;Chosen Move;;;false;;1;1;true;65,130;;\n // chosen speed embell looks like: emb2;;2;;;2;;;2;;;;1;false;0;24;kimb5.png,,kimb0.png,kimb1.png,kimb2.png,kimb3.png,kimb4.png;5,empty,0,1,2,3,4;false;Chosen Speed;;;false;;1;1;true;;;\n // basic piece face plate looks like: emb2;;2;;;2;;;2;;;;;false;0;0;D2e_arc170starfighter.png;;false;Front Plate;;;false;;1;1;true;;;\n // faction ring looks like: emb2;;2;;;2;;;2;;;;;false;0;-6;DialSelect_rebelalliance.png;;false;Faction Ring;;;false;;1;1;true;;;\n\n chosenMoveEmb.mySetType(stateString.toString());\n chosenMoveEmb.setValue(1);\n\n fullDialEmb.mySetType(basicPieceString.toString());\n ringEmb.mySetType(factionRingString.toString());\n }", "private void retriveCommand(){\n\t\tdirections.add(\"Turn left.\");\n\t\tdirections.add(\"Walk 20 meters and turn right.\");\n\t\tdirections.add(\"Arrive destination.\");\n\t}" ]
[ "0.7654008", "0.7396491", "0.73099214", "0.71171105", "0.70430857", "0.7041614", "0.70197445", "0.70138", "0.69875056", "0.69785947", "0.69703794", "0.6970316", "0.69506824", "0.690399", "0.6879779", "0.68422073", "0.6832724", "0.67766094", "0.677409", "0.6726003", "0.67238903", "0.67208946", "0.669627", "0.6676667", "0.6669723", "0.66563386", "0.6628848", "0.66169363", "0.6602071", "0.66000414", "0.6579332", "0.6577242", "0.65619266", "0.655832", "0.6558109", "0.6549625", "0.6545426", "0.65450203", "0.65423805", "0.65338254", "0.6529516", "0.65247834", "0.65149534", "0.6513742", "0.65127915", "0.6507737", "0.65014255", "0.6488333", "0.64785445", "0.6467286", "0.6466929", "0.64621806", "0.644878", "0.64360565", "0.6431593", "0.6423447", "0.6423252", "0.6411458", "0.6409479", "0.6402304", "0.6393603", "0.6389662", "0.63776755", "0.6371725", "0.6368685", "0.6366465", "0.63611317", "0.63597274", "0.6349362", "0.63440156", "0.6343743", "0.6336001", "0.63315344", "0.6330092", "0.63282055", "0.63273174", "0.6318548", "0.6306901", "0.6303161", "0.6295037", "0.62940484", "0.62940216", "0.62928027", "0.62808466", "0.62764025", "0.6275648", "0.62707067", "0.6261901", "0.6261015", "0.6240324", "0.6237043", "0.6234798", "0.6234429", "0.6229285", "0.6226434", "0.6222405", "0.62184817", "0.6214235", "0.6212989", "0.6209754" ]
0.68986565
14
Handle message sending and receiving
@Override public void onMessageReceived(MessageReceivedEvent event) { if(event.getAuthor().isBot()) return; Message msg = event.getMessage(); String content = msg.getContentRaw(); if(content.charAt(0) == PREFIX) { handleCommand(msg, content.substring(1)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void messageHandler(String read){\n\n try {\n buffer.append(read);\n }catch (MalformedMessageException e){\n System.out.println(\"[CLIENT] The message received is not in XML format.\");\n }\n\n while(!buffer.isEmpty()) {\n if (buffer.getPong()) pong = true;\n else if (buffer.getPing()) send(\"<pong/>\");\n else {\n try {\n clientController.onReceivedMessage(buffer.get());\n } catch (EmptyBufferException e) {\n System.out.println(\"[CLIENT] The buffer is empty!\");\n }\n }\n }\n\n }", "protected void handleMessage(Message msg) {}", "@Override public void handleMessage(Message msg) {\n super.handleMessage(msg);\n byte[] byteArray = (byte[]) msg.obj;\n int length = msg.arg1;\n byte[] resultArray = length == -1 ? byteArray : new byte[length];\n for (int i = 0; i < byteArray.length && i < length; ++i) {\n resultArray[i] = byteArray[i];\n }\n String text = new String(resultArray, StandardCharsets.UTF_8);\n if (msg.what == BluetoothTalker.MessageConstants.MESSAGE_WRITE) {\n Log.i(TAG, \"we just wrote... [\" + length + \"] '\" + text + \"'\");\n// mIncomingMsgs.onNext(text);\n } else if (msg.what == BluetoothTalker.MessageConstants.MESSAGE_READ) {\n Log.i(TAG, \"we just read... [\" + length + \"] '\" + text + \"'\");\n Log.i(TAG, \" >>r \" + Arrays.toString((byte[]) msg.obj));\n mIncomingMsgs.onNext(text);\n sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// mReadTxt.setText(++ri + \"] \" + text);\n// if (mServerBound && mServerService.isConnected()) {\n// mServerService.sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// } else if (mClientBound && mClientService.isConnected()) {\n// mClientService.sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// }\n// mBluetoothStuff.mTalker.write();\n }\n }", "private void receiveAndDispatchMessage() {\n String response = null;\n try {\n while((response = bufferedReader.readLine()) != null) {\n System.out.println(\"received message from server: \" + response);\n String messageKind = \"\";\n if(response.contains(\":\")) {\n messageKind = response.substring(0, response.indexOf(\":\"));\n } else {\n messageKind = response;\n }\n Bundle bundle = new Bundle();\n bundle.putString(\"response\", response);\n switch (messageKind) {\n case ClientMessageKind.SIGNUPDENIED:\n case ClientMessageKind.SIGNUPOK:\n if(resultReceiverMap.keySet().contains(ActivityNames.COMMONSIGNUPACTIVITY)) {\n resultReceiverMap.get(ActivityNames.COMMONSIGNUPACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.SIGNINDENIED:\n case ClientMessageKind.SIGNINOK:\n if(resultReceiverMap.keySet().contains(ActivityNames.COMMONSIGNINACTIVITY)) {\n resultReceiverMap.get(ActivityNames.COMMONSIGNINACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERLOC:\n if(resultReceiverMap.keySet().contains(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERLOC:\n if(resultReceiverMap.keySet().contains(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.CHATFROMDRIVER:\n if(resultReceiverMap.keySet().contains(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.CHATFROMPASSENGER:\n if(resultReceiverMap.keySet().contains(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERDEST:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.STARTRIDE:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n } else if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.ENDRIDE:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERENDSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERENDSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERCANCEL:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERCANCEL:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.UPDATEPASSENGERPROFILEDENIED:\n case ClientMessageKind.UPDATEPASSENGERPROFILEOKAY:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERUPDATEPROFILEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERUPDATEPROFILEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.UPDATEDRIVERPROFILEDENIED:\n case ClientMessageKind.UPDATEDRIVERPROFILEOKAY:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERUPDATEPROFILEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERUPDATEPROFILEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERREQUESTLOC:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERREQUESTLOC:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n default:\n break;\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public void handleMessage(Message msg) {\n switch (msg.what) {\n case handlerState:\n String readMessage = (String) msg.obj; // msg.arg1 = bytes from connect thread\n ReceivedData.setData(readMessage);\n break;\n\n case handlerState1:\n tempSound = Boolean.parseBoolean((String) msg.obj);\n ReceivedData.setSound(tempSound);\n break;\n\n case handlerState5:\n if(\"ACK\".equals ((String) msg.obj ))\n ReceivedData.clearPPGwaveBuffer();\n break;\n\n }\n ReceivedData.Process();\n }", "public void handleMessage(Message message);", "@Override\r\n public void handleMessage(Message msg) {\n }", "public void handleMessageFromClient(Object msg) {\n\n }", "public abstract void msgHandler(Message msg);", "public abstract void messageReceived(String message);", "@Override\n public void handleMessage(Message message) {}", "@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tswitch (msg.what) {\n\t\t\tcase 0:\n\t\t\t\ttv_read.setText(msg.obj.toString());\n\t\t\t\tToast.makeText(N20PINPadControllerActivity.this, \"recv\",\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "@Override\n public void handleMessage(Message msg) {\n System.out.println(\"recibe mensajes ...\");\n System.out.println(msg.obj);\n }", "void handleMessage(byte messageType, Object message);", "public boolean handleMessage(Message msg) \r\n\t{\t\r\n\t\tswitch (msg.what)\r\n\t\t{\r\n\t\tcase TCPClient.MSG_COMSTATUSCHANGE:\r\n\t\tcase MSG_UIREFRESHCOM:\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t\tUI_RefreshConnStatus ();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase TCPClient.MSG_NEWSTATUSMESSAGE:\r\n\t\tcase MSG_NEWSTATUSMESSAGE:\t\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.e(TAG,\"Status Message ACCE : \" + (String)msg.obj);\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase TCPClient.MSG_CONNECTIONSTART:\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t{\r\n\t\t\t\t\tonRobotConnect (true);\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase TCPClient.MSG_CONNECTIONSTOP:\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t{\r\n\t\t\t\t\tboolean bbNotify;\r\n\t\t\t\t\tsynchronized (this)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbbNotify=_bbCanSend;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tonRobotDisconnect (bbNotify);\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase TCPClient.MSG_SENT:\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t\tlast_sent_msg = (String)msg.obj;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase MSG_CENTER:\r\n\t\t\t{\r\n\t\t\t\tif (isConnecting())\r\n\t\t\t\t{\r\n\t\t\t\t\tstopConnection(true);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tstartConnection();\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private void handleMessage(Message msg) {\n switch (msg.what) {\n case R.id.clientReady: // 음성인식 준비 가능\n txtResult.setText(\"Connected\");\n writer = new AudioWriterPCM(Environment.getExternalStorageDirectory().getAbsolutePath() + \"/NaverSpeechTest\");\n writer.open(\"Test\");\n break;\n case R.id.audioRecording:\n writer.write((short[]) msg.obj);\n break;\n case R.id.partialResult:\n mResult = (String) (msg.obj);\n mResult += mResult;\n txtResult.setText(mResult);\n break;\n case R.id.finalResult: // 최종 인식 결과\n SpeechRecognitionResult speechRecognitionResult1 = (SpeechRecognitionResult) msg.obj;\n List<String> results1 = speechRecognitionResult1.getResults();\n StringBuilder strBuf1 = new StringBuilder();\n for(String result : results1) {\n strBuf1.append(result);\n //strBuf.append(\"\\n\");\n break;\n }\n mResult = strBuf1.toString();\n txtResult.setText(mResult);\n\n requestChatbot();\n\n break;\n case R.id.recognitionError:\n if (writer != null) {\n writer.close();\n }\n mResult = \"Error code : \" + msg.obj.toString();\n txtResult.setText(mResult);\n btnStart.setText(R.string.str_start);\n btnStart.setEnabled(true);\n break;\n case R.id.clientInactive:\n if (writer != null) {\n writer.close();\n }\n btnStart.setText(R.string.str_start);\n btnStart.setEnabled(true);\n break;\n }\n }", "private void handleMessage(EcologyMessage msg) {\n // Check the message type and route them accordingly.\n switch ((Integer) msg.fetchArgument()) {\n // A message destined for a room\n case ROOM_MESSAGE_ID:\n forwardRoomMessage(msg);\n break;\n\n // A message destined for ecology data sync\n case SYNC_DATA_MESSAGE_ID:\n getEcologyDataSync().onMessage(msg);\n break;\n }\n }", "private void HandleMessage(Message message)\n\t{\n\t\tswitch (message.messageType) {\n\t\tcase disconnect: ApplicationManager.Instance().Disconnect();\n\t\t\tbreak;\n\t\tcase log: PrintLogMessageOnTextChat((String)message.message);\n\t\t\tbreak;\n\t\tcase message: PrintMessageOnTextChat((MessageWithTime)message.message);\n\t\t\tbreak;\n\t\tcase UserJoinChannel: UserJoinChannel((ClientData)message.message);\n\t\t\tbreak;\n\t\tcase UserDisconnectChannel: UserDisconnectChannel((ClientData)message.message);\n\t\t\tbreak;\n\t\tcase changeChannel: OnChannelChanged((ChannelData)message.message);\n\t\t\tbreak;\n\t\tcase serverData: data = (ServerData) message.message; \n\t\t\t\t\t\t ApplicationManager.channelsList.DrawChannels(data);\n\t\t\t\tbreak;\n\t\tcase channelInfo: clientsData = (ClientsOnChannelData)message.message;\n\t\t\t\t\t\t ApplicationManager.informationsList.ShowInfo(clientsData);\n\t\t \t\tbreak;\n\t\tcase sendMessageToUser: ApplicationManager.textChat.write((MessageToUser)message.message);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\n public void processMessage(int type, String receivedMsg) {\n }", "abstract public Object handleMessage(Object message) throws Exception;", "void messageSent();", "abstract public boolean handleMessage(int what, int result, Object data, String message, boolean option);", "@Override\n\tprotected void processConnection() {\n\t\t\n\t\twhile(true) {\n\t\t\t\n\t\t\ttry {\n\t\t\t\tint receiverID = (Integer) input.readObject();\n\t\t\t\tString message = (String) input.readObject();\n\t\t\t\t\n\t\t\t\tClientHandler recieverHandler = Server.clientConnections.get(receiverID);\n\t\t\t\tif(recieverHandler == null) {\n\t\t\t\t\tsendData(ERROR_CODE);\n\t\t\t\t\tsendData(\"Not available\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\trecieverHandler.sendData(clientID);\n\t\t\t\t\trecieverHandler.sendData(message);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(ClassNotFoundException classNotFoundException) {\n\t\t\t\tserver.serverGUI.showMessage(\"Unknown object type recieved.\");\n\t\t\t}\n\t\t\tcatch(IOException ioException) {\n\t\t\t\tserver.serverGUI.showMessage(\"Client terminated connection.\\n\");\n\t\t\t\tcloseConnection();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void receive(String msg) {\n\t\t\n\t}", "public void process(PlainMessage msg) throws IOException {\n relay(msg);\n }", "public void handleMessage(Message msg) {\n super.handleMessage(msg);\n switch (msg.what) {\n case 1:\n if (!isStop) {\n updateTimeSpent();\n mHandler.sendEmptyMessageDelayed(1, 1000);\n }\n break;\n case 0:\n break;\n }\n }", "@Override\n public void handleMessage(Message msg) {\n Bundle data = msg.getData();\n if (data.containsKey(\"command\")) {\n if (data.getString(\"command\").equalsIgnoreCase(\"get_data\")) {\n mGetDataMessenger = msg.replyTo;\n getData();\n }\n }\n }", "@Override\n public void onReceive(Object msg) throws Exception {\n }", "@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tswitch (msg.what) {\n\t\t\tcase 911:\n\t\t\t\tqueryMsg();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "public void handleMessage(Message message, Socket socket) throws IOException, HandlingException;", "private void handleServerMessage() throws IOException {\n System.out.println(\"Handeling message for \" + id + \" with type: \" + sm.getType().toString());\n switch (sm.getType()) {\n case REGISTER:\n registrationLoginHandler.register(sm, output);\n break;\n case LOGIN:\n this.user = registrationLoginHandler.login(sm, output);\n break;\n case BOOT:\n bootHandler.boot(user, output);\n break;\n case ADD_CONTACT:\n contactHandler.addContact(sm, user, output);\n handleAddContact();\n break;\n case REMOVE_CONTACT:\n break;\n case UPDATE_NICKNAME:\n break;\n case UPDATE_STATUS:\n break;\n case UPDATE_PROFILE_PIC:\n break;\n case CLIENT_DISCONNECT:\n keepGoing = false;\n close();\n server.remove(id);\n break;\n }\n }", "@Override\n\tpublic void handleMsg(String in) {\n\n\t}", "public void process(Key msg) throws IOException {\n relay(msg);\n }", "@Override\n\tpublic void onMessageRecieved(Message arg0) {\n\t\t\n\t}", "@Override\n\tpublic void msgReceived(Message msg) {\n\n\t}", "@Override\r\n\t\t\t\tpublic synchronized void handleMessage(Message msg) {\n\t\t\t\t\tswitch(msg.what){\r\n\t\t\t\t\t//--------------通用消息-------------------------//\r\n\t\t\t\t\tcase TEACHEREXIST:// 教师端存在,如果没有被初始化,向教师端请求信息\r\n\t\t\t\t\t\t//设置连接状态\r\n\t\t\t\t\t\tif(!initialed){//未初始化,请求初始化信息\r\n\t\t\t\t\t\t\t\t//设置教师端IP\r\n\t\t\t\t\t\t\t\tif(ServerIP == null){\r\n\t\t\t\t\t\t\t\t\tServerIP = msg.getData().getString(\"ServerIP\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tus.SetIP(ServerIP);\r\n\t\t\t\t\t\t\t\t//发送学生信息请求\r\n\t\t\t\t\t\t\t\ttagCommandCode tcmd = new tagCommandCode(\" \",\" \",\" \");//否则为null!!!\r\n\t\t\t\t\t\t\t\ttcmd.SetCmdID(GETSTUINFO);\r\n\t\t\t\t\t\t\t\tus.SendMsg(tcmd.toByteArray());\r\n\t\t\t\t\t\t\t\tLog.i(\"ActivityInfo---Login===>\", \"GETSTUINFO\");\r\n\t\t\t\t\t\t\t\ttcmd.SetCmdID(LOGIN);// 在线ID\r\n\t\t\t\t\t\t\t\tus.SendMsg(tcmd.toByteArray());// 发送消息\r\n\t\t\t\t\t\t\t\tLog.i(\"ActivityInfo---Login===>\", \"Not Initialed\");\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tif(!connected){//发生改变时才操作\r\n\t\t\t\t\t\t\t\tconnected = true;\r\n\t\t\t\t\t\t\t\tpbLandlight.setImageResource(R.drawable.green);//设置为在线\r\n\t\t\t\t\t\t\t\tLog.i(\"LandLight========>\",\"Online!!!\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(ServerIP == null){\r\n\t\t\t\t\t\t\t\tServerIP = msg.getData().getString(\"ServerIP\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcmd.SetCmdID(GETSTUINFO);\r\n\t\t\t\t\t\t\tus.SendMsg(cmd.toByteArray());\r\n\t\t\t\t\t\t\tLog.i(\"ActivityInfo---Login===>\", \"GETSTUINFO\");\r\n\t\t\t\t\t\t\tus.SetIP(ServerIP);\r\n\t\t\t\t\t\t\tcmd.SetCmdID(LOGIN);// 在线ID\r\n\t\t\t\t\t\t\tus.SendMsg(cmd.toByteArray());// 发送消息\r\n\t\t\t\t\t\t\tLog.i(\"ActivityInfo---Login===>\", \"Connected & Initialed\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase ACCEPT://与教师端连接,初始化系统参数\r\n\t\t\t\t\tcase GETSTUINFO_RETURN://获得学生信息\r\n\t\t\t\t\t\tLog.i(\"ActivityInfo---ACCEPT===>\", \"Initialed!\");\r\n\t\t\t\t\t\t//初始化命令\r\n\t\t\t\t\t\ttagCommandCode tcmd = new tagCommandCode(msg.getData().getByteArray(\"data\"));\r\n\t\t\t\t\t\t//初始化信息\r\n\t\t\t\t\t\tString StrLocalIP = getLocalIpAddress();//本地IP\r\n\t\t\t\t\t\tString subIP = StrLocalIP.substring(0, StrLocalIP.lastIndexOf(\".\")+1);//网段\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString StrName; \r\n\t\t\t\t\t\tif(tcmd.strName!= null){\r\n\t\t\t\t\t\t\tStrName = tcmd.strName;//学生姓名\r\n\t\t\t\t\t\t}else StrName =\"STU\"+StrLocalIP.substring(StrLocalIP.lastIndexOf(\".\"),StrLocalIP.length());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(ServerIP==null){\r\n\t\t\t\t\t\t\tServerIP = msg.getData().getString(\"ServerIP\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//显示到界面\r\n\t\t\t\t\t\ttvIP.setText(StrLocalIP);\r\n\t\t\t\t\t\ttvName.setText(StrName);\r\n\t\t\t\t\t\tString strSeat = \"A1\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//写入\r\n\t\t\t\t\t\tif(cmd == null){\r\n\t\t\t\t\t\t\tcmd = new tagCommandCode(StrLocalIP,strSeat,StrName,subIP);//座位号!!!\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tcmd.strIP = StrLocalIP;\r\n\t\t\t\t\t\t\tcmd.strName = StrName;\r\n\t\t\t\t\t\t\tcmd.subIP = subIP;\r\n\t\t\t\t\t\t\tcmd.strSeat = strSeat;\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\tUserInfo mycmd = ((UserInfo) getApplicationContext());\r\n\t\t\t\t\t\tmycmd.getInstant(cmd);\r\n\t\t\t\t\t\tmycmd.setIP(ServerIP);\r\n\t\t\t\t\t\t//标记位\r\n\t\t\t\t\t\tinitialed = true;\r\n\t\t\t\t\t\tconnected = true;\r\n\t\t\t\t\t\tpbLandlight.setImageResource(R.drawable.green);//设置为在线\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase TIMEOUTCONNECTION://掉线\r\n//\t\t\t\t\t\t//设置连接显示\r\n\t\t\t\t\t\tif (!initialed || connected) {\r\n\t\t\t\t\t\t\tunconnected();\r\n\t\t\t\t\t\t\tconnected = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase CLEARRAISEHAND:\r\n\t\t\t\t\t\tHand.setImageResource(R.drawable.hand_on);\r\n\t\t\t\t\t\tbHandup = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase ENABLERAISEHAND:\r\n\t\t\t\t\t\tHand.setEnabled(true);\r\n\t\t\t\t\t\tHand.setImageResource(R.drawable.hand_on);\r\n\t\t\t\t\t\tbHandup = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase DISRAISEHAND:\r\n\t\t\t\t\t\tHand.setEnabled(false);\r\n\t\t\t\t\t\tHand.setImageResource(R.drawable.hand_disable);\r\n\t\t\t\t\t\tbHandup = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase SETVOLUME://老师调节音量\r\n\t\t\t\t\t\ttagCommandCode t = new tagCommandCode(msg.getData().getByteArray(\"data\"));\r\n\t\t\t\t\t\tseekBar.setProgress(t.iReserver[0]);\r\n\t\t\t\t\t\taudioManager.setStreamVolume(AudioManager.STREAM_MUSIC,t.iReserver[0], 0);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase NOTIFY:\r\n\t\t\t\t\t\t byte[] Note = new byte[480];\r\n\t\t\t\t\t\t System.arraycopy(msg.getData().getByteArray(\"data\"), DATALONG-480, Note, 0, 480);\r\n\t\t\t\t\t\tAlertDialog.Builder NotifyDialog= new AlertDialog.Builder(PlayerActivityfullscreen.this);\r\n\t\t\t\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tNotifyDialog.setTitle(\"通知\").setMessage(new String(Note,\"GBK\"))\r\n\t\t\t\t\t\t\t.setCancelable(false)\r\n\t\t\t\t\t\t\t.setNegativeButton(\"关闭\", new DialogInterface.OnClickListener() { \r\n\t\t\t\t\t\t\t public void onClick(DialogInterface dialog, int id) { \r\n\t\t\t\t\t\t\t dialog.cancel(); \r\n\t\t\t\t\t\t\t } \r\n\t\t\t\t\t\t\t }).create().show();\r\n\t\t\t\t\t\t} catch (UnsupportedEncodingException e) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t break;\r\n\t\t\t\t\tcase CLASSRESUME://上课--跟读可用,录音等待命令,默认不允许,上课置灰\r\n\t\t\t\t\tcase SELFSTUDYOFF://取消自助学习-同上课\r\n\t\t\t\t\t\tIntent intent = new Intent().setClass(PlayerActivityfullscreen.this,\r\n\t\t\t\t\t\t\t\tClassTeachActivity.class);\r\n\t\t\t\t\t\tintent.setData(Uri.parse(\"0\"));\r\n\t\t\t\t\t\tPlayerActivityfullscreen.this.startActivity(intent);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t//---------------自有消息----------------------//\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "@Override\n\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\tswitch (msg.what) {\n\t\t\t\tcase UDPHelper.HANDLER_MESSAGE_BIND_ERROR:\n\t\t\t\t\tLog.e(\"my\", \"HANDLER_MESSAGE_BIND_ERROR\");\n\t\t\t\t\tT.showShort(mContext, R.string.port_is_occupied);\n\t\t\t\t\tbreak;\n\t\t\t\tcase UDPHelper.HANDLER_MESSAGE_RECEIVE_MSG:\n\t\t\t\t\tisReceive = true;\n\t\t\t\t\tLog.e(\"my\", \"HANDLER_MESSAGE_RECEIVE_MSG\");\n\t\t\t\t\t// NormalDialog successdialog=new NormalDialog(mContext);\n\t\t\t\t\t// successdialog.successDialog();\n\t\t\t\t\tT.showShort(mContext, R.string.set_wifi_success);\n\t\t\t\t\tmHelper.StopListen();\n\t\t\t\t\tBundle bundle = msg.getData();\n\t\t\t\t\t\n\t\t\t\t\tIntent it = new Intent();\n\t\t\t\t\tit.setAction(Constants.Action.RADAR_SET_WIFI_SUCCESS);\n\t\t\t\t\tsendBroadcast(it);\n\t\t\t\t\tFList flist = FList.getInstance();\n\t\t\t\t\tflist.updateOnlineState();\n\t\t\t\t\tflist.searchLocalDevice();\n\n\t\t\t\t\tString contactId = bundle.getString(\"contactId\");\n\t\t\t\t\tString frag = bundle.getString(\"frag\");\n\t\t\t\t\tString ipFlag = bundle.getString(\"ipFlag\");\n\t\t\t\t\tContact saveContact = new Contact();\n\t\t\t\t\tsaveContact.contactId = contactId;\n\t\t\t\t\tsaveContact.activeUser = NpcCommon.mThreeNum;\n\t\t\t\t\tIntent add_device = new Intent(mContext,\n\t\t\t\t\t\t\tAddContactNextActivity.class);\n\t\t\t\t\tadd_device.putExtra(\"contact\", saveContact);\n\t\t\t\t\tif (Integer.parseInt(frag) == Constants.DeviceFlag.UNSET_PASSWORD) {\n\t\t\t\t\t\tadd_device.putExtra(\"isCreatePassword\", true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tadd_device.putExtra(\"isCreatePassword\", false);\n\t\t\t\t\t}\n\t\t\t\t\tadd_device.putExtra(\"isfactory\", true);\n\t\t\t\t\tadd_device.putExtra(\"ipFlag\", ipFlag);\n\t\t\t\t\tstartActivity(add_device);\n\t\t\t\t\t// Intent modify = new Intent();\n\t\t\t\t\t// modify.setClass(mContext, LocalDeviceListActivity.class);\n\t\t\t\t\t// mContext.startActivity(modify);\n\t\t\t\t\tfinish();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcancleTimer();\n\t\t\t}", "void onMessageReceived(Message message);", "public void OnMessageReceived(String msg);", "public void handle(int ID, Object message){}", "public synchronized void receivePost(int messageId, String message) {\n\t\tif (isClosed()) {\n\t\t\tassert false;\n\t\t\treturn; // i am closed\n\t\t}\n\t\t// receivePost is always invoked in an extra thread\n\t\tif (message == null || message.length() == 0) {\n\t\t\t// handle receiving of no data messages\n\t\t\tswitch(messageId) {\n\t\t\tcase MESSAGE_ID_OFFERING_DATA:\t\t\t\t\t\n\t\t\t\t// other got nothing to offer, so we will not receive anything\n\t\t\t\tmOwnRequestDataReceived = true;\n\t\t\t\tmPartnerOfferReceived = true;\n\t\t\t\tbreak;\n\t\t\tcase MESSAGE_ID_REQUESTING_DATA:\n\t\t\t\t// other does not want anything\n\t\t\t\tmPartnerRequestSatisfied = true;\n\t\t\t\tbreak;\n\t\t\tcase MESSAGE_ID_SENDING_DATA:\n\t\t\t\t// well... theoretically my requested data could not be received, but since other will not sent more than this, we will say ok\n\t\t\t\tmOwnRequestDataReceived = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// I don't even understand what you tell me\n\t\t\t\tclose();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\t// there is data available\n\t\t\tswitch (messageId) {\n\t\t\tcase MESSAGE_ID_OFFERING_DATA:\n\t\t\t\tif (!mOwnRequestDataReceived && !mPartnerOfferReceived) {\n\t\t\t\t\tonReceiveOffer(message);\n\t\t\t\t} else {\n\t\t\t\t\tclose(); // I already got your offer or I got everything I wanted, leave me alone\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase MESSAGE_ID_REQUESTING_DATA:\n\t\t\t\tif (!mPartnerRequestSatisfied) {\n\t\t\t\t\tonReceiveRequest(message);\n\t\t\t\t} else {\n\t\t\t\t\tclose(); // already satisfied, what else do you want from me?\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase MESSAGE_ID_SENDING_DATA:\n\t\t\t\tif (!mOwnRequestDataReceived) {\n\t\t\t\t\tonReceiveGames(message);\n\t\t\t\t} else {\n\t\t\t\t\tclose(); // I got everything I wanted, thanks, thats enough\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// I don't even understand what you tell me\n\t\t\t\tclose();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (isExchangeCompleteCondition()) {\n\t\t\tclose();\n\t\t}\n\t}", "@Override\n\tpublic void run() {\n\t\n\t\tboolean finMsg = false;\n\n \n \n\t\ttry {\n\t\t\t\n\t\t DataInputStream is = new DataInputStream(socket.getInputStream());\n DataOutputStream os = new DataOutputStream(socket.getOutputStream()); \n\t\t\t\n\t\t\twhile (!finMsg) {\n\t\t\t\t\n\t\t\tString[] client_Msg = is.readUTF().split(\" \");\n\t\t\t\t\n\t\t\tswitch (client_Msg[1]) {\n\t\t\t\n\t\t\t\tcase \"REG\":\n\t\t\t\t\thandleRegister(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"RDY\":\n\t\t\t\t\thandleReady(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"MOV\":\n\t\t\t\t\thandleMove(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\tcase \"FIN\":\n\t\t\t\t\tsocket.close();\n\t\t\t\t\tfinMsg=true;\n\t\t\t\t\tbreak;\n\t\t\t \n\t\t\t\n\t\t\t\t}\n\t\t\n\t\t \n\t\t\t}\n\t\t\t\t\n\t\t}catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "@Override\r\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tswitch (msg.what) {\r\n\t\t\t// upload ok\r\n\t\t\tcase 0:\r\n\t\t\t\tToast.makeText(SendBroadcastMessage.this, \"上传语音成功\",\r\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\r\n\t\t\t\tbreak;\r\n\t\t\t// upload error\r\n\t\t\tcase 1:\t\t\t\r\n\t\t\t\tToast.makeText(SendBroadcastMessage.this, \"上传语音失败\",\r\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\r\n\t\t\t\tbreak;\r\n\t\t\t// update ok\r\n\t\t\tcase 2:\r\n\t\t\t\tif (dialog!=null) {\r\n\t\t\t\t\tdialog.dismiss();\r\n\t\t\t\t}\r\n\t\t\t\tToast.makeText(SendBroadcastMessage.this, \"发布成功\",\r\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\r\n\t\t\t\tTextSave();\r\n\t\t\t\tSendResultSave(true);\r\n\t\t\t\tif (bm != null) {\r\n\t\t\t\t\tbm.recycle();\r\n\t\t\t\t}\r\n\t\t\t\tSendBroadcastMessage.this.finish();\r\n\t\t\t\tbreak;\r\n\t\t\t// update error\r\n\t\t\tcase 3:\r\n\t\t\t\tif (dialog!=null) {\r\n\t\t\t\t\tdialog.dismiss();\r\n\t\t\t\t}\r\n\t\t\t\tTextSave();\r\n\t\t\t\tSendResultSave(false);\r\n\t\t\t\tToast.makeText(SendBroadcastMessage.this, \"发布失败\",\r\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\r\n\t\t\t\tif (bm != null) {\r\n\t\t\t\t\tbm.recycle();\r\n\t\t\t\t}\r\n\t\t\t\tSendBroadcastMessage.this.finish();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}", "@Override\n public void handleMessage(Message msg){\n switch (msg.what) {\n case PSensor.MESSAGE_STATE_CHANGE:\n break;\n case PSensor.MESSAGE_WRITE:\n break;\n case PSensor.MESSAGE_READ:\n PSensor.sensorData.parseInput((byte[])msg.obj);//parseInput((byte[])msg.obj);\n multiGauge.handleSensor(PSensor.sensorData.boost);\n multiGaugeVolts.handleSensor(PSensor.sensorData.batVolt);\n break;\n case PSensor.MESSAGE_DEVICE_NAME:\n break;\n case PSensor.MESSAGE_TOAST:\n break;\n default:\n break;\n }\n }", "private void incomingBT_handle()\n {\n if(BT_Message_Handle_Func != null)\n BT_Message_Handle_Func.run();\n\n }", "@Override\n public void receiveMessage(String message) {\n }", "@Override\n\tprotected void doReceiveMessage(Message msg) {\n\t\tdeliverMessage(msg);\n\t}", "@Override\n public void handleMessage(Message msg) {\n AsyncResult ar;\n\n switch (msg.what) {\n case EVENT_NEW_SMS:\n // A new SMS has been received by the device\n if (Config.LOGD) {\n Log.d(TAG, \"New SMS Message Received\");\n }\n\n SmsMessage sms;\n\n ar = (AsyncResult) msg.obj;\n\n // FIXME unit test leaves cm == null. this should change\n if (mCm != null) {\n // FIXME only acknowledge on store\n mCm.acknowledgeLastIncomingSMS(true, null);\n }\n\n if (ar.exception != null) {\n Log.e(TAG, \"Exception processing incoming SMS. Exception:\" + ar.exception);\n return;\n }\n\n sms = (SmsMessage) ar.result;\n dispatchMessage(sms);\n\n break;\n\n case EVENT_SEND_SMS_COMPLETE:\n // An outbound SMS has been sucessfully transferred, or failed.\n handleSendComplete((AsyncResult) msg.obj);\n break;\n\n case EVENT_SEND_RETRY:\n sendSms((SmsTracker) msg.obj);\n break;\n\n case EVENT_NEW_SMS_STATUS_REPORT:\n handleStatusReport((AsyncResult)msg.obj);\n break;\n\n case EVENT_SIM_FULL:\n handleSimFull();\n break;\n\n case EVENT_POST_ALERT:\n handleReachSentLimit((SmsTracker)(msg.obj));\n break;\n\n case EVENT_ALERT_TIMEOUT:\n ((AlertDialog)(msg.obj)).dismiss();\n msg.obj = null;\n mSTracker = null;\n break;\n\n case EVENT_SEND_CONFIRMED_SMS:\n if (mSTracker!=null) {\n Log.d(TAG, \"Ready to send SMS again.\");\n sendSms(mSTracker);\n mSTracker = null;\n }\n break;\n }\n }", "@Override\n\tpublic void send(String msg) {\n\t\t\n\t\t\n\t\n\t}", "@Override\n public void run() {\n Message message = mHandler.obtainMessage(1);\n mHandler.sendMessage(message);\n }", "abstract void onMessage(byte[] message);", "public void handleObject(SocketManager sm, Object msg)\n\t\t{\n\t\t\tif (msg instanceof RequestPeerListMsg)\n\t\t\t{\n\t\t\t\t// start a new thread to send the peer list\n\t\t\t\tif(SessionManager.debug) System.out.println(\"New leader \" + _sm.getIdentity() + \"received RequestPeerListMsg. Sending peer list.\");\n\t\t\t\tnew PeerListSender().start();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// handle a promotion event\n\t\t\tif (msg instanceof PromoteMsg)\n\t\t\t{\n\t\t\t\tif(SessionManager.debug) System.out.println(\"PromoteMsg received by \" + _sm.getIdentity() + \". New leader is \" + ((PromoteMsg) msg).new_leader);\n\t\t\t\t_sm.peerPromoted( ( (PromoteMsg) msg).new_leader);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (msg instanceof ByteBundle)\n\t\t\t{\n\t\t\t\tByteBundle bb = (ByteBundle) msg;\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (bb.hasInt)\n\t\t\t\t\t{\n\t\t\t\t\t\t_pos.write(bb.val);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t_pos.write(bb.array);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (IOException ioe)\n\t\t\t\t{\n\t\t\t\t\tioe.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// if it wasn't one of the above, pass handling off to the\n\t\t\t// MessageListener.\n\t\t\tsynchronized (PeerChannel.this)\n\t\t\t{\n\t\t\t\t// queue up messages until we get a MessageListener to give these\n\t\t\t\t// to.\n\t\t\t\tif (_ml == null)\n\t\t\t\t{\n\t\t\t\t\t_msg_queue.addLast(msg);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_ml.messageReceived( (Serializable) msg);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n\tpublic void sendMessage() {\n\t\t\n\t}", "@Override\n public void run() {\n Message message = new Message();\n message.what=1;\n handler.sendMessage(message);\n }", "@Override\n public void handleMessage(Message msg) {\n\n Bundle bundle = msg.getData();\n if(bundle != null)\n {\n String cmd = bundle.getString(\"cmd\");\n\n writeToBle(cmd);\n }\n\n switch (msg.what) {\n case MSG_SET_TRACKING:\n setTracking(msg.arg1 == 1);\n break;\n case MSG_REGISTER_CLIENT:\n mClients.add(msg.replyTo);\n break;\n case MSG_UNREGISTER_CLIENT:\n mClients.remove(msg.replyTo);\n break;\n default:\n super.handleMessage(msg);\n }\n }", "public void send(Message msg);", "public void handleMessage(Message message, DatagramSocket socket) throws HandlingException, IOException, ClassNotFoundException;", "@Override\n\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\tprocessBluetoothDeviceMessage(msg);\n\t\t\t}", "public void processMessage(Chat chat, Message message)\n {\n }", "@Override\n public void handleMessage(Message msg){\n BTRobotRemoteActivity activity = outer.get();\n\n //can't access main UI activity\n if(activity == null){return;}\n\n //find out what message was sent\n switch(msg.what){\n //bluetooth\n case BluetoothClientService.MESSAGE_STATE_CHANGE:{\n //update bluetooth connection status\n activity.setStatus(msg.arg1);\n break;\n }\n //service wrote data \n case BluetoothClientService.MESSAGE_WRITE:{\n //store data as a string\n String writeMessage = new String((byte[]) msg.obj);\n break;\n }\n //service read data\n case BluetoothClientService.MESSAGE_READ:{\n String readMessage = new String((byte[])msg.obj, 0, msg.arg1);\n break;\n }\n //service retreived device's name\n case BluetoothClientService.MESSAGE_DEVICE_NAME:{\n // save the connected device's name\n activity.setDeviceName(msg.getData().getString(DEVICE_NAME));\n Toast.makeText(activity.getApplicationContext(), \"Connected to \"\n + activity.getDeviceName(), Toast.LENGTH_SHORT).show();\n break;\n }\n //motion sensor\n case MotionMonitor.MESSAGE_MOTION:{\n if(msg.arg1 == MotionMonitor.ARG_ACCEL){\n Bundle b = (Bundle) msg.obj;\n if(b == null){Log.e(TAG, \"Failed to convert message object to bundle\");}\n float [] data = b.getFloatArray(MotionMonitor.KEY_ACCEL);\n activity.updateOrientation(data);\n }\n else if(msg.arg1 == MotionMonitor.ARG_GYRO){\n Bundle b = (Bundle) msg.obj;\n if(b == null){Log.e(TAG, \"Failed type message data to float []\");}\n //set data in gyrostats view \n float [] data = b.getFloatArray(MotionMonitor.KEY_ROTATE);\n TextView stats = (TextView) activity.findViewById(R.id.gyro_stats);\n stats.setText(String.format(\"%4f, %4f, %4f\", data[0], data[1], data[2]));\n }\n else{Log.e(TAG, \"Unsupported argument for MESSAGE_MOTION in handleMessage()\");}\n }\n //ignore other types\n default:{\n }}\n }", "public void handleMessage(Message message, DatagramSocket socket, DatagramPacket packet) throws HandlingException, IOException, ClassNotFoundException;", "@Override\r\n\tpublic void messageReceived(Object obj) {\n\t\t\r\n\t}", "private void sendMessage(ChatMessage msg) {\n try {\n sOutput.writeObject(msg);\n } catch (IOException e) {\n e.printStackTrace();\n }\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\n public void onReceive(Object message) throws Exception {\n }", "@Override\r\n public void handleMessage(Message msg) {\n super.handleMessage(msg);\r\n switch(msg.what){\r\n case baglanti:\r\n\r\n ConnectedThread connectedThread = new ConnectedThread((BluetoothSocket)msg.obj);\r\n Toast.makeText(getApplicationContext(), \"Baglandi\",Toast.LENGTH_LONG).show();\r\n String s = \"successfully connected\";\r\n break;\r\n case mesajoku:\r\n byte[] readBuf = (byte[])msg.obj;\r\n String string = new String(readBuf);\r\n Toast.makeText(getApplicationContext(), string, Toast.LENGTH_LONG).show();\r\n break;\r\n }\r\n }", "void handleMessage(String message){\n\t\tString[] parts = message.split(\" \");\n\t\tboolean prevFor = false;\n//\t\tSystem.out.println(\"parts0 = \" + parts[0]);\n\t\tswitch(parts[0]){\n\t\t\tcase \"#quit\":\n\t\t\t\tclient.handleMessageFromClientUI(\"#quit\" + \"---\" + client.getUID() + \"---\" + \" \" + \"---\" + \" \");\n\t\t\t\tbreak;\n\t\t\tcase \"#stop\":\n\t\t\t\tclient.handleMessageFromClientUI(\"#stop\" + \"---\" + client.getUID() + \"---\" + \" \" + \"---\" + \" \");\n\t\t\t\tbreak;\n\t\t\tcase \"#close\":\n\t\t\t\tclient.handleMessageFromClientUI(\"#close\" + \"---\" + client.getUID() + \"---\" + \" \" + \"---\" + \" \");\n\t\t\t\tbreak;\n\t\t\tcase \"#setport\":\n\t\t\t\tclient.handleMessageFromClientUI(\"#setport\" + \"---\" + client.getUID() + \"---\" + \" \" + \"---\" + parts[1]);\n\t\t\t\tbreak;\n\t\t\tcase \"#getport\":\n\t\t\t\tclient.handleMessageFromClientUI(\"#getport\" + \"---\" + client.getUID() + \"---\" + \" \" + \"---\" + \" \");\n\t\t\t\tbreak;\n\t\t\tcase \"#start\":\n\t\t\t\tclient.handleMessageFromClientUI(\"#start\" + \"---\" + client.getUID() + \"---\" + \" \" + \"---\" + \" \");\n\t\t\t\tbreak;\n\t\t\tcase \"#block\":\n\t\t\t\tif(parts.length>1){\n\t\t\t\t\tclient.handleMessageFromClientUI(\"#block\" + \"---\" + client.getUID() + \"---\" + parts[1] + \"---\" + \" \");\t//this sends the info to the server to check if it's a valid user_id\n\t\t\t\t}\n\t\t\t\telse System.out.println(\"You haven't specified a user to block!\");\n\t\t\t\tbreak;\n\t\t\tcase \"#unblock\":\n\t\t\t\tif(parts.length>0){\n\t\t\t\t\tclient.handleMessageFromClientUI(\"#unblock\" + \"---\" + client.getUID() + \"---\" + parts[1] + \"---\" + \" \");\t//this sends the info to the server to check if it's a valid user_id\n\t\t\t\t\t\t\t//this also needs to be sent to server to send to all consoles to update block lists\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"#whoiblock\":\t\t//simply prints out the arraylist of users that i block\n\t\t\t\tif(blockedList.size()>0){\n\t\t\t\t\tSystem.out.print(\"The list of people you block is: \");\n\t\t\t\t\tfor(int i=0;i<blockedList.size();i++){\n\t\t\t\t\t\tSystem.out.print(blockedList.get(i)+\", \");\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t\telse System.out.println(\"You are not blocking any users\");\n\t\t\t\tbreak;\n\t\t\tcase \"#whoblocksme\":\t//simply prints out the arraylist of users that block me\n\t\t\t\tif(whoBlocksMe.size()>0){\n\t\t\t\t\tSystem.out.print(\"The list of people who block me is: \");\n\t\t\t\t\tfor(int i=0;i<whoBlocksMe.size();i++){\n\t\t\t\t\t\tSystem.out.print(whoBlocksMe.get(i)+\", \");\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t\telse System.out.println(\"There are no users that are blocking you\");\n\t\t\t\tbreak;\n\t\t\tcase \"#startforwarding\":\n\t\t\t\tprevFor = false;\n\t\t\t\ttry {\n\t\t\t\t\tif(whoIForward.size()>0) {\n\t\t\t\t\t\tfor(int i=0; i<whoIForward.size(); i++){\n\t\t\t\t\t\t\tif(parts[1].equals(whoIForward.get(i))) prevFor = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!prevFor) {\n\t\t\t\t\t\t\twhoIForward.add(parts[1]);\n\t\t\t\t\t\t\tSystem.out.println(\"You are now forwarding to user: \"+parts[1]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse System.out.println(\"You are already forwarding to that user!\");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\twhoIForward.add(parts[1]);\n\t\t\t\t\t\tSystem.out.println(\"You are now forwarding all messages to user: \"+parts[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(ArrayIndexOutOfBoundsException e){\n\t\t\t\t\tSystem.out.println(\"You need to specify a user to forward to!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"cancelforwarding\":\n\t\t\t\tprevFor = false;\n\t\t\t\ttry {\n\t\t\t\t\tif(whoIForward.size()>0){\n\t\t\t\t\t\tfor(int i=0; i<whoIForward.size(); i++){\n\t\t\t\t\t\t\tif(parts[1].equals(whoIForward.get(i))){\n\t\t\t\t\t\t\t\tprevFor = true;\n\t\t\t\t\t\t\t\twhoIForward.remove(i);\n\t\t\t\t\t\t\t\tSystem.out.println(\"You are no longer forwarding to user: \"+parts[1]);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!prevFor){\n\t\t\t\t\t\t\tSystem.out.println(\"You were not forwarding to that user!\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse System.out.println(\"You are not currently forwarding to anyone and connot stop forwarding to this user\");\n\t\t\t\t}\n\t\t\t\tcatch(ArrayIndexOutOfBoundsException e){\n\t\t\t\t\tSystem.out.println(\"You need to specify a user to stop forwarding to!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"#private\":\n\t\t\t\tString[] messageArray = Arrays.copyOfRange(parts, 2, parts.length);\n\t\t\t\tStringBuilder builder = new StringBuilder();\n\t\t\t\tfor (String value : messageArray) {\n\t\t\t\t builder.append(value + \" \");\n\t\t\t\t}\n\t\t\t\tString messageToSend = builder.toString();\n\t\t\t\tclient.handleMessageFromClientUI(\"#private\" + \"---\" + client.getUID() + \"---\" + parts[1] + \"---\" + messageToSend);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault: client.handleMessageFromClientUI(\" \" + \"---\" + client.getUID() + \"---\" + \"*\" + \"---\" + message);\n\t\t}\n\t}", "private void sendMessage(ChatMessage msg) throws IOException {\n try {\n sOutput.writeObject(msg);\n } catch (IOException e) {\n sOutput.close();\n sInput.close();\n e.printStackTrace();\n }\n //sOutput.flush();\n }", "@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tint channel;\n\t\t\tdouble data;\n\t\t\tsuper.handleMessage(msg);\n\t\t\tswitch (msg.what) {\n\t\t\t\tcase Bluetooth.SUCCESS_CONNECT:\n\t\t\t\t\tBluetooth.connectedThread = new Bluetooth.ConnectedThread((BluetoothSocket) msg.obj);\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"Conectado!\", 0).show();\n\t\t\t\t\tString s = \"successfully connected\";\n\t\t\t\t\tBluetooth.connectedThread.start();\n\t\t\t\t\tbreak;\n\t\t\t\tcase Bluetooth.MESSAGE_READ:\n\t\t\t\t\tif (!Record_Dialog_On) {\n\t\t\t\t\t\tbyte[] readBuf = (byte[]) msg.obj;\n\t\t\t\t\t\tfor (int i = 0; i < readBuf.length + cont ; i++) { //[LL]: Barrido del buffer de 1024 byte\n\t\t\t\t\t\t//\tLog.d(\"Cont.\", Integer.toString(cont));\n\t\t\t\t\t\t\tif (cont==3) {\n\t\t\t\t\t\t\t\tdata_aux[3]= (int) readBuf[i] & 0xff;\n\t\t\t\t\t\t\t\tcont=0;\n\n\t\t\t\t\t\t\tif ((data_aux[0] & 0x80) == 0x80 && (data_aux[1] & 0x80) == 0 && (data_aux[2] & 0x80) == 0 && (data_aux[3] & 0x80) == 0) {\n\t\t\t\t\t\t\t\tdata = ProcessData(data_aux); //Obtengo el valor a graficar segun el formato de los datos\n\t\t\t\t\t\t\t\tchannel = (data_aux[0] & 0x38) >> 3; //Obtengo el canal a graficar. Mascara= 0x38= 111000b\n\t\t\t\t\t\t\t\t//i = i + 3;\n\t\t\t\t\t\t\t\tif (Record == true && j < (1024 - 4)) {\n\t\t\t\t\t\t\t\t\trecording = true;\n\t\t\t\t\t\t\t\t\tif(canal_ant==-1)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif(channel==0)\n\t\t\t\t\t\t\t\t\t\t\tcanal_ant= 1;\n\t\t\t\t\t\t\t\t\t\telse if(channel==1) {\n\t\t\t\t\t\t\t\t\t\t\tcanal_ant = 0;\n\t\t\t\t\t\t\t\t\t\t\tDataWrite = DataWrite.concat(Double.toString(data_channel_0_prev) + \",\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tswitch(canal_ant) {\n\t\t\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t\t\t\tif(channel==1) {\n\t\t\t\t\t\t\t\t\t\t\t\tDataWrite = DataWrite.concat(Double.toString(data) + \"\\n\");\n\t\t\t\t\t\t\t\t\t\t\t\tcanal_ant=1;\n\t\t\t\t\t\t\t\t\t\t\t\tdata_channel_1_prev= data;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse if(channel==0) {\n\t\t\t\t\t\t\t\t\t\t\t\tDataWrite = DataWrite.concat(Double.toString(data_channel_1_prev) + \"\\n\" + data + \",\");\n\t\t\t\t\t\t\t\t\t\t\t\tdata_channel_0_prev = data;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\t\tif(channel==0) {\n\t\t\t\t\t\t\t\t\t\t\t\tDataWrite = DataWrite.concat(Double.toString(data) + \",\");\n\t\t\t\t\t\t\t\t\t\t\t\tcanal_ant = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t//DataWrite = DataWrite.concat(Double.toString(data_channel_1_prev) + \"\\n\" + data + \",\");\n\t\t\t\t\t\t\t\t\t\t\t\tdata_channel_0_prev = data;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse if(channel==1) {\n\t\t\t\t\t\t\t\t\t\t\t\tDataWrite = DataWrite.concat(Double.toString(data_channel_0_prev) + \",\" + data + \"\\n\");\n\t\t\t\t\t\t\t\t\t\t\t\t//DataWrite = DataWrite.concat(Double.toString(data_channel_1_prev) + \"\\n\" + data + \",\");\n\t\t\t\t\t\t\t\t\t\t\t\tdata_channel_1_prev = data;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tj++;\n\n\t\t\t\t\t\t\t\t} else if (recording == true) {\n\t\t\t\t\t\t\t\t\tLog.d(\"com.gibio.bt_graph\", \"grabando...\");\n\t\t\t\t\t\t\t\t\tString DirToSaveType;\n\t\t\t\t\t\t\t\t\tif (FileSaveDialog.Get_m_dir().equals(\"\") == false)\n\t\t\t\t\t\t\t\t\t\tDirToSaveType = FileSaveDialog.Get_m_dir();\n\t\t\t\t\t\t\t\t\telse DirToSaveType = FileSaveDialog.Get_m_sdcardDirectory();\n\t\t\t\t\t\t\t\t\tSaveData(DataWrite, DirToSaveType, FileSaveDialog.Get_Selected_File_Name()); //Guardo los datos en un archivo\n\t\t\t\t\t\t\t\t\tDataWrite = (String) \"\";\n\t\t\t\t\t\t\t\t\t//canal_ant = -1; // -1 == ningún canal\n\n\t\t\t\t\t\t\t\t\tif (Record == false) { //[LL]: si se presionó STOP dejo de grabar\n\t\t\t\t\t\t\t\t\t\trecording = false;\n\t\t\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"Grabación detenida!\", 0).show();j = 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tj = 0;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tswitch (channel) {\n\t\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t\t\tif (Sereies_0_index < 10000){ //[LL]:Esto lo puse para evitar picos en la memoria\n\t\t\t\t\t\t\t\t\t\t\tif(data!=-2097152.0 && data!=0.0 && data!=409600.0 && data!=393216.0) { //[LL]:Por un error (picos) ver como resolver\n\t\t\t\t\t\t\t\t\t\t//Notar que todos los valores que dan error son multiplos de 1024\n\t\t\t\t\t\t\t\t\t\t//393216= 0x060000 = 0000 0110 00000000 00000000\n\t\t\t\t\t\t\t\t\t\t//409600= 0x064000 = 0000 0110 01000000 00000000\n\t\t\t\t\t\t\t\t\t\t//con el protocolo: 10001000 00110010 00000000 00000000\n\n\t\t\t\t\t\t\t\t\t\t// -2097152= 0xE00000 = 1110 0000 00000000 00000000\n\n\t\t\t\t\t\t\t\t\t\tSeries_0.appendData(new GraphViewData(graph2LastXValue_0, data), AutoScrollX);\n\t\t\t\t\t\t\t\t\t\tSereies_0_index++;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tSeries_0.resetData(new GraphViewData[]{});\n\t\t\t\t\t\t\t\t\t\t\tSereies_0_index = 0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//X-axis control\n\t\t\t\t\t\t\t\t\t\tif (graph2LastXValue_0 >= Xview && Lock == true) {\n\t\t\t\t\t\t\t\t\t\t\tSeries_0.resetData(new GraphViewData[]{});\n\t\t\t\t\t\t\t\t\t\t\tgraph2LastXValue_0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else graph2LastXValue_0 += 0.1;\n\n\t\t\t\t\t\t\t\t\t\tif (Lock == true) {\n\t\t\t\t\t\t\t\t\t\t\tgraphView_0.setViewPort(0, Xview);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tgraphView_0.setViewPort(graph2LastXValue_0 - Xview, Xview);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//refresh\n\t\t\t\t\t\t\t\t\t\tGraphView_0.removeView(graphView_0);\n\t\t\t\t\t\t\t\t\t\tGraphView_0.addView(graphView_0);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\tif (Sereies_1_index < 10000) {\n\t\t\t\t\t\t\t\t\t\tif(data!=-2097152.0 && data!=0.0 && data!=409600.0 && data!=393216.0 ) {\n\t\t\t\t\t\t\t\t\t\t//if(data!=-2097152.0 ) {\n\t\t\t\t\t\t\t\t\t\t\tSeries_1.appendData(new GraphViewData(graph2LastXValue_1, data), AutoScrollX);\n\t\t\t\t\t\t\t\t\t\t\t//Log.d(\"com.gibio.bt_graph\", \"data:\" + Double.toString(data));\n\t\t\t\t\t\t\t\t\t\t\tSereies_1_index++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tSeries_1.resetData(new GraphViewData[]{});\n\t\t\t\t\t\t\t\t\t\t\tSereies_1_index = 0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//X-axis control\n\t\t\t\t\t\t\t\t\t\tif (graph2LastXValue_1 >= Xview && Lock == true) {\n\t\t\t\t\t\t\t\t\t\t\tSeries_1.resetData(new GraphViewData[]{});\n\t\t\t\t\t\t\t\t\t\t\tgraph2LastXValue_1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else graph2LastXValue_1 += 0.1;\n\n\t\t\t\t\t\t\t\t\t\tif (Lock == true) {\n\t\t\t\t\t\t\t\t\t\t\tgraphView_1.setViewPort(0, Xview);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tgraphView_1.setViewPort(graph2LastXValue_1 - Xview, Xview);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//refresh\n\t\t\t\t\t\t\t\t\t\tGraphView_1.removeView(graphView_1);\n\t\t\t\t\t\t\t\t\t\tGraphView_1.addView(graphView_1);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tdata_aux[cont] = (int) readBuf[i] & 0xff;\n\t\t\t\t\t\t\t\tcont++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}", "@Override\n\tpublic void send(String msg) {\n\t}", "@Override\n\tpublic void messageReceived(IoSession session, Object message) throws Exception {\n\t\t\n\t\tSmsObject sms = (SmsObject) message;\n\t\t//log.info(\"The message is [\" + sms.getMessage() + \"]\");\n\n\t\t/*\n\t\t * other operate\n\n\t\tSystem.out.println(\"================================================\");\n\t\tSystem.out.println(\"Data From : \" + session.getRemoteAddress());\n\t\tSystem.out.println(\"Receiver : [\" + sms.getReceiver() + \"]\");\n\t\tSystem.out.println(\"Data Type : [\" + sms.getDataType() + \"]\");\n\t\tSystem.out.println(\"Data Receiver : [\" + sms.getDataReceiver() + \"]\");\n\t\tSystem.out.println(\"Data Sender : [\" + sms.getDataSender() + \"]\");\n\t\tSystem.out.println(\"Data : [\" + sms.getData() + \"]\");\n\t\tSystem.out.println(\"================================================\");\n\t\t\n\t\t * */\t\n\t\t\n\t\t//The processing of registration information \n\t\tInteger i = new Integer(255);\n\t\tif( i.equals(sms.getReceiver()) &&\n\t\t\ti.equals(sms.getDataType()) &&\n\t\t\ti.equals(sms.getDataReceiver()) &&\n\t\t\ti.equals(sms.getDataSender())) {\n\t\t\t\n\t\t\tcli.addCli(session, sms.getData());\n\t\t\tSystem.out.println(\"Client : \" + session.getRemoteAddress() + \" DONE\");\n\t\t} else {\n\t\t\t//Forwarding\n\t\t\tArrayList<IoSession> tempList = new ArrayList<IoSession>();\n\t\t\ttempList = cli.getCli(sms.getReceiver());\n\t\t\t\n\t\t\tSystem.out.println(\"tempting=======>\" + session.getRemoteAddress() + \" with receiver : \" + sms.getReceiver());\n\t\t\tif(tempList != null) {\n\t\t\t\t//System.out.println(\"true\");\n\t\t\t\tfor (IoSession session1 : tempList){\n\t\t\t\t\tSystem.out.println(\"Send =========>\" + session1.getRemoteAddress());\n\t\t\t\t\tsession1.write(sms);\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"================================================\");\n\t\t\t}\n\t\t\telse System.out.println(\"forwarding false\");\n\t\t}\n\t\t\n\t\t//Trigger the client\n\t\tsms.setReceiver(i);\n\t\tsms.setDataType(i);\n\t\tsms.setDataReceiver(i);\n\t\tsms.setDataSender(i);\n\t\tsms.setData(\" \");\n\t\tsession.write(sms);\n\n\t}", "void sendMessage() {\n\n\t}", "@Override\r\n\tpublic boolean send(String msg) {\n \ttry {\r\n \t\tsendMessage(msg);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\tint event = msg.arg1;\n\t\t\t\tint result = msg.arg2;\n\t\t\t\tObject data = msg.obj;\n\t\t\t\tif (result == SMSSDK.RESULT_COMPLETE) {\n\t\t\t\t\t\n\t\t\t\t\tif (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"验证成功\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tRelativeUser.handleRegieter(handler1,edittext_phone.getText().toString(),edittext_pas.getText().toString());\n\t\t\t\t\t\t\n\t\t\t\t\t} else if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE){\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"验证码已经发送\", Toast.LENGTH_SHORT).show();\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\tToast.makeText(getBaseContext(), \"请检查网络原因\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//TODO\n\t\t\t\t\tRelativeUser.handleRegieter(handler1,edittext_phone.getText().toString(),edittext_pas.getText().toString());\n\t\t\t\t\t/*Toast.makeText(getBaseContext(), \"请检查网络原因\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t((Throwable) data).printStackTrace();*/\n\t\t\t\t}\t\t\t\t\n\t\t\t}", "public void processMessage()\n {\n \tif(messageContents.getMessage().containsCommand())\n {\n \tCommand command = new Command(messageContents);\n CommandProcessor commandProcessor = new CommandProcessor(joeBot, command);\n commandProcessor.processCommand();\n }\n else\n {\n Speech speech = new Speech(messageContents);\n SpeechProcessor speechProcessor = new SpeechProcessor(joeBot, speech);\n speechProcessor.processSpeech();\n }\n }", "protected void processMessagesOnConnection() {\n try {\n logger.info(\"Connected to \" + getConnectionName());\n state.set(StreamState.CONNECTED);\n notifyConnection();\n inputBuffer.flip();\n\n while (!Thread.currentThread().isInterrupted() && isConnected()) {\n try {\n // Find the start of message\n byte byStart = 0;\n while(byStart != START_OF_MSG && !Thread.currentThread().isInterrupted() && isConnected()) {\n byStart = nextByte(inputBuffer);\n }\n\n // and then make sure there are enough bytes and read the protocol\n readCompleteMessage(inputBuffer);\n if(inputBuffer.get() != protocol.getKeyIdentifier()) throw new TcProtocolException(\"Bad protocol\");\n\n logByteBuffer(\"Line read from stream\", inputBuffer);\n\n // now we take a shallow buffer copy and process the message\n MenuCommand mc = protocol.fromChannel(inputBuffer);\n logger.info(\"Command received: \" + mc);\n notifyListeners(mc);\n }\n catch(TcProtocolException ex) {\n // a protocol problem shouldn't drop the connection\n logger.warn(\"Probable Bad message reason='{}' Remote={} \", ex.getMessage(), getConnectionName());\n }\n }\n logger.info(\"Disconnected from \" + getConnectionName());\n } catch (Exception e) {\n logger.error(\"Problem with connectivity on \" + getConnectionName(), e);\n }\n finally {\n close();\n }\n }", "public void sendMsg(Message msg){\n messagesParser.sendMsg(msg);\n }", "@Override\n public void run() {\n Message message = new Message();\n message.what = 4;\n handler.sendMessage(message);\n }", "public abstract void receiveMessage(T message);", "public void run(){\n\t\t\tObjectReader readerClient = new ObjectReader(in, clientInetAddress);\r\n\t\t\treaderClient.start();\r\n\t\t\t\r\n\t\t\t// Constantly checks msgToSend for messages and sends them\r\n\t\t\twhile(true){\r\n\t\t\t\ttry{\r\n\t\t\t\t\t// Send message\r\n\t\t\t\t\tif(msgToSend.length() != 0){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tout.writeObject(new DataObject(DataObject.STRING, msgToSend.toString()));\r\n\t\t\t\t\t\tout.flush();\r\n\t\t\t\t\t\tmsgToSend.setLength(0);\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\tcatch(IOException ioe){\r\n\t\t\t\t\tioe.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "void sendMessage(String msg);", "abstract protected void receiveMessage(Message m);", "protected void handleMessage(Object lineObj){\n String line = (String)lineObj;\n \n if (logStream != null)\n logStream.println(line);\n \n if (handleGameInfo(line))\n return;\n if (handleExaminedGameInfo(line))\n return;\n if (handleStyle12(line))\n return;\n if (handleDeltaBoard(line))\n return;\n if (handleSeeksCleared(line))\n return;\n if (handleSeekAdded(line))\n return;\n if (handleSeeksRemoved(line))\n return;\n if (handleBughouseHoldings(line))\n return;\n if (handleGameEnd(line))\n return;\n if (handleStoppedObserving(line))\n return;\n if (handleStoppedExamining(line))\n return;\n if (handleEnteredBSetupMode(line))\n return;\n if (handleExitedBSetupMode(line))\n return;\n if (handleIllegalMove(line))\n return;\n if (handleChannelTell(line))\n return;\n if (handleLogin(line))\n return;\n if (handleIvarStateChanged(line))\n return;\n if (handlePersonalTell(line))\n return;\n if (handleSayTell(line))\n return;\n if (handlePTell(line))\n return;\n if (handleShout(line))\n return;\n if (handleIShout(line))\n return;\n if (handleTShout(line))\n return;\n if (handleCShout(line))\n return;\n if (handleAnnouncement(line))\n return;\n if (handleKibitz(line))\n return;\n if (handleWhisper(line))\n return;\n if (handleQTell(line))\n return;\n if (handleOffer(line))\n return;\n if (handleOfferRemoved(line))\n return;\n if (handlePlayerOffered(line)) //\n return; // We have to handle these\n if (handlePlayerDeclined(line)) // \"manually\", since the \n return; // server currently does \n if (handlePlayerWithdrew(line)) // not inform us of offers\n return; // in games we're \n if (handlePlayerCounteredTakebackOffer(line)) // observing. \n return; // \n if (handleSimulCurrentBoardChanged(line))\n return;\n if (handlePrimaryGameChanged(line))\n return;\n if (handleUserChannelListNext(line))\n return;\n if (handleChannelListArrives(line))\n return;\n if (handleChannelListChanged(line))\n return;\n if (handleMessagesInfo(line))\n return;\n if (handleMessages(line))\n return;\n\n if (linesToFilter.remove(line) == null)\n processLine(line);\n }", "@Override\n\t \t\tpublic void handleMessage(Message msg) {\n\t \t\treceive();\n\t \t\t\t// myTextView.setText(String.valueOf(cnt));\n\t \t\t}", "@Override\n\tpublic void run() {\n\t\t\n\t\twhile(connected) {\n\t\t\tif(GameActivity.getInstance() == null)\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\ttry {\n\t\t\t\t// Read first 4 bytes (int, messageType) from stream\n\t\t\t\t//in.read(bytes, 0, 4);\n\t\t\t\tint messageType = in.readInt();\n\t\t\t\t//intByteBuffer.clear(); // Clear buffer so we can read from it again\n\t\t\t\t\n\t\t\t\t// Receive appropriate message based on received messageType\n\t\t\t if(messageType == Message.CHARACTERS.value()) {\n\t\t\t\t\treceiveCharacters();\n\t\t\t\t} else if(messageType == Message.ID.value()) {\n\t\t\t\t\treceiveId();\n\t\t\t\t} else {\n\t\t\t\t\tSystem.err.println(\"Received message with unknown id: \" + messageType);\n\t\t\t\t}\n\t\t\t \n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(\"Connection to server lost\");\n\t\t\t\te.printStackTrace();\n\t\t\t\tclose();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "@Override\n\tpublic void sendMsg(String msg) {\n\n\t}", "public void run()\n {\n \n try {\n String Msg = \"\";\n ArrayList<String> tokens=new ArrayList<String>();\n while ((Msg = this.reader.readLine())!=null)\n {\n if(!tokens.isEmpty())\n {\n //not empty,clear.\n tokens.clear();\n\n }\n //check the msg\n System.out.println(\"Inside while, Received msg in client handler:\"+Msg);\n //all the meta datas are separated using :\n tokens.addAll(Constants.tokens(Msg, \":\"));\n //if it's a login request\n if(tokens.contains(Constants.LOGIN_ID))\n {\n this.userID=tokens.get(1);//the 2nd string of this format LOGIN_ID:username:password\n this.password=tokens.get(2);\n this.client_delegate.validate(this);\n }\n //if it's a log out request.\n if(tokens.contains(Constants.LOGOUT_ID))\n {\n this.client_delegate.logout(this);\n }\n //public room message\n if(tokens.contains(Constants.PUBLIC_ROOM))\n {\n \n if(tokens.get(1).contains(\"file\"))\n {\n //there is smiley,but the parts were separated due to the presence of an internal : after word 'file'\n this.client_delegate.sendMessage(tokens.get(1)+\":\"+tokens.get(2));\n }\n else\n {\n //the message is without smiley...\n this.client_delegate.sendMessage(tokens.get(1));\n }\n \n }\n //private message\n if(tokens.contains(Constants.MESSAGE_ID))\n {\n //private message\n if(tokens.get(2).contains(\"file\"))\n {\n //there is smiley,but the parts were separated due to the presence of an internal : after word 'file'\n this.client_delegate.sendMessageFromThisTo(tokens.get(1), tokens.get(2)+\":\"+tokens.get(3), tokens.get(4));\n }\n else\n {\n //the message is without smiley...\n this.client_delegate.sendMessageFromThisTo(tokens.get(1), tokens.get(2), tokens.get(3));\n }\n }\n if(tokens.contains(Constants.FILE))\n {\n this.client_delegate.sendFileTo(tokens.get(1), Integer.parseInt(tokens.get(2)), tokens.get(3));\n }\n \n \n\n }\n } catch (Exception ex) {\n System.out.printf(\"Error parsing message from client:%s.\",this.userID);\n }\n }", "public void handleMessage(Message msg) {\n switch (msg.what) {\n case 1:\n Pair pair = (Pair) msg.obj;\n deliverResultCallback((ResultCallback) pair.first, (Result) pair.second);\n return;\n case 2:\n ((AbstractPendingResult) msg.obj).forceFailureUnlessReady(Status.zzXS);\n return;\n default:\n Log.wtf(\"AbstractPendingResult\", \"Don't know how to handle this message.\");\n return;\n }\n }", "@Override\n public void handleMessage(Message msg) {\n\t \tif(mService.get() != null && inAllowedState(msg.what)){\n\t \n\t \t\t// Keep track of the current request\n\t \t\tif(msg.what != MSG_GETSTATE)\n\t \t\t\tmService.get().currentRequest = msg.what;\n\t \t\t\n\t \t\t// Send the message to the service\n\t \t\tswitch (msg.what) {\n case MSG_INITIALIZE:\n \tLog.v(TAG, \"initialize client request: \" + msg.obj.toString());\n \tif(!isInitialized() || msg.arg1 > 0){\n mService.get().initializeOCR(new WeakReference<Messenger> (msg.replyTo), msg.obj.toString());\n \t} else {\n \t\tmService.get().sendMessage(new WeakReference<Messenger> (msg.replyTo), MSG_REPLY, \n \t\t\t\tmsg.what, mService.get().getString(R.string.error_already_initialized));\n \t}\n break;\n case MSG_RELEASE:\n \tLog.v(TAG, \"release client request\");\n \tmService.get().releaseOCR();\t\n \tmService.get().sendMessage(new WeakReference<Messenger> (msg.replyTo), MSG_REPLY, \n \t\t\tmsg.what, mService.get().getString(R.string.success_release));\n break;\n case MSG_RECOGNIZE:\n case MSG_RECOGNIZE_TXT:\n \tLog.v(TAG, \"recognize client request\");\n \t\tmService.get().recognize(new WeakReference<Messenger> (msg.replyTo), \n \t\t\t\t(msg.obj instanceof Bitmap) ? (Bitmap) msg.obj : null);\n break;\n case MSG_GETSTATE:\n \tLog.v(TAG, \"get state client request\");\n \tmService.get().sendMessage(new WeakReference<Messenger> (msg.replyTo), MSG_REPLY, \n \t\t\tmsg.what, mService.get().mState.toString());\n \tbreak;\n case MSG_CANCEL:\n \tLog.v(TAG, \"cancel request\");\n \tmService.get().cancel();\n \tbreak;\n case MSG_INSTALL_CHECK:\n \tLog.v(TAG, \"check installation request\");\n \tmService.get().checkInstallation(new WeakReference<Messenger> (msg.replyTo));\n \tbreak;\n default:\n super.handleMessage(msg);\n\t }\t \t\t\n\t \t} else {\n\t try {\n\t \tif(mService.get() != null){\n\t \t\t// It is in an invalid state\n\t \t \t\tLog.e(TAG,\"IncomingHandler: Invalid state, namely: \" + mService.get().mState + \".\");\n\t \t\tmsg.replyTo.send(Message.obtain(null, MSG_ERROR, \n\t \t\t\t\tmService.get().getString(R.string.error_invalid_state)));\n\t \t} else {\n\t \t \t\t// The service does not exist\n\t \t \t\tLog.e(TAG,\"IncomingHandler: Service reference is null.\");\n\t \t\tmsg.replyTo.send(Message.obtain(null, MSG_ERROR, \"Service does not exist.\"));\n\t \t}\n\t } catch (RemoteException e) {\n\t // The client is dead. \n\t\t \t\tLog.e(TAG,\"IncomingHandler: The client is dead.\");\n\t } catch (NullPointerException e) {\n\t // The reply to client is does not exist. \n\t\t \t\tLog.e(TAG,\"IncomingHandler: msg.replyTo was null.\");\n\t }\n\t \t}\n\t }", "@Override\n\t\t\tpublic void handleMessage(android.os.Message msg) {\n\t\t\t\tsuper.handleMessage(msg);\n\n\t\t\t\tswitch (msg.what) {\n\t\t\t\tcase HandleConfig.GETROOMINFO:// 获取room详情,并且1分钟更新一次\n\t\t\t\t\tdismissProcessDialog();\n\t\t\t\t\tNetEntry entry = decodePointList(msg.getData().getString(\n\t\t\t\t\t\t\t\"data\"));\n\t\t\t\t\tif (NetEntry.CODESUCESS.equals(entry.status)) {\n\t\t\t\t\t\tupdteRoomInfo(msg.getData().getString(\"data\"));\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tshowToastError(entry.msg);\n\t\t\t\t\t}\n\t\t\t\t\tandroid.os.Message mg = android.os.Message.obtain();\n\t\t\t\t\tmg.what = HandleConfig.REFRESHROOMINFO;\n\t\t\t\t\tmHandler.sendMessageDelayed(mg, 10000);\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase HandleConfig.REFRESHROOMINFO:\n\t\t\t\t\tif(isFinishing()==false){\n\t\t\t\t\t\tgetroominfo(roomid);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase HandleConfig.QUERYROOMUSERS:// 更新room user list\n\n\t\t\t\t\tNetEntry entry1 = decodePointList(msg.getData().getString(\n\t\t\t\t\t\t\t\"data\"));\n\n\t\t\t\t\tif (NetEntry.CODESUCESS.equals(entry1.status)) {\n\t\t\t\t\t\tJSONObject jsonobj;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tjsonobj = new JSONObject(msg.getData().getString(\n\t\t\t\t\t\t\t\t\t\"data\"));\n\n\t\t\t\t\t\t\tJSONObject tmp = jsonobj.getJSONObject(\"data\");\n\t\t\t\t\t\t\tJSONArray tmpList = tmp.getJSONArray(\"list\");\n\t\t\t\t\t\t\tperson.clear();\n\t\t\t\t\t\t\tfor (int i = 0; i < tmpList.length(); i++) {\n\t\t\t\t\t\t\t\tJSONObject t = tmpList.getJSONObject(i);\n\t\t\t\t\t\t\t\tString phone = t.getString(\"phone\");\n\t\t\t\t\t\t\t\tString id = t.getString(\"id\");\n\t\t\t\t\t\t\t\tString name = t.getString(\"name\");\n\t\t\t\t\t\t\t\tString headpic = t.getString(\"headpic\");\n\t\t\t\t\t\t\t\tif (phone.equals(owner.phone)) {// 房主\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tMessagePerson p = new MessagePerson();\n\t\t\t\t\t\t\t\tp.id = id;\n\t\t\t\t\t\t\t\tp.name=name;\n\t\t\t\t\t\t\t\tp.pic = headpic;\n\t\t\t\t\t\t\t\tp.phone = phone;\n\t\t\t\t\t\t\t\tperson.add(p);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbigWindow.UpdateRoomPerson(person);\n\t\t\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tshowToastError(entry1.msg);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tshowToastError(\"聊天室链接失败\");\n\t\t\t\tcase 4:\n\t\t\t\t\tdismissProcessDialog();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}", "public void process(SymmetricMessage msg) throws IOException {\n relay(msg);\n }", "private void sendReceiveRes(){\n\t}", "public abstract void onTextReceived(String message);", "@Override\r\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\r\n\t\t\tif(msg.obj != null){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tString respose = (String) msg.obj;\r\n\t\t\t\t\tJSONObject object = new JSONObject(respose);\r\n\t\t\t\t\tint status = object.getInt(\"status\");\r\n\t\t\t\t\tint code = object.getInt(\"code\");\r\n\t\t\t\t\tif(status == ParamsUtils.SUCCESS_CODE){\r\n\t\t\t\t\t\t/*Bind successfully, then save gateway information on the device*/\r\n\t\t\t\t\t\tACache mCache = ACache.get(getApplicationContext(), \r\n\t\t\t\t\t\t\t\tParamsUtils.CACHE_SIZE, 1000); \r\n\t\t\t\t\t\tSharedPreferences preferences = getApplicationContext().getSharedPreferences(ParamsUtils.GATEWAY_COUNT, MODE_PRIVATE);\r\n\t\t\t\t\t\tgatewayCount = preferences.getInt(ParamsUtils.GATEWAY_COUNT_CURRENT, 0);\r\n\t\t\t\t\t\tgatewayCount = gatewayCount + 1;\r\n\t\t\t\t\t\tmCache.put(\"gateway\" + gatewayCount, gatewayId);\r\n\t\t\t\t\t\tEditor editor = preferences.edit();\r\n\t\t\t\t\t\teditor.putInt(ParamsUtils.GATEWAY_COUNT_CURRENT, gatewayCount);\r\n\t\t\t\t\t\teditor.commit();\r\n\t\t\t\t\t\tsetHintVisible(false);\r\n\t\t\t\t\t\tbindHintView.setText(R.string.bind_ok);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tLog.i(AddGatewayActivity.class.getSimpleName(), \"sendBroadcast\");\r\n\t\t\t\t\t\tIntent intent = new Intent(\"com.smartdevice.main.device.update\"); \r\n\r\n\t\t\t\t\t\tsendBroadcast(intent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tsetHintVisible(false);\r\n\t\t\t\t\t\tbindHintView.setText(R.string.bind_fail);\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (JSONException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\tsetHintVisible(false);\r\n\t\t\t\t\tbindHintView.setText(R.string.bind_fail);\r\n\t\t\t\t}\r\n\t\t\t}else {\r\n\t\t\t\tsetHintVisible(false);\r\n\t\t\t\tbindHintView.setText(R.string.bind_fail);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "public void receive()\n {\n //Client receives a message: it finds out which type of message is and so it behaves differently\n //CHAT message: prints the message in the area\n //CONNECT message: client can't receive a connect message from the server once it's connected properly\n //DISCONNECT message: client can't receive a disconnect message from the server\n //USER_LIST message: it shows the list of connected users\n try\n {\n String json = inputStream.readLine();\n\n switch (gson.fromJson(json, Message.class).getType())\n {\n case Message.CHAT:\n ChatMessage cmsg = gson.fromJson(json, ChatMessage.class);\n\n if(cmsg.getReceiverClient() == null)\n ChatGUI.getInstance().getChatHistory().append(cmsg.getSenderClient() + \" (TO ALL): \" + cmsg.getText() + \"\\n\");\n else\n ChatGUI.getInstance().getChatHistory().append(cmsg.getSenderClient() + \" (TO YOU): \" + cmsg.getText() + \"\\n\");\n break;\n case Message.CONNECT:\n //Send login nickname and wait for permission to join\n //if message code is 1, nickname is a duplicate and must be changed, then login again\n //(send call is inside button event)\n ConnectMessage comsg = gson.fromJson(json, ConnectMessage.class);\n\n if(comsg.getCode() == 1)\n {\n //Show error\n ChatGUI.getInstance().getLoginErrorLabel().setVisible(true);\n }\n else\n {\n //Save nickname\n nickname = ChatGUI.getInstance().getLoginField().getText();\n\n //Hide this panel and show main panel\n ChatGUI.getInstance().getLoginPanel().setVisible(false);\n ChatGUI.getInstance().getMainPanel().setVisible(true);\n }\n break;\n case Message.USER_LIST:\n UserListMessage umsg2 = gson.fromJson(json, UserListMessage.class);\n fillUserList(umsg2);\n break;\n }\n } \n catch (JsonSyntaxException | IOException e)\n {\n System.out.println(e.getMessage());\n System.exit(1);\n }\n }", "abstract public boolean onMessageReceived(MMXMessage message);", "public void handleMessage(Msg clientMsg) {\n switch (clientMsg.getMsgType()) {\n case ID_IS_SET:\n handle_id_is_set(clientMsg);\n break;\n\n case SHIPS_PLACED:\n handle_ships_placed(clientMsg);\n break;\n\n case WAITING:\n break;\n\n case SHOT_PERFORMED:\n handle_shot_performed(clientMsg);\n break;\n }\n }", "@Override\r\n\tpublic void sendMessage(String message) {\n\t\t\r\n\t}", "private void sendMessage()\n\t{\n\t\tfinal String message = messageTextArea.getText(); \n\t\tif(message.length() == 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tmessageTextArea.setText(\"\");\n\t\ttry\n\t\t{\n\t\t\teventsBlockingQueue.put(new MessageEvent(message));\n\t\t}\n\t\tcatch (final InterruptedException e1)\n\t\t{\n\t\t}\n\t}", "protected abstract boolean systemReadyToHandleReceivedMessage();", "@Override\n\tpublic void processMessage(Message message) {\n\t\t\n\t}" ]
[ "0.74563", "0.7406282", "0.73414356", "0.7280701", "0.7273313", "0.7231558", "0.7195365", "0.7180781", "0.69980264", "0.69897616", "0.6987571", "0.69682205", "0.69441956", "0.69424266", "0.69161946", "0.69100785", "0.6900865", "0.6873043", "0.68487865", "0.6822763", "0.6811703", "0.67864066", "0.6783122", "0.67678964", "0.6766899", "0.67567694", "0.67530584", "0.6752146", "0.67429686", "0.6740334", "0.67387706", "0.6729889", "0.6726854", "0.6706692", "0.67065513", "0.6691627", "0.6691501", "0.66870904", "0.6649973", "0.6637424", "0.6633196", "0.6625932", "0.66217285", "0.66162264", "0.6584264", "0.6576267", "0.6572094", "0.65645283", "0.6563585", "0.6552557", "0.6538593", "0.6528995", "0.65238667", "0.65064013", "0.65046704", "0.64992875", "0.6499117", "0.6495857", "0.6492611", "0.6492275", "0.6489565", "0.6489472", "0.6468097", "0.6466981", "0.645947", "0.6444942", "0.6441552", "0.6440516", "0.6428075", "0.6423947", "0.6421194", "0.6419226", "0.64134544", "0.64107215", "0.6407986", "0.6407931", "0.64044535", "0.64044183", "0.64025944", "0.63971066", "0.6390893", "0.63901764", "0.63852113", "0.6366602", "0.63586706", "0.6356182", "0.63541746", "0.6349778", "0.6342612", "0.63424116", "0.63327545", "0.6329564", "0.63291514", "0.63280076", "0.63265127", "0.63219756", "0.63150483", "0.63096", "0.63027644", "0.62970537", "0.6295215" ]
0.0
-1
Add "." to start and end of pattern to fully match any string containing the pattern
@Override public Stream<String> filter(Stream<String> stringStream, String pattern) { String regex = ".*" + pattern + ".*"; return stringStream.filter(str -> { return !Pattern.compile(regex).matcher(str).matches(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String regex() {\n final List<String> keys = new LinkedList<>();\n for (final String key : this.template.split(\"\\\\.\")) {\n if (key.equals(\"*\")) {\n keys.add(\"\\\\w+\");\n } else {\n keys.add(key);\n }\n }\n return String.join(\"\\\\.\", keys);\n }", "private static String convertPattern(String pattern) {\n if (Strings.isNullOrEmpty(pattern)) {\n return pattern;\n }\n\n return \"^\" + pattern\n .replaceAll(\"\\\\[\", \"\\\\[\")\n .replaceAll(\"]\", \"\\\\]\")\n .replaceAll(\"\\\\.\", \"\\\\.\")\n .replaceAll(\"\\\\*\", \"\\\\*\")\n .replaceAll(\"(?<!\\\\\\\\)_\", \".\")\n .replaceAll(\"\\\\\\\\_\", \"_\")\n .replaceAll(\"(?<!\\\\\\\\)%\", \".*\")\n .replaceAll(\"\\\\\\\\%\", \"%\") +\n \"$\";\n }", "boolean matchStart(String pattern, String path);", "private String getMatchPattern(String pattern) {\n String mandatoryPart = pattern.trim().replaceAll(\"(\\\\s+?)\\\\[.+?\\\\]\", \"($1.+?(\\\\\\\\s|\\\\$))*\");\n mandatoryPart = mandatoryPart.replaceAll(\"\\\\s+\", \"\\\\\\\\s+\");\n return mandatoryPart.replaceAll(\"<.+?>\", \".+?\");\n }", "public WildcardPattern(String pattern) {\r\n this.pattern = pattern;\r\n }", "private Pattern fileNameMatch(final String name) {\n final StringBuilder sb = new StringBuilder(name.length());\n for (int i = 0; i < name.length(); i++) {\n final char c = name.charAt(i);\n if (c == '.') {\n sb.append('\\\\').append('.');\n } else if (c == '?') {\n sb.append('.');\n } else if (c == '*') {\n sb.append('.').append('*').append('?');\n } else {\n sb.append(c);\n }\n }\n return Pattern.compile(sb.toString(), Pattern.CASE_INSENSITIVE);\n }", "public static void main(String[] args) {\r\n\t\tString input = \"[email protected]\";\r\n//\t\tString input2 = \"naveen [email protected]\";\r\n\t\tString regex = \"[A-Za-z0-9._]+@[A-Za-z0-9]+.[A-Za-z]{2,}\";\r\n\t\tPattern pattern = Pattern.compile(regex);\r\n\t\tMatcher matcher = pattern.matcher(input);\r\n//\t\tMatcher matcher2 = pattern.matcher(input2);\r\n\t\tSystem.out.println(matcher.matches());\r\n//\t\tSystem.out.println(matcher2.matches());\r\n\t\t\r\n\t}", "protected static boolean matchPatternStart( String pattern, String str,\n boolean isCaseSensitive )\n {\n // When str starts with a File.separator, pattern has to start with a\n // File.separator.\n // When pattern starts with a File.separator, str has to start with a\n // File.separator.\n if( str.startsWith( File.separator ) !=\n pattern.startsWith( File.separator ) )\n {\n return false;\n }\n\n ArrayList patDirs = new ArrayList();\n StringTokenizer st = new StringTokenizer( pattern, File.separator );\n while( st.hasMoreTokens() )\n {\n patDirs.add( st.nextToken() );\n }\n\n ArrayList strDirs = new ArrayList();\n st = new StringTokenizer( str, File.separator );\n while( st.hasMoreTokens() )\n {\n strDirs.add( st.nextToken() );\n }\n\n int patIdxStart = 0;\n int patIdxEnd = patDirs.size() - 1;\n int strIdxStart = 0;\n int strIdxEnd = strDirs.size() - 1;\n\n // up to first '**'\n while( patIdxStart <= patIdxEnd && strIdxStart <= strIdxEnd )\n {\n String patDir = (String)patDirs.get( patIdxStart );\n if( patDir.equals( \"**\" ) )\n {\n break;\n }\n if( !match( patDir, (String)strDirs.get( strIdxStart ), isCaseSensitive ) )\n {\n return false;\n }\n patIdxStart++;\n strIdxStart++;\n }\n\n if( strIdxStart > strIdxEnd )\n {\n // String is exhausted\n return true;\n }\n else if( patIdxStart > patIdxEnd )\n {\n // String not exhausted, but pattern is. Failure.\n return false;\n }\n else\n {\n // pattern now holds ** while string is not exhausted\n // this will generate false positives but we can live with that.\n return true;\n }\n }", "protected abstract Regex pattern();", "protected static boolean matchPatternStart( String pattern, String str )\n {\n return matchPatternStart( pattern, str, true );\n }", "public void applyPattern(String pattern) {\n applyPattern(pattern, false);\n }", "Pattern pattern() {\r\n\t\tArrayList<String> patternSpecs = new ArrayList<String>();\r\n\t\t\r\n\t\tif (delimiters.size() > 0) {\r\n\t\t delimiters.forEach(d -> patternSpecs.add(d.pattern().pattern()));\r\n\t\t} else {\r\n\t\t\tpatternSpecs.add(\"^.*$\");\r\n\t\t}\r\n\t\t\r\n\t\tString completeSpec = Joiner.on(\"|\").join(patternSpecs); // \r\n\t\t\r\n\t\tPattern pattern = Pattern.compile(completeSpec);\r\n\t\t\r\n\t\treturn pattern;\r\n\t}", "public boolean useRegisteredSuffixPatternMatch()\n/* */ {\n/* 610 */ return this.registeredSuffixPatternMatch;\n/* */ }", "private static String replaceAll(Matcher matcher, String rep) {\n try {\n StringBuffer sb = null ; // Delay until needed\n while(matcher.find()) {\n if ( sb == null )\n sb = new StringBuffer() ;\n else {\n // Do one match of zerolength string otherwise filter out.\n if (matcher.start() == matcher.end() )\n continue ;\n }\n matcher.appendReplacement(sb, rep);\n }\n if ( sb == null )\n return null ;\n matcher.appendTail(sb);\n return sb.toString();\n } catch (IndexOutOfBoundsException ex) {\n throw new ExprEvalException(\"IndexOutOfBounds\", ex) ;\n }\n }", "public boolean useSuffixPatternMatch()\n/* */ {\n/* 590 */ return this.suffixPatternMatch;\n/* */ }", "public void setSuffixPatternMatch(boolean suffixPatternMatch)\n/* */ {\n/* 583 */ this.suffixPatternMatch = suffixPatternMatch;\n/* */ }", "@Test\n public void testCrazyPatterns() {\n assertEquals(\"java\\\\.\\\\{.*\\\\}\\\\.Array\", glob2Pattern(\"java.{**}.Array\").pattern());\n assertEquals(\"java\\\\./.*<>\\\\.Array\\\\$1\", glob2Pattern(\"java./**<>.Array$1\").pattern());\n assertEquals(\"\\\\+\\\\^\\\\$\", glob2Pattern(\"+^$\").pattern());\n }", "public void addPattern(TokenPattern pattern) throws Exception {\n if (pattern.getType() == TokenPattern.STRING_TYPE) {\n automaton.addTextMatch(pattern.getPattern(), ignoreCase, pattern);\n } else {\n automaton.addRegExpMatch(pattern.getPattern(), ignoreCase, pattern);\n }\n super.addPattern(pattern);\n }", "private static String wildcardAsRegex( String wildcard ) {\n\t\tStringBuilder sb = new StringBuilder( wildcard.length() * 110 / 100 );\n\t\tfor ( int i = 0; i < wildcard.length(); i++ ) {\n\t\t\tfinal char c = wildcard.charAt( i );\n\t\t\tswitch (c) {\n\t\t\tcase '*':\n\t\t\t\tsb.append( \".*?\" );\n\t\t\t\tbreak;\n\n\t\t\tcase '?':\n\t\t\t\tsb.append( \".\" );\n\t\t\t\tbreak;\n\n\t\t\t// chars that have magic regex meaning. They need quoting to be taken\n\t\t\t// literally\n\t\t\tcase '$':\n\t\t\tcase '(':\n\t\t\tcase ')':\n\t\t\tcase '+':\n\t\t\tcase '-':\n\t\t\tcase '.':\n\t\t\tcase '[':\n\t\t\tcase '\\\\':\n\t\t\tcase ']':\n\t\t\tcase '^':\n\t\t\tcase '{':\n\t\t\tcase '|':\n\t\t\tcase '}':\n\t\t\t\tsb.append( '\\\\' );\n\t\t\t\tsb.append( c );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tsb.append( c );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}", "public boolean isMatch(String target, String pattern) {\n if(pattern.isEmpty()) return target.isEmpty();\n \n boolean firstMatch = !target.isEmpty()&&(target.charAt(0)==pattern.charAt(0)||pattern.charAt(0)=='.');\n \n if(pattern.length()>=2 && pattern.charAt(1)=='*'){\n return isMatch(target,pattern.substring(2))||(firstMatch&&isMatch(target.substring(1),pattern));\n }else{\n return firstMatch&&isMatch(target.substring(1),pattern.substring(1));\n }\n \n \n }", "public void setPattern(String pattern) {\r\n\t\tthis.pattern = pattern;\r\n\t}", "public static void main(String[] args) {\n//\n// String pattern = \"abba\";\n// String s = \"dog cat cat fish\";\n\n\n// String pattern = \"aaaa\";\n// String s = \"dog cat cat dog\";\n\n String pattern = \"abba\";\n String s = \"dog dog dog dog\";\n\n// String pattern = \"e\";\n// String s = \"eukera\";\n\n boolean flag = wordPattern(pattern, s);\n\n System.out.println(flag);\n }", "public static void main(String[] args) {\n\t\tString s = \"abc\";\r\n\t\tString p = \".*\";\r\n\t\tSystem.out.println(isMatch(s, p));\r\n\t}", "public static Pattern likeToRegex(Pat pattern) {\n StringBuilder buf = new StringBuilder(\"^\");\n char[] charArray = pattern.s.toCharArray();\n int slash = -2;\n for (int i = 0; i < charArray.length; i++) {\n char c = charArray[i];\n if (slash == i - 1) {\n buf.append('[').append(c).append(']');\n } else {\n switch (c) {\n case '\\\\':\n slash = i;\n break;\n case '%':\n buf.append(\".*\");\n break;\n case '[':\n buf.append(\"\\\\[\");\n break;\n case ']':\n buf.append(\"\\\\]\");\n break;\n default:\n buf.append('[').append(c).append(']');\n }\n }\n }\n buf.append(\"$\");\n return Pattern.compile(buf.toString());\n }", "private static String globToRegex(final String glob) {\n return \"^\" + glob.replace(\".\", \"\\\\.\").replace(\"*\", \".*\") + \"$\";\n }", "public void setPattern (String pattern) {\n this.pattern = pattern;\n }", "public void setRegisteredSuffixPatternMatch(boolean registeredSuffixPatternMatch)\n/* */ {\n/* 601 */ this.registeredSuffixPatternMatch = registeredSuffixPatternMatch;\n/* 602 */ this.suffixPatternMatch = ((registeredSuffixPatternMatch) || (this.suffixPatternMatch));\n/* */ }", "private int matchLiteral(final String text, int pos, final Object[] items, final int itemIndex, final boolean[] complete) {\n\t\tint originalPos = pos;\n\t\tString patternLiteral = (String) items[itemIndex];\n\t\tint plen = patternLiteral.length();\n\t\tint tlen = text.length();\n\t\tint idx = 0;\n\t\twhile (idx < plen && pos < tlen) {\n\t\t\tchar pch = patternLiteral.charAt(idx);\n\t\t\tchar ich = text.charAt(pos);\n\t\t\tif (PatternProps.isWhiteSpace(pch) && PatternProps.isWhiteSpace(ich)) {\n\t\t\t\t// White space characters found in both patten and input.\n\t\t\t\t// Skip contiguous white spaces.\n\t\t\t\twhile ((idx + 1) < plen && PatternProps.isWhiteSpace(patternLiteral.charAt(idx + 1))) {\n\t\t\t\t\t++idx;\n\t\t\t\t}\n\t\t\t\twhile ((pos + 1) < tlen && PatternProps.isWhiteSpace(text.charAt(pos + 1))) {\n\t\t\t\t\t++pos;\n\t\t\t\t}\n\t\t\t} else if (pch != ich) {\n\t\t\t\tif (ich == '.' && pos == originalPos && 0 < itemIndex && isLenient()) {\n\t\t\t\t\tObject before = items[itemIndex - 1];\n\t\t\t\t\tif (before instanceof PatternItem) {\n\t\t\t\t\t\tboolean isNumeric = ((PatternItem) before).isNumeric;\n\t\t\t\t\t\tif (!isNumeric) {\n\t\t\t\t\t\t\t++pos; // just update pos\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t++idx;\n\t\t\t++pos;\n\t\t}\n\t\tcomplete[0] = idx == plen;\n\t\tif (complete[0] == false && isLenient() && 0 < itemIndex && itemIndex < items.length - 1) {\n\t\t\t// If fully lenient, accept \" \"* for any text between a date and a time field\n\t\t\t// We don't go more lenient, because we don't want to accept \"12/31\" for \"12:31\".\n\t\t\t// People may be trying to parse for a date, then for a time.\n\t\t\tif (originalPos < tlen) {\n\t\t\t\tObject before = items[itemIndex - 1];\n\t\t\t\tObject after = items[itemIndex + 1];\n\t\t\t\tif (before instanceof PatternItem && after instanceof PatternItem) {\n\t\t\t\t\tchar beforeType = ((PatternItem) before).type;\n\t\t\t\t\tchar afterType = ((PatternItem) after).type;\n\t\t\t\t\tif (DATE_PATTERN_TYPE.contains(beforeType) != DATE_PATTERN_TYPE.contains(afterType)) {\n\t\t\t\t\t\tint newPos = originalPos;\n\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\tchar ich = text.charAt(newPos);\n\t\t\t\t\t\t\tif (!PatternProps.isWhiteSpace(ich)) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t++newPos;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcomplete[0] = newPos > originalPos;\n\t\t\t\t\t\tpos = newPos;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn pos;\n\t}", "public static String getMultiRegexStEnd(int minimum){\n\t\t\t return \"^\" + getMultiRegex(minimum) + \"$\";\n\t }", "private static String translateToOriginPatternString(String originExpAbsolute) {\n\t\tString retVal = originExpAbsolute.replace(\".\", \"\\\\.\"); \n\t\tretVal = retVal.replace(ANY, \"(.*)\");\n\t\tretVal = retVal.replace(REGEX_ALLCHARS, \".\"); \n\t\tretVal = retVal.replace(\"{\", \"\\\\{\"); //this is for {ROOT}\n\t\tretVal = retVal.replace(\"}\", \"\\\\}\"); //this also is for {ROOT}\n\t\tretVal = retVal.replace(\"[\", \"\\\\[\"); //this is for [<className>]\n\t\tretVal = retVal.replace(\"]\", \"\\\\]\"); //this also is for [<className>]\n\t\tretVal = retVal.replace(\"$\", \"\\\\$\"); //this is for names of inner classes\n\t\tretVal = retVal.replace(REGEX_ENDLINE, \"$\"); \n\t\treturn retVal;\n\t}", "public void setPattern(Pattern pattern) {\n this.pattern = pattern;\n }", "private String fixTrailingStarToMatchAnything(String userExpression) {\n\t\tif (userExpression.endsWith(STAR) && !userExpression.endsWith(\".*\")) {\n\t\t\tuserExpression = userExpression.substring(0, userExpression.length()-1) + \".*\";\n\t\t}\n\t\treturn userExpression;\n\t}", "public void applyPattern(final String pat) {\n\t\tthis.pattern = pat;\n\t\tsetLocale(null, null);\n\t\t// reset parsed pattern items\n\t\tpatternItems = null;\n\t}", "public void setPattern(String pattern)\n/* */ {\n/* 71 */ setPatterns(new String[] { pattern });\n/* */ }", "Match getPartialMatch();", "public void doInitFilterPattern() {\n if (includeRegex != null) {\n includePattern = Pattern.compile(includeRegex);\n }\n }", "private static String cleanModuleName(String mn) {\n // replace non-alphanumeric\n mn = Patterns.NON_ALPHANUM.matcher(mn).replaceAll(\".\");\n\n // collapse repeating dots\n mn = Patterns.REPEATING_DOTS.matcher(mn).replaceAll(\".\");\n\n // drop leading dots\n if (!mn.isEmpty() && mn.charAt(0) == '.')\n mn = Patterns.LEADING_DOTS.matcher(mn).replaceAll(\"\");\n\n // drop trailing dots\n int len = mn.length();\n if (len > 0 && mn.charAt(len-1) == '.')\n mn = Patterns.TRAILING_DOTS.matcher(mn).replaceAll(\"\");\n\n return mn;\n }", "public static void main(String[] args){\n String str = \"aasdfasdfasdfasdfas\";\n String pattern = \"aasdf.*asdf.*asdf.*asdf.*s\";\n// String str = \"mississippi\";\n// String pattern = \"mis*is*ip*.\";\n// String pattern = \"mis*is*p*.\";\n// String pattern = \"mis*is*ip*.\";\n// String str = \"aaaaaaaaaaaaac\";\n// String pattern = \"a*a*a*a*a*a*a*a*a*a*c\";\n long time = System.currentTimeMillis();\n// String str = \"aaaaaaaaaaaaab\";\n// String pattern = \"a*a*a*a*a*a*a*a*a*a*b\";\n System.out.println(find(str,pattern));\n System.out.println(\"time: \" + (System.currentTimeMillis() - time));\n }", "void setPartialMatch(Match partialMatch);", "@Override\r\n\tpublic boolean matches(String first, String last) {\n\t\treturn false;\r\n\t}", "public static String removeLeadingDots(String dotPrefixedStr) {\n int pos = 0;\n while (pos < dotPrefixedStr.length() && dotPrefixedStr.charAt(pos) == Symbol.C_DOT) {\n pos++;\n }\n return pos < dotPrefixedStr.length() ? dotPrefixedStr.substring(pos) : Normal.EMPTY;\n }", "static void checkexpression(String sentence){\n //matching the sentence to see if it begins with capital letter and ends with .\n boolean check = Pattern.matches(\"^[A-Z].*[.]$\",sentence);\n if(check){\n System.out.println(\"Correct Format.\");\n }else{\n System.out.println(\"Incorrect Format.\");\n }\n }", "public void addPattern(TokenPattern pattern) throws Exception {\n automaton.addMatch(pattern.getPattern(), ignoreCase, pattern);\n super.addPattern(pattern);\n }", "public static void main(String args[]){\n String pattern = \"/^(http(s)?(:\\\\/\\\\/))?(www\\\\.)?\\\\.(\\\\/.*)?$/\";\r\n String input = \"(http://www.archive.com/web/http://www.mrvc.indianrai.gov.in/overview)\";\r\n\r\n Matcher matcher = Pattern.compile(pattern).matcher(input);\r\n while (matcher.find()) {\r\n System.out.println(matcher.group());\r\n int start = matcher.start(1);\r\n int end = matcher.end(1);\r\n String result = input.substring(start,end).replaceFirst(\"www.\",\"\");\r\n if(result.startsWith(\"www.\") ){\r\n input.substring(start,end).replaceFirst(\"www.\",\"\");\r\n }else if(result.startsWith(\"ww2.\")){\r\n input.substring(start,end).replaceFirst(\"ww2.\",\"\");\r\n }else if(result.startsWith(\"web.\")){\r\n input.substring(start,end).replaceFirst(\"web.\",\"\");\r\n }\r\n System.out.println(result);\r\n\r\n }\r\n }", "private void compilePattern() {\r\n\r\n pattern_startOfPage = Pattern.compile(regex_startOfPage);\r\n pattern_headerAttribute = Pattern.compile(regex_headerAttribute);\r\n pattern_messageFirstLine = Pattern.compile(regex_messageFirstLine);\r\n pattern_messageContinuationLine = Pattern.compile(regex_messageContinuationLine);\r\n }", "protected String maskFullDomainRandomly(String address, String replacement, int count) {\n return address.substring(0, count + 1) + replacement;\n }", "private String ensureWellFormed(String res)\r\n {\r\n String resource = res;\r\n int idx;\r\n\r\n // replace all occurances of '.*' with '*'\r\n while( (idx = resource.indexOf(TIGHT_BINDING+LOOSE_BINDING)) != -1)\r\n {\r\n if (idx == 0)\r\n {\r\n resource = LOOSE_BINDING +\r\n resource.substring(TIGHT_BINDING_LEN+LOOSE_BINDING_LEN);\r\n }\r\n else\r\n {\r\n resource = resource.substring(0, idx) + LOOSE_BINDING +\r\n resource.substring(idx+TIGHT_BINDING_LEN+LOOSE_BINDING_LEN);\r\n }\r\n }\r\n\r\n // replace all occurances of '*.' with '*'\r\n while( (idx = resource.indexOf(LOOSE_BINDING+TIGHT_BINDING)) != -1)\r\n {\r\n if (idx == 0)\r\n {\r\n resource = LOOSE_BINDING +\r\n resource.substring(TIGHT_BINDING_LEN+LOOSE_BINDING_LEN);\r\n }\r\n else\r\n {\r\n resource = resource.substring(0, idx) + LOOSE_BINDING +\r\n resource.substring(idx+LOOSE_BINDING_LEN+TIGHT_BINDING_LEN);\r\n }\r\n }\r\n\r\n return resource;\r\n }", "@Test\n public void wordPatternTest() {\n String pattern = \"aaa\", str = \"aa aa aa aa\";\n boolean ans = instance.wordPattern(pattern, str);\n System.out.println(ans);\n }", "private String expandAffix(String pattern, StringBuffer buffer) {\n buffer.setLength(0);\n for (int i = 0; i < pattern.length();) {\n char c = pattern.charAt(i++);\n if (c == QUOTE) {\n c = pattern.charAt(i++);\n switch (c) {\n case CURRENCY_SIGN:\n buffer.append(symbols.getCurrencySymbol());\n continue;\n case PATTERN_PERCENT:\n c = symbols.getPercent();\n break;\n case PATTERN_PER_MILLE:\n c = symbols.getPerMill();\n break;\n case PATTERN_MINUS:\n c = symbols.getMinusSign();\n break;\n }\n }\n buffer.append(c);\n }\n return buffer.toString();\n }", "public static CharSequence literalReplaceAll(CharSequence pattern, CharSequence replacement, CharSequence in, boolean ignoreCase) {\n if (in.length() < pattern.length()) {\n return in;\n }\n if (pattern.length() == 0) {\n throw new IllegalArgumentException(\"Pattern is the empty string\");\n }\n if (pattern.equals(replacement)) {\n throw new IllegalArgumentException(\"Replacing pattern with itself: \" + pattern);\n }\n int max = in.length();\n StringBuilder result = new StringBuilder(in.length() + replacement.length());\n int patternEnd = pattern.length() - 1;\n int testPos = pattern.length() - 1;\n int lastMatch = -1;\n for (int i = max - 1; i >= 0; i--) {\n char realChar = in.charAt(i);\n char testChar = pattern.charAt(testPos);\n if (ignoreCase) {\n realChar = Character.toLowerCase(realChar);\n testChar = Character.toLowerCase(testChar);\n }\n if (realChar == testChar) {\n testPos--;\n if (lastMatch == -1) {\n lastMatch = i;\n }\n if (testPos < 0) {\n result.insert(0, replacement);\n testPos = patternEnd;\n lastMatch = -1;\n }\n } else {\n if (lastMatch != -1) {\n CharSequence missed = in.subSequence(i, lastMatch + 1);\n result.insert(0, missed);\n lastMatch = -1;\n } else {\n result.insert(0, realChar);\n }\n testPos = patternEnd;\n }\n }\n return result;\n }", "private static String fixLeadingBracketSugar( String dotNotaton ) {\n\n if ( dotNotaton == null || dotNotaton.length() == 0 ) {\n return \"\";\n }\n\n char prev = dotNotaton.charAt( 0 );\n StringBuilder sb = new StringBuilder();\n sb.append( prev );\n\n for ( int index = 1; index < dotNotaton.length(); index++ ) {\n char curr = dotNotaton.charAt( index );\n\n if ( curr == '[' && prev != '\\\\') {\n if ( prev == '@' || prev == '.' ) {\n // no need to add an extra '.'\n }\n else {\n sb.append( '.' );\n }\n }\n\n sb.append( curr );\n prev = curr;\n }\n\n return sb.toString();\n }", "public static void main(String[]args) {\n Assert.assertEquals(test(\"*.a.b..c\", \"cdadbccc\"), true);\n// Assert.assertEquals(test(\".a\", \"bba\"), false);\n }", "@Test\n public void repeatedSubstringPattern() {\n assertTrue(new Solution1().repeatedSubstringPattern(\"abcabcabcabc\"));\n }", "public void testFullyQualified(){ \n // when I do this, I need to change the regex as EITHER\n // \n $anno $a = $anno.of(R.class);\n \n @draft.java.proto.SannoTest.R\n class C{} \n _class _c = _class.of(C.class); \n assertNotNull( $a.firstIn(_c) );\n \n @R\n class D{} \n _class _d = _class.of(D.class); \n assertNotNull( $a.firstIn(_d) ); \n }", "public void addPattern(String pattern) {\n\t\tArrayList<String> patterns = new ArrayList<String>();\n\t\tStringTokenizer entries = new StringTokenizer(pattern, \":,\");\n\t\twhile (entries.hasMoreTokens()) {\n\t\t\tpatterns.add(entries.nextToken());\n\t\t}\n\n\t\taddPatterns((String[]) patterns.toArray(new String[patterns.size()]));\n\t}", "void applyLocalizedPattern(String pattern) {\n applyPattern(pattern, true);\n }", "int containsMatchingPattern(Set<String> values, String pattern, boolean matchPrefix) {\n return memoizer.matches(values, pattern, matchPrefix, () -> {\n int match = -1;\n for(String val : values) {\n String replaced = val.replaceAll(\"\\\\.\", \"\\\\\\\\.\").replaceAll(\"\\\\*\", \".*\");\n if(Pattern.compile(replaced).matcher(pattern).matches() || (matchPrefix && val.startsWith(pattern + \".\"))) {\n match = replaced.contains(\"*\") ? 0 : 1;\n break;\n }\n }\n return match;\n });\n }", "String combine(String pattern1, String pattern2);", "private static String orderRegexpPattern(String regexp)\n {\n // convert expression to pattern\n StringBuffer pattern = null;\n for (int i = 0, limit = regexp.length(); (i < limit); i++)\n {\n char regexpChar = regexp.charAt(i);\n switch (regexpChar)\n {\n case '*':\n case '.':\n case '?':\n case '[':\n if (pattern == null)\n {\n pattern = new StringBuffer(regexp.length()*2);\n pattern.append(regexp.substring(0, i));\n }\n switch (regexpChar)\n {\n case '*':\n pattern.append(\"[^\"+Folder.PATH_SEPARATOR+\"]*\");\n break;\n case '.':\n pattern.append(\"\\\\.\");\n break;\n case '?':\n pattern.append(\"[^\"+Folder.PATH_SEPARATOR+\"]\");\n break;\n case '[':\n pattern.append('[');\n break;\n }\n break;\n default:\n if (pattern != null)\n {\n pattern.append(regexpChar);\n }\n break;\n }\n }\n\n // return converted pattern\n if (pattern != null)\n return pattern.toString();\n return regexp;\n }", "public NaiveStringMatcher(String pattern) {\n super(pattern);\n }", "public void addPattern(String pattern, Handler<Match> handler) {\n Matcher m = Pattern.compile(\":([A-Za-z][A-Za-z0-9]*)\").matcher(pattern);\n StringBuffer sb = new StringBuffer();\n Set<String> groups = new HashSet<>();\n while (m.find()) {\n String group = m.group().substring(1);\n if (groups.contains(group)) {\n throw new IllegalArgumentException(\"Cannot use identifier \" + group + \" more than once in pattern string\");\n }\n m.appendReplacement(sb, \"(?<$1>[^\\\\/]+)\");\n groups.add(group);\n }\n m.appendTail(sb);\n String regex = sb.toString();\n PatternBinding binding = new PatternBinding(Pattern.compile(regex), groups, handler);\n bindings.add(binding);\n }", "public TextValidatorResult validateCurrency(final String input,\n final boolean allowPartialMatching)\n {\n Pattern currency = Pattern.compile(\"^\\\\$?(\\\\d+(?:\\\\.\\\\d{2})?)$\");\n Matcher matches = currency.matcher(input);\n boolean res = matches.matches();\n ArrayList<String> results = new ArrayList<String>();\n\n if (res)\n {\n if (input.contains(\".\"))\n { // check case where a decimal exists and enforce entry of post-decimal values\n currency = Pattern.compile(\"^\\\\$?(\\\\d+(?:\\\\.\\\\d{2}))$\");\n matches = currency.matcher(input);\n res = matches.matches();\n if (res)\n {\n for (int i = 0; i < matches.groupCount() + 1; i++)\n {\n results.add(matches.group(i));\n }\n return new TextValidatorResult(1, results, \"\");\n }\n else\n {\n return new TextValidatorResult(-2, results,\n \"Invalid format. If using decimal, enter all values afterwards.\\nExample: 4 or 4.10\");\n }\n }\n else\n {\n for (int i = 0; i < matches.groupCount() + 1; i++)\n {\n results.add(matches.group(i));\n }\n return new TextValidatorResult(1, results, \"\");\n }\n }\n else\n {\n if (matches.hitEnd() && allowPartialMatching)\n {\n return new TextValidatorResult(1, results, \"\");\n }\n else\n { // Check case where a decimal exists and force entry of post-decimal values\n if (input.contains(\".\"))\n {\n return new TextValidatorResult(-2, results,\n \"invalid format. Example, either: 4 OR 4.10\\n(Include all\" +\n \" values after decimal, if a point is used.\");\n }\n else\n {\n return new TextValidatorResult(-1, results,\n \"invalid format. Example, either: 4 OR 4.10\\n(Include all values after decimal, if a point is used.\");\n }\n\n }\n }\n }", "public abstract String generateUntil(String regex, int minLength, int maxLength);", "private String getDecimalPattern(String str) {\n int decimalCount = str.length() - str.indexOf(\".\") - 1;\n StringBuilder decimalPattern = new StringBuilder();\n for (int i = 0; i < decimalCount && i < MAX_DECIMAL; i++) {\n decimalPattern.append(\"0\");\n }\n return decimalPattern.toString();\n }", "private void applyPattern(String pattern, boolean localized) {\n char zeroDigit = PATTERN_ZERO_DIGIT;\n char groupingSeparator = PATTERN_GROUPING_SEPARATOR;\n char decimalSeparator = PATTERN_DECIMAL_SEPARATOR;\n char percent = PATTERN_PERCENT;\n char perMill = PATTERN_PER_MILLE;\n char digit = PATTERN_DIGIT;\n char separator = PATTERN_SEPARATOR;\n char exponent = PATTERN_EXPONENT;\n char minus = PATTERN_MINUS;\n if (localized) {\n zeroDigit = symbols.getZeroDigit();\n groupingSeparator = symbols.getGroupingSeparator();\n decimalSeparator = symbols.getDecimalSeparator();\n percent = symbols.getPercent();\n perMill = symbols.getPerMill();\n digit = symbols.getDigit();\n separator = symbols.getPatternSeparator();\n exponent = symbols.getExponentialSymbol();\n minus = symbols.getMinusSign();\n }\n boolean gotNegative = false;\n\n decimalSeparatorAlwaysShown = false;\n isCurrencyFormat = false;\n useExponentialNotation = false;\n\n // Two variables are used to record the subrange of the pattern\n // occupied by phase 1. This is used during the processing of the\n // second pattern (the one representing negative numbers) to ensure\n // that no deviation exists in phase 1 between the two patterns.\n int phaseOneStart = 0;\n int phaseOneLength = 0;\n /**\n * Back-out comment : HShih boolean phaseTwo = false;\n */\n\n int start = 0;\n for (int j = 1; j >= 0 && start < pattern.length(); --j) {\n boolean inQuote = false;\n StringBuffer prefix = new StringBuffer();\n StringBuffer suffix = new StringBuffer();\n int decimalPos = -1;\n int multiplier = 1;\n int digitLeftCount = 0, zeroDigitCount = 0, digitRightCount = 0;\n byte groupingCount = -1;\n\n // The phase ranges from 0 to 2. Phase 0 is the prefix. Phase 1 is\n // the section of the pattern with digits, decimal separator,\n // grouping characters. Phase 2 is the suffix. In phases 0 and 2,\n // percent, permille, and currency symbols are recognized and\n // translated. The separation of the characters into phases is\n // strictly enforced; if phase 1 characters are to appear in the\n // suffix, for example, they must be quoted.\n int phase = 0;\n\n // The affix is either the prefix or the suffix.\n StringBuffer affix = prefix;\n\n for (int pos = start; pos < pattern.length(); ++pos) {\n char ch = pattern.charAt(pos);\n switch (phase) {\n case 0:\n case 2:\n // Process the prefix / suffix characters\n if (inQuote) {\n // A quote within quotes indicates either the\n // closing\n // quote or two quotes, which is a quote literal.\n // That\n // is,\n // we have the second quote in 'do' or 'don''t'.\n if (ch == QUOTE) {\n if ((pos + 1) < pattern.length() && pattern.charAt(pos + 1) == QUOTE) {\n ++pos;\n affix.append(\"''\"); // 'don''t'\n } else {\n inQuote = false; // 'do'\n }\n continue;\n }\n } else {\n // Process unquoted characters seen in prefix or\n // suffix\n // phase.\n if (ch == digit || ch == zeroDigit || ch == groupingSeparator || ch == decimalSeparator) {\n // Any of these characters implicitly begins the\n // next\n // phase. If we are in phase 2, there is no next\n // phase,\n // so these characters are illegal.\n /**\n * 1.2 Back-out comment : HShih Can't throw exception here. if (phase == 2) throw new IllegalArgumentException\n * (\"Unquoted special character '\" + ch + \"' in pattern \\\"\" + pattern + '\"');\n */\n phase = 1;\n if (j == 1)\n phaseOneStart = pos;\n --pos; // Reprocess this character\n continue;\n } else if (ch == CURRENCY_SIGN) {\n // Use lookahead to determine if the currency\n // sign\n // is\n // doubled or not.\n boolean doubled = (pos + 1) < pattern.length() && pattern.charAt(pos + 1) == CURRENCY_SIGN;\n if (doubled)\n ++pos; // Skip over the doubled character\n isCurrencyFormat = true;\n affix.append(doubled ? \"'\\u00A4\\u00A4\" : \"'\\u00A4\");\n continue;\n } else if (ch == QUOTE) {\n // A quote outside quotes indicates either the\n // opening\n // quote or two quotes, which is a quote\n // literal.\n // That is,\n // we have the first quote in 'do' or o''clock.\n if (ch == QUOTE) {\n if ((pos + 1) < pattern.length() && pattern.charAt(pos + 1) == QUOTE) {\n ++pos;\n affix.append(\"''\"); // o''clock\n } else {\n inQuote = true; // 'do'\n }\n continue;\n }\n } else if (ch == separator) {\n // Don't allow separators before we see digit\n // characters of phase\n // 1, and don't allow separators in the second\n // pattern (j == 0).\n if (phase == 0 || j == 0)\n throw new IllegalArgumentException(\"Unquoted special character '\" + ch + \"' in pattern \\\"\" + pattern + '\"');\n start = pos + 1;\n pos = pattern.length();\n continue;\n }\n\n // Next handle characters which are appended\n // directly.\n else if (ch == percent) {\n if (multiplier != 1)\n throw new IllegalArgumentException(\"Too many percent/permille characters in pattern \\\"\" + pattern + '\"');\n multiplier = 100;\n affix.append(\"'%\");\n continue;\n } else if (ch == perMill) {\n if (multiplier != 1)\n throw new IllegalArgumentException(\"Too many percent/permille characters in pattern \\\"\" + pattern + '\"');\n multiplier = 1000;\n affix.append(\"'\\u2030\");\n continue;\n } else if (ch == minus) {\n affix.append(\"'-\");\n continue;\n }\n }\n // Note that if we are within quotes, or if this is an\n // unquoted,\n // non-special character, then we usually fall through\n // to\n // here.\n affix.append(ch);\n break;\n case 1:\n // Phase one must be identical in the two sub-patterns.\n // We\n // enforce this by doing a direct comparison. While\n // processing the first sub-pattern, we just record its\n // length. While processing the second, we compare\n // characters.\n if (j == 1)\n ++phaseOneLength;\n else {\n /**\n * 1.2 Back-out comment : HShih if (ch != pattern.charAt(phaseOneStart++)) throw new IllegalArgumentException\n * (\"Subpattern mismatch in \\\"\" + pattern + '\"'); phaseTwo = true;\n */\n if (--phaseOneLength == 0) {\n phase = 2;\n affix = suffix;\n }\n continue;\n }\n\n // Process the digits, decimal, and grouping characters.\n // We\n // record five pieces of information. We expect the\n // digits\n // to occur in the pattern ####0000.####, and we record\n // the\n // number of left digits, zero (central) digits, and\n // right\n // digits. The position of the last grouping character\n // is\n // recorded (should be somewhere within the first two\n // blocks\n // of characters), as is the position of the decimal\n // point,\n // if any (should be in the zero digits). If there is no\n // decimal point, then there should be no right digits.\n if (ch == digit) {\n if (zeroDigitCount > 0)\n ++digitRightCount;\n else\n ++digitLeftCount;\n if (groupingCount >= 0 && decimalPos < 0)\n ++groupingCount;\n } else if (ch == zeroDigit) {\n if (digitRightCount > 0)\n throw new IllegalArgumentException(\"Unexpected '0' in pattern \\\"\" + pattern + '\"');\n ++zeroDigitCount;\n if (groupingCount >= 0 && decimalPos < 0)\n ++groupingCount;\n } else if (ch == groupingSeparator) {\n groupingCount = 0;\n } else if (ch == decimalSeparator) {\n if (decimalPos >= 0)\n throw new IllegalArgumentException(\"Multiple decimal separators in pattern \\\"\" + pattern + '\"');\n decimalPos = digitLeftCount + zeroDigitCount + digitRightCount;\n } else if (ch == exponent) {\n if (useExponentialNotation)\n throw new IllegalArgumentException(\"Multiple exponential \" + \"symbols in pattern \\\"\" + pattern + '\"');\n useExponentialNotation = true;\n minExponentDigits = 0;\n\n // Use lookahead to parse out the exponential part\n // of\n // the\n // pattern, then jump into phase 2.\n while (++pos < pattern.length() && pattern.charAt(pos) == zeroDigit) {\n ++minExponentDigits;\n ++phaseOneLength;\n }\n\n if ((digitLeftCount + zeroDigitCount) < 1 || minExponentDigits < 1)\n throw new IllegalArgumentException(\"Malformed exponential \" + \"pattern \\\"\" + pattern + '\"');\n\n // Transition to phase 2\n phase = 2;\n affix = suffix;\n --pos;\n continue;\n } else {\n phase = 2;\n affix = suffix;\n --pos;\n --phaseOneLength;\n continue;\n }\n break;\n }\n }\n /**\n * 1.2 Back-out comment : HShih if (phaseTwo && phaseOneLength > 0) throw new IllegalArgumentException(\"Subpattern mismatch in \\\"\" + pattern +\n * '\"');\n */\n // Handle patterns with no '0' pattern character. These patterns\n // are legal, but must be interpreted. \"##.###\" -> \"#0.###\".\n // \".###\" -> \".0##\".\n /*\n * We allow patterns of the form \"####\" to produce a zeroDigitCount\n * of zero (got that?); although this seems like it might make it\n * possible for format() to produce empty strings, format() checks\n * for this condition and outputs a zero digit in this situation.\n * Having a zeroDigitCount of zero yields a minimum integer digits\n * of zero, which allows proper round-trip patterns. That is, we\n * don't want \"#\" to become \"#0\" when toPattern() is called (even\n * though that's what it really is, semantically).\n */\n if (zeroDigitCount == 0 && digitLeftCount > 0 && decimalPos >= 0) {\n // Handle \"###.###\" and \"###.\" and \".###\"\n int n = decimalPos;\n if (n == 0)\n ++n; // Handle \".###\"\n digitRightCount = digitLeftCount - n;\n digitLeftCount = n - 1;\n zeroDigitCount = 1;\n }\n\n // Do syntax checking on the digits.\n if ((decimalPos < 0 && digitRightCount > 0)\n || (decimalPos >= 0 && (decimalPos < digitLeftCount || decimalPos > (digitLeftCount + zeroDigitCount))) || groupingCount == 0 || inQuote)\n throw new IllegalArgumentException(\"Malformed pattern \\\"\" + pattern + '\"');\n\n if (j == 1) {\n posPrefixPattern = prefix.toString();\n posSuffixPattern = suffix.toString();\n negPrefixPattern = posPrefixPattern; // assume these for now\n negSuffixPattern = posSuffixPattern;\n int digitTotalCount = digitLeftCount + zeroDigitCount + digitRightCount;\n /*\n * The effectiveDecimalPos is the position the decimal is at or\n * would be at if there is no decimal. Note that if\n * decimalPos<0, then digitTotalCount == digitLeftCount +\n * zeroDigitCount.\n */\n int effectiveDecimalPos = decimalPos >= 0 ? decimalPos : digitTotalCount;\n setMinimumIntegerDigits(effectiveDecimalPos - digitLeftCount);\n setMaximumIntegerDigits(useExponentialNotation ? digitLeftCount + getMinimumIntegerDigits() : DOUBLE_INTEGER_DIGITS);\n setMaximumFractionDigits(decimalPos >= 0 ? (digitTotalCount - decimalPos) : 0);\n setMinimumFractionDigits(decimalPos >= 0 ? (digitLeftCount + zeroDigitCount - decimalPos) : 0);\n setGroupingUsed(groupingCount > 0);\n this.groupingSize = (groupingCount > 0) ? groupingCount : 0;\n this.multiplier = multiplier;\n setDecimalSeparatorAlwaysShown(decimalPos == 0 || decimalPos == digitTotalCount);\n } else {\n negPrefixPattern = prefix.toString();\n negSuffixPattern = suffix.toString();\n gotNegative = true;\n }\n }\n\n if (pattern.length() == 0) {\n posPrefixPattern = posSuffixPattern = \"\";\n setMinimumIntegerDigits(0);\n setMaximumIntegerDigits(DOUBLE_INTEGER_DIGITS);\n setMinimumFractionDigits(0);\n setMaximumFractionDigits(DOUBLE_FRACTION_DIGITS);\n }\n\n // If there was no negative pattern, or if the negative pattern is\n // identical\n // to the positive pattern, then prepend the minus sign to the positive\n // pattern to form the negative pattern.\n if (!gotNegative || (negPrefixPattern.equals(posPrefixPattern) && negSuffixPattern.equals(posSuffixPattern))) {\n negSuffixPattern = posSuffixPattern;\n negPrefixPattern = \"'-\" + posPrefixPattern;\n }\n\n expandAffixes();\n }", "private String getSplitCapitalPeriodSent(String text) {\n\t\t\r\n\t\tString testString = text;\r\n\t\t\r\n\t\t/*\r\n\t\ttestString = testString.replaceAll(\"\\\\·\", \".\"); // To avoid the error ClausIE spliter: the dash will disappear\r\n\t\t// https://d5gate.ag5.mpi-sb.mpg.de/ClausIEGate/ClausIEGate?inputtext=Optimal+temperature+and+pH+for+growth+are+25%E2%80%9330+%CB%9AC+and+pH+7%2C+respectively.&processCcAllVerbs=true&processCcNonVerbs=true&type=true&go=Extract\r\n\t\ttestString = testString.replaceAll(\"\\\\s?\\\\·\\\\s?\", \".\"); // To avoid the error ClausIE spliter: the dash will disappear\r\n\t\t\r\n\t\ttestString = testString.replaceAll(\"–\", \"-\"); // To avoid the error ClausIE spliter: the dash will disappear\r\n\t\t// https://d5gate.ag5.mpi-sb.mpg.de/ClausIEGate/ClausIEGate?inputtext=Optimal+temperature+and+pH+for+growth+are+25%E2%80%9330+%CB%9AC+and+pH+7%2C+respectively.&processCcAllVerbs=true&processCcNonVerbs=true&type=true&go=Extract\r\n\t\ttestString = testString.replaceAll(\"\\\\s?-\\\\s?\", \"-\"); // To avoid the error ClausIE spliter: the dash will disappear\r\n\t\t*/\r\n\t\t\r\n\t\t// System.out.println(\"testString::Before::\" + testString);\r\n\t\t\r\n\t\tString targetPatternString = \"(\\\\s[A-Z]\\\\.\\\\s)\";\r\n\t\tPattern pattern = Pattern.compile(targetPatternString);\r\n\t\tMatcher matcher = pattern.matcher(testString);\r\n\t\t\r\n\t\twhile (matcher.find()) {\r\n\t\t\t// System.out.println(\"Whloe Sent::\" + matcher.group());\r\n\t\t\t// System.out.println(\"Part 1::\" + matcher.group(1));\r\n\t\t\t// System.out.println(\"Part 2::\" + matcher.group(2));\r\n\t\t\t// System.out.println(\"Part 3::\" + matcher.group(3));\r\n\t\t\t\r\n\t\t\tString matchString = matcher.group(1);\r\n\t\t\t\r\n\t\t\tString newMatchString = \"\";\r\n\t\t\tfor ( int j = 0; j < matchString.length(); j++ ) {\r\n\t\t\t\tnewMatchString += matchString.substring(j, j+1) + \" \";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"getSplitCapitalPeriodSent::OriginalSent::\" + text);\r\n\t\t\tSystem.out.println(\"matchString:: \" + matchString);\r\n\t\t\tSystem.out.println(\"newMatchString:: \" + newMatchString);\r\n\t\t\t\r\n\t\t\tlog(LogLevel.INFO, \"getSplitCapitalPeriodSent::OriginalSent::\" + text);\r\n\t\t\tlog(LogLevel.INFO, \"matchString:: \" + matchString);\r\n\t\t\tlog(LogLevel.INFO, \"newMatchString:: \" + newMatchString);\r\n\t\t\t\r\n\t\t\ttestString = testString.replaceAll(matcher.group(1), newMatchString);\r\n\t\t\t\r\n\t\t\t// String matchResult = matcher.group(1);\r\n\t\t\t// System.out.println(\"matchResult::\" + matchResult);\r\n\t\t}\r\n\t\t\r\n\t\t// System.out.println(\"testString::After::\" + testString);\r\n\t\t\r\n\t\treturn testString;\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t Pattern p = Pattern.compile(\"(a+)\");\r\n\t\t Matcher m = p.matcher(\"aaaaaba\");\r\n\t\t //System.out.println(m.matches())\r\n\t\t m.find();\t\t \r\n\t\t m.find();\r\n\t\t System.out.println(\"grCount \"+m.groupCount());\t \r\n\t\t MatchResult mr = m.toMatchResult();\r\n\t\t \r\n\t\t System.out.println(m.end());\r\n\t\t System.out.println(\"'\"+mr.group()+\"'\");\r\n\t\t System.out.println(\"start \"+mr.start(1));\r\n\t\t \r\n\t}", "public static String wildcardToRegex(String wildcard){\r\n StringBuffer s = new StringBuffer(wildcard.length());\r\n s.append('^');\r\n for (int i = 0, is = wildcard.length(); i < is; i++) {\r\n char c = wildcard.charAt(i);\r\n switch(c) {\r\n case '*':\r\n s.append(\".*\");\r\n break;\r\n case '?':\r\n s.append(\".\");\r\n break;\r\n // escape special regexp-characters\r\n case '(': case ')': case '[': case ']': case '$':\r\n case '^': case '.': case '{': case '}': case '|':\r\n case '\\\\':\r\n s.append(\"\\\\\");\r\n s.append(c);\r\n break;\r\n default:\r\n s.append(c);\r\n break;\r\n }\r\n }\r\n s.append('$');\r\n return(s.toString());\r\n }", "private String translatePattern(String pattern) {\r\n StringBuffer sb = new StringBuffer();\r\n boolean escaped = false;\r\n for (int i = 0; i < pattern.length(); i++) {\r\n char c = pattern.charAt(i);\r\n if (c == '\\\\') {\r\n sb.append('\\\\');\r\n escaped = true;\r\n continue;\r\n }\r\n if (escaped) {\r\n sb.append(c);\r\n }\r\n else if (c == '*') {\r\n sb.append('%');\r\n }\r\n else if (c == '?') {\r\n sb.append('_');\r\n }\r\n else {\r\n if ((c == '%') || (c == '_')) {\r\n sb.append('\\\\');\r\n }\r\n sb.append(c);\r\n }\r\n\r\n escaped = false;\r\n }\r\n return sb.toString();\r\n }", "private boolean isValid(String s, boolean hasDot) {\n\t if (s.length() > 0 && (s.charAt(0) == '+' || s.charAt(0) == '-')) {\n\t \ts = s.substring(1);\n\t }\n\t \n\t if (s.isEmpty() || s.equals(\".\")) {\n\t \treturn false;\n\t }\n\t \n\t for (int i = 0; i<s.length(); i++) {\n\t \tchar c = s.charAt(i);\n\t if (c == '.') {\n\t \t//can not have a second dot\n\t if (hasDot) {\n\t \treturn false;\n\t }\t \n\t hasDot = true;\n\t } else if (!('0' <= c && c <= '9')) {\n\t return false;\n\t }\n\t }\n\t return true;\n\t}", "public static String ConvertExtension(String s,String dot) {\n\t\tif(!s.contains(dot)) {\n\t\t\treturn s+dot;\n\t\t}\n\t\treturn s;\n\t}", "@Override\r\n\tpublic void search(Pattern pattern) {\r\n\t\tregularSearch.setPattern(pattern);\r\n\t\tStringBuffer result = regularSearch.lookAt(new StringBuffer(source\r\n\t\t\t\t.toString()));\r\n\t\tmatchFound(result, source);\r\n\t}", "protected static Pattern newPattern(\n String pattern\n ){\n return pattern == null ? null : Pattern.compile(\n \"^\" + pattern.replaceAll(\"\\\\*\\\\*\", \".\\t\").replaceAll(\"\\\\*\", \"[^/]*\").replace('\\t', '*') + \"$\"\n );\n }", "private boolean startsWithAny(final String anyString, final String... startValues) {\n for (final String startValue : startValues) {\n if (shouldFixLineStart(anyString, startValue)) {\n return true;\n }\n }\n return false;\n }", "public void setAttributeMatchRegexPattern(String pattern)\n\t{\n\t\tthis.attributeMatchRegexPattern = pattern;\n\t}", "private boolean initPatternAndTargets() {\n Server das = domain.getServerNamed(\"server\");\n String targetName = null;\n\n // no DAS in here!\n List<Server> allServers = targetService.getAllInstances();\n\n allServers.add(das);\n\n // 0 decode special things\n // \\\\ == literal backslash and \\ is escaping next char\n userarg = handleEscapes(userarg); // too complicated to do in-line\n\n // MONDOT, SLASH should be replaced with literals\n userarg = userarg.replace(MONDOT, \".\").replace(SLASH, \"/\");\n\n // 1. nothing\n // 2. *\n // 3. *. --> which is a weird input but let's accept it anyway!\n // 4 . --> very weird but we'll take it\n if (!ok(userarg)\n || userarg.equals(\"*\")\n || userarg.equals(\".\")\n || userarg.equals(\"*.\")) {\n // By definition this means ALL servers and ALL data\n targets = allServers;\n pattern = \"*\";\n return true;\n }\n\n // 5. *..\n // 6. *.<something>\n if (userarg.startsWith(\"*.\")) {\n targets = allServers;\n\n // note: it can NOT be just \"*.\" -- there is something at posn #2 !!\n pattern = userarg.substring(2);\n\n // \"*..\" is an error\n if (pattern.startsWith(\".\")) {\n String specificError = Strings.get(\"admin.get.monitoring.nodoubledot\");\n setError(Strings.get(\"admin.get.monitoring.invalidpattern\", specificError));\n return false;\n }\n return true;\n }\n\n // 7. See 14685 for an example --> \"*jsp*\"\n if (userarg.startsWith(\"*\")) {\n targets = allServers;\n pattern = userarg.substring(1);\n return true;\n }\n\n // Another example:\n // servername*something*\n // IT 14778\n // note we will NOT support serv*something getting resolved to server*something\n // that's too crazy. They have to enter a reasonable name\n\n // we are looking for, e.g. instance1*foo.goo*\n // target is instance1 pattern is *foo.goo*\n // instance1.something is handled below\n String re = \"[^\\\\.]+\\\\*.*\";\n\n if (userarg.matches(re)) {\n int index = userarg.indexOf(\"*\");\n\n if (index < 0) { // can't happen!!\n setError(Strings.get(\"admin.get.monitoring.invalidtarget\", userarg));\n return false;\n }\n targetName = userarg.substring(0, index);\n pattern = userarg.substring(index);\n }\n\n if (targetName == null) {\n int index = userarg.indexOf(\".\");\n\n if (index >= 0) {\n targetName = userarg.substring(0, index);\n\n if (userarg.length() == index + 1) {\n // 8. <servername>.\n pattern = \"*\";\n }\n else\n // 9. <servername>.<pattern>\n pattern = userarg.substring(index + 1);\n }\n else {\n // no dots in userarg\n // 10. <servername>\n targetName = userarg;\n pattern = \"*\";\n }\n }\n\n // note that \"server\" is hard-coded everywhere in GF code. We're stuck with it!!\n\n if (targetName.equals(\"server\") || targetName.equals(\"server-config\")) {\n targets.add(das);\n return true;\n }\n\n // targetName is either 1 or more instances or garbage!\n targets = targetService.getInstances(targetName);\n\n if (targets.isEmpty()) {\n setError(Strings.get(\"admin.get.monitoring.invalidtarget\", userarg));\n return false;\n }\n\n return true;\n }", "public Pattern(String pattern)\n {\n ArrayList<Delta> temporary = new ArrayList<>();\n\n Matcher matcher = _regex.matcher(pattern);\n\n // Finds first match and asserts there is at least one\n assert(matcher.find());\n\n // Find all the deltas\n do _addDeltas(matcher, temporary, _parseDelta(matcher));\n\n while(matcher.find());\n\n _pattern = temporary.toArray(new Delta[temporary.size()]);\n }", "public void setPattern(String pPattern) {\n pattern = Pattern.compile(pPattern);\n }", "public static void main(String[] args) throws Exception {\n String s;\n// s = \"0000000000000\";\n s = \"000000-123456\";\n// s = \"000000123456\";\n if (s.matches(\"^0+$\")) {\n s = \"0\";\n }else{\n s = s.replaceFirst(\"^0+\",\"\");\n }\n System.out.println(s);\n\n\n// System.out.println(StringUtils.addRight(s,'A',mod));\n// String s = \"ECPay thong bao: Tien dien T11/2015 cua Ma KH PD13000122876, la 389.523VND. Truy cap www.ecpay.vn hoac lien he 1900561230 de biet them chi tiet.\";\n// Pattern pattern = Pattern.compile(\"^(.+)[ ](\\\\d+([.]\\\\d+)*)+VND[.](.+)$\");\n// Matcher matcher = pattern.matcher(s);\n// if(matcher.find()){\n// System.out.println(matcher.group(2));\n// }\n }", "static String findSubstringByFooterString(String src, String start, String before, String after, boolean caseSensitive)\n throws UnexpectedFormatException {\n int pos = safeIndexOf(src, start, 0, caseSensitive);\n return findSubstringByFooterString(src, pos+start.length(), before, after, caseSensitive);\n }", "private static boolean isPrefix_r(String text, String pattern)\n {\n /*\n System.out.printf(\"text...: %s\\n\", text);\n System.out.printf(\"pattern: %s\\n\", pattern);\n System.out.println(\"---------------------------------\");\n */\n\n if (pattern.length() == 0)\n return true;\n else if (text.length() < pattern.length())\n return false;\n else if (text.charAt(0) != pattern.charAt(0))\n return false;\n else\n return isPrefix_r(text.substring(1), pattern.substring(1));\n }", "@Override\n\tpublic void setPattern(String domain) {\n\t\t\n\t}", "public String wild(String text, String pattern)\n {\n\t\tString result = \"\";\n\t\tif(pattern.contains(\"*\"))\n\t\t{\n\t\t\t\tArrayList<String> sb = new ArrayList<String>();\n\t\n\t\t\tString [] cards = pattern.split(\"\\\\*\");\n\t\t\tfor(int i=0;i<cards.length;i++)\n\t\t\t{\n\t\t\t\tif(!\"\".equalsIgnoreCase(cards[i]))\n\t\t\t\t\tsb.add(cards[i]);\n\t\t\t}\n\t\t\tboolean st=false,en=false;\n\t\n\t\t\tfor (String card : cards)\n\t\t\t{\n\t\t\t\tst = text.startsWith(card);\n\t\n\t\t\t\ten = text.endsWith(card);\n\t\t\t}\n\t\n\t\t\tif(st == true && sb.size() == 1)\n\t\t\t\ten = true;\n\t\t\tif(en == true && sb.size() == 1)\n\t\t\t\tst = true;\n\t\t\tif(st && en)\n\t\t\t\t//System.out.println(text);\n\t\t\t\tresult = text;\n\t\t}\n\t\telse if(pattern.contains(\"?\"))\n\t\t{\n\t\t\t\n\t\t\t//System.out.println(\"???\");\n\t\t\tint i=0;\n\t\t\tchar[] temp = pattern.toCharArray();\n\t\t\tString temp1=\"\",temp3=\"\";\n\t\t\t\n\t\t\tfor(char c : temp)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(c == '?')\n\t\t\t\t\tbreak;\n\t\t\t\t\ti++;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(i>0)\n\t\t\t{\n\t\t\t\ttemp1 = pattern.substring(0,i-1);\n\t\t\t\ttemp3 = pattern.charAt(i-1)+\"\";\n\t\t\t\t\t//System.out.println(temp1+\" ff \"+temp3);\n\t\t\t\t\t\n\t\t\t\t\tif(text.startsWith(temp1))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!\"\".equalsIgnoreCase(temp3))\n\t\t\t\t\t\t\t//System.out.println(text);\n\t\t\t\t\t\t\tresult = text;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t//System.out.println(text);\n\t\t\t\t\t\t\tresult = text;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\n\t\t\t\ttemp3 = pattern.charAt(i+1)+\"\";\n\t\t\t\tif((i+2)<pattern.length())\n\t\t\t\t\ttemp1 = pattern.substring(i+2,pattern.length());\n\t\t\t\t//System.out.println(temp1+\" \"+temp3);\n\t\t\t\tif(text.startsWith(temp1))\n\t\t\t\t{\n\t\t\t\t\tif(!\"\".equalsIgnoreCase(temp3))\n\t\t\t\t\t\t//System.out.println(text);\n\t\t\t\t\t\tresult = text;\n\t\t\t\t\telse\n\t\t\t\t\t\tresult = text;\n\t\t\t\t\t//System.out.println(text);\n\t\t\t\t}\n\t\t\t\t//System.out.println(temp1);\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(text.equalsIgnoreCase(pattern))\n\t\t\t\t\t//System.out.println(text);\n\t\t\t\t\tresult = text;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\treturn result;\n\t\t}", "default HtmlFormatter replace(Pattern pattern, String replacement) {\n return andThen(s -> pattern.matcher(s).replaceAll(replacement));\n }", "public boolean isMatch2(){\r\n if(str==null ||pattern==null) return false; \r\n boolean[][] match=new boolean[lens+1][lenp+1];\r\n match[0][0]=true; \r\n for (int i = 0; i <lenp; i++) {\r\n if (pattern.charAt(i) == '*' && match[0][i-1]) \r\n match[0][i+1] = true; \r\n }\r\n for (int i = 0 ; i < lens; i++) {\r\n for (int j = 0; j < lenp; j++) {\r\n if (pattern.charAt(j) == '.') {\r\n match[i+1][j+1] = match[i][j];\r\n }\r\n if (pattern.charAt(j) == str.charAt(i)) {\r\n match[i+1][j+1] = match[i][j];\r\n }\r\n if (pattern.charAt(j) == '*') {\r\n if (pattern.charAt(j-1) != str.charAt(i) && pattern.charAt(j-1) != '.') {\r\n match[i+1][j+1] = match[i+1][j-1];\r\n } else {\r\n match[i+1][j+1] = (match[i+1][j] || match[i][j+1] || match[i+1][j-1]);\r\n }\r\n }\r\n }\r\n }\r\n return match[lens][lenp];\r\n }", "public void applyLocalizedPattern(final String pat) {\n\t\tthis.pattern = translatePattern(pat, formatData.localPatternChars, DateFormatSymbols.patternChars);\n\t\tsetLocale(null, null);\n\t}", "private String prependServerDot(String s) {\n\n final String namedot = serverEnv.getInstanceName() + \".\";\n\n if(s.startsWith(namedot))\n return s;\n\n return namedot + s;\n }", "protected static boolean matchPath( String pattern, String str, boolean isCaseSensitive )\n {\n // When str starts with a File.separator, pattern has to start with a\n // File.separator.\n // When pattern starts with a File.separator, str has to start with a\n // File.separator.\n if( str.startsWith( File.separator ) !=\n pattern.startsWith( File.separator ) )\n {\n return false;\n }\n\n ArrayList patDirs = new ArrayList();\n StringTokenizer st = new StringTokenizer( pattern, File.separator );\n while( st.hasMoreTokens() )\n {\n patDirs.add( st.nextToken() );\n }\n\n ArrayList strDirs = new ArrayList();\n st = new StringTokenizer( str, File.separator );\n while( st.hasMoreTokens() )\n {\n strDirs.add( st.nextToken() );\n }\n\n int patIdxStart = 0;\n int patIdxEnd = patDirs.size() - 1;\n int strIdxStart = 0;\n int strIdxEnd = strDirs.size() - 1;\n\n // up to first '**'\n while( patIdxStart <= patIdxEnd && strIdxStart <= strIdxEnd )\n {\n String patDir = (String)patDirs.get( patIdxStart );\n if( patDir.equals( \"**\" ) )\n {\n break;\n }\n if( !match( patDir, (String)strDirs.get( strIdxStart ), isCaseSensitive ) )\n {\n return false;\n }\n patIdxStart++;\n strIdxStart++;\n }\n if( strIdxStart > strIdxEnd )\n {\n // String is exhausted\n for( int i = patIdxStart; i <= patIdxEnd; i++ )\n {\n if( !patDirs.get( i ).equals( \"**\" ) )\n {\n return false;\n }\n }\n return true;\n }\n else\n {\n if( patIdxStart > patIdxEnd )\n {\n // String not exhausted, but pattern is. Failure.\n return false;\n }\n }\n\n // up to last '**'\n while( patIdxStart <= patIdxEnd && strIdxStart <= strIdxEnd )\n {\n String patDir = (String)patDirs.get( patIdxEnd );\n if( patDir.equals( \"**\" ) )\n {\n break;\n }\n if( !match( patDir, (String)strDirs.get( strIdxEnd ), isCaseSensitive ) )\n {\n return false;\n }\n patIdxEnd--;\n strIdxEnd--;\n }\n if( strIdxStart > strIdxEnd )\n {\n // String is exhausted\n for( int i = patIdxStart; i <= patIdxEnd; i++ )\n {\n if( !patDirs.get( i ).equals( \"**\" ) )\n {\n return false;\n }\n }\n return true;\n }\n\n while( patIdxStart != patIdxEnd && strIdxStart <= strIdxEnd )\n {\n int patIdxTmp = -1;\n for( int i = patIdxStart + 1; i <= patIdxEnd; i++ )\n {\n if( patDirs.get( i ).equals( \"**\" ) )\n {\n patIdxTmp = i;\n break;\n }\n }\n if( patIdxTmp == patIdxStart + 1 )\n {\n // '**/**' situation, so skip one\n patIdxStart++;\n continue;\n }\n // Find the pattern between padIdxStart & padIdxTmp in str between\n // strIdxStart & strIdxEnd\n int patLength = ( patIdxTmp - patIdxStart - 1 );\n int strLength = ( strIdxEnd - strIdxStart + 1 );\n int foundIdx = -1;\n strLoop :\n for( int i = 0; i <= strLength - patLength; i++ )\n {\n for( int j = 0; j < patLength; j++ )\n {\n String subPat = (String)patDirs.get( patIdxStart + j + 1 );\n String subStr = (String)strDirs.get( strIdxStart + i + j );\n if( !match( subPat, subStr, isCaseSensitive ) )\n {\n continue strLoop;\n }\n }\n\n foundIdx = strIdxStart + i;\n break;\n }\n\n if( foundIdx == -1 )\n {\n return false;\n }\n\n patIdxStart = patIdxTmp;\n strIdxStart = foundIdx + patLength;\n }\n\n for( int i = patIdxStart; i <= patIdxEnd; i++ )\n {\n if( !patDirs.get( i ).equals( \"**\" ) )\n {\n return false;\n }\n }\n\n return true;\n }", "public Pattern getValidStringPattern();", "private void addPersonName(StringBuffer sb, final String patName) {\n\t\tStringTokenizer stk = new StringTokenizer(patName, \"^\", true);\n\t\tfor (int i = 0; i < 6 && stk.hasMoreTokens(); ++i) {\n\t\t\tsb.append(stk.nextToken());\n\t\t}\n\t\tif (stk.hasMoreTokens()) {\n\t\t\tString prefix = stk.nextToken();\n\t\t\tif (stk.hasMoreTokens()) {\n\t\t\t\tstk.nextToken(); // skip delim\n\t\t\t\tif (stk.hasMoreTokens()) {\n\t\t\t\t\tsb.append(stk.nextToken()); // name suffix\n\t\t\t\t}\n\t\t\t}\n\t\t\tsb.append('^').append(prefix);\n\t\t}\n\t}", "public void addPattern(TokenPattern pattern) throws Exception {\n RE[] temp = regExps;\n RE re;\n\n re = new JavaRE(pattern.getPattern());\n regExps = new RE[temp.length + 1];\n System.arraycopy(temp, 0, regExps, 0, temp.length);\n regExps[temp.length] = re;\n pattern.setDebugInfo(\"native Java regexp\");\n super.addPattern(pattern);\n }", "List<Account> findAccountByAddressStartingWith(String pattern);", "private String removeContainsDot(String amount) {\n if (amount != null && !TextUtils.isEmpty(amount)) {\n if (amount.contains(\".\")) {\n String result = amount.substring(0, amount.indexOf(\".\"));\n return result;\n } else {\n return amount;\n }\n }\n return \"0\";\n }", "private static void parseToBuilder(DateTimeFormatterBuilder builder, String pattern) {\n int length = pattern.length();\n int[] indexRef = new int[1];\n\n for (int i=0; i<length; i++) {\n indexRef[0] = i;\n String token = parseToken(pattern, indexRef);\n i = indexRef[0];\n\n int tokenLen = token.length();\n if (tokenLen == 0) {\n break;\n }\n char c = token.charAt(0);\n\n if (c == '%' && token.charAt(1) != '%') {\n c = token.charAt(1);\n switch(c) {\n case 'a':\n builder.appendDayOfWeekShortText();\n break;\n case 'A':\n builder.appendDayOfWeekText();\n break;\n case 'b':\n case 'h':\n builder.appendMonthOfYearShortText();\n break;\n case 'B':\n builder.appendMonthOfYearText();\n break;\n case 'c':\n builder.appendDayOfWeekShortText();\n builder.appendLiteral(' ');\n builder.appendMonthOfYearShortText();\n builder.appendLiteral(' ');\n builder.appendDayOfMonth(2);\n builder.appendLiteral(' ');\n builder.appendHourOfDay(2);\n builder.appendLiteral(':');\n builder.appendMinuteOfHour(2);\n builder.appendLiteral(':');\n builder.appendSecondOfMinute(2);\n builder.appendLiteral(' ');\n builder.appendYear(4,4);\n break;\n case 'C':\n builder.appendCenturyOfEra(1,2);\n break;\n case 'd':\n builder.appendDayOfMonth(2);\n break;\n case 'D':\n builder.appendMonthOfYear(2);\n builder.appendLiteral('/');\n builder.appendDayOfMonth(2);\n builder.appendLiteral('/');\n builder.appendTwoDigitYear(2019);\n break;\n case 'e':\n builder.appendOptional(DateTimeFormat.forPattern(\"' '\").getParser());\n builder.appendDayOfMonth(2);\n break;\n case 'F':\n builder.appendYear(4,4);\n builder.appendLiteral('-');\n builder.appendMonthOfYear(2);\n builder.appendLiteral('-');\n builder.appendDayOfMonth(2);\n break;\n case 'g':\n case 'G':\n break; //for output only, accepted and ignored for input\n case 'H':\n builder.appendHourOfDay(2);\n break;\n case 'I':\n builder.appendClockhourOfHalfday(2);\n break;\n case 'j':\n builder.appendDayOfYear(3);\n break;\n case 'k':\n builder.appendOptional(DateTimeFormat.forPattern(\"' '\").getParser());\n builder.appendHourOfDay(2);\n break;\n case 'l':\n builder.appendOptional(DateTimeFormat.forPattern(\"' '\").getParser());\n builder.appendClockhourOfHalfday(2);\n break;\n case 'm':\n builder.appendMonthOfYear(2);\n break;\n case 'M':\n builder.appendMinuteOfHour(2);\n break;\n case 'n':\n break;\n case 'p':\n builder.appendHalfdayOfDayText();\n break;\n case 'r':\n builder.appendClockhourOfHalfday(2);\n builder.appendLiteral(':');\n builder.appendMinuteOfHour(2);\n builder.appendLiteral(':');\n builder.appendSecondOfMinute(2);\n builder.appendLiteral(' ');\n builder.appendHalfdayOfDayText();\n break;\n case 'R':\n builder.appendHourOfDay(2);\n builder.appendLiteral(':');\n builder.appendMinuteOfHour(2);\n break;\n case 'S':\n builder.appendSecondOfMinute(2);\n break;\n case 't':\n break;\n case 'T':\n builder.appendHourOfDay(2);\n builder.appendLiteral(':');\n builder.appendMinuteOfHour(2);\n builder.appendLiteral(':');\n builder.appendSecondOfMinute(2);\n break;\n/* case 'U': //FIXME Joda does not support US week start (Sun), this will be wrong\n builder.appendWeekOfYear(2);\n break;\n case 'u':\n builder.appendDayOfWeek(1);\n break;*/\n case 'V':\n break; //accepted and ignored\n/* case 'w': //FIXME Joda does not support US week start (Sun), this will be wrong\n builder.appendDayOfWeek(1);\n break;\n case 'W':\n builder.appendWeekOfYear(2);\n break;*/\n case 'x':\n builder.appendTwoDigitYear(2019);\n builder.appendLiteral('/');\n builder.appendMonthOfYear(2);\n builder.appendLiteral('/');\n builder.appendDayOfMonth(2);\n break;\n/* case 'X': //Results differ between OSX and Linux\n builder.appendHourOfDay(2);\n builder.appendLiteral(':');\n builder.appendMinuteOfHour(2);\n builder.appendLiteral(':');\n builder.appendSecondOfMinute(2);\n break;*/\n case 'y': //POSIX 2004 & 2008 says 69-99 -> 1900s, 00-68 -> 2000s\n builder.appendTwoDigitYear(2019);\n break;\n case 'Y':\n builder.appendYear(4,4);\n break;\n case 'z':\n builder.appendTimeZoneOffset(null, \"z\", false, 2, 2);\n break;\n case 'Z':\n break; //for output only, accepted and ignored for input\n default: // No match, ignore\n builder.appendLiteral('\\'');\n builder.appendLiteral(token);\n throw new IllegalArgumentException(token + \"is not acceptted as a parse token, treating as a literal\");\n }\n } else {\n if (c == '\\'') {\n String sub = token.substring(1);\n if (sub.length() > 0) {\n // Create copy of sub since otherwise the temporary quoted\n // string would still be referenced internally.\n builder.appendLiteral(new String(sub));\n }\n } else throw new IllegalArgumentException(\"Unexpected token encountered parsing format string:\" + c);\n }\n }\n }", "private static boolean isSuffix_r(String text, String pattern)\n {\n if (pattern.length() == 0)\n return true;\n else if (pattern.length() > text.length())\n return false;\n else if (pattern.charAt(pattern.length() - 1) != text.charAt(text.length() - 1))\n return false;\n else\n return isSuffix_r(text.substring(0, text.length() - 1), pattern.substring(0, pattern.length() - 1));\n }", "public String findAndSnip(final String pattern,\r\n\t\t\tfinal boolean trim, final boolean start) {\r\n\t\treturn findAndSnip(Pattern.compile(Argument.notNull(pattern, \"pattern\")), trim, start);\r\n\t}", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tString pattern = scan.nextLine();\r\n\t\tint count = 0;\r\n\t\tfor(int i=0 ; i < pattern.length(); i++){\r\n\t\t\tif(pattern.charAt(i) == '@'){\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(count==1){\r\n\t\t\tString[] str1 = pattern.split(\"@\");\r\n\t\t\tchar[] c1 = str1[0].toCharArray();\r\n\t\t\tchar[] c2 = str1[1].toCharArray();\r\n\t\t\tint right = 0;\r\n\t\t\tint left = 0;\r\n\t\t\tfor(int i=0;i<c1.length;i++){\r\n\t\t\t\tif(c1.equals('.') && (c1[i]>'a' && c1[i]<'e'))\r\n\t\t\t\t{\r\n\t\t\t\t\tleft++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor(int j=0;j<c1.length;j++){\r\n\t\t\t\tif(c2.equals('.') && (c2[j]>'a' && c2[j]<'e'))\r\n\t\t\t\t{\r\n\t\t\t\t\tright++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(left>1 && right>2){\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setUseDefaultSuffixPattern(boolean useDefaultSuffixPattern) {\r\n\t\tthis.useDefaultSuffixPattern = useDefaultSuffixPattern;\r\n\t}", "public static boolean pat() {\n\t\treturn false;\n\t}", "public static void main(String[] args) throws Exception {\n String patronA = \"[0-5]\";\n\n // conjunto de letras de \"a\" a \"c\"\n String patronB = \"[a-c]\";\n\n // conjunto de todas las letras minusculas\n String patronC = \"[a-z]\";\n\n // conjunto de numeros\n String patronD = \"[0-9]\";\n\n // ejemplo con tipo de dato string\n String textoAlfanumerico = \"0123aaaa\";\n System.out.println(\"Texto alfanumerico:\" + textoAlfanumerico);\n\n String replace1 = textoAlfanumerico.replaceAll(patronA, \"X\");\n System.out.println(\"Reemplazo de numeros con X: \" + replace1);\n\n String replace2 = textoAlfanumerico.replaceAll(patronB, \"X\");\n System.out.println(\"Reemplazo de letras con X: \" + replace2);\n\n\n //[0-5][a-c];\n //String patronComplejo = patronA + patronB;\n\n //[a-c]*[0-5]*\n //String patronComplejo = patronA + \"*\" + patronB + \"*\";\n\n //\"[a-z]+\"\n\n // + = una coincidencia\n // * = ninguna o muchas\n\n //String patronComplejo = \"(\" + patronA + patronC + \")+\";\n String patronComplejo = \"(\" + patronC + \")+\";\n\n String texto = \"hola, aacc este bbcc es mi 55222aaa texto 2663aaaa blah blah\";\n System.out.println(\"patron complejo:\" + patronComplejo);\n System.out.println(texto);\n\n Pattern pattern = Pattern.compile(patronComplejo);\n Matcher matcher = pattern.matcher(texto);\n\n // buscar ocurrencias\n while (matcher.find()) {\n System.out.println(\"Encontrado:\" + matcher.group());\n }\n\n\n }", "public static void printAllCombinations(String pattern)\n {\n // create an empty stack (we can also use set, queue, vector\n // or any other container)\n Stack<String> stack = new Stack();\n stack.push(pattern); // push the pattern into the stack\n \n int index;\n \n // do till stack is not empty\n while (!stack.empty())\n {\n // pop string from stack and process it\n String curr = stack.pop();\n \n // index stores position of first occurrence of wildcard\n // pattern in curr\n if ((index = curr.indexOf('?')) != -1)\n {\n // replace '?' with 0 and 1 and push it to the stack\n for (char ch = '0'; ch <= '1'; ch++)\n {\n curr = curr.substring(0, index) + ch + \n curr.substring(index + 1);\n stack.push(curr);\n }\n }\n \n // If no wildcard pattern is found, print the string\n else\n System.out.println(curr);\n }\n }" ]
[ "0.5914358", "0.52938", "0.5281211", "0.52144426", "0.5166466", "0.51592064", "0.51315033", "0.5123095", "0.5097771", "0.5090073", "0.5039961", "0.49998975", "0.49818164", "0.49716192", "0.49581355", "0.4957681", "0.49394077", "0.49049667", "0.48970428", "0.4896198", "0.4893551", "0.4888107", "0.48821348", "0.488077", "0.4879323", "0.48768306", "0.48550886", "0.48425075", "0.48344377", "0.48283798", "0.48177627", "0.48138645", "0.48100805", "0.48025742", "0.4800572", "0.4774454", "0.4773769", "0.47689676", "0.47571787", "0.47459936", "0.47427148", "0.47185338", "0.47078353", "0.4698409", "0.46965122", "0.4693856", "0.46749526", "0.46724445", "0.4668352", "0.46639946", "0.4645022", "0.46411553", "0.46360868", "0.46341404", "0.46250254", "0.46176168", "0.46164027", "0.46162215", "0.46043682", "0.46038696", "0.45795023", "0.4578692", "0.45706192", "0.45647648", "0.4561885", "0.45536822", "0.45510355", "0.45485207", "0.45447773", "0.45434362", "0.45423746", "0.45390153", "0.45367068", "0.4530546", "0.4515781", "0.4511", "0.45101103", "0.45094222", "0.45007694", "0.45002046", "0.44930986", "0.4490462", "0.4484016", "0.44818637", "0.44814938", "0.44803482", "0.4472001", "0.4459565", "0.4454555", "0.44434312", "0.44407213", "0.44351217", "0.44322404", "0.44111222", "0.44085386", "0.4405356", "0.4405334", "0.43989265", "0.4398517", "0.4396669", "0.43934184" ]
0.0
-1
/ checked out cust flush single rooms flush dob flush prm flush sut del cust
public static void main(String[] args) throws Exception, IOException { DateTimeFormatter f = DateTimeFormatter.ofPattern("dd/MM/yyyy"); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Map<String, Custo> c = null; Map<String, Custo> sin = null; Map<String, Custo> dobl = null; Map<String, Custo> pre = null; Map<String, Custo> sut = null; List<Custo> cust = null; int flag = 0; do { int ch = 0; System.out.println("<<<<<<<< Welcome in Hotel xyz mangement >>>>>>>>"); System.out.println("1. List Checked-out Customers"); System.out.println("2. Delete Customers"); System.out.println("3. Delete Customers from Single Room "); System.out.println("4. Delete Customers from Double Room "); System.out.println("5. Delete Customers from Premium Room "); System.out.println("6. Delete Customers from Suite "); System.out.println("Please Enter the serial no of your choice....."); int choice = Integer.parseInt(br.readLine()); switch (choice) { case 1: try(FileInputStream fiis = new FileInputStream("test\\out.dat")) { try(ObjectInputStream obc = new ObjectInputStream(fiis)){ cust = (List<Custo>)obc.readObject(); System.out.println(cust); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } break; case 2: try(FileInputStream fis = new FileInputStream("test\\custo.dat")) { try(ObjectInputStream ob = new ObjectInputStream(fis)){ c = (Map<String, Custo>)ob.readObject(); do { if(c.size() > 1) { System.out.println(c); System.out.println("\n" + "Enter the mobile no. of Customer to Delete :"); String mob = br.readLine(); if(c.containsKey(mob)) { //Single rom del try(FileInputStream ss = new FileInputStream("test\\single.dat")) { try(ObjectInputStream sss = new ObjectInputStream(ss)){ sin = (Map<String, Custo>)sss.readObject(); if(sin.containsKey(c.get(mob).getRoom_name())) { if(sin.size() > 1) { sin.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\single.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(sin); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } else { LocalDate in = LocalDate.parse("01/01/2020", f); LocalDate out = LocalDate.parse("02/01/2020", f); Custo ca = new Custo("12345", "default", "sameer123", in, out, 1, "test"); sin.put(ca.getRoom_name(), ca); sin.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\single.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(sin); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } //double room del try(FileInputStream ss = new FileInputStream("test\\double.dat")) { try(ObjectInputStream sss = new ObjectInputStream(ss)){ dobl = (Map<String, Custo>)sss.readObject(); if(dobl.containsKey(c.get(mob).getRoom_name())) { if(dobl.size() > 1) { dobl.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\double.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(dobl); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } else { LocalDate in = LocalDate.parse("01/01/2020", f); LocalDate out = LocalDate.parse("02/01/2020", f); Custo ca = new Custo("12345", "default", "sameer123", in, out, 1, "test"); dobl.put(ca.getRoom_name(), ca); dobl.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\double.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(dobl); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } //Premium room del try(FileInputStream ss = new FileInputStream("test\\premium.dat")) { try(ObjectInputStream sss = new ObjectInputStream(ss)){ pre = (Map<String, Custo>)sss.readObject(); if(pre.containsKey(c.get(mob).getRoom_name())) { if(pre.size() > 1) { pre.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\premium.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(pre); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } else { LocalDate in = LocalDate.parse("01/01/2020", f); LocalDate out = LocalDate.parse("02/01/2020", f); Custo ca = new Custo("12345", "default", "sameer123", in, out, 1, "test"); pre.put(ca.getRoom_name(), ca); pre.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\premium.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(pre); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } //Suite room del try(FileInputStream ss = new FileInputStream("test\\suite.dat")) { try(ObjectInputStream sss = new ObjectInputStream(ss)){ sut = (Map<String, Custo>)sss.readObject(); if(sut.containsKey(c.get(mob).getRoom_name())) { if(sut.size() > 1) { sut.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\suite.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(sut); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } else { LocalDate in = LocalDate.parse("01/01/2020", f); LocalDate out = LocalDate.parse("02/01/2020", f); Custo ca = new Custo("12345", "default", "sameer123", in, out, 1, "test"); sut.put(ca.getRoom_name(), ca); sut.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\suite.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(sut); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } c.remove(mob); try(FileOutputStream fos = new FileOutputStream("test\\custo.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(c); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println("/n"+"Customer Details removed Successfully ..."); System.out.println("press 0 to continue and 1 to exit deleting function.."); ch = Integer.parseInt(br.readLine()); } else {System.out.println("NO such Customer with Mobile no. : " + mob);} } else { System.out.println("No values to delete except default values"); break; } }while(ch != 1); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } break; case 3: try(FileInputStream ss = new FileInputStream("test\\single.dat")) { try(ObjectInputStream sss = new ObjectInputStream(ss)){ sin = (Map<String, Custo>)sss.readObject(); do { if(sin.size() > 1) { System.out.println(sin); System.out.println("\n" + "Enter the Room no. of Customer to Delete :"); String room = br.readLine(); if(sin.containsKey(room)) { try(FileInputStream fis = new FileInputStream("test\\custo.dat")) { try(ObjectInputStream ob = new ObjectInputStream(fis)){ c = (Map<String, Custo>)ob.readObject(); c.remove(sin.get(room).getCust_mob()); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } try(FileOutputStream fos = new FileOutputStream("test\\custo.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(c); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } sin.remove(room); try(FileOutputStream fos = new FileOutputStream("test\\single.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(sin); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println("\n"+"Customer Details removed Successfully ..."); System.out.println("press 0 to continue and 1 to exit deleting function.."); ch = Integer.parseInt(br.readLine()); } else {System.out.println("NO such Customer with Room no. : " );} } else { System.out.println("No Customers except default values"); break; } }while(ch != 1); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } break; case 4: try(FileInputStream ss1 = new FileInputStream("test\\double.dat")) { try(ObjectInputStream ss2 = new ObjectInputStream(ss1)){ dobl = (Map<String, Custo>)ss2.readObject(); do { if(dobl.size() > 1) { System.out.println(dobl); System.out.println("\n" + "Enter the Room no. of Customer to Delete :"); String room = br.readLine(); if(dobl.containsKey(room)) { try(FileInputStream fis = new FileInputStream("test\\custo.dat")) { try(ObjectInputStream ob = new ObjectInputStream(fis)){ c = (Map<String, Custo>)ob.readObject(); c.remove(dobl.get(room).getCust_mob()); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } try(FileOutputStream fos = new FileOutputStream("test\\custo.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(c); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } dobl.remove(room); try(FileOutputStream fos = new FileOutputStream("test\\double.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(dobl); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println("\n"+"Customer Details removed Successfully ..."); System.out.println("press 0 to continue and 1 to exit deleting function.."); ch = Integer.parseInt(br.readLine()); } else {System.out.println("NO such Customer with Room no. : " );} } else { System.out.println("No Customers except default values"); break; } }while(ch != 1); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } break; case 5: try(FileInputStream ss1 = new FileInputStream("test\\premium.dat")) { try(ObjectInputStream ss2 = new ObjectInputStream(ss1)){ pre = (Map<String, Custo>)ss2.readObject(); do { if(pre.size() > 1) { System.out.println(pre); System.out.println("\n" + "Enter the Room no. of Customer to Delete :"); String room = br.readLine(); if(pre.containsKey(room)) { try(FileInputStream fis = new FileInputStream("test\\custo.dat")) { try(ObjectInputStream ob = new ObjectInputStream(fis)){ c = (Map<String, Custo>)ob.readObject(); c.remove(pre.get(room).getCust_mob()); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } try(FileOutputStream fos = new FileOutputStream("test\\custo.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(c); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } pre.remove(room); try(FileOutputStream fos = new FileOutputStream("test\\premium.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(pre); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println("\n"+"Customer Details removed Successfully ..."); System.out.println("press 0 to continue and 1 to exit deleting function.."); ch = Integer.parseInt(br.readLine()); } else {System.out.println("NO such Customer with Room no. : " );} } else { System.out.println("No Customers except default values"); break; } }while(ch != 1); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } break; case 6: try(FileInputStream ss1 = new FileInputStream("test\\suite.dat")) { try(ObjectInputStream ss2 = new ObjectInputStream(ss1)){ sut = (Map<String, Custo>)ss2.readObject(); do { if(sut.size() > 1) { System.out.println(sut); System.out.println("\n" + "Enter the Room no. of Customer to Delete :"); String room = br.readLine(); if(sut.containsKey(room)) { try(FileInputStream fis = new FileInputStream("test\\custo.dat")) { try(ObjectInputStream ob = new ObjectInputStream(fis)){ c = (Map<String, Custo>)ob.readObject(); c.remove(sut.get(room).getCust_mob()); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } try(FileOutputStream fos = new FileOutputStream("test\\custo.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(c); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } sut.remove(room); try(FileOutputStream fos = new FileOutputStream("test\\suite.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(sut); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println("\n"+"Customer Details removed Successfully ..."); System.out.println("press 0 to continue and 1 to exit deleting function.."); ch = Integer.parseInt(br.readLine()); } else {System.out.println("NO such Customer with Room no. : " );} } else { System.out.println("No Customers except default values"); break; } }while(ch != 1); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } break; default: System.out.println("Please enter Proper option"); break; } System.out.println("Press 0 to continue || Press 1 to exit"); flag = Integer.parseInt(br.readLine()); }while(flag != 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void flush(){\r\n\t\tSystem.out.println(\"\\nCreating a customer by flush:\");\r\n\t\tEntityManager em = emf.createEntityManager();\r\n\t\tEntityTransaction tx = em.getTransaction();\r\n\t\tCustomer2 c1 = new Customer2(\"Selim\", \"Aslan\");\r\n\t\ttx.begin();\r\n\t\tem.persist(c1);\r\n\t\tlong id = c1.getCustId();\r\n\t\tSystem.out.println(\"Its id is : \" + id);\r\n\t\tem.flush();\r\n\t\tSystem.out.println(\"Flushed to the db.\");\r\n\t\tCustomer2 retrievedCustomer1 = em.find(Customer2.class, id);\r\n\t\tSystem.out.println(retrievedCustomer1);\r\n\t\t\r\n\t\t// Eger commit yerine rollback yapilirsa daha asagida retrievedCustomer2 null gelir.\r\n\t\ttx.commit();\r\n//\t\ttx.rollback();\r\n\t\t\r\n\t\tCustomer2 retrievedCustomer2 = em.find(Customer2.class, id);\r\n\t\tSystem.out.println(retrievedCustomer2);\r\n\t\tem.close();\r\n\t}", "@BeforeTransaction\n\tpublic void setupManyCustomers() {\n\t\tint results = template.update(\"delete from Customer\");\n\t\tlogger.debug(\"Before Transaction Deleted {} Customer(s)\", results);\n\t\tSession session = factory.openSession();\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tCustomer c = new Customer();\n\t\t\tc.setFirstName(\"Customer #\" + (i + 1));\n\t\t\tc.setLastName(\"Person\");\n\t\t\tsession.save(c);\n\t\t}\n\t\tsession.flush();\n\t\tsession.close();\n\t}", "private void endCustomer(MyCustomer customer){ \n\tDo(\"Table \" + customer.tableNum + \" is cleared!\");\n\thost.msgTableIsFree(customer.tableNum);\n\tcustomers.remove(customer);\n\tstateChanged();\n }", "@Test\r\n public void testdeleteCustomer() throws Exception {\r\n List<Server.Customer> lesClients = DAOCustomer.loadCustomer(Con());\r\n DAOCustomer.deleteCustomer(Con(),2);\r\n List<Server.Customer> r = DAOCustomer.loadCustomer(Con());\r\n assertEquals(lesClients.size()-1 , r.size());\r\n \r\n \r\n }", "@Test\n @Rollback(value = false)\n public void getAllFreeForRoomType() {\n List<Room> freeRooms = roomService.getAllFreeForRoomType(1L,\n Date.valueOf(\"1970-01-01\"), Date.valueOf(\"1970-01-02\"));\n assertEquals(\"Not All room free with room Type id=1L \", 10, freeRooms.size());\n\n // make new Order\n Order order = new Order();\n order.setStatus(OrderStatusType.APPROVED);\n\n Admin admin = adminService.get(1L);\n order.setAdmin(admin);\n\n User user = userService.get(1L);\n order.setUser(user);\n\n Room room = roomDao.getAnyForRoomType(1L);\n order.setRoom(room);\n\n order.setArrivalDate(Date.valueOf(\"1970-01-01\"));\n order.setEventsDate(Date.valueOf(\"1970-01-11\"));\n\n order.setBill(null);\n\n // save Order in Db,\n Order addOrder = orderService.add(order);\n\n // One room booked, aether rooms free with room Type id=1L\n freeRooms = roomService.getAllFreeForRoomType(1L,\n Date.valueOf(\"1970-01-01\"), Date.valueOf(\"1970-01-02\"));\n\n assertEquals(\"Not only one room booked with room Type id=1L (10-1=9) \",\n 9, freeRooms.size());\n\n // delete saved Order from DB; Bill will be deleted too by cascade\n orderService.delete(addOrder.getId());\n\n // check Correctness of removal\n Order getItOrder = orderService.get(addOrder.getId());\n\n assertNull(\"Order after deletion is NOT null\", getItOrder);\n }", "@Override\n\tpublic void syncCust(HttpSession custSession) {\n\t}", "@Test\n void deleteUserBatchesRemainSuccess() {\n GenericDao anotherDao = new GenericDao( Batch.class );\n /* user id 2 in the test database has two associated batches */\n User userWithBatch = (User) genericDao.getById(2);\n /* store the associated batches for this user */\n Set<Batch> batches = (Set<Batch>) userWithBatch.getBatches();\n logger.debug(\"The user's batches: \" + batches);\n\n /*\n * -disassociate the batches (this is the only way I can see to not delete the orphan records)\n * -delete the user\n * -confirm deletion\n */\n userWithBatch.setBatches(null);\n\n genericDao.delete(userWithBatch);\n\n assertNull(genericDao.getById(2));\n\n /*\n * try to retrieve the batches based on id\n * confirm they have not been removed from the database\n */\n for (Batch batch : batches) {\n logger.debug(\"test batch id: \" + batch.getId());\n Batch testBatch = (Batch) anotherDao.getById(batch.getId());\n logger.debug(\"Test batch retrieved from db: \" + testBatch);\n assertNotNull(testBatch);\n }\n }", "public void flushAndClose() throws TxnBatchFailure, TxnFailure, CommitFailure,\n IOException, InterruptedException {\n flush(false);\n close();\n }", "@Test\n void checkTheManagerGetAlertAfterOwnerChangeTheBid() {\n String guest= tradingSystem.ConnectSystem().returnConnID();\n tradingSystem.Register(guest, \"Manager2\", \"123\");\n Response res= tradingSystem.Login(guest, \"Manager2\", \"123\");\n tradingSystem.AddNewManager(EuserId,EconnID,storeID,res.returnUserID());\n tradingSystem.subscriberBidding(NofetID,NconnID,storeID,4,20,2);\n store.changeSubmissionBid(EuserId,NofetID,4,30,1);\n }", "@Test\n public void updateBusy() {\n ArrayList<Busy> b = new ArrayList<Busy>();\n b.add(new Busy(\"dummy\", 1, new Date(1970-05-07)));\n b.add(new Busy(\"dummy\", 1, new Date(1974-05-07)));\n\n userDAO.createUser(new User(\"dummy\", \"dummy\", 1));\n busyDAO.createBusy(new Busy(\"dummy\", 1, new Date(1970-05-07)));\n\n assertTrue(busyResource.updateBusy(b));\n\n //clean up\n busyDAO.removeBusy(new Date(1974-05-07), 1, \"dummy\");\n userDAO.removeUser(\"dummy\");\n }", "@Override\r\n\tpublic void flushAll() {\n\t\t\r\n\t}", "@Test\r\n public void testupdateCustomer() throws Exception {\r\n System.out.println(\"updateCustomer\");\r\n List<Server.Customer> lesClients = DAOCustomer.loadCustomer(Con());\r\n Server.Customer m = lesClients.get(2);\r\n DAOCustomer.updateCustomer(Con(),1, \"Costa\", \"Rui\",\"15 rue Paul\",\"77290\",\"Paris\",\"[email protected]\",\"M\");\r\n List<Server.Customer> results = DAOCustomer.loadCustomer(Con());\r\n Server.Customer r = results.get(2);\r\n assertFalse(m.getPrenom() == r.getPrenom());\r\n \r\n }", "@Override\n\t\tpublic CompletableFuture<Void> flush() {\n\n\t\t\tsynchronized(roleSwitcherThread) {\n\t\t\t\tif (!RockyController.role.equals(RockyControllerRoleType.Owner)) {\n\t\t\t\t\tSystem.err.println(\"ASSERT: flush can be served only by the Owner\");\n\t\t\t\t\tSystem.err.println(\"currently, my role=\" + RockyController.role);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn super.flush();\n\t\t}", "public void flush()\n{\n\t// no such operation required for mock persistence provider\n}", "public void ventaBilleteMaquina1()\n {\n maquina1.insertMoney(500);\n maquina1.printTicket();\n }", "@Override\n\tpublic void checkOutRoom() {\n\t\t\n\t}", "public void flushData (){\n\t\tTransaction tx = this.pm.currentTransaction();\n\t\ttry {\n\t\t\tif (this.pm.currentTransaction().isActive ()){\n\t\t\t\tthis.pm.currentTransaction().commit();\n\t\t\t}\n\t\t} catch (Exception e){\n\t\t\tApplication.getLogger ().error (\"Error flushing data for persistence. \", e);\n\t\t\te.printStackTrace();\n\t\t\ttx.rollback();\n\t\t}\n//\t\ttx.begin();\n\t}", "@Scheduled(fixedDelay = 60000)\n @Transactional\n public void run() {\n try {\n List<ClientLoanDetails> oldDetails = clientLoanDetailsDao.findOldEntity();\n oldDetails.forEach(clientLoanDetailsDao::delete);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "boolean flush_all();", "@Query(\"DELETE FROM unit WHERE sync_delete = 0\")\n public void hapusUnitSudahSync();", "public void DeleteCust(String id);", "private void flushOutbound0() {\n/* 454 */ runPendingTasks();\n/* */ \n/* 456 */ flush();\n/* */ }", "@Override\r\n\tpublic void flush() {\n\t\t\r\n\t}", "protected abstract void commitIndividualTrx();", "public void testCommitOrRollback() throws Exception {\n Properties props = new Properties();\n props.setProperty(LockssRepositoryImpl.PARAM_CACHE_LOCATION, tempDirPath);\n props\n\t.setProperty(ConfigManager.PARAM_PLATFORM_DISK_SPACE_LIST, tempDirPath);\n ConfigurationUtil.setCurrentConfigFromProps(props);\n\n startService();\n Connection conn = sqlDbManager.getConnection();\n Logger logger = Logger.getLogger(\"testCommitOrRollback\");\n SqlDbManager.commitOrRollback(conn, logger);\n SqlDbManager.safeCloseConnection(conn);\n\n conn = null;\n try {\n SqlDbManager.commitOrRollback(conn, logger);\n } catch (NullPointerException sqle) {\n }\n }", "public void ventaBilleteMaquina2()\n {\n maquina2.insertMoney(600);\n maquina1.printTicket();\n }", "public void flushUserList()\n {\n users = null;\n }", "@Test\n public void removeBusy() {\n Date date = new Date(2017-11-12);\n\n userDAO.createUser(new User(\"dummy\", \"dummy\", 1));\n busyDAO.createBusy(new Busy(\"dummy\", 1, date));\n\n assertTrue(busyResource.removeBusy(date, 1,\"dummy\"));\n\n //clean up\n userDAO.removeUser(\"dummy\");\n }", "@Test\n public void testCustomerToDatabase() throws Exception {\n \twhen(customerService.saveOrUpdate(TEST_CUSTOMER_50)).thenReturn(TEST_CUSTOMER_50);\n \t\n MockEndpoint mock = getMockEndpoint(MOCK_RESULT);\n \n mock.expectedMessageCount(1);\n mock.expectedBodiesReceived(TEST_CUSTOMER_50);\n\n template.sendBody(DIRECT_ADD_CUSTOMER, TEST_CUSTOMER_50);\n \n // assert expectations\n assertMockEndpointsSatisfied();\n \n verify(customerService, times(1)).saveOrUpdate(TEST_CUSTOMER_50);\n }", "public void done(Customer c){\n String output_done = String.format(\"%.3f\", c.getLeavingTime())+\" \"+c.getID()+\" done\";\n System.out.println(output_done);\n\n scheduler.arrivals.removeFirst();\n cc = null;\n\n //System.out.println(\"the first customer now should be nc, and will become cc \"+nc.getID()==scheduler.arrivals.get(0).getID());\n //System.out.println(scheduler.arrivals.size());//sth wrong here\n\n //run();\n\n }", "@Before\n public void clearUnitsOfWork() {\n while (CurrentUnitOfWork.isStarted()) {\n CurrentUnitOfWork.get().rollback();\n }\n }", "@Override\n\tpublic Item delete() {\n\t\treadAll();\n\t\tLOGGER.info(\"\\n\");\n\t\t//user can select either to delete a customer from system with either their id or name\n\t\tLOGGER.info(\"Do you want to delete record by Item ID\");\n\t\tlong id = util.getLong();\n\t\titemDAO.deleteById(id);\n\t\t\t\t\n\t\t\t\t\n\t\treturn null;\n\t}", "@Override\n\tpublic void flush() {\n\t}", "@Override\n\tpublic void delete() {\n\t\tSystem.out.println(\"Mobile Customer delete()\");\n\t}", "@Override\r\n\tpublic void flush() {\n\t}", "@Override\n\tpublic void flush() {\n\t\t\n\t}", "@Override\n\tpublic void flush() {\n\t\t\n\t}", "@Override\n\tpublic void flush() {\n\t\t\n\t}", "@Override\n\tpublic void flush() {\n\t\t\n\t}", "@Override\n\tpublic void flush(Map<TopicPartition, OffsetAndMetadata> offsets) throws ConnectException {\n\n\t\tSystem.out.print(\"Flush start at \"+System.currentTimeMillis());\n\t\tif (fuelList != null) {\n\t\t\tSystem.out.print(fuelList.size());\n\t\t\tfor(int fuelListIndex=0; fuelListIndex < fuelList.size(); fuelListIndex++){\n\t\t\t\ttry {\n\t\t\t\t\tnewConnection.insertFuelDB(fuelList.get(fuelListIndex));\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\t// Clear the Arraylist and the updateDeviceTimeObject\n\t\t\tfuelList.clear() ;\n\t\t\tSystem.out.print(\"Flush stop at \" + System.currentTimeMillis());\n\t\t} \n\t }", "@Test\r\n public void customerService() {\r\n Customer customer;\r\n customerCrudService = (CustomerCrudService)ctx.getBean(\"customerCrudService\");\r\n \r\n Contact contact = ContactFactory.getContact(\"[email protected]\", \"0785566321\", \"0218897190\");\r\n Demography demo = DemographyFactory.getDemography(\"Female\", \"Black\", new Date(10/6/1986));\r\n \r\n BigDecimal sellingPrice = new BigDecimal(\"8.00\");\r\n BigDecimal broughtPrice = new BigDecimal(\"6.00\");\r\n BigDecimal profit = new BigDecimal(\"2.00\");\r\n ArrayList prices = new ArrayList<BigDecimal>();\r\n prices.add(sellingPrice);\r\n prices.add(broughtPrice);\r\n prices.add(profit);\r\n Item item = ItemFactory.getItem(\"PS\", prices);\r\n \r\n List items = new ArrayList<Item>();\r\n items.add(items);\r\n \r\n customer = new CustomerFactory\r\n .Builder(125)\r\n .CustomerName(\"Mphokazi\")\r\n .CustomerSurname(\"Mhlontlo\")\r\n .Contact(contact)\r\n .Demography(demo)\r\n .OrderItem(items)\r\n .build();\r\n \r\n customerCrudService.persist(customer);\r\n customerService = (CustomerServices)ctx.getBean(\"customerService\");\r\n List<OrderItem> orderItems = customerService.customerOrder(customer.getId());\r\n Assert.assertNotNull(orderItems);\r\n for (OrderItem orderItem : orderItems) {\r\n System.out.println(orderItem.getItem());\r\n \r\n \r\n } \r\n }", "@Override\n public void flush()\n {\n }", "void unlockWriteInOMRequest();", "public synchronized void commit(int trxnId)\n {\n ResourceManager rm;\n for (Enumeration e = transactionTouch.keys(); e.hasMoreElements();) {\n rm = (ResourceManager)e.nextElement();\n try {\n rm.commit(trxnId);\n } catch (Exception x)\n {\n System.out.println(\"EXCEPTION:\");\n System.out.println(x.getMessage());\n x.printStackTrace();\n }\n }\n transactionTouch.remove(trxnId);\n lm.UnlockAll(trxnId);\n }", "public String customer_request_booking(Customer_Booking cb){\n\t\tIdUser user= new IdUser();\n\t\tTransaction trns1 = null;\n Session session = HibernateUtil.getSessionFactory().openSession(); \n Booking_Request_Master book = new Booking_Request_Master();\n\t\ttry {\n trns1 = session.beginTransaction();\n Pickup_Location_Master pick_source=new Pickup_Location_Master();\n \tpick_source = (Pickup_Location_Master) session.createQuery(\"from Pickup_Location_Master where id=?\").setParameter(0, cb.getSource()).list().get(0);\n \tPickup_Location_Master pick_destin=new Pickup_Location_Master();\n \tpick_destin = (Pickup_Location_Master) session.createQuery(\"from Pickup_Location_Master where id=?\").setParameter(0, cb.getDestination()).list().get(0);\n \n \t\n book.setCreated_at(current_timestamp);\n book.setUpdated_at(current_timestamp);\n book.setProvided_time(cb.getTime()+\":00\");\n book.setSource_id(cb.getSource());\n book.setFrom_id(pick_source.getLocation_id());\n book.setDestination_id(cb.getDestination());\n book.setTo_id(pick_destin.getLocation_id());\n book.setDept_date(java.sql.Date.valueOf(cb.getDate()));\n book.setDept_time(java.sql.Time.valueOf(cb.getTime()+\":00\"));\n book.setNumber_of_booking(cb.getNumber_of_seat());\n book.setUser_id(user.getAuthentic());\n book.setEnabled(true);\n book.setStatus(\"Pending\");\n session.save(book);\n trns1.commit();\n } catch (RuntimeException e) {\n \te.printStackTrace();\n } \n\t\tfinally {\n session.flush();\n session.close();\n }\n\t\treturn \"success\";\n\t}", "@Test\n\tpublic void deleteAllItemsFromAccountTest() {\n\t\tInteger associatedAccountId_1 = 1;\n\t\tString type_1 = \"deposit\";\n\t\tString date_1 = \"2018-04-03\";\n\t\tInteger amount_1 = 100;\n\t\tString description_1 = \"This is test transaction number one\";\n\t\tTransaction testDeleteTransaction_1 = new Transaction();\n\t\ttestDeleteTransaction_1.setAssociatedAccountId(associatedAccountId_1);\n\t\ttestDeleteTransaction_1.setType(type_1);\n\t\ttestDeleteTransaction_1.setDate(date_1);\n\t\ttestDeleteTransaction_1.setAmount(amount_1);\n\t\ttestDeleteTransaction_1.setDescription(description_1);\n\t\ttransacRepoTest.saveItem(testDeleteTransaction_1);\n\t\t\n\t\tInteger associatedAccountId_2 = 1;\n\t\tString type_2 = \"deposit\";\n\t\tString date_2 = \"2018-04-05\";\n\t\tInteger amount_2 = 560;\n\t\tString description_2 = \"This is test transaction number two\";\n\t\tTransaction testDeleteTransaction_2 = new Transaction();\n\t\ttestDeleteTransaction_2.setAssociatedAccountId(associatedAccountId_2);\n\t\ttestDeleteTransaction_2.setType(type_2);\n\t\ttestDeleteTransaction_2.setDate(date_2);\n\t\ttestDeleteTransaction_2.setAmount(amount_2);\n\t\ttestDeleteTransaction_2.setDescription(description_2);\n\t\ttransacRepoTest.saveItem(testDeleteTransaction_2);\n\t\t\n\t\t//should now be 2 transactions in the repo\t\t\n\t\tArrayList<Transaction> transList = transacRepoTest.getItemsFromAccount(associatedAccountId_2);\n\t\tassertEquals(transList.size(), 2);\n\t\t\t\n\t\ttransacRepoTest.deleteAllItemsFromAccount(associatedAccountId_2);\n\n\n\t\t//should now be 0 transactions in the repo\n\t\ttransList = transacRepoTest.getItemsFromAccount(associatedAccountId_2);\n\t\tassertEquals(transList.size(), 0);\n\t\t\n\t}", "@Override\n public void beginDatabaseBatchWrite() throws BlockStoreException {\n if (!autoCommit) {\n return;\n }\n if (instrument)\n beginMethod(\"beginDatabaseBatchWrite\");\n\n batch = db.createWriteBatch();\n uncommited = new HashMap<ByteBuffer, byte[]>();\n uncommitedDeletes = new HashSet<ByteBuffer>();\n utxoUncommittedCache = new HashMap<ByteBuffer, UTXO>();\n utxoUncommittedDeletedCache = new HashSet<ByteBuffer>();\n autoCommit = false;\n if (instrument)\n endMethod(\"beginDatabaseBatchWrite\");\n }", "public void flush() {\n\t\t\n\t}", "@Transactional\n public void initRolesAdmin() {\n Role roleUser = new Role(\"ROLE_USER\");\n Role roleAdmin = new Role(\"ROLE_ADMIN\");\n roleRepo.save(roleUser);\n roleRepo.save(roleAdmin);\n log.debug(\"Create two role in db ({} , {})\",roleUser,roleAdmin);\n\n HashSet<TelephoneService> mainService = new HashSet<>();\n //init basic service\n TelephoneService telephoneService = new TelephoneService(\"Basic call service\", \"input and out put dialing\", new BigDecimal(3.55));\n mainService.add(telephoneService);\n telephoneServiceService.save(telephoneService);\n telephoneService = new TelephoneService(\"CLIP\", \"incoming call number identifier\", new BigDecimal(0.55));\n telephoneServiceService.save(telephoneService);\n telephoneService = new TelephoneService(\"unCLIP\", \"block call number identifier\", new BigDecimal(0.55));\n telephoneServiceService.save(telephoneService);\n telephoneService = new TelephoneService(\"Answer machine\", \"add auto answer machine\", new BigDecimal(1.55));\n telephoneServiceService.save(telephoneService);\n telephoneService = new TelephoneService(\"Redirect\", \"redirect incomin call to number\", new BigDecimal(0.15));\n telephoneServiceService.save(telephoneService);\n telephoneService = new TelephoneService(\"Do not disturb\", \"all incoming call get busy signal\", new BigDecimal(0.15));\n telephoneServiceService.save(telephoneService);\n log.debug(\"Create new 6 services in db\");\n\n //init admin with login admin@admin and password admin in DB\n Set<Role> rSet = new HashSet<>();\n rSet.add(roleAdmin);\n Client client = new Client(\"admin\", \"admin\", \"[email protected]\",\n \"admin\",\n false, null, rSet, null);\n clientService.save(client);\n log.debug(\"Admin created\");\n\n //create user\n client = new Client(\"Alex\", \"Pleskachev\", \"[email protected]\",\n \"12345\", false, null, null, null);\n clientService.save(client);\n log.debug(\"Client Alex created\");\n\n\n //client test pool with active status and first amount = 5.0\n\n for(int i=1;i<5;i++){\n client = new Client(\"Client\"+i, \"SecondClientName\", \"client\"+i+\"@client.com\",\n \"12345\", true, new Account(new BigDecimal(5.0)), null, mainService);\n clientService.save(client);\n log.debug(\"Create test client {}\",client);\n }\n\n }", "@Override\r\n public void flush ()\r\n {\r\n }", "public static void reset() {\n Castle.userId(null);\n Castle.flush();\n }", "public void purge() {\n/*\nudanax-top.st:16722:FakePacker methodsFor: 'transactions'!\n{void} purge\n\t\"Flush everything out to disk and remove all purgeable imaged\n\t objects from memory. This doesn't clear the ShepherdMap table. \n\t This will have to be a weak table, and then the destruction of a \n\t shepherd or shepherdStub should remove it from myShepherdMap.\"!\n*/\n}", "public boolean flushTransactions() {\n return true;\n }", "@Test\n public void testAfterOffer() {\n pool.beforeOffer(controller1, CommInfrastructure.UEB, TOPIC1, EVENT1);\n\n // this should clear them\n assertFalse(pool.afterOffer(controller1, CommInfrastructure.UEB, TOPIC2, EVENT2, true));\n\n assertFalse(pool.beforeInsert(drools1, OBJECT1));\n verify(mgr1, never()).beforeInsert(any(), any());\n\n\n assertFalse(pool.beforeInsert(droolsDisabled, OBJECT1));\n }", "@Test\n public void testScopeMappingRoleRemoval() {\n inComittedTransaction(1, (session , i) -> {\n final RealmModel realm = session.realms().getRealm(realmId);\n ClientModel client1 = session.clients().addClient(realm, \"client1\");\n ClientModel client2 = session.clients().addClient(realm, \"client2\");\n RoleModel realmRole = session.roles().addRealmRole(realm, \"realm-role\");\n RoleModel client2Role = session.roles().addClientRole(client2, \"client2-role\");\n client1.addScopeMapping(realmRole);\n client1.addScopeMapping(client2Role);\n return null;\n });\n\n // check everything is OK\n inComittedTransaction(1, (session, i) -> {\n final RealmModel realm = session.realms().getRealm(realmId);\n final ClientModel client1 = session.clients().getClientByClientId(realm, \"client1\");\n assertThat(client1.getScopeMappingsStream().count(), is(2L));\n assertThat(client1.getScopeMappingsStream().filter(r -> r.getName().equals(\"realm-role\")).count(), is(1L));\n assertThat(client1.getScopeMappingsStream().filter(r -> r.getName().equals(\"client2-role\")).count(), is(1L));\n return null;\n });\n\n // remove the realm role\n inComittedTransaction(1, (session, i) -> {\n final RealmModel realm = session.realms().getRealm(realmId);\n final RoleModel role = session.roles().getRealmRole(realm, \"realm-role\");\n session.roles().removeRole(role);\n return null;\n });\n\n // check it is removed\n inComittedTransaction(1, (session, i) -> {\n final RealmModel realm = session.realms().getRealm(realmId);\n final ClientModel client1 = session.clients().getClientByClientId(realm, \"client1\");\n assertThat(client1.getScopeMappingsStream().count(), is(1L));\n assertThat(client1.getScopeMappingsStream().filter(r -> r.getName().equals(\"client2-role\")).count(), is(1L));\n return null;\n });\n\n // remove client role\n inComittedTransaction(1, (session, i) -> {\n final RealmModel realm = session.realms().getRealm(realmId);\n final ClientModel client2 = session.clients().getClientByClientId(realm, \"client2\");\n final RoleModel role = session.roles().getClientRole(client2, \"client2-role\");\n session.roles().removeRole(role);\n return null;\n });\n\n // check both clients are removed\n inComittedTransaction(1, (session, i) -> {\n final RealmModel realm = session.realms().getRealm(realmId);\n final ClientModel client1 = session.clients().getClientByClientId(realm, \"client1\");\n assertThat(client1.getScopeMappingsStream().count(), is(0L));\n return null;\n });\n\n // remove clients\n inComittedTransaction(1, (session , i) -> {\n final RealmModel realm = session.realms().getRealm(realmId);\n final ClientModel client1 = session.clients().getClientByClientId(realm, \"client1\");\n final ClientModel client2 = session.clients().getClientByClientId(realm, \"client2\");\n session.clients().removeClient(realm, client1.getId());\n session.clients().removeClient(realm, client2.getId());\n return null;\n });\n }", "@Test\n public void deleteInvoice() {\n Customer customer = new Customer();\n customer.setFirstName(\"Dominick\");\n customer.setLastName(\"DeChristofaro\");\n customer.setEmail(\"[email protected]\");\n customer.setCompany(\"Omni\");\n customer.setPhone(\"999-999-9999\");\n customer = service.saveCustomer(customer);\n\n // Verify it was added to the database\n Customer customerCopy = service.findCustomer(customer.getCustomerId());\n TestCase.assertEquals(customerCopy, customer);\n\n // Add an Item to the database\n Item item = new Item();\n item.setName(\"Drill\");\n item.setDescription(\"Power Tool\");\n item.setDaily_rate(new BigDecimal(\"24.99\"));\n item = service.saveItem(item);\n\n // Verify it was added\n Item itemCopy = service.findItem(item.getItem_id());\n TestCase.assertEquals(itemCopy, item);\n\n // Add an InvoiceItem to the database\n Invoice_Item invoiceItem = new Invoice_Item();\n invoiceItem.setItem_id(item.getItem_id());\n invoiceItem.setQuantity(42);\n invoiceItem.setUnit_rate(new BigDecimal(\"4.99\"));\n invoiceItem.setDiscount(new BigDecimal(\"0.99\"));\n\n // Collect all the InvoiceItems into a list\n List<Invoice_Item> invoiceItemList = new ArrayList<>();\n invoiceItemList.add(invoiceItem);\n\n // Create an InvoiceViewModel\n InvoiceViewModel invoiceViewModel = new InvoiceViewModel();\n invoiceViewModel.setCustomer_id(customer.getCustomerId());\n invoiceViewModel.setOrder_date(LocalDate.of(2000,1,1));\n invoiceViewModel.setPickup_date(LocalDate.of(2000,2,2));\n invoiceViewModel.setReturn_date(LocalDate.of(2000,3,3));\n invoiceViewModel.setLate_fee(new BigDecimal(\"4.99\"));\n invoiceViewModel.setInvoice_items(invoiceItemList);\n invoiceViewModel = service.createInvoiceViewModel(invoiceViewModel);\n\n // Delete Invoice\n service.deleteInvoiceViewModel(invoiceViewModel.getInvoice_id());\n }", "@Override\n\tpublic void flushCars() {\n\t\tinList.flush();\n\t}", "void endTransaction();", "public static void main(String[] args) {\n\r\n\t\tCustomer c = new Customer();\r\n\t\tc.setName(\"Mubeen\");\r\n\t\r\n\t\tPassport p = new Passport();\r\n\t\tc.setPassport(p);\r\n\t\t\r\n\t\t\r\n\t\ttry(Session session = HibernateUtil.getSessionFactory().openSession()){\r\n//\t\t\tsession.getTransaction().begin();\r\n//\t\t\tMessage m1 = (Message)session.get(Message.class, 4L);\r\n//\t\t\tm1.setText(\"MUBBBBB11\");\r\n//\t\t\tMessage m2 = new Message();\r\n//\t\t\tm2.setId(m1.getId());\r\n//\t\t\tm2.setText(m1.getText());\r\n//\t\t\tsession.update(m1);\r\n////\t\t\tm1.setText(\"MUBBBBB12\");\r\n//\t\t\tsession.update(m2);\r\n//\t\t\tsession.getTransaction().commit();\r\n//\t\t\tSystem.out.println(m1.getText());\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tsession.getTransaction().begin();\r\n//\t\t\tsession.persist(s);\r\n//\t\t\tsession.persist(s1);\r\n\t\t\tCustomer c1=session.get(Customer.class, 9l);\r\n\t\t\tsession.remove(c1);\r\n\t\t\tsession.getTransaction().commit();\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\r\n\t}", "public static void main(String[] args) {\n try {\n Model m = new Model();\n //Customer c = new Customer(\"Pam Satan III\", \"[email protected]\", \"Norwich\", \"V\", \"02/12\", \"2136871466\");\n //c = m.CUSTOMERS.getCustomer(c.getName(), c.getEmail());\n /*Customer pam = m.CUSTOMERS.createCustomer(c);\n System.out.println(pam);\n List<Room> list = new ArrayList<>();\n list.add(request);\n //have pam make bookings for this date until she has used up all the available rooms, should exception\n //out\n for(int i = 0; i < 100; i++) {\n m.BOOKINGS.makeBooking(c, list, LocalDate.parse(\"2017-12-24\"), LocalDate.parse(\"2017-12-28\"));\n }\n //Booking booktest = m.BOOKINGS.getBooking(15976);\n int foo = 1;*/\n //c.setName(\"Jordan Jorgens\");\n //m.CUSTOMERS.updateCustomer(c);\n //Customer check = m.CUSTOMERS.getCustomer(12955);\n //System.out.println(check);\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n Room r = (Room)null;\n }", "@Override\n public void flush() {\n }", "@Override\n public void flush() {\n }", "@Override\n public void flush() {\n }", "@Test\n @Prepare(autoImport = true, autoClearExistsData = true)\n public void testdeleteById() throws Exception {\n\n int[] ids = { 111123456, 111123457, 111123458, 111123459 };\n for (int id : ids) {\n inventoryOutDao.deleteById(id);\n }\n for (int id : ids) {\n assertNull(inventoryOutDao.getById(id));\n }\n\n // List<InventoryOutDO> list = inventoryOutDao.list(new\n // InventoryOutDO());\n // assertResultListSorted(list, \"id\");\n }", "@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}", "void flushBatch();", "@Before\n @After\n public void deleteTestTransactions() {\n if (sessionId == null) {\n getTestSession();\n }\n\n // No test transaction has been made yet, thus no need to delete anything.\n if (testTransactionId != null) {\n given()\n .header(\"X-session-ID\", sessionId)\n .delete(String.format(\"api/v1/transactions/%d\", testTransactionId));\n }\n\n if (clutterTransactionId != null) {\n given()\n .header(\"X-session-ID\", sessionId)\n .delete(String.format(\"api/v1/transactions/%d\", clutterTransactionId));\n }\n }", "public int DelCompany(Long cid, String compname, Long shareamt, Long getnoShare) throws SQLException {\n\tint i=DbConnect.getStatement().executeUpdate(\"delete from company where comp_id=\"+cid+\"\");\r\n\treturn i;\r\n}", "synchronized void flushAll(int txnum) {\n\t \n for (ExerciseBuffer buff : bufferpool)\n if (buff.isModifiedBy(txnum))\n buff.flush();\n }", "public void checkOut() {\n\t}", "void flushDB();", "@BeforeEach\n public void setUp() {\n EntityManager em = emf.createEntityManager();\n c1 = new Contact(\"Pelle\", \"[email protected]\", \"BornIT\", \"Manager\", \"12345678\");\n c2 = new Contact(\"Mari\", \"[email protected]\", \"SuperBrugsen\", \"Sales Manager\", \"87654321\");\n c3 = new Contact(\"Benjamin\", \"[email protected]\", \"Expert\", \"Manager\", \"22222222\");\n\n o1 = new Opportunity(\"Sælg dem sko\", 5000, \"2021-03-04\");\n o2 = new Opportunity(\"Sælg dem Legetøj\", 10000, \"2021-03-22\");\n\n\n s1 = new OpportunityStatus(\"Active\");\n s2 = new OpportunityStatus(\"Inactive\");\n s3 = new OpportunityStatus(\"Won\");\n s4 = new OpportunityStatus(\"Lost\");\n\n c1.addOpportunity(o1);\n c1.addOpportunity(o2);\n\n s1.AddOpportunity(o1);\n s1.AddOpportunity(o2);\n\n\n\n try {\n em.getTransaction().begin();\n em.createNamedQuery(\"Opportunity.deleteAllRows\").executeUpdate();\n em.createNamedQuery(\"OpportunityStatus.deleteAllRows\").executeUpdate();\n em.createNamedQuery(\"Contact.deleteAllRows\").executeUpdate();\n em.persist(c1);\n em.persist(c2);\n em.persist(o1);\n em.persist(o2);\n em.persist(s1);\n em.persist(s2);\n em.persist(s3);\n em.persist(s4);\n em.getTransaction().commit();\n\n } finally {\n em.close();\n }\n }", "void deleteCustomerOrderBroadbandASIDById(int id);", "@Test\n public void processTransactionManagerCaseC()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n acc3 = new Account(3,\"Jacob&Leon3\",2000);\n acc_db.addAccount(acc3);\n\n\n trans_mang.processTransaction(acc.get_Account_Number(), acc2.get_Account_Number(), 30);\n\n Assert.assertEquals(false,trans_mang.processTransaction(acc3.get_Account_Number(),acc2.get_Account_Number(),30));\n }", "@Override\n public void shutdown() {\n\n // Since we have nothing to do, override base shutdown so don't\n // get extraneous UserTransactions.\n }", "public void msgDoneEatingAndLeaving(CustomerAgent customer){\n\tfor(MyCustomer c:customers){\n\t if(c.cmr.equals(customer)){\n\t\tc.state = CustomerState.IS_DONE;\n\t\tc.food.remove();\n\t\tstateChanged();\n\t\treturn;\n\t }\n\t}\n }", "public void testWriteOrders() throws Exception {\n }", "@Test\n public void cleanWithRecycleBin() throws Exception {\n assertEquals(0, recycleBinCount());\n\n // in SYSTEM tablespace the recycle bin is deactivated\n jdbcTemplate.update(\"CREATE TABLE test_user (name VARCHAR(25) NOT NULL, PRIMARY KEY(name)) tablespace USERS\");\n jdbcTemplate.update(\"DROP TABLE test_user\");\n assertTrue(recycleBinCount() > 0);\n\n flyway.clean();\n assertEquals(0, recycleBinCount());\n }", "void createAndManageCustomer() {\r\n\t\tSystem.out.println(\"\\nCreating and managing a customer:\");\r\n\r\n\t\tEntityManager em = emf.createEntityManager();\r\n\t\tEntityTransaction tx = em.getTransaction();\r\n\t\tCustomer2 c = new Customer2(\"Sami\", \"Cemil\");\r\n\t\ttx.begin();\r\n\t\tem.persist(c);\r\n\t\ttx.commit();\r\n\t\tSystem.out.println(c);\r\n\t\t\r\n\t\ttx = em.getTransaction();\r\n\t\ttx.begin();\r\n\t\tc.setLastName(\"Kamil\");\r\n\t\ttx.commit();\r\n\t\tSystem.out.println(c);\r\n\t\tem.close();\r\n\t}", "public void clearAll() {\n if (orderId != null) {\n BouquetOrder order = orderDAO.get(orderId);\n order.getBouquets().clear();\n orderDAO.update(order);\n sendMessage(orderId);\n }\n }", "@Test\n\tpublic void deleteCustomer() {\n\n\t\t// Given\n\t\tString name = \"Leo\";\n\t\tString address = \"Auckland\";\n\t\tString telephoneNumber = \"021123728381\";\n\t\tICustomer customer = customerController.create(name, address, telephoneNumber);\n\t\tlong id = customer.getId();\n\t\tint originalLength = customerController.read().size();\n\n\t\t// When\n\t\tICustomer cus = customerController.delete(id);\n\n\t\t// Then\n\t\tint expected = originalLength - 1;\n\t\tint actual = customerController.read().size();\n\t\tAssert.assertEquals(expected, actual);\n\t\tAssert.assertNotNull(cus);\n\t}", "void testCommitClash(MasterTableJournal journal)\r\n throws TransactionException {\r\n // Very nasty search here...\r\n// int cost = entries() * journal.entries();\r\n// System.out.print(\" CLASH COST = \" + cost + \" \");\r\n\r\n for (int i = 0; i < entries(); ++i) {\r\n byte tc = getCommand(i);\r\n if (tc == 2) { // command - row remove\r\n int row_index = getRowIndex(i);\r\n// System.out.println(\"* \" + row_index);\r\n for (int n = 0; n < journal.entries(); ++n) {\r\n// System.out.print(\" \" + journal.getRowIndex(n));\r\n if (journal.getCommand(n) == 2 &&\r\n journal.getRowIndex(n) == row_index) {\r\n throw new TransactionException(\r\n TransactionException.ROW_REMOVE_CLASH,\r\n \"Concurrent Serializable Transaction Conflict(1): \" +\r\n \"Current row remove clash ( row: \" + row_index + \" )\");\r\n }\r\n }\r\n// System.out.println();\r\n }\r\n }\r\n }", "public void forceCommitTx()\n{\n}", "public void restock(Connection con, Statement s, int prod_id, int cat_id, int deficit )\n {\n int qtyToOrder = deficit + 100;\n int wareOrdId = assignID(con, s, \"store_orders\");\n String storeOrders = \"insert into store_orders(order_num, Loc_id, date_ordered) values(\" + wareOrdId +\", \" + Loc_id + \", '\"+date + \"')\";\n String storeOrder = \"insert into store_order(order_num, purpose) values(\" + assignID(con, s, \"store_order\") +\", '\"+purpose+\"')\";\n String vendor = findCheapVendor(con, s, prod_id, cat_id);\n double price = getStoreBuysPrice(con, s, vendor, prod_id, cat_id);\n String updateOrdFrom = \"insert into store_order_from(order_num, name) values(\" + wareOrdId + \", '\" + vendor + \"')\";\n String updateStoreBuys = \"insert into store_buys(order_num, cat_id, prod_id, qty, price, buy_date) values(\" + wareOrdId + \", \" + cat_id + \", \" + prod_id + \", \" + qtyToOrder + \", \" + price + \", '\" + date +\"')\";\n String updateStoredIn = \"update stored_in set qty = \" + (qtyToOrder) + \" where prod_id = \" + prod_id + \" and cat_id = \" + cat_id + \" and Loc_id = \" + Loc_id;\n try\n {\n int i = s.executeUpdate(storeOrder);\n i = s.executeUpdate(storeOrders);\n i = s.executeUpdate(updateOrdFrom);\n i = s.executeUpdate(updateStoreBuys);\n i = s.executeUpdate(updateStoredIn);\n }catch(Exception e)\n {\n System.out.println(\"updates failed\");\n System.exit(0);\n }\n }", "@Test\n @Order(17)\n void delete_client_not_in_database() {\n int sumOfIds = 0;\n HashSet<Client> allClients = service.getAllClients();\n for(Client c : allClients) {\n sumOfIds+=c.getId();\n }\n boolean isDeleted = service.deleteClientById(sumOfIds);\n Assertions.assertFalse(isDeleted);\n }", "@Test\n public void removeBusyCatch() {\n Date date = new Date(2017-11-12);\n\n userDAO.createUser(new User(\"dummy\", \"dummy\", 1));\n busyDAO.createBusy(new Busy(\"dummy\", 1, date));\n\n assertFalse(busyResource.removeBusy(date, 1,\"notdummy\"));\n\n //clean up\n busyResource.removeBusy(date, 1, \"dummy\");\n userDAO.removeUser(\"dummy\");\n }", "@Override\n public void sure(OrderDetail orderDetail) {\n }", "@After\n public void tearDown() {\n try(Connection con = DB.sql2o.open()) {\n String deleteClientsQuery = \"DELETE FROM clients *;\";\n String deleteStylistsQuery = \"DELETE FROM stylists *;\";\n con.createQuery(deleteClientsQuery).executeUpdate();\n con.createQuery(deleteStylistsQuery).executeUpdate();\n }\n }", "@Override\n\tpublic void allocateorder(Block block) {\n\t\tint executedQty=(int) block.getQtyExecuted();\n\t\tList<Order> list = new ArrayList<Order>();\n\t\tQuery query = em.createQuery(\"from Order where blockId = :id order by orderDate\");\n\t\tquery.setParameter(\"id\", block.getBlockId());\n\t\tlist = query.getResultList();\n\t\tfor (Order order1 : list) {\n\t\tint q=order1.getQtyPlaced();\n\t\tStatus status = null;\n\t\t\tif((q<= executedQty) && (executedQty>0))\n\t\t\t{\n\t\t\t\tSystem.out.println(em);\n\t\t\t\tSystem.out.println(\"Inside first loop\");\n\t\t\t\tSystem.out.println(q);\n\t\t\t\texecutedQty=executedQty-q;\n\t\t\t\t\n\t\t\t\tQuery query1 = em.createQuery(\"Update Order set qtyExecuted=:qty1, status=:status1 where orderId=:oid\");\n\t\t\t\tquery1.setParameter(\"qty1\",q);\n\t\t\t\tquery1.setParameter(\"status1\",status.Completed.toString());\n\t\t\t\tquery1.setParameter(\"oid\",order1.getOrderId());\n\t\t\t\tSystem.out.println(query1.executeUpdate());\n\t\t\t\tSystem.out.println(executedQty + q);\n\t\t\t\t//query1.executeUpdate();\n\n\t\t\t}\n\t\t\telse if(q>=executedQty && executedQty>0){\n\t\t\t\texecutedQty=q-executedQty;\n\t\t\t\tSystem.out.println(\"Inside second loop\");\n\t\t\t\tQuery query1 = em.createQuery(\"Update Order set qtyExecuted=:qty2, status=:status2 where orderId=:oid\");\n\t\t\t\tquery1.setParameter(\"qty2\",executedQty);\n\t\t\t\tquery1.setParameter(\"status2\", status.PartiallyAllocated.toString());\n\t\t\t\tquery1.setParameter(\"oid\",order1.getOrderId());\n\t\t\t\tSystem.out.println(query1.executeUpdate());\n\t\t\t\t//query1.executeUpdate();\n\t\t\t\texecutedQty=0;\n\t\t\t\tSystem.out.println(executedQty);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tQuery query2 = em.createQuery(\"update Order set status=:status3 where orderId=:oid\");\n\t\t\t\tquery2.setParameter(\"status3\", status.Open.toString());\n\t\t\t\tquery2.setParameter(\"oid\",order1.getOrderId());\n\t\t\t\tSystem.out.println(query2.executeUpdate());\n\t\t\t\t//query2.executeUpdate();\n\t\t\t}}\n\t\tSystem.out.println(\"Inside OrderDAO\");\n\n\t\t\n\t}", "public void updateTransaction(){\n\n System.out.println(\"Update transaction with ID: \");\n BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));\n try {\n Long id = Long.valueOf(bufferRead.readLine());\n Transaction newTransaction = this.ctrl.getTransactions().findOne(id).get();\n System.out.println(\"Choose an action: \\n 1.Change the client details. \\n\" +\n \"2.Add a new item to the same transaction. \\n 3.Update the date.\");\n\n String option = bufferRead.readLine();\n\n switch (option) {\n case \"1\":\n System.out.println(\"New client? \");\n String opt = bufferRead.readLine();\n Client c = new Client();\n if(opt.equals(\"yes\")){\n c = this.readClient();\n this.ctrl.addClient(c);\n }\n else {\n this.printAllClients();\n int clientOption = Integer.parseInt(bufferRead.readLine());\n Long clientId = ((Client) this.ctrl.getAllClients().toArray()[clientOption - 1]).getId();\n System.out.println(\"Enter new characteristics: \");\n System.out.println(\"Name: \");\n String newName = bufferRead.readLine();\n System.out.println(\"Age: \");\n int newAge = Integer.parseInt(bufferRead.readLine());\n System.out.println(\"Membership type: \");\n String newMembershipType = bufferRead.readLine();\n\n c = new Client(newName, newAge, newMembershipType);\n c.setId(clientId);\n ctrl.updateClient(c);\n }\n newTransaction.setClient(c);\n ctrl.updateTransaction(newTransaction);\n break;\n case \"2\":\n System.out.println(\"Choose the item you would like to add: \");\n this.printAllItems();\n String sOption = bufferRead.readLine();\n\n while(!(sOption.equals(\"stop\"))) {\n\n int itemOption = 0;\n\n itemOption = Integer.parseInt(sOption);\n ClothingItem item = (ClothingItem) this.ctrl.getAllItems().toArray()[itemOption - 1];\n newTransaction.addItemToCart(item);\n\n this.printAllItems();\n System.out.println(\"Choose another item(or stop if you have finished adding): \");\n sOption = bufferRead.readLine();\n }\n ctrl.updateTransaction(newTransaction);\n break;\n case \"3\":\n System.out.println(\"Enter a new date(dd/mm/yyyy): \");\n String newDate = bufferRead.readLine();\n newTransaction.setDate(newDate);\n ctrl.updateTransaction(newTransaction);\n break;\n default:\n break;\n\n }\n\n\n\n this.ctrl.updateTransaction(newTransaction);\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }", "public static void main(String args[])\n {\n Location location = new Location(\"Depok\", \"Jawa Brat\", \"sebuah kota bukan kata\");\n DatabaseSupplier.addSupplier(new Supplier(\"Bambang\", \"[email protected]\", \"085866669999\",location));\n System.out.println(\"====Supplier Already Exist====\");\n DatabaseSupplier.addSupplier(new Supplier(\"Bambang\", \"[email protected]\", \"085966669999\",location));\n// for (Supplier i: DatabaseSupplier.getSupplierDatabase()\n// ) {\n// System.out.println(i);\n// }\n DatabaseItem.addItem(new Item(\"Ian\", ItemStatus.Refurbished, 10000, DatabaseSupplier.getSupplier(1), ItemCategory.Stationery));\n System.out.println(\"====Customer Already Exist====\");\n DatabaseItem.addItem(new Item(\"Ian\", ItemStatus.New, 10000, DatabaseSupplier.getSupplier(1), ItemCategory.Stationery));\n// for (Item i: DatabaseItem.getItemDatabase())\n// {\n// System.out.println(i);\n// }\n\n DatabaseCustomer.addCustomer(new Customer(\"Shiroe\", \"[email protected]\", \"shiroe69\", \"Shiroe2019\", 2010, 10, 1));\n System.out.println(\"====Supplier Item Exist====\");\n DatabaseCustomer.addCustomer(new Customer(\"Shiroe\", \"[email protected]\", \"shiroe70\", \"Shiroe2019\", 2010, 10, 2));\n// for (Customer i: DatabaseCustomer.getCustomerDatabase())\n// {\n// System.out.println(i);\n// }\n ArrayList<Integer> item = new ArrayList<Integer>();\n item.add(1);\n\n DatabaseInvoice.addInvoice(new Sell_Unpaid(item, DatabaseCustomer.getCustomer(1)));\n System.out.println(\"====Invoice Already Exist====\");\n DatabaseInvoice.addInvoice(new Sell_Unpaid(item, DatabaseCustomer.getCustomer(1)));\n\n System.out.println(\"====Invoice Not Found====\");\n DatabaseInvoice.removeInvoice(100);\n System.out.println(\"====Customer Not Found====\");\n DatabaseCustomer.removeCustomer(100);\n System.out.println(\"====Supplier Not Found====\");\n DatabaseSupplier.removeSupplier(100);\n System.out.println(\"====Item Not Found====\");\n DatabaseItem.removeItem(100);\n Customer customer2 = new Customer(\"Shiroe7\", \"[email protected]\", \"sh77iroe70\", \"Shiroe20i19\", 2010, 10, 2);\n System.out.println(\"====Dont Have Active====\");\n DatabaseInvoice.getActiveOrder(customer2);\n DatabaseCustomer.addCustomer(customer2);\n\n System.out.println(\"====Result====\");\n for (Supplier i: DatabaseSupplier.getSupplierDatabase())\n {\n System.out.println(i);\n }\n\n for (Customer i: DatabaseCustomer.getCustomerDatabase())\n {\n System.out.println(i);\n }\n\n for (Item i: DatabaseItem.getItemDatabase())\n {\n System.out.println(i);\n }\n\n for (Invoice i: DatabaseInvoice.getInvoiceDatabase())\n {\n System.out.println(i);\n }\n\n\n\n // for (Invoice i: DatabaseInvoice.getInvoiceDatabase())\n// {\n// System.out.println(i);\n// }\n Transaction.finishTransaction(DatabaseInvoice.getInvoice(1));\n Transaction.finishTransaction(DatabaseInvoice.getInvoice(3));\n// for (Invoice i: DatabaseInvoice.getInvoiceDatabase())\n// {\n// System.out.println(i);\n// }\n// Transaction.cancelTransaction(DatabaseInvoice.getInvoice(1));\n// for (Invoice i: DatabaseInvoice.getInvoiceDatabase())\n// {\n// System.out.println(i);\n// }\n }", "public void declineTransaction(CommandOfService c) throws Exception {\n // We give back the points to the user\n Service s = c.getService();\n User u = c.getOwner();\n if(s.getTypeService() == 0){\n userDAO.addPoints(s.getCost(),u);\n }\n DAO.declineTransaction(c);\n FacadeNotification facadeNotification = FacadeNotification.getInstance();\n String title = \"Transaction declined!\";\n String desc = \"Your command for: \"+s.getTitle()+\" has been declined.\\n\";\n try {\n facadeNotification.createNotification(u.getIdUser(),title,desc);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void addtorepository() {\n ClientModel widget = new ClientModel();\n widget.setAddress(\"123 Fake Street\");\n widget.setCurrentInvoice(10000);\n widget.setName(\"Widget Inc\");\n clientrepository.save(widget);\n //next client\n ClientModel foo = new ClientModel();\n foo.setAddress(\"456 Attorney Drive\");\n foo.setCurrentInvoice(20000);\n foo.setName(\"Foo LLP\");\n clientrepository.save(foo);\n //next client\n ClientModel bar = new ClientModel();\n bar.setAddress(\"111 Bar Street\");\n bar.setCurrentInvoice(30000);\n bar.setName(\"Bar and Food\");\n clientrepository.save(bar);\n //next client\n ClientModel dog = new ClientModel();\n dog.setAddress(\"222 Dog Drive\");\n dog.setCurrentInvoice(40000);\n dog.setName(\"Dog Food and Accessories\");\n clientrepository.save(dog);\n //next client\n ClientModel cat = new ClientModel();\n cat.setAddress(\"333 Cat Court\");\n cat.setCurrentInvoice(50000);\n cat.setName(\"Cat Food\");\n clientrepository.save(cat);\n //next client\n ClientModel hat = new ClientModel();\n hat.setAddress(\"444 Hat Drive\");\n hat.setCurrentInvoice(60000);\n hat.setName(\"The Hat Shop\");\n clientrepository.save(hat);\n //next client\n ClientModel hatB = new ClientModel();\n hatB.setAddress(\"445 Hat Drive\");\n hatB.setCurrentInvoice(60000);\n hatB.setName(\"The Hat Shop B\");\n clientrepository.save(hatB);\n //next client\n ClientModel hatC = new ClientModel();\n hatC.setAddress(\"446 Hat Drive\");\n hatC.setCurrentInvoice(60000);\n hatC.setName(\"The Hat Shop C\");\n clientrepository.save(hatC);\n //next client\n ClientModel hatD = new ClientModel();\n hatD.setAddress(\"446 Hat Drive\");\n hatD.setCurrentInvoice(60000);\n hatD.setName(\"The Hat Shop D\");\n clientrepository.save(hatD);\n //next client\n ClientModel hatE = new ClientModel();\n hatE.setAddress(\"447 Hat Drive\");\n hatE.setCurrentInvoice(60000);\n hatE.setName(\"The Hat Shop E\");\n clientrepository.save(hatE);\n //next client\n ClientModel hatF = new ClientModel();\n hatF.setAddress(\"448 Hat Drive\");\n hatF.setCurrentInvoice(60000);\n hatF.setName(\"The Hat Shop F\");\n clientrepository.save(hatF);\n }", "@Transactional \n\tpublic void updateAll() {\n\t\t\n\t\tIterator<Pharmacy> newList = pharmacyRepository1.getAllEntity().iterator();\n\t\twhile (newList.hasNext()) {\n\t\t\tPharmacy pharmacy = newList.next();\n\t\t\tlistStockInPharmacy(pharmacy);\n\t\t\t}\n\t\t\n\t}", "public boolean commitCustomers(Connection conn) throws SQLException {\n boolean status = true;\n try {\n // Start of system transaction\n conn.setAutoCommit(false);\n BookingMapper bm = new BookingMapper();\n status = status && bm.addNewCustomer(newCustomers, conn);\n\n if (!status) {\n throw new Exception(\"Business Transaction aborted\");\n }\n // System transaction ends with success\n conn.commit();\n } catch (Exception e) {\n System.out.println(\"fail in UnitOfWork - commit()\");\n System.err.println(e);\n // System transaction fails, rollsback\n conn.rollback();\n status = false;\n }\n return status;\n }", "private void close() {\n\t\t\tassert this.sendLock.writeLock().isHeldByCurrentThread();\n\t\t\tthis.dead = true;\n\t\t\tStoreRequest s = writesByRows.remove(this.row);\n\t\t\t// This request was THE only request for its row\n\t\t\tassert this == s;\n\t\t\tlogger.fine(this.toString() + \" sent on \" + new Date(System.currentTimeMillis()) + \" and not replanned\");\n\t\t}", "@Override\r\n\tprotected void tearDown() throws Exception {\n\r\n\t\tdao.insert(\"delete from system.tables where table_id='0000001' and table_name='emp0'\");\r\n\t\tdao.insert(\"delete from system.tables where table_id='0000002' and table_name='dept0'\");\r\n\t\tdao.insert(\"delete from system.tables where table_id='0000003' and table_name='emp'\");\r\n\t\tdao.insert(\"delete from system.tables where table_id='0000004' and table_name='dept'\");\r\n\t\tdao.insert(\"delete from system.databases where database_id='00001' and database_name='database1'\");\r\n\t\tdao.insert(\"delete from system.databases where database_id='00002' and database_name='database2'\");\r\n\t\tdao.insert(\"delete from system.users where user_name='scott'\");\r\n\r\n\t\tdao.insert(\"commit\");\r\n//\t\tdao.disconnect();\r\n\t}", "@Transactional(\"transactionManager\")\r\n\tpublic String checkOut(Bank bank,Transactions transaction,String parm[]) {\r\n\r\n\r\n\r\n\t\t//Time check\r\n\t\tString paymode;\r\n\r\n\t\tdouble amount;\r\n\r\n\t\tif(transaction==null)\r\n\t\t\tthrow new CustomDataException(ErrorConstants.TRANSACTION_NOT_FOUND,ErrorConstants.STR_TRANSACTION_NOT_FOUND);\r\n\r\n\t\tif(!transaction.getStatus().equals(OrderState.INITIATED))\r\n\t\t\tthrow new CustomDataException(ErrorConstants.TRANSACTION_ALREADY_PROCESSED,ErrorConstants.STR_TRANSACTION_ALREADY_PROCESSED);\r\n\r\n\t\tArrayList<String> output = new ArrayList<String>();\r\n\t\ttransaction.setBank_activity_time(new Date());\r\n\t\ttransaction.setReference_id(parm[1]);\r\n\t\ttransaction.setTransaction_status(parm[2]);\r\n\t\tamount = Double.parseDouble(parm[3]);\r\n\t\ttransaction.setTransaction_amount(Double.parseDouble(parm[3]));\r\n\t\tpaymode = parm[4];\r\n\t\ttransaction.setTransaction_currency(parm[4]);\r\n\t\ttransaction.setTransaction_paymode(parm[5]);\r\n\t\ttransaction.setTransaction_other_details(parm[6]);\r\n\t\ttransaction.setTransaction_status_description(parm[7]);\r\n\r\n\t\ttransaction.setMerchant_reconcilation_status(\"Underprocess\");\r\n\t\t//Reconcilation status\r\n\r\n\r\n\t\t//Calculation of Bank amount vcod amount merchant amount etc .. Demo\r\n\t\tMerchant merchant = transaction.getMerchant();\r\n\t\tMerchantContract merchantContract = orderDao.getMerchantContract(merchant, transaction.getTransaction_paymode());\r\n\t\tBankContract bankContract = orderDao.getBankContract(bank, transaction.getTransaction_paymode());\r\n\t\tif(merchantContract==null||bankContract==null) //Change the logic Exceptions !\r\n\t\t\tthrow new CustomDataException(ErrorConstants.TRANSACTION_NO_CONTRACT_FOUND,ErrorConstants.STR_TRANSACTION_NO_CONTRACT_FOUND);\r\n\t\ttransaction.setBank_amount((amount*(bankContract.getRate()))/100);\r\n\t\ttransaction.setVcod_amount((amount*(merchantContract.getRate()))/100);\r\n\t\ttransaction.setMerchantcontract(merchantContract);\r\n\t\ttransaction.setBankcontract(bankContract);\r\n\t\t//Computed on merchant reconiclaition\r\n\t\ttransaction.setMerchant_reconcilation_amount(transaction.getTransaction_amount()-transaction.getBank_amount()-transaction.getVcod_amount());\r\n\r\n\t\t//Completion of order etc ie:update\r\n\t\tif(transaction.getTransaction_status().equals(OrderState.SUCCESS)||transaction.getTransaction_status().equals(OrderState.FAIL))\r\n\t\t{\r\n\t\t\tif(transaction.getTransaction_status().equals(OrderState.SUCCESS))\r\n\t\t\t{\r\n\t\t\t\ttransaction.setStatus(OrderState.SUCCESS);\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t\ttransaction.setStatus(OrderState.FAIL);\r\n\t\t}\r\n\r\n\t\torderDao.updateTransactions(transaction);\r\n\r\n\t\tlog.info(\"Transaction id : \"+transaction.getTransaction_id());\r\n\t\tlog.debug(\"Transaction id : \"+transaction.getTransaction_id());\r\n\t\tlog.info(\"Transaction amount : \"+transaction.getTransaction_amount());\r\n\t\tlog.debug(\"Transaction amount : \"+transaction.getTransaction_amount());\r\n\t\tlog.info(\"Bank activity Time : \"+transaction.getBank_activity_time());\r\n\t\tlog.debug(\"Bank activity Time: \"+transaction.getBank_activity_time());\r\n\t\tlog.info(\"Status : \"+transaction.getTransaction_status());\r\n\t\tlog.debug(\"Status \"+transaction.getTransaction_status());\r\n\r\n\t\t//In addition to this we may give some parameters from orders table\r\n\r\n\t\toutput.add(transaction.getMerchant_order_id()); //merchant order id\r\n\t\toutput.add(Integer.toString(transaction.getTransaction_id())); //out transaction id\r\n\t\toutput.add(transaction.getStatus()); //status\r\n\t\toutput.add(Double.toString(transaction.getTransaction_amount())); //Amount\r\n\t\toutput.add(transaction.getTransaction_currency()); // currency\r\n\t\toutput.add(transaction.getTransaction_paymode()); // Paymode\r\n\t\toutput.add(transaction.getTransaction_other_details()); // Other Details\r\n\t\toutput.add(transaction.getTransaction_status_description()); // Reason\r\n\r\n\t\tArrayList<String> outputParamList = output;\r\n\t\t//Encryption \r\n\t\ttry {\r\n\t\t\treturn Library.getParamterInString(outputParamList, merchant.getSecret_key());\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new CustomApplicationException(ErrorConstants.INTERNAL_ERROR,ErrorConstants.STR_INTERNAL_ERROR);\r\n\t\t}\r\n\t}", "public void completeOrderTransaction(Transaction trans){\n }" ]
[ "0.63320124", "0.557104", "0.55518925", "0.5459013", "0.5418892", "0.5370092", "0.5326914", "0.5319819", "0.5300342", "0.52911866", "0.52776676", "0.5275197", "0.5236168", "0.5233664", "0.52224684", "0.5213094", "0.52072126", "0.5191101", "0.5190921", "0.5186526", "0.5179781", "0.5174155", "0.5158069", "0.5156209", "0.5134919", "0.5134003", "0.51258487", "0.512284", "0.5111175", "0.5103637", "0.5102547", "0.5101406", "0.5098072", "0.50760144", "0.507215", "0.5070192", "0.5070192", "0.5070192", "0.5070192", "0.5068216", "0.5065739", "0.50637037", "0.5057841", "0.5046006", "0.50442874", "0.5034345", "0.50287384", "0.5016515", "0.5015772", "0.50154686", "0.5010594", "0.5008927", "0.5006959", "0.5002052", "0.49988955", "0.49906984", "0.4990681", "0.49896452", "0.4989154", "0.49852183", "0.49837577", "0.49837577", "0.49837577", "0.49828854", "0.4977294", "0.4977294", "0.4977294", "0.49770868", "0.49718282", "0.49701294", "0.49686548", "0.49577382", "0.4953892", "0.49482954", "0.49411535", "0.49361178", "0.49328706", "0.49327266", "0.492945", "0.49284658", "0.49274254", "0.49269262", "0.49263656", "0.49246705", "0.49175915", "0.4916314", "0.4916244", "0.4915619", "0.4914069", "0.49057686", "0.49039176", "0.49039087", "0.49024785", "0.48961827", "0.4893944", "0.48907486", "0.4879028", "0.48775232", "0.48711532", "0.48704216", "0.48679572" ]
0.0
-1
Instantiate this function with an infinite width.
public AllDifferent() { this(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Plain(int width) {\n this.width = width;\n }", "public FixedWidthFunction(GroupingExpression exp, Number width) {\n this(null, null, exp,\n width instanceof Double ? new DoubleValue(width.doubleValue()) : new LongValue(width.longValue()));\n }", "double getNewWidth();", "public Square(int w)\n {\n width = w;\n }", "public Rectangle(int length, int width) {\n }", "public Sliding()\n {\n }", "public void calculate(){\n\t\tint temp = new Random().nextInt();\r\n\t\tint width = temp;\r\n\t\twidth++;\r\n\t\tclass Inner {\r\n\t\t\tpublic void multiply(){\r\n\t\t\t\tSystem.out.println(length* width);\r\n\t\t\t}\r\n\t\t}\r\n\t\tInner inner = new Inner();\r\n\t\tinner.multiply();\r\n\t}", "public Spill() {\n\t\tthis(0, null);\n\t}", "Integer getDefaultWidth();", "public void setWidth(double w)\n { this.widthDefault = w; }", "int getWidth() {return width;}", "public Stack() {\r\n this(20);\r\n }", "public int width();", "public Rectangle()\n {\n length = 1;\n width = 1;\n count++;\n }", "public double width() { return _width; }", "@Override\n int width();", "public int getWidth() { return width; }", "public int getWidth() { return width; }", "public int getCurrentWidth();", "@SuppressWarnings({\"UnusedDeclaration\"})\n public DefinedEnvironmentForMaximumLengthWithAdditiveFunction() {\n this(DEFAULT_LED_ACTIVATION_DURATION,\n new PositionalVariableFunction(),\n 0.0,\n false,\n DEFAULT_ORIENTATION_DERIVATION_DURATION,\n DEFAULT_CENTROID_DISTANCE_FROM_CENTER,\n DEFAULT_ORIENTATION_OFFSET,\n new BehaviorLimitedKinematicVariableFunctionList(),\n 90.0,\n new IntensityValue(),\n new SingleVariableFunction());\n }", "Integer getCurrentWidth();", "public Fahrzeug() {\r\n this(0, null, null, null, null, 0, 0);\r\n }", "public void setWidth(int w)\n {\n width = w;\n }", "public Row(int width) {\n data = new Object[width];\n }", "void setWidth(int width);", "void setWidth(int width);", "Rectangle() {\r\n\t\tlength = 1.0;\r\n\t\twidth = 1.0;\r\n\t}", "public int getWidth()\n {return width;}", "Box(double len)\n\t{\n\t\t\n\t\twidth = height = depth = len;\n\t\t\n\t}", "int width();", "public void setWidth(int w) {\n this.width = w;\n }", "Box(double len){\r\n Height = Width = Depth = len;\r\n\r\n }", "static Extractor byWidth(int count) {\n\t\t\treturn Splitter.fixedWidthTruncationExtractor(count);\n\t\t}", "public void setWidth(int w) {\n this.W = w;\n }", "public CircularGrid() {\r\n\t\tthis(0, false, false);\r\n\t}", "public void setWidth(int w){ widthRadius = w; }", "@Override\n public Piece getNext(int width)\n {\n return new SamplePiece(new Position(-1, width / 2));\n }", "@Override\n public Optional<Integer> uniformWidth() {\n return Optional.empty();\n }", "public Builder clearWidth() {\n bitField0_ = (bitField0_ & ~0x00000004);\n width_ = 0;\n onChanged();\n return this;\n }", "public VariableGridLayout() {\n\t\tthis(FIXED_NUM_ROWS, 1, 0, 0);\n\t}", "public abstract double getBaseWidth();", "public Builder clearWidth() {\n \n width_ = 0;\n onChanged();\n return this;\n }", "@Override\n\tpublic void setWidth(float width) {\n\n\t}", "public Builder setWidth(int value) {\n \n width_ = value;\n onChanged();\n return this;\n }", "public void setWidth(int w){\n \twidth = w;\n }", "public int width()\n {\n return width;\n }", "public wall() { //default constructor makes a 10x10 square extending right and down from the pixel located at 5,5\r\n x = 5;\r\n y = 5;\r\n height = 10;\r\n width = 10;\r\n }", "@Override\r\n\tpublic void setWidth(int width) {\n\t\t\r\n\t}", "public FireflyOptimization(){\n this(25, 1000);\n }", "TwoDShape5(double x) {\n width = height = x;\n }", "public void setNextWidth(int w) {\n\t\tnextWidth = w;\n\t}", "public void setWidth(int width) {\n this.width = width;\n }", "public void setWidth(double width) {\n this.width = width;\n }", "public void setWidth(int width)\n {\n this.width = width;\n }", "public Builder setWidth(int value) {\n bitField0_ |= 0x00000004;\n width_ = value;\n onChanged();\n return this;\n }", "public LogicUnit(int width) {\n super(\"LogicUnit\", width);\n }", "@Override\n public int getWidth() {\n return width;\n }", "@Override\n public int getWidth() {\n return width;\n }", "public OutlineZigzagEffect(int width, Color color) {\n/* 89 */ super(width, color);\n/* */ }", "LengthScalarMultiply createLengthScalarMultiply();", "public Rectangle() {\n\t\tthis.width = 1;\n\t\tthis.hight = 1;\n\t\tcounter++;\n\t}", "public void setWidth(float width) {\n this.xRadius = width/2f;\n }", "public VectorStackWithIterator() {\n\t\tthis(10);\n\t}", "public double getMinWidth() { return getMinWidth(-1); }", "int getWidth()\n {\n return width;\n }", "public Rectangle(int length, int width)\n {\n this.length = length;\n this.width = width;\n\n }", "public void setWidth(double width) {\r\n this.width = width;\r\n }", "public int getWidth(){\n return width;\n }", "@Override\n public double getWidth() {\n return width;\n }", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "public int width() {\n return width;\n }", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "public Towers() {\n\t\tthis(DEFAULT_SIZE);\n\t}", "public Skull() {\n\t\tsuper();\n\t\tsuper.setWidth(width);\n\t\tsuper.setheight(height);\n\t\tloadPattern();\n\t\tcurrentPattern = walkPattern;\n\t}", "public float getWidth();", "public SPIEL() \n {\n this( 800 , 600 , false , false , false );\n }", "public void setWidth(double value) {\n this.width = value;\n }", "public int getWidth();", "public int getWidth();", "public int getWidth();", "public void setWidth(double width) {\n this.width = width;\n }", "public void setWidth(final int theWidth) {\n myWidth = theWidth;\n }", "Rectangle()\n {\n this(1.0,1.0);\n }", "abstract public int getMinWidth();", "public int width() {\n \treturn width;\n }", "public int getWidth(){\n return width;\n }", "public Thumbnail() {\n this(100, 100);\n }", "public void setWidth(int w) {\n\t\twidth = w;\n\t}", "public Builder clearWidth() {\n copyOnWrite();\n instance.clearWidth();\n return this;\n }", "public mGrid(float width) {\r\n\t\tthis.width = width;\r\n\t\tthis.pos = new mPoint3(0,0,0);\r\n\t\tmPoint3[] points = new mPoint3[17];\r\n\t\tpoints[0] = pos;\r\n\t\tfor(int i=-2;i<=2;i++){\r\n\t\t\tpoints[2*i+5] = new mPoint3(2*width,i*width,0);\r\n\t\t\tpoints[2*i+6] = new mPoint3(-2*width,i*width,0);\r\n\t\t}\r\n\t\tfor(int i=-1;i<=1;i++){\r\n\t\t\tpoints[2*i+13] = new mPoint3(i*width,2*width,0);\r\n\t\t\tpoints[2*i+14] = new mPoint3(i*width,-2*width,0);\r\n\t\t}\r\n\t\tthis.shape = new mShape();\r\n\t\tshort[][] lp = new short[2][10];\r\n\t\tshort i;\r\n\t\tfor(i=0;i<5;i++){\r\n\t\t\tlp[0][i] = (short)(i*2+1);\r\n\t\t\tlp[1][i] = (short)(2*i+2);\r\n\t\t}\r\n\t\tlp[0][5] = 2;\r\n\t\tlp[1][5] = 10;\r\n\t\tlp[0][9] = 1;\r\n\t\tlp[1][9] = 9;\r\n\t\tfor(i=0;i<3;i++){\r\n\t\t\tlp[0][i+6] = (short)(2*i+11);\r\n\t\t\tlp[1][i+6] = (short)(2*i+12);\r\n\t\t}\r\n\t\tshort[][] tp = new short[1][0];\r\n\t\tthis.shape.set(points,lp,tp);\r\n\t}", "public Integer getWidth(){return this.width;}", "public InfLinearAxis(int size) {\n super(size);\n }", "public int getWidth(){ return widthRadius; }", "public double getWidth() { return _width<0? -_width : _width; }", "public abstract int getWidth();", "@Override\n\tpublic int getWidth() {\n\t\treturn 0;\n\t}", "public int width() {\r\n return width;\r\n }", "@Override\r\n\tpublic int setWidth() {\n\t\treturn 0;\r\n\t}", "public int grWidth() { return width; }", "public void setW(int i) {\n\t\tthis.width=i;\n\t\t\n\t}", "public int getRangeWidth();" ]
[ "0.64823556", "0.5968908", "0.5893348", "0.58884764", "0.5641955", "0.5613188", "0.5593008", "0.5591713", "0.55780673", "0.5537561", "0.5511492", "0.54675525", "0.54661113", "0.54651093", "0.54115677", "0.5406519", "0.5383397", "0.5383397", "0.5379138", "0.5377192", "0.53767973", "0.5359401", "0.53464055", "0.5327499", "0.531802", "0.531802", "0.5314578", "0.5312399", "0.5307541", "0.5305152", "0.52874976", "0.52749497", "0.5255192", "0.52435964", "0.52392703", "0.52339405", "0.52224445", "0.5199609", "0.5198786", "0.5197701", "0.5189532", "0.51808596", "0.5180701", "0.5174568", "0.51736873", "0.5170953", "0.516748", "0.5159906", "0.5154471", "0.51532966", "0.5153081", "0.514461", "0.5136406", "0.51360184", "0.5134656", "0.5134493", "0.51332027", "0.51332027", "0.5127993", "0.512745", "0.5126972", "0.5122876", "0.51101416", "0.5104089", "0.5103556", "0.50902444", "0.50881684", "0.50839627", "0.508269", "0.5082298", "0.50749964", "0.50706947", "0.5065824", "0.50633794", "0.50622755", "0.5059266", "0.5058413", "0.5057653", "0.5057653", "0.5057653", "0.50384563", "0.50318795", "0.5021293", "0.50162613", "0.50152475", "0.50123805", "0.50112206", "0.500888", "0.50058514", "0.5004327", "0.50041294", "0.5003174", "0.5001597", "0.49963906", "0.49951673", "0.4995097", "0.4994154", "0.49900234", "0.49882126", "0.49871212", "0.4984273" ]
0.0
-1
if a duplicate entry has been found and the width is infinite.
@Override public Boolean getValue(Object x) { if (m_falseCount > 0 && m_width <= 0) return false; allDifferent = true; // if duplicate entries were found in previous calls if (m_falseCount > 0) { m_falseCount--; allDifferent = false; } // compare this entry to every previous one for (int i = m_previousInputs.size() - 1; i >= 0; i--) { if (m_previousInputs.get(i).equals(x)) { // this function will return false at least until this entry is removed m_falseCount = Math.max(m_falseCount, i + (m_width - m_previousInputs.size() - 1)); allDifferent = false; break; } } // update previous entries m_previousInputs.add(x); if (m_width > 0 && m_previousInputs.size() >= m_width) { m_previousInputs.remove(); } return allDifferent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\t\t\t\tprotected boolean removeEldestEntry(Map.Entry e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn size()>5;\r\n\t\t\t\t\t}", "boolean hasWidth();", "boolean hasWidth();", "boolean hasWidth();", "public boolean removeEldestEntry(Map.Entry entry){\n return size() > capacity;\n }", "@SuppressWarnings({ \"unchecked\", \"static-access\" })\r\n\tpublic boolean checkArticleIsDuplicated(){\r\n\t\r\n\t\tnum_DupInDBLP = 0;\r\n\t\t\t\t\r\n\t\tCheckExist check = new CheckExist();\r\n\t\t\r\n\t\tnumberArray = (ArrayList<Integer>) check.CheckTitleSignaturePublications(dbsaPublicationCheckList).clone();\r\n\t\tduplicateNumber = numberArray.size();\r\n\t\t\r\n\t\tduplicationArtilce = false;\r\n\t\tif(numberArray.size() > 0){\r\n\t\t\tfor(int i = 0; i < numberArray.size(); i++)\r\n\t\t\t{\t\r\n\t\t\t\tmodel.setValueAt(true, numberArray.get(i), 8);\r\n\t\t\t\tresultsJTable.addRowToPaint(numberArray.get(i), Color.red);\r\n\t\t\t\tduplicationArtilce = true;\r\n\t\t\t\t\r\n\t\t\t\tnum_DupInDBLP ++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tgetFetcherInfo();\r\n\t\t//System.out.println(num_DupInDBLP);\r\n\t\tcheckDuplicateJButton.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));\r\n\t\tDBSAApplication.statisticPanel.updateStatistic(num_Total);\r\n\t\treturn duplicationArtilce;\r\n\t}", "protected void checkSize(){\n if (size == data.length){\n resize( 2 * data.length);\n }\n }", "@java.lang.Override\n public boolean hasWidth() {\n return instance.hasWidth();\n }", "@Override\r\n\t\t\tprotected boolean removeEldestEntry(Map.Entry eldest) {\r\n\t\t return size() > 3;\t//every time the eldest element will be removed if size > 3\r\n\t\t }", "public static void incrDuplicates() { ++duplicates; }", "private void HaveDuplicate() {\n haveDuplicate = false;\n duplicateCounter = 0;\n try {\n query=\"SELECT * FROM category WHERE category_id = '\"+ txtCategoryNo.getText() +\"' OR category_name = '\"+\n txtCategoryName.getText() + \"'\";\n rset = connection.createStatement().executeQuery(query);\n while (rset.next()) {\n haveDuplicate = true;\n duplicateCounter++;\n }\n\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n\n }", "void scanunique() {\n\t\tint oldline, newline;\n\t\tnode psymbol;\n\n\t\tfor (newline = 1; newline <= newinfo.maxLine; newline++) {\n\t\t\tpsymbol = newinfo.symbol[newline];\n\t\t\tif (psymbol.symbolIsUnique()) { // 1 use in each file\n\t\t\t\toldline = psymbol.linenum;\n\t\t\t\tnewinfo.other[newline] = oldline; // record 1-1 map\n\t\t\t\toldinfo.other[oldline] = newline;\n\t\t\t}\n\t\t}\n\t\tnewinfo.other[0] = 0;\n\t\toldinfo.other[0] = 0;\n\t\tnewinfo.other[newinfo.maxLine + 1] = oldinfo.maxLine + 1;\n\t\toldinfo.other[oldinfo.maxLine + 1] = newinfo.maxLine + 1;\n\t}", "private void maybeResize() {\n\t\tif ( this.size <= this.table.length / 2) return;\r\n\t\t\r\n\t\t//store the current entries\r\n\t\tList<Entry<K,V>> temp = new ArrayList<>();\r\n\t\tfor (Entry<K,V> entry : this.entrySet())\r\n\t\t\ttemp.add(temp.size(), entry);\r\n\t\t\r\n\t\t//create new table\r\n\t\tthis.createTable(this.table.length * 2);\r\n\t\t\r\n\t\t//reinsert the old entries (since the capacity has changed, indices will be different)\r\n\t\tfor (Entry<K,V> entry : temp ) \r\n\t\t\tthis.put(entry.getKey(), entry.getValue());\r\n\t\t\r\n\t}", "private void detectExcessSize() {\n final String overflow = getElement().getStyle().getProperty(\n \"overflow\");\n getElement().getStyle().setProperty(\"overflow\", \"hidden\");\n if (BrowserInfo.get().isIE()\n && getElement().getPropertyInt(\"clientWidth\") == 0) {\n // can't detect possibly themed border/padding width in some\n // situations (with some layout configurations), use empty div\n // to measure width properly\n DivElement div = Document.get().createDivElement();\n div.setInnerHTML(\"&nbsp;\");\n div.getStyle().setProperty(\"overflow\", \"hidden\");\n div.getStyle().setProperty(\"height\", \"1px\");\n getElement().appendChild(div);\n excessWidth = getElement().getOffsetWidth()\n - div.getOffsetWidth();\n getElement().removeChild(div);\n } else {\n excessWidth = getElement().getOffsetWidth()\n - getElement().getPropertyInt(\"clientWidth\");\n }\n excessHeight = getElement().getOffsetHeight()\n - getElement().getPropertyInt(\"clientHeight\");\n \n getElement().getStyle().setProperty(\"overflow\", overflow);\n }", "@Override\n\tprotected boolean removeEldestEntry(java.util.Map.Entry<String, String> eldest) {\n\t\treturn size() > maximumSize;\n\t}", "private static int \n extraCount (final Map.Entry <String, VersionedValue> entry)\n {\n return entry.getKey ().length () + 1 + 4 + entry.getValue ().getValue ().length () + 1;\n }", "protected void repeatedFoundWhenInsert(CntAVLTreeNode node) {\n System.out.println(\"添加失败:不允许添加相同的节点!\");\n }", "private boolean hasAnyRepeatedElement(List<Integer> row) {\n List<Integer> copyRow = new ArrayList<>(row);\n Collections.sort(copyRow);\n for (int i = 0; i < copyRow.size(); i++) {\n if(!isLastElement(i, copyRow)) {\n int current = copyRow.get(i);\n int next = copyRow.get(i+1);\n // If current is equals to next means that a repeated element has been found\n if(current == next) return true;\n }\n }\n return false;\n }", "public boolean HasOneValueInTheSpace()\n {\n return _valuesToPut.size() == 1;\n }", "public boolean hasOverflow() {\r\n\t\t\treturn (data.size() > 3);\r\n\t\t}", "public boolean insert( AnyType x )\n { \n int currentPos = findPos( x );\n \n if( array[ currentPos ] == null )\n ++occupied;\n array[ currentPos ] = new HashEntry<>(x);\n \n theSize++;\n \n // Rehash\n if( occupied > array.length / 2 )\n rehash( );\n \n return true;\n }", "private boolean containsDuplicate(final int[] inputarray){\n Set<Integer> cells = new HashSet<Integer>();\n for (int i : inputarray){\n if (cells.contains(i) || (i < 1 || i > inputarray.length)) return true;\n cells.add(i);\n }\n return false;\n }", "public boolean insert(int val) {\n if (!map.containsKey(val)) {\n map.put(val, new HashSet<>());\n }\n map.get(val).add(size);\n list.add(val);\n size++;\n return map.get(val).size() == 1;\n }", "private boolean containsDuplicate(final int[][] inputarray){\n Set<Integer> cells = new HashSet<Integer>();\n for (int[] i : inputarray){\n for(int values : i){\n if (cells.contains(values) || (values < 1 || values > (inputarray.length*inputarray.length))) return true;\n cells.add(values);\n }\n }\n return false;\n }", "public boolean insert(int val) {\n if(!map.containsKey(val)){\n if(validLength == set.size()){\n set.add(val);\n map.put(val, validLength++);\n }\n else{\n map.put(val, validLength);\n set.set(validLength++, val);\n }\n return true;\n }\n else{\n return false;\n }\n }", "protected boolean removeEldestEntry(Map.Entry eldest) {\n\t\t\t\treturn size() > CACHESIZE;\r\n\t\t\t}", "protected boolean removeEldestEntry(Map.Entry eldest) {\n\t\t\t\treturn size() > CACHESIZE;\r\n\t\t\t}", "int getNumberOfDetectedDuplicates();", "private boolean noRepeatedNumbersInColumns() {\n return !this.hasAnyRepeatedInColumn();\n }", "public boolean checkDuplicates() {\n\t\tboolean[] vals = new boolean[9];\n\t\tfor(int i = 0; i < 3; i++) {\n\t\t\tfor(int k = 0; k < 3; k++) {\n\t\t\t\tint num = this.getCellNum(i, k);\n\t\t\t\tif(num != 0) {\n\t\t\t\t\tif(!vals[num-1]) {\n\t\t\t\t\t\t//The number hasn't already been found\n\t\t\t\t\t\tvals[num-1] = true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//A duplicate number was found\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean minSize(){\n\t\tboolean result; \n\t\tif(keys.size() < (MAXKEYS/2) -1){\n\t\t\tresult = true;\n\t\t}\n\t\telse{ \n\t\t\tresult = false;\n\t\t}\n\t\treturn result;\n\t}", "private boolean checkGap() { //Checks if any gap due to previously deleted resv\n\t\tif (numOfReservation == 0)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn !(rList.get(rList.size()-1).getResvNo() == numOfReservation);\n\t}", "public static void printDuplicate(String str){\n\t\t\n\t\tString[] strArray = str.split(\" \");\n\t\t\n\t\tHashMap<String, Integer> hm = new HashMap<>();\n\t\t\n\t\t/*for(String tempString : strArray){\n\t\t\tif(hm.containsKey(strArray[i])){\n\t\t\t\t\n\t\t\t\thm.put(strArray[i], hm.get(strArray[i])+1);\n\t\t\t}else{\n\t\t\t\thm.put(strArray[i], 1);\n\t\t\t}\n\t\t}*/\n\t\t\n\t\t//or\n\t\t\n\t\tfor(int i=0; i<strArray.length; i++){\n\t\t\t\n\t\t\tif(hm.containsKey(strArray[i])){\n\t\t\t\t\n\t\t\t\thm.put(strArray[i], hm.get(strArray[i])+1);\n\t\t\t}else{\n\t\t\t\thm.put(strArray[i], 1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(hm);\n\t\t\n\t\tfor (Map.Entry<String, Integer> entry : hm.entrySet()) {\n\t\t\tif(entry.getValue()>1){\n\t\t\t\tSystem.out.print(\"Item : \" + entry.getKey() + \" Count : \" + entry.getValue());\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\t//java 8 iteration\n\t\thm.forEach((k,v)->{\n\t\t\t//System.out.println(\"Item : \" + k + \" Count : \" + v);\n\t\t\t\n\t\t\tif(v > 1){\n\t\t\t\t\n\t\t\t\tSystem.out.println(k +\" \" + v);\n\t\t\t}\n\t\t});\n\t\t\n\t}", "private void incrementCounter(Entry<String, Integer> entrySet) {\n if (entrySet.getValue() < Integer.MAX_VALUE) {\n entrySet.setValue(entrySet.getValue() + 1);\n }\n logger.debug(\"[{}] - Reader reported dead. Iteration #{}\", entrySet.getKey(), entrySet.getValue());\n }", "@Override\n protected int getNumRepetitions() {\n return 1;\n }", "boolean addNextWidthTo(SchedulePriorityQueue queue) {\n\t\tif(widthAfterQueue == widths.size()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tList<ScheduleBlock> width = widths.get(widthAfterQueue++);\n\t\t\n\t\tfor(ScheduleBlock block : width) {\n\t\t\tblock.addToQueue(queue);\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "protected boolean removeEldestEntry(Map.Entry<Integer, String> eldest){\n\t return size() > this.capacity;\n\t }", "public void containsNoDuplicates() {\n List<Entry<T>> duplicates = Lists.newArrayList();\n for (Multiset.Entry<T> entry : LinkedHashMultiset.create(getSubject()).entrySet()) {\n if (entry.getCount() > 1) {\n duplicates.add(entry);\n }\n }\n if (!duplicates.isEmpty()) {\n failWithRawMessage(\"%s has the following duplicates: <%s>\", getDisplaySubject(), duplicates);\n }\n }", "boolean validateOffset() {\n\t\t\tint num = entriesByIndex.size() + 1; // assuming 0, plus 1-N)\n\t\t\tfor (int index : entriesByIndex.keySet()) {\n\t\t\t\tif (index > num || index < 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "protected boolean removeEldestEntry(Map.Entry eldest) {\n/* 49 */ return (size() > this.maxElements);\n/* */ }", "private void addPrecious(CacheRepositoryEntry entry)\n {\n try {\n long size = entry.getSize();\n synchronized (_precious) {\n if (_precious.add(entry.getPnfsId())) {\n _preciousSpace += size;\n }\n }\n } catch (CacheException e) {\n _log.error(\"failed to get entry size : \" + e.getMessage());\n }\n }", "private List<CustStmtRecord> validateDuplicate (final List<CustStmtRecord> custStmtRecords) {\n\t\tlog.info(\"Entering {}.{}\", getClass().getName(), \"validateDuplicate()\");\n\t\tfinal List<CustStmtRecord> duplicateReference = custStmtRecords\n\t\t\t\t.parallelStream()\n\t\t\t\t\t.filter(e -> Collections.frequency(custStmtRecords, e) > 1)\n\t\t\t\t\t.collect(Collectors.toList());\n\t\t\t\t\t;\n\t\t\t\n\t\tlog.info(\"duplicateReference {}\", duplicateReference);\n\t\t\t\n\t\tlog.info(\"Exiting {}.{}\", getClass().getName(), \"validateDuplicate()\");\n\t\treturn duplicateReference;\n\t}", "@Override\n\tpublic boolean removeEldestEntry(Map.Entry<T,U> element)\n\t{\n\t\t// Remove it if we've hit our capacity (meaning\n\t\t// we've overflowed)\n\t\t//\n\t\treturn size() > maxSize;\n\t}", "void checkStationUIExists() {\n\n int recordCount = 9999;\n int duplicateCount = 0;\n\n String where = MrnStation.DATE_START + \"=\" +\n Tables.getDateFormat(station.getDateStart()) +\n \" and \" + MrnStation.LATITUDE +\n \" between \" + (station.getLatitude()-areaRangeVal) +\n \" and \" + (station.getLatitude()+areaRangeVal) +\n \" and \" + MrnStation.LONGITUDE +\n \" between \" + (station.getLongitude()-areaRangeVal) +\n \" and \" + (station.getLongitude()+areaRangeVal) ;\n if (dbg) System.out.println(\"<br>checkStationUIExists: where = \" + where);\n //outputDebug(\"checkStationUIExists: where = \" + where);\n\n MrnStation[] stns = new MrnStation().get(where);\n if (dbg) System.out.println(\"<br>checkStationUIExists: stns.length = \" + stns.length);\n //outputDebug(\"checkStationUIExists: number of stations found = \" + stns.length);\n\n String debugMessage = \"\\ncheckStationUIExists: duplicate UI check \\n \" +\n station.getDateStart(\"\").substring(0,10) +\n \", \" + ec.frm(station.getLatitude(),10,5) +\n \", \" + ec.frm(station.getLongitude(),10,5) +\n \", \" + station.getStnnam(\"\") +\n \" (\" + station.getStationId(\"\") + \")\";\n\n if (stns.length == 0) {\n outputDebug(debugMessage + \": duplicate UI not found\");\n } else {\n\n outputDebug(debugMessage);\n\n // check for duplicate station names (stnnam)\n while (recordCount > 0) {\n\n // count station names the same\n recordCount = 0;\n for (int i = 0; i < stns.length; i++) {\n if (stns[i].getStnnam(\"\").equals(station.getStnnam(\"\"))) {\n recordCount++;\n } // if (stns[i].getStnnam(\"\").equals(station.getStnnam(\"\")))\n } // for (int i = 0; i < stns.length; i++)\n\n if (dbg) System.out.println(\"<br>checkStationUIExists: recordCount = \" +\n recordCount + \", stnnam = \" + station.getStnnam(\"\"));\n\n debugMessage = \" \" + station.getStnnam(\"\") +\n \", recordCount (same stnnam) = \" + recordCount;\n\n if (recordCount > 0) {\n duplicateCount++;\n\n station.setStnnam(station.getStnnam(\"\") + duplicateCount);\n\n debugMessage += \" - new stnnam = \" +\n station.getStnnam(\"\");\n //outputDebug(debugMessage);\n if (dbg) System.out.println(\"checkStationUIExists: new stnnam = \" +\n station.getStnnam(\"\"));\n }// if (recordCount > 0)\n\n outputDebug(debugMessage);\n\n } // while (recordCount > 0)\n\n } // if (stns.length == 0)\n\n }", "private boolean isFull() {\n\t\treturn (size == bq.length);\n\t}", "private void checkIfDuplicateKey(String recordKey) {\n if (this.records.containsKey(recordKey)) {\n System.out.println(duplicateKey);\n throw new IllegalArgumentException();\n }\n }", "public static boolean isDuplicate(Entry entry, List<Entry> batchEntries)\r\n\t{\n\t\tboolean isDuplicate = false;\r\n\t\t\r\n\t\tfor (int i = 0; i < batchEntries.size(); i++)\r\n\t\t{\r\n\t\t\tif (entry.getRank().equals(batchEntries.get(i).getRank()) && \r\n\t\t\t\t\tentry.getSuit().equals(batchEntries.get(i).getSuit()))\r\n\t\t\t{\r\n\t\t\t\tisDuplicate = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn isDuplicate;\r\n\t}", "private boolean noRepeatedNumbersInRows() {\n return this.matrix.stream()\n .noneMatch(this::hasAnyRepeatedElement);\n }", "private boolean zzRefill() {\r\n\t\treturn zzCurrentPos>=s.offset+s.count;\r\n\t}", "private boolean ifTooEmpty() {\n if (items.length <= 8) {\n return false;\n }\n float efficiency = (float) size / (float) items.length;\n return efficiency < 0.25;\n }", "public boolean checkDuplicate(ResultSet rsData, ResultSet rsWareHouse) {\n\t\ttry {\n\n\t\t\tint count = 0;\n\t\t\tfor (int i = 1; i <= number_colum; i++) {\n\t\t\t\ttry {\n//\t\t\t\t\tSystem.out.println(rsData.getString(i));\n//\t\t\t\t\tSystem.out.println(rsWareHouse.getObject(i + 1));\n\t\t\t\t\tif (!rsData.getString(i).equals(rsWareHouse.getObject(i + 1).toString())) {\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (count > 2) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn false;\n\n\t}", "private boolean zzRefill() {\n\t\treturn zzCurrentPos>=s.offset+s.count;\n\t}", "private boolean zzRefill() {\n\t\treturn zzCurrentPos>=s.offset+s.count;\n\t}", "void checkRepeated() {\r\n Move check = listOfMoves.peek();\r\n if (map.containsKey(check)) {\r\n _repeated = true;\r\n _winner = map.get(check.from()).opponent();\r\n }\r\n _repeated = false;\r\n }", "@Override\n public boolean isFull(){\n return (count == size);\n \n }", "public boolean isFull(){\n return this.top==this.maxLength-1;\n }", "public boolean isAmbiguous() {\n return positionMap.size() > 1;\n }", "private void skipStaleEntries()\n {\n while (this.index < keys.size() && !HashBijectiveMap.this.containsKey(keys.get(this.index)))\n this.index++;\n }", "private void expand() {\n int capacity = newCapacity();\n IntIntMap h = new IntIntMap(capacity);\n for (int i = 0; i < entries.length; i += 2) {\n if (entries[i] != EMPTY) {\n h.put(entries[i], entries[i + 1]);\n }\n }\n this.entries = h.entries;\n this.threshold = h.threshold;\n this.modulo = h.modulo;\n this.modulo2 = h.modulo2;\n }", "private void checkForMinimumDistanceFailure(final ReadEndsForMateCigar current) {\n if (!toMarkQueue.isEmpty()) {\n final ReadEndsForMateCigar other = toMarkQueue.peek();\n if (other.read1ReferenceIndex == current.read1ReferenceIndex && toMarkQueue.getToMarkQueueMinimumDistance() <= other.read1Coordinate - current.read1Coordinate) {\n if (checkCigarForSkips(other.getRecord().getCigar())) {\n throw new PicardException(\"Found a samRecordWithOrdinal with sufficiently large code length that we may have\\n\"\n + \" missed including it in an early duplicate marking iteration. Alignment contains skipped\"\n + \" reference bases (N's). If this is an\\n RNAseq aligned bam, please use MarkDuplicates instead,\"\n + \" as this tool does not work well with spliced reads.\\n Minimum distance set to \"\n + toMarkQueue.getToMarkQueueMinimumDistance() + \" but \" + (other.read1Coordinate - current.read1Coordinate - 1)\n + \" would be required.\\n\" + \"Record was: \" + other.getRecord().getSAMString());\n } else {\n System.err.print(\"record #1: \" + other.getRecord().getSAMString());\n System.err.print(\"record #2: \" + current.getRecord().getSAMString());\n throw new PicardException(\"Found a samRecordWithOrdinal with sufficiently large clipping that we may have\\n\"\n + \" missed including it in an early duplicate marking iteration. Please increase the\"\n + \" minimum distance to at least \" + (other.read1Coordinate - current.read1Coordinate - 1)\n + \"bp\\nto ensure it is considered (was \" + toMarkQueue.getToMarkQueueMinimumDistance() + \").\\n\"\n + \"Record was: \" + other.getRecord().getSAMString());\n }\n }\n }\n }", "public boolean isRepeated()\n {\n return start != end;\n }", "@Override\n\tprotected boolean removeEldestEntry(Map.Entry eldest) {\n\t\treturn size() > MAX_ENTRIES;\n\t}", "protected void removeDuplicates() {\n log.trace(\"Removing duplicated\");\n long startTime = System.currentTimeMillis();\n int initial = size();\n E last = null;\n int index = 0;\n while (index < size()) {\n E current = get(index);\n if (last != null && last.equals(current)) {\n if (log.isTraceEnabled()) {\n log.trace(\"Removing duplicate '\" + current + \"'\");\n }\n remove(index);\n } else {\n index++;\n }\n last = current;\n }\n log.debug(String.format(\"Removed %d duplicates from a total of %d values in %dms\",\n initial - size(), initial, System.currentTimeMillis() - startTime));\n }", "private boolean noConflictInColumn(int columnIndex, int number) {\n for (int i = 0; i < 9; i++) {\n if (grid[i][columnIndex] == number) {\n return false;\n }\n }\n return true;\n }", "public void countCollisions() {\n int col2 = 0;\n int col3 = 0;\n int col4 = 0;\n int col5OrMore = 0;\n \n for (int x = 0; x < buckets.length; x++) {\n SList chain = (SList) buckets[x];\n if (chain.length() == 2) {\n col2++;\n }\n if (chain.length() == 3) {\n col3++;\n }\n if (chain.length() == 4) {\n col4++;\n }\n if (chain.length() >= 5) {\n col5OrMore++;\n }\n }\n System.out.println(\"=========HASHTABLE================\");\n System.out.println(\"# of entries: \" + size);\n System.out.println(\"Number of single collisions: \"+col2);\n System.out.println(\"Number of double collisions: \"+col3);\n System.out.println(\"Number of triple collisions: \"+col4);\n System.out.println(\"Number of 5 or more collisions: \"+col5OrMore);\n }", "protected boolean isDuplicate(ELesxUseCase useCase) {\n return false;\n }", "@Override\n public boolean isFull() {\n return this.count() == 5;\n }", "private boolean isTooLarge(String name) {\n Dimension d = faFile.getDimension(name);\n return (d.width > theDialog.getWidth() - 10);\n }", "private boolean validateWindowSize(int index, int windowSize) {\n return (windowSize < candles.length && (index - windowSize >= 0)) ? true : false; \r\n }", "private boolean fitsOnBoard(Anchor anchor, ArrayList<Tile> word){\n //check if word would cause spilling off the edge of the board\n int anchorPos = getAnchorPosition(anchor, word);\n int prefixLength = anchorPos;\n int postfixLength = word.size() - anchorPos - 1 ;\n\n if (anchor.prefixCap >= prefixLength && anchor.postfixCap >= postfixLength){\n return true;\n } else {\n return false;\n }\n }", "public int repeated() {\n this.order();\n int counter = 1;\n int currentCounter = 1;\n for (int i = 0; i < this.size() - 1; i++) {\n if(this.getListaAt(i).x == this.getListaAt(i + 1).x) {\n currentCounter += 1;\n }\n else {\n if (currentCounter > counter) {\n counter = currentCounter;\n }\n currentCounter = 1;\n }\n }\n if (currentCounter > counter) {\n counter = currentCounter;\n }\n return counter;\n }", "public boolean hasWidth() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean isFull()\r\n\t\t{\r\n\t\t\tint count = 0;\r\n\t\t\tData currentData = head;\r\n\t\t\twhile (currentData != null)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tcurrentData = currentData.nextData();\r\n\t\t\t}\r\n\t\t\treturn (count > 2); //if the count is > 2 then it is full\r\n\t\t}", "@Override\r\n\tpublic boolean isfull() {\n\t\t\r\n\t\treturn count == size ;\r\n\t}", "@Override\n\t\t\tprotected boolean removeEldestEntry(final Map.Entry<K, V> eldest) {\n\t\t\t\treturn super.size() > LRUCache.this.cacheSize;\n\t\t\t}", "@Override\n public void add(Integer element) {\n if (this.contains(element) != -1) {\n return;\n }\n // when already in use\n int index = this.getIndex(element);\n if(this.data[index] != null && this.data[index] != this.thumbstone){\n int i = index + 1;\n boolean foundFreePlace = false;\n while(!foundFreePlace && i != index){\n if(this.data[i] == null && this.data[i] == this.thumbstone){\n foundFreePlace = true;\n }else{\n if(i == this.data.length - 1){\n // start at beginning.\n i = 0;\n }else{\n i++;\n }\n }\n }\n if(foundFreePlace){\n this.data[i] = element;\n }else{\n throw new IllegalStateException(\"Data Structre Full\");\n }\n }\n }", "@Override\n public int getRetainedEntries(final boolean valid) {\n if (otherCheckForSingleItem(mem_)) { return 1; }\n final int preLongs = extractPreLongs(mem_);\n final int curCount = (preLongs == 1) ? 0 : extractCurCount(mem_);\n return curCount;\n }", "public void checkBlankSpace() {\n\t\tif (xOffset < 0) {\n\t\t\txOffset = 0;\n\t\t} else if (xOffset > handler.getWorld().getWidth() * Tile.TILEWIDTH - handler.getWidth()) {\n\t\t\txOffset = handler.getWorld().getWidth() * Tile.TILEWIDTH - handler.getWidth();\n\t\t}\n\t\t\n\t\tif (yOffset < 0) {\n\t\t\tyOffset = 0;\n\t\t} else if (yOffset > handler.getWorld().getHeight() * Tile.TILEHEIGHT - handler.getHeight()) {\n\t\t\tyOffset = handler.getWorld().getHeight() * Tile.TILEWIDTH - handler.getHeight();\n\t\t}\n\t}", "private boolean noConflictInRow(int rowIndex, int number) {\n for (int i = 0; i < 9; i++) {\n if (grid[rowIndex][i] == number) {\n return false;\n }\n }\n return true;\n }", "public boolean trim() {\n final int l = arraySize(size, f);\n if (l >= n || size > maxFill(l, f)) return true;\n try {\n rehash(l);\n } catch (Error cantDoIt) {\n return false;\n }\n return true;\n }", "private boolean isFull(){\n return cellSize == Max;\n }", "DuplicateEntryException() {\n super();\n }", "private SAMRecord markDuplicatesAndGetTheNextAvailable() {\n\n // Check if there are any we can flush output buffer\n { // NB: braces to limit the scope of 'record'\n final SAMRecord record = flush();\n if (null != record) return record;\n }\n\n // Check if there are any more records to read in\n if (!backingIterator.hasNext()) { // no more records to read in\n\n // Check if there are any more to mark\n if (toMarkQueue.isEmpty()) {\n // check if there are any that can be outputted\n if (outputBuffer.isEmpty()) {\n return null;\n } // no need to flush; no records in the queue and buffer\n } else {\n // force marking duplicates on the remaining records\n tryPollingTheToMarkQueue(true, null);\n }\n\n /* Since we have no more records to read in, and no more records that need duplicate marking run, we\n update our coordinate to past the end of the reference\n */\n referenceIndex = header.getSequenceDictionary().getSequences().size();\n\n /* Now we recurse, so that we can flush from the outputBuffer until it is empty, then return null when\n * all of the input, queue, and buffer are empty */\n return markDuplicatesAndGetTheNextAvailable();\n }\n\n /* We need to retrieve more records from the input iterator and duplicate mark, until we can return one that\n * has been through duplicate marking.\n */\n while (backingIterator.hasNext()) {\n\n // NB: we could get rid of this if we made nextRecord into a list...\n // NB: we do not actually remove this record from the backing iterator until much later, to help with processing unmapped reads at the EOF\n SAMRecord record = backingIterator.peek(); // peek: used for unmapped reads\n final SamRecordWithOrdinal samRecordWithOrdinal = new SamRecordWithOrdinalAndSetDuplicateReadFlag(record, backingIteratorRecordIndex);\n\n ReadEndsForMateCigar readEnds = null;\n boolean performedChunkAndMarkTheDuplicates = false;\n\n // remove duplicate information\n record.setDuplicateReadFlag(false);\n\n /* Check for pairs that have both ends mapped and missing mate cigar. */\n if (ignoreDueToMissingMateCigar(samRecordWithOrdinal)) {\n continue;\n }\n\n // check for an unmapped read\n if (record.getReadUnmappedFlag()) {\n // unmapped reads at the end of the file!\n if (-1 == record.getReferenceIndex()) {\n // NB: this may call markDuplicatesAndGetTheNextAvailable if this is the first time a EOF unmapped record has been seen\n return nextIfRecordIsUnmappedAtEOF(record);\n } else if (!record.isSecondaryOrSupplementary()) {\n // update metrics\n final DuplicationMetrics metrics = getMetrics(record);\n ++metrics.UNMAPPED_READS;\n }\n // we will check for unmapped reads later so as not to add them to mark queue\n } else {\n // If not already set, this sets the minimum distance to twice the read length, or 100, whichever is larger\n if (-1 == toMarkQueue.getToMarkQueueMinimumDistance()) {\n // use twice the first read's length\n toMarkQueue.setToMarkQueueMinimumDistance(Math.max(2 * record.getReadBases().length, 100));\n }\n\n // build a read end for use in the toMarkQueue\n readEnds = new ReadEndsForMateCigar(header, samRecordWithOrdinal, opticalDuplicateFinder, libraryIdGenerator.getLibraryId(samRecordWithOrdinal.getRecord()));\n\n // check that the minimumDistance was not too small\n checkForMinimumDistanceFailure(readEnds);\n\n /*\n * If we can do some duplicate marking, lets do it!\n * IMPORTANT: this does not flush the to-mark-queue, so the minimum distance needs to be set for us to infer\n * which records will never be supplemented (i.e. are non-duplicate).\n */\n performedChunkAndMarkTheDuplicates = tryPollingTheToMarkQueue(false, readEnds);\n }\n\n // We can now remove the record from the input\n backingIterator.next();\n\n // Add this to the outputBuffer so it can be tracked. It will not be available to emit until it has been through duplicate marking.\n addRecordToTheOutputBuffer(samRecordWithOrdinal);\n backingIteratorRecordIndex++; // Each record is has an index and is emitted in the same order. This helps that.\n\n // We do not consider secondary, supplementary, or unmapped alignments for duplicate marking. We can thus mark that duplicate marking on them has been completed.\n final DuplicationMetrics metrics = getMetrics(record);\n if (record.isSecondaryOrSupplementary() || record.getReadUnmappedFlag()) {\n outputBuffer.setResultState(samRecordWithOrdinal, false);\n if(record.isSecondaryOrSupplementary()){\n ++metrics.SECONDARY_OR_SUPPLEMENTARY_RDS;\n }\n } else {\n // Bring the simple metrics up to date\n if (!record.getReadPairedFlag() || record.getMateUnmappedFlag()) {\n ++metrics.UNPAIRED_READS_EXAMINED;\n } else {\n ++metrics.READ_PAIRS_EXAMINED; // will need to be divided by 2 at the end\n }\n\n // Add the record for duplicate marking, which may in fact cause it to be duplicate marked or stored for later\n toMarkQueue.add(readEnds, outputBuffer, getMetrics(readEnds.getRecord()));\n }\n\n // Check if there are any we can flush, which happens if we just performed duplicate marking\n if (performedChunkAndMarkTheDuplicates) {\n record = flush();\n if (null != record) return record;\n }\n }\n\n // try again, as we may have records we can flush, or we want to see if we are at the EOF\n return markDuplicatesAndGetTheNextAvailable();\n }", "private static boolean collectionHasRepeat(List<Integer> square) {\n\t\tfor(int index = 1; index <= BOUNDARY; index++) {\n\t\t\tif(Collections.frequency(square, index) > 1) return true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean isOverflow() {\n\t\treturn (children.size() >= degree + 1) || (data.size() >= degree);\n\t}", "public static boolean exactlyOneDup(int[] num) {\n\n //create an int called control\n int control = 1;\n \n //create an int called counter\n int counter = 0;\n\n //check to see if there are any duplicates in num []\n for (int i = 0; i < num.length; i++) {\n\n for (int j = control; j < num.length; j++) {\n\n if (num[i] == num[j]) {\n counter += 1;\n\n } //end of if statement\n\n } //end of for loop\n \n control++;\n \n } //end of for loop\n\n if (counter != 1) {\n return false;\n }\n return true;\n \n }", "public boolean isDupe(T element);", "public static void detectDuplicateNumbersM1(int[] numbersToDetect){\n map = new HashMap<Integer,Integer>();\n logger.info(\"hashmap is created\");\n for (int j : numbersToDetect) {\n if (map.get(j) == null) {\n logger.info(j + \" is added map\");\n map.put(j, 1);\n } else {\n logger.info(j + \" detected second time\");\n System.out.println(\"duplicated number: \" + j);\n break;\n }\n }\n }", "static void findDuplicate()\n\t{\n\n\t\tList<String> oList = null;\n\t\tSet<String> oSet = null;\n\t\ttry {\n\t\t\toList = new ArrayList<String>();\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Dog\");\n\t\t\toList.add(\"Eagle\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\tSystem.out.println(oList);\n\t\t\t\n\t\t\toSet = new TreeSet<>();\n\t\t\t\n\t\t\tString s = \"\";\n\t\t\tfor(int i=0;i<oList.size();i++)\n\t\t\t{\n\t\t\t\tif((oSet.add(oList.get(i))==false) && (!s.contains(oList.get(i))))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Duplicate: \"+oList.get(i));\n\t\t\t\t\ts+=oList.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\toList = null;\n\t\t\toSet = null;\n\t\t}\n\t}", "public static void main(String[] args){\n RedBlackTree RBT1= new RedBlackTree<Integer, String>();\n RBT1.insert(7, \"Violet\");\n RBT1.insert(6, \"May\");\n RBT1.insert(5, \"Alexander\");\n RBT1.insert(4, \"Anya\");\n RBT1.insert(3, \"Maven\");\n RBT1.insert(2, \"Susan\");\n RBT1.insert(1, \"Tom\");\n RBT1.print();\n System.out.println(RBT1.getHeight()); //height = 2\n\n //duplicate keys\n RedBlackTree RBT2= new RedBlackTree<Integer, String>();\n RBT2.insert(7, \"Violet\");\n RBT2.insert(7, \"May\");\n RBT2.insert(7, \"Alexander\");\n RBT2.insert(6, \"Anya\");\n RBT2.insert(6, \"Maven\");\n RBT2.insert(6, \"Susan\");\n RBT2.insert(1, \"Tom\");\n RBT2.print();\n System.out.println(RBT2.getHeight()); //height = 1\n }", "public boolean hasWidth() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "protected boolean getExceed(float currentWidth, DefaultRenderer renderer, int right, int width) {\r\n boolean exceed = currentWidth > right;\r\n if (isVertical(renderer)) {\r\n exceed = currentWidth > width;\r\n }\r\n return exceed;\r\n }", "private void reallocateIfOverfilled() {\r\n\t\tif ((size * 1.0 / table.length) > MAX_FULLNESS_PERCENTAGE) {\r\n\t\t\treallocateArray();\r\n\t\t}\r\n\t}", "@Override\r\n\t\tpublic boolean hasNext() {\n\t\t\treturn itemsViewed < HashMap.this.size();\r\n\t\t}", "@Test\n\tpublic void addSameValueTwice() {\n\t\tXSet xset = new XSet(3);\n\t\txset.add(1);\n\t\txset.add(1);\n\t\tassertTrue(xset.getSize() == 1);\n\t}", "@Override\n\t\t\t\t\tprotected int sizeOf(BareJID key, Bitmap bitmap) {\n\t\t\t\t\t\treturn bitmap == mPlaceHolderBitmap ? 0 : (bitmap.getRowBytes() * bitmap.getHeight());\n\t\t\t\t\t}", "boolean checkNoDuplicateFields() {\n\t if (duplicateNames == null | duplicateNames.isEmpty())\n\t return true;\n\t Iterator iter = duplicateNames.iterator();\n\t String names = \"\";\n\t while (iter.hasNext()) {\n\t names = names + iter.next(); \n\t }\n\t cat.error(loc,DUPLICATE_COLUMN_NAMES,new Object[] {names});\n\t return false;\n\t }", "private int calculateConsecutiveDuplicateMutationsThreshold(){\n \tint combinedSiteLength = region.getCombinedSitesLength();\n \tif(combinedSiteLength <= 10){\n \t\treturn 100; // around the order of magnitude of 1,000,000 if we assume each of the 10 positions could have any of the 4 nucleotides\n \t}else{\n \t\tint consecFactor = 400000 / (combinedSiteLength * combinedSiteLength * combinedSiteLength * iContext.strategy.nucleotides.length);\n \t\treturn Math.max(2, consecFactor);\n \t}\n }", "@Override\r\n\tpublic int dupMovieChk(Search search) throws Exception {\n\t\treturn 0;\r\n\t}", "boolean insert(long x){\n int i=hash(x);\n //if x already present then dont add\n for (Node j = ht[i]; j != null; j=j.next) {\n if(j.data == x){\n return false;\n }\n }\n Node node = new Node(x);\n node.next = ht[i];\n ht[i] = node;\n return true;\n }", "private boolean isDoubleMatch(AnnotatedPluginDocument destination, AnnotatedPluginDocument insert) throws DocumentOperationException {\n List<SequenceAnnotation> destinationAnnotations = getFlankingOverhangs(destination);\n List<SequenceAnnotation> insertAnnotations = getFlankingOverhangs(insert);\n //Both lists will have a size of 2\n LinkedList<SequenceAnnotation> matchingOverhangs = new LinkedList<SequenceAnnotation>();\n for (SequenceAnnotation dAnno : destinationAnnotations) {\n for (SequenceAnnotation iAnno : insertAnnotations) {\n if (iAnno.getQualifierValue(\"sequence\").equalsIgnoreCase(dAnno.getQualifierValue(\"sequence\"))\n && iAnno.getInterval().getDirection() != dAnno.getInterval().getDirection()) {\n matchingOverhangs.add(iAnno);\n matchingOverhangs.add(dAnno);\n }\n }\n }\n //If there is a double match, all four flanking annotations should have been added to the list.\n if (matchingOverhangs.containsAll(destinationAnnotations) && matchingOverhangs.containsAll(insertAnnotations)) {\n return true;\n }\n return false;\n }" ]
[ "0.5627829", "0.5563654", "0.5563654", "0.5563654", "0.5423416", "0.54012316", "0.53828716", "0.53736985", "0.5370324", "0.5356995", "0.5322876", "0.53048307", "0.52965814", "0.5267565", "0.5233001", "0.52117383", "0.51820254", "0.5158915", "0.5151776", "0.5139773", "0.5136757", "0.5132409", "0.51271254", "0.5122107", "0.5120865", "0.51181424", "0.51181424", "0.50936466", "0.50818336", "0.5073128", "0.5066941", "0.50305784", "0.49965757", "0.49888837", "0.4984725", "0.49807662", "0.4975298", "0.49695247", "0.49669224", "0.49648112", "0.4960369", "0.49598914", "0.49541658", "0.49483576", "0.49370545", "0.49301237", "0.49292186", "0.49220237", "0.49216107", "0.49204797", "0.49186456", "0.4914484", "0.4914484", "0.49116623", "0.49025002", "0.4895358", "0.4889422", "0.48816228", "0.4875035", "0.48616353", "0.4860949", "0.48600417", "0.4858977", "0.48524678", "0.48495004", "0.48445982", "0.48377985", "0.48273444", "0.48267558", "0.4826686", "0.48239517", "0.4799752", "0.47993374", "0.47936767", "0.47929463", "0.47923678", "0.4786662", "0.47758454", "0.4775731", "0.47696975", "0.4759214", "0.47588015", "0.4758415", "0.4754644", "0.47545478", "0.4751045", "0.47464204", "0.4743921", "0.47389793", "0.4736829", "0.47362274", "0.4730318", "0.4726615", "0.47265103", "0.4721985", "0.4719246", "0.4716805", "0.47155413", "0.47124088", "0.47039282", "0.46924406" ]
0.0
-1
this li1ne number is 0 base.
private int getLineNumber(@NonNull String contents, int offset) { String preContents = contents.substring(0, offset); String remContents = preContents.replaceAll("\n", ""); return preContents.length() - remContents.length(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getNumberBase(String n1){\n return Integer.parseUnsignedInt(n1, base);\n }", "public void changeToBaseOne() {\r\n\t\tthis.numberBase = 1;\r\n\t}", "public String negBase2(int n) throws Exception {\r\n\t\t String binaryStr=\"\";\r\n\r\n\t\t int minValue = -256;//allowed min decimal\r\n\t\t// donot allow positive numbers and make sure the \r\n\t\t// input number is > allowed min value for 8 bit representation\r\n\t\t if (n>0 || n < minValue) \r\n\t\t\t throw new Exception (\"the input number exceeds the allowable limits\");\r\n\t\t\t \r\n\t\t binaryStr = Integer.toBinaryString((-1)*n);\r\n\t \t\r\n\t \tbinaryStr= String.format(\"%8s\", binaryStr).replace(' ', '0');\r\n\t \tbinaryStr = get2sComplement(binaryStr);\r\n\t\t return binaryStr;\r\n\t }", "@Override\n\tpublic int getNumericCode() {\n\t\treturn 0;\n\t}", "public int mo27483b() {\n return 0;\n }", "private String getStringBase(int n1){\n return Integer.toString(n1, base).toUpperCase();\n }", "public int baseZeroValue() {\n return this.value - 1;\n }", "@Override\r\n\tprotected Integer deriveLower() {\r\n\t return 0;\r\n\t}", "private int nn(int x)\n {\n return x > 0 ? 1 : 0;\n }", "@Override\r\n\tprotected Integer zero() {\n\t\treturn 0;\r\n\t}", "private String feelZero(Integer i){\n if( i < 10 ){\n return \"0\"+i;\n }else{\n return Integer.toString(i);\n }\n }", "private\tNum(int num) { value = num; }", "public A210062(final int num) {\n mN = -1;\n LOG = CR.valueOf(num).log().divide(CR.TEN.log());\n }", "public BinaryNumber(int length){\n\t\tdata = new int[length];\n\t\tfor (int i=0; i<length; i++){\n\t\t\tdata[i] = 0;\n\t\t}\n\t}", "public Binary() { \n\t_decNum = 0;\n\t_binNum = \"0\";\n }", "public BinaryNumber(int length) {\n\t\tdata = new int[length];\n\t\tfor(int i = 0;i < length;i++) {\n\t\t\tdata[i] = 0;\n\t\t}\n\t}", "static int addZero(int num, int n) {\n\t\t\t\n\t\t\treturn 0;\n\t\t}", "protected void setNumbertoZero() {\n\t\tnumber = 0;\n\t}", "@Override\n public void init()\n {\n out = mul(num(100.0/Math.log10(length)), log10(div(sum(truerange(), length), diff(highest(length), lowest(length)))));\n }", "long mo107678c(Integer num);", "@Field(offset=23, length=1, paddingChar='0', align=Align.RIGHT)\n\tpublic int getZeros1() {\n\t\treturn 0;\n\t}", "@Override\n public int getDecimalDigits() { return 0; }", "public int mo12720a() {\n return 0;\n }", "public int mo3360e() {\n return 0;\n }", "private int getLowTenBitNumber(int num) {\n return num & 1023;\n }", "public int mo9232aG() {\n return 0;\n }", "public int getNumericBase() {\n return _base;\n }", "public static int decimalToAnyBase(int n, int b){\n int val = 0;\n\n int p = 1;\n while(n > 0){\n int d = n % b;\n n = n / b;\n val += p * d;\n p = p * 10;\n }\n\n return val;\n}", "public String baseConversion(int num, int base) {\n\n if (base > 16 || base < 2)\n return null;\n\n StringBuilder sb = new StringBuilder();\n char[] hexaMapping = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};\n\n int numPositive = (num < 0)? -num: num;\n while (numPositive > 0) {\n sb.append(hexaMapping[numPositive % base]);\n numPositive /=base;\n }\n\n return sb.append((num < 0)? \"-\" : \"\").reverse().toString();\n }", "public void O000000o() {\r\n super.O000000o();\r\n this.O0000o0 = false;\r\n }", "@Override\r\n\tpublic double alapterulet() {\n\t\treturn 0;\r\n\t}", "public final int mo1958b() {\n return 0;\n }", "private static String convertP(int value)\n {\n String output = Integer.toBinaryString(value);\n\n for(int i = output.length(); i < 6; i++) // pad zeros\n output = \"0\" + output;\n\n return output;\n }", "private static int invertirNumero(int num) {\n\t\tint cifra, inverso = 0;\n\t\twhile (num > 0) {\n\t\t\tcifra = num % 10;\n\t\t\tinverso = cifra + inverso * 10;\n\t\t\tnum /= 10;\n\t\t}\n\t\treturn inverso;\n\t}", "String getZeroString()\n {\n return \"\"+0;\n }", "void mo107677b(Integer num);", "java.lang.String getNumb();", "private static int trailzerofun(int num) {\n\t\tint count=0;\n\t\tif(num<0)\n\t\t\treturn -1;\n\t\tfor(int i=5;num/i>=1;i*=5)\n\t\t{\n\t\t\tcount+=num/i;\n\t\t}\n\t\treturn count;\n\t}", "private static int getNumber() {\n LOG.info(\"Generating Value\");\n return 1 / 0;\n }", "private static long convertNumber(String text, int base)\r\n\t{\r\n\t\tlong result = 0;\r\n\t\ttext = text.toLowerCase();\r\n\t\tfor (int i = 2; i < text.length(); i++)\r\n\t\t{\r\n\t\t\tint d;\r\n\t\t\tchar c = text.charAt(i);\r\n\t\t\tif (c > '9')\r\n\t\t\t\td = (int) (c - 'a') + 10;\r\n\t\t\telse\r\n\t\t\t\td = (int) (c - '0');\r\n\t\t\tresult = (result * base) + d;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public Binary suma1(){\n\n java.lang.String tosum1to;\n if (!this.toString().equals(\"0\")){\n if (java.lang.String.valueOf(this.getValue().charAt(0)).equals(\"1\") && java.lang.String.valueOf(this.getValue().charAt(1)).equals(\"1\")){\n tosum1to= this.toString().substring(1);\n }\n else {\n tosum1to= this.toString();\n }\n }\n else {\n tosum1to= this.toString();\n }\n int sumlength= tosum1to.length();\n java.lang.String retstring= \"\";\n int i=1;\n for (; i<= sumlength; i++){\n if (java.lang.String.valueOf(tosum1to.charAt(sumlength - i)).equals(\"1\")) {\n retstring+= \"0\";\n }\n else {\n retstring+= \"1\";\n i++;\n break;\n }\n }\n for (; i<= sumlength; i++){\n retstring+= java.lang.String.valueOf(tosum1to.charAt(sumlength-i));\n }\n if (this.sign().equals(\"0\") && java.lang.String.valueOf(retstring.charAt(sumlength-1)).equals(\"1\")) {\n retstring+= \"0\";\n }\n return new Binary(reverse(retstring));\n }", "public int mo3384v() {\n return 0;\n }", "public int getBaseNumber() {\r\n\t\treturn baseNumber;\r\n\t}", "public void setZero() {\n\t\tset((byte) (get() | (1 << 7)));\n\t}", "public static int BIASED_ONE_OR_ZERO()\n\t{\n\t}", "public void setNumber(int n) {\n if(n<0){\n throw new ArithmeticException(\"Negative Score is not allowed\");\n }else{\n int shift = 0;\n while (n > 0) {\n int d = n / 10;\n int k = n - d * 10;\n n = d;\n background.add(new Digit(k, 30, 360 - shift, 25));\n shift += 30;\n }\n }\n }", "public HaltonSequence(final int[] base) {\n\t\tfor(int i=0; i<base.length; i++) {\n\t\t\tif(base[i] <= 1) {\n\t\t\t\tthrow new IllegalArgumentException(\"base needs to be larger than 1\");\n\t\t\t}\n\t\t}\n\n\t\tthis.base = base;\n\t}", "public Number(int n) \n {\n nn = n; // initailize with the inputed value\n }", "private static String printBinary(double num){\n\t\tif(num >= 1 || num <= 0)\n\t\t\treturn \"ERROR\";\n\t\t\n\t\tStringBuilder binary = new StringBuilder();\n\t\tbinary.append(\"0.\");\n\t\tdouble r = 0.5;\n\t\twhile(num > 0){\n\t\t\tif(binary.length() >= 32)\n\t\t\t\treturn \"ERROR\";\n\t\t\t\n\t\t\tif(num >= r){\n\t\t\t\tbinary.append(1);\n\t\t\t\tnum -= r;\n\t\t\t}else\n\t\t\t\tbinary.append(0);\n\t\t\t\n\t\t\tr /= 2;\n\t\t}\n\t\treturn binary.toString();\n\t}", "public void mo133108l() {\n mo133081a(1000);\n }", "private static String zeroPaddedBitString(int value) {\n String bitString = Integer.toBinaryString(value);\n return String.format(\"%32s\", bitString).replace(\" \", \"0\");\n }", "@Test(timeout = 4000)\n public void test033() throws Throwable {\n Range range0 = Range.ofLength(127L);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n range0.complementFrom(linkedList0);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.ZERO_BASED;\n String string0 = range0.toString(range_CoordinateSystem0);\n assertEquals(\"[ 0 .. 125 ]/0B\", string0);\n }", "public void zero();", "public java.lang.String getZEXT_NUM1()\n {\n \n return __ZEXT_NUM1;\n }", "private static int decimalToBase(int base, int num) {\n\t\tint pow = 1, rem = 0, i, res = 0;\n\t\tfor (i = num; i > 0; i = i /base) {\n\t\t\trem = i % base;\n\t\t\tres = res + pow*rem;\n\t\t\tpow = pow * 10;\n\t\t}\n\t\treturn res;\n\t}", "@Override\n\tpublic String convert2Binary(int num) {\n\t\treturn null;\n\t}", "static long flippingBits(long n) {\n\n String strBinary = String.format(\"%32s\", Long.toBinaryString(n)).replace(' ', '0');\n String strBinaryFlip = \"\";\n\n for (int i = 0; i < strBinary.length(); i++) {\n if (strBinary.charAt(i) == '0') {\n strBinaryFlip = strBinaryFlip + '1';\n } else {\n strBinaryFlip = strBinaryFlip + '0';\n }\n }\n\n String result = String.format(\"%32s\", strBinaryFlip).replace(' ', '0');\n long base10 = parseLong(result,2);\n return base10;\n }", "int minverse(int z)\n {\n int to,t1;\n int q,y;\n if(z<=1)\n return z;\n t1=0x10001/z;\n y=0x10001%z;\n if(y==1)\n return (0xffff&(1-t1));\n to=1;\n do\n {\n q=z/y;\n z=z%y;\n to+=q*t1;\n if(z==1)\n return to;\n q=y/z;\n y=y%z;\n t1+=q*to;\n }while(y!=1);\n return (0xffff&(1-t1));\n }", "public int mo3356c() {\n return 0;\n }", "public nonzeronatnum(Inatnum natnum) {\n n = natnum.getVal() + 1;\n prev=natnum;\n }", "int mo1505l();", "int ainverse(int z)\n {\n return (65536-z);\n }", "protected final int calculateInterst1(int pr){\n\t\t return pr*10*1/100;\n\t }", "@Override\n public double numValue(int numId) {\n return 0;\n }", "public Happy_Number()\r\n\t{\r\n\t\tnumberHolder = new int[20];\r\n\t\tfor(int ii = 0; ii < numberHolder.length; ii++)\r\n\t\t{\r\n\t\t\tnumberHolder[ii] = 0;\r\n\t\t}\r\n\t}", "private final int initializeInt() {\n\t\treturn 0;\r\n\t}", "public void resetZero() {\n\t\tset((byte) (get() & ~(1 << 7)));\n\t}", "public boolean isZero() {return false;}", "String getZero_or_more();", "public static String addLeadingZeros(Number numeric,int nbLength)\n {\n Double theNumerDbl = toDoubleObj(numeric);\n Integer theNumerInt = theNumerDbl.intValue();\n String thePattern = \"%0\"+nbLength+\"d\";\n return String.format(thePattern, theNumerInt);\n }", "public int pid_0101(String str) \n {\n \n int num_of_TC; \n char ON_OFF; \n String first_byte;\n first_byte=new String(str.substring(0,1));\n MathLib operations= new MathLib(); \n ON_OFF=operations.HexToBin(first_byte).charAt(0);//Bit 0\n if (ON_OFF=='1')//Then the lamp is ON\n {\n double d = Double.valueOf(operations.calculatorXF(str,\"AA\",\"A-128\"));\n num_of_TC= (int)d;\n if (num_of_TC<0) num_of_TC=0;\n }\n else \n num_of_TC=0; \n \n return num_of_TC;\n }", "Integer getNLNDreu();", "public A034318() {\n this(-1, 0, 13, 0, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 0);\n }", "public int liczbaelnastosie() {\n\t\treturn 0;\n\t}", "private static Symbol number(String text, int base)\r\n\t{\r\n\t\tint linepos = line_;\r\n\t\tint charpos = char_;\r\n\t\tint colpos = col_;\r\n\t\tscan(text);\r\n\t\tToken token = new Token(fname, text, linepos, charpos, colpos);\r\n\t\ttoken.number = convertNumber(text, base);\r\n\t\treturn new Symbol(sym.NUMBER, linepos, colpos, token);\r\n\t}", "public long mo9228aC() {\n return 0;\n }", "public Object getBaseValue() {\r\n return Long.valueOf(0);\r\n }", "private static String create50DigitString(){\n StringBuilder sb = new StringBuilder(\"1\");\n for(int i = 1; i < 50; i++){\n sb.append(\"0\");\n }\n return sb.toString();\n }", "public static String convertToBase(int num, int base2) {\n\n\t\tString str = \"\";\n\t\tif (num == 0) return str;\n\n\t\tstr = convertToBase(num/base2, base2);\n\t\treturn str + (char)((num % base2 >= 10) ? 'A' + num % base2 - 10 : '0' + num % base2);\n\t}", "private static Integer convertToBase(Integer number, Integer base) {\n int lastDigit = number % 10;\n if (lastDigit < base) {\n return number;\n } else {\n String numStr = number.toString();\n int diff = 10 - base;\n Integer currentNumber = number;\n // for base 3, add 7*(10 ^ reverse index) to any 3 to \"roll\" that digit spot over to base 3\n // e.g.:\n // index 4, number = 12223 -> add 7 => 12230\n // index 3, number = 12230 -> add 70 => 12300\n // index 2, number = 12300 -> add 700 => 13000\n // index 1, number = 13000 -> add 7000 => 20000\n // index 0, number = 20000 -> digit at 0 is less than 3, so we're done\n for(int position = numStr.length() - 1; position >= 0; position--) {\n if(numStr.charAt(position) - 48 < base) {\n return currentNumber;\n } else {\n currentNumber += diff;\n diff *= 10;\n numStr = currentNumber.toString();\n }\n }\n return currentNumber;\n }\n }", "@Test(timeout = 4000)\n public void test077() throws Throwable {\n byte[] byteArray0 = new byte[1];\n ValueLobDb valueLobDb0 = ValueLobDb.createSmallLob(1459, byteArray0, (byte)0);\n Reader reader0 = valueLobDb0.getReader();\n StreamTokenizer streamTokenizer0 = new StreamTokenizer(reader0);\n streamTokenizer0.nval = 32768.0;\n String string0 = SQLUtil.renderNumber(streamTokenizer0);\n assertEquals(\"32768\", string0);\n }", "private int toPower(int base, int exponent)\n\t {\n\t \t if(exponent > 0)\n\t {\n\t return toPower(base, exponent - 1) * base;\n\t }\n\t return 1;\n\t }", "public void setBase(Integer base);", "NullSt (int ln) { super (ln); }", "String getZero_or_one();", "static String printBinary(double num) {\n // Check Number is Between 0 to 1 or Not\n if (num >= 1 || num <= 0)\n return \"ERROR\";\n\n StringBuilder binary = new StringBuilder();\n System.out.println(\"binary:\"+binary.toString());\n binary.append(\".\");\n\n while (num > 0) {\n\t\t\t/* Setting a limit on length: 32 characters,\n\t\t\tIf the number cannot be represented\n\t\t\taccurately in binary with at most 32\n\t\t\tcharacter */\n if (binary.length() >= 32)\n return \"ERROR\";\n\n // Multiply by 2 in num to check it 1 or 0\n double r = num * 2;\n if (r >= 1) {\n binary.append(1);\n num = r - 1;\n } else {\n binary.append(0);\n num = r;\n\n\n\n }\n\n }\n return binary.toString();\n }", "public numero(char s, int length)\n {\n this.sign = s;\n this.raw_value = new char[length];\n for(int i = 0; i < this.raw_value.length; i++) this.raw_value[i] = '0';\n }", "private int m10275g(int i) {\r\n return (i >>> 1) ^ (-(i & 1));\r\n }", "java.math.BigInteger getNcbieaa();", "public int mo34973b() {\n return 48;\n }", "public static numero getZero()\n {\n return new numero(ZERO);\n }", "public static String NRZi(String input) {\n ArrayList<String> out = new ArrayList<>();\n out.add(\"UP\");\n for (int i = 0; i < input.length(); i++) {\n if ((Character.toString(input.charAt(i))).equals(\"0\")) {\n String before = out.get(out.size() - 1);\n out.add(before);\n } else {\n String before = out.get(out.size() - 1);\n out.add(inverse(before));\n }\n }\n out.remove(out.size()-1);\n String output = ArraytoString(out);\n return output;\n }", "public BinaryNumber(String str) {\n\t\tint length = str.length();\n\t\tdata = new int[length];\n\t\tfor(int i = 0;i < str.length();i++) {\n\t\t\tint number = Character.getNumericValue(str.charAt(i));\n\t\t\tif (number == 0||number == 1) {\n\t\t\t\tdata[i] = number;\n\t\t\t}\n\t\t}\n\t}", "@Override\n public int value() {\n return 0;\n }", "private String zxt (long inp, int length) {\n String result = Long.toString(inp);\n int dist = (length - result.length());\n for (int i = 0; i < dist; i++) {\n result = \"0\" + result;\n }\n return result;\n }", "@Override\n protected int func_150123_b(int p_150123_1_)\n {\n return 60;\n }", "private String MiniOneConversion() {\n int reading = ((raw[22] & 0xF0) >> 4) + ((raw[23] & 0x3F) << 4);\n\n Map<String, BigDecimal> variables = new HashMap<String, BigDecimal>();\n variables.put(\"x\", new BigDecimal(reading));\n BigDecimal result = m1Conv.eval(variables);\n return result.setScale(3, RoundingMode.UP) + \"\";\n }", "public Float getT1B111i() {\r\n return t1B111i;\r\n }", "public void setFirstSSN(float num1){\n\t\t FirstSSN = ((num1>0 && num1<=999)?num1:0);\n\t\t }", "protected float l()\r\n/* 72: */ {\r\n/* 73: 84 */ return 0.0F;\r\n/* 74: */ }", "@Override\n public int intValue(int numId) {\n return 0;\n }" ]
[ "0.6643646", "0.6513608", "0.6176411", "0.61259305", "0.5929572", "0.58271587", "0.5821877", "0.580789", "0.57892466", "0.5766924", "0.57455724", "0.57062405", "0.56925964", "0.5682736", "0.5681638", "0.56375444", "0.5636765", "0.5636586", "0.5630927", "0.5622785", "0.5604633", "0.5596846", "0.5596264", "0.55891734", "0.55888677", "0.55767095", "0.5552761", "0.55527157", "0.5544595", "0.5538359", "0.55372185", "0.5532382", "0.55234385", "0.55227816", "0.55166304", "0.55038714", "0.5491473", "0.5485879", "0.5477417", "0.54568493", "0.5453179", "0.5443568", "0.5429993", "0.5429979", "0.54289806", "0.5420738", "0.5416118", "0.5392952", "0.53895897", "0.5388923", "0.5382127", "0.5381516", "0.5375799", "0.5372872", "0.53649765", "0.53621364", "0.5358157", "0.5349298", "0.53488934", "0.53478014", "0.5344355", "0.53341854", "0.5334164", "0.5332875", "0.53204846", "0.5317391", "0.5309656", "0.53079516", "0.5306877", "0.5301621", "0.53005606", "0.52915037", "0.5289929", "0.5287685", "0.5284859", "0.52820104", "0.5279187", "0.52786773", "0.52746135", "0.5269623", "0.52666223", "0.5258577", "0.52574867", "0.52538216", "0.52506876", "0.52465546", "0.52423364", "0.52398545", "0.5239791", "0.52375543", "0.5234725", "0.52330965", "0.52292764", "0.52131027", "0.52058786", "0.519858", "0.5198183", "0.5197829", "0.51974356", "0.5197401", "0.51935524" ]
0.0
-1
this column number is 0 base.
private int getColumnNumber(@NonNull String contents, int offset) { String preContents = contents.substring(0, offset); String[] preLines = preContents.split("\n"); int lastIndex = preLines.length -1; return preContents.endsWith("\n") ? 0 : preLines[lastIndex].length(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getIntialSortedColumn()\n { \n return 0; \n }", "@Override\n\tpublic int getNumColumns() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int getNumericCode() {\n\t\treturn 0;\n\t}", "public Column(int num)\n {\n colNum = num;\n }", "private int getColumn() {\n return binaryPartition(column);\n }", "@Override\r\n\tprotected Integer zero() {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic int getColumnDisplaySize(int arg0) throws SQLException {\n\t\treturn 0;\n\t}", "public int getColumnIndex() {\n return 57;\n }", "public void forzerocount() {\r\n val = new BigDecimal[zerocntretobj.getRowCount()];\r\n for (int cnt = 0; cnt < zerocntretobj.getRowCount(); cnt++) {\r\n int zerocountct = 0;\r\n BigDecimal bdcross = null;\r\n int mcnt = Qrycolumns.size();\r\n int n = 0;\r\n for (int i = 0; i < mcnt; i++) {\r\n zerocountct = 0;\r\n\r\n for (int j = n; j < zerocntretobj.getColumnCount(); j = j + mcnt) {\r\n\r\n Object Obj = zerocntretobj.getFieldValue(cnt, j);\r\n\r\n if (zerocntretobj.columnTypes[j] != null) {\r\n if (zerocntretobj.columnTypesInt[j] == Types.BIGINT\r\n || zerocntretobj.columnTypesInt[j] == Types.DECIMAL || zerocntretobj.columnTypesInt[j] == Types.DOUBLE\r\n || zerocntretobj.columnTypesInt[j] == Types.FLOAT || zerocntretobj.columnTypesInt[j] == Types.INTEGER\r\n || zerocntretobj.columnTypesInt[j] == Types.NUMERIC || zerocntretobj.columnTypesInt[j] == Types.REAL\r\n || zerocntretobj.columnTypesInt[j] == Types.SMALLINT || zerocntretobj.columnTypesInt[j] == Types.TINYINT\r\n || zerocntretobj.columnTypes[j].equalsIgnoreCase(\"NUMBER\")) {\r\n\r\n BigDecimal bdecimal = null;\r\n\r\n if (Obj != null) {\r\n bdecimal = zerocntretobj.getFieldValueBigDecimal(cnt, j);\r\n BigDecimal bd = new BigDecimal(\"0\");\r\n if (bdecimal == null || bdecimal.compareTo(bd) == 0) {\r\n zerocountct = zerocountct + 1;\r\n bdcross = new BigDecimal(zerocountct);\r\n\r\n }\r\n }\r\n }\r\n }\r\n }\r\n n = n + 1;\r\n zerocntmsr.add(zerocountct);\r\n }\r\n\r\n }\r\n }", "private int getColumn(int number) {\n return number % 9;\n }", "@Field(offset=23, length=1, paddingChar='0', align=Align.RIGHT)\n\tpublic int getZeros1() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int getColumnCount() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int getColumnCount() {\n\t\treturn 0;\n\t}", "@Override\n public int getDecimalDigits() { return 0; }", "public int baseZeroValue() {\n return this.value - 1;\n }", "Column baseColumn();", "@Override\n public double numValue(int numId) {\n return 0;\n }", "@Override\n public int value() {\n return 0;\n }", "public int mo27483b() {\n return 0;\n }", "@Override\r\n\tpublic void updateNbCol() {\r\n\t\treturn;\r\n\t}", "public int getRealColIndex() {\n return realColIndex;\n }", "@Override\n public int intValue(int numId) {\n return 0;\n }", "public int getCol() { return _col; }", "@Override\n\tprotected String getColumn()\n\t{\n\t\treturn null;\n\t}", "public void setCol(int value) {\n this.col = value;\n }", "protected String getDefaultColumnName(int col)\r\n {\n return \"\";\r\n }", "public int getColumnNumber() {\n return column;\n }", "private int getNIdx() {\n return this.colStartOffset + 7;\n }", "public int col() {\r\n return col;\r\n }", "private int getColumn( int position ) {\n if ( columns == 1 ) {\n return 0;\n }\n //Log.d(TAG, \"getColumn returning some shit: \" + position + \" % \" + columns + \" = \" + (position % columns));\n return position % columns;\n }", "int getCol();", "public int getNumeroColis() {\r\n\t\treturn numeroColis;\r\n\t}", "protected int getCol() {\r\n\t\treturn this.col;\r\n\t}", "public int getBeginColumnNumber() {\n return this.beginColumn;\n }", "public int getColumnDisplaySize(int column) throws SQLException {\n\t\t\treturn 0;\n\t\t}", "@Override\n\tpublic String getColumnName(int arg0) {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getColumnName(int arg0) {\n\t\treturn null;\n\t}", "@Override\n public char getTypeCode() {\n return '0';\n }", "public int mo12720a() {\n return 0;\n }", "private int getCharacterColumnNumber(char character) { \t\n if(Character.isUpperCase(character))\n return 1;\n else if(Character.isLowerCase(character))\n return 2;\n else if(Character.isDigit(character))\n return 3;\n else if(Character.isWhitespace(character))\n return 0;\n else if (this.columnHashTable.get(character) != null)\n return this.columnHashTable.get(character);\n else\n return 24;\t\n }", "public FormatInteger zeroFill(){\n fillCharacter = ZERO_CHAR;\n return this;\n }", "@Override\r\n\tpublic double alapterulet() {\n\t\treturn 0;\r\n\t}", "public int getCol(){\r\n\t\treturn this.column;\r\n\t}", "public abstract int getNumColumns();", "public int getCol() {\n return this.col; \n }", "public int getColumn()\t \t\t{ return column; \t}", "@Override\n\tpublic int getPrecision(int arg0) throws SQLException {\n\t\treturn 0;\n\t}", "public int getNcol(){\r\n \treturn this.ncol;\r\n \t}", "public int getMaxCol() {\n return maxCol;\n }", "public abstract int getColumn();", "public int getCol() {\r\n return this.col;\r\n }", "public int getColumn() {\r\n\t\treturn slot % 9;\r\n\t}", "public int getMinCol() {\n return minCol;\n }", "public OutOfRangeDisplayColumn(ColumnInfo numberColumn)\r\n {\r\n this(numberColumn, null);\r\n }", "public int getColumn()\n {\n return col;\n }", "public int col() {\r\n\t\treturn col;\r\n\t}", "public void setCol(int c) {\n\t\tthis.col = c;\n\t}", "protected void setNumbertoZero() {\n\t\tnumber = 0;\n\t}", "public int getColumn() { \n\t// * JFlex starts in zero\n\treturn yycolumn+1;\n}", "public int getNumCol() {\n\t\treturn dc.size();\n\t}", "int getColumn();", "public long column_mask(int col) {\r\n return (((long)1 << height)-1) << col*(height+1);\r\n }", "public int getCol() {\n return col;\n }", "@Override\r\n public int getCol() {\r\n return this.col;\r\n }", "public int mo3356c() {\n return 0;\n }", "public int mo3360e() {\n return 0;\n }", "public int mo9232aG() {\n return 0;\n }", "public int getColumn() { return cc; }", "public int mo3384v() {\n return 0;\n }", "int totalColumns(){\n return column;\n }", "public long mo9228aC() {\n return 0;\n }", "public int getMinColumn();", "public int maxC()\r\n {\r\n return metro.numberOfColumns - 1;\r\n }", "public int getCountCol() {\n\treturn countCol;\n}", "public boolean isZero() {return false;}", "public int mo34973b() {\n return 48;\n }", "public void addRawDataColNumber (int colnum){\n raw_data_column_numbers.add(colnum);\n }", "static byte getGoalZeroIdx() {\n return GOAL_ZERO_INDEX;\n }", "public void setZero() {\n\t\tset((byte) (get() | (1 << 7)));\n\t}", "public int[] countColumnZeroes()\n\t{\n\t\tint[] zeros = new int[n];\n\t\tfor(int j=0;j<n;j++)\n\t\t{\n\t\t\tzeros[j]=0;\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t{\n\t\t\t\tif(cost[i][j]==0)\n\t\t\t\t{\n\t\t\t\t\tzeros[j]++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn zeros;\n\t}", "public int getBaseTableLength() {\n return mem.getChar(4);\n }", "public int getCol()\n\t{\n\t\treturn col;\n\t}", "public int getCol()\n\t{\n\t\treturn col;\n\t}", "public void zero() {\n fill(0);\n }", "public int getColumnCount() {\n/* 2881 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public int getNbColumn()\n\t{\n\t\treturn this.nbColumn;\n\t}", "public NumberColumnStringConverter() {\n super();\n DecimalFormatSymbols symbols = df.getDecimalFormatSymbols();\n patternBase = \"0\" + symbols.getDecimalSeparator() + \"0\";\n df.applyPattern(patternBase);\n }", "public ZeroCountDataWriter() {\n\t\tsuper(DataWriterType.ZEROCNTType);\n\t}", "public abstract Number getNumber(int columnIndex);", "private int indiceColMax(String tabla[][]){\n int indice=1;\n float aux=Float.parseFloat(tabla[0][1]);\n for (int j = 1; j <= nVariables; j++) {\n if(Float.parseFloat(tabla[0][j])<0 && Float.parseFloat(tabla[0][j])<aux){\n aux=Float.parseFloat(tabla[0][j]);\n indice=j;\n }\n }\n return indice;\n }", "private int indiceColMin(String tabla[][]){\n int indice=1;\n float aux=-10000;\n for (int j = 1; j <= nVariables; j++) {\n if(Float.parseFloat(tabla[0][j])<0 && Float.parseFloat(tabla[0][j])>aux ){\n aux=Float.parseFloat(tabla[0][j]);\n indice=j;\n }\n }\n return indice;\n }", "@Test(timeout = 4000)\n public void test115() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n DBDataType dBDataType0 = DBDataType.getInstance((-3888), \"z+)yoxC0\");\n Integer integer0 = new Integer((-3888));\n DefaultDBColumn defaultDBColumn0 = new DefaultDBColumn(\"z+)yoxC0\", defaultDBTable0, dBDataType0, integer0);\n String string0 = SQLUtil.renderColumn(defaultDBColumn0);\n assertEquals(\"z+)yoxC0 Z+)YOXC0(-3888) NULL\", string0);\n }", "@Override\n public double getValue() {\n return 0;\n }", "int cubeCol() {\n return c; \n }", "public int ZERO() {\n return getInt(setting.ZERO);\n }", "private int toColChar(int column)\n\t{\n\t\tint theCol;\n\t\tswitch (column)\n\t\t{\n\t\tcase 0: theCol = 1; break;\n\t\tcase 1: theCol = 2; break;\n\t\tcase 2: theCol = 3; break;\n\t\tdefault: theCol = -1;\n\t\t}\n\t\t\n\t\treturn theCol;\n\t}", "public int getColumnNumber()\n {\n return parser.getColumnNumber();\n }", "public int getMaxColumn();", "public int getNumColumns() { return columns.length; }", "public int getOrigCol() {\n return origCol;\n }", "private int padWithEmptyCells(Composite parent, int col) {\n for (; col < NUM_COL; ++col) {\n emptyCell(parent);\n }\n col = 0;\n return col;\n }" ]
[ "0.6459548", "0.6433609", "0.63993835", "0.6370728", "0.6113064", "0.61004806", "0.60702616", "0.60422206", "0.6034876", "0.6025026", "0.5995975", "0.5980472", "0.5980472", "0.5978248", "0.5962278", "0.5929069", "0.5922747", "0.5909779", "0.59080815", "0.5898374", "0.58811396", "0.58711237", "0.5851569", "0.5850528", "0.58464235", "0.5826729", "0.58003414", "0.5788219", "0.5765202", "0.5758588", "0.57513946", "0.574346", "0.5743146", "0.5740465", "0.5721953", "0.56943023", "0.56943023", "0.56926036", "0.56747323", "0.56669474", "0.56663674", "0.56580156", "0.5655195", "0.56489575", "0.5637748", "0.56276715", "0.5624158", "0.56230307", "0.56189156", "0.5611952", "0.5604423", "0.5597086", "0.5595766", "0.55949277", "0.55931735", "0.5592609", "0.5585364", "0.5585095", "0.55754644", "0.5573458", "0.5571131", "0.5568711", "0.5564238", "0.55563223", "0.5554402", "0.5553959", "0.5547499", "0.5546155", "0.55393267", "0.5536118", "0.5527746", "0.5523599", "0.5516236", "0.5513743", "0.5509126", "0.5508925", "0.5507332", "0.5506024", "0.5491996", "0.54918593", "0.54889685", "0.548636", "0.548636", "0.54758036", "0.5474837", "0.547297", "0.54679054", "0.5465596", "0.5465211", "0.5464819", "0.5462938", "0.5461894", "0.5461358", "0.54583555", "0.5457265", "0.54549026", "0.5453906", "0.5448916", "0.54485136", "0.54365015", "0.5436001" ]
0.0
-1
Source of biological unit. Mostly: SYNTHETIC
public StrColumn getSrcMethod() { return delegate.getColumn("src_method", DelegatingStrColumn::new); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getSource();", "public abstract String getSource();", "public String getSource ();", "public String getSource();", "public String getSource() {\n/* 312 */ return getValue(\"source\");\n/* */ }", "public String get_source() {\n\t\treturn source;\n\t}", "java.lang.String getSource();", "java.lang.String getSource();", "ElementCircuit getSource();", "@ApiModelProperty(value = \"族谱来源\")\n public String getSource() {\n return source;\n }", "java.lang.String getAssociatedSource();", "public String getSouce() {\n\t\treturn source;\n\t}", "public String getAuthoritativeSource(){\r\n\t\treturn \"pubmed\";\r\n\t}", "public PhysicalCard getSourceCard() {\n return _source;\n }", "public String getSource() {\n return source;\n }", "public String getSource() {\r\n return Source;\r\n }", "public String getSource() {\n return this.source;\n }", "String getSourceString();", "@objid (\"4e37aa68-c0f7-4404-a2cb-e6088f1dda62\")\n Instance getSource();", "public String getSource() {\r\n return source;\r\n }", "public String getSource() {\n return source;\n }", "public String getSource() {\n return source;\n }", "public String getSource() {\n return source;\n }", "public String getSource() {\n return mSource;\n }", "public String getCitationStringForSource(DenotationalTerm source,\n CycAccess cycAccess) throws CycConnectionException;", "public String getLifeUsageSource () \n\t{\n\t\treturn (String)get_Value(COLUMNNAME_LifeUsageSource);\n\t}", "State getSource();", "@Override\n\tpublic String getSource() {\n\t\treturn source;\n\t}", "public String getSource() {\n\t\treturn (String) _object.get(\"source\");\n\t}", "public abstract Source getSource();", "public SourceIF source() {\n\t\treturn this.source;\n\t}", "@Override\n public String getCampusCode() {\n final Person initiator = getPersonService().getPerson(getDocumentHeader().getWorkflowDocument().getInitiatorPrincipalId());\n return initiator.getCampusCode();\n }", "public String getSource() {\n\n return source;\n }", "public int getContributingSource() {\n return buffer.get(0) & 0x0F;\n }", "public String getSourceString() {\n return null;\n }", "@Override\n public String getSource() {\n return this.src;\n }", "@Override\r\n\tpublic String getSource() {\n\t\treturn null;\r\n\t}", "public java.lang.String getSource() {\r\n return localSource;\r\n }", "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}", "@Override\n public String getSource()\n {\n return null;\n }", "public SourceDescription getMainSourceDescription() {\n return mainSourceDescription;\n }", "public Town getSource() {\r\n\t\treturn this.source;\r\n\t}", "java.lang.String getSrc();", "public String getSource() {\n\t\treturn this.uri.toString();\n\t}", "public ArchillectSource() {\n super(SOURCE_NAME);\n }", "public String getSource(String cat);", "public java.lang.String getDisplaysource()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(DISPLAYSOURCE$10);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "protected String getFromSource() {\n return sourceTable;\n }", "public String getLBR_ProductSource();", "public void setSource(String Source) {\r\n this.Source = Source;\r\n }", "public String getNoiseSource() {\n return _avTable.get(ATTR_NOISE_SOURCE);\n }", "Source getSrc();", "public String getSource() {\n return JsoHelper.getAttribute(jsObj, \"source\");\n }", "String getSourceUsageURL();", "public long getSource()\r\n { return src; }", "public String getSource(){\r\n\t\treturn selectedSource;\r\n\t}", "public URI getSource() {\n return source;\n }", "@Override\n public Citation getAuthority() {\n return SimpleCitation.NETCDF;\n }", "public String bio() {\n this.use();\n\n return bio;\n }", "public String getSource() {\n Object ref = source_;\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 if (bs.isValidUtf8()) {\n source_ = s;\n }\n return s;\n }\n }", "public void setSource(String source) {\r\n this.source = source;\r\n }", "public void setSource (String source);", "@VTID(27)\n java.lang.String getSourceName();", "public abstract Object getSource();", "@Override\r\n public String getSource()\r\n {\n return null;\r\n }", "public String getSource(){\n\t\treturn source.getEvaluatedValue();\n\t}", "@Override\n \tpublic String getSource() {\n \t\tif (super.source != refSource) {\n \t\t\tif (refSource == null) {\n \t\t\t\trefSource = super.source;\n \t\t\t} else {\n \t\t\t\tsuper.source = refSource;\n \t\t\t}\n \t\t}\n \t\treturn refSource;\n \t}", "@HippoEssentialsGenerated(internalName = \"katharsisexampleshippo:source\")\n public String getSource() {\n return getProperty(SOURCE);\n }", "@ApiModelProperty(required = true, value = \"The program that generated the test results\")\n public String getSource() {\n return source;\n }", "public void setSource(String source) {\n this.source = source;\n }", "public void setSource(String source) {\n this.source = source;\n }", "public HarvestSource getSource() {\n\t\treturn source;\n\t}", "public String getSource() {\n Object ref = source_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n source_ = s;\n }\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getInspirationalQuoteSource() {\n\t\treturn inspirationalQuoteSource;\n\t}", "Optional<String> getSource();", "public int getSource(){\r\n\t\treturn this.source;\r\n\t}", "@ApiModelProperty(value = \"The source of the data.\")\n public String getSource() {\n return source;\n }", "private String getSource() {\n SharedPreferences settings =\n PreferenceManager.getDefaultSharedPreferences(Collect.getInstance().getBaseContext());\n String serverUrl = settings.getString(PreferencesActivity.KEY_SERVER_URL, null);\n String source = null;\n // Remove the protocol\n if(serverUrl.startsWith(\"http\")) {\n \tint idx = serverUrl.indexOf(\"//\");\n \tif(idx > 0) {\n \t\tsource = serverUrl.substring(idx + 2);\n \t} else {\n \t\tsource = serverUrl;\n \t}\n }\n \n return source;\n }", "java.lang.String getPhy();", "public String getSrcInformedOfWebsite() {\r\n return (String) getAttributeInternal(SRCINFORMEDOFWEBSITE);\r\n }", "@java.lang.Override\n public java.lang.String getSource() {\n java.lang.Object ref = source_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n source_ = s;\n return s;\n }\n }", "public interface Source {\n\n /**\n * Set the system identifier for this Source.\n * <p>\n * The system identifier is optional if the source does not get its data\n * from a URL, but it may still be useful to provide one. The application\n * can use a system identifier, for example, to resolve relative URIs and to\n * include in error messages and warnings.\n * </p>\n *\n * @param systemId\n * The system identifier as a URL string.\n */\n public void setSystemId(String systemId);\n\n /**\n * Get the system identifier that was set with setSystemId.\n *\n * @return The system identifier that was set with setSystemId, or null if\n * setSystemId was not called.\n */\n public String getSystemId();\n}", "public String getSrc() {\r\n\t\treturn src;\r\n\t}", "public Byte getSource() {\r\n return source;\r\n }", "public Object getSource() { return this.s; }", "public String getSrcCity() {\r\n return (String) getAttributeInternal(SRCCITY);\r\n }", "String getSourceID();", "public void setSource(String source);", "public void setSource(String source) {\n _source = source;\n }", "public java.lang.String getSource() {\n java.lang.Object ref = source_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n source_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getSource() {\n java.lang.Object ref = source_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n source_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getSource() {\n java.lang.Object ref = source_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n source_ = s;\n return s;\n }\n }", "public int getSource() {\n\t\treturn source;\n\t}", "@DSSource({DSSourceKind.SENSITIVE_UNCATEGORIZED})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:58:12.107 -0500\", hash_original_method = \"958E0B7EB30F5353747022B831D2FD74\", hash_generated_method = \"ADF84B7CD584A3086AA314B699B00CEF\")\n \npublic String getLocation() {\n return location;\n }", "public String getSourceSite() {\n return sourceSite;\n }", "public String getSrcAddress1() {\r\n return (String) getAttributeInternal(SRCADDRESS1);\r\n }", "public String getSourceString() {\n return sourceString;\n }", "public java.lang.CharSequence getSite() {\n return site;\n }", "public String toString() {\n return getClass().getName() + \"[source=\" + source + \"]\";\n }", "public ContractionVertex<RoadNode> getSourceCHNode() {\r\n return sourceCHNode;\r\n }", "public char[] getSource() {\n\t\treturn source;\n\t}" ]
[ "0.6335917", "0.6234252", "0.62193584", "0.6158671", "0.6150574", "0.6111239", "0.6029425", "0.6029425", "0.5974726", "0.5967423", "0.59562695", "0.59553146", "0.5931785", "0.59167606", "0.5890848", "0.58608466", "0.58188987", "0.5798793", "0.5783144", "0.57827646", "0.57524586", "0.57524586", "0.57524586", "0.57521605", "0.57408994", "0.5740582", "0.5683993", "0.56461895", "0.5629359", "0.5628434", "0.5623396", "0.56168914", "0.56118816", "0.5607807", "0.55887157", "0.5587927", "0.55834025", "0.5581893", "0.55793554", "0.555708", "0.55566734", "0.5555483", "0.55505586", "0.5539909", "0.5528671", "0.5520849", "0.5500221", "0.5499124", "0.54927295", "0.5484231", "0.54812574", "0.54773384", "0.5455533", "0.54507", "0.5439382", "0.5427544", "0.5426853", "0.54206437", "0.5409971", "0.5398698", "0.53969294", "0.539615", "0.5394784", "0.5392667", "0.5384448", "0.5380153", "0.53796804", "0.5377785", "0.5370576", "0.53614515", "0.53614515", "0.53609717", "0.5358704", "0.53583616", "0.5342023", "0.5334438", "0.5334324", "0.5322375", "0.532013", "0.5310397", "0.5303249", "0.53016526", "0.52973163", "0.5284004", "0.5282859", "0.5281956", "0.5276177", "0.52705157", "0.5265579", "0.5249688", "0.5249688", "0.52475756", "0.5246866", "0.52434194", "0.52372164", "0.5228053", "0.52269506", "0.5225054", "0.5210908", "0.5208757", "0.5207644" ]
0.0
-1
Spring Data ElasticSearch repository for the Pricing entity.
public interface PricingSearchRepository extends ElasticsearchRepository<Pricing, Long> { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface ServicePriceSearchRepository extends ElasticsearchRepository<ServicePrice, Long> {\n}", "public interface ProductPricingRepository extends JpaRepository<ProductPricing, Long> {\n}", "public interface GroupRateSearchRepository extends ElasticsearchRepository<GroupRate, Long> {\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface PricingRepository extends JpaRepository<Pricing, Long> {\n\n}", "public interface ChemicalsSearchRepository extends ElasticsearchRepository<Chemicals, Long> {\n}", "public interface ServiceAssuranceSearchRepository extends ElasticsearchRepository<ServiceAssurance, Long> {\n}", "public interface DepositSearchRepository extends ElasticsearchRepository<Deposit, Long> {\n}", "public interface PerCompanySearchRepository extends ElasticsearchRepository<PerCompany, Long> {\n}", "public interface StockTakingItemSearchRepository extends ElasticsearchRepository<StockTakingItem, Long> {\n}", "public interface SlideTemplateSearchRepository extends ElasticsearchRepository<SlideTemplate, Long> {\n}", "public interface OrderConsigneeSearchRepository extends ElasticsearchRepository<OrderConsignee, Long> {\n}", "public interface ShopSearchRepository extends ElasticsearchRepository<Shop, Long> {\n}", "public interface TicketSearchRepository extends ElasticsearchRepository<Ticket, Long> {\n}", "public interface OptionTypeSearchRepository extends ElasticsearchRepository<OptionType, Long> {\n}", "public interface POITypeSearchRepository extends ElasticsearchRepository<POIType, Long> {\n}", "public interface TrainingGeneratedSlideNodeSearchRepository extends ElasticsearchRepository<TrainingGeneratedSlideNode, Long> {\n}", "public interface RelatedDocumentSearchRepository extends ElasticsearchRepository<RelatedDocument, Long> {\n}", "public interface InsuranceTypeSearchRepository extends ElasticsearchRepository<InsuranceType, Long> {\n}", "public interface PaymentSettingsSearchRepository extends ElasticsearchRepository<PaymentSettings, Long> {\n}", "public interface OrderEntitySearchRepository extends ElasticsearchRepository<OrderEntity, Long> {\n}", "@Repository\npublic interface ProductRepository extends MongoRepository<ProductPrice, Integer>{\n\tpublic ProductPrice findByProductId(int productId);\n\t\n\n}", "public interface BibliographicEntitySearchRepository extends ElasticsearchRepository<BibliographicEntity, Long> {\n}", "public interface ProductionSearchRepository extends ElasticsearchRepository<Production, Long> {\n}", "public interface UserSkillPriceRepository extends JpaRepository<UserSkillPrice, Long> {\n}", "public interface AssigsSearchRepository extends ElasticsearchRepository<Assigs, Long> {\n}", "public interface DroitaccesDocumentSearchRepository extends ElasticsearchRepository<DroitaccesDocument, Long> {\n}", "public interface ThinkAloudSearchRepository extends ElasticsearchRepository<ThinkAloud, Long> {\n}", "@Repository\npublic interface ArticleRepository extends ElasticsearchRepository<Article, Integer> {\n\n}", "public interface PaymentTransferHistorySearchRepository extends ElasticsearchRepository<PaymentTransferHistory, Long> {\n}", "public interface PlaybookcomponentSearchRepository extends ElasticsearchRepository<Playbookcomponent, Long> {\n}", "@Repository\npublic interface TipPercentRepository extends CrudRepository<TipPercent, Long>{\n}", "public interface BookRepository extends JpaRepository<Book, Long> {\n\n List<String> giveMeAllBooksTitlesByAuthor(String author);\n\n List<Book> giveMeAllBooksByAuthorWithPrizeGraterThan(@Param(\"author\") String author,\n @Param(\"prize\") BigDecimal prize);\n\n BigDecimal giveMeAveragePrizeOfBooks();\n\n List<Book> giveMeAllBooksByAuthorOrderedByPagesDesc(@Param(\"author\") String author, Pageable pageable);\n\n List<Employee> giveMeAllEmployeesWhoSoldBooksOfThisAuthor(@Param(\"author\") String author);\n\n void increasePrizesByTenPercent(@Param(\"id\") Long id);\n}", "public interface OrderComponentSearchRepository extends ElasticsearchRepository<OrderComponent, Long> {\n}", "public interface OuderSearchRepository extends ElasticsearchRepository<Ouder, Long> {\n}", "@SuppressWarnings(\"unused\")\n@Repository\n@JaversSpringDataAuditable\npublic interface ReservoirCapacityRepository extends JpaRepository<ReservoirCapacity, Long> {\n\n}", "public interface HbzCostRepository extends BaseRepository<HbzCost, Long> {\n}", "public interface OfferingRepository extends JpaRepository<Offering, Long>{\r\n\r\n}", "public interface HrDepartmentHeadSetupSearchRepository extends ElasticsearchRepository<HrDepartmentHeadSetup, Long> {\n}", "public interface CurrencyRepository extends JpaRepository<Currency, Long> {\n\n}", "public interface HouseUpdateSearchRepository extends ElasticsearchRepository<HouseUpdate, Long> {\n}", "public interface Tbc_clienteSearchRepository extends ElasticsearchRepository<Tbc_cliente, Long> {\n}", "public interface WalletWithdrawalSearchRepository extends ElasticsearchRepository<WalletWithdrawal, Long> {\n}", "public interface ShopperPersonRepository extends CrudRepository<ShopperPerson, Long> {\n}", "@Repository\npublic interface InspectionOptionRepository extends JpaRepository<InspectionOption, Integer> {\n\n}", "public interface SaldoAppSearchRepository extends ElasticsearchRepository<SaldoApp, Long> {\n}", "public interface VeeResponseSearchRepository extends ElasticsearchRepository<VeeResponse, Long> {\n}", "public interface LevelDressageSearchRepository extends ElasticsearchRepository<LevelDressage, Long> {\n}", "public interface RegistryFieldSearchRepository extends ElasticsearchRepository<RegistryField, Long> {\n}", "public interface ReportSearchRepository extends ElasticsearchRepository<Report, Long> {\n}", "public interface MetroSearchRepository extends ElasticsearchRepository<Metro, Long> {\n}", "public interface PriceDao extends JpaRepository<Price, Integer> {\n}", "public interface BulkRequestItemDetailsRepository extends JpaRepository<BulkRequestItemEntity, Integer> {\n}", "public interface LocalitySearchRepository extends ElasticsearchRepository<Locality, Long> {\n}", "public interface TemporadaSearchRepository extends ElasticsearchRepository<Temporada, Long> {\n}", "public interface PetRepository extends CrudRepository<Pet, Long> {\n}", "public interface FonctionSearchRepository extends ElasticsearchRepository<Fonction, Long> {\n}", "@Repository\npublic interface ProductRepository extends CrudRepository<Product, Integer> {\n\n}", "@RooJpaRepository(entity = ProductTaxRates.class)\npublic interface ProductTaxRatesRepository {\n}", "@Repository(value = \"competitionRepository\")\ninterface CompetitionRepository extends JpaRepository<CompetitionModel, Long> {\n\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface SettingTestimonialRepository extends JpaRepository<SettingTestimonial, Long> {\n\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface LectureRepository extends JPASearchRepository<Lecture, Long> {\n\n}", "public interface RatingRepository extends CrudRepository<Rating, String>{\n\n}", "@Repository\npublic interface MovieRepository extends ElasticsearchRepository<Movie, Long> {\n\n List<Movie> findByName(String name);\n List<Movie> findByRatingBetween(Double start, Double end);\n List<Movie> findByDirector(Director director);\n}", "@Repository\npublic interface ProdutoRepository extends JpaRepository<Produto, Integer>{\n \t\n}", "public interface DataStateSearchRepository extends ElasticsearchRepository<DataState, Long> {\n}", "public interface Cr_elementSearchRepository extends ElasticsearchRepository<Cr_element, Long> {\n}", "public interface CmsSyllabusSearchRepository extends ElasticsearchRepository<CmsSyllabus, Long> {\n}", "public interface SemesterSearchRepository extends ElasticsearchRepository<Semester, Long> {\n}", "public interface PriceRepository extends Repository<Price, Integer> {\n}", "public interface PresupuestosExpedRepository\nextends CrudRepository<PresupuestosExped, PresupuestosExpedPK>, PresupuestosExpedRepositoryCustom {\n\t/**\n\t * UMESCI-713 Find PresupuestosExped by the parameters\n\t *\n\t * @param numExp\n\t * @param tipMovValue\n\t * @param billStatusActive\n\t * @return\n\t */\n\tPresupuestosExped findPresupuestosExpedByIdNumExpAndTipMovAndEstado(String numExp, String tipMovValue,\n\t\t\tString billStatusActive);\n\n\n}", "@Repository\npublic interface QualityParameterRepository extends JpaRepository<QualityParameter, Integer> {\n\n}", "public interface ResulteventSearchRepository extends ElasticsearchRepository<Resultevent, Long> {\n}", "public interface FiltreSearchRepository extends ElasticsearchRepository<Filtre, Long> {\n}", "@Repository\npublic interface ProductRepository extends JpaRepository<Product, Long> {\n\n}", "public interface EvDiagramSearchRepository extends ElasticsearchRepository<EvDiagram, Long> {\n}", "public interface SearchTypeSearchRepository extends ElasticsearchRepository<SearchType, Long> {\n}", "@Repository\npublic interface BookRepository extends JpaRepository<Book, Long> {\n\n}", "public interface AssignmentRepository extends JpaRepository<Assignment, Integer>, JpaSpecificationExecutor<Assignment> {\n}", "public interface MedicalCaseSearchRepository extends ElasticsearchRepository<MedicalCase, Long> {\n}", "public interface DocumentParameterRepository extends JpaRepository<DocumentParameterEntity, Long> {\n}", "public interface TypeMedicationSearchRepository extends ElasticsearchRepository<TypeMedication, Long> {\n}", "public interface ShopRepository extends PagingAndSortingRepository<ShopEntity,String> {\n}", "@RepositoryRestResource()\npublic interface PlanetRepository extends JpaRepository<Planet, Integer>, JpaSpecificationExecutor<Planet>, QuerydslPredicateExecutor<Planet> {\n\n}", "@Repository\npublic interface ProductRepository extends PagingAndSortingRepository<Product, Integer> {\n\n Page<Product> findAll(Pageable pageRequest);\n}", "public interface AreaSearchRepository extends ElasticsearchRepository<Area, Long> {\n}", "public interface ContentSearchRepository extends ElasticsearchRepository<Content, Long> {\n}", "public interface CartRepository extends JpaRepository<Cart, Integer> {\n}", "public interface AdCreativeRespository extends JpaRepository<AdCreative,Long> {\n\n}", "public interface MedCheckDetSearchRepository extends ElasticsearchRepository<MedCheckDet, Long> {\n}", "@SuppressWarnings(\"unused\")\n@Repository\n@JaversSpringDataAuditable\n\npublic interface SellContractCustomerRepository extends JpaRepository<SellContractCustomer, Long> {\n\n SellContractCustomer findByCustomer_Id(Long customerId);\n\n List<SellContractCustomer> findAllBySellContract_Id(Long sellContractId);\n\n}", "public interface ProductRepository extends MongoRepository<Offer, Integer> {\n}", "public interface CarsRepository extends JpaRepository<Car, Long> {\n\n}", "public interface ImageManagerSearchRepository extends ElasticsearchRepository<ImageManager, Long> {\n}", "@Repository\npublic interface IPaymentRepository extends JpaRepository<Payment, Long> {\n}", "@Repository\npublic interface SprintRepository extends JpaRepository<Sprint,Integer> {\n}", "public interface PermissionSearchRepository extends ElasticsearchRepository<Permission, Long> {\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface PettyCashRepository extends JpaRepository<PettyCash, Long> {\n\n}", "public interface RepairRepository extends JpaRepository<Repair,Long> {\n\n}", "public interface LandmarkRepository extends ElasticsearchRepository<Landmark, String> {\n\n List<Landmark> findByName(String name);\n\n}", "@Repository\npublic interface RedeemRepo extends JpaRepository<Redeem , Long> {\n}" ]
[ "0.7286061", "0.702248", "0.678128", "0.6780915", "0.6644016", "0.6632004", "0.6592339", "0.65712065", "0.6555739", "0.6553429", "0.65470034", "0.6468063", "0.6438855", "0.643353", "0.6415669", "0.6399343", "0.6388844", "0.6373593", "0.63693845", "0.6359977", "0.6359254", "0.6330803", "0.6296409", "0.6289364", "0.62613237", "0.6256789", "0.6247775", "0.6238691", "0.62348545", "0.6234795", "0.6202504", "0.6202068", "0.620173", "0.6177141", "0.61563176", "0.6147641", "0.6146175", "0.61430895", "0.61386436", "0.61341673", "0.61286277", "0.61138254", "0.60921735", "0.60759467", "0.60757434", "0.6073874", "0.6060465", "0.6055028", "0.6048357", "0.6039006", "0.6033352", "0.60271037", "0.6020231", "0.6010422", "0.6008657", "0.59929544", "0.59910154", "0.59864444", "0.5985571", "0.5981893", "0.59804493", "0.59768504", "0.5976536", "0.5973271", "0.5969799", "0.5969582", "0.5969036", "0.59667426", "0.59645677", "0.5957512", "0.5946738", "0.59374774", "0.5929196", "0.59254146", "0.5921955", "0.59177256", "0.59102225", "0.589423", "0.589254", "0.5892073", "0.588854", "0.5881118", "0.5879914", "0.5879144", "0.58777636", "0.5872368", "0.58721155", "0.5867934", "0.5864214", "0.5859578", "0.58551854", "0.5853248", "0.58507216", "0.58373946", "0.58357227", "0.5832897", "0.58315986", "0.58254117", "0.5824755", "0.5823402" ]
0.780306
0
/ This endpoint creates a repository with an starter tag and an optional develop branch.
@RequestMapping(method = RequestMethod.POST, value = "/startRepo") public String initializeRepo(@RequestBody CreateRepoRequestTemplate createRepoRequestTemplate) throws ResourceNotFoundException, BadRequestException { return gitLabService.initializeRepo(createRepoRequestTemplate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "WithCreate withRepoUrl(String repoUrl);", "@Override\n public CreateRepositoryResult createRepository(CreateRepositoryRequest request) {\n request = beforeClientExecution(request);\n return executeCreateRepository(request);\n }", "TRepo createRepo();", "public CompletableFuture<CreateRepositoryResponse> createRepository(CreateRepositoryRequest request)\n\t\t\tthrows IOException {\n\t\treturn this.transport.performRequestAsync(request, CreateRepositoryRequest.ENDPOINT, this.requestOptions);\n\t}", "void createRepository(String projectKey, String repoName, String parentProjectKey) throws VersionControlException;", "private void createNewRepository() {\n\t\tRepositoryConfiguration conf = repositorySettingsJPanel\n\t\t\t\t.getRepositoryConfiguration();\n\n\t\t/*\n\t\t * if (RepositoryType.HTTP.equals(conf.getType())) { new\n\t\t * MessageDialog(this, \"TBD\",\n\t\t * \"The support for HTTP repository is not implemented yet\"\n\t\t * ).setVisible(true); return; }\n\t\t */\n\n\t\tif (!validateRepositoryConfiguration(conf)) {\n\t\t\t// fixme igor; mark what is wrong!!\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tContextHolder.getInstance().getApplicationConfiguration()\n\t\t\t\t\t.addRepositoryConfiguration(conf);\n\t\t} catch (AddRepositoryException e) {\n\t\t\tnew MessageDialog(this, \"Cannot create new repository\",\n\t\t\t\t\te.getMessage()).setVisible(true);\n\t\t\treturn;\n\t\t}\n\n\t\tAppEventsManager.getInstance().fireRepositoriesChanagedEvent(this);\n\t\tdispose();\n\t}", "void createBranchAtCommit(TCommit commit, String branchName, TRepo repo);", "WithCreate withBranch(String branch);", "interface WithRepoUrl {\n /**\n * Specifies the repoUrl property: The repo url of the source control..\n *\n * @param repoUrl The repo url of the source control.\n * @return the next definition stage.\n */\n WithCreate withRepoUrl(String repoUrl);\n }", "SourceBuilder createRepository();", "public Requested<Release> postByOwnerRepo(String owner,\n String repo,\n String Accept,\n ReleaseCreate body) {\n String url = (\"https://api.github.com//repos/{owner}/{repo}/releases\".replace(\"{owner}\", \"\"+owner).replace(\"{repo}\", \"\"+repo));\n HashMap<String, String> headerProperties = new HashMap<String, String>();\n if (Accept!= null) {\n headerProperties.put(\"Accept\", (\"\"+ Accept));\n }\n Map<String, Object> content = new HashMap<>();\n content.put(\"body\", body);\n return requestPost(url, headerProperties, content, Release.class);\n }", "@Test\n\tpublic void createRepo() throws NoFilepatternException, GitAPIException, IOException {\n\t\t\n\t\t\n\t\tFile baseDir = Files.createTempDir(\"gitrepo\");\n\t\tFile gitDir = new File(baseDir, \".git\");\n\n\t\tRepository repo = new FileRepositoryBuilder().setGitDir(gitDir).setWorkTree(baseDir).build();\n\t\trepo.create();\n\n\t\tGit git = new Git(repo);\n\n\t\tFiles.write(\"Nothing\", new File(baseDir,\"my.sample\"));\n\t\t\n\t\tgit.add().addFilepattern(\"*.sample\").call();\n\t\tgit.commit().setMessage(\"first commit\").call();\n\t\t\n\t\tgit.branchCreate().setName(\"new-branch\").call();\n\t\tgit.checkout().setName(\"new-branch\").call();\n\t\t\n\t\tList<Ref> branches = git.branchList().call();\n\t\t\n\t\tSystem.out.println(\"Branches: \"+branches);\n\t\t\n\t\tAssert.assertTrue(\"clean up\",Files.deleteAll(baseDir));\n\t}", "@Path(\"/api/repo/create\")\n\t@POST\n\t@ApiOperation(value = \"Create the docker repository\", notes = \"User can create docker repository.User with role Customer Admin only allowed.\", response = ApiResponseDTO.class)\n\t@ApiResponses({ @ApiResponse(code = 200, message = \"The docker repository has been created successfully\") })\n\t@Transactional(rollbackFor = { NotAuthorizeException.class, JsonProcessingException.class, ValidationException.class,BaseException.class })\n\t@RequestMapping(value = \"/api/repo/create\", method = RequestMethod.POST)\n\t@PreAuthorize(\"hasAuthority('Customer Admin')\")\n\tpublic ApiResponseDTO createRepository(\n\t\t\t@ApiParam(name = \"Docker respository object\", value = \"Docker respository object that needs to be created\", required = true) @Valid @RequestBody DockerRepositoryDTO dockerRepositoryDTO,\n\t\t\tHttpServletRequest request) throws NotAuthorizeException, JsonProcessingException, ValidationException, BaseException {\n\t\tString message = null;\n\t\tString statusCode = HttpStatus.OK.toString();\n\t\tString loggedInEmail = getLoggedInUserEmail(SecurityContextHolder.getContext().getAuthentication());\n\t\tString roleName = getLoggedInUserRoleName(SecurityContextHolder.getContext().getAuthentication());\n\t\tlogger.debug(\"RoleName and loggedinemail are {}, {}\", roleName, loggedInEmail);\n\t\tUser loggedInUser = userService.findUserByEmail(loggedInEmail);\n\t\tString userQAuthToken = loggedInUser.getqAuthToken();\n\t\tif (userQAuthToken == null) {\n\t\t\tthrow new NotAuthorizeException(environment.getProperty(\"job.notauthorized\"));\n\t\t}\n\t\tif(StringUtils.containsWhitespace(dockerRepositoryDTO.getRepository()) == true){\n\t\t\tthrow new ValidationException(environment.getProperty(\"repository.name.notallow.space\"));\n\t\t}\n\t\ttry {\n\t\t\tString custName = customerService.findCustomer(loggedInUser).getName();\n\t\t\tString url = environment.getProperty(\"quay.url\");\n\n\t\t\tlogger.debug(\"Crreate Docker Repository with fallowing parmes url {} CustomerName {}\", url, custName);\n\n\t\t\tdockerRepositoryDTO.setNamespace(custName);\n\n\t\t\tDockerRepoResponseDTO dockerRepoResponse = JobsClient.createDockerRepository(url, BEARER + userQAuthToken,\n\t\t\t\t\tdockerRepositoryDTO);\n\t\t\tif (dockerRepoResponse != null) {\n\t\t\t\tmessage = dockerRepoResponse.getMessage();\n\t\t\t\tstatusCode = String.valueOf(dockerRepoResponse.getStatusCode());\n\t\t\t}\n\t\t\tlogger.info(environment.getProperty(\"job.repository.create.sucess\"),loggedInUser.getUserName(),custName,environment.getProperty(\"quay.url\"));\n\t\t} catch (MalformedURLException e) {\n\t\t\tlogger.error(e.getMessage());\n\t\t\tlogger.info(environment.getProperty(\"job.tomcat.failed\"),environment.getProperty(\"nvidia.host\"),environment.getProperty(\"quay.url\"));\n\t\t\tthrow new BaseException(\"error while creating docker repositories\" + e.getMessage());\n\t\t}\n\t\t\n\t\tApiResponseDTO response = new ApiResponseDTO(message, Integer.parseInt(statusCode));\n\t\treturn response;\n\t}", "private void createRepository(URL repository) throws IOException, ProcessingException {\n if(repository.getPath().equals(\"/\"))\n throw new ProcessingException(\"Illegal repository name\");\n try {\n exec(buildSvnWithUsername(\"proplist \"+repository),new File(\".\"),\"N/A\");\n } catch (ProcessingException e) {\n // directory doesn't exist\n URL parent;\n if(repository.getPath().endsWith(\"/\"))\n parent = new URL(repository, \"..\");\n else\n parent = new URL(repository, \".\");\n createRepository(parent);\n\n listener.info(repository+\" doesn't exist. creating\");\n exec(buildSvnWithUsername(\"mkdir -m \\\"\"+commitMessage+\"\\\" \"+repository),new File(\".\"),\"Failed to create directory\");\n }\n }", "private ArtifactRepository createRepository( String url, String repositoryId )\n {\n // snapshots vs releases\n // offline = to turning the update policy off\n\n //TODO: we'll need to allow finer grained creation of repositories but this will do for now\n\n String updatePolicyFlag = ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS;\n\n String checksumPolicyFlag = ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN;\n\n ArtifactRepositoryPolicy snapshotsPolicy =\n new ArtifactRepositoryPolicy( true, updatePolicyFlag, checksumPolicyFlag );\n\n ArtifactRepositoryPolicy releasesPolicy =\n new ArtifactRepositoryPolicy( true, updatePolicyFlag, checksumPolicyFlag );\n\n return artifactRepositoryFactory.createArtifactRepository( repositoryId, url, defaultArtifactRepositoryLayout,\n snapshotsPolicy, releasesPolicy );\n }", "interface WithBranch {\n /**\n * Specifies the branch property: The repo branch of the source control. Include branch as empty string for\n * VsoTfvc..\n *\n * @param branch The repo branch of the source control. Include branch as empty string for VsoTfvc.\n * @return the next definition stage.\n */\n WithCreate withBranch(String branch);\n }", "private void createAndSetNewBranch()\n {\n Date startDateOfArticle = getStartDateOfArticle();\n final String branchId = startDateOfArticle == null ? GWikiProps.formatTimeStamp(new Date()) : GWikiProps\n .formatTimeStamp(startDateOfArticle);\n\n wikiContext.runInTenantContext(branchId, getWikiSelector(), new CallableX<Void, RuntimeException>()\n {\n @Override\n public Void call() throws RuntimeException\n {\n final GWikiElement branchInfo = PlcUtils.createInfoElement(wikiContext, branchId, \"\", branchId, \"\");\n final GWikiElement branchFileStats = PlcUtils.createFileStats(wikiContext);\n wikiContext.getWikiWeb().getAuthorization().runAsSu(wikiContext, new CallableX<Void, RuntimeException>()\n {\n @Override\n public Void call() throws RuntimeException\n {\n wikiContext.getWikiWeb().saveElement(wikiContext, branchInfo, false);\n wikiContext.getWikiWeb().saveElement(wikiContext, branchFileStats, false);\n return null;\n }\n });\n GLog.note(GWikiLogCategory.Wiki, \"Autocreate branch: \" + branchId);\n return null;\n }\n });\n\n // set new created branch as selected\n selectedBranch = branchId;\n }", "void setRepository(Repository repository);", "@Override\n\t\t\tpublic void run(@Nonnull ProgressIndicator indicator)\n\t\t\t{\n\t\t\t\tLOG.info(\"Creating GitHub repository\");\n\t\t\t\tindicator.setText(\"Creating GitHub repository...\");\n\t\t\t\tfinal String url = createGithubRepository(project, githubInfo.getAuthData(), name, description,\n\t\t\t\t\t\tisPrivate);\n\t\t\t\tif(url == null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tLOG.info(\"Successfully created GitHub repository\");\n\n\t\t\t\t// creating empty git repo if git is not initialized\n\t\t\t\tLOG.info(\"Binding local project with GitHub\");\n\t\t\t\tif(!gitDetected)\n\t\t\t\t{\n\t\t\t\t\tLOG.info(\"No git detected, creating empty git repo\");\n\t\t\t\t\tindicator.setText(\"Creating empty git repo...\");\n\t\t\t\t\tif(!createEmptyGitRepository(project, root, indicator))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tGitRepositoryManager repositoryManager = GitUtil.getRepositoryManager(project);\n\t\t\t\tfinal GitRepository repository = repositoryManager.getRepositoryForRoot(root);\n\t\t\t\tLOG.assertTrue(repository != null, \"GitRepository is null for root \" + root);\n\n\t\t\t\tfinal String remoteUrl = GithubUrlUtil.getGitHost() + \"/\" + githubInfo.getUser().getLogin() + \"/\" +\n\t\t\t\t\t\tname + \".git\";\n\t\t\t\tfinal String remoteName = finalExternalRemoteDetected ? \"github\" : \"origin\";\n\n\t\t\t\t//git remote add origin [email protected]:login/name.git\n\t\t\t\tLOG.info(\"Adding GitHub as a remote host\");\n\t\t\t\tindicator.setText(\"Adding GitHub as a remote host...\");\n\t\t\t\tif(!addGithubRemote(project, root, remoteName, remoteUrl, repository))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// create sample commit for binding project\n\t\t\t\tif(!performFirstCommitIfRequired(project, root, repository, indicator, name, url))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//git push origin master\n\t\t\t\tLOG.info(\"Pushing to github master\");\n\t\t\t\tindicator.setText(\"Pushing to github master...\");\n\t\t\t\tif(!pushCurrentBranch(project, repository, remoteName, remoteUrl, name, url))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tGithubNotifications.showInfoURL(project, \"Successfully shared project on GitHub\", name, url);\n\t\t\t}", "@Test\n public void testInitialiseOnExistingRepo() throws Exception {\n moveToTempTestDirectory(\"test-project-initialise\", \"pom.xml\");\n\n final File rootFolder = getFolder().getRoot();\n assertTrue(rootFolder.exists());\n Git.init().setDirectory(rootFolder).call();\n\n verifyRepositoryInitializedWithoutErrors(rootFolder);\n }", "public void createPullReq(GHRepository origRepo,\n String branch, GHRepository forkRepo,\n PullRequestInfo pullRequestInfo) throws InterruptedException, IOException {\n while (true) {\n int pullRequestExitCode = gitHubUtil.createPullReq(origRepo,\n branch, forkRepo, pullRequestInfo.getTitle(), pullRequestInfo.getBody());\n if (pullRequestExitCode == 0) {\n return;\n } else if (pullRequestExitCode == 1) {\n gitHubUtil.safeDeleteRepo(forkRepo);\n return;\n }\n }\n }", "public void setRepository(String repository) {\n this.repository = repository;\n }", "public void setRepository(String repository) {\n this.repository = repository;\n }", "@Test\n public void testInitialiseNewGitRepo() throws Exception {\n moveToTempTestDirectory(\"test-project-initialise\", \"pom.xml\");\n\n final File rootFolder = getFolder().getRoot();\n assertTrue(rootFolder.exists());\n\n verifyRepositoryInitializedWithoutErrors(rootFolder);\n }", "private void onNewRepo() {\n RepositoryImpl repoImpl = BugtrackingUtil.createRepository();\n if(repoImpl == null) {\n return;\n }\n Repository repo = repoImpl.getRepository();\n repositoryComboBox.addItem(repo);\n repositoryComboBox.setSelectedItem(repo);\n }", "public void createVersion(final ArtifactVersion version);", "public abstract RepositoryOperation getAddOperation(URI repoLocation);", "public void createRepository() throws VcsException {\n final FossilSimpleCommand fossilCommand = new FossilSimpleCommand(myProject, myRepoPath.getParentFile(), FCommandName.new_);\n fossilCommand.addParameters(myRepoPath.getPath());\n String result = fossilCommand.run();\n result = result.replace(\"\\r\", \"\");\n final String[] split = result.split(\"\\n\");\n final List<String> lines = new ArrayList<String>(3);\n for (String line : split) {\n if (! StringUtil.isEmptyOrSpaces(line)) {\n lines.add(line.trim());\n }\n }\n\n if (lines.size() != 3) {\n throw new FossilException(\"Can not parse 'new' output: '\" + result + \"'\");\n }\n final String[] expectedHeaders = {\"project-id:\", \"server-id:\", \"admin-user:\"};\n for (int i = 0; i < lines.size(); i++) {\n final String line = lines.get(i);\n if (! line.startsWith(expectedHeaders[i])) {\n throw new FossilException(\"Can not parse 'new' output, line #\" + (i + 1) + \": '\" + result + \"'\");\n }\n }\n myProjectId = new String(lines.get(0).substring(expectedHeaders[0].length() + 1));\n myServerId = new String(lines.get(1).substring(expectedHeaders[1].length()) + 1);\n final String userPswd = lines.get(2).substring(expectedHeaders[2].length()).trim();\n final int idxSpace = userPswd.indexOf(' ');\n if (idxSpace == -1) {\n throw new FossilException(\"Can not parse 'new' output, user-password area: '\" + result + \"'\");\n }\n myUserName = new String(userPswd.substring(0, idxSpace));\n final int quot1 = userPswd.indexOf('\"', idxSpace + 1);\n int quot2 = -1;\n if (quot1 >= 0) {\n quot2 = userPswd.indexOf('\"', quot1 + 1);\n }\n if (quot1 == -1 || quot2 == -1) {\n throw new FossilException(\"Can not parse 'new' output, user-password area: '\" + result + \"'\");\n }\n myPassword = userPswd.substring(quot1 + 1 , quot2);\n }", "void push(RemoteConfig repository, String revspec) throws GitException, InterruptedException;", "RepositoryType createRepositoryType();", "@TaskAction\n public void configureRepository() throws IOException {\n GitHub github = GitHub.connect(null, getGithubToken());\n String user = github.getMyself().getLogin();\n GHRepository repository = null;\n\n try {\n repository = github.getRepository(user + \"/\" + getRepositoryName());\n }\n catch (FileNotFoundException e) {\n GHCreateRepositoryBuilder repositoryCreator = github.createRepository(getRepositoryName());\n repository = repositoryCreator.create();\n }\n\n String description = getRepositoryDescription();\n\n if (description != null && !description.equals(repository.getDescription())) {\n repository.setDescription(description);\n }\n }", "public void buildRepository(String repositoryIdentifier, boolean updateServerInfo) {\n ServerRepository serverRepository = serverRepositories.get(repositoryIdentifier);\n buildRepository(serverRepository, updateServerInfo);\n }", "interface WithBranch {\n /**\n * Specifies the branch property: The repo branch of the source control..\n *\n * @param branch The repo branch of the source control.\n * @return the next definition stage.\n */\n Update withBranch(String branch);\n }", "@PostMapping(\"/branches\")\n public ResponseEntity<Branch> createBranch(@RequestBody Branch branch)throws Exception{\n log.debug(\"REST request to create branch : {}\",branch);\n branch = branchService.save(branch);\n return ResponseEntity.created(new URI(\"/api/branches/\" + branch.getIfsc()))\n .headers(HeaderUtill.createEntityCreationAlert(\"Branch\", branch.getIfsc().toString()))\n .body(branch);\n }", "@POST\n @Path(\"accept\")\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n public Factory acceptFactory(final Factory factory) {\n final ProjectImporter importer = getGitProjectImporter();\n\n //try to check if factory contains project name value otherwise we set default project name to \"Unnamed\"\n ProjectAttributes projectAttributes = factory.getProjectattributes();\n if (projectAttributes == null) {\n projectAttributes = DtoFactory.getInstance().createDto(ProjectAttributes.class).withPname(DEFAULT_PROJECT_NAME);\n factory.setProjectattributes(projectAttributes);\n } else if (projectAttributes.getPname() == null || projectAttributes.getPname().isEmpty()) {\n projectAttributes = factory.getProjectattributes().withPname(DEFAULT_PROJECT_NAME);\n }\n\n List<FolderEntry> existedFolders = projectManager.getProjectsRoot(workspace).getChildFolders();\n\n //if project with the same name exist we should create new one with another name.\n for (FolderEntry existProject : existedFolders) {\n if (projectAttributes.getPname().equals(existProject.getName())) {\n projectAttributes.setPname(NameGenerator.generate(projectAttributes.getPname(), 4));\n break;\n }\n }\n\n //get newly created empty folder in which clone should be proceed\n FolderEntry projectFolder = projectManager.getProjectsRoot(workspace).createFolder(factory.getProjectattributes().getPname());\n\n try {\n importer.importSources(projectFolder, factory.getVcsurl());\n } catch (IOException e) {\n if (e.getCause() != null && e.getCause() instanceof NotAuthorizedException) {\n throw halt(UNAUTHORIZED, e.getMessage(), e);\n }\n throw halt(INTERNAL_SERVER_ERROR, e.getMessage());\n }\n\n //get physical path to project on file system to allow native git to work with repository\n String absoluteProjectPath;\n try {\n absoluteProjectPath = localPathResolver.resolve(projectFolder.getVirtualFile());\n } catch (VirtualFileSystemException e) {\n removeInvalidClonedFolder(projectFolder);\n throw halt(INTERNAL_SERVER_ERROR, \"Unable to resolve Git project directory.\", e);\n }\n\n GitConnection gitConnection;\n try {\n gitConnection = gitConnectionFactory.getConnection(absoluteProjectPath);\n } catch (GitException e) {\n removeInvalidClonedFolder(projectFolder);\n throw halt(INTERNAL_SERVER_ERROR, \"Unable to get Git connection to cloned project.\", e);\n }\n\n if (!Strings.isNullOrEmpty(factory.getCommitid())) {\n performCheckoutToCommitId(factory.getCommitid(), gitConnection);\n } else if (!Strings.isNullOrEmpty(factory.getVcsbranch())) {\n performCheckoutToBranch(factory.getVcsbranch(), gitConnection);\n }\n\n if (factory.getVariables() != null && factory.getVariables().size() > 0) {\n performReplaceVariables(factory.getVariables(), absoluteProjectPath);\n }\n\n if (!factory.getVcsinfo()) {\n AbstractVirtualFileEntry gitFolder = projectFolder.getChild(\".git\");\n if (gitFolder != null && gitFolder.isFolder()) {\n pushClientNotification(\"Git information erased.\");\n gitFolder.remove();\n }\n }\n\n return factory;\n }", "@Override\n\tpublic void createRelease(Version version) {\n\n\t}", "public Builder repository(String repository) {\n command.repository(repository);\n return this;\n }", "public Repository repository(String owner, String repo, EditRepoOption repository) {\n return apiClient.deserialize(apiClient.patch(String.format(\"/repos/%s/%s\", owner, repo), repository), Repository.class);\n }", "Response head(String repoName, String repoPath, UriInfo baseURI);", "interface WithCreate\n extends DefinitionStages.WithRepoUrl,\n DefinitionStages.WithBranch,\n DefinitionStages.WithFolderPath,\n DefinitionStages.WithAutoSync,\n DefinitionStages.WithPublishRunbook,\n DefinitionStages.WithSourceType,\n DefinitionStages.WithSecurityToken,\n DefinitionStages.WithDescription {\n /**\n * Executes the create request.\n *\n * @return the created resource.\n */\n SourceControl create();\n\n /**\n * Executes the create request.\n *\n * @param context The context to associate with this operation.\n * @return the created resource.\n */\n SourceControl create(Context context);\n }", "@Override\n public SvnRepository createRepository(SvnRepository svnRepository) {\n try {\n\n // if repository root path not exists, mkdir\n File repoRoot = new File(svnRepository.getRootPathLocal());\n if (!repoRoot.exists()) {\n FileUtils.forceMkdir(repoRoot);\n }\n\n // execute svnadmin create command\n String repoName = svnRepository.getName();\n String repoPathLocal = svnRepository.getFullPathLocal();\n String command = \"svnadmin create \\\"\" + StringUtils.fixFileSeparatorChar(repoPathLocal) + \"\\\"\";\n\n if (svnRepository.getRepositoryType() != null) {\n command += \" --fs-type \" + svnRepository.getRepositoryType().getCode();\n }\n\n logger.info(\"Create repository: \" + repoName);\n CommandUtils.executeAsync(command);\n\n // backup svn repository settings\n backupSettings(repoPathLocal);\n\n // svn admin\n SvnUser svnAdmin = new SvnUser(\"marssvn\", StringUtils.createRandomPassword(16));\n svnRepository.setAdminUser(svnAdmin);\n logger.debug(\"password: \" + svnAdmin.getPassword());\n\n // write svnserve.conf\n writeSvnserveConf(svnRepository);\n\n svnRepository.setSvnProtocol(ESvnProtocol.SVN);\n return svnRepository;\n\n } catch (IOException e) {\n throw new SvnApiException(\"EA0001\", e.getMessage());\n }\n }", "@Override\n public CreateBranchResult createBranch(CreateBranchRequest request) {\n request = beforeClientExecution(request);\n return executeCreateBranch(request);\n }", "@PostMapping(\"/jpa/users/{username}/suppliers\")\n public ResponseEntity<Void> createSupplier(@PathVariable String username,\n @RequestBody Supplier supplier){\n supplier.setUsername(username);\n Supplier createdSupplier = supplierJpaRepo.save(supplier);\n\n URI uri = ServletUriComponentsBuilder.fromCurrentRequest().path(\"/{id}\")\n .buildAndExpand(createdSupplier.getId()).toUri();\n\n\n return ResponseEntity.created(uri).build();\n\n }", "public synchronized Repository createRepository(String currentUser, String name)\n\t\t\tthrows IOException, DuplicateFileException {\n\n\t\tif (isAnonymousUser(currentUser)) {\n\t\t\tthrow new UserAccessException(\"Anonymous user not permitted to create repository\");\n\t\t}\n\n\t\tvalidateUser(currentUser);\n\n\t\tif (!NamingUtilities.isValidProjectName(name)) {\n\t\t\tthrow new IOException(\"Invalid repository name: \" + name);\n\t\t}\n\t\tif (repositoryMap.containsKey(name)) {\n\t\t\tthrow new DuplicateFileException(\"Repository named \" + name + \" already exists\");\n\t\t}\n\n\t\tFile f = new File(rootDirFile, NamingUtilities.mangle(name));\n\t\tif (!f.mkdir()) {\n\t\t\tthrow new IOException(\"Failed to make directory for \" + f.getAbsolutePath());\n\t\t}\n\n\t\tRepository rep = new Repository(this, currentUser, f, name);\n\t\tlog(name, null, \"repository created\", currentUser);\n\t\trepositoryMap.put(name, rep);\n\t\treturn rep;\n\t}", "public Response create(UriInfo uriInfo, B bean, String stagingUuid) {\n validate(bean.getUuid(), bean, true);\n BE entity =\n getSerializer().deserializeNew(bean, stagingUuid, RestImportExportHelper.isImport(uriInfo));\n String uuid = entity.getUuid();\n return Response.created(getGetUri(uuid)).build();\n }", "public void setRepository(Repository repo) {\n\t\tthis.repo = repo;\n\t}", "ArtifactRepository getRepository();", "Policy_Repository createPolicy_Repository();", "public DeveloperImpl(DeveloperRepository repository, SkillRepository skillRepo) {\n this.repository = repository;\n this.skillRepo = skillRepo;\n }", "@Test\n public void testCommitsApi() throws Exception\n {\n \n \n RequestBuilder builder = new RequestBuilder(\"GET\");\n Request request = builder.setUrl(\n UriTemplate.fromTemplate(BASE)\n .append(PATH_EXPRESSION)\n .set(\"user\", \"damnhandy\")\n .set(\"repo\", \"Handy-URI-Templates\")\n .set(\"function\",\"commits\")\n .expand()).build();\n Assert.assertEquals(\"https://api.github.com/repos/damnhandy/Handy-URI-Templates/commits\", request.getUrl());\n executeRequest(createClient(), request);\n }", "private void handleCreateOperation(String args[]) {\n if (args.length < 4) {\n String requiredArgs = \"<name> <color>\";\n Messages.badNumberOfArgsMessage(args.length, CREATE_OPERATION, requiredArgs);\n System.exit(1);\n }\n\n // set arguments from command line to variables\n String name = args[2];\n String colorString = args[3];\n // convert string to color\n Color colorEnum = null;\n try {\n colorEnum = Color.parseColor(colorString);\n } catch (IllegalArgumentException e) {\n Messages.printAllColors();\n System.exit(1);\n }\n\n // everything is ok, create new brick\n BrickDto brickDto = new BrickDto(name, colorEnum, \"\");\n\n Client client = ClientBuilder.newBuilder().build();\n WebTarget webTarget = client.target(\"http://localhost:8080/pa165/rest/bricks/\");\n webTarget.register(auth);\n Response response = webTarget.request(MediaType.APPLICATION_JSON).post(Entity.entity(brickDto, MediaType.APPLICATION_JSON_TYPE));\n\n // print out some response\n // successful response code is 201 == CREATED\n if (response.getStatus() == Response.Status.CREATED.getStatusCode()) {\n System.out.println(\"Brick with name '\" + name + \"' and color '\" + colorString + \"' was created\");\n } else {\n System.out.println(\"Error on server, server returned \" + response.getStatus());\n }\n }", "public Repository migrate(MigrateRepoForm repository) {\n return apiClient.deserialize(apiClient.postBody(\"/repos/migrate\", repository), Repository.class);\n }", "public ImagePull repository(String repository) {\n getParameters().put(\"repository\", repository);\n return this;\n }", "public void createVersion() {\r\n\t\tif (!active) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (applicationId == null) {\r\n\t\t\tcreateApplication();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tJSONObject versionJson = getJSonResponse(Unirest.post(url + VERSION_API_URL)\r\n\t\t\t\t\t.field(\"name\", SeleniumTestsContextManager.getApplicationVersion())\r\n\t\t\t\t\t.field(\"application\", applicationId));\r\n\t\t\tversionId = versionJson.getInt(\"id\");\r\n\t\t} catch (UnirestException | JSONException e) {\r\n\t\t\tthrow new SeleniumRobotServerException(\"cannot create version\", e);\r\n\t\t}\r\n\t}", "CreateResponse create(@NonNull CreateRequest request);", "Collection<String> createVersion(Workspace workspace, Collection<String> paths) throws RepositoryException;", "public PullRequest pullRequest(String owner, String repo, CreatePullRequestOption option) {\n return apiClient.deserialize(apiClient.postBody(String.format(\"/repos/%s/%s/pulls\", owner, repo), option), PullRequest.class);\n }", "public RepoCreate withAutoInit(final Optional<Boolean> auto) {\n return new RepoCreate(\n this.nam,\n this.priv,\n this.descr,\n this.home,\n auto,\n this.organization\n );\n }", "@Test\n public void testCommitsApiWithSpecificCommit() throws Exception\n {\n \n \n RequestBuilder builder = new RequestBuilder(\"GET\");\n Request request = builder.setUrl(\n UriTemplate.fromTemplate(BASE)\n .append(PATH_EXPRESSION)\n .set(\"user\", \"damnhandy\")\n .set(\"repo\", \"Handy-URI-Templates\")\n .set(\"function\",\"commits\")\n .set(\"id\",\"7cdf7ff75f8ede138228ceff7f5a1c18a5835b94\")\n .expand()).build();\n Assert.assertEquals(\"https://api.github.com/repos/damnhandy/Handy-URI-Templates/commits/7cdf7ff75f8ede138228ceff7f5a1c18a5835b94\", request.getUrl());\n executeRequest(createClient(), request);\n }", "@POST\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n @RolesAllowed({\"admin\"})\n public Tag create(Tag tag, @Context UriInfo uriInfo) {\n Long taskId = (uriInfo.getPathSegments().size() != 1?\n Long.valueOf(uriInfo.getPathSegments().get(3).getPath())\n :null);\n\n if (taskId != null) {\n Task task = em.find(Task.class, taskId);\n\n if (task == null) {\n throw new InvalidParentException(String.format(\"Task with ID %s not found for this tag!\", taskId));\n }\n\n task.getTags().add(tag);\n }\n\n em.persist(tag);\n\n return tag;\n }", "public abstract AbstractTask createTask(String repositoryUrl, String id, String summary);", "interface WithCreate\n extends DefinitionStages.WithLocation,\n DefinitionStages.WithTags,\n DefinitionStages.WithKind,\n DefinitionStages.WithSku,\n DefinitionStages.WithIdentity,\n DefinitionStages.WithProperties {\n /**\n * Executes the create request.\n *\n * @return the created resource.\n */\n Account create();\n\n /**\n * Executes the create request.\n *\n * @param context The context to associate with this operation.\n * @return the created resource.\n */\n Account create(Context context);\n }", "@POST\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n @ApiOperation(value = \"This method allows to create a new requirement.\")\n @ApiResponses(value = {\n @ApiResponse(code = HttpURLConnection.HTTP_CREATED, message = \"Returns the created requirement\", response = RequirementEx.class),\n @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = \"Unauthorized\"),\n @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = \"Not found\"),\n @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = \"Internal server problems\")\n })\n public Response createRequirement(@ApiParam(value = \"Requirement entity\", required = true) Requirement requirementToCreate) {\n DALFacade dalFacade = null;\n try {\n UserAgent agent = (UserAgent) Context.getCurrent().getMainAgent();\n long userId = agent.getId();\n String registratorErrors = service.bazaarService.notifyRegistrators(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING));\n if (registratorErrors != null) {\n ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registratorErrors);\n }\n // TODO: check whether the current user may create a new requirement\n dalFacade = service.bazaarService.getDBConnection();\n Gson gson = new Gson();\n Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId);\n requirementToCreate.setCreatorId(internalUserId);\n Vtor vtor = service.bazaarService.getValidators();\n vtor.useProfiles(\"create\");\n vtor.validate(requirementToCreate);\n if (vtor.hasViolations()) {\n ExceptionHandler.getInstance().handleViolations(vtor.getViolations());\n }\n vtor.resetProfiles();\n\n // check if all components are in the same project\n for (Component component : requirementToCreate.getComponents()) {\n component = dalFacade.getComponentById(component.getId());\n if (requirementToCreate.getProjectId() != component.getProjectId()) {\n ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.VALIDATION, \"Component does not fit with project\");\n }\n }\n boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_REQUIREMENT, String.valueOf(requirementToCreate.getProjectId()), dalFacade);\n if (!authorized) {\n ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString(\"error.authorization.requirement.create\"));\n }\n Requirement createdRequirement = dalFacade.createRequirement(requirementToCreate, internalUserId);\n dalFacade.followRequirement(internalUserId, createdRequirement.getId());\n\n // check if attachments are given\n if (requirementToCreate.getAttachments() != null && !requirementToCreate.getAttachments().isEmpty()) {\n for (Attachment attachment : requirementToCreate.getAttachments()) {\n attachment.setCreatorId(internalUserId);\n attachment.setRequirementId(createdRequirement.getId());\n vtor.validate(attachment);\n if (vtor.hasViolations()) {\n ExceptionHandler.getInstance().handleViolations(vtor.getViolations());\n }\n vtor.resetProfiles();\n dalFacade.createAttachment(attachment);\n }\n }\n\n createdRequirement = dalFacade.getRequirementById(createdRequirement.getId(), internalUserId);\n service.bazaarService.getNotificationDispatcher().dispatchNotification(service, createdRequirement.getCreation_time(), Activity.ActivityAction.CREATE, createdRequirement.getId(),\n Activity.DataType.REQUIREMENT, createdRequirement.getComponents().get(0).getId(), Activity.DataType.COMPONENT, internalUserId);\n return Response.status(Response.Status.CREATED).entity(gson.toJson(createdRequirement)).build();\n } catch (BazaarException bex) {\n if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) {\n return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build();\n } else {\n return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build();\n }\n } catch (Exception ex) {\n BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, \"\");\n return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build();\n } finally {\n service.bazaarService.closeDBConnection(dalFacade);\n }\n }", "public void createProject(Project newProject);", "private void buildRepository(ServerRepository serverRepository, boolean updateServerInfo) {\n RebuildRepositoryTask rrTask = new RebuildRepositoryTask(serverRepository);\n boolean success = rrTask.execute();\n\n if (success)\n log.info(\"successfully built repository {}\", serverRepository.getIdentifier());\n else\n log.info(\"error building repository {}\", serverRepository.getIdentifier());\n\n if (updateServerInfo)\n updateServerInfo();\n }", "public void createArtifact(\n com.google.cloud.aiplatform.v1.CreateArtifactRequest request,\n io.grpc.stub.StreamObserver<com.google.cloud.aiplatform.v1.Artifact> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getCreateArtifactMethod(), getCallOptions()),\n request,\n responseObserver);\n }", "public Contribution createContribution()\n {\n return new Contribution();\n }", "void tagCommit(TRepo repo, TCommit commit, String tagName);", "@ApiOperation(\"Creates a Team\")\n @PostMapping(\"/API/v1/team\")\n public ResponseEntity<TeamAPI> createTeam(@RequestParam String nombreEquipo){\n TeamString salida = teamService.crearTeam(nombreEquipo, false);\n\n if(salida.getSalida().equals(\"OK\")){\n return new ResponseEntity<>(salida.getTeam().toTeamAPI(), HttpStatus.OK);\n }\n else {\n return new ResponseEntity(salida.getSalida(), HttpStatus.NOT_FOUND);\n }\n\n }", "CreateSiteResult createSite(CreateSiteRequest createSiteRequest);", "default void createArtifact(\n com.google.cloud.aiplatform.v1.CreateArtifactRequest request,\n io.grpc.stub.StreamObserver<com.google.cloud.aiplatform.v1.Artifact> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(\n getCreateArtifactMethod(), responseObserver);\n }", "public RepoCreate withDescription(\n final String desc\n ) {\n return new RepoCreate(\n this.nam,\n this.priv,\n desc,\n this.home,\n this.init,\n this.organization\n );\n }", "public RepoCreate withAutoInit(final boolean auto) {\n return new RepoCreate(\n this.nam,\n this.priv,\n this.descr,\n this.home,\n Optional.of(auto),\n this.organization\n );\n }", "public static void createRepositorySubset(Repository repo) {\n RepoFile newRoot = RepoFile.make(AbstractRepository.OUTPUT_REPO.getValue());\n \n Random random = new Random();\n double max = REPO_SUBSET_RATE.getValue();\n \n logger.info(\"Beginning random selection of projects...\");\n int count = 0;\n int total = repo.getProjectCount();\n int included = 0;\n for (RepoProject project : repo.getProjects()) {\n // Make sure the project has at least one file\n IFileSet files = project.getFileSet();\n if (files.getJavaFileCount() > 0) {\n if (random.nextDouble() < max) {\n included++;\n logger.info(\"Including project \" + ++count + \" of \" + total);\n \n // Copy the project into the new repository\n RepoFile newProject = newRoot.rebaseFile(project.getProjectRoot());\n if (!FileUtils.copyFile(project.getProjectRoot().toFile(), newProject.toFile())) {\n logger.info(\" Error in copying project.\");\n }\n } else {\n logger.info(\"Skipping project \" + ++count + \" of \" + total);\n } \n } else {\n logger.info(\"Skipping project \" + ++count + \" of \" + total);\n }\n }\n \n logger.info(included + \" projects included in new repository.\");\n // Clean temp files\n FileUtils.cleanTempDir();\n }", "private ProxyCreationResult createRepo( String trackingId, URL url, String name )\n throws IndyDataException\n {\n UrlInfo info = new UrlInfo( url.toExternalForm() );\n\n UserPass up = UserPass.parse( ApplicationHeader.authorization, httpRequest, url.getAuthority() );\n String baseUrl = getBaseUrl( url );\n\n logger.debug( \">>>> Create repo: trackingId=\" + trackingId + \", name=\" + name );\n ProxyCreationResult result = repoCreator.create( trackingId, name, baseUrl, info, up,\n LoggerFactory.getLogger( repoCreator.getClass() ) );\n ChangeSummary changeSummary =\n new ChangeSummary( ChangeSummary.SYSTEM_USER, \"Creating HTTProx proxy for: \" + info.getUrl() );\n\n RemoteRepository remote = result.getRemote();\n if ( remote != null )\n {\n storeManager.storeArtifactStore( remote, changeSummary, false, true, new EventMetadata() );\n }\n\n HostedRepository hosted = result.getHosted();\n if ( hosted != null )\n {\n storeManager.storeArtifactStore( hosted, changeSummary, false, true, new EventMetadata() );\n }\n\n Group group = result.getGroup();\n if ( group != null )\n {\n storeManager.storeArtifactStore( group, changeSummary, false, true, new EventMetadata() );\n }\n\n return result;\n }", "public GithubClient() {\n// client = ClientBuilder.newClient();\n// userTarget = client.target(\"https://api.github.com/users/{username}\");\n// userRepoTarget = client.target(\"https://api.github.com/users/{username}/repos\");\n// releaseCountTarget = client.target(\"https://api.github.com/repos/{owner}/{repo}/releases\");\n }", "public RepoCreate withName(\n final String nme\n ) {\n return new RepoCreate(\n nme,\n this.priv,\n this.descr,\n this.home,\n this.init,\n this.organization\n );\n }", "public com.amazon.s3.CreateBucketResponse createBucket(com.amazon.s3.CreateBucket createBucket);", "Drone createDrone();", "public void createBranch(String branch)\r\n \t{\r\n \t\tif (this.hasBranch(branch))\r\n \t\t\tthrow new ExternalFileMgrException(ERR_BRANCH_ALREADY_EXISTS + branch);\r\n \t\tFile dstFolder= new File(this.externalDataFolder, branch);\r\n \t\tdstFolder.mkdir();\r\n \t}", "TArea checkout(TCommit commit, TRepo repo, AreaFactory<TContent, TArea> areaFactory, ContentFactory<TContent> contentFactory);", "H enrichRepo(RepoType repoType);", "@Bean\n @RequestScope\n public PersonRepository create(final IESJCEventStore eventStore) {\n return new PersonRepository(eventStore);\n }", "@RequestMapping(value = \"/drivers\",\n method = RequestMethod.POST,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<Driver> create(@RequestBody Driver driver) throws URISyntaxException {\n log.debug(\"REST request to save Driver : {}\", driver);\n if (driver.getId() != null) {\n return ResponseEntity.badRequest().header(\"Failure\", \"A new driver cannot already have an ID\").body(null);\n }\n Driver result = driverRepository.save(driver);\n return ResponseEntity.created(new URI(\"/api/drivers/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(\"driver\", result.getId().toString()))\n .body(result);\n }", "Repository getRepository();", "TCommit getCommitForTag(TRepo repo, String tagName);", "private void commitRepChanges() {\r\n\t\t\r\n\t\t// get repository info\r\n\t\tString repURL = repURLFld.getText();\r\n\t\tString boURI = repBaseOntFld.getText();\r\n\t\tthis.repositoryAuthor = repAuthorFld.getText();\r\n\t\tthis.reposityCreatedDate = repDateFld.getText();\r\n\t\t\r\n\t\tString status = \"Status: [ACTION - Commit to Repository]...\";\r\n\t\ttry {\r\n\t\t\tthis.repositoryURI = new URI(repURL);\r\n\t\t\tthis.baseOntologyURI = new URI(boURI);\r\n\t\t}\r\n\t\tcatch (URISyntaxException ex) {\r\n\t\t\tstatusBar.setText(status+\"Invalid Repository URL and/or Base Ontology URI\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t// check if repository already exists\r\n\t\t\tboolean repExists = this.loadRepositoryHeader();\r\n\t\t\t\r\n\t\t\tif (!repExists) {\r\n\t\t\t\t// creating new repository\r\n\t\t\t\t// form repository header\r\n\t\t\t\tURI[] headerURI = new URI[1];\r\n\t\t\t\theaderURI[0] = new URI(this.repositoryURI+\"#header\");\r\n\t\t\t\t\r\n\t\t\t\tif (this.repositoryAuthor.equals(\"\") || this.reposityCreatedDate.equals(\"\")) {\r\n\t\t\t\t\tint opt = JOptionPane.showConfirmDialog(null, \"Repository Author and/or Date not specified. Continue?\", \"Creating Repository\", JOptionPane.YES_NO_OPTION);\r\n\t\t\t\t\tif (opt == JOptionPane.NO_OPTION) return;\r\n\t\t\t\t}\r\n\t\t\t\t// create annotea description for header\r\n\t\t\t\tDescription header = new Description();\r\n\t\t\t\theader.setAnnotates(headerURI);\r\n\t\t\t\theader.setAuthor(this.repositoryAuthor);\r\n\t\t\t\theader.setCreated(this.reposityCreatedDate);\r\n\t\t\t\theader.setAnnotatedEntityDefinition(this.baseOntologyURI.toString());\r\n\t\t\t\tthis.headVersionNumber = 0;\r\n\t\t\t\theader.setBody(String.valueOf(this.headVersionNumber));\r\n\t\t\t\theader.setBodyType(\"text/html\");\r\n\t\t\t\theader.setAnnotationType(this.annotType);\r\n\t\t\t\tclient.post(header);\r\n\t\t\t\tstatusBar.setText(status+\"Ontology Repository Header posted at \"+headerURI[0]);\r\n\t\t\t\ttoggleRepOptions(false);\r\n\t\t\t\tversionDescriptions[0] = header;\r\n\t\t\t\tswoopModel.updateVersionRepository(repositoryURI, versionDescriptions);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// test changes\r\n\t\t\tboolean success = this.testChanges(true);\r\n\t\t\tif (success){\r\n\t\t\t\t// prompt user for comment on commit\r\n\t\t\t\tString commitComment = JOptionPane.showInputDialog(this, \"COMMIT New Version (Details):\");\r\n\t\t\t\t\r\n\t\t\t\tif (commitComment==null) {\r\n\t\t\t\t\tstatusBar.setText(status+\"CANCELLED\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// transform SwoopChange list to Description list (to save author, date, uris etc)\r\n\t\t\t\tList descList = transformChangeList(repChanges);\r\n\t\t\t\t// serialize each description into RDF/XML\r\n\t\t\t\t// and make it one large string with separator (\"[SWOOP-ANNOTATED-CHANGE-SET]\") in the middle\r\n\t\t\t\tString largeChangeSetString = \"\";\r\n\t\t\t\tfor (Iterator iter = descList.iterator(); iter.hasNext();) {\r\n\t\t\t\t\tDescription desc = (Description) iter.next();\r\n\t\t\t\t\tString descStr = desc.serializeIntoString(swoopModel);\t\t\t\t\t\r\n\t\t\t\t\tlargeChangeSetString += descStr + separator;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// ENCODE CDATA\r\n\t\t\t\tlargeChangeSetString = largeChangeSetString.replaceAll(\"CDATA\", \"ENCODED-CDATA\");\r\n\t\t\t\tlargeChangeSetString = largeChangeSetString.replaceAll(\"]]>\", \"]ENCODED]>\");\r\n\t\t\t\t\r\n\t\t\t\t// finally commit a single annotation with the entire changeset string in the body\r\n\t\t\t\t// also allow author to make annotation on commit\r\n\t\t\t\tDescription commit = new Description();\r\n\t\t\t\tcommit.setAuthor(swoopModel.getUserName());\r\n\t\t\t\tcommit.setCreated(swoopModel.getTimeStamp());\r\n\t\t\t\tcommit.setBody(largeChangeSetString);\r\n\t\t\t\tcommit.setBodyType(\"text/html\");\r\n\t\t\t\tcommit.setAnnotatedEntityDefinition(commitComment);\r\n\t\t\t\tcommit.setAnnotationType(this.annotType);\r\n\t\t\t\t\r\n\t\t\t\t// increment headVersionNum and write new commit\r\n\t\t\t\t// at repURL+\"#\"+headVersionNum\r\n\t\t\t\tthis.headVersionNumber++;\r\n\t\t\t\tURI[] annotates = new URI[1];\r\n\t\t\t\tannotates[0] = new URI(repositoryURI.toString()+\"#\"+String.valueOf(this.headVersionNumber));\r\n\t\t\t\tcommit.setAnnotates(annotates);\r\n\t\t\t\t// COMMIT!\r\n\t\t\t\tclient.post(commit);\r\n\t\t\t\t\r\n\t\t\t\t// post-process:\r\n\t\t\t\t// 1. rewrite rep header added newly incremented headVersionNumber \r\n\t\t\t\tthis.rewriteRepHeader();\r\n\t\t\t\t// 2. set newCommitNode params to current commit\r\n\t\t\t\tnewCommitNode.swoopChange.setAuthor(commit.getAuthor());\r\n\t\t\t\tnewCommitNode.swoopChange.setTimeStamp(commit.getCreated());\r\n\t\t\t\tnewCommitNode.swoopChange.setDescription(commit.getAnnotatedEntityDefinition());\r\n\t\t\t\t// 3. save newCommitNode in versionCommits array and Description in versionDescriptions array\r\n\t\t\t\tversionNodes[this.headVersionNumber] = newCommitNode;\r\n\t\t\t\tversionDescriptions[this.headVersionNumber] = commit;\r\n\t\t\t\tswoopModel.updateVersionRepository(repositoryURI, versionDescriptions);\r\n\t\t\t\t// 4. for each child of newCommitNode, set its swoopChange.onRepository value to true\r\n\t\t\t\tfor (Iterator iter3=newCommitNode.children.iterator(); iter3.hasNext();) {\r\n\t\t\t\t\tTreeTableNode child = (TreeTableNode) iter3.next();\r\n\t\t\t\t\tchild.swoopChange.isOnRepository = true;\r\n\t\t\t\t}\r\n\t\t\t\t// 5. create newCommitNode and add to root at the end\r\n\t\t\t\tnewCommitNode = new TreeTableNode(new SwoopChange(swoopModel.getUserName(), null, null, swoopModel.getTimeStamp(), \"New Version Commit\", true, false));\r\n\t\t\t\tnewCommitNode.swoopChange.isTopNode = true;\r\n\t\t\t\trepRoot.addChild(newCommitNode);\r\n\t\t\t\trepChanges = new ArrayList(); // also clear this\r\n\t\t\t\tstatusBar.setText(status+\"Committed New Version \"+this.headVersionNumber);\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\tcatch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t\tstatusBar.setText(status+\"FAILED\");\r\n\t\t}\r\n\t\tthis.refreshRepTreeTable(false);\r\n\t}", "public static void main(String[] args) {\nSystem.out.println(\"day one example how to use git\");\r\n\t}", "void setRepoType(String repoType);", "@Override\r\n\tpublic Libro create(Libro libro) {\n\t\treturn libroRepository.save(libro);\r\n\t}", "interface WithCreate\n extends DefinitionStages.WithTags,\n DefinitionStages.WithNetworkProfile,\n DefinitionStages.WithAutoShutdownProfile,\n DefinitionStages.WithConnectionProfile,\n DefinitionStages.WithVirtualMachineProfile,\n DefinitionStages.WithSecurityProfile,\n DefinitionStages.WithRosterProfile,\n DefinitionStages.WithLabPlanId,\n DefinitionStages.WithTitle,\n DefinitionStages.WithDescription {\n /**\n * Executes the create request.\n *\n * @return the created resource.\n */\n Lab create();\n\n /**\n * Executes the create request.\n *\n * @param context The context to associate with this operation.\n * @return the created resource.\n */\n Lab create(Context context);\n }", "@PostMapping(\"/cards\")\n StarbucksCard newCard() {\n StarbucksCard newcard = new StarbucksCard();\n\n Random random = new Random();\n int num = random.nextInt(900000000) + 100000000;\n int code = random.nextInt(900) + 100;\n\n newcard.setCardNumber(String.valueOf(num));\n newcard.setCardCode(String.valueOf(code));\n newcard.setBalance(20.00);\n newcard.setActivated(false);\n newcard.setStatus(\"New Card\");\n return repository.save(newcard);\n }", "public interface TesteApi {\n\n @GET(\"/repos/{owner}/{repo}/contributors\")\n Contributor[] contributors(\n @Path(\"owner\") String owner,\n @Path(\"repo\") String repo\n );\n}", "public void create(Branch branch) {\n branch_dao.create(branch);\n }", "public RepoCreate withPrivacy(final boolean privacy) {\n return new RepoCreate(\n this.nam,\n privacy,\n this.descr,\n this.home,\n this.init,\n this.organization\n );\n }", "@Test(enabled = true)\n public void createPerson() {\n List <Account> accounts = new ArrayList<>();\n List<Subscription> sub = new ArrayList<>();\n \n Contact contact = new Contact.Builder().emailaddress(\"[email protected]\").phoneNumber(\"021345685\").build();\n Address address = new Address.Builder().location(\"Daveyton\").streetName(\"Phaswane Street\").houseNumber(45).build();\n \n repo = ctx.getBean(PersonsRepository.class);\n Person p = new Person.Builder()\n .firstname(\"Nobu\")\n .lastname(\"Tyokz\")\n .age(25)\n .account(accounts)\n .sub(sub)\n .contact(contact)\n .address(address)\n .build();\n repo.save(p);\n id = p.getId();\n Assert.assertNotNull(p);\n\n }", "public Repository() {\n\n }", "private static Release release() throws Exception {\n final Release release = Mockito.mock(Release.class);\n final Repo repo = new MkGithub(\"john\").repos().create(\n new Repos.RepoCreate(\"blueharvest\", false)\n );\n Mockito.doReturn(repo).when(release).repo();\n Mockito.doReturn(1).when(release).number();\n return release;\n }", "public Mono<Application> createBranch(String defaultApplicationId, GitBranchDTO branchDTO, MultiValueMap<String, String> params) {\n\n final String srcBranch = params.getFirst(FieldName.BRANCH_NAME);\n if (StringUtils.isEmptyOrNull(srcBranch)) {\n throw new AppsmithException(AppsmithError.INVALID_PARAMETER, FieldName.BRANCH_NAME);\n }\n\n return applicationService.getApplicationByBranchNameAndDefaultApplication(srcBranch, defaultApplicationId, MANAGE_APPLICATIONS)\n .zipWhen(srcApplication -> {\n GitApplicationMetadata gitData = srcApplication.getGitApplicationMetadata();\n if (gitData.getDefaultApplicationId().equals(srcApplication.getId())) {\n return Mono.just(srcApplication.getGitApplicationMetadata().getGitAuth());\n }\n return applicationService.getSshKey(gitData.getDefaultApplicationId());\n })\n .flatMap(tuple -> {\n Application srcApplication = tuple.getT1();\n GitAuth defaultGitAuth = tuple.getT2();\n GitApplicationMetadata srcBranchGitData = srcApplication.getGitApplicationMetadata();\n if (srcBranchGitData == null\n || srcBranchGitData.getDefaultApplicationId() == null\n || srcBranchGitData.getRepoName() == null) {\n return Mono.error(new AppsmithException(\n AppsmithError.INVALID_GIT_CONFIGURATION,\n \"Unable to find the parent branch. Please create a branch from other available branches\"\n ));\n }\n Path repoSuffix = Paths.get(srcApplication.getOrganizationId(), srcBranchGitData.getDefaultApplicationId(), srcBranchGitData.getRepoName());\n // Create a new branch from the parent checked out branch\n return Mono.zip(\n gitExecutor.checkoutToBranch(repoSuffix, srcBranch)\n .onErrorResume(error -> Mono.error(new AppsmithException(AppsmithError.GIT_ACTION_FAILED, \"checkout\", \"Unable to find \" + srcBranch))),\n gitExecutor.fetchRemote(repoSuffix, defaultGitAuth.getPublicKey(), defaultGitAuth.getPrivateKey(), false))\n .flatMap(ignore -> gitExecutor.listBranches(repoSuffix, ListBranchCommand.ListMode.REMOTE, srcBranchGitData.getRemoteUrl(), defaultGitAuth.getPublicKey(), defaultGitAuth.getPrivateKey())\n .flatMap(branchList -> {\n boolean isDuplicateName = branchList.stream()\n // TODO We are only supporting origin as the remote name so this is safe\n // but needs to be altered if we starts supporting user defined remote names\n .anyMatch(branch -> branch.getBranchName().replace(\"refs/remotes/origin/\", \"\")\n .equals(branchDTO.getBranchName()));\n\n if (isDuplicateName) {\n return Mono.error(new AppsmithException(\n AppsmithError.DUPLICATE_KEY_USER_ERROR,\n \"remotes/origin/\" + branchDTO.getBranchName(),\n FieldName.BRANCH_NAME\n ));\n }\n return gitExecutor.createAndCheckoutToBranch(repoSuffix, branchDTO.getBranchName());\n }))\n .flatMap(branchName -> {\n final String srcApplicationId = srcApplication.getId();\n srcBranchGitData.setBranchName(branchName);\n // Save a new application in DB and update from the parent branch application\n srcBranchGitData.setGitAuth(null);\n srcApplication.setId(null);\n srcApplication.setPages(null);\n srcApplication.setPublishedPages(null);\n srcApplication.setGitApplicationMetadata(srcBranchGitData);\n return Mono.zip(\n applicationService.save(srcApplication),\n importExportApplicationService.exportApplicationById(srcApplicationId, SerialiseApplicationObjective.VERSION_CONTROL)\n );\n })\n .onErrorResume(error -> Mono.error(new AppsmithException(AppsmithError.GIT_ACTION_FAILED, \"branch\", error.getMessage())));\n })\n .flatMap(tuple -> {\n Application savedApplication = tuple.getT1();\n return importExportApplicationService.importApplicationInOrganization(\n savedApplication.getOrganizationId(),\n tuple.getT2(),\n savedApplication.getId()\n );\n });\n }", "public Repository createRepository(String fileServerName, \r\n \t\tString displayName,\r\n \t\tString folderSystemName, \r\n \t\tString repoName, \r\n \t\tString fileDatabasePath,\r\n \t\tString defaultFolderDispalyName) throws LocationAlreadyExistsException\r\n {\r\n\r\n\t\t// create the file server\r\n\t\tfileServer = fileServerService.createFileServer(fileServerName);\r\n\t\tfileServer.setId(1l);\r\n\r\n\t\t// create the file database\r\n\t\tDefaultFileDatabaseInfo fileDatabaseInfo = new DefaultFileDatabaseInfo(fileServer.getId(),\r\n\t\t\t\tdisplayName, folderSystemName, fileDatabasePath, defaultFolderDispalyName, \"uniqueFolderName\");\r\n\t\tFileDatabase fileDatabase = fileServerService.createFileDatabase(fileDatabaseInfo);\r\n\t\t\r\n\t\t// create the repository\r\n\t\trepository = repositoryService.createRepository(repoName, fileDatabase);\r\n\t\trepository.setId(1l);\r\n\t\t\r\n\t\treturn repository;\r\n }" ]
[ "0.64799607", "0.61946714", "0.5942678", "0.5871605", "0.58289343", "0.58199525", "0.5801379", "0.5650184", "0.5566602", "0.54939413", "0.54794806", "0.54685163", "0.5384734", "0.5363201", "0.53159964", "0.5276887", "0.5116236", "0.51124275", "0.502043", "0.48835814", "0.48756465", "0.4798523", "0.4798523", "0.47919774", "0.47840208", "0.47829914", "0.47705418", "0.47620308", "0.475418", "0.47254962", "0.4716215", "0.47153586", "0.47097108", "0.46795517", "0.46642765", "0.46597576", "0.46332806", "0.4593795", "0.4590544", "0.45769086", "0.45687398", "0.45569047", "0.4507091", "0.44964355", "0.44944122", "0.44795334", "0.44401222", "0.44168893", "0.44028828", "0.4390123", "0.43866682", "0.43764699", "0.43644994", "0.43580383", "0.43441433", "0.43419194", "0.43383536", "0.43351498", "0.43249655", "0.43227908", "0.43206075", "0.43185475", "0.43184638", "0.4316779", "0.4313925", "0.43098748", "0.42980057", "0.4290605", "0.42834577", "0.4282907", "0.42751828", "0.42723757", "0.42593554", "0.42554638", "0.42541954", "0.42481735", "0.4247675", "0.42441487", "0.42439237", "0.42382106", "0.4236342", "0.42346773", "0.42333528", "0.42322606", "0.42244485", "0.422328", "0.4219856", "0.4218072", "0.4211867", "0.42073217", "0.4206371", "0.4204508", "0.4201514", "0.42003655", "0.41896993", "0.4182509", "0.41818893", "0.4181752", "0.41809872", "0.41764536" ]
0.5987682
2
TODO Autogenerated method stub
@Override public void editPost(Integer postID, String message, String posterName, String[] imageName, String[] imageID) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void editThread(Integer threadID, String topic, String message, String posterName, String[] imageName, String[] imageID) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void createPost(Integer postID, Integer parentPostID, String posterName, String message, String[] imageName, String[] imageID) { }
{ "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
Process the attack in the animal through the strategy and recalculates the available life power.
public final void receiveAttack(Weapon weapon) { this.availableLifePower = damageStrategy.processAttack(this, weapon); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void resolve(){\n logger.log(Level.FINE,attacker.getName()+\" withering attacked \"+defender.getName());\n AttackState state=new AttackState();\n state.weaponDamage=weapon.getDamage();\n state.initialAttackpool=baseAttackdice+baseAccuracy-woundpenalty;\n attacker.declareWitheringAttack(state); // If the attacker wants to change the pool, he modifies the state accordingly.\n defender.declareWitheringDV(state); // Defender declares their dv against this specific attack. This sets both initialdv and changedDv\n state.initialAttackRoll= new DiceThrow(state.changedAttackpool);\n attacker.modifyWitheringAttackRollAttacker(state); //This sets stuff like modifiedAttackRollAttacker and AttackerRollValuation\n defender.modifyWitheringAttackRollDefender(state); //This sets defender modifiedAttackRollDefender\n state.attackRollSuccesses=state.modifiedAttackRollDefender.evaluateResults(state.AttackRollValuationAttacker);\n state.threshholdSuccesses=state.attackRollSuccesses-state.changedDv;\n logger.log(Level.FINE,attacker.getName()+\" rolled \"+state.changedAttackpool+\" dice against \"+defender.getName()+\"'s dv of \"+state.changedDv+\" and gained \"+state.attackRollSuccesses+\" successes.\");\n attacker.changeWitheringThreshholdAttacker(state); //This sets thresholdModifiedAttacker\n defender.changeWitheringThreshholdDefender(state); //This sets thresholdModifiedDefender\n if(state.thresholdModifiedDefender>=0) {\n logger.log(Level.FINE,attacker.getName()+\" hit \"+defender.getName()+\" with \"+state.thresholdModifiedDefender+\" threshhold successes.\");\n attacker.modifyWitheringRawDamageAttacker(state); //Sets normal raw damageType, based on strength and weapon damageType, and then sets rawDamagemModifiedAttacker\n defender.modifyWitheringRawDamageDefender(state); //this sets rawDamageModifiedDefender, and sets up the various soak values, so natural soak and armor soak.\n logger.log(Level.FINE, \"The raw damage of the attack is: \"+state.rawDamageModifiedDefender);\n state.totalSoak = Math.max(state.defenderArmorSoak - ignoredArmorSoak, 0) + state.defenderNaturalSoak; //\n attacker.modifyTotalSoakAttacker(state); //This sets totalSoakmodifiedAttacker. Don't think this actually has support in the solar charmset, but giving opportunities to work with.\n defender.modifyTotalSoakDefender(state); // This sets totalSoakmodifiedDefender.\n state.postSoakSuccesses=Math.max(state.rawDamageModifiedDefender-state.totalSoakModifiedDefender,weapon.getOverwhelming());\n logger.log(Level.FINE,state.totalSoakModifiedDefender+\" damage is soaked, leading to post soak dice of \"+state.postSoakSuccesses);\n attacker.declarePostSoakAttacker(state); //sets postSoakSuccessesModifiedAttacker\n defender.declarePostSoakDefender(state); //sets postSoakSuccessesModifiedDefender\n DiceThrow droll=new DiceThrow(state.postSoakSuccessesModifiedDefender);\n state.damageRoll=droll;\n attacker.modifyWitheringDamageRollAttacker(state); //sets damageRollmodifiedAttacker and damageRollvValuation\n defender.modifyWitheringDamageRollDefender(state); //sets damageRollmodifiedDefender\n state.initiativeDamageDone=state.damageRollModifiedDefender.evaluateResults(state.damageRollValuation);\n logger.log(Level.FINE,attacker.getName()+\" rolls \"+state.postSoakSuccessesModifiedDefender+\" dice and achieves \"+state.initiativeDamageDone+\" successes.\");\n attacker.modifyInitiativeDamageAttacker(state);\n defender.modifyInitiativeDamageDefender(state); //Since this is the last change of initiative, we can check whether the defender was crashed here.\n attacker.updateInitiativeAttacker(state);\n defender.updateInitiativeDefender(state);//Here we should handle all the initiative changes respectively, with checking if people are crashed etc.\n }\n else{\n attacker.failedWitheringAttackAttacker(state);\n defender.failedWitheringAttackDefender(state);\n }\n\n }", "private static void decisionWhenAttacking() {\n\t\tif (isNewAttackState()) {\n\t\t\tchangeStateTo(STATE_ATTACK_PENDING);\n\n\t\t\t// We will try to define place for our army where to attack. It\n\t\t\t// probably will be center around a crucial building like Command\n\t\t\t// Center. But what we really need is the point where to go, not the\n\t\t\t// unit. As long as the point is defined we can attack the enemy.\n\n\t\t\t// If we don't have defined point where to attack it means we\n\t\t\t// haven't yet decided where to go. So it's the war's very start.\n\t\t\t// Define this assault point now. It would be reasonable to relate\n\t\t\t// it to a particular unit.\n\t\t\t// if (!isPointWhereToAttackDefined()) {\n\t\t\tStrategyManager.defineInitialAttackTarget();\n\t\t\t// }\n\t\t}\n\n\t\t// Attack is pending, it's quite \"regular\" situation.\n\t\tif (isGlobalAttackInProgress()) {\n\n\t\t\t// Now we surely have defined our point where to attack, but it can\n\t\t\t// be so, that the unit which was the target has been destroyed\n\t\t\t// (e.g. just a second ago), so we're standing in the middle of\n\t\t\t// wasteland.\n\t\t\t// In this case define next target.\n\t\t\t// if (!isSomethingToAttackDefined()) {\n\t\t\tdefineNextTarget();\n\t\t\t// }\n\n\t\t\t// Check again if continue attack or to retreat.\n\t\t\tboolean shouldAttack = decideIfWeAreReadyToAttack();\n\t\t\tif (!shouldAttack) {\n\t\t\t\tretreatsCounter++;\n\t\t\t\tchangeStateTo(STATE_RETREAT);\n\t\t\t}\n\t\t}\n\n\t\t// If we should retreat... fly you fools!\n\t\tif (isRetreatNecessary()) {\n\t\t\tretreat();\n\t\t}\n\t}", "public static void damageStep () {\r\n // rough plan:\r\n // #1: flip defending monster, if face down -> see flipMonster(...);\r\n // #2: Ask CPU and player for possible effect negation! (For an attack negation it is too late!) -> see below in this method\r\n // #3: calculate damage, kill monsters, if needed\r\n // (consider also banishing and immunity, also copied passive effect of (Holy) Lance)\r\n // -> see makeDamageCalculation(...);\r\n // #4: decrease life points, if needed -> see isDealingBattleDamageAndContinuingGame(...);\r\n // #5: consider passive (also copied) trap monster effects -> see possibleSuicideEffect(...);\r\n // #6: display Win/Lose dialog and end match, if needed -> see Game.over(...);\r\n // #7: finally end the attack (consider the effects that happen afterwards), thus allowing the next attack -> endDamageStep(...);\r\n \r\n // about #1:\r\n if (Game.ActiveGuardingMonster.isFaceDown) {flipMonster(Game.ActiveGuardingMonster);}\r\n // about #2:\r\n if (Game.ActiveAttackingMonster.canBeNegated() || Game.ActiveGuardingMonster.canBeNegated()) {\r\n AIinterrupts.cpuIsUsingEffectNegateDuringBattlePhase(); // ask CPU to negate effects first\r\n // ask player to negate effect here\r\n boolean isCanceling = false;\r\n boolean hasEffectNegateHandTrap = Hand.lookForEffectNegateOnHand(true);\r\n boolean hasEffectNegateOnField = Hand.lookForEffectNegateOnField(true);\r\n if (hasEffectNegateHandTrap || hasEffectNegateOnField) {\r\n if (hasEffectNegateHandTrap && !hasEffectNegateOnField) {\r\n isCanceling = PlayerInterrupts.playerMayNegateEffect(Game.ActiveAttackingMonster, Game.ActiveGuardingMonster, true);\r\n }\r\n else if (!hasEffectNegateHandTrap && hasEffectNegateOnField) {\r\n isCanceling = PlayerInterrupts.playerMayNegateEffect(Game.ActiveAttackingMonster, Game.ActiveGuardingMonster, false);\r\n }\r\n else {\r\n int intDialogResult = YuGiOhJi.multipleChoiceDialog(\"Do you want to negate effects on the field?\", \"You can negate passive effects.\", new String[]{\"yes, by discarding Neutraliser\", \"yes, by paying the cost worth 1 card\", \"no (default)\"}, \"no (default)\");\r\n if (intDialogResult==0) {\r\n isCanceling = PlayerInterrupts.playerMayNegateEffect(Game.ActiveAttackingMonster, Game.ActiveGuardingMonster, true);\r\n }\r\n else if (intDialogResult==1) {\r\n isCanceling = PlayerInterrupts.playerMayNegateEffect(Game.ActiveAttackingMonster, Game.ActiveGuardingMonster, false);\r\n }\r\n }\r\n }\r\n if (!isCanceling) {\r\n makeDamageCalculation(Game.ActiveAttackingMonster, Game.ActiveGuardingMonster); // whole rest of battle\r\n }\r\n }\r\n else {\r\n makeDamageCalculation(Game.ActiveAttackingMonster, Game.ActiveGuardingMonster); // whole rest of battle\r\n }\r\n \r\n }", "private void calculateDamage() {\n this.baseDamage = this.actualBaseDamage;\n this.applyPowers();\n this.baseDamage = Math.max(this.baseDamage - ((this.baseDamage * this.otherCardsPlayed) / this.magicNumber), 0);\n }", "@Override\n public void attackedByPaladin(double attack) {\n this.attack += (2 * attack) / 3;\n damageCounter = Math.max(damageCounter - (2 * attack) / 3, 0);\n }", "private int heavyAttack() {\n return attack(6, 2);\n }", "@Override\n @SuppressWarnings(\"empty-statement\")\n public void attack(){\n\n if (myTerritory.getAlpha() <= 0.5){\n myTerritory.produceSoldiers(myTerritory.getNatRes(), myTerritory.getPeasants());\n attackingSoldiers = myTerritory.getSoldiers()/4;\n defendingSoldiers = myTerritory.getSoldiers()*3/4;\n attackedTerritoryID = (new Random()).nextInt(myTerritory.getNeighbors().numObjs) + 1;\n }\n else\n myTerritory.produceSoldiers(myTerritory.getNatRes(), myTerritory.getPeasants());\n attackingSoldiers = myTerritory.getFoodGrowth()/4;\n defendingSoldiers = myTerritory.getFoodGrowth()*3/4;\n attackedTerritoryID = (new Random()).nextInt(myTerritory.getNeighbors().numObjs) + 1;\n }", "public void attack(){\n activity = CreatureActivity.ATTACK;\n createWeapon();\n endAttack = new CountDown(20); //100\n endAnimationAttack = new CountDown(100);\n }", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n public void executeAttack() {\r\n \t\r\n \tSystem.out.println();\r\n System.out.println(\"**** Attack Phase Begins for player \" + this.playerName + \"..****\\n\");\r\n \r\n boolean hasConnqueredAtleastOneCountry = false;\r\n \r\n\t System.out.println(\"\\n\" + \"Fetching potential attack scenarios for \" + this.playerName + \"...\\n\");\r\n\t \r\n\t // get all scenarios but we're only interested in attacking with the strongest country & in all-out mode\r\n\t HashMap<String, ArrayList<String>> potentialAttackScenarios = getPotentialAttackScenarios();\r\n\t \r\n\t if (potentialAttackScenarios == null) {\r\n\t System.out.println(\r\n\t \"There are currently no attack opportunities for \" + this.playerName + \".. Sorry!\\n\");\r\n\t System.out.println(\"\\n****Attack Phase Ends for player \" + this.playerName + \"..****\\n\");\r\n\t return;\r\n\t }\r\n\t\r\n\t if (potentialAttackScenarios.isEmpty()) {\r\n\t System.out.println(\r\n\t \"There are currently no attack opportunities for \" + this.playerName + \".. Sorry!\\n\");\r\n\t System.out.println(\"\\n****Attack Phase Ends for player \" + this.playerName + \"..****\\n\");\r\n\t return;\r\n\t }\r\n\t \r\n\t \t \r\n\t String enemyCountryToAttack = null;\r\n\t String strongestCountry = getStrongestCountryConqueredByPlayer(potentialAttackScenarios);\r\n\t if(strongestCountry == null) {\r\n\t \tSystem.out.println(\r\n\t \"There are currently no attack opportunities for \" + this.playerName + \".. Sorry!\\n\");\r\n\t System.out.println(\"\\n****Attack Phase Ends for player \" + this.playerName + \"..****\\n\");\r\n\t return;\r\n\t }\r\n\t \r\n\t \r\n // implement a mini-strategy within this aggressive strategy to target the weakest enemy country first\r\n\t // build map of all enemy countries and their respective army counts\r\n\t ArrayList<String> allAdjacentEnemyCountries = potentialAttackScenarios.get(strongestCountry); \r\n\t HashMap<String,Integer> allAdjacentEnemyCountriesAndArmyCounts = new HashMap<String,Integer>();\r\n\t \r\n\t for(String enemyCountry: allAdjacentEnemyCountries) {\r\n \tInteger currentEnemyCountryArmyCount = gameData.gameMap.getCountry(enemyCountry).getCountryArmyCount();\r\n \tallAdjacentEnemyCountriesAndArmyCounts.putIfAbsent(enemyCountry, currentEnemyCountryArmyCount);\r\n\t }\r\n\t \r\n\t // sort in ascending order based on lowest army count -> highest\r\n\t Object[] sortedAdjacentEnemyCountriesAndArmyCounts = allAdjacentEnemyCountriesAndArmyCounts.entrySet().toArray();\r\n\t Arrays.sort(sortedAdjacentEnemyCountriesAndArmyCounts, (o1, o2) -> ((Map.Entry<String, Integer>) o1).getValue()\r\n\t\t .compareTo(((Map.Entry<String, Integer>) o2).getValue()));\r\n\t \r\n\r\n\t HashSet<String> countriesConquered = new HashSet<>();\r\n\t \r\n\t // attack each surrounding enemy country while you can\r\n\t for (Object e : sortedAdjacentEnemyCountriesAndArmyCounts) {\r\n\r\n\t \t// setup phase state\r\n\t \tAttackPhaseState attackPhase = new AttackPhaseState();\r\n\t \t attackPhase.setAttackingPlayer(this.playerName);\r\n\t \t attackPhaseState.add(attackPhase);\r\n\t \t notifyView();\r\n\t \t // attacking country will be the same for a given turn\r\n\t \t attackPhase.setAttackingCountry(strongestCountry);\r\n\t notifyView();\r\n\t \t\r\n\t \tenemyCountryToAttack = ((Map.Entry<String, Integer>) e).getKey(); \r\n\t \tattackPhase.setDefendingCountry(enemyCountryToAttack);\r\n\t \tnotifyView();\r\n\t\r\n\t \tString defendingPlayer = gameData\r\n\t .getPlayer(this.gameData.gameMap.getCountry(enemyCountryToAttack).getCountryConquerorID())\r\n\t .getStrategyType().getPlayerName();\r\n\t \tattackPhase.setDefendingPlayer(defendingPlayer);\r\n\t \tnotifyView();\r\n\t \r\n\t \t// fight in all out mode until you win or run out of armies on the ground\r\n\t\t while (!attackPhase.getBattleOutcomeFlag() && this.gameData.gameMap.getCountry(strongestCountry).getCountryArmyCount() > 1) {\r\n\t // proceed with max allowed dice count for both sides\r\n\t Integer attackerDiceCount = getActualMaxAllowedDiceCountForAction(\"attack\", strongestCountry, 3);\r\n\t\t attackPhase.setAttackerDiceCount(attackerDiceCount);\r\n\t\t //Integer defenderDiceCount = getActualMaxAllowedDiceCountForAction(\"defend\",enemyCountryToAttack, 2);\r\n\t\t // always set defender dice count to the min to maximize aggression \r\n\t\t Integer defenderDiceCount = 1;\r\n\t\t attackPhase.setDefenderDiceCount(defenderDiceCount);\r\n\t\t rollDiceBattle(attackPhase);\r\n\t hasConnqueredAtleastOneCountry = fight(attackPhase) || hasConnqueredAtleastOneCountry;\r\n\t \r\n\t if(attackPhase.getBattleOutcomeFlag()) {\r\n\t \tcountriesConquered.add(strongestCountry);\r\n\t \tcountriesConquered.add(enemyCountryToAttack);\r\n\t \t\r\n\t }\r\n\t \r\n\t }\r\n\t\t \r\n\t }\r\n\t \r\n\t String weakestCountry = getCountryWithMostNumberOfBordersShared(countriesConquered);\r\n\t \r\n\t if(weakestCountry != strongestCountry) {\r\n\t \t\r\n\t \tInteger strongestCountryArmyCount = this.gameData.gameMap.getCountry(strongestCountry).getCountryArmyCount();\r\n\t \t\r\n\t \tif(strongestCountryArmyCount > 1) {\r\n\t \t\tthis.gameData.gameMap.deductArmyToCountry(strongestCountry, strongestCountryArmyCount - 1);\r\n\t\t\t\tthis.gameData.gameMap.addArmyToCountry(weakestCountry, strongestCountryArmyCount - 1);\r\n\t \t}\r\n\t \t\r\n\t }\r\n\t \r\n checkIfPlayerHasConqueredTheWorld();\r\n \r\n\t\t\r\n\t if (hasConnqueredAtleastOneCountry) {\r\n\t\t \tCard card = gameData.cardsDeck.getCard();\r\n\t \r\n\t\t if(card == null) {\r\n\t\t \tSystem.out.println(\"No more cards left in the deck\");\r\n\t\t } else {\r\n\t\t \t\tthis.cardList.add(card);\r\n\t\t \t\tSystem.out.println(\"PlayerStrategy received 1 card => Army Type: \" + card.getArmyType() + \", Country: \" + card.getCountry().getCountryName());\r\n\t\t \t\tSystem.out.println(\"Total cards : \" + this.cardList.size());\r\n\t\t \t}\r\n\t\t} \r\n\t \r\n\t HashSet<String> conqueredCountryByThisPlayer = gameData.gameMap.getConqueredCountries(playerID);\r\n System.out.println(\"\\nOverview of army counts: \\n\");\r\n for(String country: conqueredCountryByThisPlayer){\r\n System.out.println(\"Country: \"+country+\", Army Count: \"+gameData.gameMap.getCountry(country).getCountryArmyCount());\r\n }\r\n\t \r\n\t endAttack();\r\n }", "public void attack() { \n db.attack(creatures.get(creatureId), players.get(playerId));\n creatures.set(creatureId, db.getCreature(creatures.get(creatureId).getId()));\n players.set(playerId, db.getPlayer(players.get(playerId).getId()));\n setTextFields();\n }", "public void attack() {\n energy = 2;\n redBull = 0;\n gun = 0;\n target = 1;\n // if Player is in range take off a life.\n if (CharacterTask.ghostLocation == GameWindow.playerLocation) {\n playerLives = playerLives - 1;\n System.out.println(\"Player Lives: \" + playerLives);\n }\n }", "static void attacking() throws GameActionException {\n\n\t\trc.setIndicatorLine(myLocation, myLocation.add(robotDirection), 0, 0, 0);\n\n\t\tcheckLumberjack();\n\n\t\tint maxSoldier = Constants.MAX_COUNT_SOLDIER;\n\t\tint maxTank = Constants.MAX_COUNT_TANK;\n\n\t\tint numSoldier = rc.readBroadcast(Channels.COUNT_SOLDIER);\n\t\tint numTank = rc.readBroadcast(Channels.COUNT_TANK);\n\n\t\tfloat maxRatio = (float) (maxSoldier) / (maxTank + 1);\n\t\tfloat numRatio = (float) (numSoldier) / (numTank + 1);\n\n\t\tboolean canBuildTank = rc.canBuildRobot(RobotType.TANK, robotDirection);\n\t\tboolean canBuildSoldier = rc.canBuildRobot(RobotType.SOLDIER, robotDirection);\n\n\t\tSystem.out.println(numRatio + \">\" + maxRatio);\n\n\t\tif (canBuildSoldier && numSoldier < maxSoldier && numRatio < maxRatio) {\n\t\t\trc.buildRobot(RobotType.SOLDIER, robotDirection);\n\t\t\tCommunication.countMe(RobotType.SOLDIER);\n\t\t} else if (canBuildTank && numTank < maxTank) {\n\t\t\trc.buildRobot(RobotType.TANK, robotDirection);\n\t\t\tCommunication.countMe(RobotType.TANK);\n\t\t}\n\n\t}", "public void attack() {\n this.attacked = true;\n }", "public abstract boolean attack(KillableItem i);", "@Override\n\tpublic void reduceCurrentHp(final double damage, final L2Character attacker, final boolean awake)\n\t{\n\t\t/*\n\t\t * if ((this instanceof L2SiegeGuardInstance) && (attacker instanceof L2SiegeGuardInstance)) //if((this.getEffect(L2Effect.EffectType.CONFUSION)!=null) && (attacker.getEffect(L2Effect.EffectType.CONFUSION)!=null)) return; if ((this instanceof L2MonsterInstance)&&(attacker instanceof\n\t\t * L2MonsterInstance)) if((this.getEffect(L2Effect.EffectType.CONFUSION)!=null) && (attacker.getEffect(L2Effect.EffectType.CONFUSION)!=null)) return;\n\t\t */\n\t\t\n\t\tif (isRaid() && attacker != null && attacker.getParty() != null && attacker.getParty().isInCommandChannel() && attacker.getParty().getCommandChannel().meetRaidWarCondition(this))\n\t\t{\n\t\t\tif (firstCommandChannelAttacked == null) // looting right isn't set\n\t\t\t{\n\t\t\t\tsynchronized (this)\n\t\t\t\t{\n\t\t\t\t\tif (firstCommandChannelAttacked == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tfirstCommandChannelAttacked = attacker.getParty().getCommandChannel();\n\t\t\t\t\t\tif (firstCommandChannelAttacked != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommandChannelTimer = new CommandChannelTimer(this);\n\t\t\t\t\t\t\tcommandChannelLastAttack = System.currentTimeMillis();\n\t\t\t\t\t\t\tThreadPoolManager.getInstance().scheduleGeneral(commandChannelTimer, 10000); // check for last attack\n\t\t\t\t\t\t\tfirstCommandChannelAttacked.broadcastToChannelMembers(new CreatureSay(0, Say2.PARTYROOM_ALL, \"\", \"You have looting rights!\")); // TODO: retail msg\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (attacker.getParty().getCommandChannel().equals(firstCommandChannelAttacked)) // is in same channel\n\t\t\t{\n\t\t\t\tcommandChannelLastAttack = System.currentTimeMillis(); // update last attack time\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * // CommandChannel if(commandChannelTimer == null && isRaid() && attacker != null) { if(attacker.isInParty() && attacker.getParty().isInCommandChannel() && attacker.getParty().getCommandChannel().meetRaidWarCondition(this)) { firstCommandChannelAttacked = attacker.getParty().getCommandChannel();\n\t\t * commandChannelTimer = new CommandChannelTimer(this, attacker.getParty().getCommandChannel()); ThreadPoolManager.getInstance().scheduleGeneral(_commandChannelTimer, 300000); // 5 min firstCommandChannelAttacked.broadcastToChannelMembers(new CreatureSay(0, Say2.PARTYROOM_ALL, \"\",\n\t\t * \"You have looting rights!\")); } }\n\t\t */\n\t\tif (isEventMob)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Add damage and hate to the attacker AggroInfo of the L2Attackable aggroList\n\t\tif (attacker != null)\n\t\t{\n\t\t\taddDamage(attacker, (int) damage);\n\t\t}\n\t\t\n\t\t// If this L2Attackable is a L2MonsterInstance and it has spawned minions, call its minions to battle\n\t\tif (this instanceof L2MonsterInstance)\n\t\t{\n\t\t\tL2MonsterInstance master = (L2MonsterInstance) this;\n\t\t\t\n\t\t\tif (this instanceof L2MinionInstance)\n\t\t\t{\n\t\t\t\tmaster = ((L2MinionInstance) this).getLeader();\n\t\t\t\t\n\t\t\t\tif (!master.isInCombat() && !master.isDead())\n\t\t\t\t{\n\t\t\t\t\tmaster.addDamage(attacker, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (master.hasMinions())\n\t\t\t{\n\t\t\t\tmaster.callMinionsToAssist(attacker);\n\t\t\t}\n\t\t\t\n\t\t\tmaster = null;\n\t\t}\n\t\t\n\t\t// Reduce the current HP of the L2Attackable and launch the doDie Task if necessary\n\t\tsuper.reduceCurrentHp(damage, attacker, awake);\n\t}", "@Override\n public void doStrategy(final Pyromancer pyromancer) {\n int hpLoss = pyromancer.getHP() / Constants.PYROMANCER_STRATEGY_HP_LOSS;\n pyromancer.reduceHP(hpLoss);\n pyromancer.increaseRaceMod(Constants.DAMAGE_MOD_70);\n }", "@Override\n\tpublic double attack() {\n\t\treturn 12.5;\n\t}", "@Override\n\tpublic void attack() {\n\n\t}", "public void gameAttack(){\n int counter = 0;\n while (currentPlayer.wantToAttack(this)){\n counter++;\n if (counter > 100) break;\n /*In rare cases, AI players will repeatedly select the same attackers and defenders\n while also not wanting to dice fight. That will infinitely loop here and this counter will prevent it\n Under normal circumstances, no reasonable player will ever try to do more than 100 separate attacks in the same turn\n */\n\n String[] attackerDefender = {\"\",\"\"};\n //AttackStarterSelection\n attackerDefender[0] = currentPlayer.chooseAttackStarter(this);\n\n //AttackDefenderSelection\n attackerDefender[1] = currentPlayer.chooseAttackDefender(this, attackerDefender[0]);\n\n //DiceFightOrQuit\n int attackerDice, defenderDice;\n while (currentPlayer.wantToDiceFight(this, attackerDefender[0]+ \",\" + attackerDefender[1])){\n //DiceFightAttackerChoice\n attackerDice = currentPlayer.getAttackerDice(this, getTerritory(attackerDefender[0]));\n\n //DiceFightDefenderChoice\n Player defender = this.getPlayerFromList(this.getTerritory(attackerDefender[1]).getOwner());\n defenderDice = defender.getDefenderDice(this, this.getTerritory(attackerDefender[1]));\n\n\n //DiceFight results\n displayMessage(this.diceFight(attackerDefender, attackerDice,defenderDice));\n\n //Possible elimination and announcement of winner\n //Current diceFight ends if attacker has 1 troop left, or territory is conquered\n if (endDiceFight(attackerDefender, attackerDice)) break;\n\n }//End diceFightOrQuit\n\n\n }//End wantToAttack\n //Proceed to fortify stage of turn\n }", "public void attack() {\n if (activeWeapon == null) {\n return;\n }\n attacking = true;\n }", "private void damage(){\n\n LevelMap.getLevel().damage(dmg);\n //System.out.println(\"died\");\n setDie();\n }", "public void autosimulateCombat() {\n\n int monstersRemainingHealth = monster.getHealth() - player.getPower();\n int playersRemainingHealth = player.getHealth() - monster.getPower();\n\n while (player.getHealth() > 0 && monster.getHealth() > 0) {\n\n monster.setHealth(monstersRemainingHealth);\n monstersRemainingHealth = monster.getHealth() - player.getPower();\n\n\n player.setHealth(playersRemainingHealth);\n playersRemainingHealth = player.getHealth() - monster.getPower();\n\n }\n isPlayerDefeated();\n return;\n }", "@Override\n public void attackedByShaman(double attack) {\n damageCounter += (2 * attack) / 3;\n this.attack = Math.max(this.attack - (2 * attack) / 3, 0);\n }", "@Override\n\tpublic int attack( ){\n\t\treturn enemy.attack();\n\t}", "@Override\n public int doDamage() {\n if (difficulty <5)\n return damage;\n else \n return damage*2;\n }", "@Override\n\tpublic void attack() {\n\t\t\n\t}", "abstract public boolean performNextAttack();", "@Override\n\tpublic void takeHit(int attack) {\n\n\t}", "public void attack();", "@Override\n\tpublic void attack() {\n\t}", "public abstract void attack(Monster mon);", "public void attemptAttack() {\r\n\t\tattackAttempts += 100;\r\n\t}", "@Override\n\tpublic void doTimeStep() {\n\t\tint activity = Critter.getRandomInt(3);\n\t\tif(activity == 0) {\n\t\t\twalk(Critter.getRandomInt(8));\n\t\t\tthis.moveFlag = true;\n\t\t}\n\t\telse if(activity == 1) {\t\t\t\t\n\t\t\trun(Critter.getRandomInt(8));\n\t\t\tthis.moveFlag = true;\n\t\t}\n\t\telse if(this.getEnergy() >= Params.min_reproduce_energy) {\n\t\t\tCritter4 egg = new Critter4();\n\t\t\tthis.reproduce(egg,Critter.getRandomInt(8));\n\t\t}\n\t\telse {\n\t\t}\n\t}", "@Override\n public void attack() {\n\n }", "public void applyDamage(int damage)\r\n\t{\r\n\r\n\t}", "@InvokeEvent\n public void onAttack(PlayerAttackEntityEvent event) {\n int multiplier = Configuration.INSTANCE.getMultiplier();\n // Create a variable for the entity.\n Entity entity = event.getEntity();\n // Create a variable for Minecraft#thePlayer\n EntityPlayer player = Minecraft.getMinecraft().thePlayer;\n // Check if the player is null, multiplier is 1 or Configuration#isMultiplyOnAnimals() is false.\n if (player == null || multiplier == 1 || !Configuration.INSTANCE.isMultiplyOnAnimals()) return;\n // Check if the attack was critical.\n boolean critical = player.fallDistance > 0.0f && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(Potion.blindness) && player.ridingEntity == null;\n // Create a float to get the EMD (Enchantment Modifier Damage).\n float enchantment = EnchantmentHelper.getEnchantmentModifierDamage(new ItemStack[]{player.getHeldItem()}, new EntityDamageSource(\"player\", player));\n // Create a for statement which loops for the length of the multiplier and runs the code inside.\n for (int i = 1; i < multiplier; ++i) {\n // Checks if enabled.\n if (Configuration.INSTANCE.isEnabled()) {\n // Check if its a critical hit or the multiply without critical hits option is enabled run Minecraft#onCriticalHit(entity) to show the critical marks\n if (critical || Configuration.INSTANCE.isMultiplyWithoutCrits()) Minecraft.getMinecraft().thePlayer.onCriticalHit(entity);\n // Check if the enchantment float is over 0.0f run Minecraft#onEnchantmentCritical(entity) instead.\n if (enchantment > 0.0f) Minecraft.getMinecraft().thePlayer.onEnchantmentCritical(entity);\n }\n }\n }", "@Override\n\tvoid attack() {\n\n\t}", "@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 }", "public abstract void attack(Game g);", "public void handleAttack(int damage) {\n this.health -= damage;\n }", "public void breath() {\n\t\tif (alive) {\n\t\t\t_age++;\n\t\t\t// Respiration process\n\t\t\tboolean canBreath = useEnergy(Math.min((_mass - _lowmaintenance) / Utils.SEGMENT_COST_DIVISOR, _energy));\n\t\t\tif ((_age >> 8) > _geneticCode.getMaxAge() || !canBreath) {\n\t\t\t\t// It's dead, but still may have energy\n\t\t\t\tdie(null);\n\t\t\t} else {\n\t\t\t\tif (_energy <= Utils.tol) {\n\t\t\t\t\talive = false;\n\t\t\t\t\t_world.decreasePopulation();\n\t\t\t\t\t_world.organismHasDied(this, null);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// The corpse slowly decays\n\t\t\tuseEnergy(Math.min(_energy, Utils.DECAY_ENERGY));\n\t\t}\n\t}", "public abstract boolean attack(PermanentCharm i);", "private void attack(int player){\n //grabs a random number\n int monster = monsterAttack();\n \n //monsters strength and modifier against the player\n double monAttack;\n double monMod;\n //players strength and modifier against the monster\n double playerAttack;\n double playerMod;\n //resets the buttons\n btnFire.setEnabled(true);\n btnWater.setEnabled(true);\n btnIce.setEnabled(true);\n btnEarth.setEnabled(true);\n //holds the types of attacks the player and monster will have\n Element mType;\n Element pType;\n \n //sets the monsters type of attack\n switch(monster){\n case 0:\n mType = new Earth();\n break;\n case 1:\n mType = new Fire();\n break;\n case 2:\n mType = new Water();\n break;\n case 3:\n mType = new Ice();\n break;\n default:\n mType = new Earth();\n System.out.println(\"Something went wrong with monster attack selection - given number\" + monster);\n break;\n }\n //sets the players attack type, and monsters modifier\n switch(player){\n case 0:\n pType = new Earth();\n playerAttack = c.getEarth();\n monMod = 1.0;\n btnEarth.setEnabled(false);\n break;\n case 1:\n pType = new Fire();\n playerAttack = c.getFire();\n monMod = mType.getFM();\n btnFire.setEnabled(false);\n break;\n case 2:\n pType = new Water();\n playerAttack = c.getWater();\n monMod = mType.getWM();\n btnWater.setEnabled(false);\n break;\n case 3:\n pType = new Ice();\n playerAttack = c.getIce();\n monMod = mType.getIM();\n btnIce.setEnabled(false);\n break;\n default:\n pType = new Earth();\n playerAttack = c.getEarth();\n monMod = 1.0;\n btnEarth.setEnabled(false);\n System.out.println(\"Something went wrong with player attack selection - given number\" + player);\n break;\n }\n //sets the monster's attack type, and player's modifier\n switch(monster){\n case 0:\n monAttack = m.getEarth();\n playerMod = 1.0;\n break;\n case 1:\n monAttack = m.getFire();\n playerMod = pType.getFM();\n break;\n case 2:\n monAttack = m.getWater();\n playerMod = pType.getWM();\n break;\n case 3:\n monAttack = m.getIce();\n playerMod = pType.getIM();\n break;\n default:\n System.out.println(\"Monster attack comparison error\");\n monAttack = m.getEarth();\n playerMod = 1.0;\n break;\n }\n //decide who won the Attack\n decide(playerAttack, playerMod, monAttack, monMod, pType, mType);\n \n }", "@Override\n\tpublic void decide() {\n\t\tif (this.isDead) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(this.age >= this.lifeSpan) {\n\t\t\t// DIE\n\t\t\tthis.environment.removeAgent(this.getPosX(), this.getPosY());\n\t\t\tthis.isDead = true;\n\n\t\t\t// Print if required\n\t\t\tif (this.appConfig.hasTrace()) {\n\t\t\t\tSystem.out.println(\"Agent;Death;Fish;\" + this.getPosX() + \";\" + this.getPosY());\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\tthis.age++;\n\t\tthis.color = Color.GREEN;\n\t\tboolean canFuck = this.breedTime == 0;\n\n\t\tint[] coordinates = this.chooseCoordinates();\n\n\t\t// fish cannot move or fuck because there is no place to do so\n\t\tif (coordinates == null) {\n\t\t\tthis.breedTime = this.breedTime > 0 ? this.breedTime - 1 : this.breedTime;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.environment.moveAgent(this, coordinates[0], coordinates[1]);\n\n\t\t// Time to fuck-zer\n\t\tif (canFuck) {\n\t\t\tthis.fuck(this.getPosX(), this.getPosY());\n\t\t}\n\t\t// Update breedtime in order to wait the holy fuck time\n\t\telse {\n\t\t\tthis.breedTime = this.breedTime > 0 ? this.breedTime - 1 : this.breedTime;\n\t\t}\n\t\tthis.posX = coordinates[0];\n\t\tthis.posY = coordinates[1];\n\t}", "public int calculateAttack() {\n int attack = 0;\n for (Weapon w : equippedWeapons) {\n attack += w.getType().getDamage();\n }\n return attack;\n }", "public void attack() {\n\t\t\n\t\tint row = getPosition().getRow();\n\t\tint column = getPosition().getColumn();\n\t\t\n\t\tgetPosition().setCoordinates(row + 1, column);\n\t\tsetPosition(getPosition()) ;\n\t\t// restore health\n\t\tsetHealth(100);\n\t\t// end hunter mode\n\t\tthis.hunter = false;\n\t\t\n\t}", "public void battleAllyAttack() {\n if(battleAlly instanceof Character){\n battleTickStatuses();\n updateBattleSides();\n }\n\n // battleAlly now attacks targetEnemy or preference based on the type of battleAlly\n if(battleAlly != null){ // If all allies have attacked, they cannot attack anymore for this round\n MovingEntity target = battleAlly.getAttackPreference(targetEnemies);\n // if not picky, get preference is the default next target\n if(target == null) {\n target = targetEnemy;\n }\n battleAlly.attack(target, targetAllies, targetEnemies);\n //System.out.println(battleAlly.getID() + \" is attacking \" + target.getID() + \" remaining hp: \" + target.getCurrHP());\n if (updateTarget(target) == false) {\n // if target still alive, check if its still unfriendly\n targetEnemy = checkSideSwap(targetEnemy, true, battleAllies, targetAllies, battleEnemies, targetEnemies);\n }\n battleAlly = nextAttacker(battleAlly, battleAllies);\n\n }\n }", "protected void takeDamage(int damage)\n {\n health = health - damage;\n \n }", "private void updateAgilisaurusState() {\n this.age++;\n\n if (this.age == 30 && this.hasCapability(LifeStage.BABY)) {\n // grow up\n this.removeCapability(LifeStage.BABY);\n this.addCapability(LifeStage.ADULT);\n this.displayChar = 'D';\n }\n\n if (this.foodLevel > 0) {\n this.foodLevel--;\n }\n\n if (this.waterLevel > 0) {\n this.waterLevel--;\n }\n\n if (this.foodLevel < 30) {\n this.behaviour = new HungryBehaviour();\n }\n\n if (this.foodLevel > 50) {\n this.behaviour = new BreedBehaviour();\n }\n\n if (this.foodLevel == 0) {\n this.Starving();\n } else {\n this.starvationLevel = 0;\n }\n\n if (this.waterLevel < 30) {\n this.behaviour = new ThirstBehaviour();\n }\n\n if (this.waterLevel == 0) {\n this.Thirsting();\n } else {\n this.thirstLevel = 0;\n }\n }", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tfor (Damage damage : actionAttack.damages) {\r\n\t\t\t\t\t\t\t\tBattlerSprite attacked = damage.target.getTag();\r\n\t\t\t\t\t\t\t\tattacked.takeHit(damage.damage);\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}", "@Override\n public void attack(){\n\n }", "public void setAttack(double attack) {\n this.attack = attack;\n }", "@Override\n\tpublic void takeDamage(double damage) {\n\n\t}", "private float setAttackAbsorption(HashMap content) {\n\t\tfloat change = calculateAbsorption();\n this.attackDamageModifier = baseDamageModifier + change;\n//System.out.println(\"attack: \" + this.attackDamageModifier);\n content.put(\"attack_damage_modifier\", \"\" + this.attackDamageModifier);\n\t\treturn change*ABSORPTION_PRICE_MULTIPLIER;\n }", "public void attack(Entity entity) {\n\t}", "public void performAttack(){\r\n // For every zombie\r\n for (int i = 0 ; i < allZombies.getZombies().size(); i++) {\r\n // Variables used to prevent long getter lines\r\n int zombieX = allZombies.getZombies().get(i).getCurrX();\r\n int zombieY = allZombies.getZombies().get(i).getCurrY();\r\n Zombie zombie = allZombies.getZombies().get(i);\r\n // If the zombie is in range and alive:\r\n if(isInRange(zombieX,zombieY) && zombie.isAlive()) {\r\n // kill the zombie and increase score by 1.\r\n allZombies.getZombies().get(i).setAlive(false);\r\n increaseScore();\r\n }\r\n }\r\n }", "public void process(double delta) {\n\n effectProcess(delta);\n switch (this.damageState) {\n case DESTROY:\n destroyCase(delta);\n break;\n case DAMAGED:\n damagedCase(delta);\n break;\n case FULL:\n fullCase(delta);\n break;\n }\n }", "@Override\n public void onLivingUpdate() {\n if (this.lastEntityToAttack != this.entityToAttack) {\n IAttributeInstance attribute = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed);\n attribute.removeModifier(EntityEnderCreeper.attackingSpeedBoost);\n if (this.entityToAttack != null) {\n attribute.applyModifier(EntityEnderCreeper.attackingSpeedBoost);\n }\n }\n this.lastEntityToAttack = this.entityToAttack;\n\n for (int i = 0; i < 2; i++) {\n this.worldObj.spawnParticle(\"portal\", this.posX + (this.rand.nextDouble() - 0.5) * this.width, this.posY + this.rand.nextDouble() * this.height - 0.25, this.posZ + (this.rand.nextDouble() - 0.5) * this.width, (this.rand.nextDouble() - 0.5) * 2.0, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5) * 2.0);\n }\n if (this.worldObj.isDaytime() && !this.worldObj.isRemote) {\n float brightness = this.getBrightness(1.0F);\n if (brightness > 0.5F && this.worldObj.canBlockSeeTheSky((int)Math.floor(this.posX), (int)Math.floor(this.posY), (int)Math.floor(this.posZ)) && this.rand.nextFloat() * 30.0F < (brightness - 0.4F) * 2.0F) {\n this.entityToAttack = null;\n this.teleportRandomly();\n }\n }\n if (this.isWet()) {\n this.attackEntityFrom(DamageSource.drown, 1);\n this.entityToAttack = null;\n this.teleportRandomly();\n }\n this.isJumping = false;\n if (this.entityToAttack != null) {\n if (this.entityToAttack.getDistanceSqToEntity(this) < 9.0 && this.canEntityBeSeen(this.entityToAttack)) {\n this.setCreeperState(1);\n }\n else {\n this.setCreeperState(-1);\n }\n this.faceEntity(this.entityToAttack, 100.0F, 100.0F);\n }\n if (!this.worldObj.isRemote && this.isEntityAlive()) {\n if (this.entityToAttack != null) {\n if (this.entityToAttack instanceof EntityPlayer && this.shouldAttackPlayer((EntityPlayer)this.entityToAttack)) {\n if (this.getCreeperState() < 0 && this.entityToAttack.getDistanceSqToEntity(this) < 16.0) {\n this.teleportRandomly();\n }\n this.teleportDelay = 0;\n }\n else if (this.entityToAttack.getDistanceSqToEntity(this) > 256.0 && this.teleportDelay++ >= 30 && this.teleportToEntity(this.entityToAttack)) {\n this.teleportDelay = 0;\n }\n }\n else {\n this.teleportDelay = 0;\n }\n }\n super.onLivingUpdate();\n }", "public static void makeDamageCalculation (SummonedMonster AttackingMonster, SummonedMonster GuardingMonster) {\r\n AttackingMonster.canStillAttackThisTurn = false; // Just in case this might be missed somewhere, erase its one attack per turn, because now there is no turning back.\r\n AttMonster.rememberPropertiesOfMonster(AttackingMonster);\r\n GuardMonster.rememberPropertiesOfMonster(GuardingMonster);\r\n // get the 2 relevant values for the attack calculation\r\n int relevantAttValue = AttackingMonster.att;\r\n int releventGuardingValue = GuardingMonster.relevantValue();\r\n // get some relevant properties of the involved monsters\r\n boolean attackingMonsterIndestructible = AttackingMonster.isIndestructibleByBattle();\r\n boolean attackingMonsterImmuneWhileWinning = AttackingMonster.isImmuneWhileWinning();\r\n boolean attackingMonsterImmune = AttackingMonster.isImmune();\r\n boolean attackingMonsterBanishes = AttackingMonster.isBanishingOpposingMonster(GuardingMonster);\r\n boolean attackingMonsterBanishesBoth = AttackingMonster.isBanishingBothMonsters(GuardingMonster);\r\n \r\n boolean guardingMonsterIndestructible = GuardingMonster.isIndestructibleByBattle();\r\n boolean guardingMonsterImmuneWhileWinning = GuardingMonster.isImmuneWhileWinning();\r\n boolean guardingMonsterImmune = GuardingMonster.isImmune();\r\n boolean guardingMonsterBanishes = GuardingMonster.isBanishingOpposingMonster(AttackingMonster);\r\n boolean guardingMonsterBanishesBoth = GuardingMonster.isBanishingBothMonsters(AttackingMonster);\r\n // let monsters clash here\r\n if (relevantAttValue == releventGuardingValue) {\r\n if (relevantAttValue==0) {\r\n YuGiOhJi.informationDialog(\"Nothing happens, because of zero attack.\", \"\");\r\n endAttack(false);\r\n }\r\n else {\r\n if (GuardingMonster.isInAttackMode) { // usually both monsters kill each other\r\n if (attackingMonsterBanishesBoth) {\r\n banishingDialogBanisher(AttackingMonster);\r\n getNthSummonedMonster(AttackingMonster.sumMonsterNumber, AttackingMonster.isPlayersMonster).banishMonster();\r\n if (!guardingMonsterImmuneWhileWinning && !guardingMonsterImmune) {\r\n banishingDialogBanisher(GuardingMonster);\r\n getNthSummonedMonster(GuardingMonster.sumMonsterNumber, GuardingMonster.isPlayersMonster).banishMonster();\r\n }\r\n else {\r\n getNthSummonedMonster(GuardingMonster.sumMonsterNumber, GuardingMonster.isPlayersMonster).killMonster();\r\n }\r\n }\r\n else if (guardingMonsterBanishesBoth) {\r\n banishingDialogBanisher(GuardingMonster);\r\n getNthSummonedMonster(GuardingMonster.sumMonsterNumber, GuardingMonster.isPlayersMonster).banishMonster();\r\n if (!attackingMonsterImmuneWhileWinning && !attackingMonsterImmune) {\r\n banishingDialogBanisher(AttackingMonster);\r\n getNthSummonedMonster(AttackingMonster.sumMonsterNumber, AttackingMonster.isPlayersMonster).banishMonster();\r\n }\r\n else {\r\n getNthSummonedMonster(AttackingMonster.sumMonsterNumber, AttackingMonster.isPlayersMonster).killMonster();\r\n }\r\n }\r\n else {\r\n if (!guardingMonsterIndestructible) {\r\n if (attackingMonsterBanishes && !guardingMonsterImmuneWhileWinning && !guardingMonsterImmune) {\r\n banishingDialogBigBanisher(GuardingMonster);\r\n getNthSummonedMonster(GuardingMonster.sumMonsterNumber, GuardingMonster.isPlayersMonster).banishMonster();\r\n }\r\n else {\r\n getNthSummonedMonster(GuardingMonster.sumMonsterNumber, GuardingMonster.isPlayersMonster).killMonster();\r\n }\r\n }\r\n if (!attackingMonsterIndestructible) {\r\n if (guardingMonsterBanishes && !attackingMonsterImmuneWhileWinning && !attackingMonsterImmune) {\r\n banishingDialogBigBanisher(AttackingMonster);\r\n getNthSummonedMonster(AttackingMonster.sumMonsterNumber, AttackingMonster.isPlayersMonster).banishMonster();\r\n }\r\n else {\r\n getNthSummonedMonster(AttackingMonster.sumMonsterNumber, AttackingMonster.isPlayersMonster).killMonster();\r\n }\r\n }\r\n }\r\n if (!guardingMonsterIndestructible && attackingMonsterIndestructible) {\r\n possibleSuicideEffect(false, false);\r\n }\r\n else if (guardingMonsterIndestructible && !attackingMonsterIndestructible) {\r\n possibleSuicideEffect(true, false); // suicide effect of attacking monster\r\n }\r\n else if (!guardingMonsterIndestructible && !attackingMonsterIndestructible) {\r\n possibleSuicideEffect(false, true); // double kill here\r\n }\r\n else { // if both are indestructible, none of them has a suicide effect\r\n endDamageStep(false); // here both survive\r\n }\r\n } // else nothing happens\r\n }\r\n }\r\n else if (relevantAttValue > releventGuardingValue) { // here the attacking monster usually kills the guarding one\r\n // look if attacking monster is either piercing by itself or copies Lance or Holy Lance\r\n boolean isEffectivelyPiercing = (AttackingMonster.hasPiercingDamageAbility() && !guardingMonsterImmune);\r\n boolean isContinuingGame = true;\r\n if (GuardingMonster.isInAttackMode || isEffectivelyPiercing) {\r\n isContinuingGame = isDealingBattleDamageAndContinuingGame(false, relevantAttValue-releventGuardingValue, GuardingMonster.isPlayersMonster);\r\n } // else no damage\r\n if (isContinuingGame) {\r\n if (guardingMonsterBanishesBoth) { // definitely banishes itself\r\n banishingDialogBanisher(GuardingMonster);\r\n getNthSummonedMonster(GuardingMonster.sumMonsterNumber, GuardingMonster.isPlayersMonster).banishMonster();\r\n if (!attackingMonsterImmuneWhileWinning && !attackingMonsterImmune) { // banishes opponent only, if it not immune against it\r\n banishingDialogBanisher(AttackingMonster);\r\n getNthSummonedMonster(AttackingMonster.sumMonsterNumber, AttackingMonster.isPlayersMonster).banishMonster();\r\n }\r\n }\r\n else if (!guardingMonsterIndestructible) {\r\n if (attackingMonsterBanishes && !guardingMonsterImmune) {\r\n banishingDialogBigBanisher(GuardingMonster);\r\n getNthSummonedMonster(GuardingMonster.sumMonsterNumber, GuardingMonster.isPlayersMonster).banishMonster();\r\n }\r\n else {\r\n getNthSummonedMonster(GuardingMonster.sumMonsterNumber, GuardingMonster.isPlayersMonster).killMonster();\r\n }\r\n possibleSuicideEffect(false, false);\r\n }\r\n else {\r\n endDamageStep(false);\r\n }\r\n }\r\n }\r\n else { // here: relevantAttValue < releventGuardingValue\r\n // rare case in which attacker gets the damage\r\n boolean isContinuingGame = isDealingBattleDamageAndContinuingGame(false, releventGuardingValue-relevantAttValue, AttackingMonster.isPlayersMonster);\r\n if (isContinuingGame) {\r\n if (GuardingMonster.isInAttackMode) {\r\n if (attackingMonsterBanishesBoth) {\r\n banishingDialogBanisher(AttackingMonster);\r\n getNthSummonedMonster(AttackingMonster.sumMonsterNumber, AttackingMonster.isPlayersMonster).banishMonster();\r\n if (!guardingMonsterImmuneWhileWinning && !guardingMonsterImmune) {\r\n banishingDialogBanisher(GuardingMonster);\r\n getNthSummonedMonster(GuardingMonster.sumMonsterNumber, GuardingMonster.isPlayersMonster).banishMonster();\r\n }\r\n }\r\n else if (!attackingMonsterIndestructible) {\r\n if (guardingMonsterBanishes && !attackingMonsterImmune) {\r\n banishingDialogBigBanisher(AttackingMonster);\r\n getNthSummonedMonster(AttackingMonster.sumMonsterNumber, AttackingMonster.isPlayersMonster).banishMonster();\r\n }\r\n else {\r\n getNthSummonedMonster(AttackingMonster.sumMonsterNumber, AttackingMonster.isPlayersMonster).killMonster();\r\n }\r\n }\r\n possibleSuicideEffect(true, false);\r\n }\r\n else {\r\n endDamageStep(false);\r\n }\r\n }\r\n }\r\n \r\n }", "@Override\n\tpublic void setAttack(double attack) {\n\n\t}", "private void combatPhase() {\n \t\n \tpause();\n \tDice.setFinalValMinusOne();\n\n \t// Go through each battle ground a resolve each conflict\n \tfor (Coord c : battleGrounds) {\n \t\t\n \tClickObserver.getInstance().setTerrainFlag(\"\");\n \t\n \tSystem.out.println(\"Entering battleGround\");\n \t\tfinal Terrain battleGround = Board.getTerrainWithCoord(c);\n \t\t\n \t\t// find the owner of terrain for post combat\n \tPlayer owner = battleGround.getOwner();\n \t\n \t\t// simulate a click on the first battleGround, cover all other terrains\n \t\tClickObserver.getInstance().setClickedTerrain(battleGround);\n \t\tPlatform.runLater(new Runnable() {\n @Override\n public void run() {\n \t\tClickObserver.getInstance().whenTerrainClicked();\n \t\tBoard.applyCovers();\n \t\tClickObserver.getInstance().getClickedTerrain().uncover();\n \tClickObserver.getInstance().setTerrainFlag(\"Disabled\");\n }\n });\n \t\t\n \t\t// Get the fort\n \t Fort battleFort = battleGround.getFort(); \n \t\t\n \t\t// List of players to battle in the terrain\n \t\tArrayList<Player> combatants = new ArrayList<Player>();\n \t\t\n \t\t// List of pieces that can attack (including forts, city/village)\n \t\tHashMap<String, ArrayList<Piece>> attackingPieces = new HashMap<String, ArrayList<Piece>>();\n \t\t\n \t\tSystem.out.println(battleGround.getContents().keySet());\n \t\t\n \t\tIterator<String> keySetIterator = battleGround.getContents().keySet().iterator();\n\t \twhile(keySetIterator.hasNext()) {\n\t \t\tString key = keySetIterator.next();\n\t \t\t\n \t\t\tcombatants.add(battleGround.getContents().get(key).getOwner());\n \t\t\tattackingPieces.put(battleGround.getContents().get(key).getOwner().getName(), (ArrayList<Piece>) battleGround.getContents().get(key).getStack().clone()); \n \t\t\t\n\t \t}\n\t \t\n\t \t\n\t \t\n\t \t// if the owner of the terrain has no pieces, just a fort or city/village\n\t\t\tif (!combatants.contains(battleGround.getOwner()) && battleFort != null) {\n\t\t\t\tcombatants.add(battleGround.getOwner());\n\t\t\t\tattackingPieces.put(battleGround.getOwner().getName(), new ArrayList<Piece>());\n\t\t\t}\n\n \t\t// add forts and city/village to attackingPieces\n \t\tif (battleFort != null) {\n \t\t\tattackingPieces.get(battleGround.getOwner().getName()).add(battleFort);\n \t\t}\n \t\t\n \t\tkeySetIterator = attackingPieces.keySet().iterator();\n\t \twhile (keySetIterator.hasNext()) {\n\t \t\tString key = keySetIterator.next();\n\t \t\t\n\t \t\tfor (Piece p : attackingPieces.get(key)) {\n\t \t\t\tif (p.getName().equals(\"Baron Munchhausen\") || p.getName().equals(\"Grand Duke\")) {\n\t \t\t\t\tif (p.getOwner() != battleGround.getOwner())\n\t \t\t\t\t\t((Performable)p).specialAbility();\n\t \t\t\t}\n\t \t\t\t\t\n\t \t\t}\n\t \t}\n \t\t// TODO implement city/village\n// \t\tif (City and village stuff here)\n \t\tSystem.out.println(combatants);\n \t\t\n \t\tboolean exploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t// Fight until all attackers are dead, or until the attacker becomes the owner of the hex\n \t\twhile (combatants.size() > 1 || exploring) {\n \t\t\t\n /////////////Exploration\n \t// Check if this is an exploration battle:\n \t\t// Must fight other players first\n \t\t\tboolean fightingWildThings = false;\n \tif (exploring) {\n\n \t\t\t\t// Set the battleGround explored\n \t\t\t\tbattleGround.setExplored(true);\n \t\n \t\tString exploringPlayer = null;\n \t\tIterator<String> keySetIter = battleGround.getContents().keySet().iterator();\n \t \twhile(keySetIter.hasNext()) {\n \t \t\tString key = keySetIter.next();\n \t \t\texploringPlayer = key;\n \t \t}\n \t\tplayer = battleGround.getContents(exploringPlayer).getOwner();\n \t\tplayer.flipAllUp();\n \t \t\n \t\t// Get user to roll die to see if explored right away\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \tDiceGUI.getInstance().uncover();\n \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n \t \t\t\t+ \", roll the die. You need a 1 or a 6 to explore this terrain without a fight!\");\n \t }\n \t\t\t\t});\n \t\t\t\t\n \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n \t\t\t\tint luckyExplore = -1;\n \t\t\t\twhile (luckyExplore == -1) {\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\tluckyExplore = Dice.getFinalVal();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// If success TODO FIX this \n \t\t\t\tif (luckyExplore == 1 || luckyExplore == 6) {\n \t\t\t\t\t\n \t\t\t\t\t// Cover die. Display msg\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t @Override\n \t\t public void run() {\n \t\t \tDiceGUI.getInstance().cover();\n \t\t \tGUI.getHelpText().setText(\"Attack phase: Congrats!\" + player.getName() \n \t\t \t\t\t+ \"!, You get the terrain!\");\n \t\t }\n \t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\texploring = false;\n \t\t\t\t\tbreak;\n \t\t\t\t\t\n \t\t\t\t} else { // Else failure. Must fight or bribe\n \t\t\t\t\t\n \t\t\t\t\tfightingWildThings = true;\n \t\t\t\t\t\n \t\t\t\t\t// Cover die. Display msg\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t @Override\n \t\t public void run() {\n \t\t \tDiceGUI.getInstance().cover();\n \t\t \tbattleGround.coverPieces();\n \t\t \tGUI.getHelpText().setText(\"Attack phase: Boooo!\" + player.getName() \n \t\t \t\t\t+ \"!, You have to bribe, or fight for your right to explore!\");\n \t\t }\n \t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\t\n \t\t\t\t\t// add luckyExplore amount of pieces to terrain under wildThing player\n \t\t\t\t\tfinal ArrayList<Piece> wildPieces = TheCup.getInstance().draw(luckyExplore);\n \t\t\t\t\t\t\n \t\t\t\t\t// Update the infopanel with played pieces. Active done button\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t @Override\n \t\t public void run() {\n \t\t \twildThings.playWildPieces(wildPieces, battleGround);\n \t\t GUI.getDoneButton().setDisable(false);\n \t\t battleGround.coverPieces();\n \t\t \tInfoPanel.showTileInfo(battleGround);\n \t\t \n \t\t }\n \t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\n \t\t\t\t\t//////Bribing here\n \t\t\t\t\tpause();\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectCreatureToBribe\");\n \t\t\t\t\t\n \t\t\t\t\t// Uncover the pieces that the player can afford to bribe\n \t\t\t\t\t// canPay is false if there are no Pieces that the user can afford to bribe\n \t\t\t\t\tboolean canPay = false;\n \t\t\t\t\tfor (final Piece p : battleGround.getContents(wildThings.getName()).getStack()) {\n \t\t\t\t\t\tif (((Combatable)p).getCombatValue() <= player.getGold()) {\n \t\t\t\t\t\t\tcanPay = true;\n \t\t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t\t\t @Override\n \t\t\t\t public void run() {\n \t\t\t\t \tp.uncover();\n \t\t\t\t }\n \t\t\t\t\t\t\t});\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\ttry { Thread.sleep(50); } catch( Exception e ){ return; }\n \t\t\t\t\t\n \t\t\t\t\t// Continue looping until there are no more pieces user can afford to bribe, or user hits done button\n \t\t\t\t\twhile (canPay && isPaused) {\n \t\t\t\t\t\t\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t\t @Override\n\t \t\t public void run() {\n\t \t\t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n\t \t\t \t\t\t+ \", Click on creatures you would like to bribe\");\n\t \t\t }\n \t\t\t\t\t\t});\n \t\t\t\t\t\t\n \t\t\t\t\t\t// wait for user to hit done, or select a piece\n \t\t\t\t\t\tpieceClicked = null;\n \t\t\t\t\t\twhile(pieceClicked == null && isPaused) {\n \t\t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (pieceClicked != null) {\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// spend gold for bribing. Remove clicked creature\n \t\t\t\t\t\t\tplayer.spendGold(((Combatable)pieceClicked).getCombatValue());\n \t\t\t\t\t\t\t((Combatable)pieceClicked).inflict();\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// cover pieces that are too expensive\n \t\t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t\t\t @Override\n \t\t\t\t public void run() {\n \t\t\t\t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n \t\t\t \t\t\t+ \" bribed \" + pieceClicked.getName());\n \t\t\t\t \tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t \tif (battleGround.getContents(wildThings.getName()) != null) {\n\t \t\t\t\t for (Piece p : battleGround.getContents(wildThings.getName()).getStack()) {\n\t \t\t\t\t \tif (((Combatable)p).getCombatValue() > player.getGold())\n\t \t\t\t\t \t\tp.cover();\n\t \t\t\t\t }\n \t\t\t\t \t}\n \t\t\t\t }\n \t\t\t\t\t\t\t});\n \t\t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// Check if there are any pieces user can afford to bribe and set canPay to true if so\n \t\t\t\t\t\t\tcanPay = false;\n \t\t\t\t\t\t\tif (battleGround.getContents(wildThings.getName()) == null || battleGround.getContents(wildThings.getName()).getStack().size() == 1)\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t\telse {\n\t \t\t\t\t\t\t\tfor (final Piece p : battleGround.getContents(wildThings.getName()).getStack()) {\n\t \t\t\t\t\t\t\t\tif (((Combatable)p).getCombatValue() <= player.getGold()) {\n\t \t\t\t\t\t\t\t\t\tcanPay = true;\n\t \t\t\t\t\t\t\t\t\tbreak;\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t @Override\n\t\t\t public void run() {\n\t\t\t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n\t\t \t\t\t+ \" done bribing\");\n\t\t\t }\n \t\t\t\t\t});\n \t\t\t\t\tSystem.out.println(\"Made it past bribing\");\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\t\n \t\t\t\t\t// Done bribing, on to fighting\n \t\t\t\t\t\n \t\t\t\t\t// find another player to control wildThings and move on to regular combat\n \t\t\t\t\t// to be used later \n \t\t\t\t\tPlayer explorer = player;\n \t\t\t\t\tPlayer wildThingsController = null;\n \t\t\t\t\tfor (Player p : playerList) {\n \t\t\t\t\t\tif (!p.getName().equals(player.getName()))\n \t\t\t\t\t\t\twildThingsController = p;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// If wild things still has pieces left:\n \t\t\t\t\tif (battleGround.getContents().containsKey(wildThings.getName())) {\n\t \t\t\t\t\tcombatants.add(battleGround.getContents().get(wildThings.getName()).getOwner());\n\t \t \t\t\tattackingPieces.put(wildThings.getName(), (ArrayList<Piece>) battleGround.getContents().get(wildThings.getName()).getStack().clone()); \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// cover pieces again\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \tbattleGround.coverPieces();\n \t }\n \t\t\t\t});\n \t\t\t\t\n \t\t\t\tplayer.flipAllDown();\n \t} // end if (exploring)\n \t\t\t\n \t\t\tSystem.out.println(\"combatants.size() > 1 : \" + combatants.size());\n \t\t\tSystem.out.println(combatants);\n \t\t\t\n \t\t\t// This hashMap keeps track of the player to attack for each player\n \t\t\tHashMap<String, Player> toAttacks = new HashMap<String, Player>();\n\n\t\t\t\t// each player selects which other player to attack in case of more than two combatants\n \t\t\tif (combatants.size() > 2) {\n \t\t\t\t\n \t\t\t\tfor (final Player p : combatants) {\n \t\t\t\t\tif (!p.isWildThing()) {\n\t \t \t\tpause();\n\t \t \t\tClickObserver.getInstance().setPlayerFlag(\"Attacking: SelectPlayerToAttack\");\n\t \t \t\tplayer = p;\n\t\t \tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t \tPlayerBoard.getInstance().applyCovers();\n\t\t \t \tbattleGround.coverPieces();\n\t\t \t \t GUI.getHelpText().setText(\"Attack phase: \" + player.getName()\n\t\t \t + \", select which player to attack\");\n\t\t\t \t \t}\n\t\t \t });\n\t\t \tfor (final Player pl : combatants) {\n\t\t \t\tif (!pl.getName().equals(player.getName())) {\n\t\t \t\t\tPlatform.runLater(new Runnable() {\n\t\t \t \t @Override\n\t\t \t \t public void run() {\n\t\t \t \t \tPlayerBoard.getInstance().uncover(pl);\n\t\t \t \t }\n\t\t \t\t\t});\n\t\t \t\t}\n\t\t \t}\n\t\t \twhile (isPaused) {\n\t\t \ttry { Thread.sleep(100); } catch( Exception e ){ return; } \n\t\t \t }\n\t\t \t\n\t\t \t// ClickObserver sets playerClicked, then unpauses. This stores what player is attacking what player\n\t\t \ttoAttacks.put(p.getName(), playerClicked);\n\t \t \t\tClickObserver.getInstance().setPlayerFlag(\"\");\n\t\t \t\n\t \t \t} \n \t\t\t\t}\n \t\t\t\tcombatants.remove(wildThings);\n \t\t\t\tPlayerBoard.getInstance().removeCovers();\n \t\t\t\t\n \t } else { // Only two players fighting\n \t \t\n \t \tfor (Player p1 : combatants) {\n \t \t\tfor (Player p2 : combatants) {\n \t \t\t\tif (!p1.getName().equals(p2.getName())) {\n \t \t \ttoAttacks.put(p1.getName(), p2);\n \t \t\t\t}\n \t \t\t}\n \t \t}\n \t }\n \t\t\t\n ///////////////////Call out bluffs here:\n \t\t\tbattleGround.flipPiecesUp();\n \t\t\tfor (final Player p : combatants) {\n \t\t\t\t\n \t\t\t\t// Make sure not wildThings\n \t\t\t\tif (!p.isWildThing()) {\n \t\t\t\t\t\n \t\t\t\t\tArrayList <Piece> callOuts = new ArrayList<Piece>();\n \t\t\t\t\t\n \t\t\t\t\tfor (final Piece ap : attackingPieces.get(p.getName())) {\n \t\t\t\t\t\t\n \t\t\t\t\t\t// If not supported the gtfo\n \t\t\t\t\t\tif (!ap.isSupported()) {\n\n \t\t\t\t\t\t\tcallOuts.add(ap);\n \t\t\t\t\t\t\t((Combatable)ap).inflict();\n \t\t\t\t\t\t\ttry { Thread.sleep(250); } catch( Exception e ){ return; } \n \t\t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t \t @Override\n\t \t \t public void run() {\n\t \t \t \tInfoPanel.showTileInfo(battleGround);\n\t \t \t \tGUI.getHelpText().setText(\"Attack phase: \" + p.getName()\n\t\t\t \t + \" lost their \" + ap.getName() + \" in a called bluff!\");\n\t \t \t }\n\t \t\t\t});\n \t\t\t\t\t\t\ttry { Thread.sleep(250); } catch( Exception e ){ return; } \n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tfor (Piece co : callOuts) {\n \t\t\t\t\t\tattackingPieces.get(p.getName()).remove(co);\n \t\t\t\t\t}\n\t\t\t\t\t\tif (attackingPieces.get(p.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(p.getName());\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n \t\t\tPlayer baby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\t// Set up this HashMap that will store successful attacking pieces\n \t\t\tHashMap<String, ArrayList<Piece>> successAttacks = new HashMap<String, ArrayList<Piece>>();\n \t\t\t// Set up this HashMap that will store piece marked to get damage inflicted\n\t\t\t\tHashMap<String, ArrayList<Piece>> toInflict = new HashMap<String, ArrayList<Piece>>();\n \t\t\tfor (Player p : combatants) {\n \t\t\t\t\n \t\t\t\tsuccessAttacks.put(p.getName(), new ArrayList<Piece>());\n \t\t\t\ttoInflict.put(p.getName(), new ArrayList<Piece>());\n \t\t\t}\n \t\t\t\n \t\t\t// Array List of pieces that need to be used during a particular phase\n\t\t\t\tfinal ArrayList<Piece> phaseThings = new ArrayList<Piece>();\n\t\t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Magic!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t\n/////////////////////// Magic phase\n \t\t\tfor (final Player pl : combatants) {\n \t\t\t\t\n \t\t\t\tplayer = pl;\n \t\t\t\t// Cover all pieces\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \t\tbattleGround.coverPieces();\n \t }\n \t });\n \t\t\t\t\n \t\t\t\t// For each piece, if its magic. Add it to the phaseThings array\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) {\n \t\t\t\t\tif (p instanceof Combatable && ((Combatable)p).isMagic() && !(p instanceof Fort && ((Fort)p).getCombatValue() == 0)) \n \t\t\t\t\t\tphaseThings.add(p);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// uncover magic pieces for clicking\n \t\t\t\tif (phaseThings.size() > 0) {\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \t\t\t\tfor (Piece mag : phaseThings) \n\t \t\t\t\t\tmag.uncover();\n\t \t }\n\t \t });\n \t\t\t\t}\n\n\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"----------------------------------------------------------------\");\n\t\t\t\t\tSystem.out.println(\"attackingPieces.size(): \" + attackingPieces.size());\n\t\t\t\t\tSystem.out.println(\"attackingPieces.keySet(): \" + attackingPieces.keySet());\n\t\t\t\t\tIterator<String> keySetIte = battleGround.getContents().keySet().iterator();\n \t \twhile(keySetIte.hasNext()) {\n \t \t\tString key = keySetIte.next();\n\n \t\t\t\t\tSystem.out.println(\"key: \" + key);\n \t\t\t\t\tSystem.out.println(\"attackingPieces.get(key).size():\\n\" + attackingPieces.get(key).size());\n \t\t\t\t\tSystem.out.println(\"attackingPieces.get(key):\\n\" + attackingPieces.get(key));\n \t \t}\n\t\t\t\t\tSystem.out.println(\"----------------------------------------------------------------\");\n\t\t\t\t\t\n \t\t\t\t// Have user select a piece to attack with until there are no more magic pieces\n \t\t\t\twhile (phaseThings.size() > 0) {\n \t\t\t\t\t\n \t\t\t\t\t// Display message prompting user to select a magic piece\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", select a magic piece to attack with\");\n\t \t }\n\t \t });\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\t// Wait for user to select piece\n \t\t\t\tpieceClicked = null;\n \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t \t\t\t\t\n\t \t\t\t\t// hightlight piece that was selected, uncover the die to use, display message about rolling die\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tpieceClicked.highLight();\n\t \t \tDiceGUI.getInstance().uncover();\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n\t \t \t\t\t+ \", roll the die. You need a \" + ((Combatable)pieceClicked).getCombatValue() + \" or lower\");\n\t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\n\t \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n \t\t\t\t\tint attackStrength = -1;\n \t\t\t\t\twhile (attackStrength == -1) {\n \t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\tattackStrength = Dice.getFinalVal();\n \t\t\t\t\t}\n\t\t\t\t\t\t\n \t\t\t\t\t// If the roll was successful. Add to successfulThings Array, and change it image. prompt Failed attack\n \t\t\t\t\tif (attackStrength <= ((Combatable)pieceClicked).getCombatValue()) {\n \t\t\t\t\t\t\n \t\t\t\t\t\tsuccessAttacks.get(player.getName()).add(pieceClicked);\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t \t @Override\n \t \t public void run() {\n \t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(true);\n \t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n \t \t \tGUI.getHelpText().setText(\"Attack phase: Successful Attack!\");\n \t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\t\n \t\t\t\t\t} else { // else failed attack, update image, prompt Failed attack\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(false);\n\t\t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t\t \t \tGUI.getHelpText().setText(\"Attack phase: Failed Attack!\");\n\t\t \t }\n\t \t\t\t\t\t});\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// Pause to a second for easy game play, remove the clicked piece from phaseThings\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\tphaseThings.remove(pieceClicked);\n \t\t\t\t}\n \t\t\t}\n\n\t\t\t\t// For each piece that had success, player who is being attacked must choose a piece\n \t\t\t// Gets tricky here. Will be tough for Networking :(\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Active player is set to the player who 'pl' is attack based on toAttack HashMap\n \t\t\t\tplayer = toAttacks.get(pl.getName()); // 'defender'\n \t\t\t\tfinal String plName = pl.getName();\n \t\t\t\t\n \t\t\t\t// For each piece of pl's that has a success (in successAttacks)\n \t\t\t\tint i = 0;\n \t\t\t\tfor (final Piece p : successAttacks.get(plName)) {\n\n \t\t\t\t\t// If there are more successful attacks then pieces to attack, break after using enough attacks\n \t\t\t\t\tif (i >= attackingPieces.get(player.getName()).size()) {\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// Display message, cover other players pieces, uncover active players pieces\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", Select a Piece to take a hit from \" + plName + \"'s \" + p.getName());\n\t \t \tbattleGround.coverPieces();\n\t \t \tbattleGround.uncoverPieces(player.getName());\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\n\t \t\t\t\t// Cover pieces already choosen to be inflicted. Wait to make sure runLater covers pieces already selected\n\t \t\t\t\tfor (final Piece pi : toInflict.get(player.getName())) {\n\t \t\t\t\t\tif (!((pi instanceof Fort) && ((Fort)pi).getCombatValue() > 0)) {\n\t\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t\t \t\t\t\t\tpi.cover();\n\t\t\t \t }\n\t\t\t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t}//TODO here is where a pause might be needed\n\t \t\t\t\t\n\t \t\t\t\t// Wait for user to select piece\n \t\t\t\t\tpieceClicked = null;\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToGetHit\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToGetHit\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t\t \t\t\t\n \t\t\t\t\t// Add to arrayList in HashMap of player to mark for future inflict. Cover pieces\n \t\t\t\t\ttoInflict.get(player.getName()).add(pieceClicked);\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tbattleGround.coverPieces();\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ti++;\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\t\n \t\t\t\t}\n \t\t\t\t// Clear successful attacks for next phase\n \t\t\t\tsuccessAttacks.get(pl.getName()).clear();\n \t\t\t}\n \t\t\t\n \t\t\t// Remove little success and failure images, inflict if necessary\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Change piece image of success or failure to not visible\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) \n \t\t\t\t\t((Combatable)p).resetAttack();\n \t\t\t\t\n\t\t\t\t\t// inflict return true if the piece is dead, and removes it from attackingPieces if so\n \t\t\t\t// Inflict is also responsible for removing from the CreatureStack\n \t\t\t\tfor (Piece p : toInflict.get(pl.getName())) {\n\t\t\t\t\t\tif (((Combatable)p).inflict()) \n\t\t\t\t\t\t\tattackingPieces.get(pl.getName()).remove(p);\n\t\t\t\t\t\tif (attackingPieces.get(pl.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(pl.getName());\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Clear toInflict for next phase\n \t\t\t\ttoInflict.get(pl.getName()).clear();\n \t\t\t}\n\n\t\t\t\t// Update the InfoPanel gui for changed/removed pieces\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n \t\t\t\t\tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t\tbattleGround.coverPieces();\n\t }\n\t\t\t\t});\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n \t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Ranged!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n//////////////////// Ranged phase\n\t\t\t\tfor (final Player pl : combatants) {\n \t\t\t\t\n \t\t\t\tplayer = pl;\n \t\t\t\t// Cover all pieces\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \t\tbattleGround.coverPieces();\n \t }\n \t });\n \t\t\t\t\n \t\t\t\t// For each piece, if its ranged. Add it to the phaseThings array\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) {\n \t\t\t\t\tif (p instanceof Combatable && ((Combatable)p).isRanged() && !(p instanceof Fort && ((Fort)p).getCombatValue() == 0)) \n \t\t\t\t\t\tphaseThings.add(p);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// uncover ranged pieces for clicking\n \t\t\t\tif (phaseThings.size() > 0) {\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \t\t\t\tfor (Piece ran : phaseThings) \n\t \t\t\t\t\tran.uncover();\n\t \t }\n\t \t });\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Have user select a piece to attack with until there are no more ranged pieces\n \t\t\t\twhile (phaseThings.size() > 0) {\n \t\t\t\t\t\n \t\t\t\t\t// Display message prompting user to select a ranged piece\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", select a ranged piece to attack with\");\n\t \t }\n\t \t });\n\n \t\t\t\t\t// Wait for user to select piece\n \t\t\t\tpieceClicked = null;\n \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t \t\t\t\t\n\t \t\t\t\t// hightlight piece that was selected, uncover the die to use, display message about rolling die\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tpieceClicked.highLight();\n\t \t \tDiceGUI.getInstance().uncover();\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName()\n\t \t + \", roll the die. You need a \" + ((Combatable)pieceClicked).getCombatValue() + \" or lower\");\n\t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\n\t \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n \t\t\t\t\tint attackStrength = -1;\n \t\t\t\t\twhile (attackStrength == -1) {\n \t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\tattackStrength = Dice.getFinalVal();\n \t\t\t\t\t}\n\t\t\t\t\t\t\n \t\t\t\t\t// If the roll was successful. Add to successfulThings Array, and change it image. prompt Failed attack\n \t\t\t\t\tif (attackStrength <= ((Combatable)pieceClicked).getCombatValue()) {\n \t\t\t\t\t\t\n \t\t\t\t\t\tsuccessAttacks.get(player.getName()).add(pieceClicked);\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t \t @Override\n \t \t public void run() {\n \t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(true);\n \t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n \t \t \tGUI.getHelpText().setText(\"Attack phase: Successful Attack!\");\n \t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\t\n \t\t\t\t\t} else { // else failed attack, update image, prompt Failed attack\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(false);\n\t\t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t\t \t \tGUI.getHelpText().setText(\"Attack phase: Failed Attack!\");\n\t\t \t }\n\t \t\t\t\t\t});\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// Pause to a second for easy game play, remove the clicked piece from phaseThings\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\tphaseThings.remove(pieceClicked);\n \t\t\t\t}\n \t\t\t}\n\n\t\t\t\t// For each piece that had success, player who is being attacked must choose a piece\n \t\t\t// Gets tricky here. Will be tough for Networking :(\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Active player is set to the player who 'pl' is attack based on toAttack HashMap\n \t\t\t\tplayer = toAttacks.get(pl.getName());\n \t\t\t\tfinal String plName = pl.getName();\n \t\t\t\t\n \t\t\t\t// For each piece of pl's that has a success (in successAttacks)\n \t\t\t\tint i = 0;\n \t\t\t\tfor (final Piece p : successAttacks.get(plName)) {\n\n \t\t\t\t\t// If there are more successful attacks then pieces to attack, break after using enough attacks\n \t\t\t\t\tif (i >= attackingPieces.get(player.getName()).size()) {\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// Display message, cover other players pieces, uncover active players pieces\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", Select a Piece to take a hit from \" + plName + \"'s \" + p.getName());\n\t \t \tbattleGround.coverPieces();\n\t \t \tbattleGround.uncoverPieces(player.getName());\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\t\n\t \t\t\t\t// Cover pieces already choosen to be inflicted. Wait to make sure runLater covers pieces already selected\n\t \t\t\t\tfor (final Piece pi : toInflict.get(player.getName())) {\n\t \t\t\t\t\tif (!((pi instanceof Fort) && ((Fort)pi).getCombatValue() > 0)) {\n\t\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t\t \t\t\t\t\tpi.cover();\n\t\t\t \t }\n\t\t\t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t}//TODO here is where a pause might be needed\n\t \t\t\t\t\n\t \t\t\t\t// Wait for user to select piece\n \t\t\t\t\tpieceClicked = null;\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToGetHit\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToGetHit\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n \t\t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t\t \t\t\t\n \t\t\t\t\t// Add to arrayList in HashMap of player to mark for future inflict. Cover pieces\n \t\t\t\t\ttoInflict.get(player.getName()).add(pieceClicked);\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tbattleGround.coverPieces();\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\ti++;\n \t\t\t\t}\n \t\t\t\t// Clear successful attacks for next phase\n \t\t\t\tsuccessAttacks.get(pl.getName()).clear();\n \t\t\t}\n \t\t\t\n \t\t\t// Remove little success and failure images, inflict if necessary\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Change piece image of success or failure to not visible\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) \n \t\t\t\t\t((Combatable)p).resetAttack();\n \t\t\t\t\n\t\t\t\t\t// inflict return true if the piece is dead, and removes it from attackingPieces if so\n \t\t\t\t// Inflict is also responsible for removing from the CreatureStack\n \t\t\t\tfor (Piece p : toInflict.get(pl.getName())) {\n\t\t\t\t\t\tif (((Combatable)p).inflict()) \n\t\t\t\t\t\t\tattackingPieces.get(pl.getName()).remove(p);\n\t\t\t\t\t\tif (attackingPieces.get(pl.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(pl.getName());\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Clear toInflict for next phase\n \t\t\t\ttoInflict.get(pl.getName()).clear();\n \t\t\t}\n\n\t\t\t\t// Update the InfoPanel gui for changed/removed pieces\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n \t\t\t\t\tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t\tbattleGround.coverPieces();\n\t }\n\t\t\t\t});\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n\t\t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Melee!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t\n\n///////////////////////////// Melee phase\n\t\t\t\tfor (final Player pl : combatants) {\n \t\t\t\t\n \t\t\t\tplayer = pl;\n \t\t\t\t// Cover all pieces\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \t\tbattleGround.coverPieces();\n \t }\n \t });\n \t\t\t\t\n \t\t\t\t// For each piece, if its melee. Add it to the phaseThings array\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) {\n \t\t\t\t\tif (p instanceof Combatable && !(((Combatable)p).isRanged() || ((Combatable)p).isMagic()) && !(p instanceof Fort && ((Fort)p).getCombatValue() == 0)) \n \t\t\t\t\t\tphaseThings.add(p);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// uncover melee pieces for clicking\n \t\t\t\tif (phaseThings.size() > 0) {\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \t\t\t\tfor (Piece mel : phaseThings) \n\t \t\t\t\t\tmel.uncover();\n\t \t }\n\t \t });\n \t\t\t\t}\n \t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\n \t\t\t\t// Have user select a piece to attack with until there are no more melee pieces\n \t\t\t\twhile (phaseThings.size() > 0) {\n \t\t\t\t\t\n \t\t\t\t\t// Display message prompting user to select a melee piece\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", select a melee piece to attack with\");\n\t \t }\n\t \t });\n\n \t\t\t\t\t// Wait for user to select piece\n \t\t\t\tpieceClicked = null;\n \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t \t\t\t\t\n\t \t\t\t\t// Is it a charging piece?\n\t \t\t\t\tint charger;\n\t \t\t\t\tif (((Combatable)pieceClicked).isCharging()) {\n\t \t\t\t\t\tcharger = 2;\n\t \t\t\t\t} else\n\t \t\t\t\t\tcharger = 1;\n\t \t\t\t\t\n\t \t\t\t\t// do twice if piece is a charger\n\t \t\t\t\tfor (int i = 0; i < charger; i++) {\n\t \t\t\t\t\t\n\t\t \t\t\t\t// hightlight piece that was selected, uncover the die to use, display message about rolling die\n\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t \tpieceClicked.highLight();\n\t\t \t \tDiceGUI.getInstance().uncover();\n\t\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName()\n\t\t \t + \", roll the die. You need a \" + ((Combatable)pieceClicked).getCombatValue() + \" or lower\");\n\t\t \t }\n\t \t\t\t\t\t});\n\t \t\t\t\t\t\n\t\t \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n\t \t\t\t\t\tint attackStrength = -1;\n\t \t\t\t\t\twhile (attackStrength == -1) {\n\t \t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\t\t\tattackStrength = Dice.getFinalVal();\n\t \t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t \t\t\t\t\t// If the roll was successful. Add to successfulThings Array, and change it image. prompt Failed attack\n\t \t\t\t\t\tif (attackStrength <= ((Combatable)pieceClicked).getCombatValue()) {\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t\tsuccessAttacks.get(player.getName()).add(pieceClicked);\n\t \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t \t @Override\n\t \t \t public void run() {\n\t \t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(true);\n\t \t \t\t\t\t\t\tpieceClicked.cover();\n\t \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t \t \t \tGUI.getHelpText().setText(\"Attack phase: Successful Attack!\");\n\t \t \t }\n\t \t\t\t\t\t});\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t} else { // else failed attack, update image, prompt Failed attack\n\t \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(false);\n\t\t\t \t\t\t\t\t\tpieceClicked.cover();\n\t \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t\t\t \t \tGUI.getHelpText().setText(\"Attack phase: Failed Attack!\");\n\t\t\t \t }\n\t\t \t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \t\t\t\t\t// If piece is charging, and it is its first attack, remove the cover again\n\t \t\t\t\t\tif (((Combatable)pieceClicked).isCharging() && i == 0) {\n\t \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t \t \tpieceClicked.uncover();\n\t\t\t \t }\n\t \t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \t\t\t\t\t// Pause to a second for easy game play, remove the clicked piece from phaseThings\n\t \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n\t \t\t\t\t}\n\n \t\t\t\t\tphaseThings.remove(pieceClicked);\n \t\t\t\t}\n \t\t\t}\n\n\t\t\t\t// For each piece that had success, player who is being attacked must choose a piece\n \t\t\t// Gets tricky here. Will be tough for Networking :(\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Active player is set to the player who 'pl' is attack based on toAttack HashMap\n \t\t\t\tplayer = toAttacks.get(pl.getName());\n \t\t\t\tfinal String plName = pl.getName();\n \t\t\t\t\n \t\t\t\t// For each piece of pl's that has a success (in successAttacks)\n \t\t\t\tint i = 0;\n \t\t\t\tfor (final Piece p : successAttacks.get(plName)) {\n \t\t\t\t\t\n \t\t\t\t\t// If there are more successful attacks then pieces to attack, break after using enough attacks\n \t\t\t\t\tif (i >= attackingPieces.get(player.getName()).size()) {\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// Display message, cover other players pieces, uncover active players pieces\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", Select a Piece to take a hit from \" + plName + \"'s \" + p.getName());\n\t \t \tbattleGround.coverPieces();\n\t \t \tbattleGround.uncoverPieces(player.getName());\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\t\n\t \t\t\t\t// Cover pieces already choosen to be inflicted. Wait to make sure runLater covers pieces already selected\n\t \t\t\t\tfor (final Piece pi : toInflict.get(player.getName())) {\n\t \t\t\t\t\tif (!((pi instanceof Fort) && ((Fort)pi).getCombatValue() > 0)) {\n\t\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t\t \t\t\t\t\tpi.cover();\n\t\t\t \t }\n\t\t\t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t}//TODO here is where a pause might be needed\n\t \t\t\t\t\n\t \t\t\t\t// Wait for user to select piece\n \t\t\t\t\tpieceClicked = null;\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToGetHit\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToGetHit\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n \t\t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t\t \t\t\t\n \t\t\t\t\t// Add to arrayList in HashMap of player to mark for future inflict. Cover pieces\n \t\t\t\t\ttoInflict.get(player.getName()).add(pieceClicked);\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tbattleGround.coverPieces();\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\ti++;\n \t\t\t\t}\n \t\t\t\t// Clear successful attacks for next phase\n \t\t\t\tsuccessAttacks.get(pl.getName()).clear();\n \t\t\t}\n \t\t\t\n \t\t\t// Remove little success and failure images, inflict if necessary\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Change piece image of success or failure to not visible\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) \n \t\t\t\t\t((Combatable)p).resetAttack();\n \t\t\t\t\n\t\t\t\t\t// inflict return true if the piece is dead, and removes it from attackingPieces if so\n \t\t\t\t// Inflict is also responsible for removing from the CreatureStack\n \t\t\t\tfor (Piece p : toInflict.get(pl.getName())) {\n\t\t\t\t\t\tif (((Combatable)p).inflict()) \n\t\t\t\t\t\t\tattackingPieces.get(pl.getName()).remove(p);\n\t\t\t\t\t\tif (attackingPieces.get(pl.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(pl.getName());\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Clear toInflict for next phase\n \t\t\t\ttoInflict.get(pl.getName()).clear();\n \t\t\t}\n\n\t\t\t\t// Update the InfoPanel gui for changed/removed pieces\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n \t\t\t\t\tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t\tbattleGround.coverPieces();\n\t }\n\t\t\t\t});\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n\t\t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Retreat!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n \t\t\t\n \t\t\t\n//////////////////////// Retreat phase\n\t\t\t\t// Can only retreat to a Terrain that has been explored and has no ememies on it\n\t\t\t\t\n\t\t\t\t// Display message, activate done button\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tGUI.getHelpText().setText(\"Attack phase: Retreat some of your armies?\");\n\t\t GUI.getDoneButton().setDisable(false);\n\t }\n\t }); \t\t\t\t\n\t\t\t\t\n\t\t\t\t// For each combatant, ask if they would like to retreat\n\t\t for (Player pl : combatants) {\n\t\t \t\n\t\t \t// Make sure wildThings aren't trying to get away\n\t\t \tif (!pl.isWildThing()) {\n\t\t\t \tplayer = pl;\n\t \t InfoPanel.uncover(player.getName());\n\t\t\t\t ClickObserver.getInstance().setActivePlayer(player);\n\t\t\t\t ClickObserver.getInstance().setCreatureFlag(\"Combat: SelectRetreaters\");\n\t\t\t\t \n\t\t\t\t // Pause and wait for player to hit done button\n\t\t\t\t pause();\n\t\t\t Platform.runLater(new Runnable() {\n\t\t\t @Override\n\t\t\t public void run() {\n\t\t\t \tbattleGround.coverPieces();\n\t\t\t \tbattleGround.uncoverPieces(player.getName());\n\t\t\t \tbattleGround.coverFort();\n\t\t\t \t GUI.getHelpText().setText(\"Attack Phase: \" + player.getName() + \", You can retreat your armies\");\n\t\t\t }\n\t\t\t });\n\t\t\t\t while (isPaused && battleGround.getContents(player.getName()) != null) {\n\t\t\t \ttry { Thread.sleep(100); } catch( Exception e ){ return; } \n\t\t\t\t }\t \n\t\t\t\t ClickObserver.getInstance().setTerrainFlag(\"Disabled\");\n\t\t\t\t \n\t\t\t\t // TODO, maybe an if block here asking user if they would like to attack \n\t\t\t\t System.out.println(attackingPieces + \"---BEFORE CLEARING\");\n\t\t\t\t // Re-populate attackingPieces to check for changes\n\t\t\t\t attackingPieces.clear();\n\t\t\t\t Iterator<String> keySetIterator2 = battleGround.getContents().keySet().iterator();\n\t\t\t\t \twhile(keySetIterator2.hasNext()) {\n\t\t\t\t \t\tString key = keySetIterator2.next();\n System.out.println(key + \"=====key\");\n\t\t\t \t\t\tattackingPieces.put(battleGround.getContents().get(key).getOwner().getName(), (ArrayList<Piece>) battleGround.getContents().get(key).getStack().clone()); \n\t\t\t\t \t}\n // System.out.println(attackingPieces);\n\t\t\t\t \t// if the owner of the terrain has no pieces, just a fort or city/village\n System.out.println(\"===battleground\"+battleGround);\n System.out.println(\"===attackingPieces\"+attackingPieces);\n System.out.println(combatants.contains(battleGround.getOwner()) ? \"TRUE\" : \"FALSE\");\n\t\t\t\t\t\tif (combatants.contains(battleGround.getOwner()) && battleFort != null) {\n System.out.println(battleGround + \"===battleground\");\n\t\t\t\t\t\t\tattackingPieces.put(battleGround.getOwner().getName(), new ArrayList<Piece>());\n System.out.println(attackingPieces + \"===attacking pieces\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (battleFort != null) {\n System.out.println(battleFort.getName() + \"===battlefort\");\n System.out.println(battleFort.getOwner().getName() + \"===battlefort's owner\");\n \n\t\t\t\t\t\t\tattackingPieces.get(battleFort.getOwner().getName()).add(battleFort);\n System.out.println(attackingPieces.get(battleFort.getOwner().getName()));\n\t\t\t\t\t\t}\n\t//\t\t\t\t\tif (battleGround city/village)\n\t\t\t\t\t\t// TODO city/village\n\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t // Check if all the players pieces are now gone\n\t\t\t\t if (!attackingPieces.containsKey(player.getName())) {\n\t\t\t\t \t\n\t\t\t\t \t// Display message, and remove player from combatants\n\t\t\t\t \tPlatform.runLater(new Runnable() {\n\t\t\t\t @Override\n\t\t\t\t public void run() {\n\t\t\t\t \t GUI.getHelpText().setText(\"Attack Phase: \" + player.getName() + \" has retreated all of their pieces!\");\n\t\t\t\t }\n\t\t\t\t });\n\t\t\t\t \t\n\t\t\t\t \t// If there is only 1 player fighting for the hex, \n\t\t\t\t \tif (attackingPieces.size() == 1) \n\t\t\t\t \t\tbreak;\n\t\t\t\t \t\n\t\t\t\t \t// Pause because somebody just retreated\n\t\t\t\t \ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t }\n\t\t\t\t \n\n\t \t InfoPanel.cover(player.getName());\n\t\t\t\t \n\t\t\t }\n\t\t }\n\t\t \n\t\t // Done button no longer needed\n\t\t Platform.runLater(new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t GUI.getDoneButton().setDisable(true);\n\t\t }\n\t\t });\n\t\t ClickObserver.getInstance().setCreatureFlag(\"\");\n\t\t ClickObserver.getInstance().setFortFlag(\"\");\n\t\t \n\t\t // Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n \t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\n\t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n\t\t\t\t\n\t\t\t\t// Add wildthings back to combatants if they were removed\n\t\t\t\tif (battleGround.getContents().containsKey(wildThings.getName()) && !combatants.contains(wildThings))\n\t\t\t\t\tcombatants.add(wildThings);\n\t\t\t\t\n \t\t} // end while (combatants.size() > 1 || exploring)\n \t\tbattleGround.coverFort();\n \t\t\n////////////////// Post Combat\n \t\t\n \t\t// sets player as the winner of the combat\n \t\t// Can be null if battle takes place on a hex owned by nobody, and each player lost all pieces\n \t\tPlatform.runLater(new Runnable() {\n @Override\n public void run() {\n \tbattleGround.removeBattleHex();\n }\n \t\t});\n \t\t\n \t\tif (combatants.size() == 0)\n \t\t\tplayer = battleGround.getOwner();\n \t\telse if (combatants.size() == 1 && combatants.get(0).getName().equals(wildThings.getName()))\n \t\t\tplayer = null;\n \t\telse\n \t\t\tplayer = combatants.get(0);\n \t\t\n \t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n \t\tSystem.out.println(\"combatants: \" + combatants);\n \t\tfor (Player p : combatants) {\n \t\tSystem.out.println(\"p.getName(): \"+ p.getName());\n \t\t\t\n \t\t}\n \t\tSystem.out.println(\"owner: \" + owner);\n \t\tSystem.out.println(\"combatants.get(0): \" + combatants.get(0));\n \t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n \t\t\n \t\t\n \t\t// Change ownership of hex to winner\n \t\tboolean ownerChanged = false;\n \t\tif (owner != null && combatants.size() > 0 && !battleGround.getOwner().equals(combatants.get(0))) {\n \t\t\tbattleGround.getOwner().removeHex(battleGround);\n \t\t\tcombatants.get(0).addHexOwned(battleGround);\n \t\t\townerChanged = true;\n \t\t}\n\t\t\t\n \t\t// See if fort is kept or downgraded.\n \t\tif (battleFort != null) {\n if (battleFort.getName().equals(\"Citadel\")) {\n owner.setCitadel(false);\n player.setCitadel(true);\n battleFort.healFort();\n player.addHexOwned(battleGround);\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", you get to keep the fort!\");\n }\n });\n checkWinners();\n return;\n }\n \t\t\n\t\t\t\t// Get player to click dice to see if fort is kept\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tGUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", roll the die to see if the fort is kept or downgraded\");\n\t \tDiceGUI.getInstance().uncover();\n\t \tInfoPanel.showTileInfo(battleGround);\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n\t\t\t\tint oneOrSixGood = -1;\n\t\t\t\twhile (oneOrSixGood == -1) {\n\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t\t\t\t\toneOrSixGood = Dice.getFinalVal();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if a 1 or 6, keep fort (Keep it.... not turn it into a keep)\n\t\t\t\tif (oneOrSixGood == 1 || oneOrSixGood == 6) {\n\t\t\t\t\tbattleFort.healFort();\n\t\t\t\t\tplayer.addHexOwned(battleGround);\n\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t \tGUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", you get to keep the fort!\");\n\t\t }\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tbattleFort.downgrade();Platform.runLater(new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t \tGUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", the fort was destroyed!\");\n\t\t }\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tInfoPanel.showTileInfo(battleGround);\n\t }\n\t });\n\t\t\t\t\n\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n\t\t\t\t\n\t\t\t\t\n \t\t}\n\n \t\tbattleGround.flipPiecesDown();\n\t\t\t// TODO city/village and special incomes if they are kept or lost/damaged \n \t\t\n \t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t}/// end Post combat\n\n \tPlatform.runLater(new Runnable() {\n @Override\n public void run() {\n//\t\t\t\tInfoPanel.showBattleStats();\n \tBoard.removeCovers();\n }\n\t\t});\n \t\n\t\tClickObserver.getInstance().setTerrainFlag(\"\");\n\t\tClickObserver.getInstance().setPlayerFlag(\"\");\n\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t\tbattleGrounds.clear();\n }", "public abstract void attack(int i,int j);", "public abstract boolean attack(Enemy w);", "public boolean attack(Animal animal, int attackType) {\n if (energy - attackValue[attackType] >= 0) {\n animal.life -= attackValue[attackType];\n energy -= attackValue[attackType];\n if (animal.life <= 0) {\n animal.alive = false;\n }\n return true;\n } else {\n System.err.println(\"Can't attack\");\n return false;\n }\n }", "public void attack() {\n\n }", "private void takeDamage(int damage){ health -= damage;}", "@Override\n public void attack(Entity e) {\n e.hit(atk);\n }", "public void battleEnemyAttack() {\n if(battleEnemy != null){ // If all enemies have attacked, they cannot attack anymore for this round\n\n MovingEntity target = battleEnemy.getAttackPreference(targetAllies);\n if(target == null){\n target = targetAlly;\n }\n\n battleEnemy.attack(target, targetEnemies, targetAllies);\n //System.out.println(battleEnemy.getID() + \" is attacking \" + target.getID() + \" remaining hp: \" + target.getCurrHP());\n if (updateTarget(target) == false) {\n // if target still alive, check if its still friendly incase of zombify\n targetAlly = checkSideSwap(targetAlly, false, battleEnemies, targetEnemies, battleAllies, targetAllies);\n }\n\n battleEnemy = nextAttacker(battleEnemy, battleEnemies);\n\n }\n }", "@Override\n public void attack(ArrayList<territories> PlayersTerritories,int bonusArmies ) {\n\n // placeArmy(PlayersTerritories,bonusArmies);\n\n\n territories toAttack=getTerritoryGreedyAttack(PlayersTerritories,0);\n\n territories AttackWith = GetMaximumAttacker(PlayersTerritories,toAttack);\n\n Attacking(toAttack,AttackWith);\n\n\n\n }", "public void takeDamage(int damage);", "public void handle(long now) {\n if (attackCD > 0) {\n attackCD--;\n }\n if (input.contains(\"J\") && attackCD <= 0) {\n currSpeed = 0;\n attackCD = 50;\n int temp = attack();\n damageWindow = temp;\n moveCD = temp;\n } else if (input.size() > 1) {\n currSpeed = speed * speedWeaponModifier * speedBuffModifier / Math.sqrt(2);\n } else {\n currSpeed = speed * speedWeaponModifier * speedBuffModifier;\n }\n if (damageWindow > 0) {\n for (Monster monster : GameLoop.getMonsters()) {\n if (Controller.getPlayer().intersects(monster) && !(weapon instanceof Bow)) {\n System.out.println(\"Player damaged monster for \" + damage * damageWeaponModifier * damageBuffModifier);\n monster.takeDamage(damage * damageWeaponModifier * damageBuffModifier);\n damageWindow = 0;\n }\n }\n damageWindow--;\n }\n if (damageCooldown > 0 && damageCooldown % 15 == 0) { // got hit\n invisibilityCd = 5; // set invis frames\n }\n damageCooldown--; // so dmgcd triggers for first frame (60 % 15)\n\n if (moveCD > 0) {\n moveCD--;\n } else {\n if (input.contains(\"A\") && positionX > 10) {\n imageView.setScaleX(1);\n moveRelative(-currSpeed, 0);\n direction = 0;\n }\n if (input.contains(\"D\") && positionX + width < (scene.getWidth() - 25)) {\n imageView.setScaleX(-1);\n moveRelative(currSpeed, 0);\n direction = 1;\n }\n if (input.contains(\"W\") && positionY > 10) {\n moveRelative(0, -currSpeed);\n }\n if (input.contains(\"S\") && positionY + height < (scene.getHeight() - 55)) {\n moveRelative(0, currSpeed);\n }\n }\n\n if (invisibilityCd > 0) { // Overwrite setScale if invis frames\n imageView.setScaleX(0);\n } else if (imageView.getScaleX() == 0) { // If player didn't move\n if (direction == 0) { // same direction\n imageView.setScaleX(1);\n } else if (direction == 1) {\n imageView.setScaleX(-1);\n }\n }\n invisibilityCd--;\n\n\n //Keyboard transitions to screens\n if (input.contains(\"I\")) {\n containedI = true;\n }\n if (containedI && !input.contains(\"I\")) { //Go to inventory if I was released.\n Controller.goToInventory();\n input.remove(\"I\");\n containedI = false;\n }\n\n }", "public abstract int doDamage(int time, GenericMovableUnit unit, Unit target);", "public void attack() {\n //Grab an attacker.\n Territory attacker = potentialAttackers.remove(0);\n \n //Find the weakest adjacent territory\n int victimStrength = Integer.MAX_VALUE;\n Territory victim = null;\n List<Territory> adjs = gameController.getBoard().getAdjacentTerritories(attacker);\n for(Territory adj : adjs){\n \n //Verify that our odds are good enough for this attack to consider it.\n int aTroops = attacker.getNumTroops() - 1;\n int dTroops = adj.getNumTroops();\n double odds = MarkovLookupTable.getOddsOfSuccessfulAttack(aTroops, dTroops);\n boolean yes = Double.compare(odds, ACCEPTABLE_RISK) >= 0;\n \n //If we have a chance of winning this fight and its the weakest opponent.\n if(yes && adj.getNumTroops() < victimStrength && !adj.getOwner().equals(this)){\n victim = adj;\n victimStrength = adj.getNumTroops();\n }\n }\n \n //Resolve the Attack by building forces and settle the winner in Victim's land\n Force atkForce = attacker.buildForce(attacker.getNumTroops() - 1);\n Force defForce = victim.buildForce(victimStrength); //Guaranteed not null\n Force winner = atkForce.attack(defForce);\n victim.settleForce(winner);\n }", "public abstract boolean attack(TemporaryCharm i);", "@Override\n\tpublic void visit(EquipmentAttack e) {\n\t}", "private int lightAttack() {\n return attack(9, 0);\n }", "@Override\r\n\tpublic void useSkill() {\n\t\tthis.defense+=20;\r\n\t\tthis.maxHp+=(this.maxHp/2);\r\n\t\tthis.hp+=(this.hp/2);\r\n\t\tthis.skillActive = true;\r\n\t\tthis.skillLast = 2;\r\n\t}", "public static void worldTimeStep() {\n\t\t//System.out.println(\"Time Step: \" + count);\n\t\tcount = count + 1;\n\t for (Critter A : Critter.population){\n\t if(A.energy<=0){\n\t\t\t\tA.isAlive = false;\n }\n else if(A.energy>0){\n\t A.isAlive=true;\n A.doTimeStep();\n if(A.energy<0){\n\t\t\t\t\tA.isAlive = false;\n\t\t\t\t}\n }\n\n }\n\t\tfor (Iterator<Critter> iterator = Critter.population.iterator(); iterator.hasNext();){\n\t\t\tCritter tmp = iterator.next();\n\t\t\tif (tmp.isAlive == false){\n\t\t\t\titerator.remove();\n\t\t\t}\n\t\t}\n\n encounters2();\n\n\t\tfor (Iterator<Critter> iterator = Critter.population.iterator(); iterator.hasNext();){\n\t\t\tCritter tmp = iterator.next();\n\t\t\tif (tmp.isAlive == false){\n\t\t\t\titerator.remove();\n\t\t\t}\n\t\t}\n\n\t\tmapCheck();\n\t\t// we have add reproduction\n\n\t\t// we have to add algae\n\t\tfor (int i = 0; i < Params.refresh_algae_count; i = i + 1){\n\t\t\t//Algae child = new Algae();\n\t\t\t//child.setEnergy(Params.start_energy);\n\t\t\t//makecritter takes care of anything\n\t\t\ttry{\n\t\t\t\tmakeCritter(\"Algae\");\n\t\t\t}\n\t\t\tcatch(InvalidCritterException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\t//deduct rest energy\n\t\tfor (Critter A : Critter.population){\n\t\t\tA.energy = A.getEnergy() - Params.rest_energy_cost;\n\t\t\tif(A.getEnergy()<=0){\n\t\t\t\tA.isAlive=false;\n\t\t\t}\n\t\t}\n\t\tfor (Iterator<Critter> iterator = Critter.population.iterator(); iterator.hasNext();){\n\t\t\tCritter tmp = iterator.next();\n\t\t\tif (tmp.isAlive == false){\n\t\t\t\titerator.remove();\n\t\t\t}\n\t\t}\n\t\t//babies add\n\t\tfor(Critter b: babies){\n\t\t\tb.isAlive=true;\n\t\t\tpopulation.add(b);\n\t\t}\n\t\t//not sure if this removes everything\n\t\tbabies.clear();\n\t}", "@Override\n\tpublic void doTimeStep() {\n\t\tif (getEnergy() > Params.MIN_REPRODUCE_ENERGY) {\n\t\t\tCritter1 child = new Critter1();\n\t\t\treproduce(child, Critter.getRandomInt(8));\n\t\t}\n\t\telse{\n\t\t\twalk(Critter.getRandomInt(8));\n\t\t}\n\t}", "@Override\r\n\tpublic int attack() {\r\n\t\treturn rnd.nextInt(MAX_MONSTER_ATTACK_DAMAGE);\r\n\t}", "public void playerAttack() {\n if (playerTurn==true) {\n myMonster.enemHealth=myMonster.enemHealth-battlePlayer.str;\n }\n playerTurn=false;\n enemyMove();\n }", "protected void attackEntity(Entity par1Entity, float par2) {\n/* 310 */ if (this.attackTime <= 0 && par2 < 3.0F && (par1Entity.func_174813_aQ()).field_72337_e > (func_174813_aQ()).field_72338_b && (par1Entity.func_174813_aQ()).field_72338_b < (func_174813_aQ()).field_72337_e) {\n/* */ \n/* 312 */ if (getIsSummoned()) {\n/* 313 */ ((EntityLivingBase)par1Entity).field_70718_bc = 100;\n/* */ }\n/* */ \n/* 316 */ this.attackTime = 15 + this.field_70146_Z.nextInt(10);\n/* */ \n/* 318 */ double mx = par1Entity.field_70159_w;\n/* 319 */ double my = par1Entity.field_70181_x;\n/* 320 */ double mz = par1Entity.field_70179_y;\n/* 321 */ if (func_70652_k(par1Entity) && \n/* 322 */ !this.field_70170_p.field_72995_K && par1Entity instanceof EntityLivingBase) {\n/* 323 */ ((EntityLivingBase)par1Entity).func_70690_d(new PotionEffect(MobEffects.field_76437_t, 100, 0));\n/* */ }\n/* */ \n/* 326 */ par1Entity.field_70160_al = false;\n/* 327 */ par1Entity.field_70159_w = mx;\n/* 328 */ par1Entity.field_70181_x = my;\n/* 329 */ par1Entity.field_70179_y = mz;\n/* */ \n/* 331 */ func_184185_a(SoundsTC.swarmattack, 0.3F, 0.9F + this.field_70170_p.field_73012_v.nextFloat() * 0.2F);\n/* */ } \n/* */ }", "public void attack(Entity entity, boolean aoe) {\n if(aoe) entity.damaged((int) (this.damage*0.6));\n else entity.damaged(this.damage);\n if(entity.isDead()){\n incExp(entity.getLevel()*9);\n if(entity instanceof Boss) {\n this.bossesDefeated++;\n }\n }\n }", "public void calibrated() {\n weaponDamage = weaponDamage + 10;\r\n }", "public abstract void performAction(Individual victim) {\n\tvictim.health -= this.performance;\n}", "public final void applyDamage(DamageDTO damage) {\n int rolledDamage = damage.getMaxDamage();\n if (rolledDamage > 0) {\n this.currentHitPoints -= rolledDamage;\n }\n if (this.currentHitPoints <= 0) {\n this.die();\n }\n }", "public void act() \n {\n EggFactory eggFactory = new EggFactory();\n \n move(4);\n int random = Greenfoot.getRandomNumber(5000);\n if((random>200 & random<300) || ((Farm)getWorld()).atWorldEdge(this))\n {\n turn(180);\n getImage().mirrorVertically();\n move(4);\n \n }\n\n if( Greenfoot.getRandomNumber(100) ==0)\n {\n\n Farm farm = (Farm)getWorld();\n Egg egg = null; \n int eggPicker = Greenfoot.getRandomNumber(80);\n //DropEggStrategy dropEgg = new DropEggStrategy(); //Strategy pattern\n\n IEggStrategy whiteStrategy = new WhiteEggStrategy(eggFactory);\n IEggStrategy blackStrategy = new BlackEggStrategy(eggFactory);\n IEggStrategy goldenStrategy = new GoldenEggStrategy(eggFactory);\n \n DropEggContext context = new DropEggContext();\n \n if(eggPicker >= 50 && eggPicker <= 60){\n \n context.setIEggStrategy(goldenStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else if(eggPicker >= 60 && eggPicker <= 70){\n\n context.setIEggStrategy(blackStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else{\n context.setIEggStrategy(whiteStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n \n egg.register(farm.getLifeObserver());//register life creator observer into egg subject \n\n \n\n }\n\n }", "public void takeDamage(int damage) {\n\t\tlife = (life-damage<0)?0:life-damage;\n\t}", "public void apply() {\r\n\tif (currentEffect != null)\r\n\t currentEffect.removeFrom(kingdom);\r\n\r\n\tif (isVacant())\r\n\t currentEffect = penalty;\r\n\telse\r\n\t currentEffect = bonus;\r\n\r\n\tcurrentEffect.applyTo(kingdom);\r\n }", "@Override\n void planted() {\n super.planted();\n TimerTask Task = new TimerTask() {\n @Override\n public void run() {\n\n for (Drawable drawables : gameState.getDrawables()) {\n if (drawables instanceof Zombie) {\n int distance = (int) Math.sqrt(Math.pow((drawables.x - x), 2) + Math.pow((drawables.y - y), 2));\n if (distance <= explosionradious) {\n ((Zombie) drawables).hurt(Integer.MAX_VALUE);\n }\n }\n }\n\n life = 0;\n }\n\n };\n\n Timer timer = new Timer();\n timer.schedule(Task, 2000);\n }", "protected void attack(){\n\t\tif(reloadTime-- <= 0){\n\t\t\treloadTime = 0;\n\t\t}\n\t\tif(!hostileInRange())\n\t\t\treturn;\n\t\tif(!rotate()){\n\t\t\tif(reloadTime <= 0){\n\t\t\t\tshotAt(this.target);\n\t\t\t}\n\t\t}\n\t}", "@Override\n public ICombatResponse combatLoop(int action) {\n CombatResponse cr = new CombatResponse(0, 0, running, opponent);\n switch (action) {\n case 0:\n cr.setPlayerAttack(lightAttack());\n break;\n case 1:\n cr.setPlayerAttack(heavyAttack());\n break;\n case 2:\n running = false;\n break;\n case 3:\n return (ICombatResponse) cr;\n\n }\n if (opponent.getHealth() < 1) { //If the opponents health is below 1 ( = dead), the opponent gets removed from the room / game.\n opponent.onDeath();\n player.addExp(((NPC) opponent).getExpDrop());\n currentRoom.removeCharacterFromRoom(opponent);\n running = false; //When our opponent has been removed, we set running to false to stop combat.\n }\n\n if (running) {\n cr.setOpponentAttack(opponentMove()); //The opponents move\n if (player.getHealth() < 1) {\n player.onDeath();\n }\n } else {\n DomainGame.getInstance().moveAllNPC(); //At the end of combat we call moveAllNPC, to make all our moveableNPC's move around\n player.addHunger(-8); //At the end of combat the player's hungervalue decreases\n }\n return (ICombatResponse) cr;\n }", "@Override\n public void visit(final Knight knight) {\n knight.getFirstAbility().changeAllVictimModifier(DAMAGE_MODIFIER_FOR_KNIGHT);\n knight.getSecondAbility().changeAllVictimModifier(DAMAGE_MODIFIER_FOR_KNIGHT);\n // anunt magicianul de ajutorul ingerului\n knight.getEvent().anEventHappened(knight, this, \"help\");\n // ofer Xp jucatorului pentru a trece la nivelul urmator\n knight.gainXp(getNewXp(knight));\n }", "public void suffer(int damage){\r\n\t\thp -= damage;\r\n\t\tinvulnerable = true;\r\n\t}", "@Override\n\tpublic void reduceCurrentHp(final double damage, final L2Character attacker)\n\t{\n\t\treduceCurrentHp(damage, attacker, true);\n\t}", "public abstract boolean attack(Warrior w);", "public void takeDamage(double damage){\n damage -= this.armor;\n this.health -= damage;\n }", "@Override\n\tpublic int calculateDamage() \n\t{\n\t\t// TODO Auto-generated method stub\n\t\treturn 0;\n\t}", "public void attack() {\n if (st instanceof RedAlienState.Attacking) {\n \tRedAlienState.Attacking att = (RedAlienState.Attacking)st;\n \ttry{\n \t\tDelta d = att.path.remove();\n \t\tthis.x += d.xd;\n \t\tthis.y += d.yd;\n \t\tif(Math.random() > .99){\n \t\t\tthis.fire();\n \t\t}\n \t}catch(NoSuchElementException e){\n \t\tthis.x = this.column;\n \t\tthis.y = this.row;\n \t\tst = new RedAlienState.Normal();\n \t\tthis.isAttacking = false;\n \t}\n }\n }", "public abstract void attack(Player p);" ]
[ "0.67076623", "0.66352063", "0.6561955", "0.63321954", "0.63310575", "0.63203114", "0.62993586", "0.6287019", "0.62765193", "0.614935", "0.61477584", "0.6080914", "0.6074547", "0.6058662", "0.60457003", "0.6042471", "0.60414237", "0.6028139", "0.60210776", "0.60148257", "0.6006586", "0.6002039", "0.59904575", "0.5980529", "0.5975299", "0.5968372", "0.5953521", "0.5953405", "0.5940176", "0.5932113", "0.5911313", "0.59093577", "0.5903056", "0.5894639", "0.5890844", "0.5885493", "0.5880669", "0.58792573", "0.5871469", "0.5863326", "0.5851534", "0.58485883", "0.5833895", "0.5832383", "0.5831002", "0.5830336", "0.5828881", "0.5813404", "0.5802785", "0.5799663", "0.5796618", "0.5793132", "0.57791954", "0.5772214", "0.577219", "0.57695884", "0.5768727", "0.57633096", "0.5760451", "0.5757197", "0.5742076", "0.5738567", "0.5736151", "0.5734552", "0.57314646", "0.5727324", "0.5720835", "0.57160044", "0.57131463", "0.57090497", "0.5706205", "0.57042783", "0.569676", "0.56803113", "0.5656691", "0.56492037", "0.5639158", "0.563742", "0.5631833", "0.56315225", "0.56236726", "0.5620299", "0.56163144", "0.5612462", "0.5609267", "0.56082207", "0.56080496", "0.5603782", "0.5601709", "0.5597034", "0.5595734", "0.55950934", "0.5594025", "0.5575836", "0.5570606", "0.55642897", "0.55616415", "0.55547214", "0.5547521", "0.5547518" ]
0.5603315
88
Creates an authorized Credential object.
public static Credential authorize() throws IOException { // Load client secrets. InputStream in = YouTubeDownloader.class.getResourceAsStream("/youtube/downloader/resources/clients_secrets.json"); GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader( in )); // Build flow and trigger user authorization request. GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder( HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES) .setDataStoreFactory(DATA_STORE_FACTORY) .setAccessType("offline") .build(); Credential credential = new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user"); System.out.println("Credentials saved to " + DATA_STORE_DIR.getAbsolutePath()); return credential; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "AbstractCredentialModel createBasicCredential(String username, String password);", "protected static Credentials getServiceCredentials() throws AnaplanAPIException {\n if (authType == AUTH_TYPE.CERT) {\n try {\n return new Credentials(getCertificate(), getPrivateKey());\n } catch (Exception e) {\n throw new AnaplanAPIException(\"Could not initialise service credentials\", e);\n }\n } else if (authType == AUTH_TYPE.OAUTH) {\n return new Credentials(clientId);\n }\n return new Credentials(getUsername(), getPassphrase());\n }", "CloudCredentialStatus create(@Nonnull AuthenticatedContext authenticatedContext);", "void createExposedOAuthCredential(IntegrationClientCredentialsDetailsModel integrationCCD);", "public Credential getUsercredentialwithAccessToken(String accessToken) {\n\t\treturn new GoogleCredential.Builder().setTransport(HTTP_TRANSPORT)\n\t\t\t\t.setJsonFactory(new JacksonFactory())\n\t\t\t\t.setClientSecrets(CLIENT_ID, CLIENT_SECRET).build()\n\t\t\t\t.setAccessToken(accessToken);\n\t}", "AbstractCredentialModel createOAuthCredential(EmployeeModel employee);", "GoogleAuthenticatorKey createCredentials(String userName);", "public Credentials()\n {\n this(null, null, null, null);\n }", "public static Credential authorize() throws IOException, GeneralSecurityException {\n // Load client secrets.\n InputStream in = GoogleIntegration.class.getResourceAsStream(\"/client_secret.json\");\n GoogleClientSecrets clientSecrets =\n GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n\n FileDataStoreFactory DATA_FACTORY = new FileDataStoreFactory(DATA_STORE_DIR);\n HttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();\n\n // Build flow and trigger user authorization request.\n GoogleAuthorizationCodeFlow flow =\n new GoogleAuthorizationCodeFlow.Builder(\n HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\n .setDataStoreFactory(DATA_FACTORY)\n .setAccessType(\"offline\")\n .build();\n Credential credential = new AuthorizationCodeInstalledApp(\n flow, new LocalServerReceiver()).authorize(\"user\");\n System.out.println(\n \"Credentials saved to \" + DATA_STORE_DIR.getAbsolutePath());\n return credential;\n }", "GoogleAuthenticatorKey createCredentials();", "public static Credential authorize() throws IOException {\n // Load client secrets.\n InputStream in =\n Quickstart2.class.getResourceAsStream(\"/client_secret.json\");\n GoogleClientSecrets clientSecrets =\n GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n\n // Build flow and trigger user authorization request.\n GoogleAuthorizationCodeFlow flow =\n new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\n .setDataStoreFactory(DATA_STORE_FACTORY)\n .setAccessType(\"offline\")\n .build();\n \n Credential credential = new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize(\"user\");\n \n System.out.println(\"Credentials saved to \" + DATA_STORE_DIR.getAbsolutePath());\n return credential;\n }", "public static Credential authorize() throws IOException {\n\t\t// Load client secrets.\n\t\tInputStream in = GmailDownloader.class.getResourceAsStream(\"/client_secret.json\");\n\t\tGoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n\n\t\t// Build flow and trigger user authorization request.\n\t\tGoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY,\n\t\t\t\tclientSecrets, SCOPES).setDataStoreFactory(DATA_STORE_FACTORY).setAccessType(\"offline\").build();\n\t\tCredential credential = new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize(\"user\");\n\t\tSystem.out.println(\"Credentials saved to \" + DATA_STORE_DIR.getAbsolutePath());\n\t\treturn credential;\n\t}", "public Builder credential(Credential newCredential) {\n credential = newCredential;\n return this;\n }", "public ClientSecretCredential() {\n this(new IdentityClientOptions());\n }", "private Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT) throws IOException {\n // Build flow and trigger user authorization request.\n GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(\n HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\n .setDataStoreFactory(new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH)))\n .setAccessType(\"offline\")\n .build();\n LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();\n return new AuthorizationCodeInstalledApp(flow, receiver).authorize(\"user\");\n }", "@Nonnull\n public Credential getSPCredential() throws IOException {\n\n final ClassPathResource spKeyResource = new ClassPathResource(SP_KEY);\n Assert.assertTrue(spKeyResource.exists());\n final PrivateKey spPrivateKey = KeyPairUtil.readPrivateKey(spKeyResource.getInputStream());\n\n final ClassPathResource spCrtResource = new ClassPathResource(SP_CRT);\n Assert.assertTrue(spCrtResource.exists());\n final X509Certificate spEntityCert = (X509Certificate) CertUtil.readCertificate(spCrtResource.getInputStream());\n\n return new BasicX509Credential(spEntityCert, spPrivateKey);\n }", "private Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT) throws IOException {\n // Load client secrets.\n InputStream in = EventoUtils.class.getResourceAsStream(CREDENTIALS_FILE_PATH);\n if (in == null) {\n throw new FileNotFoundException(\"Resource not found: \" + CREDENTIALS_FILE_PATH);\n }\n GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n\n // Build flow and trigger user authorization request.\n GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(\n HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\n .setDataStoreFactory(new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH)))\n .setAccessType(\"offline\")\n .build();\n LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();\n return new AuthorizationCodeInstalledApp(flow, receiver).authorize(\"user\");\n }", "private static Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT) throws IOException {\n // Load client secrets.\n InputStream in = GoogleAuthorizeUtil.class.getResourceAsStream(CREDENTIALS_FILE_PATH);\n\n if (in == null) {\n throw new FileNotFoundException(\"Resource not found: \" + CREDENTIALS_FILE_PATH);\n }\n GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n\n // Build flow and trigger user authorization request.\n GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(\n HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\n .setDataStoreFactory(new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH)))\n .setAccessType(\"offline\")\n .build();\n LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();\n return new AuthorizationCodeInstalledApp(flow, receiver).authorize(\"user\");\n }", "public static X500PrivateCredential createRootCredential() throws Exception {\n KeyPair rootPair = generateRSAKeyPair();\n X509Certificate rootCert = generateRootCert(rootPair);\n\n return new X500PrivateCredential(rootCert, rootPair.getPrivate(), ROOT_ALIAS);\n }", "public Credential getCredential() {\n return this.credential;\n }", "public static Credential fromProtoBytes(byte[] credentialProtoBytes) throws IOException {\n return new Credential.Builder(\n org.openyolo.proto.Credential.ADAPTER.decode(credentialProtoBytes))\n .build();\n }", "public Object getCredential()\n {\n return this.credential;\n }", "public Object getCredential()\n {\n return this.credential;\n }", "public Object getCredential()\n {\n return this.credential;\n }", "private static Credential getCredentials(HttpTransport HTTP_TRANSPORT) throws IOException {\r\n // Load client secrets.\r\n InputStream in = SheetsQuickstart.class.getResourceAsStream(CREDENTIALS_FILE_PATH);\r\n if (in == null) {\r\n throw new FileNotFoundException(\"Resource not found: \" + CREDENTIALS_FILE_PATH);\r\n }\r\n GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\r\n\r\n // Build flow and trigger user authorization request.\r\n GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(\r\n HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\r\n .setDataStoreFactory(new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH)))\r\n .setAccessType(\"offline\")\r\n .build();\r\n LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();\r\n return new AuthorizationCodeInstalledApp(flow, receiver).authorize(\"user\");\r\n }", "private static Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT)\n throws IOException {\n // Load client secrets.\n InputStream in = GoogleCalendar.class.getResourceAsStream(CREDENTIALS_FILE_PATH);\n GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY,\n new InputStreamReader(in));\n\n // Build flow and trigger user authorization request.\n GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT,\n JSON_FACTORY, clientSecrets, SCOPES)\n .setDataStoreFactory(\n new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH)))\n .setAccessType(\"offline\").build();\n LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();\n return new AuthorizationCodeInstalledApp(flow, receiver).authorize(\"user\");\n }", "private HttpRequestInitializer getCredentials(final NetHttpTransport HTTP_TRANSPORT, TCC tcc) throws IOException {\n\t\tlogger.debug(\"Obtendo credenciais...\");\n\t\tString credentialsPath = CREDENTIALS_FILE_PATH + tcc.getAluno().getCurso().getCodigoCurso() + \".json\";\n\t\tlogger.debug(\"Caminho do arquivo de credenciais: \" + credentialsPath);\n\t\tGoogleCredentials credentials = GoogleCredentials.fromStream(new FileInputStream(credentialsPath));\n\t\tcredentials = credentials.createScoped(SCOPES);\n\t\tcredentials.refreshIfExpired();\n\t\tHttpRequestInitializer requestInitializer = new HttpCredentialsAdapter(credentials);\n\t\treturn requestInitializer;\n\t}", "public Credential getUsercredential(final String authCode)\n\t\t\tthrows IOException, JSONException {\n\t\tfinal GoogleTokenResponse response = flow.newTokenRequest(authCode)\n\t\t\t\t.setRedirectUri(CALLBACK_URI).execute();\n\t\tfinal Credential credential = flow.createAndStoreCredential(response,\n\t\t\t\tnull);\n\t\treturn credential;\n\t}", "public static Credential authorize(final NetHttpTransport httpTransport) throws Exception {\n\t\t /*** Load client secrets. ***/\n//\t\tInputStream in = UploadYoutubeCaption.class.getResourceAsStream(CLIENT_SECRETS);\n\t\tInputStream in = new FileInputStream(\"/home/chanwit/Documents/UploadSubtitleYoutube/booming-bonito-309508-5408dbc89eef.json\");\n\t\t GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n\t\t \n\t\t /*** Build flow and trigger user authorization request. ***/\n\t\t GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(httpTransport, JSON_FACTORY, clientSecrets, SCOPES).build();\n\t\t Credential credential = new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize(\"user\");\n\t\t \n\t\t return credential;\n\t}", "public ClientCredentials() {\n }", "public Credentials(String user, String password) {\r\n\t\tthis.user = user;\r\n\t\tthis.password = password;\r\n\t}", "private static Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT) throws IOException {\n InputStream in = SheetsRead.class.getResourceAsStream(CREDENTIALS_FILE_PATH);\n if (in == null) {\n throw new FileNotFoundException(\"Resource not found: \" + CREDENTIALS_FILE_PATH);\n }\n GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(\n HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\n .setDataStoreFactory(new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH)))\n .setAccessType(\"offline\")\n .build();\n LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();\n return new AuthorizationCodeInstalledApp(flow, receiver).authorize(\"user\");\n }", "@Override\n public ExternalCredentialsResponse getCredentials(Principal principal, DomainDetails domainDetails, String idToken, ExternalCredentialsRequest externalCredentialsRequest)\n throws ResourceException {\n\n // first make sure that our required components are available and configured\n\n if (authorizer == null) {\n throw new ResourceException(ResourceException.FORBIDDEN, \"ZTS authorizer not configured\");\n }\n\n Map<String, String> attributes = externalCredentialsRequest.getAttributes();\n final String gcpServiceAccount = getRequestAttribute(attributes, GCP_SERVICE_ACCOUNT, null);\n if (StringUtil.isEmpty(gcpServiceAccount)) {\n throw new ResourceException(ResourceException.BAD_REQUEST, \"missing gcp service account\");\n }\n\n // verify that the given principal is authorized for all scopes requested\n\n final String gcpTokenScope = getRequestAttribute(attributes, GCP_TOKEN_SCOPE, GCP_DEFAULT_TOKEN_SCOPE);\n String[] gcpTokenScopeList = gcpTokenScope.split(\" \");\n for (String scopeItem : gcpTokenScopeList) {\n final String resource = domainDetails.getName() + \":\" + scopeItem;\n if (!authorizer.access(GCP_SCOPE_ACTION, resource, principal, null)) {\n throw new ResourceException(ResourceException.FORBIDDEN, \"Principal not authorized for configured scope\");\n }\n }\n\n try {\n // first we're going to get our exchange token\n\n GcpExchangeTokenResponse exchangeTokenResponse = getExchangeToken(domainDetails, idToken, externalCredentialsRequest);\n\n final String serviceUrl = String.format(\"https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/%s@%s.iam.gserviceaccount.com:generateAccessToken\",\n gcpServiceAccount, domainDetails.getGcpProjectId());\n final String authorizationHeader = exchangeTokenResponse.getTokenType() + \" \" + exchangeTokenResponse.getAccessToken();\n\n GcpAccessTokenRequest accessTokenRequest = new GcpAccessTokenRequest();\n accessTokenRequest.setScopeList(gcpTokenScope);\n int expiryTime = externalCredentialsRequest.getExpiryTime() == null ? 3600 : externalCredentialsRequest.getExpiryTime();\n accessTokenRequest.setLifetimeSeconds(expiryTime);\n\n HttpPost httpPost = new HttpPost(serviceUrl);\n httpPost.addHeader(HttpHeaders.AUTHORIZATION, authorizationHeader);\n httpPost.setEntity(new StringEntity(jsonMapper.writeValueAsString(accessTokenRequest), ContentType.APPLICATION_JSON));\n\n final HttpDriverResponse httpResponse = httpDriver.doPostHttpResponse(httpPost);\n if (httpResponse.getStatusCode() != HttpStatus.SC_OK) {\n GcpAccessTokenError error = jsonMapper.readValue(httpResponse.getMessage(), GcpAccessTokenError.class);\n throw new ResourceException(httpResponse.getStatusCode(), error.getErrorMessage());\n }\n\n GcpAccessTokenResponse gcpAccessTokenResponse = jsonMapper.readValue(httpResponse.getMessage(), GcpAccessTokenResponse.class);\n\n ExternalCredentialsResponse externalCredentialsResponse = new ExternalCredentialsResponse();\n attributes = new HashMap<>();\n attributes.put(GCP_ACCESS_TOKEN, gcpAccessTokenResponse.getAccessToken());\n externalCredentialsResponse.setAttributes(attributes);\n externalCredentialsResponse.setExpiration(Timestamp.fromString(gcpAccessTokenResponse.getExpireTime()));\n return externalCredentialsResponse;\n\n } catch (Exception ex) {\n throw new ResourceException(ResourceException.FORBIDDEN, ex.getMessage());\n }\n }", "private static GSSCredential getClientCredential(final Subject subject,\n final GSSManager MANAGER,\n final Oid kerboid) throws PrivilegedActionException {\n final PrivilegedExceptionAction<GSSCredential> action = new PrivilegedExceptionAction<GSSCredential>() {\n public GSSCredential run() throws GSSException {\n return MANAGER.createCredential(null // use the default principal\n , GSSCredential.DEFAULT_LIFETIME, kerboid, GSSCredential.INITIATE_ONLY);\n }\n };\n // TO support java 5, 6 we have to do this\n // The signature for Java 5 returns an object 6 returns GSSCredential, immediate casting throws \n // warning in Java 6.\n Object credential = Subject.doAs(subject, action);\n return (GSSCredential) credential;\n }", "public void getCredentials() throws IOException, GeneralSecurityException {\n\n KeyPairGenerator keyGenerator = KeyPairGenerator.getInstance(keyAlg);\n keyGenerator.initialize(keySize);\n keypair = keyGenerator.genKeyPair();\n Security.addProvider(new BouncyCastleProvider());\n \n PKCS10CertificationRequest pkcs10 = null;\n try{\n \tpkcs10 = generateCertificationRequest(DN, keypair);\n }\n catch(Exception ex){\n \tthrow new GeneralSecurityException(ex);\n }\n getCredentials(pkcs10.getEncoded());\n }", "@Test\n public void makeCredentialAndGetAssertionWithAllowCredential() throws VirgilException, WebAuthnException, CborException {\n AuthenticatorMakeCredentialOptions makeCredentialOptions = AuthenticatorMakeCredentialOptions.fromJSON(MAKE_CREDENTIAL_JSON);\n AttestationObject attObj = authenticator.makeCredential(makeCredentialOptions);\n byte[] cborEncoded = attObj.asCBOR();\n\n ByteArrayInputStream bais = new ByteArrayInputStream(cborEncoded);\n Map decoded = (Map) new CborDecoder(bais).decode().get(0);\n String fmt = ((UnicodeString) decoded.get(new UnicodeString(\"fmt\"))).getString();\n assertEquals(fmt, \"none\");\n\n byte[] credentialId = attObj.getCredentialId();\n\n // Now let's see if we can generate an assertion based on the returned credential ID\n AuthenticatorGetAssertionOptions getAssertionOptions = AuthenticatorGetAssertionOptions.fromJSON(GET_ASSERTION_JSON);\n //getAssertionOptions.allowCredentialDescriptorList.clear();\n getAssertionOptions.allowCredentialDescriptorList.add(new PublicKeyCredentialDescriptor(\"public-key\", credentialId, null));\n\n AuthenticatorGetAssertionResult getAssertionResult = authenticator.getAssertion(getAssertionOptions, new CredentialSelector() {\n @Override\n public PublicKeyCredentialSource selectFrom(List<PublicKeyCredentialSource> credentialList) {\n return credentialList.get(0);\n }\n });\n\n ByteBuffer resultBuf = ByteBuffer.allocate(getAssertionOptions.clientDataHash.length + getAssertionResult.authenticatorData.length);\n resultBuf.put(getAssertionResult.authenticatorData);\n resultBuf.put(getAssertionOptions.clientDataHash);\n byte[] signedData = resultBuf.array();\n List<PublicKeyCredentialSource> sources = this.credentialSafe.getKeysForEntity(makeCredentialOptions.rpEntity.id);\n PublicKeyCredentialSource source = sources.get(sources.size() - 1);\n KeyPair keyPair = this.credentialSafe.getKeyPairByAlias(source.keyPairAlias);\n assertTrue(this.cryptography.verifySignature(keyPair.getPublic(), signedData, getAssertionResult.signature));\n }", "@Test\n public void testExcludeCredentials() throws VirgilException, WebAuthnException {\n AuthenticatorMakeCredentialOptions makeCredentialOptions = AuthenticatorMakeCredentialOptions.fromJSON(MAKE_CREDENTIAL_JSON);\n AttestationObject firstAttestationObject = authenticator.makeCredential(makeCredentialOptions);\n\n // Now we want to pull out the ID of the just-created credential, add it to the exclude list,\n // and ensure that we see a failure when creating a second credential.\n\n makeCredentialOptions.excludeCredentialDescriptorList.add(new PublicKeyCredentialDescriptor(\"public-key\", firstAttestationObject.getCredentialId(), null));\n try {\n AttestationObject secondAttestationObject = authenticator.makeCredential(makeCredentialOptions);\n Assert.fail(\"makeCredential should have failed due to a matching credential ID in the exclude list\");\n } catch (InvalidStateError e) {\n // good! the matching credential descriptor caused the authenticator to reject the request\n }\n }", "public Object credentials() {\n return cred;\n }", "public Builder credentials(String credentials) {\n this.credentials = credentials;\n return this;\n }", "public ProfileTokenCredential() {\n super();\n new Random().nextBytes(addr_);\n new Random().nextBytes(mask_);\n }", "public Credentials getCredentials(AuthScope authscope)\n {\n return credentials;\n }", "public Builder(@NonNull org.openyolo.proto.Credential proto) {\n mProtoBuilder = new org.openyolo.proto.Credential.Builder();\n\n // required properties\n setIdentifier(proto.id);\n setAuthenticationDomain(new AuthenticationDomain(proto.authDomain));\n setAuthenticationMethod(proto.authMethod);\n\n // optional properties\n setDisplayName(proto.displayName);\n setDisplayPicture(proto.displayPictureUri);\n setPassword(proto.password);\n setAdditionalProperties(\n CollectionConverter.toMap(\n proto.additionalProps,\n KeyValuePairConverters.CONVERTER_KVP_TO_PAIR));\n }", "public final OAuthCredentialsResponse execute() throws IOException {\n HttpTransport transport = new HttpTransport();\n createParameters().signRequestsUsingAuthorizationHeader(transport);\n HttpRequest request =\n this.usePost ? transport.buildPostRequest() : transport\n .buildGetRequest();\n request.url = this;\n HttpResponse response = request.execute();\n response.disableContentLogging = true;\n OAuthCredentialsResponse oauthResponse = new OAuthCredentialsResponse();\n UrlEncodedParser.parse(response.parseAsString(), oauthResponse);\n return oauthResponse;\n }", "public static GoogleCredential createCredentialWithRefreshToken(\n\t\t\tHttpTransport transport, JacksonFactory jsonFactory,\n\t\t\tTokenResponse tokenResponse, String clientId, String clientSecret) {\n\t\treturn new GoogleCredential.Builder().setTransport(HTTP_TRANSPORT)\n\t\t\t\t.setJsonFactory(new JacksonFactory())\n\t\t\t\t.setClientSecrets(clientId, clientSecret).build()\n\t\t\t\t.setFromTokenResponse(tokenResponse);\n\t}", "public OAuthParameters createParameters() {\n OAuthParameters result = new OAuthParameters();\n result.consumerKey = this.consumerKey;\n result.signer = this.signer;\n return result;\n }", "public QCloudLifecycleCredentials onGetCredentialFromLocal(String secretId2, String secretKey2) throws QCloudClientException {\n long current = System.currentTimeMillis() / 1000;\n String keyTime = current + \";\" + (current + this.duration);\n return new BasicQCloudCredentials(secretId2, secretKey2SignKey(secretKey2, keyTime), keyTime);\n }", "public CredentialsDefinitionAdaptor(EntityDefinition def) {\n super(def);\n }", "public String createCredential(Credential credential, String baseUrl, String endpoint) {\n this.goHomeAndGoToTab(baseUrl, endpoint);\n\n // Click on Add new Credential\n this.waitForElementToBeClickableAndClick(this.btnCredentialAdd);\n\n this.fillInForm(credential);\n\n return getPageTitleAndGoHome(baseUrl, endpoint);\n }", "private Drive authentication() throws IOException {\n\t\t// Request a new access token using the refresh token.\n\t\tGoogleCredential credential = new GoogleCredential.Builder()\n\t\t\t\t.setTransport(HTTP_TRANSPORT)\n\t\t\t\t.setJsonFactory(JSON_FACTORY)\n\t\t\t\t.setClientSecrets(CLIENT_ID, CLIENT_SECRET).build()\n\t\t\t\t.setFromTokenResponse(new TokenResponse().setRefreshToken(REFRESH_TOKEN));\n\t\tcredential.refreshToken();\n\t\treturn new Drive.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)\n\t\t\t\t.setApplicationName(\"tp3\").build();\n\t}", "public BasicAuthenticationCredentials(String userName, String password) {\n this.userName = userName;\n this.password = password;\n }", "public IAuthorizationPrincipal newPrincipal(String key, Class type);", "public AuthCredentials(String scheme,String name,String password)\n {\n this.scheme = scheme;\n this.name = name;\n this.password = password;\n }", "public void setCredential(final Object credential)\n {\n checkImmutable();\n this.credential = credential;\n }", "private DefaultHttpClient createHttpClient()\n throws IOException\n {\n XCapCredentialsProvider credentialsProvider\n = new XCapCredentialsProvider();\n credentialsProvider.setCredentials(\n AuthScope.ANY,\n new UsernamePasswordCredentials(getUserName(), password));\n\n return HttpUtils.getHttpClient(\n null , null, uri.getHost(), credentialsProvider);\n }", "public FederatedIdentityCredentialInner() {\n }", "public AuthToken login(UserCreds credentials) throws ResourceNotFoundException, UnauthorizedException {\n User user = getByName(credentials);\n // Check if user is authorized\n if (!user.getUserCreds().equals(credentials)) throw new UnauthorizedException();\n // Generate auth token\n AuthToken token = new AuthToken(user);\n // Return the token\n return token;\n }", "private static Credential authorize(List<String> scopes) throws Exception {\r\n\r\n\t // Load client secrets.\r\n\t GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(\r\n\t JSON_FACTORY, UploadVideo.class.getResourceAsStream(\"/client_secrets.json\"));\r\n\r\n\t // Checks that the defaults have been replaced (Default = \"Enter X here\").\r\n\t if (clientSecrets.getDetails().getClientId().startsWith(\"Enter\")\r\n\t || clientSecrets.getDetails().getClientSecret().startsWith(\"Enter \")) {\r\n\t System.out.println(\r\n\t \"Enter Client ID and Secret from https://code.google.com/apis/console/?api=youtube\"\r\n\t + \"into youtube-cmdline-uploadvideo-sample/src/main/resources/client_secrets.json\");\r\n\t System.exit(1);\r\n\t }\r\n\r\n\t // Set up file credential store.\r\n\t FileCredentialStore credentialStore = new FileCredentialStore(\r\n\t new File(System.getProperty(\"user.home\"), \".credentials/youtube-api-uploadvideo.json\"),\r\n\t JSON_FACTORY);\r\n\r\n\t // Set up authorization code flow.\r\n\t GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(\r\n\t HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, scopes).setCredentialStore(credentialStore)\r\n\t .build();\r\n\r\n\t // Build the local server and bind it to port 9000\r\n\t LocalServerReceiver localReceiver = new LocalServerReceiver.Builder().setPort(8080).build();\r\n\r\n\t // Authorize.\r\n\t return new AuthorizationCodeInstalledApp(flow, localReceiver).authorize(\"user\");\r\n\t }", "@Override\r\n\tpublic Credential getCredential() {\n\t\treturn null;\r\n\t}", "public void credentials(Object cred) {\n this.cred = cred;\n }", "@Bean\n\t@RefreshScope\n\tCredentials refreshableCredentials() throws Exception {\n\t\tLOGGER.warn(\"***** ASKED FOR NEW CREDENTIALS\");\n\n\t\tList<String> scopes = Collections.singletonList(GcpScope.STORAGE_READ_WRITE.getUrl());\n\n\t\treturn GoogleCredentials.fromStream(\n\t\t\t\t// You'd be reading from Vault here, not from local file.\n\t\t\t\tnew FileInputStream(this.privateKeyLocation))\n\t\t\t\t.createScoped(scopes);\n\t}", "public Object credential(HttpServletRequest request)\n throws URISyntaxException, OAuthSystemException {\n try {\n OAuthClientCredentialRequest oauthRequest = new OAuthClientCredentialRequest(request);\n OAuthAuthzParameters oAuthAuthzParameters = new OAuthAuthzParameters(oauthRequest);\n\n if (!oauthRequest.getGrantType().equals(Constants.OAUTH_CLIENT_CREDENTIALS)) {\n OAuthResponse response = OAuthASResponseEx\n .errorResponse(HttpServletResponse.SC_OK)\n .setError(String.valueOf(OAuthConstants.OAuthResponse.INVALID_REQUEST))\n .setErrorDescription(OAuthConstants.OAuthDescription.INVALID_GRANT_TYPE)\n .buildJSONMessage();\n logger.info(\"invalid grant type: {}, context: {}\", oauthRequest.getGrantType(), oAuthAuthzParameters);\n return new ResponseEntity<String>(response.getBody(), HttpStatus.valueOf(response.getResponseStatus()));\n }\n\n Client client = oAuthService.getClientByClientId(oAuthAuthzParameters.getClientId());\n if (client == null) {\n OAuthResponse response = OAuthASResponseEx\n .errorResponse(HttpServletResponse.SC_OK)\n .setError(String.valueOf(OAuthConstants.OAuthResponse.INVALID_CLIENT))\n .setErrorDescription(OAuthConstants.OAuthDescription.INVALID_CLIENT_DESCRIPTION)\n .buildJSONMessage();\n logger.info(\"can not get client, context: {}\", oAuthAuthzParameters);\n return new ResponseEntity<String>(response.getBody(), HttpStatus.valueOf(response.getResponseStatus()));\n }\n\n if (!client.getGrantTypes().contains(Constants.OAUTH_CLIENT_CREDENTIALS)) {\n OAuthResponse response = OAuthASResponseEx\n .errorResponse(HttpServletResponse.SC_OK)\n .setError(String.valueOf(OAuthConstants.OAuthResponse.INVALID_CLIENT_INFO))\n .setErrorDescription(OAuthConstants.OAuthDescription.INVALID_GRANT_TYPE)\n .buildJSONMessage();\n logger.info(\"no grant type, context: {}\", oAuthAuthzParameters);\n return new ResponseEntity<String>(response.getBody(), HttpStatus.valueOf(response.getResponseStatus()));\n }\n\n if (!client.getClientSecret().equals(oAuthAuthzParameters.getClientSecret())) {\n OAuthResponse response = OAuthASResponseEx\n .errorResponse(HttpServletResponse.SC_OK)\n .setError(String.valueOf(OAuthConstants.OAuthResponse.INVALID_CLIENT_INFO))\n .setErrorDescription(OAuthConstants.OAuthDescription.INVALID_CLIENT_DESCRIPTION)\n .buildJSONMessage();\n logger.info(\"invalid secret: {}, context: {}\", client.getClientSecret(), oAuthAuthzParameters);\n return new ResponseEntity<String>(response.getBody(), HttpStatus.valueOf(response.getResponseStatus()));\n }\n\n if (StringUtils.isEmpty(oAuthAuthzParameters.getScope())) {\n oAuthAuthzParameters.setScope(client.getDefaultScope());\n } else {\n oAuthAuthzParameters.setScope(\n OAuthUtils.encodeScopes(\n oAuthService.getRetainScopes(\n client.getDefaultScope(),\n oAuthAuthzParameters.getScope()\n )\n )\n );\n }\n\n OAuthIssuer oauthIssuerImpl = new OAuthIssuerImpl(new UUIDValueGeneratorEx());\n String accessToken = oauthIssuerImpl.accessToken();\n\n oAuthService.saveAccessToken(accessToken, oAuthAuthzParameters);\n\n OAuthResponse response = OAuthASResponseEx\n .tokenResponse(HttpServletResponse.SC_OK)\n .setTokenType(\"uuid\")\n .setAccessToken(accessToken)\n .setExpiresIn(String.valueOf(appConfig.tokenAccessExpire))\n .setScope(oAuthAuthzParameters.getScope())\n .buildJSONMessage();\n logger.info(\"response access token {}, context: {}\", accessToken, oAuthAuthzParameters);\n return new ResponseEntity<String>(response.getBody(), HttpStatus.valueOf(response.getResponseStatus()));\n } catch (OAuthProblemException e) {\n logger.error(\"oauth problem exception\", e);\n final OAuthResponse response = OAuthASResponseEx\n .errorResponse(HttpServletResponse.SC_OK)\n .setError(String.valueOf(OAuthConstants.OAuthResponse.INVALID_REQUEST))\n .setErrorDescription(e.getMessage())\n .buildJSONMessage();\n HttpHeaders headers = new HttpHeaders();\n return new ResponseEntity<String>(response.getBody(), headers, HttpStatus.valueOf(response.getResponseStatus()));\n }\n }", "public DelegateCredentialsProvider build() {\n return new DelegateCredentialsProvider(this);\n }", "public static ServiceAuthentication createEntity(EntityManager em) {\n ServiceAuthentication serviceAuthentication = new ServiceAuthentication()\n .code(DEFAULT_CODE)\n .label(DEFAULT_LABEL)\n .active(DEFAULT_ACTIVE);\n return serviceAuthentication;\n }", "@Bean\n public BasicCredentialsProvider abTestCredentialProvider() {\n BasicCredentialsProvider provider = new BasicCredentialsProvider();\n provider.setCredentials(abTestAuthScope(), abTestCredentials());\n return provider;\n }", "public static interface Credentials extends Serializable {\n\t\tpublic String getUserName();\n\t\t/**\n\t\t* The password is encrypted.\n\t\t*/\n\t\tpublic String getPassword();\n\t}", "public static Security_I create()\r\n\t\t{\r\n\t\treturn new Security();\r\n\t\t}", "private SharedSecret(String domainName, Certificate creatorCert) {\n super(LENGTH);\n this.init();\n this.setDomainName(domainName);\n this.setCreator(creatorCert);\n }", "public Object encryptedCredential() {\n return this.encryptedCredential;\n }", "@Test\n public void fromJson() throws VirgilException, WebAuthnException {\n AuthenticatorMakeCredentialOptions options = AuthenticatorMakeCredentialOptions.fromJSON(MAKE_CREDENTIAL_JSON);\n AttestationObject attObj = authenticator.makeCredential(options);\n }", "public static AuthorAcess createEntity(EntityManager em) {\n AuthorAcess authorAcess = new AuthorAcess()\n .requestLogin(DEFAULT_REQUEST_LOGIN);\n return authorAcess;\n }", "public CredentialManagerException() {\n\t\tsuper();\n\t}", "public void createClientFromCredential() {\n WebPubSubServiceAsyncClient serverClient = new WebPubSubServiceClientBuilder()\n .connectionString(\"<connection-string>\")\n .hub(\"<hub>>\")\n .buildAsyncClient();\n\n // wrap WebPubSubServiceAsyncClient.getClientAccessToken as WebPubSubClientCredential\n WebPubSubClientCredential clientCredential = new WebPubSubClientCredential(Mono.defer(() ->\n serverClient.getClientAccessToken(new GetClientAccessTokenOptions()\n .setUserId(\"<user-name>\")\n .addRole(\"webpubsub.joinLeaveGroup\")\n .addRole(\"webpubsub.sendToGroup\"))\n .map(WebPubSubClientAccessToken::getUrl)));\n\n // create WebPubSub client\n WebPubSubClient client = new WebPubSubClientBuilder()\n .credential(clientCredential)\n .buildClient();\n // END: readme-sample-createClientFromCredential\n }", "public CalendarService() throws IOException, GeneralSecurityException {\n InputStream in = CalendarService.class.getResourceAsStream(CREDENTIALS_FILE_PATH);\n if (in == null) {\n throw new FileNotFoundException(\"Resource not found: \" + CREDENTIALS_FILE_PATH);\n }\n clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n \n NetHttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();\n service = new Calendar.Builder(HTTP_TRANSPORT, JSON_FACTORY, getCredentials(HTTP_TRANSPORT))\n .setApplicationName(APPLICATION_NAME)\n .build();\n }", "public static final Account createGuestAccount() {\n Name name = new Name(\"Guest\");\n Credential credential = new Credential(\"Guest\", \"Guest\");\n MatricNumber matricNumber = new MatricNumber(\"A0000000X\");\n PrivilegeLevel privilegeLevel = new PrivilegeLevel(0);\n Account guest = new Account(name, credential, matricNumber, privilegeLevel);\n return guest;\n }", "@Test\n public void testAllowCredentialsEmpty() throws VirgilException, WebAuthnException {\n AuthenticatorMakeCredentialOptions makeCredentialOptions = AuthenticatorMakeCredentialOptions.fromJSON(MAKE_CREDENTIAL_JSON);\n AttestationObject attObj = authenticator.makeCredential(makeCredentialOptions);\n\n AuthenticatorGetAssertionOptions getAssertionOptions = AuthenticatorGetAssertionOptions.fromJSON(GET_ASSERTION_JSON);\n getAssertionOptions.allowCredentialDescriptorList.clear();\n authenticator.getAssertion(getAssertionOptions, new CredentialSelector() {\n @Override\n public PublicKeyCredentialSource selectFrom(List<PublicKeyCredentialSource> credentialList) {\n return credentialList.get(0);\n }\n });\n }", "public static CredentialManager getInstance(Context context) {\n if (instance == null) {\n instance = new CredentialManager(context);\n }\n return instance;\n }", "java.lang.String getCred();", "String getToken(String scope, String username, String password) throws AuthorizationException;", "public interface CredentialConnector {\n\n /**\n * Check whether the credential (e.g public key) associated with a stack (cluster) has present on Cloud provider.\n *\n * @param authenticatedContext the authenticated context which holds the client object\n * @return the status respone of method call\n */\n CloudCredentialStatus verify(@Nonnull AuthenticatedContext authenticatedContext);\n\n\n /**\n * Create the credential (e.g public key) associated with a stack (cluster) on Cloud provider.\n *\n * @param authenticatedContext the authenticated context which holds the client object\n * @return the status respone of method call\n */\n CloudCredentialStatus create(@Nonnull AuthenticatedContext authenticatedContext);\n\n\n /**\n * Interactive login for credential creation.\n *\n * @return parameters for interactive login\n */\n Map<String, String> interactiveLogin(CloudContext cloudContext, ExtendedCloudCredential extendedCloudCredential,\n CredentialNotifier credentialNotifier);\n\n /**\n * Delete the credential (e.g public key) associated with a stack (cluster) from Cloud provider.\n *\n * @param authenticatedContext the authenticated context which holds the client object\n * @return the status respone of method call\n */\n CloudCredentialStatus delete(@Nonnull AuthenticatedContext authenticatedContext);\n\n}", "private GoogleCredential getGoogleCredential(String userId) {\t\t\n\t\t\n\t\ttry { \n\t\t\t// get the service account e-mail address and service account private key from property file\n\t\t\t// this email account and key file are specific for your environment\n\t\t\tif (SERVICE_ACCOUNT_EMAIL == null) {\n\t\t\t\tSERVICE_ACCOUNT_EMAIL = m_serverConfigurationService.getString(\"google.service.account.email\", \"\");\n\t\t\t}\n\t\t\tif (PRIVATE_KEY == null) {\n\t\t\t\tPRIVATE_KEY = m_serverConfigurationService.getString(\"google.private.key\", \"\");\n\t\t\t}\n\t\t\t\n\t\t\tGoogleCredential credential = getCredentialFromCredentialCache(userId);\n\t\t\treturn credential;\n\n\t\t} catch (Exception e) {\n\t\t\t// return null if an exception occurs while communicating with Google.\n\t\t\tM_log.error(\"Error creating a GoogleCredential object or requesting access token: \" + userId + \" \" + e.getMessage());\n\t\t\treturn null;\n\t\t}\n\t}", "private CredentialManager(Context context) {\n appDb = AppDB.getInstance(context);\n mContext = context;\n }", "com.google.protobuf.ByteString\n getCredBytes();", "public Account(final String localUsername, final String password,\n\t\t\tfinal UserId userId, final Set<DistributionRole> distributionRoles) {\n\t\tsuper();\n\t\tthis.localUsername = localUsername;\n\t\tthis.password = password;\n\t\tthis.userId = userId;\n\t\tthis.distributionRoles = distributionRoles;\n\t}", "public void setCredentialId(String CredentialId) {\n this.CredentialId = CredentialId;\n }", "public ServicePrincipalAuthenticator(String tenantId, String clientId, String clientSecret, ExecutorService executor) {\n super();\n this.executor = executor;\n this.tenantId = tenantId;\n this.authority = String.format(DEFAULT_AUTHORITY_FORMAT, this.tenantId);\n this.clientId = clientId;\n this.clientSecret = clientSecret;\n }", "public TarjetaDeCreditoEntity createTarjetaDeCredito(TarjetaDeCreditoEntity entity) throws BusinessLogicException \n {\n LOGGER.info(\"Inicia proceso de creación de TarjetaDeCredito\");\n \n // Verifica la regla de negocio que dice que una tarjeta debe tener un CDV de 3 digitos\n if(Long.toString(entity.getCDV()).length() != 3)\n {\n throw new BusinessLogicException(\"la tarjeta de credito tiene un CDV mayor o menor a 3 digitos \" + entity.getCDV() + \"\\\"\");\n }\n // Verifica la regla de negocio que dice que una tarjeta debe tener 16 digitos en su numero\n if(Long.toString(entity.getNumero()).length() != 16)\n {\n throw new BusinessLogicException(\"la tarjeta de credito tiene un numero mayor o menor a 16 digitos \" + entity.getNumero() + \"\\\"\");\n }\n persistence.create(entity);\n LOGGER.info(\"Termina proceso de creación de TarjetaDeCredito\");\n return entity;\n }", "public PropertiesCredentials(InputStream inputStream) throws IOException {\n\t\tProperties accountProperties = new Properties();\n\t\ttry {\n\t\t\taccountProperties.load(inputStream);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tinputStream.close();\n\t\t\t} catch (Exception e) {\n\t\t\t}\n\t\t}\n\n\t\tif (accountProperties.getProperty(\"consumerKey\") == null\n\t\t\t\t|| accountProperties.getProperty(\"consumerSecret\") == null\n\t\t\t\t|| accountProperties.getProperty(\"accessToken\") == null\n\t\t\t\t|| accountProperties.getProperty(\"accessTokenSecret\") == null) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"The specified file or stream doesn't contain the expected properties: 'consumerKey' \"\n\t\t\t\t\t\t\t+ \"'consumerSecret' 'accessToken' and 'accessTokenSecret'.\");\n\t\t}\n\n\t\ttwitterCredentials = new TwitterCredentials(\n\t\t\t\taccountProperties.getProperty(\"consumerKey\"),\n\t\t\t\taccountProperties.getProperty(\"consumerSecret\"),\n\t\t\t\taccountProperties.getProperty(\"accessToken\"),\n\t\t\t\taccountProperties.getProperty(\"accessTokenSecret\"));\n\t}", "public void addCredential(Credentials credential) {\n this.credentials.add(credential);\n }", "public static final synchronized SharedSecret createNewSharedSecret(String domainName, String creatorKeyAlias, String creatorKeyPassword) {\n Certificate cert = com.ibm.aglets.AgletRuntime.getCertificate(creatorKeyAlias);\n if (cert == null) {\n System.err.println(\"SharedSecret.createNewSharedSecret: Creator's certificate was not found\");\n return null;\n }\n char[] pwd = null;\n if (creatorKeyPassword != null) {\n pwd = creatorKeyPassword.toCharArray();\n }\n PrivateKey key = com.ibm.aglets.AgletRuntime.getPrivateKey(cert, pwd);\n if (key == null) {\n System.err.println(\"SharedSecret.createNewSharedSecert: Failed to get creator's private key\");\n return null;\n }\n SharedSecret aSharedSecret = new SharedSecret(domainName, cert);\n aSharedSecret.sign(key);\n return aSharedSecret;\n }", "public Account createAccount() {\n\t\t\n\t\tAccountBuilder builder = new AccountBuilder();\n\t\tUserRole role = new UserRole();\n\t\trole.setUsername(getUsername());\n\t\trole.setRole(\"ROLE_USER\");\n\t\t\n\t\t//builds the account entity using the front end POJO\n\t\tbuilder\n\t\t\t.withUsername(getUsername())\n\t\t\t.withPassword(getPassword())\n\t\t\t.withLastName(getLastName())\n\t\t\t.withFirstName(getFirstName())\n\t\t\t.withRole(role)\n\t\t\t.withStatus(AccountStatus.ACTIVE)\n\t\t\t.withEmail(getEmail())\n\t\t\t.withStoreCd(getStoreCd());\n\t\t\n return builder.build();\n\t}", "private GoogleCredential getCredentialFromCredentialCache(final String userId) throws IOException{\n\t\tGoogleCredential credential = (GoogleCredential)cache.get(userId);\n\t\tif (credential != null){\n\t\t\tM_log.debug(\"Fetching credential from cache for user: \" + userId);\n\t\t\treturn credential;\n\t\t}\n\t\telse{ // Need to create credential and create access token.\n\t\t\tcredential = SakaiGoogleAuthServiceImpl.authorize(userId, SERVICE_ACCOUNT_EMAIL, PRIVATE_KEY, CalendarScopes.CALENDAR);\n\t\t\tif (credential != null){\n\t\t\t\tcredential.refreshToken(); // Populates credential with access token\n\t\t\t\taddCredentialToCache(userId, credential);\n\t\t\t}\n\t\t\treturn credential;\n\t\t}\n\t}", "public PasswordCredential getPasswordCredential() {\n return passCred;\n }", "public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {\n return GoogleCredentialsProvider.newBuilder()\n .setScopesToApply(DEFAULT_SERVICE_SCOPES)\n .setUseJwtAccessWithScope(true);\n }", "public static CredentialsProvider basicAuthentication(String userName,String password) {\r\n\r\n\r\n\r\n\t\tCredentialsProvider provider = new BasicCredentialsProvider();\r\n\r\n\t\tUsernamePasswordCredentials credentials= new UsernamePasswordCredentials(userName,password);\r\n\r\n\t\tprovider.setCredentials(AuthScope.ANY, credentials);\r\n\r\n\r\n\r\n\t\treturn provider;\r\n\r\n\r\n\r\n\t}", "public static synchronized Credentials authenticate(String userName, String password){\n\t\t\tConnection connection;\n\t\t \tCredentials credentials=null;\n\t\t \t\n\t\t \tPreparedStatement statement=null;\n\t\t\tString preparedSQL = \"SELECT * FROM Credential WHERE Email = ? and Pass = ?\";\n\t\t\t\n\t\t try{\n\t\t \tconnection=DBConnector.getConnection();\n\t\t \tstatement = connection.prepareStatement(preparedSQL);\n\t\t \tstatement.setString(1, userName);\n\t\t \tstatement.setString(2, password);\n\t\t\t\tResultSet rs = statement.executeQuery();\n\t\t\t\tif(rs.next()){\n\t\t\t\t\tcredentials = new Credentials();\n\t\t\t\t\tcredentials.setCredID(rs.getInt(1));\n\t\t\t\t\tcredentials.setUserID(rs.getInt(2));\n\t\t\t\t\tcredentials.setEmail(rs.getString(3));\n\t\t\t\t\tcredentials.setPass(rs.getString(4));\n\t\t\t\t\tcredentials.setRole(rs.getString(5));\n\t\t\t\t\tcredentials.setValid(rs.getInt(6));\n\t\t\t\t\tcredentials.setRegKey(rs.getString(7));\n\t\t\t\t}\t\n\t\t\t\trs.close();\t\t\n\t\t\t\tstatement.close();\n\t\t\t\tconnection.close();\n\t\t\t\t\n\t\t\t}catch (SQLException ex){\n\t\t\t\t\tSystem.out.println(\"Error: \" + ex);\n\t\t\t\t\tSystem.out.println(\"Query: \" + statement.toString());\n\t\t\t\t\tcredentials = null;\n\t\t\t\t}\t\n\t\t\treturn credentials;\n\t}", "boolean isValidCredential(String username, String password);", "public static ECKey createFromPassphrase(String secret) {\n byte[] hash = null;\n\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-256\");\n md.update(secret.getBytes(\"UTF-8\"));\n hash = md.digest();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n ECKey key = new ECKey(new SecureRandom(hash));\n return key;\n }", "List<ExposedOAuthCredentialModel> readExposedOAuthCredentials();", "public CredentialBag()\n {\n credentialBag = new Vector();\n }", "protected SecurityContext doCreateSecurityContext(final Principal p, final Subject subject) {\n return new DefaultSecurityContext(p, subject);\n }" ]
[ "0.66188663", "0.6506624", "0.638938", "0.62834114", "0.6251041", "0.62424284", "0.61427015", "0.6054992", "0.6031464", "0.6030351", "0.60015774", "0.59658563", "0.5901143", "0.5878223", "0.586457", "0.5840592", "0.5813233", "0.5796609", "0.5740635", "0.57173693", "0.5711749", "0.56874496", "0.56874496", "0.56874496", "0.56813055", "0.5662083", "0.5642833", "0.5604419", "0.5539813", "0.553344", "0.55122554", "0.5477456", "0.5455179", "0.5408792", "0.534468", "0.53251565", "0.5307157", "0.52993804", "0.5298138", "0.52545774", "0.5249628", "0.5248393", "0.5242873", "0.52188087", "0.5193854", "0.51663756", "0.51358336", "0.5122264", "0.51098293", "0.50632805", "0.5062043", "0.50430226", "0.5032183", "0.49972528", "0.49749267", "0.4967856", "0.495184", "0.494431", "0.4943011", "0.49288782", "0.49197957", "0.49010345", "0.48703602", "0.48571366", "0.48359352", "0.48353216", "0.48311737", "0.48103657", "0.48038217", "0.48003253", "0.47963783", "0.47907132", "0.47802618", "0.47759375", "0.4764607", "0.4764409", "0.4757377", "0.47443834", "0.47402677", "0.47381184", "0.47366184", "0.47292972", "0.47206497", "0.47200817", "0.47099298", "0.47097453", "0.4704156", "0.46962687", "0.46799573", "0.4679884", "0.46773377", "0.46639207", "0.46243548", "0.4623172", "0.4621273", "0.4587973", "0.456105", "0.45604157", "0.45580265", "0.45547748" ]
0.58576566
15
Build and return an authorized API client service, such as a YouTube Data API client service.
public static YouTube getYouTubeService() throws IOException { Credential credential = authorize(); return new YouTube.Builder( HTTP_TRANSPORT, JSON_FACTORY, credential) .setApplicationName(APPLICATION_NAME) .build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private YouTube getService() throws GeneralSecurityException, IOException {\n final NetHttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();\n return new YouTube.Builder(httpTransport, JSON_FACTORY, null)\n .setApplicationName(APPLICATION_NAME)\n .build();\n }", "public void createClientFromCredential() {\n WebPubSubServiceAsyncClient serverClient = new WebPubSubServiceClientBuilder()\n .connectionString(\"<connection-string>\")\n .hub(\"<hub>>\")\n .buildAsyncClient();\n\n // wrap WebPubSubServiceAsyncClient.getClientAccessToken as WebPubSubClientCredential\n WebPubSubClientCredential clientCredential = new WebPubSubClientCredential(Mono.defer(() ->\n serverClient.getClientAccessToken(new GetClientAccessTokenOptions()\n .setUserId(\"<user-name>\")\n .addRole(\"webpubsub.joinLeaveGroup\")\n .addRole(\"webpubsub.sendToGroup\"))\n .map(WebPubSubClientAccessToken::getUrl)));\n\n // create WebPubSub client\n WebPubSubClient client = new WebPubSubClientBuilder()\n .credential(clientCredential)\n .buildClient();\n // END: readme-sample-createClientFromCredential\n }", "@Bean\n\tpublic ApiClient apiClient() {\n\t\tApiClient apiClient = new ApiClient(grantType, clientId, clientSecret, accessTokenUri, code);\n\n\t\treturn apiClient;\n\t}", "public static BaseApiService getAPIService(){\n return RetrofitClient.getClient(BASE_URL_HOSTING).create(BaseApiService.class);\n }", "public static BaseApiService getAPIService(){\n return RetrofitClient.getClient(BASE_URL_API).create(BaseApiService.class);\n }", "GoogleAuthenticatorKey createCredentials();", "private static Calendar getService() throws GeneralSecurityException, IOException {\n final NetHttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();\n return new Calendar.Builder(HTTP_TRANSPORT, JSON_FACTORY, getCredentials(HTTP_TRANSPORT))\n .setApplicationName(APPLICATION_NAME).build();\n }", "private OkHttpClient Create() {\n final OkHttpClient.Builder baseClient = new OkHttpClient().newBuilder()\n .connectTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS)\n .writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS)\n .readTimeout(READ_TIMEOUT, TimeUnit.SECONDS);\n\n // If there's no proxy just create a normal client\n if (appProps.getProxyHost().isEmpty()) {\n return baseClient.build();\n }\n\n final OkHttpClient.Builder proxyClient = baseClient\n .proxy(new java.net.Proxy(java.net.Proxy.Type.HTTP, new InetSocketAddress(appProps.getProxyHost(), Integer.parseInt(appProps.getProxyPort()))));\n\n if (!appProps.getProxyUsername().isEmpty() && !appProps.getProxyPassword().isEmpty()) {\n\n Authenticator proxyAuthenticator;\n String credentials;\n\n credentials = Credentials.basic(appProps.getProxyUsername(), appProps.getProxyPassword());\n\n // authenticate the proxy\n proxyAuthenticator = (route, response) -> response.request().newBuilder()\n .header(\"Proxy-Authorization\", credentials)\n .build();\n proxyClient.proxyAuthenticator(proxyAuthenticator);\n }\n return proxyClient.build();\n\n }", "public static ApiClient getApiClient(String apiToken) {\n return new ApiClient(DEFAULTS.API_URL.value, getHeadersWithAuth(DEFAULTS.SERVER_AUTH_HEADER, apiToken));\n }", "private static void createInstance() {\n if (mApiInterface == null) {\n synchronized(APIClient.class) {\n if (mApiInterface == null) {\n mApiInterface = buildApiClient();\n }\n }\n }\n }", "private static com.google.api.services.calendar.Calendar getCalendarService() throws IOException\n{\n Credential cred = authorize();\n com.google.api.services.calendar.Calendar.Builder bldr =\n new com.google.api.services.calendar.Calendar.Builder(HTTP_TRANSPORT,JSON_FACTORY,cred);\n bldr.setApplicationName(APPLICATION_NAME);\n\n com.google.api.services.calendar.Calendar cal = bldr.build();\n\n return cal;\n}", "public YelpFusionApi initClient() {\n try {\n YelpFusionApiFactory yelpBuild = new YelpFusionApiFactory();\n YelpFusionApi yelpClient = yelpBuild.createAPI(CONFIG.yelpClientID, CONFIG.yelpSecret);\n return yelpClient;\n }\n catch(IOException e) {\n Log.v(\"yelpClient\", e.getStackTrace().toString());\n return null;\n }\n }", "protected synchronized void createGoogleAPIClient() {\n googleApiClient = new GoogleApiClient.Builder(this)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .addApi(LocationServices.API)\n .build();\n }", "public Client create() {\n RequestProvider provider = RequestProviders.lookup();\n return provider.newClient(this);\n }", "private static VbxService getApiInstance() {\n HttpLoggingInterceptor logger = new HttpLoggingInterceptor();\n logger.setLevel(HttpLoggingInterceptor.Level.BODY);\n\n Interceptor setAcceptType = new Interceptor() {\n @Override\n public Response intercept(Chain chain) throws IOException {\n Request request = chain.request();\n Request typedRequest = request\n .newBuilder()\n .header(\"Accept\", \"application/json\")\n .build();\n return chain.proceed(typedRequest);\n }\n };\n\n Interceptor setAuthorization = new Interceptor() {\n @Override\n public Response intercept(Chain chain) throws IOException {\n Request request = chain.request();\n if(email != null && password != null) {\n String auth = Base64.encodeToString((email + \":\" + password).getBytes(), Base64.NO_WRAP);\n Request typedRequest = request\n .newBuilder()\n .header(\"Authorization\", String.format(\"Basic %s\", auth))\n .build();\n return chain.proceed(typedRequest);\n }\n return chain.proceed(request);\n }\n };\n\n OkHttpClient apiClient = new OkHttpClient.Builder()\n .addInterceptor(logger)\n .addInterceptor(setAcceptType)\n .addInterceptor(setAuthorization)\n .build();\n\n return new Retrofit.Builder()\n .baseUrl(endpoint)\n .client(apiClient)\n .addCallAdapterFactory(RxJavaCallAdapterFactory.create())\n .addConverterFactory(GsonConverterFactory.create())\n .build()\n .create(VbxService.class);\n }", "public GoogleAuthHelper() {\n\t\t\n\t\tLoadType<ClientCredentials> credentials = ofy().load().type(ClientCredentials.class);\n\t\t\n\t\tfor(ClientCredentials credential : credentials) {\n\t\t\t// static ClientCredentials credentials = new ClientCredentials();\n\t\t\tCALLBACK_URI = credential.getCallBackUri();\n\t\t\tCLIENT_ID = credential.getclientId();\n\t\t\tCLIENT_SECRET = credential.getClientSecret();\n\t\t}\n\t\t\n\t\tflow = new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT,\n\t\t\t\tJSON_FACTORY, CLIENT_ID, CLIENT_SECRET, SCOPE).setAccessType(\n\t\t\t\t\"offline\").build();\n\t\tgenerateStateToken();\n\t}", "public APIClient() {\n Gson gson = new GsonBuilder()\n .setLenient()\n .create();\n\n // Build base url\n retrofit = new Retrofit.Builder()\n .baseUrl(BASE_URL)\n .addConverterFactory(GsonConverterFactory.create(gson))\n .addCallAdapterFactory(RxJava3CallAdapterFactory.create())\n .build();\n }", "public static Retrofit serviceNowApi() {\n return new Retrofit.Builder()\n .baseUrl(BuildConfig.BASE_URL)\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n }", "public static BaseApiService getApiService() {\n return RetrofitClient.getClient(BASE_URL_API).create(BaseApiService.class);\n }", "private void buildApiClient() {\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .addApi(Awareness.API)\n .addConnectionCallbacks(this)\n .build();\n mGoogleApiClient.connect();\n }", "private DocsService getDocsService() throws DocumentServiceException {\n\tAuthenticationToken token = this.store.getUserToken();\n\tif (token == null) {\n\t throw new DocumentServiceException(\"Service requires authentication.\");\n\t}\n\tPrivateKey key = AuthenticationKey.getAuthSubKey();\n DocsService svc = new DocsService(GDATA_CLIENT_APPLICATION_NAME);\n svc.setConnectTimeout(0);\n svc.setReadTimeout(0);\n svc.setAuthSubToken(token.getToken(), key);\n svc.setProtocolVersion(DocsService.Versions.V3);\n return svc;\n }", "public ApiClient getApiClient() {\n return apiClient;\n }", "public ApiClient getApiClient() {\n return apiClient;\n }", "public void buildApiClient(){\n if(c==null){\n c = new GoogleApiClient.Builder(this)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .addApi(LocationServices.API)\n .build();\n }\n }", "BuildClient createBuildClient();", "public static ApiService getApiService()\n {\n return getRetrofit().create(ApiService.class);\n }", "public static YouTube getService() throws Exception {\n final NetHttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();\n Credential credential = authorize(httpTransport);\n return new YouTube.Builder(httpTransport, JSON_FACTORY, credential)\n .setApplicationName(APPLICATION_NAME)\n .build();\n }", "private static GoogleApiClient getClient(@NonNull Context context) {\n final String serverClientId = context.getString(R.string.server_client_id);\n final GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(serverClientId)\n .requestEmail()\n .build();\n\n // Build a GoogleApiClient with access to the Google Sign-In API\n return new GoogleApiClient.Builder(context)\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n }", "public GoogleAPI() {\n try {\n ytService = getService();\n } catch (GeneralSecurityException | IOException e) {\n e.printStackTrace();\n }\n DEVELOPER_KEY = DEVELOPER_KEY_Junwei;\n }", "protected synchronized void buildGoogleApiClient() {\n\t\tmGoogleApiClient = new GoogleApiClient.Builder(context)\n\t\t\t\t.addConnectionCallbacks(this)\n\t\t\t\t.addOnConnectionFailedListener(this)\n\t\t\t\t.addApi(LocationServices.API).build();\n\t}", "private static HttpClient createClient() {\n return HttpClients.createMinimal();\n }", "private Drive getDriveService(HttpServletRequest req,\n\t\t\tHttpServletResponse resp) throws IOException {\n\n\t\tCredential credentials = getCredential(req, resp);\n\t\treturn new Builder(TRANSPORT, JSON_FACTORY, credentials).build();\n\t}", "@Provides\n @Singleton\n Client provideHttpClient(Environment environment, PermissionsAppConfig config) {\n HttpClientConfiguration httpClientConfiguration = new HttpClientConfiguration();\n httpClientConfiguration.setTimeout(Duration.milliseconds(7000));\n\n HttpClientBuilder clientBuilder = new HttpClientBuilder(environment);\n clientBuilder.using(httpClientConfiguration);\n\n JerseyClientBuilder builder = new JerseyClientBuilder(environment);\n builder.setApacheHttpClientBuilder(clientBuilder);\n\n Client client = builder.build(\"jerseyClient\");\n client.register(ClientCorrelationIdFilter.class, 1);\n client.register(JerseyLoggingFilter.class, 2);\n return client;\n }", "private void buildGoogleApiClient() {\n // Iitialize Google API client.\n if (googleApiClient == null) {\n googleApiClient = new GoogleApiClient.Builder(this)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .addApi(Wearable.API) // Request access only to the wearable API.\n .build();\n }\n }", "private void buildGoogleApiClient() {\n if (googleApiClient == null) {\n googleApiClient = new GoogleApiClient.Builder(this)\n .addApi(Drive.API)\n .addScope(Drive.SCOPE_FILE)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .build();\n }\n }", "GoogleAuthenticatorKey createCredentials(String userName);", "public SpotifyService getSpotifyService(){\n //Creates and configures a REST adapter for Spotify Web API.\n SpotifyApi wrapper = new SpotifyApi();\n if(!getAccessToken().equals(\"\") && getAccessToken()!=null) {\n wrapper.setAccessToken(getAccessToken());\n }else{\n Log.d(\"SpotifyNewRelease\",\"Invalid Access Token\");\n }\n SpotifyService spotifyService = wrapper.getService();\n return spotifyService;\n }", "public static AuthenticatedClient getAuthenticatedClient() {\n\t\treturn getAuthenticatedClient(false);\n\t}", "protected synchronized void buildGoogleApiClient() {\n //Confirms no instance of GoogleApiClient has been instantiated\n if (mGoogleApiClient == null) {\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .addApi(LocationServices.API)\n .build();\n }\n }", "public interface ApiClient {\n\n /**\n * Retrieves the channels owned by the current API user.\n * \n * @param pageCriteria Optional {@link PageCriteria page criteria}.\n * @return A {@link ChannelsResource} containing a collection of channels owned by the current user.\n * @throws ApiClientException If an error occurs on making the API call.\n */\n ChannelsResource getMyChannels(PageCriteria pageCriteria) throws ApiClientException;\n\n /**\n * Retrieves the channels owned by an identified BrightTALK user.\n * <p>\n * The API credentials used must be authorised to access the identified user's channels.\n * \n * @param userId The ID of the BrightTALK user.\n * @param pageCriteria Optional {@link PageCriteria page criteria}.\n * @return A {@link ChannelsResource} containing a collection of channels owned by the identified user.\n * @throws ApiClientException If an error occurs on making the API call.\n */\n ChannelsResource getUserChannels(int userId, PageCriteria pageCriteria) throws ApiClientException;\n\n /**\n * Retrieves the list of current and/or past subscribers to a channel owned by an API user.\n * \n * @param channelId The ID of the channel.\n * @param subscribed Optionally filters the results according to the subscriber’s current subscription status.\n * {@code true} to to include only those that are subscribed. {@code false} to include only those that are\n * unsubscribed. If not supplied all subscribers are returned, irrespective of their current subscription status.\n * @param subscribedSince Optionally filters the results to include only those subscribers who subscribed after\n * (exclusive) the specified UTC date / time. Supports incremental reporting of new and updated susbcribers. (May,\n * depending on the ‘subscribed’ param, include Subscribers who have since unsubscribed).\n * @param unsubscribedSince Optionally filters the results to include only those subscribers who <em>un</em>subscribed\n * after (exclusive) the specified UTC date / time. Implies setting the {@code subscribed} param to “false”.\n * @param pageCriteria Optional {@link PageCriteria page criteria}.\n * @return A {@link ChannelSubscribersResource} containing a collection of zero or more subscribers to the channel.\n * @throws ApiClientException If an error occurs on making the API call.\n */\n ChannelSubscribersResource getChannelSubscribers(int channelId, Boolean subscribed, Date subscribedSince,\n Date unsubscribedSince, PageCriteria pageCriteria) throws ApiClientException;\n\n /**\n * Retrieves a summary (aggregation) of per subscriber activity for webcasts in one of the channel owner's channels.\n * \n * @param channelId The ID of the channel.\n * @param since Optionally filters the results to include only those Subscriber Webcast Activity (created or) updated\n * after (exclusive) the specified UTC date / time.\n * @param expandChannelSurveyResponse Optionally expands every child Subscriber Webcast Activity to include the\n * subscriber’s response to the channel’s survey, if there is one. Defaults to {@code false}.\n * @param pageCriteria Optional {@link PageCriteria page criteria}.\n * @return A {@link SubscribersWebcastActivityResource} containing a collection of zero or more activities.\n * @throws ApiClientException If an error occurs on making the API call.\n */\n SubscribersWebcastActivityResource getSubscribersWebcastActivityForChannel(int channelId, Date since,\n Boolean expandChannelSurveyResponse, PageCriteria pageCriteria) throws ApiClientException;\n\n /**\n * Retrieves a summary (aggregation) of per subscriber activity for a specific webcast in one of the channel owner's\n * channels.\n * \n * @param channelId The ID of the channel.\n * @param webcastId The ID of the webcast.\n * @param since Optionally filters the results to include only those Subscriber Webcast Activity (created or) updated\n * after (exclusive) the specified UTC date / time.\n * @param expandChannelSurveyResponse Optionally expands every child Subscriber Webcast Activity to include the\n * subscriber’s response to the channel’s survey, if there is one. Defaults to {@code false}.\n * @param pageCriteria Optional {@link PageCriteria page criteria}.\n * @return A {@link SubscribersWebcastActivityResource} containing a collection of zero or more activities.\n * @throws ApiClientException If an error occurs on making the API call.\n */\n SubscribersWebcastActivityResource getSubscribersWebcastActivityForWebcast(int channelId, int webcastId, Date since,\n Boolean expandChannelSurveyResponse, PageCriteria pageCriteria) throws ApiClientException;\n\n /**\n * Retrieves the survey (definitions) for a channel owned by the current user.\n * <p>\n * Supports a Channel owner obtaining a link for subsequently retrieving the responses to a channel survey.\n * \n * @param channelId The ID of the channel.\n * @return A {@link SurveysResource} containing a collection of zero or more {@link SurveyResource surveys}.\n * @throws ApiClientException If an error occurs on making the API call.\n */\n SurveysResource getSurveysForChannel(int channelId) throws ApiClientException;\n\n /**\n * Retrieves an identified survey (definition) owned by the current user.\n * \n * @param surveyId The ID of the survey.\n * @return The {@link SurveyResource}.\n * @throws ApiClientException If an error occurs on making the API call.\n */\n SurveyResource getSurvey(int surveyId) throws ApiClientException;\n\n /**\n * Retrieves all of the responses to an identified survey owned by the current user.\n * \n * @param surveyId The ID of the survey.\n * @param since Optionally filters the results to include only those survey responses (created or) updated after\n * (exclusive) the specified UTC date / time.\n * @param pageCriteria Optional {@link PageCriteria page criteria}.\n * @return A {@link SurveyResponsesResource} containing a collection of zero or more\n * {@link com.neiljbrown.brighttalk.channels.reportingapi.client.resource.SurveyResponseResource survey response}.\n * @throws ApiClientException If an error occurs on making the API call.\n */\n SurveyResponsesResource getSurveyResponses(int surveyId, Date since, PageCriteria pageCriteria)\n throws ApiClientException;\n\n/**\n * Retrieves the webcasts in an identified channel owned by the current user.\n * \n * @param channelId The ID of the channel.\n * @param since Optionally filters the results to include only those webcasts (created or) updated after (exclusive) \n * the specified UTC date / time.\n * @param pageCriteria Optional {@link PageCriteria page criteria}.\n * @return A {@link WebcastsResource} containing a collection of zero or more {@link \n * com.neiljbrown.brighttalk.channels.reportingapi.client.resource.WebcastResource webcasts}.\n * @throws ApiClientException If an error occurs on making the API call.\n */\n WebcastsResource getWebcastsForChannel(int channelId, Date since, PageCriteria pageCriteria)\n throws ApiClientException;\n\n /**\n * Retrieves the full details of an identified webcast, in a channel owned by the current user.\n * \n * @param channelId The ID of the channel.\n * @param webcastId The ID of the webcast.\n * @return The {@link WebcastResource webcast}.\n * @throws ApiClientException If an error occurs on making the API call.\n */\n WebcastResource getWebcast(int channelId, int webcastId) throws ApiClientException;\n\n /**\n * Retrieves all of the registrations for an identified webcast in a channel owned by the current user.\n * \n * @param channelId The ID of the channel.\n * @param webcastId The ID of the webcast.\n * @param since Optionally filters the results to include only those registrations (created or) updated after\n * (exclusive) the specified UTC date / time.\n * @param viewed Optionally filters the results according to whether the registrant has subsequently viewed the \n * webcast in any status (live or recorded). Supports identification of “no shows” - subscribers that registered but \n * have not yet viewed.\n * @param pageCriteria Optional {@link PageCriteria page criteria}. \n * @return A {@link WebcastRegistrationsResource} containing a collection of zero or more {@link \n * com.neiljbrown.brighttalk.channels.reportingapi.client.resource.WebcastRegistrationResource webcast registration}.\n * @throws ApiClientException If an error occurs on making the API call.\n */\n WebcastRegistrationsResource getWebcastRegistrationsForWebcast(int channelId, int webcastId, Date since,\n Boolean viewed, PageCriteria pageCriteria) throws ApiClientException;\n\n /**\n * Retrieves the viewings that have taken place for all webcasts in a channel owned by the current user.\n * \n * @param channelId The ID of the channel.\n * @param since Optionally filters the results to include only those viewings (created or) updated after\n * (exclusive) the specified UTC date / time.\n * @param webcastStatus Optionally filters the results according to the status of the webcast at the time the viewing \n * took place. Must be one of supported status {@link WebcastStatus#LIVE} or {@link WebcastStatus#RECORDED}.\n * @param pageCriteria Optional {@link PageCriteria page criteria}. \n * @return A {@link WebcastViewingsResource} containing a collection of zero or more {@link \n * com.neiljbrown.brighttalk.channels.reportingapi.client.resource.WebcastViewingResource webcast viewing}.\n * @throws IllegalArgumentException If {@code webcastStatus} is not one of the status supported by this API.\n * @throws ApiClientException If an error occurs on making the API call.\n */\n WebcastViewingsResource getWebcastViewingsForChannel(int channelId, Date since, WebcastStatus webcastStatus,\n PageCriteria pageCriteria) throws ApiClientException;\n\n /**\n * Retrieves the viewings that have taken place for an identified webcast in a channel owned by the current user.\n * \n * @param channelId The ID of the channel.\n * @param webcastId The ID of the webcast. \n * @param since Optionally filters the results to include only those vieiwngs (created or) updated after\n * (exclusive) the specified UTC date / time.\n * @param webcastStatus Optionally filters the results according to the status of the webcast at the time the viewing \n * took place. Must be one of supported status {@link WebcastStatus#LIVE} or {@link WebcastStatus#RECORDED}.\n * @param pageCriteria Optional {@link PageCriteria page criteria}. \n * @return A {@link WebcastViewingsResource} containing a collection of zero or more {@link \n * com.neiljbrown.brighttalk.channels.reportingapi.client.resource.WebcastViewingResource webcast viewing}.\n * @throws IllegalArgumentException If {@code webcastStatus} is not one of the status supported by this API.\n * @throws ApiClientException If an error occurs on making the API call.\n */\n WebcastViewingsResource getWebcastViewingsForWebcast(int channelId, int webcastId, Date since,\n WebcastStatus webcastStatus, PageCriteria pageCriteria) throws ApiClientException;\n}", "public CountriesApiService getApiService() {\n if (apiService == null) {\n synchronized (RestClient.class) {\n if (apiService == null)\n new RestClient();\n }\n }\n return apiService;\n }", "protected static Credentials getServiceCredentials() throws AnaplanAPIException {\n if (authType == AUTH_TYPE.CERT) {\n try {\n return new Credentials(getCertificate(), getPrivateKey());\n } catch (Exception e) {\n throw new AnaplanAPIException(\"Could not initialise service credentials\", e);\n }\n } else if (authType == AUTH_TYPE.OAUTH) {\n return new Credentials(clientId);\n }\n return new Credentials(getUsername(), getPassphrase());\n }", "public static ApiClient getWebClient(boolean authenticated, String username, TestingPostgres testingPostgres) {\n ApiClient client = new ApiClient();\n client.setBasePath(getBasePath());\n if (authenticated) {\n client.addDefaultHeader(\"Authorization\", getDockstoreToken(testingPostgres, username));\n }\n return client;\n }", "public interface Client {\n \n /**\n * Get the unique id of current client.\n *\n * @return id of client\n */\n String getClientId();\n \n /**\n * Whether is ephemeral of current client.\n *\n * @return true if client is ephemeral, otherwise false\n */\n boolean isEphemeral();\n \n /**\n * Set the last time for updating current client as current time.\n */\n void setLastUpdatedTime();\n \n /**\n * Get the last time for updating current client.\n *\n * @return last time for updating\n */\n long getLastUpdatedTime();\n \n /**\n * Add a new instance for service for current client.\n *\n * @param service publish service\n * @param instancePublishInfo instance\n * @return true if add successfully, otherwise false\n */\n boolean addServiceInstance(Service service, InstancePublishInfo instancePublishInfo);\n \n /**\n * Remove service instance from client.\n *\n * @param service service of instance\n * @return instance info if exist, otherwise {@code null}\n */\n InstancePublishInfo removeServiceInstance(Service service);\n \n /**\n * Get instance info of service from client.\n *\n * @param service service of instance\n * @return instance info\n */\n InstancePublishInfo getInstancePublishInfo(Service service);\n \n /**\n * Get all published service of current client.\n *\n * @return published services\n */\n Collection<Service> getAllPublishedService();\n \n /**\n * Add a new subscriber for target service.\n *\n * @param service subscribe service\n * @param subscriber subscriber\n * @return true if add successfully, otherwise false\n */\n boolean addServiceSubscriber(Service service, Subscriber subscriber);\n \n /**\n * Remove subscriber for service.\n *\n * @param service service of subscriber\n * @return true if remove successfully, otherwise false\n */\n boolean removeServiceSubscriber(Service service);\n \n /**\n * Get subscriber of service from client.\n *\n * @param service service of subscriber\n * @return subscriber\n */\n Subscriber getSubscriber(Service service);\n \n /**\n * Get all subscribe service of current client.\n *\n * @return subscribe services\n */\n Collection<Service> getAllSubscribeService();\n \n /**\n * Generate sync data.\n *\n * @return sync data\n */\n ClientSyncData generateSyncData();\n \n /**\n * Whether current client is expired.\n *\n * @param currentTime unified current timestamp\n * @return true if client has expired, otherwise false\n */\n boolean isExpire(long currentTime);\n \n /**\n * Release current client and release resources if neccessary.\n */\n void release();\n \n /**\n * Recalculate client revision and get its value.\n * @return recalculated revision value\n */\n long recalculateRevision();\n \n /**\n * Get client revision.\n * @return current revision without recalculation\n */\n long getRevision();\n \n /**\n * Set client revision.\n * @param revision revision of this client to update\n */\n void setRevision(long revision);\n \n}", "private static twitter4j.Twitter createClient() {\n \t\ttwitter4j.Twitter client = TwitterFactory.getSingleton();\n \t\tclient.setOAuthConsumer(consumerKey, consumerSecret);\n \t\treturn client;\n \t}", "public static final DefaultHttpClient createHttpClient() {\n\t\treturn createHttpClient(3);\n\t}", "public static Retrofit getClient() {\n if (retrofit == null){ // Nos aseguramos que no se haya creado un objeto retrofit\n Gson gson = new GsonBuilder()\n .setLenient()\n .create();\n\n retrofit = new Retrofit.Builder() // Inicializamos el objeto Retrofit\n .baseUrl(BASE_URL) // Indicamos a cual sitio se estará conectando\n .addConverterFactory(GsonConverterFactory.create(gson)) // Indicamos cual será nuestro serializador y deserializador de objetos (JSON)\n .build(); // Construimos el objeto\n Log.w(\"Retrofit\",\"Retrofit Start\");\n }\n return retrofit;\n }", "private CloudStackApi getApi() {\n if (_eng == null) {\n _eng = new CloudStackApi(managementServer, cloudAPIPort, false);\n }\n // regardless of whether _eng is initialized, we must make sure\n // access/secret keys are current with what's in the UserCredentials\n _eng.setApiKey(UserContext.current().getAccessKey());\n _eng.setSecretKey(UserContext.current().getSecretKey());\n return _eng;\n }", "public synchronized void buildGoogleApiClient() {\r\n mGoogleApiClient = new GoogleApiClient.Builder(this)\r\n .addConnectionCallbacks(this)\r\n .addOnConnectionFailedListener(this)\r\n .addApi(LocationServices.API)\r\n .build();\r\n }", "public CalendarService() throws IOException, GeneralSecurityException {\n InputStream in = CalendarService.class.getResourceAsStream(CREDENTIALS_FILE_PATH);\n if (in == null) {\n throw new FileNotFoundException(\"Resource not found: \" + CREDENTIALS_FILE_PATH);\n }\n clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n \n NetHttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();\n service = new Calendar.Builder(HTTP_TRANSPORT, JSON_FACTORY, getCredentials(HTTP_TRANSPORT))\n .setApplicationName(APPLICATION_NAME)\n .build();\n }", "private APIClient() {\n }", "API createAPI();", "public static io.dockstore.openapi.client.ApiClient getOpenAPIWebClient(boolean authenticated, String username, TestingPostgres testingPostgres) {\n io.dockstore.openapi.client.ApiClient client = new io.dockstore.openapi.client.ApiClient();\n client.setBasePath(getBasePath());\n if (authenticated) {\n client.addDefaultHeader(\"Authorization\", getDockstoreToken(testingPostgres, username));\n }\n return client;\n }", "public API getApi()\n\t{\n\t\treturn new API(this);\n\t}", "protected synchronized void buildGoogleApiClient() {\n mGoogleApiClient = new GoogleApiClient.Builder(getContext())\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .addApi(LocationServices.API).build();\n }", "protected synchronized void buildGoogleApiClient() {\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .addApi(LocationServices.API).build();\n }", "public CloseableHttpClient build() {\n\t\tCloseableHttpClient httpClient = httpClientBuilder.build();\n\t\treturn httpClient;\n\t}", "protected synchronized void buildGoogleApiClient() {\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .addApi(LocationServices.API)\n .build();\n }", "public static HttpClient Factory() {\n\t\treturn httpclient;\n\t}", "public Configuration.Builder getClientIdAndClientSecretBuilder() {\n String clientId = \"0993a005480472a69fab10c2f9b8ad0d6bee7acf\";//getString(R.string.client_id);\n String clientSecret=\"oVsWjoQ2RHeHvZ8xK3yrtdHrG7YiN+rnHh4qqBfmscDbCwplTFzytAoVIVrXMnAQShuBYuA6fZftYL+AIvX5zRP8JXOs06dQcej1yeL/ACJSGuiKoQJbqdC6CELuP+Pl\";\n\n String codeGrantRedirectUri = \"deva://robokart\";\n Configuration.Builder configBuilder =\n new Configuration.Builder(clientId, clientSecret, SCOPE, null,\n null);\n configBuilder.setCacheDirectory(this.getCacheDir())\n .setUserAgentString(getUserAgentString(this))\n // Used for oauth flow\n .setCodeGrantRedirectUri(codeGrantRedirectUri);\n\n return configBuilder;\n }", "static IDiscordClient getBuiltDiscordClient(String token) {\r\n // The ClientBuilder object is where you will attach your params for configuring the instance of your bot.\r\n // Such as withToken, setDaemon etc\r\n return new ClientBuilder()\r\n .withToken(token)\r\n .withPingTimeout(1)\r\n .withRecommendedShardCount()\r\n .build();\r\n }", "private Drive authentication() throws IOException {\n\t\t// Request a new access token using the refresh token.\n\t\tGoogleCredential credential = new GoogleCredential.Builder()\n\t\t\t\t.setTransport(HTTP_TRANSPORT)\n\t\t\t\t.setJsonFactory(JSON_FACTORY)\n\t\t\t\t.setClientSecrets(CLIENT_ID, CLIENT_SECRET).build()\n\t\t\t\t.setFromTokenResponse(new TokenResponse().setRefreshToken(REFRESH_TOKEN));\n\t\tcredential.refreshToken();\n\t\treturn new Drive.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)\n\t\t\t\t.setApplicationName(\"tp3\").build();\n\t}", "public Apis getApi() {\n //logging requests and responses in verbose\n HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();\n interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);\n OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();\n //build retrofit object\n Retrofit retrofit = new Retrofit.Builder()\n .baseUrl(\"http://srishti-systems.info/projects/ForteBank/api/\")\n .addConverterFactory(GsonConverterFactory.create())\n .client(client).build();\n\n //connect api class with this builder\n\n Apis apis = retrofit.create(Apis.class);\n return apis;\n }", "private DefaultHttpClient createHttpClient()\n throws IOException\n {\n XCapCredentialsProvider credentialsProvider\n = new XCapCredentialsProvider();\n credentialsProvider.setCredentials(\n AuthScope.ANY,\n new UsernamePasswordCredentials(getUserName(), password));\n\n return HttpUtils.getHttpClient(\n null , null, uri.getHost(), credentialsProvider);\n }", "public static Client create() {\n ClientConfig clientConfig = new ClientConfig(JacksonFeature.class,\n JacksonJaxbJsonProvider.class,\n JacksonJsonProvider.class);\n return ClientBuilder.newClient(clientConfig);\n }", "public static WebResource getJerseyClient(String url){\n\t\tif(url == null || url.isEmpty()){\n\t\t\treturn null;\n\t\t}\n\t\tClient client = null;\n\n\t\tClientConfig clientConfigRegisterUser = new DefaultClientConfig();\n\t\tclientConfigRegisterUser.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,Boolean.TRUE);\n\n\t\tclient = Client.create(clientConfigRegisterUser);\n\n\t\treturn client.resource(url);\n\t}", "protected synchronized void buildGoogleApiClient() {\r\n googleApiClient = new GoogleApiClient.Builder(this)\r\n .addConnectionCallbacks(this)\r\n .addOnConnectionFailedListener(this)\r\n .addApi(LocationServices.API)\r\n .build();\r\n }", "public static Retrofit getClient(final Context context) {\n //setup cache\n OkHttpClient okHttpClient = createCachedClient(context);\n retrofit = new Retrofit.Builder()\n .client(okHttpClient)\n .baseUrl(BASE_URL)\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n return retrofit;\n }", "public HttpClient build() {\n\t\tCloseableHttpClient httpClient = httpClientBuilder.build();\n\t\treturn new ApacheHttpClient(this.configuration, httpClient);\n\t}", "public static synchronized APIClient getINSTANCE() {\n if (INSTANCE == null) {\n INSTANCE = new APIClient();\n }\n return INSTANCE;\n }", "protected synchronized void buildGoogleApiClient() {\n try {\n System.out.println(\"In GOOGLE API CLIENT\");\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .addApi(LocationServices.API).build();\n mGoogleApiClient.connect();\n createLocationRequest();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public DelegateCredentialsProvider build() {\n return new DelegateCredentialsProvider(this);\n }", "public ApiService apiService() {\n\t\treturn apiService;\n\t}", "protected synchronized void buildGoogleApiClient() {\n\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .addApi(LocationServices.API)\n .build();\n mGoogleApiClient.connect();\n }", "public GoogleApiClient getGoogleApiCLient()\n {\n return googleApiClient;\n }", "private static ServiceAccount getInstanceByEnvVars() {\n Map<String, String> env = System.getenv();\n String gaasUrl = env.get(GAAS_URL);\n String gaasApiKey = env.get(GAAS_API_KEY);\n if (gaasUrl == null || gaasApiKey == null) {\n return null;\n }\n logger.info(\"A ServiceAccount is created from environment variables: GAAS_URL=\"\n + gaasUrl + \", GAAS_API_KEY=***\");\n return getInstance(gaasUrl, gaasApiKey);\n }", "public BackendService build() {\n return new BackendService(super.buildUnknownFields());\n }", "private Calendar getGoogleClient(String email)\t{\n\t\tGoogleCredential credential = getGoogleCredential(email);\n\t\tCalendar client = getGoogleClient(credential);\n\t\treturn client;\n\t}", "protected HttpClient getClient() {\n if (client == null) {\n synchronized (this) {\n if (client == null) {\n client = new DefaultHttpClient(conman, params);\n }\n }\n }\n\n return client;\n }", "static Http1Client create() {\n return create(Http1ClientConfig.create());\n }", "private void buildGoogleApiClient() {\n Log.d(Constants.SERVICE_CREATED, Constants.GOOGLE_MAP_BUILDING);\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .addApi(com.google.android.gms.location.LocationServices.API)\n .build();\n Log.d(Constants.SERVICE_CREATED, Constants.GOOGLE_MAP_BUILT);\n createLocationRequest();\n }", "private CloseableHttpAsyncClient createHttpClient() {\n RequestConfig.Builder requestConfigBuilder = RequestConfig.custom()\n .setConnectTimeout(Timeout.ofMilliseconds(DEFAULT_CONNECT_TIMEOUT_MILLIS))\n .setResponseTimeout(Timeout.ofMilliseconds(DEFAULT_RESPONSE_TIMEOUT_MILLIS));\n if (requestConfigCallback != null) {\n requestConfigBuilder = requestConfigCallback.customizeRequestConfig(requestConfigBuilder);\n }\n\n try {\n final TlsStrategy tlsStrategy = ClientTlsStrategyBuilder.create()\n .setSslContext(SSLContext.getDefault())\n // See https://issues.apache.org/jira/browse/HTTPCLIENT-2219\n .setTlsDetailsFactory(new Factory<SSLEngine, TlsDetails>() {\n @Override\n public TlsDetails create(final SSLEngine sslEngine) {\n return new TlsDetails(sslEngine.getSession(), sslEngine.getApplicationProtocol());\n }\n })\n .build();\n\n final PoolingAsyncClientConnectionManager connectionManager = PoolingAsyncClientConnectionManagerBuilder.create()\n .setMaxConnPerRoute(DEFAULT_MAX_CONN_PER_ROUTE)\n .setMaxConnTotal(DEFAULT_MAX_CONN_TOTAL)\n .setTlsStrategy(tlsStrategy)\n .build();\n\n HttpAsyncClientBuilder httpClientBuilder = HttpAsyncClientBuilder.create()\n .setDefaultRequestConfig(requestConfigBuilder.build())\n .setConnectionManager(connectionManager)\n .setTargetAuthenticationStrategy(DefaultAuthenticationStrategy.INSTANCE)\n .disableAutomaticRetries();\n if (httpClientConfigCallback != null) {\n httpClientBuilder = httpClientConfigCallback.customizeHttpClient(httpClientBuilder);\n }\n\n final HttpAsyncClientBuilder finalBuilder = httpClientBuilder;\n return AccessController.doPrivileged((PrivilegedAction<CloseableHttpAsyncClient>) finalBuilder::build);\n } catch (NoSuchAlgorithmException e) {\n throw new IllegalStateException(\"could not create the default ssl context\", e);\n }\n }", "public interface GmailClientFactory {\n /**\n * Creates a GmailClient instance\n *\n * @param credential a valid Google credential object\n * @return a GmailClient instance that contains the user's credentials\n */\n GmailClient getGmailClient(Credential credential);\n}", "public static RetrofitWebService RetrofitInitilizer(){\n\n RestAdapter adapter = new RestAdapter.Builder()\n .setEndpoint(DOMAIN) //Setting the Root URL\n .build(); //Finally building the adapter\n\n RetrofitWebService api = adapter.create(RetrofitWebService.class);\n\n return api;\n }", "static Retrofit getClient(String baseUrl) {\n if (retrofit == null) {\n retrofit = new Retrofit.Builder()\n .baseUrl(baseUrl)\n .addCallAdapterFactory(RxJava2CallAdapterFactory.create())\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n }\n return retrofit;\n }", "public GoogleAuth(String apiKey, String apiSecret, String scope){\n\t\tthis.apiKey = apiKey;\n\t\tthis.apiSecret = apiSecret;\n\t\tthis.scope = scope;\n\t\tthis.service = new ServiceBuilder().provider(Google2Api.class)\n\t\t\t\t.apiKey(this.apiKey).apiSecret(this.apiSecret).callback(this.callbackUrl)\n\t\t\t\t.scope(this.scope).build();\n\n\t\ttry {\n\t\t\tHTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected synchronized void buildGoogleApiClient() {\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .addApi(LocationServices.API)\n .build();\n mGoogleApiClient.connect();\n }", "public Calendar getCalendarService() throws IOException {\n\t\tCredential credential = this.googleCred;\n\t\treturn new Calendar.Builder(\n\t\t\t\tHTTP_TRANSPORT, JSON_FACTORY, credential)\n\t\t\t\t.setApplicationName(APP_NAME)\n\t\t\t\t.build();\n\t}", "public static ApiClient getDefaultApiClient() {\n return defaultApiClient;\n }", "private Client buildClient() {\n\t\tClient client = new Client();\n\t\tclient.setName(clientNameTextBox.getValue());\n\t\tclient.setAddress(clientAddressTextBox.getValue());\n\t\tclient.setTelephone(clientTelephoneTextBox.getValue());\n\t\treturn client;\n\t}", "public static Client createClient() {\n JacksonJaxbJsonProvider provider = new JacksonJaxbJsonProvider();\n provider.setAnnotationsToUse(new Annotations[]{Annotations.JACKSON});\n\n ClientConfig config = new ClientConfig(provider);\n //Allow delete request with entity\n config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);\n //It helps to handle cookies\n config.property(ClientProperties.FOLLOW_REDIRECTS, Boolean.FALSE);\n //Allow PATCH\n config.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);\n\n Logger logger = Logger.getLogger(\"Client\");\n Feature feature = new LoggingFeature(logger, Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY,\n null);\n\n //Allow self trusted certificates\n SSLContext sslcontext;\n try {\n sslcontext = SSLContext.getInstance(\"TLS\");\n sslcontext.init(null, new TrustManager[]{new X509TrustManager() {\n public void checkClientTrusted(X509Certificate[] arg0, String arg1) {\n }\n\n public void checkServerTrusted(X509Certificate[] arg0, String arg1) {\n }\n\n public X509Certificate[] getAcceptedIssuers() {\n return new X509Certificate[0];\n }\n }}, new java.security.SecureRandom());\n } catch (KeyManagementException | NoSuchAlgorithmException e) {\n throw new RuntimeException(e);\n }\n\n return ClientBuilder\n .newBuilder()\n .withConfig(config)\n .sslContext(sslcontext)\n .build()\n .register(feature)\n .register(MultiPartFeature.class);\n }", "public static RetrofitClient getInstance() {\n return OUR_INSTANCE;\n }", "private SubscriptionAdminClient createSubscriptionClient() throws IOException {\n if (useEmulator) {\n SubscriptionAdminSettings adminSettings = SubscriptionAdminSettings.newBuilder()\n .setCredentialsProvider(pubsubCredsProvider)\n .setTransportChannelProvider(channelProvider)\n .build();\n return SubscriptionAdminClient.create(adminSettings);\n } else {\n return SubscriptionAdminClient.create(); // todo arz shutdown listener\n }\n }", "protected synchronized void buildGoogleApiClient() {\n mGoogleApiClient = new GoogleApiClient.Builder(getActivity())\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .addApi(LocationServices.API)\n .build();\n }", "private CloseableHttpClient getHttpClient() {\n return HttpClients.custom()\n .setConnectionManager(httpClientConnectionManager)\n .setConnectionManagerShared(true)\n .build();\n }", "private ResourceClient( ResourceConfigurationBase<?> theConfiguration, String theContractRoot, String theContractVersion, String theUserAgent, HttpClient theClient, JsonTranslationFacility theJsonFacility ) {\r\n\t\tPreconditions.checkNotNull( theConfiguration, \"need a configuration object so we can get our endpoint\" );\r\n \tPreconditions.checkArgument( !Strings.isNullOrEmpty( theContractRoot ), \"need a contract root\" );\r\n \tPreconditions.checkArgument( theContractRoot.startsWith( \"/\" ), \"the contract root '%s' must be a reference from the root (i.e. start with '/')\", theContractRoot );\r\n \tPreconditions.checkArgument( !Strings.isNullOrEmpty( theContractVersion ), \"need a version for contract root '%s'\", theContractRoot );\r\n \tPreconditions.checkArgument( ContractVersion.isValidVersion( theContractVersion), \"the version string '%s' for contract root '%s' is not valid\", theContractVersion, theContractRoot );\r\n\t\tPreconditions.checkArgument( !Strings.isNullOrEmpty( theUserAgent ), \"need a user agent for this client\" );\r\n\r\n\t\t// lets make sure the configuration is valid\r\n\t\ttheConfiguration.validate();\r\n\t\t\r\n\t\t// now let's start preparing the client\r\n\t\tendpoint = new HttpEndpoint( theConfiguration.getEndpoint( ) ); // this will do validation on the endpoint \r\n\t\tcontractRoot = theContractRoot; \r\n\t\tcontractVersion = theContractVersion;\r\n\t\tuserAgent = theUserAgent;\r\n\t\t\r\n\t\t// use the client if sent in, but create a working one otherwise\r\n\t\tif( theClient == null ) {\r\n\t\t\ttry {\r\n\t\t\t SslContextFactory sslContextFactory = null;\r\n\t\r\n\t\t\t if( endpoint.isSecure( ) ) {\r\n\t\t\t \tif( theConfiguration.getAllowUntrustedSsl() ) {\r\n\t\t\t \t\t// so we need SSL communication BUT we don't need to worry about it being valid, likley\r\n\t\t\t \t\t// because the caller is self-cert'ing or in early development ... we may need to do \r\n\t\t\t \t\t// more here mind you\r\n\t\t\t \t\t\r\n\t\t\t\t \t// the following code was based https://code.google.com/p/misc-utils/wiki/JavaHttpsUrl\r\n\t\t\t\t \t// if we were to look into mutual SSL and overall key handling, I probably want to\r\n\t\t\t\t \t// take a closer look\r\n\t\t\t\t \t\r\n\t\t\t\t \t// We need to create a trust manager that essentially doesn't except/fail checks\r\n\t\t\t\t\t final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\r\n\t\t\t\t\t \t// this was based on the code found here:\r\n\t\t\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void checkClientTrusted(X509Certificate[] chain,\r\n\t\t\t\t\t\t\t\t\tString authType) throws CertificateException {\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void checkServerTrusted(X509Certificate[] chain,\r\n\t\t\t\t\t\t\t\t\tString authType) throws CertificateException {\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic X509Certificate[] getAcceptedIssuers() {\r\n\t\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t } };\r\n\t\t\t\t\t \r\n\t\t\t\t\t // then we need to create an SSL context that uses lax trust manager \r\n\t\t\t\t\t SSLContext sslContext = SSLContext.getInstance( \"SSL\" );\r\n\t\t\t\t\t\tsslContext.init( null, trustAllCerts, new java.security.SecureRandom() );\r\n\t\r\n\t\t\t\t\t\t// and finally, create the SSL context that\r\n\t\t\t\t\t\tsslContextFactory = new SslContextFactory();\r\n\t\t\t\t\t\tsslContextFactory.setSslContext( sslContext );\r\n\t\t\t \t} else {\r\n\t\t\t \t\t// TODO: this needs to be tested against \r\n\t\t\t \t\t//\t\t a) real certs with real paths that aren't expired\r\n\t\t\t \t\t//\t\t b) real certs with real paths that are expired\r\n\t\t\t \t\tsslContextFactory = new SslContextFactory( );\r\n\t\t\t \t}\r\n\t\t\t\t\thttpClient = new HttpClient( sslContextFactory );\r\n\t\t\t } else {\r\n\t\t\t\t\thttpClient = new HttpClient( );\r\n\t\t\t }\r\n\t\t\t httpClient.setFollowRedirects( false ); // tales doesn't have redirects (at least not yet)\r\n\t\t\t httpClient.setStrictEventOrdering( true ); // this seems to fix an odd issue on back-to-back calls to the same service on \r\n\t\t\t\thttpClient.start( );\r\n\t\t\t displayClientConfiguration( httpClient );\r\n\t\t\t} catch (NoSuchAlgorithmException | KeyManagementException e) {\r\n\t\t\t\tthrow new IllegalStateException( \"unable to create the resource client due to a problem setting up SSL\", e );\r\n\t\t\t} catch (Exception e ) {\r\n\t\t\t\tthrow new IllegalStateException( \"unable to create the resource client due to the inability to start the HttpClient\", e );\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\thttpClient = theClient;\r\n\t\t}\r\n\t\thttpClient.setUserAgentField( new HttpField( HttpHeader.USER_AGENT, theUserAgent ) );\r\n\r\n\t\tif( theJsonFacility == null ) {\r\n\t\tjsonFacility = new JsonTranslationFacility( new DataContractTypeSource( ) );\r\n\t\t} else {\r\n\t\t\tjsonFacility = theJsonFacility;\r\n\t\t}\r\n\t\t\r\n\t\tjsonParser = new JsonParser( );\r\n\t\t\r\n\t\t// now that we have the json facility, let's \r\n\t\t// get the adapter for the result type\r\n\t\tJavaType type = new JavaType( ResourceResult.class );\r\n\t\tJsonTypeMap typeMap = jsonFacility.generateTypeMap( type ); // TODO: technically I can, if I have the type of the result, now do the full thing (need to have a field for it)\r\n\t\tresultTypeAdapter = new TypeFormatAdapter( \r\n\t\t\t\ttype,\r\n\t\t\t\ttypeMap.getReflectedType().getName(),\r\n \t\t\tnew JsonObjectToObjectTranslator( typeMap ),\r\n \t\t\tnew ObjectToJsonObjectTranslator( typeMap ) );\t\t\t\t\r\n\t}", "protected static Service getService() throws AnaplanAPIException, UnknownAuthenticationException {\n if (service != null) {\n return service;\n }\n\n ConnectionProperties props = getConnectionProperties();\n service = DefaultServiceProvider.getService(props, Constants.X_ACONNECT_HEADER_KEY, Constants.X_ACONNECT_HEADER_VALUE);\n service.authenticate();\n return service;\n }", "public API getApi() {\n return retrofit.create(API.class);\n }", "public static ApiClient getApiClient(String apiToken, Boolean secureConnection, String customApiUrl) {\n return new ApiClient(customApiUrl, getHeadersWithAuth(DEFAULTS.SERVER_AUTH_HEADER, apiToken), secureConnection);\n }", "public PublishingClientImpl() {\n this.httpClientSupplier = () -> HttpClients.createDefault();\n this.requestBuilder = new PublishingRequestBuilderImpl();\n }" ]
[ "0.63384336", "0.6336757", "0.6198538", "0.6143181", "0.6020759", "0.5928088", "0.58776295", "0.58676696", "0.5846059", "0.5843613", "0.58411926", "0.58395433", "0.5824829", "0.580408", "0.5759715", "0.5748068", "0.57446945", "0.5728541", "0.57241565", "0.5689256", "0.5688689", "0.5675701", "0.5675701", "0.5668575", "0.5637096", "0.5636283", "0.5600133", "0.5591408", "0.5589273", "0.55579555", "0.5539753", "0.55371714", "0.55352736", "0.55227023", "0.54998475", "0.5483501", "0.54486734", "0.54484344", "0.54417205", "0.5438403", "0.54274255", "0.5425213", "0.5418648", "0.54164124", "0.5387068", "0.5385081", "0.5367784", "0.53594345", "0.53585196", "0.53582716", "0.535718", "0.5353778", "0.53461164", "0.5345206", "0.5338201", "0.53348196", "0.5326112", "0.5325022", "0.53226745", "0.53157675", "0.53099525", "0.5308636", "0.5306814", "0.5291971", "0.5290372", "0.5276451", "0.5270696", "0.52665174", "0.52650744", "0.52648866", "0.52644986", "0.5251325", "0.525044", "0.52479565", "0.52372044", "0.52369237", "0.52364886", "0.522901", "0.52166593", "0.5213084", "0.5211834", "0.5201968", "0.52003354", "0.5198092", "0.5193844", "0.5192317", "0.51809084", "0.5179504", "0.51748484", "0.51747346", "0.5174134", "0.5165677", "0.5164771", "0.51583546", "0.51552886", "0.51439947", "0.51410323", "0.51369476", "0.51337105", "0.5133199" ]
0.5493431
35
Use Comparator.comparing and thenComparing to sort the list by balance and then by ownerName Collect your stream into a list and print the sorted result to the console
public static void main(String[] args) { List<Account> accounts = new ArrayList<Account>() { { add(new Account("Bob", 5000, 1001)); add(new Account("Jim", 10000, 1002)); add(new Account("Bruce", 5300, 1003)); add(new Account("Li", 12000, 1004)); add(new Account("Sam", 9000, 1005)); add(new Account("Rick", 11000, 1006)); } }; BiFunction<List<Account>, Integer, List<Account>> MYLIB = (list, f) -> { return list.stream().filter(e -> e.getBalance() > f).collect(Collectors.toList()); }; MYLIB.apply(accounts, 2000).forEach(x -> System.out.println(x.getOwnerName())); MYLIB.apply(accounts, 40000).forEach(x -> System.out.println(x.getOwnerName())); accounts.stream().filter(a -> a.getBalance() > 50000).collect(Collectors.toList()); class A { public A() { } boolean test() { return true; } public String toString(){ return test() + ""; } }; // A a = new A(); // accounts.stream().filter(A::test).collect(Collectors.toList()); Stream.generate(A::new).limit(10).forEach(System.out::println); // s.forEach(System.out::println); //sorting code here System.out.println("----------------------------"); System.out.println(accounts); Collections.sort(accounts, Comparator.comparing(Account::getBalance).thenComparing(Account::getOwnerName).reversed()); // Collections.sort(accounts, Comparator.comparing(Account::getBalance).thenComparing(Account::getOwnerName)); System.out.println(accounts); MyF f = new MyF(); List<Integer> n = Arrays.asList(1, 2, 3, 4,5, 6, 7); f.filter(n, (x) -> ((int) x) > 3).forEach(System.out::println); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n ArrayList<BankAccount> accounts = makeBankingSystem();\n \n Collections.sort(accounts, BankAccount.createComparatorByBalance(false));\n for (BankAccount c: accounts){\n System.out.println(c.getName(c)+\", \"+c.getBalance(c));\n \n }\n \n}", "public static void main(String[] args){\n\t\tSystem.out.println(\"/***Java 8 stream Implementation sorting and filtering ***/\");\n\t\tSystem.out.println(\"/*Stream Implementation sorting and filtering to List*/\");\n\t\tList<Person> streamEx = new ArrayList<Person>();\n\t\tstreamEx.add(new Person(\"Ramu\",12));\n\t\tstreamEx.add(new Person(\"Agil\",52));\n\t\tstreamEx.add(new Person(\"Murali\",17));\n\t\tstreamEx.add(new Person(\"Hari\",17));\n\t\tstreamEx.add(new Person(\"Kalai\",45));\n\t\tstreamEx.add(new Person(\"George\",78));\n\t\tList<String> sortedNames = streamEx\n\t\t.stream().filter(s -> s.getAge() > 18)\n\t\t//.sorted(PERSON_SORT_BY_NAME) // Soreted using Comparator instance already created\n\t\t.sorted((p1,p2)->p1.getAge().compareTo(p2.getAge())) // Defining the Comparator here itself\n\t\t.map(Person::getName)\n\t\t.collect(Collectors.toList());\n\t\tSystem.out.println(sortedNames);\n\t\t\n\t\t// Retriving the first person of the criteria being met\n\t\tOptional<Person> firstPerson = streamEx\n\t\t\t\t\t\t\t\t\t\t.stream()\n\t\t\t\t\t\t\t\t\t\t//.sorted(PERSON_SORT_BY_AGE.reversed()) // Reverse sorting\n\t\t\t\t\t\t\t\t\t\t.sorted(PERSON_SORT_BY_AGE)\n\t\t\t\t\t\t\t\t\t\t.findFirst();\n\t\tSystem.out.println(\"Person with Minimum Age :: \"+firstPerson.get());\n\t\t\n\t\t//Mutiple Sorting conditions\n\t\tSystem.out.println(\"/*\\n*Mutiple Sorting conditions \\n*1.Age\\n*2.Name\\n*/\");\n\t\tstreamEx\n\t\t.stream()\n\t\t.sorted(PERSON_SORT_BY_AGE.thenComparing(PERSON_SORT_BY_NAME))\n\t\t.forEach(e -> System.out.println(e));\n\t\t\n\t\tSystem.out.println(\"/*Stream Implementation sorting and filtering to Map*/\");\n\t\tMap<String,Integer> sortedMap = streamEx\n\t\t.stream()\n\t\t.collect(Collectors.toMap(Person::getName,Person::getAge));\n\t\tSystem.out.println(sortedMap);\n\t\t\n\t\t//Limiting Records\n\t\tSystem.out.println(\"/** Limiting Records **/\");\n\t\tstreamEx\n\t\t.stream()\n\t\t.sorted(PERSON_SORT_BY_NAME)\n\t\t.filter(s -> s.getAge() < 18)\n\t\t.limit(2)\n\t\t.forEach(e -> System.out.println(e));\n\t\t\n\t\tprintMethodName();\n\t\n\t}", "public void exercise() {\n List<Transaction> ex1 = transactions.stream()\n .filter(transaction -> transaction.getYear() == 2011)\n .sorted(Comparator.comparing(Transaction::getValue))\n .collect(Collectors.toList());\n System.out.println(ex1);\n\n //2 What are all the unique cities where the traders work?\n List<String> ex2 = transactions.stream()\n .map(transaction -> transaction.getTrader().getCity())\n .distinct()\n .collect(Collectors.toList());\n System.out.println(ex2);\n\n //alternative solution\n Set<String> ex2alt = transactions.stream()\n .map(transaction -> transaction.getTrader().getCity())\n .collect(Collectors.toSet());\n\n //3 Find all traders from Cambridge and sort them by name.\n List<Trader> ex3 = transactions.stream()\n .map(Transaction::getTrader)\n .distinct()\n .filter(trader -> trader.getCity() == \"Cambridge\")\n .sorted(Comparator.comparing(Trader::getName))\n .collect(Collectors.toList());\n System.out.println(ex3);\n\n //4 Return a string of all traders’ names sorted alphabetically.\n String ex4 = transactions.stream()\n .map(transaction -> transaction.getTrader().getName())\n .distinct()\n .sorted()\n .reduce(\"\", (n1, n2) -> n1 + n2);\n System.out.println(ex4);\n\n //alternative solution\n String ex4Alt = transactions.stream()\n .map(transaction -> transaction.getTrader().getName())\n .distinct()\n .sorted()\n .collect(Collectors.joining());\n System.out.println(ex4Alt);\n\n //5 Are any traders based in Milan?\n Boolean ex5 = transactions.stream()\n .anyMatch(transaction -> transaction.getTrader().getCity().equals(\"Milan\"));\n System.out.println(ex5);\n\n //6 Print the values of all transactions from the traders living in Cambridge.\n transactions.stream()\n .filter(transaction -> transaction.getTrader().getCity().equals(\"Cambridge\"))\n .forEach(System.out::println);\n\n //7 What’s the highest value of all the transactions?\n Optional<Integer> ex7 = transactions.stream()\n .map(Transaction::getValue)\n .reduce(Integer::max);\n System.out.println(ex7);\n\n //8 Find the transaction with the smallest value.\n Optional<Transaction> ex8 = transactions.stream()\n .reduce((t1, t2) -> t1.getValue() < t2.getValue() ? t1 : t2);\n System.out.println(ex8);\n\n //alternative solution\n Optional<Transaction> ex8Alt = transactions.stream()\n .min(Comparator.comparing(Transaction::getValue));\n System.out.println(ex8Alt);\n\n }", "public static void main(String[] args)\n {\n Employee[] employees = {\n new Employee(\"Jason\", \"Red\", 5000, \"IT\"),\n new Employee(\"Ashley\", \"Green\", 7600, \"IT\"),\n new Employee(\"Matthew\", \"Indigo\", 3587.5, \"Sales\"),\n new Employee(\"James\", \"Indigo\", 4700.77, \"Marketing\"),\n new Employee(\"Luke\", \"Indigo\", 6200, \"IT\"),\n new Employee(\"Jason\", \"Blue\", 3200, \"Sales\"),\n new Employee(\"Wendy\", \"Brown\", 4236.4, \"Marketing\")};\n\n // get List view of the Employees\n List<Employee> list = Arrays.asList(employees);\n\n // display all Employees\n System.out.println(\"Complete Employee list:\");\n list.stream().forEach(System.out::println); // A method reference.\n \n List<Employee> list2 = Arrays.asList(employees);\n Collections.sort(list2, new myEmployeeComparator());\n\n //display all Employees\n System.out.println(\"\\nComplete Employee list Ordered:\");\n list2.stream().forEach(System.out::println); // A method reference.\n \n //Predicate (boolean-valued function) that returns true for salaries \n //in the range $4000-$6000\n Predicate<Employee> fourToSixThousand = \n e -> (e.getSalary() >= 4000 && e.getSalary() <= 6000);\n\n //Display Employees with salaries in the range $4000-$6000\n // sorted into ascending order by salary\n System.out.printf(\n \"%nEmployees earning $4000-$6000 per month sorted by salary:%n\");\n\n list.stream()\n .filter(fourToSixThousand)\n .sorted(Comparator.comparing(Employee::getSalary))\n .forEach(System.out::println);\n\n //Display first Employee with salary in the range $4000-$6000\n System.out.printf(\"%nFirst employee who earns $4000-$6000:%n%s%n\",\n list.stream()\n .filter(fourToSixThousand)\n .findFirst()\n .get());\n\n // Functions for getting first and last names from an Employee\n Function<Employee, String> byFirstName = Employee::getFirstName;\n Function<Employee, String> byLastName = Employee::getLastName;\n\n //Comparator for comparing Employees by first name then last name\n Comparator<Employee> lastThenFirst = \n Comparator.comparing(byLastName).thenComparing(byFirstName);\n\n // sort employees by last name, then first name \n System.out.printf(\n \"%nEmployees in ascending order by last name then first:%n\");\n list.stream()\n .sorted(lastThenFirst)\n .forEach(System.out::println);\n\n //sort employees in descending order by last name, then first name\n System.out.printf(\n \"%nEmployees in descending order by last name then first:%n\");\n list.stream()\n .sorted(lastThenFirst.reversed())\n .forEach(System.out::println);\n\n //display unique employee last names sorted\n System.out.printf(\"%nUnique employee last names:%n\");\n list.stream()\n .map(Employee::getLastName)\n .distinct()\n .sorted()\n .forEach(System.out::println);\n\n //display only first and last names\n System.out.printf(\n \"%nEmployee names in order by last name then first nameX:%n\"); \n list.stream()\n .sorted(lastThenFirst)\n .map(Employee::getName)\n .forEach(System.out::println);\n\n //group Employees by department\n System.out.printf(\"%nEmployees by department:%n\"); \n Map<String, List<Employee>> groupedByDepartment =\n list.stream()\n .collect(Collectors.groupingBy(Employee::getDepartment));\n\n groupedByDepartment.forEach(\n (department, employeesInDepartment) -> \n {\n System.out.println(department);\n employeesInDepartment.forEach(\n employee -> System.out.printf(\" %s%n\", employee));\n }\n );\n System.out.printf(\"%nAverage salary by department:%n\"); \n \n groupedByDepartment.forEach(\n \t (department, employeesInDepartment) -> \n \t {\n \t System.out.println(department);\n \t System.out.printf(\" %.2f%n\",employeesInDepartment.stream().mapToDouble(Employee::getSalary).average().getAsDouble());\n \t \n \t }\n \t );\n \n System.out.printf(\"%nMax salary by department:%n\"); \n \n groupedByDepartment.forEach(\n \t (department, employeesInDepartment) -> \n \t {\n \t System.out.println(department);\n \t System.out.printf(\" %.2f%n\",employeesInDepartment.stream().mapToDouble(Employee::getSalary).max().getAsDouble());\n \t \n \t }\n \t );\n\n //count number of Employees in each department\n System.out.printf(\"%nCount of Employees by department:%n\"); \n\n Map<String, Long> employeeCountByDepartment =\n list.stream()\n .collect(Collectors.groupingBy(Employee::getDepartment, \n TreeMap::new, Collectors.counting()));\n\n employeeCountByDepartment.forEach(\n (department, count) -> System.out.printf(\n \"%s has %d employee(s)%n\", department, count));\n\n/* Output looks something like :\n\n HR 4\n IT 8\n Sales 12\n*/\n\n\n // sum of Employee salaries with DoubleStream sum method\n System.out.printf(\n \"%nSum of Employees' salaries (via sum method): %.2f%n\",\n list.stream()\n .mapToDouble(Employee::getSalary)\n .sum());\n\n //calculate sum of Employee salaries with Stream reduce method\n System.out.printf(\n \"Sum of Employees' salaries (via reduce method): %.2f%n\",\n list.stream()\n .mapToDouble(Employee::getSalary)\n .reduce(0, (value1, value2) -> value1 + value2)); \n\n //average of Employee salaries with DoubleStream average method\n System.out.printf(\"Average of Employees' salaries: %.2f%n\",\n list.stream()\n .mapToDouble(Employee::getSalary)\n .average()\n .getAsDouble()); \n \n System.out.printf(\"Number of Lastnames beginning with B %d\",\n \t list.stream()\n \t .map(Employee::getLastName)\n \t .filter(e->e.charAt(0)=='b' || e.charAt(0)=='B')\n \t .count()); \n \n \n System.out.printf(\"\\nList of Employees with lastname beginning with B %s\",\n \t list.stream()\n \t .map(Employee::getLastName)\n \t .filter(e->(e.charAt(0)=='b' || e.charAt(0)=='B'))\n \t .collect(Collectors.toList()\n \t \t\t )); \n \n List<Employee> lastbyB =\n \t list.stream()\n \t .filter(s -> s.getLastName().startsWith(\"B\")||s.getLastName().startsWith(\"b\"))\n \t .collect(Collectors.toList()) ;\n \n System.out.printf(\n \t \"\\nFirst and Lastname upper case \\n\\n\");\n \n \n list.stream()\n\t .filter(s -> s.getLastName().startsWith(\"B\"))\n .map(emp ->{ \n \t return \n \t\t\t new Employee(emp.getFirstName().toUpperCase(), \n \t\t emp.getLastName().toUpperCase(),emp.getSalary(),\n \t\t emp.getDepartment());\n \t })\n .forEach(System.out::println);\n \n System.out.printf(\n \t \"\\nLastname upper case \\n\\n\");\n \n \n\nlist.stream()\n.map(x-> {\n\tif(x.getLastName().startsWith(\"B\")) {\n\treturn new Employee(x.getFirstName(), x.getLastName().toUpperCase(),x.getSalary(),x.getDepartment());\n\t}else {\n\t\treturn new Employee(x.getFirstName(), x.getLastName(),x.getSalary(),x.getDepartment());\n\n\t}\n\t})\n.forEach(System.out::println);\n\nStream<Employee> mstr=list.stream()\n.map(x-> {\n\tif(x.getLastName().startsWith(\"B\")) {\n\treturn new Employee(x.getFirstName(), x.getLastName().toUpperCase(),x.getSalary(),x.getDepartment());\n\t}else {\n\t\treturn new Employee(x.getFirstName(), x.getLastName(),x.getSalary(),x.getDepartment());\n\n\t}\n\t//return new Employee(x.getFirstName(), x.getLastName(),x.getSalary(),x.getDepartment());\n\t});\nStream<Employee> mstr1=list.stream()\n.map(x-> {\n\tif(x.getLastName().startsWith(\"B\")) {\n\treturn new Employee(x.getFirstName(), x.getLastName().toUpperCase(),x.getSalary(),x.getDepartment());\n\t}else {\n\t\treturn new Employee(x.getFirstName(), x.getLastName(),x.getSalary(),x.getDepartment());\n\n\t}\n\t//return new Employee(x.getFirstName(), x.getLastName(),x.getSalary(),x.getDepartment());\n\t});\n\n\n\n\n\nSystem.out.println(\n \"\\nJoining in Employees \\n\\n\"+\nmstr\n.map( Employee::toString)\n.collect(Collectors.joining()));\n\nSystem.out.println(\n \"\\nJoining in Employees with separator\\n\\n\"+\nmstr1\n.map( Employee::toString)\n.collect(Collectors.joining(\"---\\n---\")));\n\n\n\n\nSystem.out.printf(\n \"\\nEmploying with Last Name starting with I, sorted and without duplicate upper case \\n\\n\");\n\nlist.stream()\n.filter(s -> s.getLastName().startsWith(\"I\")||s.getLastName().startsWith(\"i\"))\n.map(e->e.getLastName())\n.sorted()\n.distinct()\n.forEach(System.out::println);\n\nSystem.out.printf(\n \"\\nAverage of Salary %.1f\\n\",\nlist.stream()\n.map(e->e.getSalary()/list.size())\n.reduce(0.0, (x,y)->x+y)\n.doubleValue());\n\nSystem.out.printf(\n \"\\nAverage of Salary %.1f\\n\",\nlist.stream()\n.mapToDouble(Employee::getSalary)\n.average().getAsDouble());\n\nSystem.out.printf(\n \"\\nAverage of Salary %.1f\\n\",\nlist.stream()\n.collect(Collectors.averagingDouble(Employee::getSalary)));\n\nSystem.out.printf(\n \"\\nTotal of Salary %.1f\\n\",\nlist.stream()\n.map(e->e.getSalary())\n.reduce(0.0, (x,y)->x+y)\n.doubleValue());\n\nSystem.out.printf(\n \"\\nFirstname of All Employees\\n\\n\");\n\nlist.stream()\n.map(e->e.getFirstName())\n.forEach(System.out::println);\n\nSystem.out.printf(\n \"\\nInfinite even numbers print the 20 first\\n\\n\");\nIntStream \n\n.iterate(0, i -> i + 2)\n.limit(20)\n.forEach(System.out::println); \n\n \t \n \n }", "public static void main(String[] args) {\n\t\tList<Integer> numbers = List.of(10,1, 2, 3, 3, 4, 4, 5, 6, 7, 8, 9);\n\t\tList<String> courses = List.of(\"Spring\", \"Spring Boot\", \"API\" , \"Microservices\",\"AWS\", \"PCF\",\"Azure\", \"Docker\", \"Kubernetes\");\n\n//01 distinct numbers in stream\t\t\n\t\tnumbers.stream().distinct()\n\t\t .forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\n//02 sorted\n\t\tnumbers.stream().sorted()\n .forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\t\t\n//03 sort Strings-- by default is natural order\t\t\n\t\tcourses.stream().sorted()\n .forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\n//04 sort Strings- user Comparator--- sort(Comparator)\n\t/*Comparators can be passed to a sort method (such as Collections.\n\t * sort or Arrays.sort) to allow precise control over the sort order. \n\t */\t\n\t \tcourses.stream().sorted(Comparator.naturalOrder())\n\t .forEach(System.out::println);\n\t \t System.out.println(\"---------------------------------------\");\n\t \t\n//05 Comparator calss -Sort string reverse order \n\t \tcourses.stream().sorted(Comparator.reverseOrder())\n .forEach(System.out::println);\n\t \t System.out.println(\"---------------------------------------\");\n\t \t\n//06 Comparator(lambda)-Sort String- based on string length\n\t \t//05 Sort string reverse order \n\t \tcourses.stream().sorted(Comparator.comparing(x->x.length())).forEach(System.out::println);\n\t \t System.out.println(\"---------------------------------------\");\n\n//07 sort string - based on last char\t \t\n\t\tcourses.stream().\n\t\tsorted((str1, str2) -> \n\t\tCharacter.compare(str1.charAt(str1.length() - 1),str2.charAt(str2.length() - 1)))\n . forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\t\n//08 sort Book list based on year of release\n\t\tBook book=new Book();\n\t\t Book.bookList.stream()\n\t\t\t\t .sorted(Comparator.comparingLong(Book::getReleaseYear)).forEach(System.out::println);\n\t\t \n\t\t // .sorted((o1, o2) -> (o1 - o2.getSalary())).collect(Collectors.toList());\n\t\t //.out.println(bookSortedList1);\n\t\t System.out.println(\"---------------------------------------\");\n\t\t \n\t\t \n //08 sort Book list based on year of release\n\t\t \n\t\t Book.bookList.stream()\n\t\t\t\t .sorted((o1, o2) -> (o1.getReleaseYear() - o2.getReleaseYear())).forEach(System.out::println); \n\n\t\t \n//Reversed order\n\t\t\t Comparator<Book> comparator_reversed_order = Comparator.comparingLong(Book::getReleaseYear).reversed();\n\t\t\tBook.bookList.stream()\n\t\t\t\t\t .sorted(comparator_reversed_order).forEach(System.out::println); \n//\t\tBook book=new Book();\n\t\t\t Book.bookList.stream()\n\t\t\t\t .sorted(Comparator.comparingLong(Book::getReleaseYear)).forEach(System.out::println);\n\t\n//\tIf this Comparator considers two elements equal, i.e. compare(a, b) == 0, other is used to determine the order. \n//comparator1.thenComparing(comparator2)\n\t\t\t \n\t}", "private static void multipleSortOfFinalPlayerList() {\n\n sortedFinalPlayerList = new ArrayList<>();\n\n Comparator<Player> byLastName = (e1, e2) -> e1\n .getLastName().compareTo(e2.getLastName());\n\n Comparator<Player> byFirstName = (e1, e2) -> e1\n .getFirstName().compareTo(e2.getFirstName());\n\n Comparator<Player> byCountry = (e1, e2) -> e1\n .getCountry().compareTo(e2.getCountry());\n\n streamPlayerList.stream().sorted(byLastName.thenComparing(byFirstName).thenComparing(byCountry))\n .forEach(e -> System.out.print(e));\n Stream<Player> f = streamPlayerList.stream().sorted(byLastName.thenComparing(byFirstName).thenComparing(byCountry));\n f.forEach(r -> sortedFinalPlayerList.add(r));\n }", "public static void main(String[] args) {\n\r\n\t\tList<Library> list=new ArrayList<Library>();\r\n\t\tlist.add(new Library(100, \"bhagyesh\"));\r\n\t\tlist.add(new Library(4, \"patel\"));\r\n\t\tlist.add(new Library(5, \"sid\"));\r\n\t\tlist.add(new Library(78, \"naitik\"));\r\n\t\tlist.add(new Library(39, \"amit\"));\r\n\t\t\r\n \tlist.stream().forEach(p -> System.out.println(p.getName()));\r\n \tlist.sort(Comparator.comparing(Library::getName));\r\n \tlist.stream().forEach(p -> System.out.println(p.getName()));\r\n \r\n \t\r\n \t\r\n \t\r\n\t}", "@Override\n public List<Client> clientsSortedByMoneySpent(){\n log.trace(\"clientsSortedByMoneySpent -- method entered\");\n Iterable<Client> clients = clientRepository.findAll();\n List<Client> result = StreamSupport.stream(clients.spliterator(),false).sorted(Comparator.comparing(Client::getMoneySpent).reversed()).collect(Collectors.toList());\n log.trace(\"clientsSortedByMoneySpent: result={}\", result);\n return result;\n }", "public static void main(String[] args) {\n\n\tBankAccount2 gil = new BankAccount2(\"Gil\",500);\n\tBankAccount2 joe = new BankAccount2(\"Joe\",1000);\n\tBankAccount2 fred = new BankAccount2(\"Fred\",2000);\n\tBankAccount2 sally = new BankAccount2(\"Sally\",2500);\n\tArrayList<BankAccount2> accountList= new ArrayList<>();\n\taccountList.add(gil);\n\taccountList.add(joe);\n\taccountList.add(fred);\n\tfor(BankAccount2 Account:accountList)\n\t{\n\t\tSystem.out.println(Account.getAccount());\n\t}\n\taccountList.add(sally);\n\t\n\tdouble highBal = 0;\n\tString info = \" \";\n\tfor(BankAccount2 Account:accountList)\n\t{\n\t\tif(Account.getBalance() > highBal)\n\t\t{\n\t\t\thighBal = Account.getBalance();\n\t\t\tinfo = Account.getAccount();\n\t\t}\n\t}\n\t\n\tfor(BankAccount2 Account:accountList)\n\t{\n\t\tif(Account.getBalance() > highBal)\n\t\t{\n\t\t\thighBal = Account.getBalance();\n\t\t\tinfo = Account.getAccount();\n\t\t}\n\t}\n\t\n\tSystem.out.println(\"The account with the highest balance once Sally is added is: \"+info);\n\taccountList.remove(sally);\n\t\n\thighBal = 0;\n\tinfo = \" \";\n\tfor(BankAccount2 Account:accountList)\n\t{\n\t\tif(Account.getBalance() > highBal)\n\t\t{\n\t\t\thighBal = Account.getBalance();\n\t\t\tinfo = Account.getAccount();\n\t\t}\n\t}\n\t\n\tSystem.out.println(\"The account with the highest balance once Sally is removed is: \"+ info);\n\t\n\t\n\t}", "@Test\n public void testCreateComparatorByBalance() {\n System.out.println(\"createComparatorByName\");\n // in decreasing order\n boolean increasing = false;\n BankAccount instance = new BankAccount(\"Kelly\", 99.99);\n BankAccount instance2 = new BankAccount(\"Nelly\", 199.99);\n int result = BankAccount.createComparatorByBalance(increasing).compare(instance, instance2);\n assertTrue(result > 0);\n int result2 = BankAccount.createComparatorByBalance(increasing).compare(instance2, instance);\n assertTrue(result2 < 0);\n // in increasing order\n increasing = true;\n int result3 = BankAccount.createComparatorByBalance(increasing).compare(instance2, instance);\n assertTrue(result3 > 0);\n }", "private void sortByLastName() { \r\n\t\tfor ( int i = 0; i < size-1; i++) {\r\n\t\t\tint minIndex = i; \r\n\t\t\tfor(int j = i + 1; j < size; j++) {\r\n\t\t\t\tif ( accounts[j].getHolder().getLname().compareTo(accounts[minIndex].getHolder().getLname()) < 0 ) { \r\n\t\t\t\t\tSystem.out.println(accounts[j].getHolder().getLname());\r\n\t\t\t\t\tminIndex = j;\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t\tAccount temp = accounts[minIndex];\r\n\t\t\taccounts[minIndex] = accounts[i];\r\n\t\t\taccounts[i] = temp;\r\n\t\t}\r\n\t\treturn;\r\n\t}", "public static void main(String[] args) {\n\t\tArrayList<Employee> list= new ArrayList<Employee>();\n\t\t\n\t\tlist.add(new Employee(3,6000,\"vinod\"));\n\t\tlist.add(new Employee(6,7500,\"Rangu\"));\n\t\tlist.add(new Employee(1,9000,\"kittu\"));\n\t\tlist.add(new Employee(5,5000,\"bunny\"));\n\t\t\n\t\tCollections.sort(list, new NameComparator());\n\t\t\n\t\tIterator it = list.iterator();\n\t\t\n\t\twhile(it.hasNext()){\n\t\t\tEmployee emp = (Employee)it.next();\n\t\t\tSystem.out.println(emp.id+\" \"+emp.salaray+\" \"+emp.name);\n\t\t\t\n\t\t\t/*Collections.sort(list, new SalaryComparator());\n\t\t\t\n\t\t\tIterator it = list.iterator();\n\t\t\t\n\t\t\twhile(it.hasNext()){\n\t\t\t\tEmployee emp = (Employee)it.next();\n\t\t\t\tSystem.out.println(emp.id+\" \"+emp.salaray+\" \"+emp.name);\n\t\t}*/\n\t}\n\t}", "public static void main(String[] args) {\n\t\tList<Employee> empList = new ArrayList<>();\r\n\t\tempList.add(new Employee(\"Rashim\", \"SDFSDFJLK\", 52));\r\n\t\tempList.add(new Employee(\"Amit\", \"JLKSDFJKLL79989\", 67));\r\n\t\tempList.add(new Employee(\"Ranjit\", \"ASDFJLKSJLF78676\", 45));\r\n\t\tempList.add(new Employee(\"Shymala\", \"SDFJLSJU8907\", 34));\r\n\t\t\r\n\t\t\r\n//\t\tfirst select only employees whose salary is greater than 50\r\n//\t\tand sort the employees based on their names (ignore case)\r\n//\t\tand print each employee of the stream.\r\n\t\tempList.stream().filter(emp -> emp.getSalary() > 50).sorted((e1, e2) -> e1.getName().compareToIgnoreCase(e2.getName())).forEach(emp -> System.out.println(emp));\r\n\t}", "private void sortByDateOpen() { // sort in ascending order\n\t\tint numAccounts = size;\n\t\tDate firstDateOpen;\n\t\tDate secondDateOpen;\n\t\t\n\t\tfor (int i = 0; i < numAccounts-1; i++) {\n\t\t\t\n\t\t\t\n\t\t\tint min_idx = i;\n\t\t\t\n\t\t\t\n\t\t\tfor (int j = i+1; j < numAccounts; j++) {\n\t\t\t\t\n\t\t\t\t// Retrieve last name of two that you are comparing\n\t\t\t\tfirstDateOpen = accounts[j].getDateOpen();\n\t\t\t\tsecondDateOpen = accounts[min_idx].getDateOpen();\n\t\t\t\t\n\t\t\t\tif (firstDateOpen.compareTo(secondDateOpen) < 0) {\n\t\t\t\t\tmin_idx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tAccount temp = accounts[min_idx];\n\t\t\taccounts[min_idx] = accounts[i];\n\t\t\taccounts[i] = temp;\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n\n Person person1 = new Person(\"Tom Brady\");\n Person person2 = new Person(\"David Letterman\");\n\n List<Person> personList = new ArrayList<Person>();\n personList.add(person1);\n personList.add(person2);\n\n // Sorting\n // Collections.sort(personList, new PersonComparer());\n // Collections.sort(personList, (o1, o2) -> o1.getName().compareTo(o2.getName()));\n personList.sort((o1, o2) -> o1.getName().compareTo(o2.getName()));\n\n // Print out the people!\n for (Person p : personList)\n {\n System.out.println(p.getName());\n }\n\n }", "public static void main(String[] args) {\n\t\tList<Person> personList = Arrays.asList( new Person(\"narendra\", \"nirala\", 27), \r\n\t\t\t\tnew Person(\"pankaj\", \"yadav\", 27),\r\n\t\t\t\tnew Person(\"sanjay\", \"sahu\", 28),\r\n\t\t\t\tnew Person(\"prakash\", \"solemn\", 27),\r\n\t\t\t\tnew Person(\"bhagwat\", \"chandra\", 30));\r\n\t\t\r\n\t\t\r\n\t\tComparator<Person> comp = new Comparator<Person>() {\t\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(Person p1, Person p2) {\r\n\t\t\t\treturn p1.getFirstName().compareTo(p2.getFirstName());\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\tCollections.sort(personList, comp);\r\n\t\t\r\n\t\tSystem.out.println(personList);\r\n\t\t\r\n\t\t//------Java 8 way\r\n\t\tList<Person> personList2 = Arrays.asList( new Person(\"narendra\", \"nirala\", 27), \r\n\t\t\t\tnew Person(\"pankaj\", \"yadav\", 27),\r\n\t\t\t\tnew Person(\"sanjay\", \"sahu\", 28),\r\n\t\t\t\tnew Person(\"prakash\", \"solemn\", 27),\r\n\t\t\t\tnew Person(\"bhagwat\", \"chandra\", 30));\r\n\t\t\r\n\t\tCollections.sort(personList2, (person1,person2) -> person1.getFirstName().compareTo(person2.getFirstName()));\r\n\t\tSystem.out.println(personList2);\r\n\t\t\r\n\t\t\r\n\t\t//---------------------------Task 2 - print all elements\r\n\t\tSystem.out.println(\"-------------Task 2 - print all elements------------------\");\r\n\t\t// java 8 way 1\r\n\t\tpersonList2.forEach(System.out::println);\r\n\t\t\r\n\t\t// java 8 way 2\r\n\t\t\r\n\t\tpersonList2.forEach(s -> System.out.println(s));\r\n\t\t\r\n\t\t//------------------------Task 3 - Print conditionally and define what to do if condition satisfied\r\n\t\t// Java 8 way\r\n\t\tSystem.out.println(\"----------Task 3 - Print conditionally---------------------\");\r\n\t\tprintConditionally(personList, p -> p.getFirstName().startsWith(\"b\") , p -> System.out.println(p.getFirstName().toUpperCase()));\r\n\t\tprintConditionally(personList, p -> p.getLastName().startsWith(\"s\"), p -> System.out.println(p.getFirstName().toUpperCase()));\r\n\t\t\r\n\t}", "private void sortByLastName() { \n\t\t\n\t\tint numAccounts = size;\n\t\tString firstHolder_lname;\n\t\tString secondHolder_lname;\n\t\t\n\t\tfor (int i = 0; i < numAccounts-1; i++) {\n\t\t\t\n\t\t\t\n\t\t\tint min_idx = i;\n\t\t\t\n\t\t\t\n\t\t\tfor (int j = i+1; j < numAccounts; j++) {\n\t\t\t\t\n\t\t\t\t// Retrieve last name of two that you are comparing\n\t\t\t\tfirstHolder_lname = (accounts[j].getHolder()).get_lname();\n\t\t\t\tsecondHolder_lname = (accounts[min_idx].getHolder()).get_lname();\n\t\t\t\t\n\t\t\t\tif (firstHolder_lname.compareTo(secondHolder_lname) < 0) {\n\t\t\t\t\tmin_idx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tAccount temp = accounts[min_idx];\n\t\t\taccounts[min_idx] = accounts[i];\n\t\t\taccounts[i] = temp;\n\n\t\t\t\n\t\t}\n\t}", "public void sortBalance() {\n for (int i=0; i < accounts.size() - 1; i++) {\n int posicao_menor = i;\n \n for (int j=i + 1; j < accounts.size(); j++) { // Cada iteração vai acumulando (a esquerda) a área ordenada.\n if (accounts.get(j).getBalance() < accounts.get(posicao_menor).getBalance())\n posicao_menor = j;\n }\n \n // Troca (swap)\n BankAccount temp = accounts.get(i); \n accounts.set(i, accounts.get(posicao_menor)); \n accounts.set(posicao_menor, temp);\n }\n }", "private static Comparator<Person> comparator(CrudFilter filter) {\n return filter.getSortOrders().entrySet().stream()\n .map(sortClause -> {\n try {\n Comparator<Person> comparator\n = Comparator.comparing(person ->\n (Comparable) valueOf(sortClause.getKey(), person));\n\n if (sortClause.getValue() == SortDirection.DESCENDING) {\n comparator = comparator.reversed();\n }\n\n return comparator;\n } catch (Exception ex) {\n return (Comparator<Person>) (o1, o2) -> 0;\n }\n })\n .reduce(Comparator::thenComparing)\n .orElse((o1, o2) -> 0);\n }", "public static void main(String[] args) {\n\t\tList<Developer> listDevs = getDevelopers();\r\n\r\n\t\tSystem.out.println(\"Before Sort\");\r\n\t\tfor (Developer developer : listDevs) {\r\n\t\t\tSystem.out.println(developer.getName());\r\n\t\t}\r\n\t\t\r\n\t\tlistDevs.sort( new Comparator<Developer>(){\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(Developer o1, Developer o2) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\treturn o2.getAge()-o1.getAge();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tlistDevs.sort((Developer o1, Developer o2) -> o1.getName().compareTo(o2.getName()));\r\n\t\t\r\n\t\tSystem.out.println(\"Aftrer Sort\");\r\n\t\tfor (Developer developer : listDevs) {\r\n\t\t\tSystem.out.println(developer.getName());\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\":::::::::::::::\");\r\n\t\tList<String> lines = Arrays.asList(\"spring\", \"node\", \"mkyong\",\"spring\",\"spring\");\r\n\t\t\r\n\t\tlines.stream().filter(line -> line.equals(\"spring\")).forEach(line -> System.out.println(\"line::\"+line));\r\n\t\tSystem.out.println(\":::::::::::::::\");\r\n\t\tMap<String, Long> result = lines.stream().collect(Collectors.groupingBy(Function.identity(),Collectors.counting()));\r\n\t\t\r\n\t\tSystem.out.println(\":::::::::::::::\");\r\n\t\t//System.out.println(result.entrySet().stream().sorted(Map.Entry.<String,Integer>comparingByKey().reversed()).);\r\n\t\t\r\n\t\tStream<String> language = Stream.of(\"java\", \"python\", \"node\", null, \"ruby\", null, \"php\");\r\n\t\tList langList = language.collect(Collectors.toList());\r\n\t\tlangList.forEach(new Consumer<String>()\r\n\t\t{\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void accept(String t) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tif(t!=null)\r\n\t\t\t\tSystem.out.println(\"length::\"+t.length());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tlangList.forEach(x -> System.out.println(\"value of x::\"+x));\r\n\t\t\r\n\t}", "public static void main(String args[]) {\n Order ord1 = new Order(101, 203.34f, \"11/19/2017\", \"11/20/2017\", \"Sony\");\n Order ord2 = new Order(102, 439.49f, \"11/19/2017\", \"11/20/2017\",\"Hitachi\");\n Order ord3 = new Order(103, 611.31f,\"11/19/2017\", \"11/20/2017\", \"Philips\");\n\n //putting Objects into Collection to sort\n List<Order> orders = new ArrayList<Order>();\n orders.add(ord3);\n orders.add(ord1);\n orders.add(ord2);\n orders.add(ord3);\n orders.add(ord1);\n\n //printing unsorted collection\n System.out.println(\"Unsorted Collection : \" + orders);\n\n UniqueList( orders );\n //Sorting Order Object on natural order - ascending\n Collections.sort(orders);\n\n //printing sorted collection\n System.out.println(\"List of UNIQUE Order object sorted in natural order : \" + orders);\n\n // Sorting object in descending order in Java\n Collections.sort(orders, Collections.reverseOrder());\n System.out.println(\"List of object sorted in descending order : \" + orders);\n\n //Sorting object using Comparator in Java\n Collections.sort(orders, new Order.OrderByAmount());\n System.out.println(\"List of Order object sorted using Comparator - amount : \" + orders);\n\n // Comparator sorting Example - Sorting based on customer\n Collections.sort(orders, new Order.OrderByVendor());\n System.out.println(\"Collection of Orders sorted using Comparator - by vendor : \" + orders);\n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\tList<Student> students = new ArrayList<>();\r\n\t\t\r\n\t\tstudents.add(new Student(23, \"Aryan\"));\r\n\t\tstudents.add(new Student(23, \"Jeet\"));\r\n\t\tstudents.add(new Student(83, \"Dhruv\"));\r\n\t\tstudents.add(new Student(13, \"Amit\"));\r\n\t\tstudents.add(new Student(65, \"Aditya\"));\r\n\t\tstudents.add(new Student(57, \"Jeet\"));\r\n\t\t\r\n//\t\tCollections.sort(students);\r\n\t\t\r\n//\t\tCollections.sort(students, new SortByNameThenMarks());\t// We passed our own comparator object.\r\n\t\t\r\n\t\t// We can have our own anonymous comparator without making a class. We can do that so by doing the following:\r\n\t\t\r\n//\t\tCollections.sort(students, new Comparator<Student>() {\r\n//\r\n//\t\t\t@Override\r\n//\t\t\tpublic int compare(Student obj1, Student obj2) {\r\n//\t\t\t\tif(obj1.name.equals(obj2)) return obj1.marks - obj2.marks;\r\n//\t\t\t\treturn obj1.name.compareTo(obj2.name);\r\n//\t\t\t}\r\n//\t\t\t\r\n//\t\t});\r\n\t\t\r\n\t\t// With the help of Lambda we could cut short the lines but we have to mention the sign \"->\".\r\n//\t\tCollections.sort(students,(Student obj1, Student obj2) -> {\r\n\t\t\r\n//\t\tCollections.sort(students,(obj1, obj2) -> {\r\n//\t\t\t\tif(obj1.name.equals(obj2)) return obj1.marks - obj2.marks;\r\n//\t\t\t\treturn obj1.name.compareTo(obj2.name);\r\n//\t\t\t});\r\n\t\t\r\n//\t\tCollections.sort(students, (obj1, obj2) -> obj1.name.compareTo(obj2.name));\r\n\t\t\r\n//\tThe comparator SortByNameThenMarks can be written in one line as follows. Also \".reversed()\" is used to reverse the order of comparison.\r\n\t\tCollections.sort(students, Comparator.comparing(Student::getName).thenComparing(Student::getMarks).reversed());\r\n\t\t\r\n\t\tstudents.forEach(System.out::println);\t// This is lambda expression to print \r\n\t}", "public static void main(String[] args) {\n\t\tList<List<String>> activityList = Student.getListOfStudents().stream().map(Student::getActivities)\n\t\t\t\t.collect(Collectors.toList());\n\t\tSystem.out.println(activityList);\n\n\t\t// Flat Map Demo\n\t\tList<String> activityList1 = Student.getListOfStudents().stream().map(Student::getActivities)\n\t\t\t\t.flatMap(List::stream).collect(Collectors.toList());\n\t\tSystem.out.println(activityList1);\n\n\t\t// Distinct element form stream\n\t\tList<String> distictActivityList = Student.getListOfStudents().stream().map(Student::getActivities)\n\t\t\t\t.flatMap(List::stream).distinct().collect(Collectors.toList());\n\t\tSystem.out.println(distictActivityList);\n\n\t\t// Count number of elements after manipulation\n\t\tlong activityCount = Student.getListOfStudents().stream().map(Student::getActivities).flatMap(List::stream)\n\t\t\t\t.distinct().count();\n\t\tSystem.out.println(\"Activity Count : \" + activityCount);\n\n\t\t// Comparator Traditional\n\t\tList<String> studentNameList = Student.getListOfStudents().stream().map(Student::getStudentName)\n\t\t\t\t.sorted((i1, i2) -> i1.compareTo(i2)).collect(Collectors.toList());\n\t\tSystem.out.println(studentNameList);\n\n\t\t// Comparator Using Stream\n\t\tList<String> studentNamecomparator = Student.getListOfStudents().stream()\n\t\t\t\t.sorted(Comparator.comparing(Student::getStudentName)).map(Student::getStudentName)\n\t\t\t\t.collect(Collectors.toList());\n\t\tSystem.out.println(studentNamecomparator);\n\n\t\t// Comparator Using Stream\n\t\tList<String> studentNamecomparatorReverseOrder = Student.getListOfStudents().stream()\n\t\t\t\t.sorted(Comparator.comparing(Student::getStudentName).reversed()).map(Student::getStudentName)\n\t\t\t\t.collect(Collectors.toList());\n\t\tSystem.out.println(studentNamecomparatorReverseOrder);\n\n\t}", "private void printAllOwners(ArrayList<String> ownerList){\n for(int i = 0; i < ownerList.size(); i++){\n System.out.println(ownerList.get(i));\n }\n }", "public static void main(String[] args) {\n\t\tList<Employee> list = new ArrayList<Employee>();\r\n\t\tlist.add(new Employee(\"Ashish\", new Integer(37), new Double(373727)));\r\n\t\tlist.add(new Employee(\"Ashish\", new Integer(37), new Double(373)));\r\n\t\tlist.add(new Employee(\"Rakesh\", new Integer(37), new Double(373727)));\r\n\r\n\t\tlist.add(new Employee(\"Sakal\", new Integer(25), new Double(3434737)));\r\n\t\tlist.add(new Employee(\"Manish\", new Integer(26), new Double(373727)));\r\n\t\tlist.add(new Employee(\"Manish\", new Integer(37), new Double(373727)));\r\n\r\n\t\t// In collections class one sort method is there which taking two\r\n\t\t// argument\r\n\t\t// one list one one comparator type so here\r\n\t\t// SortBasedOnNameAgeAndSalary is comparator type note: sortimg in\r\n\t\t// assending\r\n\r\n\t\tCollections.sort(list, new SortBasedOnNameAgeAndSalary());\r\n\t\tSystem.out.println(\"after Sorting\" + list);\r\n\t\t// Here i am iterating list and getting sorted result\r\n\t\tfor (Employee employee : list) {\r\n\t\t\tSystem.out.println(employee);\r\n\t\t}\r\n\t}", "public static void main(String[] args){\n\n List<Student> arrList = new ArrayList<>(); // arraylist of our own class type\n arrList.add(new Student(111, \"bbb\", \"London\"));\n arrList.add(new Student(222,\"aaa\", \"nyc\"));\n arrList.add(new Student(333, \"ccc\", \"Jaipur\"));\n\n System.out.println(\"Unsorted list : \");\n for (Student student : arrList)\n System.out.println(student);\n\n // Sort the arrayList based on roll no\n Collections.sort(arrList, new Sortbyroll());\n\n System.out.println(\"Sorted by rollNo : \");\n for(Student student : arrList)\n System.out.println(student);\n\n // Sort the arrayList based on name\n Collections.sort(arrList, new Sortbyname());\n\n System.out.println(\"Sorted by name : \");\n for (int i=0; i<arrList.size(); i++)\n System.out.println(arrList.get(i));\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tArrayList <Person> employee_list = new ArrayList <>();\r\n\r\n//taking input for the file name\r\n\t\tSystem.out.println(\"Please enter the name of the file (with the extension) that you want to process: \");\r\n\t\tScanner sc= new Scanner(System.in);\r\n\t\tString file_name=sc.nextLine();\r\n\t\t\r\n//opening and reading the file\r\n\t\t\r\n\t\ttry {\r\n List<String> empl_Lines = Files.readAllLines(java.nio.file.Paths.get(file_name), StandardCharsets.UTF_8);\r\n for (String line: empl_Lines) {\r\n \t String[] tokens = line.split(\",\");\r\n \temployee_list.add((Person)Employee.parse(line));\r\n }\r\n }\r\n\t\tcatch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\t\t\r\n System.out.println(\"Showing the data in the unsorted format\");\r\n System.out.println();\r\n for(Person emp: employee_list) {\r\n \tSystem.out.println(emp);\r\n }\r\n System.out.println();\r\n\r\n//sorting the employee list based on their IDs in ascending order\r\n \r\n Object[] person_array = employee_list.toArray();\r\n Arrays.sort(person_array, (a,b) -> (\"\"+((Person) a).getID()).compareTo(((Person) b).getID()));\r\n System.out.println(\"Sorting the array by the people's ID:\");\r\n System.out.println();\r\n Stream<Object> stream1 = Arrays.stream(person_array);\r\n stream1.forEach(System.out::println);\r\n System.out.println();\r\n \r\n\t\t\r\n//sorting the employee list alphabetically based on their first name\r\n System.out.println(\"Sorting based on First names: \");\r\n System.out.println();\r\n Arrays.sort(person_array, (a,b) -> (\"\"+((Person) a).getFirstName()).compareTo(\"\"+((Person) b).getFirstName())); \r\n Stream<Object> stream2 = Arrays.stream(person_array);\r\n stream2.forEach(System.out::println);\r\n System.out.println();\r\n \r\n//sorting the employee list alphabetically based on their last name, if same last name, then sorting based on first name\r\n System.out.println(\"Sorting based on Last names: \");\r\n System.out.println();\r\n Arrays.sort(person_array, (a,b) -> (\"\"+((Person) a).getLastName()).compareTo(\"\"+((Person) b).getLastName())); \r\n Arrays.sort(person_array, (a, b) -> {\r\n \tint ck = (\"\" + ((Person) a).getLastName()).compareTo(\"\" + ((Person) b).getLastName()); // lastName\r\n \treturn ck != 0? ck:\r\n \t(\"\" + ((Person) a).getFirstName()).compareTo(\"\" + ((Person) b).getFirstName()); // then firstFame\r\n \t});\r\n\r\n Stream<Object> stream3 = Arrays.stream(person_array);\r\n stream3.forEach(System.out::println);\r\n System.out.println(); \r\n\t\t\r\n//showing the total average and the number of the total employees using a stream\r\n\t\t\t\tObject[] empl_array= employee_list.toArray();\r\n\t\t\t\tStream<Object> stream = Arrays.stream(empl_array);\r\n\t\t\t\tdouble avg= stream.mapToDouble(e->((Employee) e).getSalary().doubleValue()).average().getAsDouble();\r\n\t\t\t\tBigDecimal avg_sal= new BigDecimal(avg);\r\n\t\t\t\tSystem.out.print(\"The average salary is: \");\r\n\t\t\t\tSystem.out.printf(\"%.2f\", avg_sal);\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tSystem.out.println(\"The total number of employees is: \"+ empl_array.length);\r\n\t\t\t\tSystem.out.println();\r\n \t\t \r\n//grouping the employees based on their salary range\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\tMap<Object, DoubleSummaryStatistics> result = employee_list.stream()\r\n\t\t\t\t\t\t\t.collect(Collectors.groupingBy(emp -> \r\n\t\t\t\t\t\t\t\t\t ((Employee) emp).getSalary().doubleValue() < 25000 ? \"<25000\" :\r\n\t\t\t\t\t\t\t\t ((Employee) emp).getSalary().doubleValue() < 40000 ? \"25000-40000\" :\r\n\t\t\t\t\t\t\t\t ((Employee) emp).getSalary().doubleValue() < 70000 ? \"40000-70000\" :\r\n\t\t\t\t\t\t\t\t\t ((Employee) emp).getSalary().doubleValue() > 70000 ? \">70000\" : \">70000\",\r\n\t\t\t\t\t\t\t\t Collectors.summarizingDouble(emp -> ((Employee) emp).getSalary().doubleValue())));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\tDoubleSummaryStatistics sal_25 = result.get(\"<25000\");\r\n\t\t\t\tdouble avg_25 = sal_25 == null ? 0.0 : sal_25.getAverage();\r\n\t\t\t\tSystem.out.println(\"<25000 --> employee count: \" + sal_25.getCount() + \" --> avg salary: \" + String.format(\"%.2f\",avg_25));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\tDoubleSummaryStatistics sal_25_40 = result.get(\"25000-40000\");\r\n\t\t\t\tdouble avg_25_40 = sal_25_40 == null ? 0.0 : sal_25_40.getAverage();\r\n\t\t\t\tSystem.out.println(\"25000-40000 --> employee count: \" + sal_25_40.getCount() + \" --> avg salary: \" + String.format(\"%.2f\",avg_25_40));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\tDoubleSummaryStatistics sal_40_70 = result.get(\"40000-70000\");\r\n\t\t\t\tdouble avg_40_70 = sal_40_70 == null ? 0.0 : sal_40_70.getAverage();\r\n\t\t\t\tSystem.out.println(\"40000-70000 --> employee count: \" + sal_40_70.getCount() + \" --> avg salary: \" + String.format(\"%.2f\",avg_40_70));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\tDoubleSummaryStatistics sal_70 = result.get(\">70000\");\r\n\t\t\t\tdouble avg_70 = sal_70 == null ? 0.0 : sal_70.getAverage();\r\n\t\t\t\tSystem.out.println(\">70000 --> employee count: \" + sal_70.getCount() + \" --> avg salary: \" + String.format(\"%.2f\",avg_70));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t}", "public void printOwners(){\n ArrayList<String> ownerList = new ArrayList<String>();\n\n for(RegistrationPlate plates: this.registrationList.keySet()){\n if(!ownerList.contains(this.registrationList.get(plates)))\n ownerList.add(this.registrationList.get(plates));\n }\n\n printAllOwners(ownerList);\n }", "public static void main(String[] args) {\n\t\tStud1 s1=new Stud1(1,\"Yogi\");\r\n\t\tStud1 s2=new Stud1(4,\"Rushi\");\r\n\t\tStud1 s3=new Stud1(2,\"Praje\");\r\n\t\tStud1 s4=new Stud1(3,\"Amre\");\r\n\t\t\r\n\t\tList l=new ArrayList();\r\n\t\tl.add(s1);\r\n\t\tl.add(s2);\r\n\t\tl.add(s3);\r\n\t\tl.add(s4);\r\n\t\t\r\n\t\tSystem.out.println(l);\r\n\t\t\r\n\t\tCollections.sort(l);\r\n\t\t\r\n\t\tEnumeration e=Collections.enumeration(l);\r\n\t\t\r\n\t\twhile(e.hasMoreElements())\r\n\t\t{\r\n\t\t\tObject o=e.nextElement();\r\n\t\t\tSystem.out.println(o);\r\n\t\t}\r\n\r\n\t}", "private void sortInvestors(int sortingOrder) {\n\t\tList<Loan> loanList = investmentMap.keySet().stream().sorted().collect(Collectors.toList());\n\t\t\n\t\tfor(Loan l : loanList) {\n\t\t\tList<Investor> investorList = investmentMap.get(l); //List of Investors that are eligible to invest in Loan l after rules have been applied\n\t\t\t\n\t\t\t//Sorts Investors by the chosen Sorting Style\n\t\t\tinvestorList = sortInvestors(investorList, sortingOrder);\n\t\t\t\n\t\t\ttemporaryInvestors = new HashMap<>();\n\t\t\tlong originalLoan = l.getLoanAmount();\n\t\t\t\n\t\t\tfor(Investor i : investorList) {\n\t\t\t\tif(i.getInvestmentAmount() == 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i.getInvestmentAmount() >= l.getLoanAmount()) {\t\t//If the investor has more (or equal) number of funds than the loan is requesting\n\t\t\t\t\ti.setInvestmentAmount(i.getInvestmentAmount() - l.getLoanAmount()); \t//Change the remaining amount of funds available to invest\n\t\t\t\t\tl.addInvestor(i, l.getLoanAmount()); \t//Add the investor to the given Loan, as well as the amount invested\n\t\t\t\t\ti.setInvestments(l, l.getLoanAmount());\t //Add the loan to the given investor\n\t\t\t\t\tl.setLoanAmount(0); \t//Set the outstanding loan amount to 0\n\t\t\t\t\tl.setLoanGiven(true); \t//Set loanGiven boolean to true - Loan has been successfully been matched\n\t\t\t\t\tbreak; //Continue to next loan\n\t\t\t\t} else {\n\t\t\t\t\ttemporaryInvestors.put(i, i.getInvestmentAmount());\t\t//Place the current investor and amount invested into temporary storage\n\t\t\t\t\ti.setInvestments(l, i.getInvestmentAmount());\n\t\t\t\t\tl.addInvestor(i, i.getInvestmentAmount());\n\t\t\t\t\tlong remainingInvestment = i.getInvestmentAmount() - l.getLoanAmount();\n\t\t\t\t\tl.setLoanAmount(l.getLoanAmount() - i.getInvestmentAmount());\n\t\t\t\t\tif(remainingInvestment > 0) {\t//If the investor has funds left after investing\n\t\t\t\t\t\ti.setInvestmentAmount(remainingInvestment);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ti.setInvestmentAmount(0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//If after all eligible investors have been accounted for, and the loan hasn't been matched\n\t\t\t//Remove the temporary investors\n\t\t\tif(!l.loanGiven() && l.getInvestorList().size() > 0) {\n\t\t\t\tremoveUnfundedInvestors(l, investorList);\n\t\t\t\tl.setLoanAmount(originalLoan);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "private void showCourtBookings()\n {\n ArrayList<Court> courtList = new ArrayList<Court>();\n ArrayList<Booking> bookingList = new ArrayList<Booking>();\n for(Sport sObj : sportsClub.sportList)\n {\n System.out.println(\"Displaying Courts for : \" + sObj.getSportName());\n courtList = sObj.getCourtList();\n for(Court cObj : courtList)\n { \n if(cObj.getCourtBookings().size()==0)\n System.out.println(\"Booking are not yet started for sport :\" + sObj.getSportName() + \" on Court : \" + cObj.getCourtId());\n else\n { \n\n Collections.sort(cObj.getCourtBookings());\n System.out.println(cObj.getCourtBookings().toString());\n\n } \n }\n } \n }", "private void listBalances() {\n\t\t\r\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\tSystem.out.println(\"-------1. Stream filter() example---------\");\r\n\t\t//We can use filter() method to test stream elements for a condition and generate filtered list.\r\n\t\t\r\n\t\tList<Integer> myList = new ArrayList<>();\r\n\t\tfor(int i=0; i<100; i++) myList.add(i);\r\n\t\tStream<Integer> sequentialStream = myList.stream();\r\n\r\n\t\tStream<Integer> highNums = sequentialStream.filter(p -> p > 90); //filter numbers greater than 90\r\n\t\tSystem.out.print(\"High Nums greater than 90=\");\r\n\t\thighNums.forEach(p -> System.out.print(p+\" \"));\r\n\t\t//prints \"High Nums greater than 90=91 92 93 94 95 96 97 98 99 \"\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"-------2. Stream map() example---------\");\r\n\t\t//We can use map() to apply functions to an stream\r\n\t\tStream<String> names = Stream.of(\"aBc\", \"d\", \"ef\");\r\n\t\tSystem.out.println(names.map(s -> {\r\n\t\t\t\treturn s.toUpperCase();\r\n\t\t\t}).collect(Collectors.toList()));\r\n\t\t//prints [ABC, D, EF]\r\n\t\t\r\n\t\tSystem.out.println(\"-------3. Stream sorted() example---------\");\r\n\t\t//We can use sorted() to sort the stream elements by passing Comparator argument.\r\n\t\tStream<String> names2 = Stream.of(\"aBc\", \"d\", \"ef\", \"123456\");\r\n\t\tList<String> reverseSorted = names2.sorted(Comparator.reverseOrder()).collect(Collectors.toList());\r\n\t\tSystem.out.println(reverseSorted); // [ef, d, aBc, 123456]\r\n\r\n\t\tStream<String> names3 = Stream.of(\"aBc\", \"d\", \"ef\", \"123456\");\r\n\t\tList<String> naturalSorted = names3.sorted().collect(Collectors.toList());\r\n\t\tSystem.out.println(naturalSorted); //[123456, aBc, d, ef]\r\n\t\t\r\n\t\tSystem.out.println(\"-------4. Stream flatMap() example---------\");\r\n\t\t//We can use flatMap() to create a stream from the stream of list.\r\n\t\tStream<List<String>> namesOriginalList = Stream.of(\r\n\t\t\t\tArrays.asList(\"Pankaj\"), \r\n\t\t\t\tArrays.asList(\"David\", \"Lisa\"),\r\n\t\t\t\tArrays.asList(\"Amit\"));\r\n\t\t\t//flat the stream from List<String> to String stream\r\n\t\t\tStream<String> flatStream = namesOriginalList\r\n\t\t\t\t.flatMap(strList -> strList.stream());\r\n\r\n\t\t\tflatStream.forEach(System.out::println);\r\n\r\n\t}", "public void showBalance(){\n for(Player player: players){\n System.out.println(player + \"'s balance: \" + player.getWallet());\n }\n System.out.println();\n dealer.showProfit();\n System.out.println();\n }", "public static void main(String[] args) {\n System.out.println(\"hola la concha de tu madre\");\n Persona persona1 = new Persona(\"allan\",28,19040012);\n Persona persona2 = new Persona(\"federico\", 14,40794525);\n Persona persona3 = new Persona(\"pablito\", 66,56654456);\n\n List<Persona> personas= new ArrayList<Persona>();\n personas.add(persona1);\n personas.add(persona2);\n personas.add(persona3);\n\n System.out.println(\"--------Para imprimir la list completa--------\");\n System.out.println(String.format(\"Personas: %s\",personas));\n\n System.out.println(\"----------MAYORES A 21-------------\");\n // mayores a 21\n System.out.println(String.format(\"Mayores a 21: %s\",personas.stream()\n .filter(persona->persona.getEdad() > 21)\n .collect(Collectors.toList())));\n\n System.out.println(\"-----------MENORES A 18-------------------\");\n // menores 18\n System.out.println(String.format(\"menores 18: %s\",personas.stream()\n .filter(persona->persona.getEdad() < 18)\n .collect(Collectors.toList())));\n\n System.out.println(\"---------MAYORES A 21 + DNI >20000000 -------------------\");\n System.out.println(String.format(\"MAYORES A 21 + DNI >20000000: %s\",personas.stream()\n .filter(persona->persona.getEdad() > 21 && persona.getDni()>20000000)\n //.filter( persona->persona.getDni() >20000000) // tambien funciona con este\n .collect(Collectors.toList())));\n\n }", "public void writeList() {\n\n HeapSort heapSort = new HeapSort();\n heapSort.sort(list);\n\n// QuickSort quickSort = new QuickSort();\n// quickSort.sort(list);\n\n// MergeSort mergeSort = new MergeSort();\n// mergeSort.sortNumbers(list);\n\n System.out.println(\"Result of sorting :\");\n list.stream().forEach(s -> System.out.println(s));\n }", "private static List<MoneyLoss> sortLosses(Collection<MoneyLoss> unsortedLosses)\n {\n //Sort budget items first on frequency and then alphabetically\n ArrayList<MoneyLoss> oneTimeItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> dailyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> weeklyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> biweeklyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> monthlyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> yearlyItems = new ArrayList<MoneyLoss>();\n\n for (MoneyLoss loss : unsortedLosses)\n {\n switch (loss.lossFrequency())\n {\n case oneTime:\n {\n oneTimeItems.add(loss);\n break;\n }\n case daily:\n {\n dailyItems.add(loss);\n break;\n }\n case weekly:\n {\n weeklyItems.add(loss);\n break;\n }\n case biWeekly:\n {\n biweeklyItems.add(loss);\n break;\n }\n case monthly:\n {\n monthlyItems.add(loss);\n break;\n }\n case yearly:\n {\n yearlyItems.add(loss);\n break;\n }\n }\n }\n\n Comparator<MoneyLoss> comparator = new Comparator<MoneyLoss>() {\n @Override\n public int compare(MoneyLoss lhs, MoneyLoss rhs) {\n return lhs.expenseDescription().compareTo(rhs.expenseDescription());\n }\n };\n\n Collections.sort(oneTimeItems, comparator);\n Collections.sort(dailyItems, comparator);\n Collections.sort(weeklyItems, comparator);\n Collections.sort(biweeklyItems, comparator);\n Collections.sort(monthlyItems, comparator);\n Collections.sort(yearlyItems, comparator);\n\n ArrayList<MoneyLoss> sortedItems = new ArrayList<MoneyLoss>();\n BadBudgetApplication.appendItems(sortedItems, oneTimeItems);\n BadBudgetApplication.appendItems(sortedItems, dailyItems);\n BadBudgetApplication.appendItems(sortedItems, weeklyItems);\n BadBudgetApplication.appendItems(sortedItems, biweeklyItems);\n BadBudgetApplication.appendItems(sortedItems, monthlyItems);\n BadBudgetApplication.appendItems(sortedItems, yearlyItems);\n\n return sortedItems;\n }", "private void outputAccounts(){\r\n float total = 0;\r\n Collections.sort(theAccounts);\r\n for(Account aAccount:theAccounts){\r\n System.out.println(aAccount.toString());\r\n total += aAccount.getPremiumBonds();\r\n }\r\n\r\n System.out.println(\"Mediem\");\r\n calculateMediem();\r\n\r\n System.out.println(\"Mean:\");\r\n calculateMean(total);\r\n\r\n System.out.println(\"Mode:\");\r\n calculateMode();\r\n\r\n System.out.println(\"Range\");\r\n calculateRange();\r\n }", "public static void main(String[] args) {\n\t\tList<StatetostateDetail> list = new ArrayList<StatetostateDetail>();\n\t\tfor(int i = 1; i < 16; i++){\n\t\t\tStatetostateDetail s = new StatetostateDetail();\n\t\t\ts.setId(i);\n\t\t\ts.setStatue(0);\n\t\t\ts.setTime(System.currentTimeMillis() + (i + i * 100));\n\t\t\tlist.add(s);\n\t\t}\n\t\tlist.get(3).setStatue(1);\n\t\tlist.get(5).setStatue(1);\n\t\tlist.get(10).setStatue(1);\n\t\tlist.get(14).setStatue(1);\n\t\tlist.get(7).setStatue(2);\n\t\tlist.get(9).setStatue(2);\n\t\tSystem.out.println(\"list:\" + list);\n\t\n\t\t\n\t\tCollections.sort(list, new Comparator<StatetostateDetail>(){\n public int compare(StatetostateDetail s1, StatetostateDetail s2) {\n \tLong t1 = null;\n \tLong t2 = null;\n \ttry{\n \t\tt1 = s1.getTime();\n\t \tt2 = s2.getTime();\n \t}catch(Exception e){\n \t\te.printStackTrace();\n \t}\n \n return t2.compareTo(t1);\n }\n });\n\t\tCollections.sort(list, new Comparator<StatetostateDetail>(){\n public int compare(StatetostateDetail s1, StatetostateDetail s2) {\n \treturn s1.getStatue()>s2.getStatue()?1:(s1.getStatue()==s2.getStatue()?0:(s2.getTime()>s1.getTime()?-1:0));\n }\n });\n\t\t\n\t\tSystem.out.println(\"list:\" + list);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n ArrayList<SortObjects> a = new ArrayList<SortObjects>();\n\n SortObjects o = new SortObjects(\"Latha\", 23, 26000);\n SortObjects o2= new SortObjects(\"Ramya\", 20, 11000);\n SortObjects o3= new SortObjects(\"Kalai\", 29, 30000);\n SortObjects o4= new SortObjects(\"Vidya\", 24, 25000);\n a.add(o);\n a.add(o2);\n a.add(o3);\n a.add(o4);\n SortComparator s = new SortComparator();\n a.sort(s);\n System.out.println(a);\n \n \n\n\t}", "@Override\n public String report() {\n\n StringBuilder print = new StringBuilder();\n player.getModels().stream().sorted((p, l) -> {\n int result = p.getClass().getSimpleName().compareTo(l.getClass().getSimpleName()); // Order them by type alphabetically,\n if (result == 0) {\n result = Integer.compare(l.getHealth(), p.getHealth());// then by health descending,\n if (result == 0) {\n result = p.getUsername().compareTo(l.getUsername());\n ;// then by username alphabetically.\n }\n }\n return result;\n })\n .forEach(pl -> print.append(pl).append(System.lineSeparator()));\n\n return print.toString().trim();\n }", "public static void main(String[] args) {\n\t\tList<String> animal = new ArrayList<String>();\n\n\t\tanimal.add(\"Cat\");\n\t\tanimal.add(\"Mouse\");\n\t\tanimal.add(\"Lion\");\n\t\tanimal.add(\"Zeebra\");\n\t\tanimal.add(\"Bear\");\n\t\tanimal.add(\"Deer\");\n\n\t\t// Collections.sort(animal,new StringLengthComparator());\n\n\t\tCollections.sort(animal, new ReverseAlphabeticalComparator());\n\t\tfor (String animal1 : animal) {\n\n\t\t\tSystem.out.println(animal1);\n\t\t}\n\n\t\t/////////////////////////////// Sorting Numbers ////////////////////////////////\n\t\tList<Integer> numbers = new ArrayList<Integer>();\n\n\t\tnumbers.add(5);\n\t\tnumbers.add(31);\n\t\tnumbers.add(16);\n\t\tnumbers.add(605);\n\t\tnumbers.add(15);\n\n\t\tCollections.sort(numbers, new Comparator<Integer>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Integer num1, Integer num2) {\n\n\t\t\t\treturn -num1.compareTo(num2);\n\t\t\t}\n\n\t\t});\n\n\t\tfor (Integer num1 : numbers) {\n\n\t\t\tSystem.out.println(num1);\n\t\t}\n\t\t///////////////////////////// Sorting Arbitrary Objects ////////////////////////////\n\n\t\tList<Person> people = new ArrayList<Person>();\n\n\t\tpeople.add(new Person(3, \"Ajeer\"));\n\t\tpeople.add(new Person(1, \"Sudeer\"));\n\t\tpeople.add(new Person(2, \"Sureash\"));\n\t\tpeople.add(new Person(4, \"Sam\"));\n\t\t\n\t\t// Sort in Order of ID\n\t\tCollections.sort(people, new Comparator<Person>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Person p1, Person p2) {\n\t\t\t\tif (p1.getId() > p2.getId()) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse if (p1.getId()< p2.getId()) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t});\n\t\tfor (Person person1 : people) {\n\n\t\t\tSystem.out.println(person1);\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t\t// Sort In Order of NAME....\n\t\tCollections.sort(people, new Comparator<Person>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Person p1, Person p2) {\n\t\t\t\n\t\t\t\treturn p1.getName().compareTo(p2.getName());\n\t\t\t}\n\t\t});\n\t\tfor (Person person1 : people) {\n\n\t\t\tSystem.out.println(person1);\n\t\t}\n\t}", "public void testConsumer ()\n {\n\n List<String> list = new ArrayList<>();\n list.add(\"ccc\");\n list.add(\"bbb\");\n list.add(\"ddd\");\n list.add(\"DDDD\");\n list.add(\"ccc\");\n list.add(\"aaa\");\n list.add(\"eee\");\n\n// Collections.sort(list);\n// Collections.sort(list, (s, s2) -> s.toLowerCase().compareTo(s2.toLowerCase()));\n\n// list.sort((s, s2) -> s.compareTo(s2));\n// list.sort((s, s2) -> s.toLowerCase().compareTo(s2.toLowerCase()));\n\n// list.forEach(s -> System.out.println(s));\n// list.forEach(s -> System.out.println(s));\n\n\n// Predicate<String> predicate2 = s -> s.length()>3;\n// System.out.println(\"predicate2.test(\\\"DDDD\\\") = \" + predicate2.test(\"DDDD\"));\n\n// Stream<String> stringStream = list.stream();\n// stringStream.forEach(s -> System.out.println(s));\n// stringStream.forEach(s -> System.out.println(s));//会报错\n\n// list.stream().forEach(s -> System.out.println(s));\n// list.stream().forEach(s -> System.out.println(s));\n\n //并行流是无序的\n// list.parallelStream().forEach(s -> System.out.println(s));\n// list.parallelStream().forEach(s -> System.out.println(s));\n\n// list.stream().skip(3).forEach(s -> System.out.println(s));\n// list.stream().distinct().forEach(s -> System.out.println(s));\n// System.out.println(\"list.stream().count() = \" + list.stream().count());\n// list.stream().limit(2).forEach(s -> System.out.println(s));\n\n// list.stream().filter(s -> s.length()<4).forEach(s -> System.out.println(s));\n\n// BiFunction<Integer, String, Person> bf = Person::new;\n// BiFunction<Integer, String, Person> bf = (n, s) -> new Person(s);\n\n// Person aaa = bf.apply();\n\n// System.out.println(\"aaa = \" + bf.apply(0, \"aaa\"));\n \n }", "@Override\n public int compare(PublisherInfo lhs, PublisherInfo rhs) {\n if (lhs.lastName != rhs.lastName) {\n return lhs.lastName.compareToIgnoreCase(rhs.lastName);\n\n } else {\n if (lhs.firstName != rhs.firstName) {\n return lhs.firstName.compareToIgnoreCase(rhs.firstName);\n } else {\n return lhs.middleName.compareToIgnoreCase(rhs.middleName);\n }\n }\n\n }", "public static void main(String[] args) {\n\n List<String> animals = new ArrayList <String>();\n\n animals.add(\"Elephatn\");\n animals.add(\"snake\");\n animals.add(\"Lion\");\n animals.add(\"Mongoose\");\n animals.add(\"Cat\");\n\n\n\n// Collections.sort(animals, new StringLengthComparator());\n// Collections.sort(animals, new AlphabeticalComparator());\n Collections.sort(animals, new ReverseAlphabeticalComparator());\n for(String animal:animals){\n System.out.println(animal);\n }\n\n//////////////Sorting Numbers ///////////\n List<Integer> numbers = new ArrayList <Integer>();\n\n numbers.add(54);\n numbers.add(1);\n numbers.add(36);\n numbers.add(73);\n numbers.add(9);\n\n Collections.sort(numbers, new Comparator <Integer>() {\n @Override\n public int compare(Integer num1, Integer num2) {\n return num1.compareTo(num2);\n }\n });\n\n for(Integer number: numbers){\n System.out.println(number);\n }\n\n\n///////////////Sorting Arbitrary objects////////\n\n\n List<Person> people = new ArrayList <Person>();\n\n people.add(new Person(1,\"Joe\"));\n people.add(new Person(5,\"Harry\"));\n people.add(new Person(2,\"Hermoine\"));\n people.add(new Person(4,\"Muffet\"));\n\n// Sort in order of ID\n Collections.sort(people, new Comparator <Person>() {\n @Override\n public int compare(Person p1, Person p2) {\n\n if(p1.getId()>p2.getId()){\n return 1;\n }else if(p1.getId()<p2.getId()){\n return -1;\n }\n return 0;\n\n }\n });\n\n\n // Sort in order of Name\n Collections.sort(people, new Comparator <Person>() {\n @Override\n public int compare(Person p1, Person p2) {\n\n return p1.getName().compareTo(p2.getName());\n\n\n }\n });\n\n for(Person person: people){\n System.out.println(person);\n\n }\n\n }", "public static void main(String[] args) {\n\r\n\t\tAlunoTreinar alunoTreinar = new AlunoTreinar();\r\n\t\t\r\n\t\talunoTreinar.setNome(\"Teste\");\r\n\t\talunoTreinar.setCpf(123);\r\n\t\talunoTreinar.setNome(\"Albert\");\r\n\t\talunoTreinar.setCpf(321)\r\n\t\t\r\n\t\tList<String> lista = new ArrayList<>();\r\n\t\tlista.add(alunoTreinar.toString());\r\n\t\t\r\n\t\tSystem.out.print(lista.get(0));\r\n\t\t\r\n\t\tCollections.sort(lista);\r\n\t\t\r\n\t\tfor (alunoTreinar AlunoTreinar : lista) {\r\n\t\t\t\t\t\t\r\n\t\t\tSystem.out.print(lista);\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args) throws FileNotFoundException, IOException {\n BufferedReader br = new BufferedReader(new FileReader(\"D:\\\\name-sorter\\\\unsorted-names-list.txt\"));\n \n // Step 5: Create an ArrayList to hold the Person objects.\n ArrayList<Person> listPersonNames = new ArrayList<Person>();\n \n // Step 6 : Read every person record from input text file. For each person record, \n // create one person object and add that person object into listPersonNames.\n String line = br.readLine();\n \n while(line != null){\n String[] names = line.split(\" \");\n\n String givenNames = \"\";\n for(int a=0; a < names.length-1; a++){\n givenNames += names[a];\n givenNames += \" \";\n }\n \n String lastName = names[names.length-1];\n \n listPersonNames.add(new Person(givenNames, lastName));\n \n line = br.readLine();\n }\n \n // Step 7 : Sort the ArrayList listPersonNames using Collections.sort() method by passing \n // NamesCompare object to sort the text file.\n Collections.sort(listPersonNames, new NamesCompare());\n \n // Step 8 : Create BufferedWriter object to write the records into output text file.\n BufferedWriter writer = new BufferedWriter(new FileWriter(\"D:\\\\name-sorter\\\\sorted-names-list.txt\"));\n \n // Step 9 : Write each listPersonNames into output text file.\n for (Person person : listPersonNames){\n writer.write(person.givenNames);\n writer.write(\" \"+person.lastName);\n writer.newLine();\n \n System.out.println(person.givenNames+\" \"+person.lastName);\n }\n \n // Step 10 : Close the resources.\n br.close();\n writer.close();\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tArrayList<Student2> studs = new ArrayList<>();\r\n\t\tstuds.add(new Student2(6,\"neena\"));\r\n\t\tstuds.add(new Student2(1,\"nimmy\"));\r\n\t\tstuds.add(new Student2(4,\"cookie\"));\r\n\t\t\r\n\t\tCollections.sort(studs);\r\n\t\t\r\n\t\tfor(Student2 s : studs) {\r\n\t\t\tSystem.out.println(s);\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n ArrayList<Pessoa> pessoas = new ArrayList<>();\n Scanner s = new Scanner(System.in);\n char sin;\n \n //Identifica como o filtro deve ser realizado\n System.out.println(\"Deseja filtrar por nome (1) ou idade (2)?\");\n sin = s.next().charAt(0); \n \n //Instancia e povoa a primeira pessoa\n Pessoa pessoa1 = new Pessoa();\n pessoa1.setNome(\"Carlos\");\n pessoa1.setIdade(32);\n \n //Instancia e povoa a segunda pessoa\n Pessoa pessoa2 = new Pessoa();\n pessoa2.setNome(\"Izabel\");\n pessoa2.setIdade(21);\n \n //Instancia e povoa a terceira pessoa\n Pessoa pessoa3 = new Pessoa();\n pessoa3.setNome(\"Ademir\");\n pessoa3.setIdade(34); \n \n //Adiciona objetos no ArrayList\n pessoas.add(pessoa1);\n pessoas.add(pessoa2);\n pessoas.add(pessoa3);\n \n //Compara utilizando Comparator - necessario utilizar para permitir a criaçao de dois metodos de comparaçao\n if(sin == '1'){\n Collections.sort(pessoas, comparaNome());\n }else if(sin == '2'){\n Collections.sort(pessoas, comparaIdade());\n }\n \n //Imprime as pessoas considerando a ordem do sort\n System.out.println(\"Saida do comparator: \");\n for(Pessoa p : pessoas){\n System.out.println(\"Nome: \" +p.getNome()+ \" Idade: \" + p.getIdade());\n }\n \n //Compara utilizando Comparable - somente ordenara de acordo com a implementaçao do metodo na clase de origem - somente uma implementaçao\n //O que nao permitira variar entre atributos de ordenaçao diferentes.\n System.out.println(\"\\nSaida do comparable (Filtro atual por idade): \");\n Collections.sort(pessoas);\n for(Pessoa p : pessoas){\n System.out.println(\"Nome: \" +p.getNome()+ \" Idade: \" + p.getIdade());\n }\n \n }", "public void f4(List<Book> a) {\r\n Collections.sort(a, new Comparator<Book>() {\r\n @Override\r\n public int compare(Book o1, Book o2) {\r\n String txt1[] = o1.getName().split(\" \");\r\n String txt2[] = o2.getName().split(\" \");\r\n String lastName1 = txt1[txt1.length - 1];\r\n String lastName2 = txt2[txt2.length - 1];\r\n return lastName1.compareToIgnoreCase(lastName2);\r\n }\r\n });\r\n\r\n }", "@Override\n public List<Client> clientsSortedAlphabetically(){\n log.trace(\"clientsSortedAlphabetically -- method entered\");\n Iterable<Client> clients = clientRepository.findAll();\n List<Client> result = StreamSupport.stream(clients.spliterator(),false).sorted(Comparator.comparing(Client::getName)).collect(Collectors.toList());\n log.trace(\"clientsSortedAlphabetically: result={}\", result);\n return result;\n\n }", "public static void main(String[] args) {\n\t\tLinkedList list=new LinkedList();\n\t\tlist.insert(10);\n\t\tlist.insert(5);\n\t\tlist.insert(15);\n\t\tlist.insert(100);\n\t\tlist.insert(500);\n\t\tlist.insert(200);\n\t\tlist.show();\n\t\tlist.sort();\n\t\tSystem.out.println();\n\t\tlist.show();\n\t}", "public static void main(String[] args) {\n\t\tRandom rnd = new Random();\n\t\tList<SomeObjectToCompare> myList = new ArrayList<>();\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tmyList.add(new SomeObjectToCompare(rnd.nextInt(100), new Integer(rnd.nextInt(50)).toString()));\n\t\t}\n\t\tfor (SomeObjectToCompare someObjectToCompare : myList) {\n\t\t\tSystem.out.println(someObjectToCompare);\n\t\t}\n\t\tSystem.out.println();\n//\t\tCollections.sort(myList,new Comparator<SomeObjectToCompare>() {\n//\t\t\t@Override\n//\t\t\tpublic int compare(SomeObjectToCompare o1, SomeObjectToCompare o2) {\n//\t\t\t\t// TODO Auto-generated method stub\n//\t\t\t\treturn o1.getId()-o2.getId();\n//\t\t\t}\t\t\t\n//\t\t});\n\t\t\n//\t\tCollections.sort(myList, (o1,o2) -> o1.getId()-o2.getId());\n\n\t\tCollections.sort(myList, SomeObjectToCompare::compareById);\n\t\t\n\t\tmyList.forEach(System.out::println);\n\t}", "public static void sortMoney(List<? extends Valuable> money) {\n\t\tComparator<Valuable> com = new ValueComparator();\n\t\tCollections.sort(money, com);\n\t\tprintList(money);\n\t}", "public void SortByPrice() {\n for (int i = 1; i < LastIndex; i++) {\n int x = i;\n while (x >= 1) {\n if (ForChild[x - 1].getPrice() > ForChild[x].getPrice()) {\n Confectionery sweets = ForChild[x - 1];\n ForChild[x - 1] = ForChild[x];\n ForChild[x] = sweets;\n\n }\n x -= 1;\n }\n }\n }", "public static void main(String[] args) {\n Box myBox = new Box(50.0, \"brown\");\n Box yourBox = new Box(45.5, \"white\");\n\n Box[] boxes = {myBox, new Box(3.5, \"red\"), yourBox};\n\n for (Box box : boxes) {\n System.out.println(box);\n }\n\n System.out.println(\"+----------------------------+\");\n\n Arrays.sort(boxes);\n\n for (Box box : boxes) {\n System.out.println(box);\n }\n\n System.out.println(\"+----------------------+\");\n\n /*\n * Comparator interface\n *\n * \t\tComparator interface compare(Object o1, Object o2) method need to be implemented that takes two Object\n * \t\targument, it should be implemented in such a way that it returns negative int if first argument is less\n * \t\tthan the second one and returns zero if they are equal and positive int if first argument is greater\n * \t\tthan second one.\n */\n Car myCar = new Car(123456, \"Nissan\", \"Rogue\", \"grey\");\n Car yourCar = new Car(987654, \"Nissan\", \"Murano\", \"maroon\");\n\n ArrayList<Car> cars = new ArrayList<>();\n cars.add(myCar);\n cars.add(yourCar);\n cars.add(new Car(76892345, \"Honda\", \"Accord\", \"silver\"));\n cars.add(new Car(9876, \"Dodge\", \"Caravan\", \"orange\"));\n\n // sneak-peek at lambda expressions\n cars.forEach(car -> System.out.println(car));\n// cars.forEach(Car::toString); // shorter version, of the already short lambda expression\n\n System.out.println(\"+-----------------+\");\n\n VinComparer vinComparer = new VinComparer();\n cars.sort(vinComparer);\n for (Car car : cars) System.out.println(car);\n\n }", "default Stream<Account> streamAccountsOfLedger(\n final String ledgerIdentifer,\n final String sortDirection) {\n final AccountPage firstPage = this.fetchAccountsOfLedger(\n ledgerIdentifer,\n 0,\n 10,\n null,\n null);\n final Integer pageCount = firstPage.getTotalPages();\n switch (sortDirection) {\n case \"ASC\":\n // Sort column is always date and order always ascending so that the order and adjacency of account\n // entries is always stable. This has the advantage that the set of account entries included in the\n // stream is set the moment the first call to fetchAccountEntries (above) is made.\n return Stream.iterate(0, (i) -> i + 1).limit(pageCount)\n .map(i -> this.fetchAccountsOfLedger(ledgerIdentifer, i, 10, \"lastModifiedOn\", \"ASC\"))\n .flatMap(pageI -> pageI.getAccounts().stream());\n case \"DESC\":\n return Stream.iterate(pageCount - 1, (i) -> i - 1).limit(pageCount)\n .map(i -> this.fetchAccountsOfLedger(ledgerIdentifer, i, 10, \"lastModifiedOn\", \"DESC\"))\n .flatMap(pageI -> {\n Collections.reverse(pageI.getAccounts());\n return pageI.getAccounts().stream();\n });\n default:\n throw new IllegalArgumentException();\n }\n }", "protected abstract Comparator<UsageInfo> makeUsageInfoComparator();", "List<User> getUsersSortedByNameAndAge(List<User> users);", "public static void main(String[] args) {\n\t\tList<Product> prodList = new ArrayList<>();\n\t\tprodList.add(new Product(12, \"Refrigerator\", \"Whirlpool\", 43000.00f));\n\t\tprodList.add(new Product(16, \"Mobile\", \"Samsung\", 18000.00f));\n\t\tprodList.add(new Product(11, \"Laptop\", \"Lenovo\", 28300.00f));\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before Sorting\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\tCollections.sort(prodList);\n\t\t\n\t\tSystem.out.println(\"After Sorting\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\tProductNameComparator pnc = new ProductNameComparator();\n\t\tCollections.sort(prodList, pnc);\n\t\t\n\t\tSystem.out.println(\"After Sorting as per name\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\tCollections.sort(prodList,Collections.reverseOrder());\n\t\t\n\t\tSystem.out.println(\"After Sorting as per desc id\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\tCollections.sort(prodList,Collections.reverseOrder(pnc));\n\t\t\n\t\tSystem.out.println(\"After Sorting as per desc name\");\n\t\tfor(Product p:prodList) {\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\t\n\t\t\n\t\tCollections.sort(prodList, (p1,p2)-> p1.getPrice()>p2.getPrice()?1:-1 );\n\t\tSystem.out.println(\"After Sorting as per price\");\n\t\tprodList.forEach(p->System.out.println(p));\n\t\t\n\t\tCollections.sort(prodList, (p1,p2)-> p1.getPrice()<p2.getPrice()?1:-1 );\n\t\tSystem.out.println(\"After Sorting as per desc price\");\n\t\tprodList.forEach(System.out::println);\n\t\t\n\t}", "public void step4(){\n\n Collections.sort(names,(a,b)->b.compareTo(a));\n\n\n System.out.println(\"names sorted are :\"+names);\n }", "protected void arrangeBestOrder ()\n \t{\n \t\tObject[] duplLoans = null;\n \t\ttry\n \t\t{\n \t\t\tduplLoans = theLoanList.popFirstDuplicates();\n \t\t}\n \t\tcatch (NoSuchElementException ex)\n \t\t{\n \t\t\tlog.error(\"The list of duplicate loan lists is empty\");\n \t\t\treturn;\n \t\t}\n \n \t\tDuplicateLoanDataVO bestSourceLoan = null;\n \t\tDuplicateLoanDataVO firstDataVO = null;\n \t\tDuplicateLoanDataVO nextDataVO = null;\n \t\tString xmlValue = null;\n \t\tString apsId1 = null;\n \t\tString providerType1 = null;\n \t\tString apsId2 = null;\n \t\tString providerType2 = null;\n \n \t\tfor (int ndx = 1; ndx < duplLoans.length; ndx++)\n \t\t{\n \t\t\tfirstDataVO = (DuplicateLoanDataVO)duplLoans[0];\n \t\t\tnextDataVO = (DuplicateLoanDataVO)duplLoans[ndx];\n \n \t\t\tapsId1 = firstDataVO.getAwardId();\n \t\t\tproviderType1 = firstDataVO.getProviderType();\n \t\t\tapsId2 = nextDataVO.getAwardId();\n \t\t\tproviderType2 = nextDataVO.getProviderType();\n \n \t\t\tif (apsId1 == null)\n \t\t\t{\n \t\t\t\tapsId1 = XMLParser.getNodeValue(firstDataVO.getDocument(), \"APSUniqueAwardID\");\n \t\t\t\tfirstDataVO.setAwardId(apsId1);\n \t\t\t}\n \n \t\t\tif (providerType1 == null)\n \t\t\t{\n \t\t\t\tproviderType1 = XMLParser.getNodeValue(firstDataVO.getDocument(), \"DataProviderType\");\n \t\t\t\tfirstDataVO.setProviderType(providerType1);\n \t\t\t}\n \n \t\t\tif (apsId2 == null)\n \t\t\t{\n \t\t\t\tapsId2 = XMLParser.getNodeValue(nextDataVO.getDocument(), \"APSUniqueAwardID\");\n \t\t\t\tnextDataVO.setAwardId(apsId2);\n \t\t\t}\n \n \t\t\tif (providerType2 == null)\n \t\t\t{\n \t\t\t\tproviderType2 = XMLParser.getNodeValue(nextDataVO.getDocument(), \"DataProviderType\");\n \t\t\t\tnextDataVO.setProviderType(providerType2);\n \t\t\t}\n \n \t\t\tif (log.isDebugEnabled())\n \t\t\t{\n \t\t\t\tlog.debug(\"Comparing Award ID: \" + apsId1 + \" with provider type '\" + providerType1 +\n \t\t\t\t \"' to Award ID: \" + apsId2 + \" with provider type '\" + providerType2 + \"' \");\n \t\t\t}\n \n \t\t\tbestSourceLoan = determineBestSource(firstDataVO, nextDataVO);\n \t\t\tif (bestSourceLoan != null && bestSourceLoan == nextDataVO)\n \t\t\t{\n \t\t\t\t// we need to rearrange things so that the \"best\" is at\n \t\t\t\t// the \"head\" of the array (element 0).\n \n \t\t\t\tDuplicateLoanDataVO best = (DuplicateLoanDataVO)duplLoans[ndx];\n \t\t\t\tduplLoans[ndx] = duplLoans[0];\n \t\t\t\tduplLoans[0] = best;\n \n \t\t\t\tif (log.isDebugEnabled())\n \t\t\t\t{\n \t\t\t\t\tString apsId = nextDataVO.getAwardId();\n \t\t\t\t\tString providerType = nextDataVO.getProviderType();\n \t\t\t\t\tlog.debug(\"Award ID: \" + apsId + \" with provider type '\" + providerType + \"' is now the 'best' source\");\n \t\t\t\t}\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tif (log.isDebugEnabled())\n \t\t\t\t{\n \t\t\t\t\tString apsId = firstDataVO.getAwardId();\n \t\t\t\t\tString providerType = firstDataVO.getProviderType();\n \t\t\t\t\tlog.debug(\"Award ID: \" + apsId + \" with provider type '\" + providerType + \"' is still the 'best' source\");\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\ttheLoanList.pushLastDuplicates(duplLoans);\n \t}", "public static void main(String[] args) {\n\t\tCompLastName compLN=new CompLastName();\r\n\t\tComparator<String>CompLastThenFirst=compLN.thenComparing(new CompThenByFirstName());\r\n\t\tTreeMap<String,Double> tm3=new TreeMap<String,Double>(CompLastThenFirst);\r\n\t\ttm3.put(\"John Doe\",3434.34);\r\n\t\ttm3.put(\"Tom Smith\", 123.22);\r\n\t\ttm3.put(\"Jane Baker\",1378.00);\r\n\t\ttm3.put(\"Tod Hall\", 99.22);\r\n\t\ttm3.put(\"Ralph Smith\",-19.8);\r\n\t\tSet<Map.Entry<String,Double>> set=tm3.entrySet();\r\n\t\tfor(Map.Entry<String, Double>me4:set) {\r\n\t\t\tSystem.out.print(me4.getKey()+\":\");\r\n\t\t\tSystem.out.println(me4.getValue());\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tdouble balance3=tm3.get(\"John Doe\");\r\n\t\ttm3.put(\"John Doe\", balance3+1000);\r\n\t\tSystem.out.println(\"John Doe is new balance : \"+tm3.get(\"John Doe\"));\r\n\r\n\r\n\t}", "private void sortResults(){\r\n this.sortedPlayers = new ArrayList<>();\r\n int size = players.size();\r\n while (size > 0) {\r\n Player lowestPointsPlayer = this.players.get(0);\r\n for(int i = 0; i<this.players.size(); i++){\r\n if(lowestPointsPlayer.getPoints() <= this.players.get(i).getPoints()){\r\n lowestPointsPlayer = this.players.get(i);\r\n }\r\n }\r\n this.sortedPlayers.add(lowestPointsPlayer);\r\n this.players.remove(lowestPointsPlayer);\r\n size--;\r\n }\r\n\r\n\r\n }", "public List<User> sortByAllFields(List<User> list) {\n Collections.sort(list, (user1, user2) -> {\n int result;\n result = user1.getName().compareTo(user2.getName());\n if (result == 0) {\n result = user1.getAge() - user2.getAge();\n }\n return result;\n });\n\n return list;\n\n }", "public static void main(String[] args) {\n Account anushaAccount = new Account(456123, \"SBIK1014\", 100);\n Account priyaAccount = new Account(789456, \"SBIK1014\", 200);\n Account dhanuAccount = new Account(951753, \"SBIK1014\", 300);\n\n ArrayList<Account> accounts = new ArrayList<>();\n\n accounts.add(anushaAccount);\n accounts.add(priyaAccount);\n accounts.add(dhanuAccount);\n\n TransactionHistory anuTranHist1 = new TransactionHistory(\"8-Jun-2018\", \"savaings\", 25000);\n TransactionHistory anuTranHist2 = new TransactionHistory(\"28-nov-2018\", \"current\", 50000);\n TransactionHistory anuTranHist3 = new TransactionHistory(\"15-Mar-2018\", \"savaings\", 5000);\n\n TransactionHistory priyaTranHist1 = new TransactionHistory(\"8-Jun-2018\", \"savaings\", 25000);\n TransactionHistory priyaTranHist2 = new TransactionHistory(\"28-nov-2018\", \"current\", 50000);\n TransactionHistory priyaTranHist3 = new TransactionHistory(\"15-Mar-2018\", \"savaings\", 5000);\n\n TransactionHistory dhanuTranHist1 = new TransactionHistory(\"8-Jun-2018\", \"savaings\", 25000);\n TransactionHistory dhanuTranHist2 = new TransactionHistory(\"28-nov-2018\", \"current\", 50000);\n TransactionHistory dhanuTranHist3 = new TransactionHistory(\"15-Mar-2018\", \"savaings\", 5000);\n\n\n ArrayList<TransactionHistory> anuTransactionHistory = new ArrayList<>();\n anuTransactionHistory.add(anuTranHist1);\n anuTransactionHistory.add(anuTranHist2);\n anuTransactionHistory.add(anuTranHist3);\n\n ArrayList<TransactionHistory> priyaTransactionHistory = new ArrayList<>();\n anuTransactionHistory.add(priyaTranHist1);\n anuTransactionHistory.add(priyaTranHist2);\n anuTransactionHistory.add(priyaTranHist3);\n\n ArrayList<TransactionHistory> dhanuTransactionHistory = new ArrayList<>();\n anuTransactionHistory.add(dhanuTranHist1);\n anuTransactionHistory.add(dhanuTranHist2);\n anuTransactionHistory.add(dhanuTranHist3);\n\n //useless code\n //you have already instantiated arraylist above and filled it with objects.. you can use that\n // List<Account> accountDetails=Arrays.asList(anushaAccount,priyaAccount,dhanuAccount);\n //List<TransactionHistory> transHistory=Arrays.asList(anuTranHist1,anuTranHist2,anuTranHist3);\n\n Customer anusha = new Customer(\"anusha\", 26, \"28-mar-92\", anushaAccount, anuTransactionHistory);\n Customer priya = new Customer(\"priya\", 22, \"15-oct-96\", priyaAccount, priyaTransactionHistory);\n Customer dhanu = new Customer(\"dhanu\", 32, \"05-jan-82\", dhanuAccount, dhanuTransactionHistory);\n\n anusha.setAccount(anushaAccount);\n priya.setAccount(priyaAccount);\n dhanu.setAccount(dhanuAccount);\n\n List<Customer> customerDetails = Arrays.asList(anusha, priya, dhanu);\n\n\n Bank bank = new Bank(\"SBI\", \"BNGLR\", customerDetails);\n\n// use the utitlity class here and output the customer object with the highest amount\n // check if your logic is running fine and fix this by morning. I have to finish work, and will leave it to you.\n Customer highestAmountCustomer = BankUtility.getCustomerWithHighestDeposit(bank);\n\n System.out.println(\"Customer with highest bank balance is \"+ highestAmountCustomer.getName() + \" with value \"+highestAmountCustomer.getAccount().getAmount());\n }", "public static void Externalexp2Sort(ArrayList<String> source)\n throws IOException {\n PriorityQueue<KVPair> heap = new PriorityQueue<KVPair>(20,\n new UserPrio());\n ArrayList<CsvReader> readers = new ArrayList<CsvReader>();\n // user_tweets output\n PrintWriter writer = new PrintWriter(new FileWriter(user_retweet));\n\n // open files\n for (String fileName : source) {\n // get read csv files\n CsvReader reader = new CsvReader(new InputStreamReader(\n new FileInputStream(fileName), \"UTF-8\"));\n reader.setHeaders(Merge.fields);\n // read a line and put into heap\n if (reader.readRecord()) {\n heap.offer(new KVPair(Merge.readRecord(reader), readers.size()));\n }\n readers.add(reader);\n }\n\n // get same key\n KVPair last = null;\n HashSet<Long> sameRecord = new HashSet<Long>();\n\n while (heap.size() > 0) {\n KVPair tmp = heap.poll();\n\n // no retweet directly read the next\n if (tmp.record.retweet != -1) {\n if (last != null && last.record.retweet != -1\n && last.record.retweet != tmp.record.retweet) {\n StringBuilder builder = new StringBuilder(\n last.record.retweet + \",\");\n\n for (Long userid : sameRecord) {\n builder.append(userid);\n builder.append(\" \");\n }\n writer.println(builder);\n sameRecord = new HashSet<Long>();\n }\n sameRecord.add(tmp.record.userid);\n }\n\n // read next record in the same file\n if (readers.get(tmp.file).readRecord()) {\n heap.offer(new KVPair(Merge.readRecord(readers.get(tmp.file)),\n tmp.file));\n } else {\n readers.get(tmp.file).close();\n }\n last = tmp;\n }\n\n // last part of external sort\n if (sameRecord.size() != 0) {\n StringBuilder builder = new StringBuilder(last.record.retweet + \",\");\n\n for (Long userid : sameRecord) {\n builder.append(userid);\n builder.append(\" \");\n }\n writer.println(builder);\n }\n\n writer.close();\n }", "private static List<StudentRecord> vratiSortiranuListuOdlikasa(List<StudentRecord> records) {\n\t\treturn records.stream()\n\t\t\t\t.filter(o -> o.getOcjena() == 5)\n\t\t\t\t.sorted((o1, o2) -> o1.getOcjena().compareTo(o2.getOcjena()))\n\t\t\t\t.collect(Collectors.toList());\n\t}", "private void sortClients()\n {\n System.out.println(\"clients items (alphabetically):\");\n Set<Client> clients = ctrl.sortClientsAlphabetically();\n clients.stream().forEach(System.out::println);\n }", "@Override\n\tpublic int compare(Account o1, Account o2) {\n\t\treturn ((Double)(o1.getBalance())).compareTo(o2.getBalance());\n\t}", "public static void main(String[] args) {\n Set<BankAccount> set=new TreeSet(new BankAccountTest());\n\tset.add(new BankAccount(128,\"mallika\",2000.0));\n\tset.add(new BankAccount(124,\"sallika1\",21000.0));\n\tset.add(new BankAccount(125,\"nallika2\",20000));\t\n\tfor(BankAccount bank:set){\n\t\tSystem.out.println(bank);\n\t}\n \n\t}", "public static void main(String[] args) {\n\t\t\n\t\tEmployee emp1 = new Employee(1,\"Hibachi\",2000000);\n\t\tEmployee emp2 = new Employee(2,\"Budh\",50000000);\n\t\tEmployee emp3 = new Employee(3,\"Som\",1000000);\n\t\tEmployee emp4 = new Employee(4,\"Mangal\",600000);\n\t\tEmployee emp5 = new Employee(5,\"Brihaspati\",7000000);\n\t\t\n\t\tList<Employee> empList = new ArrayList<>();\n\t\tempList.add(emp1);\n\t\tempList.add(emp2);\n\t\tempList.add(emp3);\n\t\tempList.add(emp4);\n\t\tempList.add(emp5);\n\t\t\n\t\t// sorting done using comparable implementation Employee\n\t\tSystem.out.println(\"sorting using comparable. Sorts by default by name\");\n \t\tCollections.sort(empList);\n\t\t\n\t\tempList.forEach(empl -> System.out.println(empl));\n\n\t\t//using comparator in Employee sort the employees by salary\n\t\tCollections.sort(empList, Employee.compareSalary);\n\t\tSystem.out.println(\"*****************************************************\");\n\t\tSystem.out.println(\"sorting using comparator. sorts based on salary\");\n\t\tempList.forEach(emp -> System.out.println(emp));\n\t\t\n\t\t\n\t\t//using comparator in Employee sort the employees by id\n\t\tCollections.sort(empList, Employee.compareId);\n\t\tSystem.out.println(\"*****************************************************\");\n\t\tSystem.out.println(\"sorting using comparator. sorts based on Id\");\n\t\tempList.forEach(emp -> System.out.println(emp));\n\t\t\n\t\t\n\t\t//Now let's say we want to use the comparator to sort in descending order\n\t\tComparator<Employee> reverseSortSalaryDescendingOrder = Collections.reverseOrder(Employee.compareSalary);\n\t\tCollections.sort(empList,reverseSortSalaryDescendingOrder );\n\t\tSystem.out.println(\"*****************************************************\");\n\t\tSystem.out.println(\"Salary soreted in reverse order i.e. descending order using same comparator and Collections reverseOrder()\");\n\t\tempList.forEach(empl -> System.out.println(empl));\n\t\t\n\t\t// Or we can reverse using the comparator's own reversed() method. Internally it calls reverseOrder() \n\t\tCollections.sort(empList, Employee.compareSalary.reversed());\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tTreeSet<Employee> list=new TreeSet<Employee>();\r\n\t\tlist.add(new Employee(1,\"Nisha\",\"Dhore\"));\r\n\t\tlist.add(new Employee(3,\"Shamal\",\"Dambe\"));\r\n\t\tlist.add(new Employee(4,\"Ravi\",\"Astarkar\"));\r\n\t\tlist.add(new Employee(2,\"Ram\",\"Astarkar\"));\r\n\t\tlist.add(new Employee(1,\"Manisha\",\"Oberoys\"));\r\n\t\t\r\n\t\t\r\n//\t\tTreeSet<Integer> t=new TreeSet();\r\n//\t\tt.add(1);\r\n//\t\tt.add(7);\r\n//\t\tt.add(5);\r\n//\t\tSystem.out.println(\"id sort\");\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\"-------sort asce by id\"+list);\r\n//\t\tCollections.sort(list, new ComparatorId());\r\n//\t\tSystem.out.println(\"------After sort\"+list);\r\n//\t\t\r\n\t\tSystem.out.println(\"lastname sorting\");\r\n\t\t\r\n\t\tList<Employee> l=new ArrayList<Employee>(list);\r\n\t\tCollections.sort(l, new ComparatorFirstName());\r\n\t\tSystem.out.println(\"------After sort\"+l);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n BiFunction<String, Integer, Usuario> factory = Usuario::new;\n Usuario user1 = factory.apply(\"Henrique Schumaker\", 50);\n Usuario user2 = factory.apply(\"Humberto Schumaker\", 120);\n Usuario user3 = factory.apply(\"Hugo Schumaker\", 190);\n Usuario user4 = factory.apply(\"Hudson Schumaker\", 10);\n Usuario user5 = factory.apply(\"Gabriel Schumaker\", 90);\n Usuario user6 = factory.apply(\"Nikolas Schumaker\", 290);\n Usuario user7 = factory.apply(\"Elisabeth Schumaker\", 195);\n Usuario user8 = factory.apply(\"Eliza Schumaker\", 1000);\n Usuario user9 = factory.apply(\"Marcos Schumaker\", 100);\n Usuario user10 = factory.apply(\"Wilson Schumaker\", 1300);\n \n List<Usuario> usuarios = Arrays.asList(user1, user2, user3, user4, user5,\n user6, user7, user8, user9, user10);\n \n //filtra usuarios com + de 100 pontos\n usuarios.stream().filter(u -> u.getPontos() >100);\n \n //imprime todos\n usuarios.forEach(System.out::println);\n \n /*\n Por que na saída apareceu todos, sendo que eles não tem mais de 100 pontos? \n Ele não aplicou o ltro na lista de usuários! Isso porque o método filter, assim como os \n demais métodos da interface Stream, não alteram os elementos do stream original! É muito \n importante saber que o Stream não tem efeito colateral sobre a coleção que o originou.\n */\n }", "@Override\r\n\tpublic List<CreditCard> sortedList(String sortBy) {\n\t\tswitch(sortBy)\r\n\t\t{\r\n\t\tcase \"cardHolderName\" :\r\n\t\tCollections.sort(this.cardList);\r\n\t\tbreak;\r\n\t\tcase \"cardNumber\" :\r\n\t\t\tCollections.sort(this.cardList,new CreditCardComparator());\r\n\t\t\tbreak;\r\n\t\tcase \"sortByLimit\" :\r\n\t\t\tCollections.sort(this.cardList,new CreditLimitComparator());\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.cardList;\r\n\t}", "private void checkSortedAmount() {\n\n\t\tList<String> actualAmountList = new ArrayList<String>();\n\t\tList<WebElement> elementList = util.findElementsByXpath(\"//td[5]/span\");\n\t\tfor (WebElement we : elementList) {\n\t\t\tactualAmountList.add(we.getText());\n\t\t}\n\n\t\tassertEquals(actualAmountList, dataService.getAscendingAmounts());\n\t\tdriver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\n\t}", "public static void main(String... args) {\n\n Person p1 = new Person(\"Mike\", 25);\n Person p2 = new Person(\"John\", 33);\n Person p3 = new Person(\"Slavek\", 48);\n Person p4 = new Person(\"Pawel\", 15);\n Person p5 = new Person(\"MJerry\", 66);\n Person p6 = new Person(\"White\", 35);\n\n List<Person>list = new ArrayList<>(Arrays.asList(p1,p2,p3,p4,p5,p6));\n\n list.forEach(System.out::println);\n list.removeIf(ps->ps.getAge()<25);\n System.out.println(\"after removal\");\n list.forEach(System.out::println);\n System.out.println(\"Trasformation\");\n list.replaceAll(p->new Person(p.getName().toUpperCase(),p.getAge()-5));\n System.out.println(\"After replacement\");\n list.forEach(System.out::println);\n list.sort((s1,s2)->s1.getAge()-s2.getAge());\n System.out.println(\"after sorting\");\n list.forEach(System.out::println);\n list.sort((s1,s2)->s1.getAge()-s2.getAge());\n list.sort(Comparator.comparing(Person::getAge));\n list.sort(Comparator.comparing(Person::getName).reversed());\n\n List<String >sd = Arrays.asList(\"okkok\");\n sd.stream().map(value-> {\n char ss = value.toUpperCase().charAt(0);\n return ss;\n }\n );\n sd.forEach(System.out::println);\n\n\n\n\n }", "private static void sortByVerified( ArrayList<Volunteer> list)\n {\n // Find the string reference that should go in each cell of\n // the array, from cell 0 to the end\n for ( int j = 0; j < list.size();j++ )\n {\n // Find min: the index of the string reference that should go into cell j.\n // Look through the unsorted strings (those at j or higher) for the one that is first in lexicographic order\n int min = j;\n for ( int k=j+1; k < list.size(); k++ ) {\n if (list.get(k).compareTo(list.get(min)) > 0) {\n min = k;\n }\n\n }\n\n // Swap the reference at j with the reference at min\n Collections.swap(list, j, min);\n }\n }", "public static void main(String[] args) {\n Set<String> list = new TreeSet<>();\n list.add(\"Song\");\n list.add(\"Album\");\n list.add(\"Artist\");\n list.add(\"Year\");\n list.add(\"Genre\");\n list.add(\"Song\");\n list.add(\"Song\");\n\n System.out.println();\n for(String x : list){\n System.out.println(x);\n }\n\n //NO REPITTED VALUES AND ASCENDED ORDER WHIT COMPARABLE, HASHCODE AND EQUALS\n Set<Persona> list2 = new TreeSet<>();\n list2.add(new Persona(1, \"Rayman\"));\n list2.add(new Persona(2, \"Castlevania\"));\n list2.add(new Persona(3, \"Silent Hill\"));\n list2.add(new Persona(4, \"Silent Hill\"));\n list2.add(new Persona(1, \"Rayman\"));\n\n System.out.println();\n for(Persona x : list2){\n System.out.println(x.getId() + \" - \" + x.getName());\n }\n }", "public static void main (String args []) throws Exception {\n\n\n ArrayList<Person> people = new ArrayList<Person>();\n Person youngestPerson = getYoungestPerson(people);\n Person oldestPerson = getOldestPerson(people);\n ArrayList<Person> sortedByAgeList = getSortedListByAge(people);\n ArrayList<Person> sortedByNameList = getSortedListByName(people, false);\n\n\n /*\n For the below to work where you can see what you've done, you must have\n done the section 1 recap portion where you override the toString() method of the\n Person class!\n */\n\n for(Person p : sortedByAgeList) {\n System.out.println(p);\n }\n\n for(Person p : sortedByNameList) {\n System.out.println(p);\n }\n }", "public void displayList() {\n salesNumber.stream().map((_item) -> {\r\n //establishes a for loop to search for the top seller\r\n if (salesMax == salesNumber.get((int) displayIteration)) { //identifies and displays a message for the top seller, (you are welcome for the beer)\r\n System.out.println(\"Congratulations \" + topSeller + \" you are the current sales leader with \"\r\n + newFormat.format(salesNumber.get((int) displayIteration)) + \" in sales, and \"\r\n + newFormat.format(salesCommission.get((int) displayIteration)) + \" in compensation. You are also responsible for \"\r\n + \"the first round of beer!\");\r\n } else {\r\n if (salesMax > salesNumber.get((int) displayIteration)) { //identifies values that missed the top sales position and \r\n salesDeficiency = salesMax - salesNumber.get((int) displayIteration); //displays a message stating how far off from top sdales value the seller was.\r\n System.out.println(salesName.get((int) displayIteration) + \", you are \" + newFormat.format(salesDeficiency)\r\n + \" behind the sales leader with \" + newFormat.format(salesNumber.get((int) displayIteration))\r\n + \" in sales and \" + newFormat.format(salesCommission.get((int) displayIteration)) + \" in compensation.\");\r\n }\r\n }\r\n return _item;\r\n }).forEach((_item) -> {\r\n displayIteration = displayIteration + 1; //counts the iteration for the for loop\r\n });\r\n }", "private static List<StudentRecord> vratiSortiranuListuOdlikasa(List<StudentRecord> records) {\n\t\treturn records.stream()\n\t\t\t\t\t\t.filter(s -> s.getGrade() == 5)\n\t\t\t\t\t\t.sorted(StudentRecord.BY_POINTS.reversed())\n\t\t\t\t\t\t.collect(Collectors.toList());\n\t}", "public void print() {\n\t\ttry {\n\t\t\tArrayList<String> list = new ArrayList<String>(clients.keySet());\n\t\t\tCollections.sort(list);\n\t\t\tfor (String name : list) {\n\t\t\t\tProfile p = clients.get(name);\n\t\t\t\tif (p.valid()) {\n\t\t\t\t\tSystem.out.println(p.getName() + \": $\" + p.getBalance());\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(p.getName() + \": error\");\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Throwable e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "private void sortByLastName() {\n //selection sort\n for (int i = 0; i < size - 1; i++) {\n int alphaSmallerIndex = i;\n for (int j = i + 1; j < size; j++)\n if (accounts[j].getHolder().getLastNameFirstName().compareTo(accounts[alphaSmallerIndex].getHolder().getLastNameFirstName()) < 0) {\n alphaSmallerIndex = j;\n }\n Account acc = accounts[alphaSmallerIndex];\n accounts[alphaSmallerIndex] = accounts[i];\n accounts[i] = acc;\n }\n }", "public void filterAndPrint(List<Student> students, Predicate<Student> filter, Consumer<Student> action, Comparator<Student> sort) {\n\t\t// I have filter the list and sorted it, Also forLoop print the result.\n\t\tstudents.stream().filter(filter).sorted(sort).forEach(action);\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tList<Card> listOfCards = new ArrayList<Card>();\n\t\tlistOfCards.add(new Card(SuitColor.RED, SuitType.DIAMOND, SuitValue.ACE));\n\t\tlistOfCards.add(new Card(SuitColor.BLACK, SuitType.CLUB, SuitValue.FIVE));\n\t\tlistOfCards.add(new Card(SuitColor.RED, SuitType.HEART, SuitValue.FOUR));\n\t\tlistOfCards.add(new Card(SuitColor.BLACK, SuitType.SPADE, SuitValue.THREE));\n\t\tlistOfCards.add(new Card(SuitColor.BLACK, SuitType.CLUB, SuitValue.TWO));\n\t\tlistOfCards.add(new Card(SuitColor.RED, SuitType.DIAMOND, SuitValue.JACK));\n\t\tSystem.out.println(listOfCards);\n\t\tCollections.sort(listOfCards, Card.ColorComparator);\n\t\tSystem.out.println(listOfCards);\n\t\tCollections.sort(listOfCards, Card.TypeComparator);\n\t\tSystem.out.println(listOfCards);\n\t\tCollections.sort(listOfCards, Card.ValueComparator);\n\t\tSystem.out.println(listOfCards);\n\t\tCollections.sort(listOfCards, Card.CardComparator);\n\t\tSystem.out.println(listOfCards);\n\t}", "@Test\n public void whenListOfUserContainsofFiveUsersThenSortByAge() {\n\n SortUser sort = new SortUser();\n\n User din = new User(\"Din\", 23);\n User sam = new User(\"Sam\", 15);\n User john = new User(\"John\", 31);\n User sara = new User(\"Sara\", 25);\n User greg = new User(\"Greg\", 28);\n\n List<User> users = new LinkedList<>();\n\n users.add(din);\n users.add(sam);\n users.add(john);\n users.add(sara);\n users.add(greg);\n\n Set<User> expectedSet = new TreeSet<>();\n\n expectedSet.add(sam);\n expectedSet.add(din);\n expectedSet.add(sara);\n expectedSet.add(greg);\n expectedSet.add(john);\n\n Set<User> actualSet = sort.sort(users);\n\n assertThat(actualSet, is(expectedSet));\n\n }", "public static void main(String[] args) {\n\t\tint flowerToPurchase = 3;\n int members = 2;\n int[] fPrice = {2,5,6};\n \n \tint j=0;\n \tint key,k;\n \tint arr_length= flowerToPurchase;\n \tfor(int i=1;i<flowerToPurchase; i++){\n \t\tj=i-1;\n \t\tkey = fPrice[i];\n \t\twhile(j >=0 && key < fPrice[j]){\n \t\t\tfPrice[j+1] = fPrice[j];\n \t\t\tj=j-1;\n \t\t}\n\n \t\tfPrice[j+1] = key;\n \t} // sort ends\n \t\n \tint temp = flowerToPurchase;\n \tint x =0;\n \tint amnt =0, peopleCount=0;\n \tint index = flowerToPurchase-1;\n \tint[] friends = new int[members];\n \tint f_index =0;\n \twhile(temp != 0){\n \t\tif(members == flowerToPurchase){\n \t\t\tamnt += fPrice[index--];\n \t\t\ttemp--;\n \t\t}\n \t\telse if(members < flowerToPurchase){\n \t\t\t\n \t\t\tif(friends[f_index] == 0){\n \t\t\t\tfriends[f_index] = 1;\n \t\t\t\tamnt += fPrice[index--];\n \t\t\t\tfPrice[index+1] = 0;\n \t\t\t\ttemp--;\n \t\t\t}\n \t\t\telse if(friends[f_index] == 1){\n \t\t\t\tamnt += (friends[f_index] + 1) * fPrice[0];\n \t\t\t\tfriends[f_index] = 2;\n \t\t\t\tfPrice[0] = 0;\n \t\t\t\ttemp--;\n \t\t\t\tf_index++;\n \t\t\t}\n \t\t\t\n \t\t}\n \t}\n \tSystem.out.println(amnt);\n \t\n }", "public static void main(String[] args) {\n SortedSet<CompareObject> objects = new TreeSet<>(new ComparatorTest());\n\n objects.add(new CompareObject(1));\n objects.add(new CompareObject(3));\n objects.add(new CompareObject(5));\n objects.add(new CompareObject(-13));\n objects.add(new CompareObject(12));\n objects.add(new CompareObject(1100));\n objects.add(new CompareObject(1));\n\n for (CompareObject x : objects){\n System.out.println(x);\n }\n\n }", "public void comparatorSample() {\n\t\tList<Person> persons = Arrays.asList(new Person(\"Charles\", \"Dicken\", 60), new Person(\"Niharika\", \"Kothari\", 25),\n\t\t\t\tnew Person(\"Havilah\", \"Thathaputi\", 24), new Person(\"Alekya\", \"Saladi\", 24),\n\t\t\t\tnew Person(\"Muthu\", \"Sakthivel\", 27));\n\n\t\t/** Before Java 8: */\n\t\tSystem.out.println(\"Without Lambda Expressions:\");\n\t\t// Sort list by last name\n\t\tCollections.sort(persons, new Comparator<Person>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Person p1, Person p2) {\n\t\t\t\treturn p1.getFirstName().compareTo(p2.getFirstName());\n\t\t\t}\n\t\t});\n\t\t// Create a method that prints all elements in the list\n\t\tSystem.out.println(\"Print all the data:\");\n\t\tprintAll(persons);\n\t\t// Create a method print all the last names start with 'T'\n\t\tSystem.out.println(\"Print data based on char:\");\n\t\tprintConditionally(persons, \"H\", new Condition() {\n\t\t\t@Override\n\t\t\tpublic boolean test(Person p, String letter) {\n\t\t\t\treturn p.getFirstName().startsWith(letter);\n\t\t\t}\n\t\t});\n\n\t\t/** Java 8: */\n\t\tSystem.out.println(\"With Lambda Expressions:\");\n\t\t// Sort list by last name\n\t\tCollections.sort(persons, (p1, p2) -> p1.getFirstName().compareTo(p2.getLastName()));\n\t\t// Create a method that prints all elements in the list\n\t\tSystem.out.println(\"Print all the data:\");\n\t\tprintAll(persons);\n\t\t// Create a method print all the last names start with 'T'\n\t\tSystem.out.println(\"Print data based on char:\");\n\t\tprintConditionally(persons, \"H\", (p, letter) -> p.getFirstName().startsWith(letter));\n\n\t}", "public static void sortListOfEmployees() {\n List<Employee> employees = null;\n try {\n employees = employeeRepository.getAll(dataSource);\n } catch (SQLException e) {\n LOGGER.error(e.getMessage());\n }\n if (employees.isEmpty()) {\n System.out.println(\"\\n\" + resourceBundle.getString(\"empty.list\") + \"\\n\");\n LOGGER.warn(\"The list of employees is empty\");\n return;\n }\n System.out.println();\n employees.stream().sorted(Comparator.comparing(Employee::getLastName)).forEach(System.out::println);\n }", "public static void runExercise8() {\n List <Integer> years = students.stream().map(student -> student.getBirthYear()).sorted(Comparator.reverseOrder()).collect(Collectors.toList());\n System.out.println(years);\n }", "private void collectorOperationInStream() {\n List<Person> persons =\n Arrays.asList(\n new Person(\"Max\", 18),\n new Person(\"Vicky\", 23),\n new Person(\"Ron\", 23),\n new Person(\"Harry\", 12));\n\n Map<Integer, List<Person>> personsByAge = persons\n .stream()\n .collect(Collectors.groupingBy(p -> p.age));\n\n personsByAge.forEach((age, p) -> System.out.format(\"age %s: %s\\n\", age, p));\n\n Double averageAge = persons\n .stream()\n .collect(Collectors.averagingInt(p -> p.age));\n\n System.out.println(\"Average-Age: \" + averageAge);\n\n IntSummaryStatistics ageSummary = persons.stream()\n .collect(Collectors.summarizingInt(p -> p.age));\n\n System.out.println(\"Summarizing Age: \" + ageSummary);\n\n String phrase = persons\n .stream()\n .filter(p -> p.age >= 18)\n .map(p -> p.name)\n .collect(Collectors.joining(\" and \", \"In Germany \", \" are of legal age.\"));\n\n System.out.println(\"Collectors Joining: \" + phrase);\n\n Map<Integer, String> map = persons\n .stream()\n .collect(Collectors.toMap(\n p -> p.age,\n p -> p.name,\n (name1, name2) -> name1 + \";\" + name2));\n\n System.out.println(\"Collectors Mapping: \" + map);\n\n\n Collector<Person, StringJoiner, String> personNameCollector =\n Collector.of(\n () -> new StringJoiner(\" | \"), // supplier\n (j, p) -> j.add(p.name.toUpperCase()), // accumulator\n StringJoiner::merge, // combiner\n StringJoiner::toString); // finisher\n\n String names = persons\n .stream()\n .collect(personNameCollector);\n\n System.out.println(\"Collectors Collect: \" + names);\n\n\n List<Integer> IntegerRange = IntStream.range(51, 54).boxed().collect(Collectors.toList());\n List<Integer> IntegerRange1 = IntStream.range(51, 54).mapToObj(i-> i).collect(Collectors.toList());\n System.out.println(\"InStream to List : \"+IntegerRange);\n System.out.println(\"InStream to List : \"+IntegerRange1);\n }", "public static void userSort(ArrayList<FileData> fromFile, int primary_sort, int secondary_sort, int primary_order, int secondary_order)\n {\n \n // user wants to sort by primary = state code and secondary = county code\n if(primary_sort == 1 && secondary_sort == 2) \n {\n if(primary_order == 1 && secondary_order == 1){// user wants both primary and secondary in ascending order\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order == 2 && secondary_order == 2){ // user wants both primary and secondary in decending order\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){// primary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n // user wants to sort by primary = county code and secondary = state code\n if(primary_sort == 2 && secondary_sort == 1){\n if(primary_order == 1 && secondary_order == 1){\n //primary and seconary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2 && secondary_order == 2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){//primary is ascending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); // primary sort\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); // primary sort\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==1&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==1&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n } \n } \n }\n \n \n if(primary_sort==1&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n \n if(primary_sort==8&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==6&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==7&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==8&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==3&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==4&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==5&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n }", "public int compare(Object pObj1, Object pObj2)\r\n {\r\n VwClientFollowupBean b1 = (VwClientFollowupBean)pObj1;\r\n VwClientFollowupBean b2 = (VwClientFollowupBean)pObj2;\r\n int iReturn = 0;\r\n switch(iType)\r\n {\r\n case VwClientFollowupManager.ID_LAST_NAME:\r\n if (b1.getLastName() == null && b2.getLastName() != null) {\r\n iReturn = -1;\r\n } else if (b1.getLastName() == null && b2.getLastName() == null) {\r\n iReturn = 0;\r\n } else if (b1.getLastName() != null && b2.getLastName() == null) {\r\n iReturn = 1;\r\n } else {\r\n iReturn = b1.getLastName().compareTo(b2.getLastName());\r\n }\r\n break;\r\n case VwClientFollowupManager.ID_FIRST_NAME:\r\n if (b1.getFirstName() == null && b2.getFirstName() != null) {\r\n iReturn = -1;\r\n } else if (b1.getFirstName() == null && b2.getFirstName() == null) {\r\n iReturn = 0;\r\n } else if (b1.getFirstName() != null && b2.getFirstName() == null) {\r\n iReturn = 1;\r\n } else {\r\n iReturn = b1.getFirstName().compareTo(b2.getFirstName());\r\n }\r\n break;\r\n case VwClientFollowupManager.ID_DESCRIPTION:\r\n if (b1.getDescription() == null && b2.getDescription() != null) {\r\n iReturn = -1;\r\n } else if (b1.getDescription() == null && b2.getDescription() == null) {\r\n iReturn = 0;\r\n } else if (b1.getDescription() != null && b2.getDescription() == null) {\r\n iReturn = 1;\r\n } else {\r\n iReturn = b1.getDescription().compareTo(b2.getDescription());\r\n }\r\n break;\r\n case VwClientFollowupManager.ID_CLOSED_DT:\r\n if (b1.getClosedDt() == null && b2.getClosedDt() != null) {\r\n iReturn = -1;\r\n } else if (b1.getClosedDt() == null && b2.getClosedDt() == null) {\r\n iReturn = 0;\r\n } else if (b1.getClosedDt() != null && b2.getClosedDt() == null) {\r\n iReturn = 1;\r\n } else {\r\n iReturn = b1.getClosedDt().compareTo(b2.getClosedDt());\r\n }\r\n break;\r\n case VwClientFollowupManager.ID_OPENED_DATE:\r\n if (b1.getOpenedDate() == null && b2.getOpenedDate() != null) {\r\n iReturn = -1;\r\n } else if (b1.getOpenedDate() == null && b2.getOpenedDate() == null) {\r\n iReturn = 0;\r\n } else if (b1.getOpenedDate() != null && b2.getOpenedDate() == null) {\r\n iReturn = 1;\r\n } else {\r\n iReturn = b1.getOpenedDate().compareTo(b2.getOpenedDate());\r\n }\r\n break;\r\n case VwClientFollowupManager.ID_DUE_DT:\r\n if (b1.getDueDt() == null && b2.getDueDt() != null) {\r\n iReturn = -1;\r\n } else if (b1.getDueDt() == null && b2.getDueDt() == null) {\r\n iReturn = 0;\r\n } else if (b1.getDueDt() != null && b2.getDueDt() == null) {\r\n iReturn = 1;\r\n } else {\r\n iReturn = b1.getDueDt().compareTo(b2.getDueDt());\r\n }\r\n break;\r\n case VwClientFollowupManager.ID_FOLLOWUP_ID:\r\n if (b1.getFollowupId() == null && b2.getFollowupId() != null) {\r\n iReturn = -1;\r\n } else if (b1.getFollowupId() == null && b2.getFollowupId() == null) {\r\n iReturn = 0;\r\n } else if (b1.getFollowupId() != null && b2.getFollowupId() == null) {\r\n iReturn = 1;\r\n } else {\r\n iReturn = b1.getFollowupId().compareTo(b2.getFollowupId());\r\n }\r\n break;\r\n default:\r\n throw new IllegalArgumentException(\"Type passed for the field is not supported\");\r\n }\r\n\r\n return bReverse ? (-1 * iReturn) : iReturn;\r\n }", "@Test\n public void whenListOfUsersWithDifferentNamesAndAgesThenSortHashSortsUsersByHashcode() {\n\n SortUser sort = new SortUser();\n\n List<User> test = new LinkedList<>();\n\n User basil = new User(\"Basil\", 27);\n User alex = new User(\"Alex\", 31);\n User sam = new User(\"Sam\", 33);\n\n test.add(basil);\n test.add(alex);\n test.add(sam);\n\n List<User> expected = new LinkedList<>();\n\n expected.add(sam);\n expected.add(alex);\n expected.add(basil);\n\n List<User> actual = sort.sortHash(test);\n\n assertThat(actual, is(expected));\n\n }", "public static void main(String[] args) {\n IntStream myIntStream = IntStream.range(1, 20);\n List<Integer> sortedReverse = myIntStream.boxed().sorted((a, b) -> b - a).collect(Collectors.toList());\n System.out.println(sortedReverse);\n Collections.sort(sortedReverse, Comparator.comparing(a-> a.intValue()));\n Collections.sort(sortedReverse, Integer::compareTo);\n\n String[] stringArray = { \"Barbara\", \"James\", \"Mary\",\n \"John\", \"Patricia\", \"Robert\", \"Michael\", \"Linda\" };\n\n\n Arrays.sort(stringArray, String::compareToIgnoreCase);\n\n System.out.println(IntStream.range(1, 5).sum());\n System.out.println(IntStream.range(1, 5).reduce(100,(a,b)-> a+b));\n\n // Local Date and Time\n LocalDateTime timePoint = LocalDateTime.now( ); // The current date and time\n LocalDate myLocalDate = LocalDate.now().plusDays(10);\n\n List<String> myList = List.of(stringArray);\n long count = myList.parallelStream()\n .peek(a-> System.out.println(\"Processing \"+a + \" \"+a.length()))\n .map(a-> a.toUpperCase())\n .peek(a-> System.out.println(\"Upper Case: \"+a))\n .map(a-> a.length())\n .filter(a-> a>5)\n .count();\n\n System.out.println(\"Name length greater than 5 is: \"+ count);\n\n }", "public static void main(String[] args) {\n\t\tList<String> lines = Arrays.asList(\"spring\", \"node\", \"mkyong\");\r\n\r\n List<String> result = lines.stream() // convert list to stream\r\n .filter(line -> !\"mkyong\".equals(line)) // we dont like mkyong\r\n .collect(Collectors.toList()); // collect the output and convert streams to a List\r\n\r\n result.forEach(System.out::println); //output : spring, node\r\n \r\n \r\n \r\n \r\n //Streams filter(), findAny() and orElse()\r\n List<Person> persons = Arrays.asList(\r\n new Person(\"mkyong\", 30),\r\n new Person(\"jack\", 20),\r\n new Person(\"lawrence\", 40)\r\n );\r\n\r\n Person result1 = persons.stream() // Convert to steam\r\n .filter(x -> \"jack\".equals(x.getName())) // we want \"jack\" only\r\n .findAny() // If 'findAny' then return found\r\n .orElse(null); // If not found, return null\r\n\r\n System.out.println(result1);\r\n \r\n \r\n \r\n \r\n //A List of Strings to Uppercase\r\n List<String> alpha = Arrays.asList(\"a\", \"b\", \"c\", \"d\");\r\n // Java 8\r\n List<String> collect = alpha.stream().map(String::toUpperCase).collect(Collectors.toList());\r\n System.out.println(collect); //[A, B, C, D]\r\n\r\n\t}", "public static void main(String[] str) {\n\t\tList<Order> orderListByName = getOrderList();\n\t\tCollections.sort(orderListByName, (o1, o2)-> o1.getOrderName().compareTo(o2.getOrderName()) );\n\t\n\t\t// sort order by order name\n\t\tList<Order> orderListByOrderBill = getOrderList();\n\t\tCollections.sort(orderListByOrderBill, (o1, o2)-> o1.getOrderBillAmount().compareTo(o2.getOrderBillAmount()));\n\t\t}", "public void sortByGiftCardAmounts(ArrayList sortedList) {\r\n Collections.sort(sortedList, GIFT_CARD_AMOUNT_COMPARATOR);\r\n }" ]
[ "0.7342798", "0.62204266", "0.61799073", "0.61594415", "0.5991168", "0.5972254", "0.59635943", "0.5947595", "0.5941119", "0.5855189", "0.5837831", "0.5768275", "0.57673025", "0.5755676", "0.57053995", "0.569247", "0.56918305", "0.5656489", "0.5646564", "0.56400543", "0.5594065", "0.555073", "0.5544332", "0.54921484", "0.5471297", "0.5453561", "0.5452771", "0.54420114", "0.5412028", "0.5405564", "0.5388735", "0.53541476", "0.53364563", "0.53337026", "0.53238183", "0.5318211", "0.53177744", "0.5314843", "0.53037375", "0.52985334", "0.52893054", "0.527287", "0.5268519", "0.5248145", "0.52429605", "0.524115", "0.5238302", "0.5237481", "0.52297735", "0.5215306", "0.52144814", "0.5211255", "0.519791", "0.5196387", "0.51936364", "0.5179941", "0.5177715", "0.5176258", "0.5154534", "0.51531273", "0.515302", "0.51528454", "0.51497316", "0.5149567", "0.5148911", "0.5148353", "0.5145366", "0.5138656", "0.51326215", "0.5130164", "0.51258016", "0.51164067", "0.5115764", "0.5115227", "0.51142335", "0.51043224", "0.5095536", "0.5094542", "0.5092956", "0.5086176", "0.5076831", "0.50754595", "0.5075409", "0.5068398", "0.5059972", "0.505883", "0.5046292", "0.5033962", "0.5032742", "0.50316584", "0.50249934", "0.50115764", "0.50103015", "0.50040156", "0.4994846", "0.4986915", "0.49619782", "0.49608678", "0.49576083", "0.49528253" ]
0.68962926
1
Runs when the job is started
@Override public boolean onStartJob(JobParameters job) { Log.d(LOG_TAG, "Sync job started..."); new Thread(new SyncRunnable(job)).start(); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void beforeJobExecution() {\n\t}", "private void scheduleJob() {\n\n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tSystem.out.println(\"onStart\");\n\t\t\t\tif(listener!=null) listener.onMessage(\"onStart\");\n\t\t\t\tisRun = true;\n\t\t\t}", "private void startJobs() {\n List<JobProfile> profileList = getJobConfDb().getAcceptedJobs();\n for (JobProfile profile : profileList) {\n LOGGER.info(\"init starting job from db {}\", profile.toJsonStr());\n addJob(new Job(profile));\n }\n }", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "public void startTask() {\n\t}", "@Override\n public void taskStarting() {\n\n }", "@Override\r\n\tpublic void doBeforeJob() {\n\r\n\t}", "@Override\n public void start() {}", "@Override\n public boolean onStartJob(JobParameters params) {\n Log.d(TAG, \"Job started\");\n doBackgroundWork(params);\n\n return true;\n }", "public void start() {}", "public void start() {}", "@Override\r\n public void start() {\r\n }", "@Override\r\n\tpublic void start() {\n\t\t\r\n\t}", "protected void start() {\n }", "@Override\n public void start() { }", "@Override\n public void start() {\n }", "@Override public void start() {\n }", "public void start() {\n\n\t}", "private void start() {\n\n\t}", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n\tpublic void start() {\n\t}", "@Override\n\tpublic void start() {\n\t}", "@Override\n\tpublic void start() {\n\n\t}", "public void start() {\n }", "void onStarted();", "@Override\n public void start() {\n\n }", "@Override\n public void start() {\n\n }", "@Override\n public void start() {\n\n }", "public void start()\n {\n VoltDB.instance().schedulePriorityWork(\n this,\n 1,\n 1,\n TimeUnit.SECONDS);\n }", "@Override\n\tpublic void beforeJob(JobExecution arg0) {\n\t\t\n\t}", "public abstract void started();", "public void start()\n {\n }", "@Override\n public boolean onStartJob(JobParameters jobParameters) {\n Log.d(TAG, \"Job started!\");\n isWorking = true;\n // We need 'jobParameters' so we can call 'jobFinished'\n startWorkOnNewThread(jobParameters); // Services do NOT run on a separate thread\n\n return isWorking;\n }", "public void start() {\n\t\t\n\t}", "public void start() {\n\t\t\n\t}", "@Override\r\n\tpublic synchronized void start() {\n\t\tsuper.start();\r\n\t}", "public void start(){\n }", "public void start() {\n\n }", "@Override\n public synchronized void start()\n {\n if (run)\n return;\n run = true;\n super.start();\n }", "@Override\n\tpublic void start() {\n\t\t\n\t}", "@Override\n\tpublic void start() {\n\t\t\n\t}", "@Override\n\tpublic void start() {\n\t\t\n\t}", "@Override\n\tpublic void start() {\n\t\t\n\t}", "public void start(){\n\t\tsuper.start();\n\t}", "@Override\n public final void onStarted(final Run run, final TaskListener listener) {\n String jobName = run.getParent().getDisplayName();\n\n // Process only if job is NOT in blacklist\n if ( isJobTracked(jobName) ) {\n logger.fine(\"Started build!\");\n\n // Grab environment variables\n EnvVars envVars = null;\n try {\n envVars = run.getEnvironment(listener);\n } catch (IOException e) {\n logger.severe(e.getMessage());\n } catch (InterruptedException e) {\n logger.severe(e.getMessage());\n }\n\n // Gather pre-build metadata\n JSONObject builddata = new JSONObject();\n builddata.put(\"hostname\", getHostname(envVars)); // string\n builddata.put(\"job\", jobName); // string\n builddata.put(\"number\", run.number); // int\n builddata.put(\"result\", null); // null\n builddata.put(\"duration\", null); // null\n builddata.put(\"buildurl\", envVars.get(\"BUILD_URL\")); // string\n long starttime = run.getStartTimeInMillis() / this.THOUSAND_LONG; // adjusted from ms to s\n builddata.put(\"timestamp\", starttime); // string\n\n // Add event_type to assist in roll-ups\n builddata.put(\"event_type\", \"build start\"); // string\n\n event(builddata);\n }\n }", "@Override\n\tvoid start() {\n\t\tSystem.out.println(\"starts\");\n\t}", "@Override\n public synchronized void start() {\n\n lifecycleState = LifecycleState.START;\n }", "@Override\n public void onStart() {\n this.dataGenerator = new DataGenerator(this.dataSize, this.dataValues, this.dataValuesBalancing);\n this.dataStream = new DataStream();\n if (this.flowRate != 0)\n this.sleepTime = dataStream.convertToInterval(this.flowRate);\n this.count = 0L;\n// this.me = this.me + \"_\" + getRuntimeContext().getIndexOfThisSubtask();\n new Thread(this::receive).start();\n }", "@Override\n public void onStepStarting(FlowStep flowStep) {\n //getting Hadoop job client\n HadoopStepStats stats = (HadoopStepStats)((HadoopFlowStep)flowStep).getFlowStepStats();\n String assignedJobId = stats.getJobID();\n String jobName = flowStep.getName();\n JobClient jc = stats.getJobClient();\n\n runnigJobs++; //update overall progress\n\n DAGNode<CascadingJob> node = this.dagNodeNameMap.get(jobName);\n if (node == null) {\n log.warn(\"jobStartedNotification - unrecognized operator name found (\"\n + jobName + \") for jobId \" + assignedJobId);\n } else {\n node.getJob().setId(assignedJobId);\n node.getJob().setJobStats(stats);\n addMapReduceJobState(node.getJob(), stats);\n\n dagNodeJobIdMap.put(node.getJob().getId(), node);\n pushEvent(currentFlowId, new Event.JobStartedEvent(node));\n }\n }", "@Override\r\n\tpublic void start() {\n\t\tsuper.start();\r\n\t\t\r\n\t}", "void doManualStart();", "@Override\n public synchronized void start() {\n init();\n }", "public RunProcDefJob() {\n\t}", "void onSuccessfulStarted();", "public void doStart() {\n if (this.mActive == null) {\n a();\n } else {\n com.alipay.mobile.common.task.Log.v(TAG, \"StandardPipeline.start(a task is running, so don't call scheduleNext())\");\n }\n }", "@Override\n\tpublic void doStart() throws Exception {\n\t\tlog.info(\"starting...\");\n\t}", "public void handleStart()\n {\n }", "public void start(){\n\t\tstarted = true;\n\t\tlastTime = System.nanoTime();\n\t}", "public void run() {\n\t\t\t\tIMSScheduleManager.super.startCron();\r\n\t\t\t\t\r\n\t\t\t}", "public void start()\n {}", "public void startExecuting() {}", "public void start() {\n startTime = System.currentTimeMillis();\n }", "void onTaskStart();", "protected void onThreadStart() {\n\t\tparent.startLock.countDown();\n\t\t//wait for all other threads ready\n\t\ttry {\n\t\t\tparent.startLock.await();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tthreadStartTime = new Date();\n\t}", "public void start() {\r\n\t\trunning = true;\r\n\t\trun();\r\n\t}", "@Override\n\t\t\tpublic void beforeJob(JobExecution jobExecution) {\n\t\t\t\t\n\t\t\t}", "public void start() {\r\n\t\tdiscoverTopology();\r\n\t\tsetUpTimer();\r\n\t}", "@Override\n public synchronized void start() {\n m_startTime = getMsClock();\n m_running = true;\n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\", \"onstart\");\n\n\t\t\t}", "public void onStarted(long startedTime);", "@Override\n\tfinal public void execute(ICustomContext context) {\n\n\t\tfinal Job job = initializeJob(context);\n\t\tconfigureJob(job);\n\n\t\t// Callback\n\t\tbeforeJobExecution();\n\n\t\t// Job is run\n\t\tjob.schedule();\n\t}", "public JobManager(){\n //Initialize the job manager for use of the system\n }", "public void start() {\n startTime = System.currentTimeMillis();\n }", "@Override\r\n\tpublic void startCron() {\n\t\tlog.info(\"Start Schedule Manager.\");\r\n\t\tmainThread = new Thread(new Runnable() {\r\n\t\t\t\r\n\t\t\tpublic void run() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tIMSScheduleManager.super.startCron();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\tmainThread.start();\r\n\t}", "@Override\r\n\tprotected void doStart() throws Exception {\n\r\n\t}", "protected abstract void doStart();", "public void start() {\n LOG.entering(CLASS_NAME, \"start\");\n if (state.compareAndSet(STOPPING, STARTED)) {\n // Keep same thread running if STOPPING\n }\n else if (state.compareAndSet(STOPPED, STARTED)) {\n new Thread(this, \"XoaEventProcessor\").start();\n }\n }", "public void start()\n throws JobException\n {\n // Announce our arrival.\n if (_log.isInfoEnabled()) \n _log.info(MsgUtils.getMsg(\"JOBS_READER_STARTED\", _parms.name, \n _queueName, getBindingKey()));\n \n // Start reading the queue.\n readQueue();\n \n // Announce our termination.\n if (_log.isInfoEnabled()) \n _log.info(MsgUtils.getMsg(\"JOBS_READER_STOPPED\", _parms.name, \n _queueName, getBindingKey()));\n }", "@Override\n\tpublic void doJob() {\n\t\tSystem.out.println(\"Studying\");\n\t}", "@Override\n\tpublic void startWork() {\n\t\tSystem.out.println(\"Robot is working\");\n\t}", "public void start() {\n\r\n }", "public void run() {/* THE CODE HERE IS A THE @OVERRIDE FOR START() METHOD */\n\t}", "public static void startWork() {\n System.out.println(\"[ ! ] Start working\");\n workFlag.set(true);\n }", "public void start() { \t\n try {\n \tTask task = new FileTask(fileScanner);\n \tTaskDescription taskDescription = new TaskDescription();\n \ttaskDescription.setName(name + \"-FILE-EP\");\n \ttaskDescription.setTaskGroup(\"FILE-EP\");\n \ttaskDescription.setInterval(interval);\n \ttaskDescription.setIntervalInMs(true);\n \ttaskDescription.addResource(TaskDescription.INSTANCE, task);\n \ttaskDescription.addResource(TaskDescription.CLASSNAME, task.getClass().getName());\n \tstartUpController = new StartUpController();\n \tstartUpController.setTaskDescription(taskDescription);\n \tstartUpController.init(synapseEnvironment);\n\n } catch (Exception e) {\n log.error(\"Could not start File Processor. Error starting up scheduler. Error: \" + e.getLocalizedMessage());\n }\n }", "public void start() {\n\t\tSystem.out.println(\"parent method\");\n\t}", "public CronJobTrigger() {\n init();\n }", "void start() {\n }", "@Override\r\n\tpublic void onStart(ISuite arg0) {\n\t\tbuildTime = getCurrentDate();\r\n\t\tbuildDate = getCurrentTimeStamp();\r\n\t}", "public void startExecution() {\n \n \t\tfinal Thread thread = this.environment.getExecutingThread();\n \t\tthread.start();\n \t\tthis.startTime = System.currentTimeMillis();\n \t}", "@Override\n public void threadStarted() {\n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\",\"onstart\");\n\n\t\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\",\"onstart\");\n\n\t\t\t}" ]
[ "0.7282081", "0.708519", "0.7032158", "0.6967531", "0.6950059", "0.6950059", "0.69261444", "0.6897287", "0.688294", "0.68201", "0.6818587", "0.67837304", "0.67837304", "0.6782441", "0.6774908", "0.6769945", "0.67609227", "0.67575425", "0.6755716", "0.67514807", "0.6741714", "0.67373496", "0.67373496", "0.67373496", "0.67373496", "0.67373496", "0.67373496", "0.67373496", "0.6735064", "0.6735064", "0.6706094", "0.6703338", "0.66993636", "0.66931266", "0.66931266", "0.66931266", "0.66929495", "0.66770494", "0.6670336", "0.6661225", "0.66386783", "0.66337126", "0.66337126", "0.6631801", "0.6624606", "0.6622863", "0.6620238", "0.6612585", "0.6612585", "0.6612585", "0.6612585", "0.66113234", "0.66041505", "0.65921587", "0.65814257", "0.6574215", "0.6565371", "0.65651226", "0.65270174", "0.65032613", "0.6497952", "0.64914435", "0.64913124", "0.6480313", "0.6476954", "0.6468965", "0.64685017", "0.64589095", "0.6444025", "0.64336544", "0.643161", "0.6431284", "0.6426827", "0.6426142", "0.6401126", "0.64007306", "0.639959", "0.63961977", "0.6394368", "0.638932", "0.6386179", "0.63718694", "0.6367426", "0.6359008", "0.63587004", "0.63568014", "0.63531446", "0.63514525", "0.63457835", "0.6341469", "0.6330043", "0.6326584", "0.6321351", "0.63180053", "0.63137865", "0.6308877", "0.6299501", "0.6293972", "0.6287842", "0.6287842" ]
0.6722545
30
Runs when the job is stopped
@Override public boolean onStopJob(JobParameters job) { Log.d(LOG_TAG, "Sync job stopped"); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void stop() {\n \t\t\tif (isJobRunning) cancel();\n \t\t}", "@Override\n public boolean onStopJob(JobParameters job) {\n return true;\n }", "@Override\n protected void onStop() {\n stopService(new Intent(this, MyJobScheduler.class));\n super.onStop();\n }", "@Override\n public boolean onStopJob(JobParameters params) {\n return false;\n }", "@Override\n protected void onStop() {\n stopService(new Intent(this, MyJobService.class));\n super.onStop();\n }", "public void onStop() {\n\t }", "public void stopped();", "@Override\n\t\t\tpublic void onStop() {\n\n\t\t\t}", "@Override\n\t\t\tpublic void onStop() {\n\n\t\t\t}", "@Override\n public void stop() {}", "public void onStop () {\t\t\n\t\t\n\t}", "public void onStop() {\n }", "public abstract void stopped();", "@Override\n public void onStop() {\n }", "public void stop() {}", "@Override\n\t\tpublic void stop() {\n\t\t\t// Nothing to do for now\n\t\t}", "protected void onStop() throws FailedToStopException { }", "@Override\r\n protected void onStop() {\n }", "@Override\r\n public void stop() {\r\n }", "@Override\r\n public void stop() {\r\n }", "public void onStop();", "@Override\n protected void onStop() {\n status = 0;\n super.onStop();\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\r\n public void stop() {\r\n\r\n }", "public void stopping() {\n super.stopping();\n }", "@Override\n public void stop() {\n }", "@Override\n protected void onStop() {\n stopService(new Intent(this, JobSchedulerService.class));\n super.onStop();\n }", "@Override\r\n\tpublic void stop() {\n\t\t\r\n\t}", "@Override\n public void onStop()\n {\n }", "@Override public void stop() {\n }", "@Override\n\tpublic void onStop() {\n\n\t}", "public void onStop() {\n }", "public void onStop() {\n }", "@Override\n public void stop() {\n }", "@Override\n\tpublic void stop() {\n\t}", "@Override\n\tpublic void stop() {\n\t}", "@Override\r\n\tprotected void onStop() {\n\t\t\r\n\t}", "public void stop() {\n }", "public void stop() {\n }", "@Override\n protected void onStop() {\n }", "@Override\n public void stop() {\n\n }", "@Override\n\tpublic void stop()\n\t\t{\n\t\t}", "public void stop() {\n\t}", "@Override\n\tprotected void onStop() {\n\t\tSystem.out.println(\"---onStop---\");\n\t\tsuper.onStop();\n\t}", "@Override\n public boolean onStopJob(JobParameters job) {\n if (mTasksData != null) {\n mTasksData.cancel(true);\n }\n return true;\n }", "@Override public void stop () {\n }", "@Override\n\tprotected void onStop() {\n\t\tSystem.out.println(\"onStop\");\n\t}", "@Override\r\n\tprotected void doStop() throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void onStop() {\n\t\tsuper.onStop();\r\n\t}", "@Override\r\n\tpublic void onStop() {\n\t\tsuper.onStop();\r\n\t}", "@Override\r\n\tpublic void onStop() {\n\t\tsuper.onStop();\r\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@EncoderThread\n protected abstract void onStop();", "@Override\n\t\tprotected void onStop() {\n\t\t\tsuper.onStop();\n\t\t}", "protected void onStop() {\n\t\tsuper.onStop();\r\n\t}", "protected void onStop() {\n\t\tsuper.onStop();\r\n\t}", "@Override\n protected void onStop() {\n \tsuper.onStop();\n \tthread.setThreadExit(true);\n \tthread = null;\n \t\n }", "protected void onStop ()\n\t{\n\t\tsuper.onStop ();\n\t}", "public void stop() {\n\t\t\n\t}", "@Override\n\tpublic void onStop() {\n\t\tsuper.onStop();\n\t}", "@Override\n\tpublic void onStop() {\n\t\tsuper.onStop();\n\t}", "@Override\n\tpublic void onStop() {\n\t\tsuper.onStop();\n\t}", "@Override\n\tpublic void onStop() {\n\t\tsuper.onStop();\n\t}", "public void stop(){\n\t\t\n\t}", "public void stop(){\n }", "@Override\r\n\tprotected void onStop() {\n\t\tsuper.onStop();\r\n\t}", "@Override\r\n\tprotected void onStop() {\n\t\tsuper.onStop();\r\n\t}", "@Override\r\n\tprotected void onStop() {\n\t\tsuper.onStop();\r\n\t}", "@Override\n\tpublic void stop() {\n\t\tstopTask();\n\t\tmPlaybillPath = null;\n\t\tmResPlaybill = null;\n\t}", "public void stopWork() {\n stopWork = true;\n }", "@Override\n\tprotected void onStop() {\n\t\tsuper.onStop();\n\t\tSystem.out.println(\"onStop...\");\n\t}", "public void stop()\n {\n }", "private void stop()\n {\n if(running)\n {\n scheduledExecutorService.shutdownNow();\n running = false;\n }\n }", "public void stopping();", "public void onStop() {\n\n }", "@Override\n public void doStop() {\n loc = null;\n sensors().set(SERVICE_STATE, Lifecycle.STOPPING);\n sensors().set(SERVICE_UP, false);\n sensors().set(SERVICE_STATE, Lifecycle.STOPPED);\n }", "@Override\n\tprotected void onStop()\n\t{\n\t\tsuper.onStop();\n\t}", "@Override\n\tprotected void onStop() {\n\t\tsuper.onStop();\n\t}", "@Override\n\tprotected void onStop() {\n\t\tsuper.onStop();\n\t}", "@Override\n\tprotected void onStop() {\n\t\tsuper.onStop();\n\t}", "@Override\n\tprotected void onStop() {\n\t\tsuper.onStop();\n\t}", "@Override\n\tprotected void onStop() {\n\t\tsuper.onStop();\n\t}", "@Override\n\tprotected void onStop() {\n\t\tsuper.onStop();\n\t}" ]
[ "0.7679481", "0.7384585", "0.7330686", "0.73277533", "0.73160166", "0.7285944", "0.727875", "0.72000724", "0.72000724", "0.7185586", "0.71746755", "0.7173771", "0.7158877", "0.71486473", "0.7144053", "0.71437716", "0.71392363", "0.70970917", "0.70948863", "0.70948863", "0.70662534", "0.70563024", "0.7055648", "0.7055648", "0.7055648", "0.7055648", "0.7055648", "0.7055648", "0.7055648", "0.7055648", "0.7055648", "0.7055648", "0.7055648", "0.7054949", "0.705342", "0.70380485", "0.7037885", "0.7031878", "0.7031791", "0.70300066", "0.7027565", "0.7020573", "0.7020573", "0.70200914", "0.70164764", "0.70164764", "0.70006615", "0.69953215", "0.69953215", "0.6995052", "0.6986042", "0.6983466", "0.69768447", "0.69705033", "0.6965138", "0.69623756", "0.6958201", "0.6954841", "0.69544953", "0.69544953", "0.69544953", "0.6933", "0.6933", "0.6933", "0.6933", "0.6933", "0.6933", "0.6933", "0.6933", "0.6927626", "0.69268125", "0.6921083", "0.6921083", "0.69152665", "0.69138503", "0.69046474", "0.69042253", "0.69042253", "0.69042253", "0.69042253", "0.6901179", "0.6889266", "0.688803", "0.688803", "0.688803", "0.6887377", "0.6883209", "0.68825555", "0.6878905", "0.6874632", "0.68693346", "0.68580127", "0.68529457", "0.68523073", "0.68426144", "0.68426144", "0.68426144", "0.68426144", "0.68426144", "0.68426144" ]
0.70090365
46
When the sync has completed in a background thread, calls jobFinished()
private void onSyncFinished(JobParameters job) { jobFinished(job, false); // Is a reschedule needed? Log.d(LOG_TAG, "Sync job finished"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void jobFinished(Progress job) {\n }", "protected void finished(){\n if (doFilterUpdate) {\n //runFilterUpdates();\n }\n \n double groupTotalTimeSecs = (System.currentTimeMillis() - (double) groupStartTime) / 1000;\n log.info(\"Job \"+id+\" finished \" /*+ parsedType*/ + \" after \"\n + groupTotalTimeSecs + \" seconds\");\n \n ((DistributedTileBreeder)breeder).jobDone(this);\n }", "synchronized public void jobDone(){ // l'action a été réalisée\n\t\tdone = true; // changement d'état\n\t\tthis.notifyAll(); // on notifie tout le monde\n\t}", "void completeJob();", "protected void synchronizationDone() {\n }", "public void finalizeJob() {\n // override to implement\n }", "void synchronizationDone();", "protected void onThreadFinish() {\n\t\t// notify test finish\n\t\tparent.finishLock.countDown();\n\n\t\t// print finish summary message\n\t\tprintThreadFinishMessage();\n\t}", "public void computationCompleted(ComputationThread thread, WorkSection work);", "protected void afterJobExecution() {\n\t}", "private void scheduleJob() {\n Log.d(TAG, \"Long lived task is done.\");\n }", "public void done() {\n try {\n C1000c.this.mo5101e(get());\n } catch (InterruptedException e) {\n Log.w(\"AsyncTask\", e);\n } catch (ExecutionException e2) {\n throw new RuntimeException(\"An error occurred while executing doInBackground()\", e2.getCause());\n } catch (CancellationException unused) {\n C1000c.this.mo5101e(null);\n } catch (Throwable th) {\n throw new RuntimeException(\"An error occurred while executing doInBackground()\", th);\n }\n }", "@Override\r\n\tpublic void doAfterJob() {\n\r\n\t}", "@Override\n\tvoid finishWork() {\n\t\t\n\t}", "@Override\n\tvoid finishWork() {\n\t\t\n\t}", "public void finished() {\r\n\t\t// Mark ourselves as finished.\r\n\t\tif (finished) { return; }\r\n\t\tfinished = true;\r\n\t\tif (ic != null) {\r\n\t\t\tjvr.removeEventListener(ic);\r\n\t\t\ttry {\r\n\t\t\t\tdx.stopch(dxdev,dx.EV_ASYNC);\r\n\t\t\t}\r\n\t\t\tcatch (JVRException e) { logger.throwing(getClass().getName(),\"finished\",e); }\r\n\t\t}\r\n\t\t// Notify any \"waiters\" that we are done.\r\n\t\tsynchronized (this) { notifyAll(); }\r\n\t\t// Fire an event for asynchronous JVR event listeners.\r\n\t\tnew JVREvent(this,\"finished\").fire();\r\n\t\t// For debugging only.\r\n\t\t// logger.info(\"(FINISHED)\\n\" + this);\r\n\t}", "public void notifyAsyncTaskDone();", "final void waitFinished() {\n if (selectionSyncTask != null) {\n selectionSyncTask.waitFinished();\n }\n }", "public void finish() {\n latch.countDown();\n }", "public void done() {\n AppMethodBeat.i(98166);\n try {\n AsyncTask.this.a(get());\n AppMethodBeat.o(98166);\n } catch (InterruptedException e) {\n AppMethodBeat.o(98166);\n } catch (ExecutionException e2) {\n RuntimeException runtimeException = new RuntimeException(\"An error occured while executing doInBackground()\", e2.getCause());\n AppMethodBeat.o(98166);\n throw runtimeException;\n } catch (CancellationException e3) {\n AsyncTask.this.a(null);\n AppMethodBeat.o(98166);\n }\n }", "public void finishTask() {\n\t\t\n\t}", "@Override\r\n public void tasksFinished()\r\n {\n }", "protected void makeThreadObjectFinish() {\n\t\ttry {\n\t\t\tif (syncCommands != null) {\n\t\t\t\tsyncCommands.join();\n\t\t\t}\n\t\t} catch (Exception e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "public void onFinished();", "public void taskCompleted(FJWorker worker, double time) {\n if (FJSimulator.DEBUG) System.out.println(\"task \"+worker.current_task.path_log_id+\" completed \"+time);\n FJTask task = worker.current_task;\n task.completion_time = time;\n task.completed = true;\n worker.current_task = null;\n \n // check if this task was the last one of a job\n //TODO: this could be more efficient\n boolean compl = true;\n for (FJTask t : task.job.tasks) {\n compl = compl && t.completed;\n }\n task.job.completed = compl;\n \n if (task.job.completed) {\n // it is the last, record the completion time\n task.job.completion_time = time;\n \n // for this type of server it is also the departure time\n task.job.departure_time = time;\n \n // sample and dispose of the job\n if (FJSimulator.DEBUG) System.out.println(\"job departing: \"+task.job.path_log_id);\n jobDepart(task.job);\n \n // service the next job, if any\n feedWorkers(time);\n } else {\n serviceTask(worker, worker.queue.poll(), time);\n }\n }", "public void handleFinish()\n {\n }", "protected void execute() {\n finished = true;\n }", "public synchronized void jobFinished\n\t\t(JobFrontendRef theJobFrontend)\n\t\tthrows IOException\n\t\t{\n\t\tJobInfo jobinfo = getJobInfo (theJobFrontend);\n\t\tdoFinishJob (System.currentTimeMillis(), jobinfo);\n\t\t}", "public void completeTask() {\n completed = true;\n }", "@Override\n public boolean onStopJob(JobParameters job) {\n Log.d(LOG_TAG, \"Sync job stopped\");\n return true;\n }", "public void done() {\n try {\n AsyncTask.this.a(get());\n } catch (InterruptedException e) {\n Log.w(\"AsyncTask\", e);\n } catch (ExecutionException e2) {\n throw new RuntimeException(\"An error occured while executing doInBackground()\", e2.getCause());\n } catch (CancellationException unused) {\n AsyncTask.this.a(null);\n }\n }", "@Override\n public void onFinished() {\n\n }", "protected void onQueued() {}", "@Override\n public void onFinished() {\n\n }", "@Override\n public void onFinished() {\n }", "@Override\n public void onFinished() {\n }", "@Override\r\n\tprotected void progressFinished() {\n\t}", "public void allFinished() {\n\t}", "@Override\n public void onCompleted() {\n System.out.println(\n \"\\n\\tServer is finished!\"\n );\n\n this.latch.countDown();\n }", "@Override\n\tpublic void complete()\n\t{\n\t}", "protected void end() {\n isFinished();\n }", "public Status waitUntilFinished();", "@Override\n\t\tpublic void onCompleted() {\n\t\t}", "protected void fireQueueComplete() {\n for (UploadListener uploadListener : uploadListeners) {\n uploadListener.queueUploadComplete();\n }\n }", "public void finish() {}", "public void complete() {\n\t}", "@Override\n \tpublic void finished()\n \t{\n \t}", "private void doFinishJob\n\t\t(long now,\n\t\t JobInfo jobinfo)\n\t\tthrows IOException\n\t\t{\n\t\tmyLog.log (now, \"Job \" + jobinfo.jobnum + \" finished\");\n\t\tdoCleanupJob (now, jobinfo);\n\t\t}", "public void finished();", "@Override\n protected boolean isFinished() {\n return true;\n }", "public abstract void finished();", "public interface ASyncTaskListener {\n public void onThreadFinished(Object result);\n}", "@Override\n\tprotected void done() {\n\t\t//close the monitor \n\t\tprogressMonitorReporter.closeMonitor();\n\t\t\n\t\t//Inform application that operation isn't being in progress. \n\t\tapplicationInteractor.setOperationInProgress(false);\n\t}", "@Override\n public boolean onStartJob(JobParameters job) {\n Log.d(LOG_TAG, \"Sync job started...\");\n new Thread(new SyncRunnable(job)).start();\n return true;\n }", "@Override\r\n\t\t\tpublic void onCompleted() {\n\r\n\t\t\t}", "@Override\n public boolean isFinished() {\n return true;\n }", "public abstract void finished(Object result);", "public void afterDone() {\n }", "public void afterDone() {\n }", "public void taskComplete() {\n mTasksLeft--;\n if ((mTasksLeft==0) & mHasCloRequest){\n onAllTasksCompleted();\n }\n }", "public void performBatchComplete() {\n ArrayList arrayList = new ArrayList(this.batch);\n this.batch.clear();\n this.mainThreadHandler.sendMessage(this.mainThreadHandler.obtainMessage(8, arrayList));\n logBatch(arrayList);\n }", "@Override\n public boolean isFinished() {\n return complete;\n }", "@Override\r\n\tpublic boolean finishCurrentTask() {\r\n\t\treturn finished;\r\n\t}", "public boolean finished();", "public void finish() {\n\t\ttask.run();\n\t\ttask.cancel();\n\t}", "@Override\n protected boolean isFinished() {\n return true;\n }", "protected void done() {\n\t\ttry {\n\t\t\t// get the result of doInBackground and display it\n\t\t\tresultJLabel.setText(get().toString());\n\t\t} // end try\n\t\tcatch (InterruptedException ex) {\n\t\t\tresultJLabel.setText(\"Interrupted while waiting for results.\");\n\t\t} // end catch\n\t\tcatch (ExecutionException ex) {\n\t\t\tresultJLabel.setText(\"Error encountered while performing calculation.\");\n\t\t} // end catch\n\t}", "@Override\n public boolean completed() {\n return false;\n }", "@Override\n public boolean isFinished() {\n return true;\n }", "public void run() {\n jobDescriptor j = null;\n\n while (!exit) {\n try {\n // wait for work\n syncObject.acquire();\n\n // get next job descriptor\n j = jobQueue.poll();\n if (j == null)\n continue;\n\n j.outputObject.started();\n\n if (!executor.executeTask(new MyRunnable(j.codeToBeExecuted, j.outputObject))) {\n j.outputObject.error(\"... cancelled!\");\n }\n } catch (Throwable e) {\n logger.error(e.getMessage());\n }\n }\n }", "@Override\r\n\tpublic void complete() {\n\r\n\t}", "@Override\n\tpublic void eventFinished() {\n\t\tstatus=EventCompleted;\n\t}", "public void finished() {\n Object obj = get();\n if (obj instanceof Exception)\n mCallback.run(null, (Exception)obj, mRock);\n else\n mCallback.run(obj, null, mRock);\n }", "public void onCompleted() {\n\t\t\n\t\t }", "public abstract Task markAsDone();", "public void waitToFinish()\n {\n while(!this.finished)\n {\n try\n {\n Thread.sleep(1);\n }\n catch (InterruptedException e)\n {\n e.printStackTrace();\n return;\n }\n }\n }", "@Override\n\t\tpublic void onFinish() {\n\t\t}", "@Override\n\t\t\t\t\tpublic void onFinish() {\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void onFinish() {\n\t\t\t\t\t}", "@Override\n public void completed(Integer result, String attachment)\n {\n }", "@Override\n public void run() {\n\n strOut = \"\";\n strErr = \"\";\n nReturnCode = -1;\n exception = null;\n lStart = System.currentTimeMillis();\n lStop = 0;\n\n // Do the work of the thread\n log.debug(\"Calling doWork [\" + getName() + \"]\");\n doWork();\n\n // Set the completion time\n lStop = System.currentTimeMillis();\n\n // Logging\n if (log.isDebugEnabled() || exception != null) {\n StringBuffer sb = new StringBuffer();\n sb.append(\"doWork complete [ + \" + getName() + \"]\\n\");\n sb.append(\"* Start: \" + new Date(lStart) + \"\\n\");\n sb.append(\"* Stop: \" + new Date(lStop) + \"\\n\");\n sb.append(\"* Elapsed: \" + getElapsed(lStop - lStart) + \"\\n\");\n sb.append(\"* Return: \" + nReturnCode + \"\\n\");\n\n if (!strOut.equals(\"\"))\n sb.append(\"* Stdout:\\n\" + strOut + \"\\n\");\n if (!strErr.equals(\"\"))\n sb.append(\"* Stderr:\\n\" + strErr + \"\\n\");\n if (exception != null)\n sb.append(\"* Exception:\\n\" + ErrorHandling.getStackTrace(exception)\n + \"\\n\");\n\n if (exception != null)\n log.error(sb.toString());\n else\n log.debug(sb.toString());\n }\n\n // Notify the main thread of completion\n synchronized (oSync) {\n try {\n log.debug(\"Notifying oSync of completion [\" + getName() + \"]\");\n fDone = true;\n oSync.notify();\n } catch (Exception e) {\n log.error(ErrorHandling.getStackTrace(e));\n }\n }\n }", "@Override\n public boolean isFinished() {\n return isDone;\n }", "@Override\n public boolean isFinished() {\n return isDone;\n }", "public void complete()\n {\n isComplete = true;\n }", "void TaskFinished(Task task) {\n\n repository.finishTask(task);\n }", "@Override\n public void onFinish() {\n }", "@Override\n public void onCompleted() {\n }", "@Override\n public void onCompleted() {\n }", "@Override\n\tpublic void onComplete() {\n\t\tSystem.out.println(\"Its Done!!!\");\n\t}", "void onTaskFinished(A finishedTask, R result);", "@Override\n public void onFinish() {\n EventBus.getDefault().post(new SyncContactsFinishedEvent());\n //to prevent initial sync contacts when the app is launched for first time\n SharedPreferencesManager.setContactSynced(true);\n stopSelf();\n }", "public void done() {\n if (!isCancelled()) {\n try {\n C0637h.this.mo7991a(get());\n } catch (InterruptedException | ExecutionException e) {\n C0637h.this.mo7992a(e.getCause());\n }\n } else {\n C0637h.this.mo7992a((Throwable) new CancellationException());\n }\n }", "@Override\n\t\t\t\t\t\tpublic void finish() {\n\t\t\t\t\t\t\tSystem.out.println(\"下载成功\");\n\t\t\t\t\t\t}", "@Override\n\tpublic void onTaskDone(String result) {\n\t\t\n\t}", "@Override\n\t\tpublic void onFinish() {\n\t\t\tfinalizar();\n\t\t}", "protected void finishExecution() {\r\n\r\n\t}", "protected void finish() {\n }", "@Override\n public void afterFinish() {\n \n }", "@Override\r\n\tprotected boolean isFinished() {\n\t\treturn true;\r\n\t}", "@Override\r\n\tprotected boolean isFinished() {\n\t\treturn true;\r\n\t}" ]
[ "0.7151507", "0.7034199", "0.69863266", "0.6974351", "0.68917555", "0.6668809", "0.65870774", "0.6490893", "0.6362296", "0.6340109", "0.6321839", "0.6309747", "0.6287309", "0.6278736", "0.6278736", "0.62505555", "0.6249185", "0.620791", "0.6179291", "0.6169736", "0.6156029", "0.61385614", "0.6109727", "0.60830337", "0.60741556", "0.6068092", "0.60640115", "0.60493493", "0.6042263", "0.60216016", "0.5994784", "0.59533435", "0.5936663", "0.5925967", "0.59204304", "0.59204304", "0.59063303", "0.5890722", "0.58651924", "0.5854079", "0.5851619", "0.5850224", "0.5847351", "0.58448726", "0.58428186", "0.58415085", "0.5840378", "0.5838984", "0.58358777", "0.5803809", "0.5802221", "0.5791699", "0.5791425", "0.5786543", "0.5784031", "0.57764494", "0.5771756", "0.57664764", "0.57664764", "0.5754574", "0.5749496", "0.5747465", "0.5746241", "0.57445025", "0.57438385", "0.57429236", "0.57407784", "0.5725013", "0.57239634", "0.56977624", "0.5686757", "0.5673006", "0.5671641", "0.56650513", "0.5664594", "0.5653535", "0.56532574", "0.56519246", "0.56519246", "0.5648262", "0.56473297", "0.56472397", "0.56472397", "0.56437874", "0.56428045", "0.56404114", "0.5636619", "0.5636619", "0.56315213", "0.5626243", "0.56164926", "0.5606823", "0.56019187", "0.5590965", "0.5577697", "0.5576474", "0.5571955", "0.5566815", "0.5564945", "0.5564945" ]
0.79219
0
Dispatches a sync for as soon as the network is available
public static void dispatchSyncNow(Context context) { FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(context)); Job syncJob = dispatcher.newJobBuilder() .setTag(SYNC_TAG) .setService(FirebaseSyncJobService.class) .setTrigger(Trigger.NOW) .setRecurring(false) .setReplaceCurrent(true) .setLifetime(Lifetime.UNTIL_NEXT_BOOT) .addConstraint(Constraint.ON_ANY_NETWORK) .build(); dispatcher.mustSchedule(syncJob); Log.d(LOG_TAG, "Sync job dispatched"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void callSync() {\n\n }", "public void requestExtraSync()\n {\n executor.requestExtraSync();\n }", "private void invokeSync()\n \t{\n if (iDeviceList.size() == 0)\n {\n System.out.println(\"No devices found, so nothing to test\");\n return;\n }\n CpDevice device = iDeviceList.get(0);\n System.out.println(\"\\n\\nSync call to device \" + device.getUdn());\n \n CpProxyUpnpOrgConnectionManager1 connMgr = new CpProxyUpnpOrgConnectionManager1(device);\n try {\n GetProtocolInfo points = connMgr.syncGetProtocolInfo();\n System.out.println(\"source is \" + points.getSource() + \"\\nsink is \" + points.getSink());\n } catch (ProxyError pe) { }\n connMgr.dispose();\n \t}", "private void syncNext() {\n Log.d(TAG, \"syncNext +++++\");\n mCurrentSyncRequest = mSyncRequestQueue.getFirstRequest();\n if (mCurrentSyncRequest != null) {\n mIsSyncing = true;\n mCurrentSyncRequest.notifyState(SyncRequest.SyncNotify.SYNC_STATE_START);\n switch (mCurrentSyncRequest.mSyncType) {\n case SyncRequest.SYNC_BACKUP:\n mEngine.sync(ContactsSyncEngine.SYNC_MODE_BACKUP);\n break;\n case SyncRequest.SYNC_RESTORE:\n mEngine.sync(ContactsSyncEngine.SYNC_MODE_RESTORE);\n break;\n case SyncRequest.CHECK_RESTORE_RESULT:\n mEngine.sync(ContactsSyncEngine.SYNC_MODE_CHECK_RESTORE);\n break;\n default:\n break;\n }\n } else {\n Log.d(TAG, \"SyncRequestQueue is empty !\");\n }\n Log.d(TAG, \"syncNext -----\");\n }", "public void submitSyncDeviceTrafficTask() {\n\t\tL.i(this.getClass(), \"SyncDeviceTrafficTask()...\");\n\t\taddTask(new SyncDeviceTrafficTask());\n\t}", "public void forceSend() {\n if(!isAsync()) {\n NoXray.log(Level.WARNING, \"Attempted to force send a sync packet, unnecesaary\");\n Thread.dumpStack();\n return;\n }\n\n while(_event.getAsyncMarker().getProcessingDelay() > 0) {\n decrementAsyncProcessingCountAndSendIfZero();\n }\n }", "void send() {\n if (mInFlight == this) {\n // This was probably queued up and sent during a sync runnable of the last callback.\n // Don't queue it again.\n return;\n }\n if (mInFlight != null) {\n throw new IllegalStateException(\"Sync Transactions must be serialized. In Flight: \"\n + mInFlight.mId + \" - \" + mInFlight.mWCT);\n }\n mInFlight = this;\n if (DEBUG) Slog.d(TAG, \"Sending sync transaction: \" + mWCT);\n if (mLegacyTransition != null) {\n mId = new WindowOrganizer().startLegacyTransition(mLegacyTransition.getType(),\n mLegacyTransition.getAdapter(), this, mWCT);\n } else {\n mId = new WindowOrganizer().applySyncTransaction(mWCT, this);\n }\n if (DEBUG) Slog.d(TAG, \" Sent sync transaction. Got id=\" + mId);\n mMainExecutor.executeDelayed(mOnReplyTimeout, REPLY_TIMEOUT);\n }", "private void doReflexSync() {\n reflexSyncCurrent = IrisUUID.randomUUID();\n final UUID syncToken = reflexSyncCurrent;\n\n syncBackoff.onSuccess();\n Completable.create(sub -> {\n if (!syncToken.equals(reflexSyncCurrent)) {\n sub.onCompleted();\n return;\n }\n\n UUID acc = HubAttributesService.getAccountId();\n UUID plc = HubAttributesService.getPlaceId();\n if (acc == null || plc == null) {\n sub.onError(new Exception(\"not registered\"));\n return;\n }\n\n List<Map<String,Object>> devices = new ArrayList<>(); \n for (Map.Entry<String,HubDeviceService.DeviceProvider> entry : HubDeviceService.devices().entrySet()) {\n HubDeviceService.DeviceProvider prov = entry.getValue();\n\n int numDevices = 0;\n for (HubDeviceService.DeviceInfo info : prov) {\n SyncDeviceInfo sdinfo = new SyncDeviceInfo();\n sdinfo.setProtocol(info.getProtocolAddress());\n\n Address addr = Address.fromString(info.getProtocolAddress());\n ReflexProcessor proc = processors.get(addr);\n\n if (proc != null) {\n sdinfo.setDriver(proc.getDriver());\n sdinfo.setVersion(proc.getVersion().getRepresentation());\n sdinfo.setHash(proc.getHash());\n sdinfo.setAttrs(proc.getSyncState());\n }\n\n Boolean online = info.isOnline();\n if (online != null) {\n sdinfo.setOnline(online);\n }\n\n sdinfo.setDegraded(proc != null && proc.isDegraded());\n devices.add(sdinfo.toMap());\n numDevices++;\n }\n\n log.info(\"syncing hub reflexes: {} protocol reported {} devices\", entry.getKey(), numDevices);\n }\n\n MessageBody msg;\n try {\n log.info(\"syncing hub reflexes: {} devices reported to platform\", devices.size());\n String json = JSON.toJson(devices);\n String compressed = compressAsString(json.getBytes(StandardCharsets.UTF_8));\n\n msg = DeviceService.SyncDevicesRequest.builder()\n .withAccountId(acc.toString())\n .withPlaceId(plc.toString())\n .withDevices(compressed)\n .build();\n } catch (Exception ex) {\n msg = Errors.fromException(ex);\n }\n\n PlatformMessage sync = PlatformMessage.buildRequest(msg, port.getSendPlatformAddress(), DEVICE_SERVICE)\n .withCorrelationId(reflexSyncCurrent.toString())\n .create();\n\n port.send(sync);\n sub.onError(new Throwable(\"again\"));\n })\n .retryWhen(RxIris.retry(syncBackoff))\n .subscribe();\n }", "private void sync() throws Exception {\n final Synchronizer synchronizer = new Synchronizer();\n\n final long start = System.nanoTime();\n synchronizer.synchronize(caller, listener);\n final long stop = System.nanoTime();\n Duration syncDuration = Duration.ofNanos(stop - start);\n\n caller.drainReceivedEventQueue();\n listener.drainReceivedEventQueue();\n\n System.out.printf(\n \"Synced %d events in %d ms%n\",\n caller.getReceivedEvents().size() + listener.getReceivedEvents().size(), syncDuration.toMillis());\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tLooper.prepare();\n\t\t\t\tif (syncArticleContent()) {\n\t\t\t\t\thandler.sendEmptyMessage(OFFLINE_DOWNLOAD);\n\t\t\t\t}\n\t\t\t}", "@Override\n public void run() {\n syncToServer();\n }", "RESPONSE_TYPE doSync(final RequestImpl _requestImpl) throws Exception;", "private synchronized void syncData() {\n try {\n // pulling data from server\n pullData();\n\n // pushing local changes to server\n// recordStatus=2\n pushData();\n// recordStatus=1\n// pushData1();\n } catch (Throwable throwable) {\n Log.d(TAG, \"doWork: \" + throwable.getMessage());\n }\n // Toast.makeText(getApplicationContext(), \".\", Toast.LENGTH_SHORT).show();\n }", "public synchronized void makeAvailable(){\n isBusy = false;\n }", "@Override\n public void sync(){\n }", "public ICancellable sync(RepositorySyncRequest arg0, ResponseHandler<RepositorySyncResponse> arg1) {\n\t\treturn null;\n\t}", "protected void onQueued() {}", "public abstract void onWait();", "public void queueSyn() {\n\t\tflags |= SYN_SEG_WAITING;\n\t}", "public void dispatch(int id, Object data)\n {\n switch (id) {\n case Event.Sync.FAILED:\n case Event.Sync.CANCELLED:\n case Event.Sync.CANCELLING: \n case Event.Sync.SUCCESSFULL:\n running = false;\n break;\n\n case Event.Sync.SYNCING:\n break;\n }\n\n if (dispatcher != null) {\n dispatcher.notifyEvent(Event.Context.SYNC, id, data);\n }\n }", "public void syncStart(SyncRequest request) {\n boolean isAdd = mSyncRequestQueue.addRequest(request, mCurrentSyncRequest);\n if (isAdd) {\n if (!mIsSyncing) {\n syncNext();\n }\n }\n }", "public void submitSyncAllTrafficTask() {\n\t\tL.i(this.getClass(), \"SyncAllTrafficTask()...\");\n\t\tsubmitSyncDeviceTrafficTask();\n\t\taddTask(new SyncAppsTrafficTask());\n\t\tthis.runTask();\n\t}", "public void runOnAvailableCallback() {\n onAvailableCallback.run();\n }", "@Override public void onPerformSync(\n Account account,\n Bundle extras,\n String authority,\n ContentProviderClient provider,\n SyncResult syncResult) {\n broadcastSyncStatus(SyncManager.STARTED);\n\n Intent syncFailedIntent =\n new Intent(getContext(), SyncManager.SyncStatusBroadcastReceiver.class);\n syncFailedIntent.putExtra(SyncManager.SYNC_STATUS, SyncManager.FAILED);\n\n Intent syncCanceledIntent =\n new Intent(getContext(), SyncManager.SyncStatusBroadcastReceiver.class);\n syncCanceledIntent.putExtra(SyncManager.SYNC_STATUS, SyncManager.CANCELED);\n\n // If we can't access the Buendia API, short-circuit. Before this check was added, sync\n // would occasionally hang indefinitely when wifi is unavailable. As a side effect of this\n // change, however, any user-requested sync will instantly fail until the HealthMonitor has\n // made a determination that the server is definitely accessible.\n if (App.getInstance().getHealthMonitor().isApiUnavailable()) {\n LOG.e(\"Abort sync: Buendia API is unavailable.\");\n broadcastSyncStatus(SyncManager.FAILED);\n return;\n }\n\n try {\n checkCancellation(\"before work started\");\n } catch (CancellationException e) {\n broadcastSyncStatus(SyncManager.CANCELED);\n return;\n }\n\n // Decide which phases to do. If FULL_SYNC is set or no phases\n // are specified, do them all.\n Set<SyncPhase> phases = new HashSet<>();\n for (SyncPhase phase : SyncPhase.values()) {\n if (extras.getBoolean(phase.name())) {\n phases.add(phase);\n }\n }\n boolean fullSync = phases.isEmpty() || extras.getBoolean(SyncOption.FULL_SYNC.name());\n if (fullSync) {\n Collections.addAll(phases, SyncPhase.values());\n }\n\n LOG.i(\"Requested phases are: %s\", phases);\n broadcastSyncProgress(0, R.string.sync_in_progress);\n TimingLogger timings = new TimingLogger(LOG.tag, \"onPerformSync\");\n\n BuendiaProvider buendiaProvider = (BuendiaProvider) provider.getLocalContentProvider();\n try (DatabaseTransaction tx = buendiaProvider.startTransaction(SYNC_SAVEPOINT_NAME)) {\n try {\n if (fullSync) {\n storeFullSyncStartTime(provider, Instant.now());\n }\n\n float progressIncrement = 100.0f/phases.size();\n int completedPhases = 0;\n for (SyncPhase phase : SyncPhase.values()) {\n if (phases.contains(phase)) {\n LOG.i(\"--- Begin %s ---\", phase);\n checkCancellation(\"before \" + phase);\n broadcastSyncProgress((int) (completedPhases * progressIncrement), phase.message);\n phase.runnable.sync(mContentResolver, syncResult, provider);\n timings.addSplit(phase.name() + \" phase completed\");\n completedPhases++;\n }\n }\n broadcastSyncProgress(100, R.string.completing_sync);\n\n if (fullSync) {\n storeFullSyncEndTime(provider, Instant.now());\n }\n } catch (CancellationException e) {\n LOG.i(e, \"Sync canceled\");\n tx.rollback();\n // Reset canceled state so that it doesn't interfere with next sync.\n broadcastSyncStatus(SyncManager.CANCELED);\n return;\n } catch (OperationApplicationException e) {\n LOG.e(e, \"Error updating database during sync\");\n tx.rollback();\n syncResult.databaseError = true;\n broadcastSyncStatus(SyncManager.FAILED);\n return;\n } catch (Throwable e) {\n LOG.e(e, \"Error during sync\");\n tx.rollback();\n syncResult.stats.numIoExceptions++;\n broadcastSyncStatus(SyncManager.FAILED);\n return;\n }\n }\n timings.dumpToLog();\n broadcastSyncStatus(SyncManager.COMPLETED);\n LOG.i(\"onPerformSync completed\");\n }", "@Override\n\tpublic void startSync() throws Exception {\n\t}", "public void sync()\n {\n setAutoSync(false);\n // simply send sync command\n super.executionSync(Option.SYNC);\n }", "void sync() throws IOException;", "@SuppressWarnings(\"static-access\")\r\n\t\t@Override\r\n\t\tpublic void run() {\r\n\t\t\tsetName(C_THREAD);\r\n\t\t\tif(controller == MultiController.TCP) {\r\n\t\t\t\tnetworkHandling = new NetworkHandling(tcpHandler);\r\n\t\t\t\tnetworkHandling.establishConnection();\r\n\t\t\t\t\r\n\t\t\t\ttry { \r\n\t\t\t\t\t//Wait until the lock is released - wait for connection\r\n\t\t\t\t\tnetworkHandling.lock.acquire(); \r\n\t\t\t\t} catch (InterruptedException e) { }\r\n\t\t\r\n\t\t\t\tfinished(networkHandling.isConnected());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(controller == MultiController.BLUETOOTH) {\r\n\t\t\t\tbluetoothHandling = new BluetoothHandling(getApplicationContext(),bluetoothHandler);\r\n\t\t\t\tbluetoothHandling.start();\r\n\t\t\t\t\r\n\t\t\t\tIntent intent = new Intent(getApplicationContext(),DeviceListActivity.class);\r\n\t\t\t\tstartActivityForResult(intent, BluetoothHandler.REQUEST_ADDRESS);\r\n\t\t\t\t\r\n\t\t\t\tfinReq = true;\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\t//Wait until the lock is released - wait for connection\r\n\t\t\t\t\tbluetoothHandling.lock.acquire();\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tfinished(bluetoothHandling.getState() == BluetoothHandling.STATE_CONNECTED);\r\n\t\t\t}\r\n\t\t}", "public boolean needsSync() {\n return myNeedsSync;\n }", "Boolean autoSync();", "public void submitMonitorDeviceTrafficTask() {\n\t\tL.i(this.getClass(), \"MonitorDeviceTrafficTask()...\");\n\t\taddTask(new MonitorDeviceTrafficTask());\n\t}", "public interface INetworkHandler<T> extends Runnable {\n\n /**\n * The main method which starts the protocol implementation.\n * <p>\n * {@inheritDoc}\n */\n void run();\n\n /**\n * Sends the request of the network handler to all online peers of the node.\n *\n * @throws ConnectionFailedException If the other online clients can not be determined\n */\n void sendRequest(IRequest request)\n throws ConnectionFailedException;\n\n /**\n * Blocks until all notified clients have responded\n *\n * @throws InterruptedException If the thread got interrupted while waiting\n */\n void await()\n throws InterruptedException;\n\n /**\n * Blocks for the given timeout.\n *\n * @param timeout The timeout to wait\n * @param timeUnit The time unit which qualifies the timeout\n *\n * @throws InterruptedException If the thread got interrupted while waiting\n */\n void await(long timeout, TimeUnit timeUnit)\n throws InterruptedException;\n\n /**\n * Returns true once all notified clients have responded.\n *\n * @return True, if all notified clients have responded, false otherwise.\n */\n boolean isCompleted();\n\n /**\n * Returns the progress until this handler's communication\n * is considered complete (See {@link INetworkHandler#isCompleted()}).\n *\n * Returns values between 100 and 0 (inclusive).\n *\n * @return The progress\n */\n int getProgress();\n\n\n /**\n * Returns the final result of the exchange.\n * Note, that the result may be null before all clients have responded.\n *\n * @return The result once the all necessary clients responded. May be null before all clients have responded\n */\n T getResult();\n}", "public void sync() {\n\t\tif (!validState) {\n\t\t\tthrow new InvalidStateException();\n\t\t}\n\t\tif (useMmap) {\n\t\t\tsyncAllMmaps();\n\t\t}\n\t\tif (fileChannel != null) {\n\t\t\ttry {\n\t\t\t\tfileChannel.force(false);\n\t\t\t} catch (Exception ign) {\n\t\t\t}\n\t\t}\n\t\tif (callback != null) {\n\t\t\tcallback.synched();\n\t\t}\n\t}", "@Override\n public void run() {\n while (LANSyncServer.IS_CLIENT_ALIVE) {\n try {\n LANSyncServer.smsserver.sendMessage(HandleProcess.REFRESH_REQUEST_MESSAGE);\n Thread.sleep(6000);\n } catch (InterruptedException ex) {\n Logger.getLogger(SyncRequestServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "public void acquireNetwork(final String requestId) throws MmsNetworkException {\n synchronized (this) {\n mMmsRequestCount += 1;\n /* Delete by SPRD for bug 542996 Start */\n //if (mNetwork != null) {\n // Already available\n // LogUtil.d(requestId, \"MmsNetworkManager: already available\");\n // return;\n //}\n // Not available, so start a new request if not done yet\n //if (mNetworkCallback == null) {\n // LogUtil.d(requestId, \"MmsNetworkManager: start new network request\");\n // startNewNetworkRequestLocked();\n //}\n /* Delete by SPRD for bug 542996 End */\n /* Add by SPRD for bug 542996 Start */\n if (mReleaseNwHandler == null) {\n HandlerThread thread = new HandlerThread(\"MmsNetworkManager\");\n thread.start();\n mReleaseNwHandler = new NetworkRelease(thread.getLooper());\n }\n\n if ((mPendingReleaseMmsNetworkManager.get() != null)\n && (mPendingReleaseMmsNetworkManager.get().mSubId != mSubId)) {\n LogUtil.d(requestId, \"MmsNetworkManager: different SIM pdp request, currentSubId=\" + mSubId +\n \", pendingSubId=\" + mPendingReleaseMmsNetworkManager.get().mSubId);\n if (mReleaseNwHandler.hasMessages(EVENT_NETWORK_RELEASE_DELAY)) {\n LogUtil.d(\"MmsNetworkManager: remove EVENT_NETWORK_RELEASE_DELAY messages\");\n mReleaseNwHandler.removeMessages(EVENT_NETWORK_RELEASE_DELAY);\n mReleaseNwHandler.sendMessage(mReleaseNwHandler.obtainMessage(EVENT_NETWORK_RELEASE));\n }\n } else {\n LogUtil.d(\"MmsNetworkManager: first request or same sim pdp request, currentSubId =\"\n + mSubId\n + \", pendingSubId = \"\n + ((mPendingReleaseMmsNetworkManager.get() !=\n null ? mPendingReleaseMmsNetworkManager.get().mSubId : null)));\n }\n\n if (mReleaseNwHandler.hasMessages(EVENT_NETWORK_RELEASE_DELAY)) {\n LogUtil.d(\"MmsNetworkManager: remove EVENT_NETWORK_RELEASE_DELAY messages\");\n mReleaseNwHandler.removeMessages(EVENT_NETWORK_RELEASE_DELAY);\n }\n final ConnectivityManager.NetworkCallback current = getNetworkCallback();\n mReleaseNwHandler.post(new Runnable() {\n @Override\n public void run() {\n synchronized (MmsNetworkManager.this) {\n if (mNetwork != null) {\n // Already available\n LogUtil.d(requestId, \"MmsNetworkManager: already available, subId=\" + mSubId);\n MmsNetworkManager.this.notifyAll();\n return;\n }\n LogUtil.d(requestId, \"MmsNetworkManager: start new network request, subId=\" + mSubId);\n // Not available, so start a new request\n synchronized (mNetworkCallbacks) {\n mNetworkCallbacks.add(current);\n }\n startNewNetworkRequestLocked(current);\n }\n }\n });\n /* Add by SPRD for bug 542996 End */\n\n final long shouldEnd = SystemClock.elapsedRealtime() + NETWORK_ACQUIRE_TIMEOUT_MILLIS;\n long waitTime = NETWORK_ACQUIRE_TIMEOUT_MILLIS;\n while (waitTime > 0) {\n try {\n this.wait(waitTime);\n } catch (InterruptedException e) {\n LogUtil.w(requestId, \"MmsNetworkManager: acquire network wait interrupted\");\n }\n if (mNetwork != null) {\n // Success\n return;\n }\n // Calculate remaining waiting time to make sure we wait the full timeout period\n waitTime = shouldEnd - SystemClock.elapsedRealtime();\n }\n // Timed out, so release the request and fail\n LogUtil.d(requestId, \"MmsNetworkManager: timed out\");\n /* Add by SPRD for bug 542996 Start */\n synchronized (mNetworkCallbacks) {\n mNetworkCallbacks.remove(current);\n }\n mMmsRequestCount -= 1;\n releaseRequestLocked(current);\n /* Add by SPRD for bug 542996 End */\n // Delete by SPRD for bug 542996\n //releaseRequestLocked(mNetworkCallback);\n throw new MmsNetworkException(\"Acquiring network timed out\");\n }\n }", "@Override\n\tpublic void run() {\n\t\tdispBlocks();\n\t\tsendData();\n\t}", "@Override\n public void syncState() {\n scheduledCounter.check();\n }", "public void synced() {\n Preconditions.checkNotNull(state);\n state.setState(ENodeState.Synced);\n }", "void sync()throws IOException;", "@MainThread\n void fetchImmediatelyIfNeeded();", "void asyncEventPing();", "@Override\n public void run()\n {\n final long expectedTimeBetweenCalls = TimeUnit.SECONDS.toMillis(1) / MAX_EXPECTED_EXECUTIONS_PER_SECOND;\n\n // Calculate the next call time, the first time should be immediate\n long nextCallTime = System.currentTimeMillis();\n\n // Execute the operation the required number of times\n for(int i = 0; i < NUM_EXECUTIONS; i++)\n {\n // Wait until the next call must be sent\n while(System.currentTimeMillis() < nextCallTime);\n\n // TODO Compute latency for each operation in milliseconds\n\n // Execute the operation, it will sleep for 10 milliseconds\n syncOpSimulator.executeOp();\n\n // TODO Record latency into histogram\n\n // TODO Compute accumulated latency and record it\n\n // Calculate the next time to call execute op\n nextCallTime += expectedTimeBetweenCalls;\n }\n\n finished = true;\n }", "public void submitSyncAppsTrafficTask() {\n\t\tL.i(this.getClass(), \"SyncAppsTrafficTask()...\");\n\t\taddTask(new SyncAppsTrafficTask());\n\t}", "@Override\n\tpublic void sync() throws IOException {\n\t\t\n\t}", "@MainThread\n @Override\n protected void onForceLoad() {\n super.onForceLoad();\n cancelLoadHelper();\n\n makeRequest();\n }", "@Override\n public void run(){\n\n boolean gotReady = false;\n\n try {\n player.sendCommandToPlayer(new Command(CommandTypes.waitingForClientToGetReady , null));\n } catch (IOException e) {\n God.removeOfflinePlayerNotifyOthers(player);\n }\n\n while (! gotReady){\n try {\n Command command = player.receivePlayerRespond();\n\n if(command.getType() == CommandTypes.imReady){\n gotReady = true;\n }\n\n else {\n God.doTheCommand(command);\n }\n\n } catch (IOException e) {\n God.removeOfflinePlayerNotifyOthers(player);\n break;\n }\n }\n }", "public void setSyncStatus(int syncStatus);", "@Override\n public void run() {\n transmit_set();\n }", "public void dispatchNetworkStateChange(NetworkInfo networkInfo) {\n this.handler.sendMessage(this.handler.obtainMessage(9, networkInfo));\n }", "public void RunSync() {\n\t\tInteger numThreads = Runtime.getRuntime().availableProcessors() + 1;\n\t\tExecutorService executor = Executors.newFixedThreadPool(numThreads);\n\t\tSystem.out.println(\"Num Threads: \" + numThreads.toString());\t\n\t\t\n\t\t// Set rate limits so sync will pause and avoid errors\n\t\tRequestLimitManager.addLimit(new Limit(TimeUnit.SECONDS.toNanos(1), 100));\n\t\tRequestLimitManager.addLimit(new Limit(TimeUnit.HOURS.toNanos(1), 36000));\n\n\t\t// Initialize start time for request limits\n\t\tItemSync.initialize();\n\t\tItemSync.setMaxRecords(200000); // @todo Detect the end of valid IDs if possible\n\n\t\t// Add callable instance to list so they can be managed during execution phase\n\t\tArrayList<Callable<ItemSync>> tasks = new ArrayList<Callable<ItemSync>>();\n\t\tfor(int i = 0; i < numThreads; i++) {\n\t\t\ttasks.add(new ItemSync());\n\t\t}\n\n\n\t\t/**\n\t\t * EXECUTION STAGE: Start all sync threads, loop until all threads are finished.\n\t\t * Sleeps at end of check so we aren't hammering the CPU.\n\t\t */\n\t\ttry {\n\t\t\t// Start callables for every ItemSync instance\n\t\t\tList<Future<ItemSync>> futures = executor.invokeAll(tasks);\n\n\t\t\t// Main loop, checks state of thread (future)\n\t\t\tboolean loop = true;\n\t\t\twhile(loop) {\n\t\t\t\tloop = false;\n\t\t\t\tfor(Future<ItemSync> future : futures) {\n\t\t\t\t\tSystem.out.println(future.isDone());\n\t\t\t\t\tif(!future.isDone()) {\n\t\t\t\t\t\tloop = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Waiting...\");\n\t\t\t\tThread.sleep(TimeUnit.SECONDS.toMillis(1));\n\t\t\t}\n\t\t\t\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\t\t\n\n\t\t/**\n\t\t * CLEAN UP STAGE: Threads are done running, clean up\n\t\t */\n\t\tSystem.out.println(\"Shutting down threads\");\n\t\texecutor.shutdown();\n\t\twhile(!executor.isTerminated()) {\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"Finished\");\n\t}", "public void syncHandle() {\n syncOldStream();\n }", "public void synchronousStart() {\n if (getState() < 500) {\n synchronousPrefetch();\n if (getState() < 500) {\n return;\n }\n }\n synchronousSyncStart(getTimeBase().getTime());\n }", "@Override\n protected boolean performTask() {\n Map<WebSocketChannel, ProcessRequest> requests = this.channelManager.getRequests(MessageType.PROCESS_REQUEST);\n if (requests.isEmpty()) {\n return false;\n }\n\n List<Request> l = requests.entrySet().stream()\n .map(e -> new Request(e.getKey(), e.getValue()))\n .collect(Collectors.toList());\n\n dispatch(l);\n\n return false;\n }", "@SuppressWarnings(\"WeakerAccess\")\n protected void makeRequest() {\n if (mCallback == null) {\n CoreLogger.logError(addLoaderInfo(\"mCallback == null\"));\n return;\n }\n\n synchronized (mWaitLock) {\n mWaitForResponse.set(true);\n }\n\n doProgressSafe(true);\n\n Utils.runInBackground(true, new Runnable() {\n @Override\n public void run() {\n try {\n CoreLogger.log(addLoaderInfo(\"makeRequest\"));\n makeRequest(mCallback);\n }\n catch (Exception exception) {\n CoreLogger.log(addLoaderInfo(\"makeRequest failed\"), exception);\n callbackHelper(false, wrapException(exception));\n }\n }\n });\n }", "@DSSink({DSSinkKind.SYNCHRONIZATION_DATA})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:59:45.544 -0500\", hash_original_method = \"42BD69B2114459AD691B3AEBDAE73546\", hash_generated_method = \"C285A4D23EAB85D82915D70E1F66F84C\")\n \npublic Message sendMessageSynchronously(int what) {\n Message msg = Message.obtain();\n msg.what = what;\n Message resultMsg = sendMessageSynchronously(msg);\n return resultMsg;\n }", "@Override\n\t\tpublic void onStatusChanged(int which) {\n\t\t\tgetActivity().runOnUiThread(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\n\t\t\t\t\tboolean syncActive = ContentResolver.isSyncActive(\n\t\t\t\t\t\t\tOdooAccountManager.getAccount(getActivity(), OUser\n\t\t\t\t\t\t\t\t\t.current(getActivity()).getAndroidName()),\n\t\t\t\t\t\t\tsyncOberserverModel.authority());\n\t\t\t\t\tboolean syncPending = ContentResolver.isSyncPending(\n\t\t\t\t\t\t\tOdooAccountManager.getAccount(getActivity(), OUser\n\t\t\t\t\t\t\t\t\t.current(getActivity()).getAndroidName()),\n\t\t\t\t\t\t\tsyncOberserverModel.authority());\n\t\t\t\t\tboolean refreshing = syncActive | syncPending;\n\t\t\t\t\tif (!refreshing) {\n\t\t\t\t\t\tscope.main().refreshDrawer(drawer_tag);\n\t\t\t\t\t}\n\t\t\t\t\tmSyncStatusObserverListener.onStatusChange(refreshing);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "private void proceedAfterPermission() {\n new SDsync().execute();\n\n }", "void trySynchronizeHostData(DataBuffer buffer);", "@MainThread // MainThread since threading is handled by Retrofit\n public abstract LiveData<NetworkModel> fetchFromNetwork();", "public void syncStream() {\n JCudaDriver.cuStreamSynchronize(stream);}", "protected void sync() {\n System.out.println(\"Starting playback thread with \" + terms);\n startThread();\n }", "void flushBlocking();", "public void onDrainComplete();", "@Override\n\tpublic void sync() throws IOException\n\t{\n\n\t}", "@Override\n\tprotected void sync() {\n\n\t\tString key = null;\n\t\ttry {\n\t\t\tkey = DeviceKeyUtils.getDeviceKey(mContext);\n\t\t} catch (RuntimeException e) {\n\t\t\tUtil.logException(e);\n\t\t\tdoneSyncing();\n\t\t}\n\n\t\t/*\n\t\t * We don't really care about the response... we're not going to retry\n\t\t * if the login fails, since it's really only for tracking usage data.\n\t\t */\n\t\tResponse response = mApiService.login(key);\n\n\t\tdoneSyncing();\n\t}", "@Override\n\tprotected void onRegistered(Context context, String registrationId) {\n\t\tnew GCMAsyncTask().execute(registrationId);\n\t}", "private boolean sendRequest() {\n\t\tclSyncNTPMessage _mess = new clSyncNTPMessage();\n\t\t_mess.setOriginateDate(new Date().getTime());\n\t\t\n\t\treturn sendToServer(_mess);\n\t}", "private void sendFitDataSync(final Context context){\n final Date date = new Date();\n HandlerThread ht = new HandlerThread(\"HeartThread\", android.os.Process.THREAD_PRIORITY_BACKGROUND);\n ht.start();\n Handler h = new Handler(ht.getLooper());\n h.post(new Runnable() {\n @Override\n public void run() {\n GoogleApiClient mGoogleAPIClient = new GoogleApiClient.Builder(context)\n .addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() {\n @Override\n public void onConnected(Bundle bundle) {\n Log.d(\"Heart\", \"Connected\");\n }\n\n @Override\n public void onConnectionSuspended(int i) {\n\n }\n })\n .addApi(Wearable.API).build();\n mGoogleAPIClient.blockingConnect(10, TimeUnit.SECONDS);\n /* Sync msg & time to handheld */\n WearableSendSync.sendSyncToDevice(mGoogleAPIClient, WearableSendSync.START_ACTV_SYNC, date);\n WearableSendSync.sendSyncToDevice(mGoogleAPIClient, WearableSendSync.START_HIST_SYNC, date);\n WearableSendSync.sendDailyNotifFileWrapper(mGoogleAPIClient);\n\n }\n });\n }", "@DSSink({DSSinkKind.SYNCHRONIZATION_DATA})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:59:45.552 -0500\", hash_original_method = \"35A5E39A8A1820326BDEA32FA9EDD100\", hash_generated_method = \"CE016FA9F8D335C8879BF83223FA7CD6\")\n \npublic Message sendMessageSynchronously(int what, Object obj) {\n Message msg = Message.obtain();\n msg.what = what;\n msg.obj = obj;\n Message resultMsg = sendMessageSynchronously(msg);\n return resultMsg;\n }", "private void deferredInitialization() {\n HostInfo hostInfo = new HostInfo(repoInfo.host, repoInfo.namespace, repoInfo.secure);\n connection = ctx.newPersistentConnection(hostInfo, this);\n\n this.ctx\n .getAuthTokenProvider()\n .addTokenChangeListener(\n ((DefaultRunLoop) ctx.getRunLoop()).getExecutorService(),\n new TokenProvider.TokenChangeListener() {\n @Override\n public void onTokenChange() {\n operationLogger.debug(\"Auth token changed, triggering auth token refresh\");\n connection.refreshAuthToken();\n }\n\n @Override\n public void onTokenChange(String token) {\n operationLogger.debug(\"Auth token changed, triggering auth token refresh\");\n connection.refreshAuthToken(token);\n }\n });\n\n this.ctx\n .getAppCheckTokenProvider()\n .addTokenChangeListener(\n ((DefaultRunLoop) ctx.getRunLoop()).getExecutorService(),\n new TokenProvider.TokenChangeListener() {\n @Override\n public void onTokenChange() {\n operationLogger.debug(\n \"App check token changed, triggering app check token refresh\");\n connection.refreshAppCheckToken();\n }\n\n @Override\n public void onTokenChange(String token) {\n operationLogger.debug(\n \"App check token changed, triggering app check token refresh\");\n connection.refreshAppCheckToken(token);\n }\n });\n\n // Open connection now so that by the time we are connected the deferred init has run\n // This relies on the fact that all callbacks run on repo's runloop.\n connection.initialize();\n\n PersistenceManager persistenceManager = ctx.getPersistenceManager(repoInfo.host);\n\n infoData = new SnapshotHolder();\n onDisconnect = new SparseSnapshotTree();\n\n transactionQueueTree = new Tree<List<TransactionData>>();\n\n infoSyncTree =\n new SyncTree(\n ctx,\n new NoopPersistenceManager(),\n new SyncTree.ListenProvider() {\n @Override\n public void startListening(\n final QuerySpec query,\n Tag tag,\n final ListenHashProvider hash,\n final SyncTree.CompletionListener onComplete) {\n scheduleNow(\n new Runnable() {\n @Override\n public void run() {\n // This is possibly a hack, but we have different semantics for .info\n // endpoints. We don't raise null events on initial data...\n final Node node = infoData.getNode(query.getPath());\n if (!node.isEmpty()) {\n List<? extends Event> infoEvents =\n infoSyncTree.applyServerOverwrite(query.getPath(), node);\n postEvents(infoEvents);\n onComplete.onListenComplete(null);\n }\n }\n });\n }\n\n @Override\n public void stopListening(QuerySpec query, Tag tag) {}\n });\n\n serverSyncTree =\n new SyncTree(\n ctx,\n persistenceManager,\n new SyncTree.ListenProvider() {\n @Override\n public void startListening(\n QuerySpec query,\n Tag tag,\n ListenHashProvider hash,\n final SyncTree.CompletionListener onListenComplete) {\n connection.listen(\n query.getPath().asList(),\n query.getParams().getWireProtocolParams(),\n hash,\n tag != null ? tag.getTagNumber() : null,\n new RequestResultCallback() {\n @Override\n public void onRequestResult(String optErrorCode, String optErrorMessage) {\n DatabaseError error = fromErrorCode(optErrorCode, optErrorMessage);\n List<? extends Event> events = onListenComplete.onListenComplete(error);\n postEvents(events);\n }\n });\n }\n\n @Override\n public void stopListening(QuerySpec query, Tag tag) {\n connection.unlisten(\n query.getPath().asList(), query.getParams().getWireProtocolParams());\n }\n });\n\n restoreWrites(persistenceManager);\n\n updateInfo(Constants.DOT_INFO_AUTHENTICATED, false);\n updateInfo(Constants.DOT_INFO_CONNECTED, false);\n }", "private void startAsyncLoader() {\n if (CheckInternetConnection.isNetworkAvailable(this)) {\n Log.e(\"connection\", \"connection available\");\n if (getLoaderManager().getLoader(ASYNC_LOADER_ID) == null) {\n getLoaderManager().initLoader(ASYNC_LOADER_ID, null, new UpdateDataInfo()).forceLoad();\n } else {\n getLoaderManager().restartLoader(ASYNC_LOADER_ID, null, new UpdateDataInfo()).forceLoad();\n }\n } else {\n showMessageDialog(getResources().getString(R.string.message), getResources().getString(R.string.no_int), 1);\n }\n }", "@Override\n public void run() {\n load_remote_data();\n }", "@Override\n public void work() {\n if (!lnd_.isRpcReady())\n return;\n\n if (!started_) {\n // NOTE: start protocol to recover in-flight payments' state:\n // - get all payments w/ 'sending' state from db\n // - get all payments from lnd\n // - find 'sending' payments within lnd payments\n // - update found payments, reset state for not-found\n // - delete all payments from lnd to clear it\n // - started_ = true, can process new payments now\n if (!starting_) {\n starting_ = true;\n List<Job> sendingJobs = dao_.getSendingJobs();\n checkPayments(sendingJobs);\n }\n return;\n }\n\n if (!notified_ && nextWorkTime_ > System.currentTimeMillis())\n return;\n\n // reset\n notified_ = false;\n\n List<Job> pending = dao_.getPendingJobs(System.currentTimeMillis());\n for (Job job: pending) {\n WalletData.SendPayment p = (WalletData.SendPayment)job.objects.get(0);\n if (p.paymentHashHex() != null || p.isKeysend()) {\n queryRoutes(job, p);\n } else if (p.paymentRequest() != null) {\n decodePayment(job, p);\n }\n }\n\n nextWorkTime_ = System.currentTimeMillis() + WORK_INTERVAL;\n }", "@Override\r\n public Object connect() {\n if(status()){\r\n //creates thread that checks messages in the network\r\n System.out.println(\"notifying network that connection is good\");\r\n notifyObservers(this);\r\n }\r\n return socket;\r\n }", "public void startSync() {\n mLogger.d(\"Starting silent sync\");\n startSync(new IMediaSyncListener() {\n @Override\n public void step() {\n\n }\n\n @Override\n public void onFinish(int total, int ok, int ko) {\n mLogger.d(\"Silent sync finished, killing the service\");\n SyncService.this.onDestroy();\n }\n });\n }", "void synchronizationDone();", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\twhile(true){\n\t\t\t\tif (client == null){\n\t\t\t\t\tsynchronized(holder){\n\t\t\t\t\t\trestTime = new Date();\n\t\t\t\t\t\tlogger.info(\"进入restRoom\");\n\t\t\t\t\t\tcentralSystem.rest(this);\n\t\t\t\t\t\tholder.wait();\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tthis.proc.process(client);\n client = centralSystem.fetchOne();\t\n if (client != null){\n \tlogger.info(\"领取新任务\");\n } \n\t\t\t\t}\t\t\t\t\n\t\t\t}\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}", "public void startSync(ISyncContext syncContext, String authority, Account account, Bundle extras) {\n if (AbstractThreadedSyncAdapter.ENABLE_LOG) {\n if (extras != null) {\n extras.size();\n }\n Log.d(AbstractThreadedSyncAdapter.TAG, \"startSync() start \" + authority + WifiEnterpriseConfig.CA_CERT_ALIAS_DELIMITER + account + WifiEnterpriseConfig.CA_CERT_ALIAS_DELIMITER + extras);\n }\n try {\n SyncContext syncContextClient = new SyncContext(syncContext);\n Account threadsKey = AbstractThreadedSyncAdapter.this.toSyncKey(account);\n synchronized (AbstractThreadedSyncAdapter.this.mSyncThreadLock) {\n boolean alreadyInProgress;\n if (AbstractThreadedSyncAdapter.this.mSyncThreads.containsKey(threadsKey)) {\n if (AbstractThreadedSyncAdapter.ENABLE_LOG) {\n Log.d(AbstractThreadedSyncAdapter.TAG, \" alreadyInProgress\");\n }\n alreadyInProgress = true;\n } else {\n if (AbstractThreadedSyncAdapter.this.mAutoInitialize && extras != null) {\n if (extras.getBoolean(ContentResolver.SYNC_EXTRAS_INITIALIZE, false)) {\n try {\n if (ContentResolver.getIsSyncable(account, authority) < 0) {\n ContentResolver.setIsSyncable(account, authority, 1);\n }\n syncContextClient.onFinished(new SyncResult());\n } catch (Throwable th) {\n syncContextClient.onFinished(new SyncResult());\n }\n }\n }\n SyncThread syncThread = new SyncThread(AbstractThreadedSyncAdapter.this, \"SyncAdapterThread-\" + AbstractThreadedSyncAdapter.this.mNumSyncStarts.incrementAndGet(), syncContextClient, authority, account, extras, null);\n AbstractThreadedSyncAdapter.this.mSyncThreads.put(threadsKey, syncThread);\n syncThread.start();\n alreadyInProgress = false;\n }\n }\n } catch (Throwable th2) {\n try {\n if (AbstractThreadedSyncAdapter.ENABLE_LOG) {\n Log.d(AbstractThreadedSyncAdapter.TAG, \"startSync() caught exception\", th2);\n }\n throw th2;\n } catch (Throwable th3) {\n if (AbstractThreadedSyncAdapter.ENABLE_LOG) {\n Log.d(AbstractThreadedSyncAdapter.TAG, \"startSync() finishing\");\n }\n }\n }\n }", "public void syncChannel() {\r\n\t\tarrChannels.clear(); // I want to make sure that there are no leftover data inside.\r\n\t\tfor(int i = 0; i < workChannels.size(); i++) {\r\n\t\t\tarrChannels.add(workChannels.get(i));\r\n\t\t}\r\n\t}", "private void submitCollectSysTrafficTask() {\n\t\tL.i(this.getClass(), \"CollectSysTrafficTask()...\");\n\t\taddTask(new CollectSysTrafficTask());\n\t}", "public void sendAsync() {\n\t\tstartTime = System.currentTimeMillis();\n\t\t\n\t\tif(logMINOR) Logger.minor(this, \"Starting async send on \"+this);\n\t\tincRunningBlockTransmits();\n\t\t\n\t\ttry {\n\t\t\tsynchronized(_prb) {\n\t\t\t\t_unsent = _prb.addListener(myListener = new PartiallyReceivedBlock.PacketReceivedListener() {;\n\n\t\t\t\t\tpublic void packetReceived(int packetNo) {\n\t\t\t\t\t\tsynchronized(_senderThread) {\n\t\t\t\t\t\t\tif(_unsent.contains(packetNo)) {\n\t\t\t\t\t\t\t\tLogger.error(this, \"Already in unsent: \"+packetNo+\" for \"+this+\" unsent is \"+_unsent, new Exception(\"error\"));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(_sentPackets.bitAt(packetNo)) {\n\t\t\t\t\t\t\t\tLogger.error(this, \"Already sent packet in packetReceived: \"+packetNo+\" for \"+this+\" unsent is \"+_unsent+\" sent is \"+_sentPackets, new Exception(\"error\"));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_unsent.addLast(packetNo);\n\t\t\t\t\t\t\ttimeAllSent = -1;\n\t\t\t\t\t\t\t_senderThread.schedule();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic void receiveAborted(int reason, String description) {\n\t\t\t\t\t\tonAborted(reason, description);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t_senderThread.schedule();\n\t\t\t\n\t\t\tmfAllReceived = MessageFilter.create().setType(DMT.allReceived).setField(DMT.UID, _uid).setSource(_destination).setNoTimeout();\n\t\t\tmfSendAborted = MessageFilter.create().setType(DMT.sendAborted).setField(DMT.UID, _uid).setSource(_destination).setNoTimeout();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t_usm.addAsyncFilter(mfAllReceived, cbAllReceived, _ctr);\n\t\t\t\t_usm.addAsyncFilter(mfSendAborted, cbSendAborted, _ctr);\n\t\t\t} catch (DisconnectedException e) {\n\t\t\t\tonDisconnect();\n\t\t\t}\n\t\t\t\n\t\t} catch (AbortedException e) {\n\t\t\tonAborted(_prb._abortReason, _prb._abortDescription);\n\t\t}\n\t}", "@Override\n public void onResponse(String response) {\n System.out.print(\"respuesta Server\"+response);\n responseRequest(sync_id);\n /*if (sync_id != 0) {\n responseRequest(sync_id);\n } else {\n background_response = \"ID Sync null\";\n restartRequest(background_response);\n }*/\n }", "@Override\n\t\tpublic void run() {\n\t\t\tURL url;\n\t\t\ttry {\n\t\t\t\tThread.sleep(3000);\n\t\t\t\turl = new URL(strUrl);\n\t\t\t\tURLConnection con = url.openConnection();\n\t\t\t\tcon.connect();\n\t\t\t\tInputStream input = con.getInputStream();\n\t\t\t\tList<Map<String,Object>> temp = json.getListItems(input);\n\t\t\t\tif(temp != null){\n\t\t\t\t\tif(merger.mergeTwoList(list, temp, direction))\n\t\t\t\t\t\tmyHandler.sendEmptyMessage(1);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tmyHandler.sendEmptyMessage(5);\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t}", "@Override\n\tpublic void execute() {\n\t\tcmdReceiver.send();\n\t}", "@CallByThread(\"Netty EventLoop\")\n @Override\n public void run() {\n if (referenced > 0) { // is blocking\n incomingPublishService.drain();\n }\n }", "private void sendUpdateConnectionInfo() {\n\n }", "@Override\n public void run() {\n\n new Thread() {\n\n @Override\n public void run() {\n HttpGet requestForTest = new HttpGet(\"http://m.google.com\");\n try {\n new DefaultHttpClient().execute(requestForTest); // can last...\n responded = true;\n } catch (Exception e) {}\n }\n\n }.start();\n\n try {\n int waited = 0;\n while(!responded && (waited < timeout)) {\n sleep(100);\n if(!responded ) { \n waited += 100;\n }\n }\n } \n catch(InterruptedException e) {} // do nothing \n finally { \n if (!responded) { handler.sendEmptyMessage(0); } \n else { handler.sendEmptyMessage(1); }\n }\n\n }", "void onSynchronizationFailed(SyncException e);", "public void run()\n\t{\n\t\t// The instance of the received broadcast request. 11/29/2014, Bing Li\n\t\tSearchKeywordBroadcastRequest request;\n\t\t// The thread always runs until it is shutdown by the BoundNotificationDispatcher. 11/29/2014, Bing Li\n\t\twhile (!this.isShutdown())\n\t\t{\n\t\t\t// Check whether the notification queue is empty. 11/29/2014, Bing Li\n\t\t\twhile (!this.isEmpty())\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// Dequeue the request. 11/29/2014, Bing Li\n\t\t\t\t\trequest = this.getNotification();\n\t\t\t\t\t// Disseminate the broadcast request to the local node's children. 11/29/2014, Bing Li\n\t\t\t\t\tMemoryMulticastor.STORE().disseminateSearchKeywordRequestAmongSubMemServers(request);\n\t\t\t\t\t// Notify the binder that the thread's task on the request has done. 11/29/2014, Bing Li\n\t\t\t\t\tthis.bind(super.getDispatcherKey(), request);\n\t\t\t\t}\n\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Wait for a moment after all of the existing requests are processed. 11/29/2014, Bing Li\n\t\t\t\tthis.holdOn(ServerConfig.NOTIFICATION_THREAD_WAIT_TIME);\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\t}", "protected void synchronizationDone() {\n }", "protected abstract long waitToTravel();", "public int getSyncStatus();", "void syncImmediately() {\r\n // Utilize the current time as the seed time for each of the RecipeSyncServices\r\n long currentTime = Utilities.getCurrentTime();\r\n\r\n // Initialize and start the Services\r\n Intent allRecipesIntent = new Intent(this, AllRecipesService.class);\r\n allRecipesIntent.putExtra(getString(R.string.extra_time), currentTime);\r\n startService(allRecipesIntent);\r\n\r\n Intent epicuriousIntent = new Intent(this, EpicuriousService.class);\r\n epicuriousIntent.putExtra(getString(R.string.extra_time), currentTime);\r\n startService(epicuriousIntent);\r\n\r\n Intent foodIntent = new Intent(this, FoodDotComService.class);\r\n foodIntent.putExtra(getString(R.string.extra_time), currentTime);\r\n startService(foodIntent);\r\n\r\n Intent seriousIntent = new Intent(this, SeriousEatsService.class);\r\n seriousIntent.putExtra(getString(R.string.extra_time), currentTime);\r\n startService(seriousIntent);\r\n }", "public void notifySyncCompleted(PropertyList syncCompletedEvent);", "@MainThread\n public abstract boolean shouldFetchFromNetwork();", "public interface AsynService {\n void asynMethod();\n}", "protected ResultHolder<S, T> handleASyncServiceCall() {\n\n\t\t// Check we have a service action\n\t\tServiceAction action = getServiceAction();\n\t\tif (action == null) {\n\t\t\tthrow new IllegalStateException(\"No service action provided for polling.\");\n\t\t}\n\n\t\t// Generate a cache key so the polling result can be held\n\t\tif (!isUseCachedResult()) {\n\t\t\t//Generate a key\n\t\t\tsetServiceCacheKey(generateCacheKey());\n\t\t\t// Clear previous result\n\t\t\tsetServiceResult(null);\n\t\t}\n\n\t\t// Check we have a cache key\n\t\tString key = getServiceCacheKey();\n\t\tif (key == null) {\n\t\t\tthrow new IllegalStateException(\"No cache key provided for polling.\");\n\t\t}\n\n\t\t// Start Service action (will return result if already cached)\n\t\ttry {\n\t\t\tResultHolder result = SERVICE_HELPER.handleAsyncServiceCall(getServiceCache(), key, getServiceCriteria(), action);\n\t\t\tsetServiceRunning(true);\n\t\t\treturn result;\n\t\t} catch (RejectedTaskException e) {\n\t\t\t// Could not start service (usually no threads available). Try and start on the next poll.\n\t\t\tLOG.info(\"Could not start service in pool [\" + getServiceThreadPool() + \"]. Will try next poll.\");\n\t\t\tsetServiceRunning(false);\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\n public void run() {\n new ConnectBT().execute();\n }", "public void startCollectSysTrafficTask() {\n\t\tsubmitCollectSysTrafficTask();\n\t}", "SyncStart createSyncStart();" ]
[ "0.66346747", "0.643447", "0.61977726", "0.61440086", "0.61266696", "0.5971272", "0.5899578", "0.5873551", "0.57837105", "0.5738586", "0.5730113", "0.5719214", "0.57124233", "0.5709851", "0.5683954", "0.5662162", "0.56315243", "0.5574711", "0.5574383", "0.55683446", "0.5541052", "0.55335903", "0.5532725", "0.5529036", "0.5509206", "0.55085915", "0.54873985", "0.54861355", "0.5477089", "0.54494274", "0.54404086", "0.54377216", "0.54370236", "0.54254115", "0.5417413", "0.5401671", "0.53842384", "0.5383701", "0.53732026", "0.5370809", "0.53445995", "0.5337095", "0.5336566", "0.5329411", "0.530554", "0.5300144", "0.52977115", "0.52945834", "0.52929235", "0.52886957", "0.5280449", "0.5279055", "0.5273863", "0.5267274", "0.5261263", "0.5250221", "0.52416974", "0.5241506", "0.52410614", "0.5237508", "0.5227052", "0.52243495", "0.5217288", "0.5209911", "0.52089554", "0.51994294", "0.5192137", "0.5187657", "0.51875913", "0.51856273", "0.51772076", "0.517454", "0.51720876", "0.5168129", "0.5166839", "0.5149164", "0.5132393", "0.51306486", "0.5122781", "0.511906", "0.5116814", "0.51146364", "0.5114419", "0.51111", "0.51106524", "0.5106184", "0.51052433", "0.51022625", "0.5090564", "0.5079282", "0.5076277", "0.50757873", "0.50749683", "0.50681734", "0.5065376", "0.5053008", "0.5052205", "0.5050761", "0.5042046", "0.50402266" ]
0.5435903
33
Dispatches a sync for midnight on the day it was triggered; The sync will run as soon as the network is available after midnight
public static void dispatchScheduledSync(Context context) { FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(context)); Job syncJob = dispatcher.newJobBuilder() .setTag(SYNC_TAG_SCHEDULED) .setService(FirebaseSyncJobService.class) .setTrigger(Trigger.NOW) .setRecurring(false) .setReplaceCurrent(true) .setLifetime(Lifetime.UNTIL_NEXT_BOOT) .addConstraint(Constraint.ON_ANY_NETWORK) .build(); dispatcher.mustSchedule(syncJob); Log.d(LOG_TAG, "Recurring sync job dispatched"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void dispatchSyncNow(Context context) {\n FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(context));\n Job syncJob = dispatcher.newJobBuilder()\n .setTag(SYNC_TAG)\n .setService(FirebaseSyncJobService.class)\n .setTrigger(Trigger.NOW)\n .setRecurring(false)\n .setReplaceCurrent(true)\n .setLifetime(Lifetime.UNTIL_NEXT_BOOT)\n .addConstraint(Constraint.ON_ANY_NETWORK)\n .build();\n dispatcher.mustSchedule(syncJob);\n Log.d(LOG_TAG, \"Sync job dispatched\");\n }", "@Override\n public void autonomousPeriodic()\n {\n commonPeriodic();\n }", "public void submitSyncDeviceTrafficTask() {\n\t\tL.i(this.getClass(), \"SyncDeviceTrafficTask()...\");\n\t\taddTask(new SyncDeviceTrafficTask());\n\t}", "private void beginSchedule(){\n\t\tDivaApp.getInstance().submitScheduledTask(new RandomUpdater(this), RandomUpdater.DELAY, RandomUpdater.PERIOD);\n\t}", "void syncImmediately() {\r\n // Utilize the current time as the seed time for each of the RecipeSyncServices\r\n long currentTime = Utilities.getCurrentTime();\r\n\r\n // Initialize and start the Services\r\n Intent allRecipesIntent = new Intent(this, AllRecipesService.class);\r\n allRecipesIntent.putExtra(getString(R.string.extra_time), currentTime);\r\n startService(allRecipesIntent);\r\n\r\n Intent epicuriousIntent = new Intent(this, EpicuriousService.class);\r\n epicuriousIntent.putExtra(getString(R.string.extra_time), currentTime);\r\n startService(epicuriousIntent);\r\n\r\n Intent foodIntent = new Intent(this, FoodDotComService.class);\r\n foodIntent.putExtra(getString(R.string.extra_time), currentTime);\r\n startService(foodIntent);\r\n\r\n Intent seriousIntent = new Intent(this, SeriousEatsService.class);\r\n seriousIntent.putExtra(getString(R.string.extra_time), currentTime);\r\n startService(seriousIntent);\r\n }", "static void scheduleWeatherSync(@NonNull final Context context) {\n Driver driver = new GooglePlayDriver(context);\n FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(driver);\n\n Job syncJob = dispatcher.newJobBuilder()\n .setService(FirebaseJobService.class)\n .setTag(SYNC_TAG)\n .setConstraints(Constraint.ON_ANY_NETWORK)\n .setLifetime(Lifetime.FOREVER) // set how long this sync job persists\n .setRecurring(true)\n .setTrigger(Trigger.executionWindow(\n SYNC_INTERVAL_SEC,\n SYNC_INTERVAL_SEC + SYNC_FLEXTIME_SEC\n ))\n .setReplaceCurrent(true)\n .build();\n\n dispatcher.schedule(syncJob);\n\n }", "@Override\n public void syncState() {\n scheduledCounter.check();\n }", "public void scheduleRecurringContactsSync() {\n Driver driver = new GooglePlayDriver(mContext);\n FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(driver);\n\n // Create the Job to periodically sync Sunshine\n Job syncContactsJob = dispatcher.newJobBuilder()\n /* The Service that will be used to sync contacts's data */\n .setService(FirebaseContanctsSyncJobService.class)\n .setTag(CONTACTS_SYNC_TAG)\n .setConstraints(Constraint.ON_ANY_NETWORK)\n .setLifetime(Lifetime.FOREVER)\n .setRecurring(true)\n .setTrigger(Trigger.executionWindow(\n SYNC_INTERVAL_SECONDS,\n SYNC_INTERVAL_SECONDS + SYNC_FLEXTIME_SECONDS))\n .setReplaceCurrent(true)\n .build();\n\n // Schedule the Job with the dispatcher\n dispatcher.schedule(syncContactsJob);\n Log.d(LOG_TAG, \"Contacts sync job scheduled\");\n }", "@Override\n public void teleopPeriodic()\n {\n commonPeriodic();\n }", "SyncStart createSyncStart();", "public void submitSyncAppsTrafficTask() {\n\t\tL.i(this.getClass(), \"SyncAppsTrafficTask()...\");\n\t\taddTask(new SyncAppsTrafficTask());\n\t}", "public void autonomousPeriodic() {\r\n Scheduler.getInstance().run();\r\n }", "public void autonomousPeriodic() \n {\n Scheduler.getInstance().run();\n }", "@Override\n public void callSync() {\n\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "@Override\n public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "@Override\n public void autonomousPeriodic()\n {\n Scheduler.getInstance().run();\n }", "@Override\n public void autonomousPeriodic() {\n \n Scheduler.getInstance().run();\n \n }", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\t\n\t}", "@Override\n public void autonomousPeriodic() {\n }", "@Override\n public void autonomousPeriodic() {\n }", "@Override\n public void autonomousPeriodic() {\n }", "@Override\n public void autonomousPeriodic() {\n }", "public void autonomousPeriodic() {\r\n\t\tScheduler.getInstance().run();\r\n\t}", "public void autonomousPeriodic() {\r\n }", "public void autonomousPeriodic() {\r\n }", "@Override\n public void autonomousPeriodic() {\n \tbeginPeriodic();\n Scheduler.getInstance().run();\n endPeriodic();\n }", "public void autonomousPeriodic()\r\n {\r\n \r\n }", "public void autonomousPeriodic() {\n }", "public void autonomousPeriodic() {\n }", "@Override\n public void autonomousPeriodic() {\n\n }", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n public void autonomousPeriodic() {\n teleopPeriodic();\n //Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n drive.updateAuto();\n sensor.updateAuto();\n }", "public void submitSyncAllTrafficTask() {\n\t\tL.i(this.getClass(), \"SyncAllTrafficTask()...\");\n\t\tsubmitSyncDeviceTrafficTask();\n\t\taddTask(new SyncAppsTrafficTask());\n\t\tthis.runTask();\n\t}", "public void autonomousPeriodic() {\n \n }", "public void autonomousPeriodic()\n\t{\n\t\tScheduler.getInstance().run();\n\t}", "private void runPeriodic() {\n boolean ok = ScheduledFutureTask.super.runAndReset();\n boolean down = isShutdown();\n // Reschedule if not cancelled and not shutdown or policy allows\n if (ok && !down) {\n updateNextExecutionTime();\n MeasurableScheduler.super.getQueue().add(this);\n }\n // This might have been the final executed delayed\n // task. Wake up threads to check.\n else if (down)\n interruptIdleWorkers();\n }", "public void autonomousPeriodic() {\n\n }", "public void autonomousPeriodic() {\n\n }", "@Override\n public void autonomousPeriodic() {\n\t// updateDiagnostics();9\n\tScheduler.getInstance().run();\n }", "public void onScheduled(long scheduledTime);", "@Override\n public void autonomousPeriodic() {\n \n }", "@Override\n public void teleopPeriodic() {\n \tbeginPeriodic();\n Scheduler.getInstance().run();\n endPeriodic();\n }", "public void teleopPeriodic() {\r\n\t\tScheduler.getInstance().run();\r\n\t}", "@Override\n public void teleopPeriodic()\n {\n Scheduler.getInstance().run();\n }", "public void startScheduling() {\n new Thread(new Runnable() {\n public void run() {\n while(true) {\n try {\n Thread.sleep(30000);\n Calendar c = Calendar.getInstance();\n int min = c.get(Calendar.MINUTE);\n if (((min % 10) == 0) || (min == 0)) {\n boolean action = getLightOnWhenMovementDetectedSchedule().getCurrentSchedule();\n if (action) {\n configureSwitchOnWhenMovement(true);\n } else {\n configureSwitchOnWhenMovement(false);\n }\n action = getLightSchedule().getCurrentSchedule();\n if (action) {\n switchOn();\n } else {\n switchOff();\n }\n saveHistoryData();\n }\n Thread.sleep(30000);\n } catch (InterruptedException e) {\n return;\n } catch (RemoteHomeConnectionException e) {\n e.printStackTrace();\n } catch (RemoteHomeManagerException e) {\n e.printStackTrace();\n }\n }\n }\n }).start(); \n }", "public void sync() {\n new Thread(new Runnable() {\n public void run() {\n\n try {\n syncWeatherData();\n } catch (IOException e) {\n Log.i(\"sync\", \"error syncing weather data\");\n e.printStackTrace();\n }\n try {\n syncEnergyData();\n } catch (IOException e) {\n Log.i(\"sync\", \"error syncing energy data\");\n e.printStackTrace();\n }\n\n Date now = new Date();\n lastUpdated = now.getTime();\n SharedPreferences sharedPref = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);\n SharedPreferences.Editor e = sharedPref.edit();\n e.putLong(\"lastUpdated\", lastUpdated);\n e.commit();\n DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n df.setTimeZone(SimpleTimeZone.getTimeZone(\"US/Central\"));\n\n Log.i(\"sync\", \"consumption \" + getLiveDemand());\n Log.i(\"sync\", \"windmill1 \" + getLiveProduction(1));\n Log.i(\"sync\", \"temp \" + getCurrentTemperature());\n Log.i(\"sync\", \"wind \" + getCurrentWindSpeed());\n }\n }).start();\n\n }", "public void teleopPeriodic() {\r\n Scheduler.getInstance().run();\r\n OI.poll();\r\n }", "@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "public static void configurePeriodicSync(Context context) {\n int syncInterval = 3600; //Integer.parseInt(MovieUtils.getPreferredSyncInterval(context));\n int syncFlexTime = syncInterval / SECONDS_IN_HOUR;\n\n ScoreSyncAdapter.configurePeriodicSync(context, syncInterval, syncFlexTime);\n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "Boolean autoSync();", "public void sync()\n {\n setAutoSync(false);\n // simply send sync command\n super.executionSync(Option.SYNC);\n }", "public void teleopPeriodic()\n\t{\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n public void teleopPeriodic() {\n\tupdateDiagnostics();\n\tScheduler.getInstance().run();\n }", "private void sendFitDataSync(final Context context){\n final Date date = new Date();\n HandlerThread ht = new HandlerThread(\"HeartThread\", android.os.Process.THREAD_PRIORITY_BACKGROUND);\n ht.start();\n Handler h = new Handler(ht.getLooper());\n h.post(new Runnable() {\n @Override\n public void run() {\n GoogleApiClient mGoogleAPIClient = new GoogleApiClient.Builder(context)\n .addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() {\n @Override\n public void onConnected(Bundle bundle) {\n Log.d(\"Heart\", \"Connected\");\n }\n\n @Override\n public void onConnectionSuspended(int i) {\n\n }\n })\n .addApi(Wearable.API).build();\n mGoogleAPIClient.blockingConnect(10, TimeUnit.SECONDS);\n /* Sync msg & time to handheld */\n WearableSendSync.sendSyncToDevice(mGoogleAPIClient, WearableSendSync.START_ACTV_SYNC, date);\n WearableSendSync.sendSyncToDevice(mGoogleAPIClient, WearableSendSync.START_HIST_SYNC, date);\n WearableSendSync.sendDailyNotifFileWrapper(mGoogleAPIClient);\n\n }\n });\n }", "@Override\npublic void autonomousPeriodic() {\n\n}", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n rumbleInYourPants();\n turnSpindleIfNeeded();\n turnWinchIfNeeded();\n if (arcadeDrive != null) \n arcadeDrive.start();\n }", "@Override\n public void teleopPeriodic() {\n // drive.DrivePeriodic();\n controllerMap.controllerMapPeriodic();\n // intake.IntakePeriodic();\n // climb.ClimbPeriodic();\n\n }", "@Override\n public void mySchedule(String date) {\n FastJsonRequest request = new FastJsonRequest(SystemUtils.mainUrl + MethodCode.CLASSSCHEDULE + MethodType.MYSCHEDULEV2, RequestMethod.POST);\n request.add(\"username\", application.getSystemUtils().getDefaultUsername());\n request.add(\"token\", application.getSystemUtils().getToken());\n request.add(\"date\", date);\n request.add(MethodCode.DEVICEID, application.getSystemUtils().getSn());\n request.add(MethodCode.DEVICETYPE, SystemUtils.deviceType);\n request.add(MethodCode.APPVERSION, SystemUtils.getVersionName(context));\n addQueue(MethodCode.EVENT_MYSCHEDULE, request);\n\n\n// startQueue();\n }", "protected void runEachDay() {\n \n }", "public void autonomousPeriodic() {\n \tauto.autonomousPeriodic();\n\t}", "public void onTimeTick() {\n tick++;\n try {\n sendBeaconLog(10);\n } catch (InterruptedException e) {\n }\n if (tick % 10 == 0) {\n sendDirectedPresence();\n }\n }", "@Override\n public void teleopPeriodic() {\n Scheduler.getInstance().run();\n \n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n \n if(switchesSubsystem.readyToFire()) {\n \t\tSmartDashboard.putString(\"DB/String \"+0, \"ready to fire\");\n \t} else {\n \t\tSmartDashboard.putString(\"DB/String \"+0, \"reloading\");\n \t}\n \n SmartDashboard.putString(\"DB/String \"+1, \"Wound switch: \" + switchesSubsystem.isBarDown());\n \tSmartDashboard.putString(\"DB/String \"+2, \"Taut switch: \" + switchesSubsystem.isTaut());\n \tSmartDashboard.putString(\"DB/String \"+3, \"Fired switch: \" + switchesSubsystem.isLauncherFired());\n }", "private void schedule() {\n service.scheduleDelayed(task, schedulingInterval);\n isScheduled = true;\n }", "@Scheduled(cron = \"0 0/30 8-9 * * *\")\n\tpublic void scheduleTaskCustomHourly() {\n\t\tlog.info(\"Cron Task :: Execution Time Every 8:00, 8:30, 9:00, 9:30 O'clock Every Day - {}\", dateTimeFormatter.format(LocalDateTime.now()));\n\t}", "@Override\n public void fetchScheduled(RuleKey ruleKey) {\n }", "public void autonomousPeriodic() {\n // RobotMap.helmsman.trackPosition();\n Scheduler.getInstance().run();\n }", "@Override\n public void run()\n {\n Intent intent = new Intent(context, NotifyService.class);\n intent.putExtra(NotifyService.INTENT_NOTIFY, true);\n intent.putExtra(\"REMINDER\", showInfo);\n PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, 0);\n\n boolean alarmUp = (PendingIntent.getBroadcast(context, 0,\n new Intent(\"is.activites.scheduleActivites.INTENT_NOTIFY\"),\n PendingIntent.FLAG_NO_CREATE) != null);\n\n // Sets an alarm - note this alarm will be lost if the phone is turned off and on again\n if(!alarmUp) am.set(AlarmManager.RTC_WAKEUP, date.getTimeInMillis(), pendingIntent);\n }", "@Override\n public void autonomousPeriodic() \n {\n Scheduler.getInstance().run();\n log();\n }", "@Override\r\n\tpublic void doInitialSchedules() {\n\t}", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n drive.updateTeleop();\n sensor.updateTeleop();\n }", "public void startScheduledTasks(boolean isDayDiff) {\n // if it is a new day, close the library\n if (isDayDiff) {\n requestManager.setState(1);\n }\n\n // check if the hour is within closing time\n int hour = LocalTime.now().getHour();\n if (hour >= closingTime.getHour() || hour < openingTime.getHour()) {\n open();\n close();\n } else {\n close();\n open();\n }\n }", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\tlog();\n\t}", "public void updatePeriodic() {\r\n }", "public void submitMonitorDeviceTrafficTask() {\n\t\tL.i(this.getClass(), \"MonitorDeviceTrafficTask()...\");\n\t\taddTask(new MonitorDeviceTrafficTask());\n\t}", "public void autonomousPeriodic() {\r\n \r\n }", "public void scheduledUpdate() {\n\n if (isUpdating.compareAndSet(false, true)) {\n\n if (getCurrentChannel() != null) {\n\n updateData();\n }\n }\n\n timer.cancel();\n timer.purge();\n\n timer = new Timer();\n timer.scheduleAtFixedRate(new UpdateTask(), 3600000,\n 3600000);\n\n }", "public void run() {\n LocalDateTime currentTime = calendar.getCurrentTime();\n LocalTime closingTime = calendar.getClosingTime();\n LocalTime openingTime = calendar.getOpeningTime();\n\n if (currentTime.getHour() >= closingTime.getHour() || currentTime.getHour() < openingTime.getHour()) {\n requestManager.setState(1); // close\n } else {\n requestManager.setState(0); // open\n }\n }", "@SuppressWarnings(\"deprecation\")\n\t\t@Override\n\t\tpublic void run() {\n\t\t\t\n\t\t\tlogger.info( \"BeaconOn\");\n\t\t\t\n\t\t\tbyte rollingProxyID[] = null;\n\t\t\t\n\t\t\tif ( Crypto.VERSION == 1) {\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tfinal long dayNbr = Crypto.getDayNumber( System.currentTimeMillis());\n\t\t\t\t\tfinal char timeInterval = Crypto.getTimeIntervalNumber( dayNbr);\n\t\t\t\t\t\n\t\t\t\t\tlogger.info( \"BeaconOn: dayNbr: \" + String.valueOf( dayNbr) + \", timeInterval: \" + String.valueOf( (int) timeInterval));\n\t\t\t\t\t\n\t\t\t\t\tfinal String tracingKey = Crypto.getTracingKeyProperty();\n\t\t\t\t\tbyte dailyTracingKey[] = Crypto.getDailyTracingKey( tracingKey, dayNbr);\n\t\t\t\t\trollingProxyID = Crypto.getRollingProxyID( dailyTracingKey, timeInterval);\t\t\n\t\t\t\t\t\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\trollingProxyID = Crypto.getRollingProximityID();\n\t\t\t\t} catch (InvalidKeyException | NoSuchAlgorithmException\n\t\t\t\t\t\t| NoSuchPaddingException | IllegalBlockSizeException\n\t\t\t\t\t\t| BadPaddingException | IOException e) {\n\t\t\t\t\tlogger.severe( e.getMessage());\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tthis.beacon.setStartTime( System.currentTimeMillis());\n\t\t\t\n\t\t\tthis.turnBeaconOn( rollingProxyID);\t\t\n\t\t\tthis.beacon.setState( State.ADVERTISING);\n\t\t\t\n\t\t\t\n\t\t\t// schedule the task to turn beacon off\t\t\t\n\t\t\tBeaconOff beaconOffTask = new BeaconOff( this.beacon);\t\n\t\t\tthis.beacon.beaconTimer.schedule( beaconOffTask, Beacon.getBeaconAdvertisingDuration());\n\t\t\t\n\t\t}", "public void scheduleAlarm() {\n\n Calendar cal = Calendar.getInstance();\n Intent alarmIntent = new Intent(context, PeriodicTransactionService.class);\n alarmIntent.setAction(PeriodicTransactionService.ACTION);\n Bundle bundle = new Bundle();\n bundle.putInt(PeriodicTransactionService.USER_ID_PARAM, userId);\n alarmIntent.putExtras(bundle);\n PendingIntent pintent = PendingIntent.getService(context,\n MyAlarmManager.REQUEST_CODE,\n alarmIntent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n AlarmManager alarm = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n alarm.setInexactRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), 4 * 1000, pintent);\n }", "@Scheduled(cron = \"0 0 8-10 * * *\")\n\tpublic void scheduleTaskHourly() {\n\t\tlog.info(\"Cron Task :: Execution Time Every 8 - 10 O'clock Every Day - {}\", dateTimeFormatter.format(LocalDateTime.now()));\n\t}", "public abstract void schedule();", "@Override\n\tpublic void teleopPeriodic() {\n\t\tOI.refreshAll();\n\t\tScheduler.getInstance().run();\n\t\tlog();\n\t}", "void send() {\n if (mInFlight == this) {\n // This was probably queued up and sent during a sync runnable of the last callback.\n // Don't queue it again.\n return;\n }\n if (mInFlight != null) {\n throw new IllegalStateException(\"Sync Transactions must be serialized. In Flight: \"\n + mInFlight.mId + \" - \" + mInFlight.mWCT);\n }\n mInFlight = this;\n if (DEBUG) Slog.d(TAG, \"Sending sync transaction: \" + mWCT);\n if (mLegacyTransition != null) {\n mId = new WindowOrganizer().startLegacyTransition(mLegacyTransition.getType(),\n mLegacyTransition.getAdapter(), this, mWCT);\n } else {\n mId = new WindowOrganizer().applySyncTransaction(mWCT, this);\n }\n if (DEBUG) Slog.d(TAG, \" Sent sync transaction. Got id=\" + mId);\n mMainExecutor.executeDelayed(mOnReplyTimeout, REPLY_TIMEOUT);\n }" ]
[ "0.63342047", "0.5996821", "0.5919967", "0.589004", "0.5886641", "0.58731973", "0.58548844", "0.58517325", "0.58481634", "0.5836042", "0.5832729", "0.5803721", "0.5782976", "0.5780491", "0.5766398", "0.5766398", "0.5766398", "0.5766398", "0.5766398", "0.5766398", "0.5760471", "0.5748276", "0.57404476", "0.573694", "0.5732423", "0.57194847", "0.57194847", "0.57194847", "0.5719028", "0.5718265", "0.5718265", "0.57097065", "0.57061476", "0.5697765", "0.5697765", "0.56964475", "0.56961775", "0.56961775", "0.56961775", "0.56961775", "0.56913143", "0.56766087", "0.56736636", "0.5661003", "0.5656473", "0.56548953", "0.56298155", "0.56298155", "0.56241965", "0.56235296", "0.5606933", "0.55841404", "0.55709136", "0.55632806", "0.55620974", "0.5552052", "0.5550385", "0.55437225", "0.55437225", "0.55437225", "0.5525946", "0.55235654", "0.55235654", "0.55235654", "0.55235654", "0.5522576", "0.5516803", "0.55007344", "0.5490538", "0.549039", "0.54757565", "0.5472043", "0.5462055", "0.546132", "0.5454676", "0.5433804", "0.5412452", "0.54098135", "0.5405658", "0.5403627", "0.54018885", "0.54001015", "0.5397258", "0.53848046", "0.5379175", "0.53771955", "0.53737074", "0.53706247", "0.53639346", "0.5363786", "0.5356077", "0.53538764", "0.53502727", "0.53486836", "0.5343521", "0.5330052", "0.53250027", "0.5321334", "0.5319753", "0.530322" ]
0.6004485
1
TODO Autogenerated method stub
@Override protected JsonUtil getJsonUtil() { return super.getJsonUtil(); }
{ "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
= new XStream(/new DomDriver()/);
public UE2_0_3Serializer(){ xstream = new XStream(/*new DomDriver()*/); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static XStream createXStream(){\r\n\t\tXStream xstream = new XStream();\r\n\t\txstream.alias(\"configuration\", FilterConfig.class);\r\n\t\txstream.alias(\"filter\", FilterEnumeration.class);\r\n\t\txstream.alias(\"displayable\", DisplayableValue.class);\r\n\t\treturn xstream;\r\n\t}", "private XStream buildXStream() {\r\n\t\tfinal XStream stream = new XStream();\r\n\r\n\t\tstream.setMode(XStream.XPATH_ABSOLUTE_REFERENCES);\r\n\r\n\t\t// Alias these tags so that it does not care about the packages,\r\n\t\t// plus it makes the XML nicer.\r\n\t\tstream.alias(\"Story\", StoryModel.class);\r\n\t\tstream.alias(\"Library\", LibraryModel.class);\r\n\t\tstream.alias(\"Root\", StoryComponentContainer.class);\r\n\t\tstream.alias(\"KnowIt\", KnowIt.class);\r\n\t\tstream.alias(\"StoryComponentContainer\", StoryComponentContainer.class);\r\n\t\tstream.alias(\"AskIt\", AskIt.class);\r\n\t\tstream.alias(\"PickIt\", PickIt.class);\r\n\t\tstream.alias(\"KnowItBinding\", KnowItBinding.class);\r\n\t\tstream.alias(\"Type\", GameType.class);\r\n\t\tstream.alias(\"Slot\", Slot.class);\r\n\t\tstream.alias(\"Binding\", KnowItBinding.class);\r\n\t\tstream.alias(\"Value\", String.class);\r\n\t\tstream.alias(\"DialogueLine\", DialogueLine.class);\r\n\t\tstream.alias(\"DescribeIt\", DescribeIt.class);\r\n\t\tstream.alias(\"DescribeItNode\", DescribeItNode.class);\r\n\t\tstream.alias(\"CodeBlock\", CodeBlock.class);\r\n\t\tstream.alias(\"CodeBlockSource\", CodeBlockSource.class);\r\n\t\tstream.alias(\"CodeBlockReference\", CodeBlockReference.class);\r\n\t\tstream.alias(\"ScriptIt\", ScriptIt.class);\r\n\t\tstream.alias(\"StoryGroup\", StoryGroup.class);\r\n\t\tstream.alias(\"StoryPoint\", StoryPoint.class);\r\n\t\tstream.alias(\"Note\", Note.class);\r\n\t\tstream.alias(\"ControlIt\", ControlIt.class);\r\n\t\tstream.alias(\"CauseIt\", CauseIt.class);\r\n\t\tstream.alias(\"Behaviour\", Behaviour.class);\r\n\t\tstream.alias(\"IndependentTask\", IndependentTask.class);\r\n\t\tstream.alias(\"CollaborativeTask\", CollaborativeTask.class);\r\n\t\tstream.alias(\"ActivityIt\", ActivityIt.class);\r\n\r\n\t\t// Language Dictionary Fragments\r\n\t\tstream.alias(\"LibraryModel\", LibraryModel.class);\r\n\t\tstream.alias(\"LanguageDictionary\", LanguageDictionary.class);\r\n\t\tstream.alias(\"Format\", FormatDefinitionFragment.class);\r\n\t\tstream.alias(\"Indent\", IndentFragment.class);\r\n\t\tstream.alias(\"Line\", LineFragment.class);\r\n\t\tstream.alias(\"Literal\", LiteralFragment.class);\r\n\t\tstream.alias(\"FormatRef\", FormatReferenceFragment.class);\r\n\t\tstream.alias(\"Scope\", ScopeFragment.class);\r\n\t\tstream.alias(\"Series\", SeriesFragment.class);\r\n\t\tstream.alias(\"Fragment\", SimpleDataFragment.class);\r\n\r\n\t\t// the below are aliased for backwards compatibility\r\n\r\n\t\t/* <Insert backwards-compatible aliases here> */\r\n\r\n\t\t// now register all of the leaf-level converters\r\n\t\tstream.registerConverter(new StoryModelConverter());\r\n\t\tstream.registerConverter(new DialogueLineConverter());\r\n\t\tstream.registerConverter(new StoryComponentContainerConverter());\r\n\t\tstream.registerConverter(new KnowItConverter());\r\n\t\tstream.registerConverter(new PickItConverter());\r\n\t\tstream.registerConverter(new AskItConverter());\r\n\t\tstream.registerConverter(new KnowItBindingConverter());\r\n\t\tstream.registerConverter(new GameTypeConverter());\r\n\t\tstream.registerConverter(new SlotConverter());\r\n\t\tstream.registerConverter(new FormatDefinitionFragmentConverter());\r\n\t\tstream.registerConverter(new IndentedFragmentConverter());\r\n\t\tstream.registerConverter(new LineFragmentConverter());\r\n\t\tstream.registerConverter(new LiteralFragmentConverter());\r\n\t\tstream.registerConverter(new FormatReferenceFragmentConverter());\r\n\t\tstream.registerConverter(new ScopeFragmentConverter());\r\n\t\tstream.registerConverter(new SeriesFragmentConverter());\r\n\t\tstream.registerConverter(new SimpleDataFragmentConverter());\r\n\t\tstream.registerConverter(new LibraryModelConverter());\r\n\t\tstream.registerConverter(new LanguageDictionaryConverter());\r\n\t\tstream.registerConverter(new CodeBlockSourceConverter());\r\n\t\tstream.registerConverter(new CodeBlockReferenceConverter());\r\n\t\tstream.registerConverter(new ScriptItConverter());\r\n\t\tstream.registerConverter(new CauseItConverter());\r\n\t\tstream.registerConverter(new StoryGroupConverter());\r\n\t\tstream.registerConverter(new StoryPointConverter());\r\n\t\tstream.registerConverter(new NoteConverter());\r\n\t\tstream.registerConverter(new DescribeItConverter());\r\n\t\tstream.registerConverter(new DescribeItNodeConverter());\r\n\t\tstream.registerConverter(new ControlItConverter());\r\n\t\tstream.registerConverter(new BehaviourConverter());\r\n\t\tstream.registerConverter(new IndependentTaskConverter());\r\n\t\tstream.registerConverter(new CollaborativeTaskConverter());\r\n\t\tstream.registerConverter(new ActivityItConverter());\r\n\r\n\t\tstream.registerConverter(new IdentityArrayListConverter(stream\r\n\t\t\t\t.getMapper()));\r\n\r\n\t\treturn stream;\r\n\t}", "public XStream createXStream()\n\t{\n\t\tXStream xstream = new XStream(new XppDriver());\n\t\t\n\t\txstream.registerConverter(new CalendarConverter(), XStream.PRIORITY_VERY_HIGH);\n//\t\txstream.registerConverter(new JoinedConverter(), XStream.PRIORITY_NORMAL);\n\n//\t\txstream.addImplicitCollection(TeamsTO.class, \"teams\", TeamTO.class);\n//\t\txstream.addImplicitCollection(UsersTO.class, \"users\", UserTO.class);\n\t\t\n//\t\txstream.alias(\"user\", UserTO.class);\n\t\txstream.processAnnotations(UserTO.class);\n//\t\txstream.alias(\"user\", com.jpizarro.th.lib.team.entity.UserTO.class);\n\n//\t\txstream.alias(\"team\", TeamTO.class);\n\t\txstream.processAnnotations(TeamTO.class);\n\t\t\n\t\n//\t\txstream.alias(\"teams\", TeamsTO.class);\n//\t\txstream.alias(\"users\", UsersTO.class);\n\t\t\n\t\t\n//\t\txstream.aliasField(\"users\", TeamTO.class, \"userTOList\");\n\t\t\n\t\txstream.alias(\"exception\", THException.class);\n\t\t\n\t\treturn xstream;\n\t}", "static XStream getXStream() {\r\n XStream xstream = TextWorld.getXStream();\r\n return xstream;\r\n }", "public static XStream retrieveXstream() {\r\n return retrieveXstream(WsRestClassLookup.getAliasClassMap());\r\n }", "@Test\n public void test_CustomizeXstream() {\n //This tests if the stream is customized.\n System.out.println(\"Testing MeasuredRatioModel's customizeXstream(Xstream xstream)\");\n MeasuredRatioModel instance = new MeasuredRatioModel();\n XStream xstream = new XStream();\n instance.customizeXstream(xstream);\n boolean expResult = true;\n boolean result=false;\n String expResult2;\n String result2;\n if(xstream instanceof XStream){\n result=true; \n expResult2=\"http://earth-time.org/projects/upb/public_data/XSD/ValueModelXMLSchema.xsd\";\n result2=instance.getValueModelXMLSchemaURL();\n assertEquals(expResult2,result2); \n }\n assertEquals(expResult,result);\n }", "private XmlStreamFactory()\n {\n /*\n * nothing to do\n */\n }", "public Unknown2XML() {\n reflectUtil = new ReflectUtil();\n// mappers = new HashMap<Class<?>, XMLMapper>();\n }", "public SAXDriver()\n {\n reset();\n }", "private XmlHelper() {}", "@Test\n\tpublic void testExplicitlyConvertEventHandler() {\n\t\tPerson person = new Person();\n XStream xstream = new XStream();\n xstream.registerConverter(new ReflectionConverter(xstream.getMapper(), xstream.getReflectionProvider(), EventHandler.class));\n\n //xstream.fromXML(xml);\n //assertEquals(0, BUFFER.length());\n //array[0].run();\n //assertEquals(\"Executed!\", BUFFER.toString());\n \n try {\n\t\t\tString filename = \"./dynamic_exploit.xml\";\n\t\t\tFile file = new File(filename);\n\t\t\tFileInputStream fis = new FileInputStream(filename);\n\t\t\t//System.out.println(filename);\n\t\t\t\n\t\t\tSystem.out.println(FileUtils.readFileToString(file));\n\t\t\t\n\t\t\txstream.fromXML(fis, person);\n\t\t\t\n\t\t\t//print the data from the object that has been read\n\t\t\t//System.out.println(person.toString());\n\t\t\t\n\t\t} catch (FileNotFoundException ex) {\n\t\t\tex.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n }", "public XMLUtils() {\r\n\t\tsuper();\r\n\t}", "public XMLOutputter() {\r\n }", "public static void main(String[] args) {\n\t\tXStream xstream = new XStreamEx(new DomDriver());\r\n\t\txstream.alias(\"AIPG\", AIPG.class);\r\n\t\txstream.alias(\"INFO\", InfoReq.class);\r\n\t\r\n\t\t\r\n\t\t\r\n\t\txstream.alias(\"RET_DETAIL\", Ret_Detail.class);\r\n \t\txstream.aliasField(\"RET_DETAILS\", Body.class, \"details\");\r\n\t\r\n\r\n\t\t\r\n//\t\txstream.aliasField(\"TRX->CODE1\", Info.class, \"TRX_CODE\");\r\n\t\t\r\n\t\tAIPG g = new AIPG( );\r\n\t\tInfoRsp info = new InfoRsp( );\r\n\t\tinfo.setTRX_CODE(\"-----\");\r\n\t\tinfo.setVERSION(\"03\");\r\n\t\tg.setINFO(info);\r\n\t\t\r\n\t\tBody body = new Body( );\r\n//\t\tTrans_Sum transsum = new Trans_Sum( );\r\n\t\tRet_Detail detail=new Ret_Detail();\r\n\t\tdetail.setSN(\"woshi\");\r\n\t body.addDetail(detail);\r\n\t \r\n\t\t\r\n\t\tg.setBODY(body);\r\n\t\tSystem.out.println(xstream.toXML(g).replaceAll(\"__\", \"_\"));\r\n\t\t\r\n\t\t\r\n\t}", "public abstract String toXML();", "public abstract String toXML();", "public abstract String toXML();", "private DOMs() {\n }", "public DOMParser() { ; }", "public AnXmlTransform() {\n super();\n }", "XMLStreamReader createXMLStreamReader(DataObject sdo);", "private XSLTTransformerFactory() {\r\n\t}", "private void testProXml(){\n\t}", "public <T> T fromXML(final HierarchicalStreamDriver driver, final String xml)\n throws ClassNotFoundException, ObjectStreamException {\n try {\n return fromXML(driver, new StringReader(xml));\n } catch (final ObjectStreamException e) {\n throw e;\n } catch (final IOException e) {\n throw new StreamException(\"Unexpected IO error from a StringReader\", e);\n }\n }", "public XMLPipeline()\r\n throws SAXException {\r\n this(true, true, true, true,\r\n null,\r\n \"org.apache.xerces.parsers.SAXParser\"\r\n );\r\n }", "public static void main(String args[]) {\n new xml().convert();\n }", "PersistenceServiceXStream(XStreamPersistence xstreamPersistence) {\n this.xstreamPersistence = xstreamPersistence;\n }", "public interface SSMLBytesStream {\n\t/**\n\t * Get the (default) encoding.\n\t * This is the default encoding for writeTo() methods (except the 3-parameters).\n\t * @return An explicit encoding for writeTo() methods\n\t * or <code>null</code> (=> use the machine default and no encoding in the xml declaration)\n\t */\n\tCharset getEncoding();\n\n\t/**\n\t * Write the SSML byte[]\n\t * with the &lt;?xml ... ?&gt; declaration\n\t * using the default encoding (if any).\n\t * @throws IOException\n\t * @return\tnumber of written bytes\n\t */\n\tint writeTo(OutputStream out) throws IOException;\n\n\t/**\n\t * A SSMLBytesStream with the possibility to manage the xml declaration and encoding. \n\t *\n\t */\n\tpublic interface SSMLBytesStreamPlus extends SSMLBytesStream {\n\n\t\t/**\n\t\t * Write the SSML byte[]\n\t\t * using a specific encoding.\n\t\t * @param withXmlDecl\tprepend the &lt;?xml ... ?&gt; declaration (with encoding).\n\t\t * @param enc\t(optional) explicit SSML encoding.\n\t\t * \tIf <code>null</code> the default machine encoding will be used.\n\t\t * @throws IOException\n\t\t * @return\tnumber of written bytes\n\t\t */\n\t\tint writeTo(OutputStream out, boolean withXmlDecl, Charset enc) throws IOException;\n\n\t\t/**\n\t\t * Write the SSML byte[]\n\t\t * using the default encoding (if any).\n\t\t * @param withXmlDecl\tprepend the &lt;?xml ... ?&gt; declaration (with encoding).\n\t\t * @throws IOException\n\t\t * @return\tnumber of written bytes\n\t\t */\n\t\tint writeTo(OutputStream out, boolean withXmlDecl) throws IOException;\n\t}\n\n}", "private XhtmlUtils()\n\t{\n\t}", "public void testImportXML() throws RepositoryException, IOException{\n String path = \"path\";\n InputStream stream = new ByteArrayInputStream(new byte[0]);\n session.importXML(path, stream, 0);\n \n sessionControl.replay();\n sfControl.replay();\n \n jt.importXML(path, stream, 0);\n }", "public interface XMLStreamHelper {\n /**\n * Creates and returns an XMLDocument from an XML input stream. The reader\n * must be positioned on a START_DOCUMENT event.\n * \n * @param reader the stream to read\n * @return an XMLDocument created from the stream\n * @throws XMLStreamException if there was a problem reading the stream\n * @throws IllegalStateException if the reader is not positioned on a\n * START_DOCUMENT event\n */\n XMLDocument load(XMLStreamReader reader) throws XMLStreamException, IllegalStateException;\n\n /**\n * Save a XMLDocument to an XML stream.\n * \n * @param document the document to be written\n * @param writer the stream to write to\n * @throws XMLStreamException if there was a problem writing to the stream\n */\n void save(XMLDocument document, XMLStreamWriter writer) throws XMLStreamException;\n\n void save(XMLDocument document, XMLStreamWriter writer, Map options) throws XMLStreamException;\n\n /**\n * Creates and returns a XMLStreamReader that can be used to read an\n * XMLDocument as a XML event stream. The reader will be positioned on a\n * START_DOCUMENT event.\n * \n * @param document the XMLDocument to be read\n * @return an XMLStreamReader that can be used to read the document\n */\n XMLStreamReader createXMLStreamReader(XMLDocument document) throws XMLStreamException;\n\n /**\n * Create a DataObject from an element in a XML stream. The reader must be\n * positioned on a START_ELEMENT event.\n * \n * @param reader the stream to read\n * @return a DataObject created from the element in the stream\n * @throws XMLStreamException if there was a problem reading the stream\n * @throws IllegalStateException if the reader is not positioned on a\n * START_ELEMENT event\n */\n DataObject loadObject(XMLStreamReader reader) throws XMLStreamException, IllegalStateException;\n\n /**\n * Default Type to load DataObject if the element is unqualified/local\n * without xsi:type or the qualified/global element or xsi:type fail to\n * resolve. Can be null.\n */\n String OPTION_DEFAULT_ROOT_TYPE = \"default root type\";\n\n /**\n * Create a DataObject from an element in a XML stream. The reader must be\n * positioned on a START_ELEMENT event.\n * \n * @param reader the stream to read\n * @param options {@link OPTION_DEFAULT_ROOT_TYPE}; can be null or empty\n * @return a DataObject created from the element in the stream\n * @throws XMLStreamException if there was a problem reading the stream\n * @throws IllegalStateException if the reader is not positioned on a\n * START_ELEMENT event\n */\n DataObject loadObject(XMLStreamReader reader, Map options) throws XMLStreamException, IllegalStateException;\n\n /**\n * Save a DataObject to an XML stream.\n * \n * @param sdo the DataObject to be written\n * @param writer the stream to write to\n * @throws XMLStreamException if there was a problem writing to the stream\n */\n void saveObject(DataObject sdo, XMLStreamWriter writer) throws XMLStreamException;\n\n void saveObject(DataObject sdo, XMLStreamWriter writer, Map options) throws XMLStreamException;\n\n /**\n * Creates and returns a XMLStreamReader that can be used to read a\n * DataObject as a XML event stream. The reader will be positioned on a\n * START_ELEMENT event.\n * \n * @param sdo the DataObject to be read\n * @return an XMLStreamReader that can be used to read the DataObject\n */\n XMLStreamReader createXMLStreamReader(DataObject sdo);\n\n HelperContext getHelperContext();\n}", "private XMLUtil()\n {\n }", "private DOMImplementationRegistry() {\n }", "public Document getAsXMLDOM () {\r\n\r\n //code description\r\n\r\n return document;\r\n\r\n }", "public void streamToXML(Element node, XMLStreamer streamer) {\n // TODO Auto-generated method stub\n super.streamToXML(node, streamer);\n }", "public XMLOutputFactoryImpl() {\n }", "private XmlFactory() {\r\n /* no-op */\r\n }", "private XMLUtils()\r\n\t{\r\n\t}", "public SCMLReader() {}", "boolean streamXML(String path,\n ContentHandler contentHandler,\n LexicalHandler lexicalHandler)\n throws SAXException, ProcessingException;", "private XMLUtil() {\n\t}", "public XStream getHackMetadataXstream() {\n XStream xstream = new XStream(new DomDriver(\"UTF-8\"));\n xstream.alias(\"hack\", Hack.class);\n\n ClassAliasingMapper mapper = new ClassAliasingMapper(xstream.getMapper());\n mapper.addClassAlias(\"pattern\", String.class);\n xstream.registerLocalConverter(Hack.class, \"urlPatterns\", new CollectionConverter(mapper));\n\n xstream.alias(\"restriction\", Restriction.class);\n xstream.aliasField(\"restrictions\", Hack.class, \"restrictions\");\n\n xstream.alias(\"configEntryDefinition\", ConfigEntryDefinition.class);\n xstream.aliasField(\"configEntryDefinitions\", Hack.class, \"configEntryDefinitions\");\n\n xstream.alias(\"injectionPoint\", String.class);\n xstream.aliasField(\"injectionPoints\", Hack.class, \"injectionPoints\");\n\n xstream.omitField(Hack.class, \"enabled\");\n\n xstream.alias(\"resource\", HackResource.class);\n xstream.omitField(HackResource.class, \"tempFileName\");\n\n xstream.alias(\"developer\", Developer.class);\n xstream.aliasField(\"developers\", Hack.class, \"developers\");\n\n return xstream;\n }", "public interface XMLParser {\n\n String parse();\n}", "public void transformToSecondXml();", "public XObject(){\n }", "private SAXParserProvider() {\n // empty\n }", "public XmlAdaptedDistributor() {}", "public XObject(){\r\n }", "private DOMImplementationRegistry(Vector srcs) {\n _sources = srcs;\n }", "private XmlUtil() {\n }", "public PersistenceServiceXStream() {\n storageServiceClassName = ConfigurationProperties.getConfiguredStorageService();\n }", "protected XMLRepositoryImpl() {\n }", "public XPathParser(java_cup.runtime.Scanner s) {super(s);}", "public CrossrefUnixrefSaxParser() {\n }", "public mxCodec() {\n this(mxDomUtils.createDocument());\n }", "private static Document parseXML(InputStream stream) throws Exception {\n DocumentBuilderFactory objDocumentBuilderFactory = null;\n DocumentBuilder objDocumentBuilder = null;\n Document doc = null;\n try {\n objDocumentBuilderFactory = DocumentBuilderFactory.newInstance();\n objDocumentBuilder = objDocumentBuilderFactory.newDocumentBuilder();\n doc = objDocumentBuilder.parse(stream);\n } catch (Exception ex) {\n throw ex;\n }\n return doc;\n }", "public RayTracerXMLSceneParser() {\n\t\ttry {\n\t\t\treader = XMLReaderFactory.createXMLReader();\n\t\t\treader.setContentHandler(this);\n\t\t} catch (SAXException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public interface XMLizable {\n\n /**\n * Write this element as an XML DOM element.\n */\n Element toXML();\n\n /**\n * Read this element as the content of the given element.\n */\n void readXML(Element elem) throws XMLSyntaxError;\n}", "@Override\n protected abstract Document parseAsDom(final T input) throws ConversionException;", "public XPathEngineImpl() {\n // Do NOT add arguments to the constructor!!\n }", "private XMLTreeNNExpressionEvaluator() {\n }", "private XMLUtils() {\n }", "public String exportXML() {\n\n\t\tXStream xstream = new XStream();\n\t\txstream.setMode(XStream.NO_REFERENCES);\n\n\t\treturn xstream.toXML(this);\n\t}", "public XML xml() {\n return new XMLDocument(new Xembler(this.dirs).domQuietly());\n }", "protected XMLizer createXMLizer (boolean direct) {\n return (transcomDataXMLizer = new TranscomDataXMLize (direct, logger, expectedIDs));\n }", "protected abstract void fromXmlEx(Element source)\n throws PSUnknownNodeTypeException;", "public static void main(String[] args) {\n new MySaxParserEx(\"ProductCatalog.xml\");\n\n }", "@Override\n public void toXml(XmlContext xc) {\n\n }", "void accept(TmxElementVisitor visitor);", "Element() {\n\t}", "public DocumentBuilderFactoryImpl() {\n super();\n }", "public XmlElement() {\n }", "protected abstract void toXml(PrintWriter result);", "interface dax {\n}", "<R> Streamlet<R> newSource(IRichSpout spout);", "public XMLPipeline(DefaultHandler consumer)\r\n throws SAXException {\r\n this(true, true, true, true,\r\n consumer,\r\n \"org.apache.xerces.parsers.SAXParser\"\r\n );\r\n }", "Object create(InputSource is) throws IOException, SAXException, ParserConfigurationException;", "public static Node transform(Node xmlXML, Node xmlXSL, DOMResult xmlResult)\r\n throws TransformerConfigurationException,\r\n TransformerException \r\n \r\n {\r\n TransformerFactory factory = TransformerFactory.newInstance();\r\n Transformer transformer = factory.newTransformer(new DOMSource(xmlXSL));\r\n //?? In Java 5.0, using Apache Xalan for transformations, when the \r\n //?? following are in the CLASSPATH:\r\n //?? C:\\Apps\\Apache\\xalan-j_2_7_1\\xercesImpl.jar\r\n //?? C:\\Apps\\Apache\\xalan-j_2_7_1\\xml-apis.jar \r\n //?? this call to newTransformer() writes warnings and errors to \r\n //?? stdout, and doesn't throw an exception on warnings. \r\n //??\r\n //?? For errors, the stdout text looks like:\r\n //?? ERROR: 'Unsupported XSL element 'xxxsort'.'\r\n //?? FATAL ERROR: 'Could not compile stylesheet'\r\n //?? and the value of TransformerConfigurationException.getMessage() \r\n //?? is simply:\r\n //?? Could not compile stylesheet\r\n //?? instead of:\r\n //?? javax.xml.transform.TransformerConfigurationException: \r\n //?? javax.xml.transform.TransformerException: \r\n //?? javax.xml.transform.TransformerException: \r\n //?? xsl:xxxsort is not allowed in this position in the stylesheet!\r\n //??\r\n //?? For warnings, the stdout text looks like:\r\n //?? Compiler warnings:\r\n //?? Illegal attribute 'cxxxase-order'.\r\n //?? and no exception is thrown instead of it throwing \r\n //?? TransformerConfigurationException:\r\n //?? with the value of TransformerConfigurationException.getMessage() \r\n //?? being: \r\n //?? javax.xml.transform.TransformerConfigurationException: \r\n //?? javax.xml.transform.TransformerException: \r\n //?? javax.xml.transform.TransformerException: \r\n //?? \"cxxxase-order\" attribute is not allowed on the xsl:sort element!\r\n //?? \r\n //?? When xalan.jar precedes them in the CLASSPATH:\r\n //?? C:\\Apps\\Apache\\xalan-j_2_7_1\\xalan.jar\r\n //?? C:\\Apps\\Apache\\xalan-j_2_7_1\\xercesImpl.jar\r\n //?? C:\\Apps\\Apache\\xalan-j_2_7_1\\xml-apis.jar \r\n //?? there is no exception on errors either, and the stdout text looks\r\n //?? like:\r\n //?? D:\\Fred\\bristle\\javaapps\\xmltrans\\Testing\\Actual\\dummy.xsl; \r\n //?? Line #0; Column #0; xsl:xxxsort is not allowed in this position \r\n //?? in the stylesheet!\r\n //?? or:\r\n //?? D:\\Fred\\bristle\\javaapps\\xmltrans\\Testing\\Actual\\dummy.xsl; \r\n //?? Line #0; Column #0; \"cxxxase-order\" attribute is not allowed \r\n //?? on the xsl:sort element!\r\n //??\r\n //?? Should find a better parser perhaps.\r\n //??\r\n transformer.transform(new DOMSource(xmlXML), xmlResult);\r\n return xmlResult.getNode();\r\n }", "public static void testXmlImport() {\n\n }", "public abstract StringBuffer toXML ();", "private Nodes xPathQuery(String query)\r\n \t{\r\n \t\treturn document.query(query, context);\r\n \t}", "@GET\n @Path(\"/\")\n @Produces(MediaType.TEXT_XML)\n public StreamingOutput getXCRIXml() {\n return new StreamingOutput() {\n\n @Override\n public void write(OutputStream output) throws IOException, WebApplicationException {\n byte[] out = xcriSession.loadCourseDirectoryFile(xcriSession.getCourseFileName());\n output.write(out);\n }\n };\n }", "public static final void prepareInstance() {\r\n prepareInstance(new XmlFactory());\r\n }", "private void init() {\n\t\tthis.xpath = XPathFactory.newInstance().newXPath();\n\t\tthis.xpath.setNamespaceContext(new XPathNSContext());\n\t}", "public DevicesStAXBuilder() {\n super();\n inputFactory = XMLInputFactory.newInstance();\n }", "protected RCPOMDocument() {\n\t}", "public OpenOfficeXMLDocumentParser() {\r\n }", "public Sources()\n {\n super(NAMESPACE, ELEMENT);\n }", "@org.junit.Test\n public void constrCompelemEnclexpr1() {\n final XQuery query = new XQuery(\n \"element elem {}\",\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 assertSerialization(\"<elem/>\", false)\n );\n }", "public CGXParser() {\n super();\n }", "protected static final Transformer newTransformer(final StreamSource source) {\r\n try {\r\n return getOutTransformer(getTransformerFactory().newTransformer(source));\r\n } catch (final TransformerConfigurationException tce) {\r\n logB.error(\"XmlFactory.newTransformer : failure on creating new Transformer for source : \" + source, tce);\r\n }\r\n\r\n return null;\r\n }", "private WebXmlIo()\n {\n // Voluntarily empty constructor as utility classes should not have a public or default\n // constructor\n }", "private XMath()\n {\n \n }", "@Test\r\n\tpublic void testCreateXml(){\n\t}", "public XMLElement() {\n this(new Properties(), false, true, true);\n }", "public XMLData () {\r\n\r\n //code description\r\n\r\n try {\r\n DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();\r\n this.document = builder.newDocument(); \r\n }\r\n catch (ParserConfigurationException err) {}\r\n\r\n }", "public MySaxParser() {\n\t\ttry {\n\t\t\tSAXParser parser=SAXParserFactory.newInstance().newSAXParser();\n\t\t\tparser.parse(new File(GAME_FILE), this);\n\t\t} catch (ParserConfigurationException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (SAXException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "XExpr createXExpr();", "protected static org.w3c.dom.Document setUpXML(String nodeName)\n throws ParserConfigurationException\n {\n //try\n //{\n DocumentBuilderFactory myFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder myDocBuilder = myFactory.newDocumentBuilder();\n DOMImplementation myDOMImpl = myDocBuilder.getDOMImplementation();\n // resultDocument = myDOMImpl.createDocument(\"at.ac.tuwien.dbai.pdfwrap\", \"PDFResult\", null);\n org.w3c.dom.Document resultDocument =\n myDOMImpl.createDocument(\"at.ac.tuwien.dbai.pdfwrap\", nodeName, null);\n return resultDocument;\n //}\n //catch (ParserConfigurationException e)\n //{\n // e.printStackTrace();\n // return null;\n //}\n\n }", "Xid createXid();" ]
[ "0.6437617", "0.61609674", "0.6097178", "0.6033878", "0.5750813", "0.56777906", "0.56417257", "0.56292987", "0.5612706", "0.5545476", "0.5510748", "0.54784656", "0.54489815", "0.5396621", "0.53856915", "0.53856915", "0.53856915", "0.5377515", "0.5365683", "0.5359267", "0.53461224", "0.53259605", "0.53175044", "0.53078663", "0.5287507", "0.52668846", "0.52496326", "0.52471983", "0.5221325", "0.5213792", "0.51991665", "0.5192496", "0.51845473", "0.5169546", "0.5157596", "0.515352", "0.5142241", "0.5141135", "0.51288545", "0.51099724", "0.51047456", "0.50927955", "0.5089563", "0.50861794", "0.5083522", "0.5078523", "0.50727177", "0.50664186", "0.5061319", "0.50583965", "0.50568986", "0.5052477", "0.5046804", "0.50291985", "0.5017827", "0.50082797", "0.49995223", "0.49961755", "0.49929634", "0.4990784", "0.49679393", "0.49519682", "0.49499398", "0.49386597", "0.4933594", "0.49279517", "0.49247548", "0.49220383", "0.49187478", "0.49056652", "0.4883458", "0.48702425", "0.48687947", "0.4865702", "0.48592204", "0.4846988", "0.48468444", "0.48445365", "0.48336813", "0.48333764", "0.48267666", "0.4822674", "0.4816557", "0.48129094", "0.48095432", "0.48076874", "0.480766", "0.47942013", "0.47899133", "0.47891322", "0.47890267", "0.47804278", "0.47793895", "0.47747856", "0.47701606", "0.47696963", "0.47633517", "0.4752459", "0.4740466", "0.47273847" ]
0.7016496
0
overridden in subclasses which handle StsObjects (DBStsClassType) and StsObject arrays (DBArrayType)
public void addToModel(Object object, StsModel model) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test public void getBaseTypeShouldReturnCorrectType() throws SQLException {\n\t\tList<Object> list = new ArrayList<>();\n\t\tArray array;\n\t\tfor (int type : Array.TYPES_SUPPORTED) {\n\t\t\tarray = new ListArray(list, type);\n\t\t\tassertEquals(type, array.getBaseType());\n\t\t}\n\t}", "public Object[] getOracleArray(long paramLong, int paramInt)\n/* */ throws SQLException\n/* */ {\n/* 283 */ int i = sliceLength(paramLong, paramInt);\n/* */ \n/* 285 */ if (i < 0) {\n/* 286 */ return null;\n/* */ }\n/* 288 */ Object localObject = null;\n/* */ \n/* 290 */ switch (this.sqlType)\n/* */ {\n/* */ \n/* */ case -13: \n/* 294 */ localObject = new BFILE[i];\n/* */ \n/* 296 */ break;\n/* */ \n/* */ case 2004: \n/* 299 */ localObject = new BLOB[i];\n/* */ \n/* 301 */ break;\n/* */ \n/* */ \n/* */ case 1: \n/* */ case 12: \n/* 306 */ localObject = new CHAR[i];\n/* */ \n/* 308 */ break;\n/* */ \n/* */ case 2005: \n/* 311 */ localObject = new CLOB[i];\n/* */ \n/* 313 */ break;\n/* */ \n/* */ case 91: \n/* 316 */ localObject = new DATE[i];\n/* */ \n/* 318 */ break;\n/* */ \n/* */ case 93: \n/* 321 */ localObject = new TIMESTAMP[i];\n/* */ \n/* 323 */ break;\n/* */ \n/* */ case -101: \n/* 326 */ localObject = new TIMESTAMPTZ[i];\n/* */ \n/* 328 */ break;\n/* */ \n/* */ case -102: \n/* 331 */ localObject = new TIMESTAMPLTZ[i];\n/* */ \n/* 333 */ break;\n/* */ \n/* */ case -104: \n/* 336 */ localObject = new INTERVALDS[i];\n/* */ \n/* 338 */ break;\n/* */ \n/* */ case -103: \n/* 341 */ localObject = new INTERVALYM[i];\n/* */ \n/* 343 */ break;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 2: \n/* */ case 3: \n/* */ case 4: \n/* */ case 5: \n/* */ case 6: \n/* */ case 7: \n/* */ case 8: \n/* 358 */ localObject = new NUMBER[i];\n/* */ \n/* 360 */ break;\n/* */ \n/* */ case -2: \n/* 363 */ localObject = new RAW[i];\n/* */ \n/* 365 */ break;\n/* */ \n/* */ case 100: \n/* 368 */ localObject = new BINARY_FLOAT[i];\n/* */ \n/* 370 */ break;\n/* */ \n/* */ case 101: \n/* 373 */ localObject = new BINARY_DOUBLE[i];\n/* */ \n/* 375 */ break;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 0: \n/* */ case 2002: \n/* */ case 2003: \n/* */ case 2006: \n/* */ case 2007: \n/* 386 */ if (this.old_factory == null)\n/* */ {\n/* 388 */ localObject = new ORAData[i];\n/* */ }\n/* */ else\n/* */ {\n/* 392 */ localObject = new CustomDatum[i];\n/* */ }\n/* */ \n/* 395 */ break;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case -15: \n/* */ case -9: \n/* 402 */ setNChar();\n/* 403 */ localObject = new CHAR[i];\n/* 404 */ break;\n/* */ \n/* */ case 2011: \n/* 407 */ localObject = new NCLOB[i];\n/* 408 */ break;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ default: \n/* 414 */ SQLException localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 48);\n/* 415 */ localSQLException.fillInStackTrace();\n/* 416 */ throw localSQLException;\n/* */ }\n/* */ \n/* */ \n/* 420 */ return getOracleArray(paramLong, (Object[])localObject);\n/* */ }", "@Test public void getBaseTypeNameShouldReturnCorrectType() throws SQLException {\n\t\tList<Object> list = new ArrayList<>();\n\t\tArray array = new ListArray(list, Types.VARCHAR);\n\t\tassertEquals(\"VARCHAR\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.INTEGER);\n\t\tassertEquals(\"INTEGER\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.DOUBLE);\n\t\tassertEquals(\"DOUBLE\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.BOOLEAN);\n\t\tassertEquals(\"BOOLEAN\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.JAVA_OBJECT);\n\t\tassertEquals(\"JAVA_OBJECT\", array.getBaseTypeName());\n\t}", "public void setOracleArray(Object[] paramArrayOfObject)\n/* */ {\n/* 672 */ if ((this.factory == null) && (this.old_factory == null)) {\n/* 673 */ setDatumArray((Datum[])paramArrayOfObject);\n/* */ } else {\n/* 675 */ setObjectArray(paramArrayOfObject);\n/* */ }\n/* */ }", "public interface StandardTypesLocalService {\n BigInteger getNewBigInteger(BigInteger bi);\n BigInteger[] getNewBigIntegerArray(BigInteger[] bia);\n \n BigDecimal getNewBigDecimal(BigDecimal bd);\n BigDecimal[] getNewBigDecimalArray(BigDecimal[] bda);\n\n Calendar getNewCalendar(Calendar c);\n Calendar[] getNewCalendarArray(Calendar[] ca);\n \n Date getNewDate(Date d);\n Date[] getNewDateArray(Date[] da);\n\n QName getNewQName(QName qname);\n QName[] getNewQNameArray(QName[] qnames);\n \n URI getNewURI(URI uri);\n URI[] getNewURIArray(URI[] uris);\n \n XMLGregorianCalendar getNewXMLGregorianCalendar(XMLGregorianCalendar xgcal);\n XMLGregorianCalendar[] getNewXMLGregorianCalendarArray(XMLGregorianCalendar[] xgcal);\n \n Duration getNewDuration(Duration d);\n Duration[] getNewDurationArray(Duration[] da);\n \n Object getNewObject(Object obj);\n Object[] getNewObjectArray(Object[] objs);\n \n Image getNewImage(Image img);\n Image[] getNewImageArray(Image[] imgs);\n \n DataHandler getNewDataHandler(DataHandler dh);\n DataHandler[] getNewDataHandlerArray(DataHandler[] dha);\n\n Source getNewSource(Source src);\n Source[] getNewSourceArray(Source[] srcs);\n \n UUID getNewUUID(UUID uuid);\n UUID[] getNewUUIDArray(UUID[] uuids);\n}", "public MutableArray(int paramInt, Object[] paramArrayOfObject, ORADataFactory paramORADataFactory)\n/* */ {\n/* 100 */ this.sqlType = paramInt;\n/* 101 */ this.factory = paramORADataFactory;\n/* 102 */ this.isNChar = false;\n/* */ \n/* 104 */ setObjectArray(paramArrayOfObject);\n/* */ }", "public SampletypeBean[] save(SampletypeBean[] pObjects) throws SQLException \n {\n for (int iIndex = 0; iIndex < pObjects.length; iIndex ++){\n save(pObjects[iIndex]);\n }\n return pObjects;\n }", "public Object[] getObjectArray(Object[] paramArrayOfObject)\n/* */ throws SQLException\n/* */ {\n/* 586 */ return getObjectArray(0L, paramArrayOfObject);\n/* */ }", "public MutableArray(Object[] paramArrayOfObject, int paramInt, CustomDatumFactory paramCustomDatumFactory)\n/* */ {\n/* 180 */ this.sqlType = paramInt;\n/* 181 */ this.old_factory = paramCustomDatumFactory;\n/* 182 */ this.isNChar = false;\n/* */ \n/* 184 */ setObjectArray(paramArrayOfObject);\n/* */ }", "void setArrayGeneric(int paramInt)\n/* */ {\n/* 1062 */ this.length = paramInt;\n/* 1063 */ this.datums = new Datum[paramInt];\n/* 1064 */ this.pickled = null;\n/* 1065 */ this.pickledCorrect = false;\n/* */ }", "public int addNewRecordInArray(String typeObject){\r\n\r\n\t\tif (typeObject.equals(\"AutoParts\")) {\r\n\t\t\t\r\n\t\t\tAutoParts[] newGoods = new AutoParts[goods.length + 1];\r\n\t\t\tSystem.arraycopy(goods, 0, newGoods, 0, goods.length);\r\n\t\t\tgoods = newGoods;\r\n\t\t\t\r\n\t\t} else if (typeObject.equals(\"Prices\")) {\r\n\t\t\tPrices[] newPrices = new Prices[prices.length + 1];\r\n\t\t\tSystem.arraycopy(prices, 0, newPrices, 0, prices.length);\r\n\t\t\tprices = newPrices;\r\n\t\t} else if (typeObject.equals(\"Client\")){\r\n\t\t\tClient[] newClients = new Client[client.length + 1];\r\n\t\t\tSystem.arraycopy(client, 0, newClients, 0, client.length);\r\n\t\t\tclient = newClients;\r\n\t\t} else if (typeObject.equals(\"Shopping\")){\r\n\t\t\t\r\n\t\t\tShopping[] newShopping = new Shopping[shop.length + 1];\r\n\t\t\tSystem.arraycopy(shop, 0, newShopping, 0, shop.length);\r\n\t\t\tshop = newShopping;\r\n\t\t\t\r\n\t\t} else if (typeObject.equals(\"BalancesAutoParts\")){\r\n\t\t\t\r\n\t\t\tBalancesAutoParts[] newBalancesAutoParts = new BalancesAutoParts[balancesAutoParts.length + 1];\r\n\t\t\tSystem.arraycopy(balancesAutoParts, 0, newBalancesAutoParts, 0, balancesAutoParts.length);\r\n\t\t\tbalancesAutoParts = newBalancesAutoParts;\r\n\t\t\t\r\n\t\t} else if (typeObject.equals(\"Sale\")) {\r\n\t\t\t\r\n\t\t\tSale[] newSale = new Sale[sale.length + 1];\r\n\t\t\tSystem.arraycopy(sale, 0, newSale, 0, sale.length);\r\n\t\t\tsale = newSale;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn 1;\r\n\r\n\t}", "static byte[] serialize(Object s) throws SQLException {\n\tByteArrayOutputStream bo = new ByteArrayOutputStream();\n\n\ttry {\n\t ObjectOutputStream os = new ObjectOutputStream(bo);\n\n\t os.writeObject(s);\n\n\t return bo.toByteArray();\n\t} catch (Exception e) {\n\t throw Trace.error(Trace.SERIALIZATION_FAILURE, e.getMessage());\n\t}\n }", "@SuppressWarnings(\"unchecked\")\n public void writeObject(SQLData x) throws SQLException{\n /**\n * Except for the types that are passed as objects\n * this seems to be the only way for an object to\n * get a null value for a field in a structure.\n *\n * Note: this means that the class defining SQLData\n * will need to track if a field is SQL null for itself\n */\n if(x==null){\n attribs.add(null);\n }else{\n /**\n * We have to write out a SerialStruct that contains\n * the name of this class otherwise we don't know\n * what to re-instantiate during readSQL()\n */\n attribs.add(new SerialStruct(x,map));\n }\n }", "public MutableArray(int paramInt, double[] paramArrayOfDouble, ORADataFactory paramORADataFactory)\n/* */ {\n/* 111 */ this.sqlType = paramInt;\n/* 112 */ this.factory = paramORADataFactory;\n/* 113 */ this.isNChar = false;\n/* */ \n/* 115 */ setArray(paramArrayOfDouble);\n/* */ }", "protected void record2object(String tableAlias, Object obj, Database db, ResultSet results, int position)\r\n throws SQLException, ReflectiveOperationException {\r\n Object dbValue = record2object(tableAlias, results, position);\r\n if (results.wasNull()) {\r\n dbValue = null;\r\n }\r\n dbValue = db.unformatValue(dbValue, fieldAccess.typeFromSetter());\r\n if (dbValue == null && isPrimitive)\r\n throw new SQLException(\"Attempt to assign NULL from \" + databaseFieldName + \" to a primitive\");\r\n fieldAccess.set(obj, dbValue);\r\n }", "@Override\r\n\t\tpublic Array createArrayOf(String typeName, Object[] elements)\r\n\t\t\t\tthrows SQLException {\n\t\t\treturn null;\r\n\t\t}", "void setObject(int index, Object value, int sqlType)\n throws SQLException;", "@SuppressWarnings(\"rawtypes\")\n\t@Test\n\tpublic void retrieveArrays() {\n\t\tObjectSet result = db.queryByExample(new double[] { 0.6, 0.4 });\n\t\tlistResult(result);\n\n\t\t// Important note QBE does not work well with arrays\n\t\tassertEquals(0, result.size());\n\n\t}", "void setObject(int index, Object value, int sqlType, int scale)\n throws SQLException;", "private Object arrayToSPLArray(String name, JSONArray jarr, Type ptype) throws Exception {\n\t\tif(l.isLoggable(TraceLevel.DEBUG)) {\n\t\t\tl.log(TraceLevel.DEBUG, \"Creating Array: \" + name);\n\t\t}\n\t\tCollectionType ctype = (CollectionType) ptype;\n\t\tint cnt=0;\n\t\tString cname = \"List: \" + name;\n\n\t\tswitch(ctype.getElementType().getMetaType()) {\n\t\tcase INT8:\n\t\tcase UINT8: \n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tbyte[] arr= new byte[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Byte)val;\n\t\t\treturn arr;\n\t\t} \n\t\tcase INT16:\n\t\tcase UINT16:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tshort[] arr= new short[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Short)val;\n\t\t\treturn arr;\n\t\t} \n\t\tcase INT32:\n\t\tcase UINT32:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tint[] arr= new int[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Integer)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase INT64:\n\t\tcase UINT64:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tlong[] arr= new long[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Long)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase BOOLEAN:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tboolean[] arr= new boolean[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Boolean)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase FLOAT32:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tfloat[] arr= new float[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Float)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase FLOAT64:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tdouble[] arr= new double[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Double)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase USTRING:\n\t\t{\n\t\t\tList<String> lst = new ArrayList<String>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((String)obj);\n\t\t\t}\n\t\t\treturn lst.toArray(new String[lst.size()]);\n\t\t} \n\n\t\tcase BSTRING:\n\t\tcase RSTRING:\n\t\t{\n\t\t\tList<RString> lst = new ArrayList<RString>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((RString)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\t\tcase TUPLE:\n\t\t{\n\t\t\tList<Tuple> lst = new ArrayList<Tuple>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((Tuple)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\t\tcase LIST:\n\t\tcase BLIST:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add(obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase SET:\n\t\tcase BSET:\n\t\t{\n\t\t\tSet<Object> lst = new HashSet<Object>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add(obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase DECIMAL32:\n\t\tcase DECIMAL64:\n\t\tcase DECIMAL128:\n\t\t{\n\t\t\tList<BigDecimal> lst = new ArrayList<BigDecimal>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((BigDecimal)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase TIMESTAMP:\n\t\t{\n\t\t\tList<Timestamp> lst = new ArrayList<Timestamp>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((Timestamp)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\n\t\t//TODO -- not yet supported types\n\t\tcase BLOB:\n\t\tcase MAP:\n\t\tcase BMAP:\n\t\tcase COMPLEX32:\n\t\tcase COMPLEX64:\n\t\tdefault:\n\t\t\tthrow new Exception(\"Unhandled array type: \" + ctype.getElementType().getMetaType());\n\t\t}\n\n\t}", "private String arrayToString(TOP fsIn, int arrayType) throws SAXException {\n if (fsIn == null) {\n return null;\n }\n\n StringBuilder buf = new StringBuilder();\n CommonArrayFS fs = (CommonArrayFS) fsIn;\n String elemStr = null;\n\n // FS arrays: handle shared data items\n if (fs instanceof FSArray) {\n List<XmiArrayElement> ootsArrayElementsList = cds.sharedData == null ? null\n : cds.sharedData.getOutOfTypeSystemArrayElements((FSArray) fs);\n int ootsIndex = 0;\n\n int j = -1;\n for (TOP elemFS : ((FSArray) fs)._getTheArray()) {\n j++;\n if (elemFS == null) { // null case\n // special NULL object with xmi:id=0 is used to represent\n // a null in an FSArray\n elemStr = \"0\";\n // However, this null array element might have been a reference to an\n // out-of-typesystem FS, so check the ootsArrayElementsList\n if (ootsArrayElementsList != null) {\n\n while (ootsIndex < ootsArrayElementsList.size()) {\n XmiArrayElement arel = ootsArrayElementsList.get(ootsIndex++);\n if (arel.index == j) {\n elemStr = arel.xmiId;\n break;\n }\n }\n }\n\n } else { // not null\n String xmiId = cds.getXmiId(elemFS);\n if (cds.isFiltering) { // return as null any references to types not in target TS\n String typeName = elemFS._getTypeImpl().getName();\n if (cds.filterTypeSystem_inner.getType(typeName) == null) {\n xmiId = \"0\";\n }\n }\n elemStr = xmiId;\n }\n\n if (buf.length() > 0) {\n buf.append(' ');\n }\n buf.append(elemStr);\n } // end of loop over FS Array elements\n\n return buf.toString();\n\n } else if (fs instanceof ByteArray) {\n\n // special case for byte arrays: serialize as hex digits\n byte[] ba = ((ByteArray) fs)._getTheArray();\n\n char[] r = new char[ba.length * 2];\n\n int i = 0;\n for (byte b : ba) {\n r[i++] = INT_TO_HEX[(b & 0xF0) >>> 4];\n r[i++] = INT_TO_HEX[b & 0x0F];\n }\n return new String(r);\n } else {\n // is not FSarray, is not ByteArray, is not String Array\n // CommonArrayFS fs;\n // String[] fsvalues;\n //\n // switch (arrayType) {\n // case LowLevelCAS.TYPE_CLASS_INTARRAY:\n // fs = new IntArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_FLOATARRAY:\n // fs = new FloatArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_BOOLEANARRAY:\n // fs = new BooleanArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_SHORTARRAY:\n // fs = new ShortArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_LONGARRAY:\n // fs = new LongArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_DOUBLEARRAY:\n // fs = new DoubleArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_BYTEARRAY:\n // fs = new ByteArrayFSImpl(addr, cds.cas);\n // break;\n // default: {\n // return \"\";\n // }\n // }\n\n // if (arrayType == LowLevelCAS.TYPE_CLASS_STRINGARRAY) { // this method never called for\n // StringArrays\n // StringArrayFS strFS = new StringArrayFSImpl(addr, cds.cas);\n // fsvalues = strFS.toArray();\n // } else {\n String[] fsvalues = fs.toStringArray();\n // }\n\n for (String s : fsvalues) {\n if (buf.length() > 0) {\n buf.append(' ');\n }\n buf.append(s);\n }\n return buf.toString();\n }\n }", "public abstract Object getUnderlyingObject();", "public interface DatabaseCollection<T> {\n \n /**\n * <p>Insert one, several, or table of entity into the collection</p>\n * @param entity\n * @throws NoSQLException\n */\n public void insert(T... entity) throws NoSQLException;\n\n /**\n * <p>Insert a list of entity into the collection</p>\n * @param entity\n * @throws NoSQLException\n */\n public void insert(List<T> entity) throws NoSQLException;\n \n /**\n * <p>find only one object from the collection</p>\n * @param dbObjectQuery\n * @return\n */\n public T findOne(DBObject dbObjectQuery) throws NoSQLException;\n \n /**\n * <p>find a list of object from query</p>\n * @param dbObjectQuery\n * @return\n * @throws NoSQLException\n */\n public List<T> find(DBObject dbObjectQuery) throws NoSQLException;\n \n /**\n * <p>find a list of all the objects from the collection</p>\n * @return\n * @throws NoSQLException\n */\n public List<T> findAll() throws NoSQLException;\n \n /**\n * <p>find only one object from the collection with order by</p>\n * @param dbObjectQuery\n * @return\n */\n public T findOne(DBObject dbObjectQuery, DBObject orderBy) throws NoSQLException;\n \n /**\n * <p>find a list of object from query with order by</p>\n * @param dbObjectQuery\n * @return\n * @throws NoSQLException\n */\n public List<T> find(DBObject dbObjectQuery, DBObject orderBy) throws NoSQLException;\n \n /**\n * <p>find a list of all the objects from the collection with order by</p>\n * @return\n * @throws NoSQLException\n */\n public List<T> findAll(DBObject orderBy) throws NoSQLException;\n \n /**\n * <p>remove documents from query</p>\n * @param dbObjectQuery\n */\n public void remove(DBObject dbObjectQuery);\n}", "@Override\n public Object toJdbcType(Object value) {\n return value;\n }", "public abstract <T> List<T> query(String paramString, Class<T> paramClass, Object[] paramArrayOfObject);", "@Test public void getArrayShouldReturnCorrectArray() throws SQLException {\n\t\tList<String> list = new ArrayList<>();\n\t\tArray array = new ListArray(list, Types.VARCHAR);\n\t\tassertTrue(array.getArray() instanceof String[]);\n\t\tlist.add(\"test\");\n\t\tarray = new ListArray(list, Types.VARCHAR);\n\t\tassertEquals(\"test\", ((String[])array.getArray())[0]);\n\t\tlist.add(\"test2\");\n\t\tarray = new ListArray(list, Types.VARCHAR);\n\t\tassertEquals(\"test2\", ((String[])array.getArray())[1]);\n\t}", "protected abstract Object[] getData();", "private String prepareType(String smaliType) {\n int arrayDimensions = 0;\n \n String typeWithoutBrackets = smaliType;\n \n while (typeWithoutBrackets.startsWith(\"[\")) {\n arrayDimensions++;\n typeWithoutBrackets = typeWithoutBrackets.substring(1);\n }\n \n if(SmaliNameConverter.isPrimitiveSmaliType(typeWithoutBrackets)) {\n return (typeWithoutBrackets.equals(\"V\")) ? \"\" : smaliType ; \n }\n \n String classOfType = SmaliNameConverter.convertTypeFromSmali(typeWithoutBrackets);\n String packageOfType = SmaliNameConverter.extractPackageNameFromClassName(classOfType);\n\n StringBuilder type = new StringBuilder();\n\n for(int i = 0; i < arrayDimensions; i++) {\n type.append(\"[\");\n }\n\n boolean isCurrentClassObject = (classOfType.equals(currentClassType)); \n boolean isInternalObject = (packageOfType.equals(currentPackage)); \n \n char typeChar = isCurrentClassObject? 'T' : \n isInternalObject? 'O' : 'E' ;\n \n type.append(typeChar);\n\n return type.toString();\n }", "void decodeObjectArray();", "public GTUIterator(GTUContainer <T> object,Class<T[]> classtype){\r\n position=0;\r\n sizeArr=object.size();\r\n itrArr=classtype.cast(Array.newInstance(classtype.getComponentType(),sizeArr));\r\n for(int i=0;i<object.size();i++) {\r\n itrArr[i]= (T)object.getArrayElement(i);\r\n }\r\n }", "private boolean savePrice(ArrayList<ArrayList<Object>> objArr) {\n //TODO: create string array construction method with String... array\n //TODO: create generic method to create POJO object from objArr and map to JSON data\n logger.trace(\"BEGIN boolean savePrice(ArrayList<ArrayList<Object>> objArr)\");\n boolean result = false;\n TSDBData pricingData = new TSDBData();\n ArrayList<String> strArr = new ArrayList<String>();\n InfluxDBClient dbClient = new InfluxDBClient();\n ObjectMapper mapper = new ObjectMapper();\n String jsonData = null;\n\n strArr.add(\"resource\");\n strArr.add(\"userId\");\n strArr.add(\"usage\");\n strArr.add(\"price\");\n pricingData.setName(Loader.getSettings().getInfluxDBSettings().getCdrRecord());\n pricingData.setColumns(strArr);\n pricingData.setPoints(objArr);\n //get tags and put them into pricingData\n logger.trace(\"DATA boolean savePrice(ArrayList<ArrayList<Object>> objArr): pricingData=\" + pricingData);\n\n try {\n jsonData = mapper.writeValueAsString(pricingData);\n } catch (JsonProcessingException e) {\n logger.error(\"EXCEPTION JSONPROCESSINGEXCEPTION boolean savePrice(ArrayList<ArrayList<Object>> objArr)\");\n e.printStackTrace();\n }\n\n //System.out.println(jsonData);\n logger.trace(\"DATA boolean savePrice(ArrayList<ArrayList<Object>> objArr): jsonData=\" + jsonData);\n result = dbClient.saveData(jsonData);\n logger.trace(\"END boolean savePrice(ArrayList<ArrayList<Object>> objArr)\");\n return result;\n }", "public MutableArray(int paramInt, short[] paramArrayOfShort, ORADataFactory paramORADataFactory)\n/* */ {\n/* 144 */ this.sqlType = paramInt;\n/* 145 */ this.factory = paramORADataFactory;\n/* 146 */ this.isNChar = false;\n/* */ \n/* 148 */ setArray(paramArrayOfShort);\n/* */ }", "@Override\r\n\tprotected Object covertToArrayType(Object componentType) throws SerializeException {\r\n\t\t//return super.covertToArrayType(AdvancedDeserializerUtil.covertToArrayType(componentType));\r\n\t\treturn super.covertToArrayType(AdvancedDeserializerUtil.covertToArrayType(componentType));\r\n\t}", "Object convertJavaValueToDBValue(Object value, Class<?> javaType);", "public Object caseDataType(DataType object) {\r\n\t\treturn null;\r\n\t}", "public Object convertToCatalyst (Object a, org.apache.spark.sql.catalyst.types.DataType dataType) ;", "Object convertDBValueToJavaValue(Object value, Class<?> javaType);", "@Override\n protected IRscDataObject[] processRecord(Object obj) {\n if (obj instanceof DataTime) {\n NcGridDataProxy rscDataObj = new NcGridDataProxy((DataTime) obj);\n return new NcGridDataProxy[] { rscDataObj };\n } else if (obj instanceof GridRecord) {\n NcGridDataProxy rscDataObj = new NcGridDataProxy(\n ((GridRecord) obj).getDataTime());\n return new NcGridDataProxy[] { rscDataObj };\n } else {\n logger.info(\"Unexpected object in NcGridResource.processRecord \");\n return null;\n }\n }", "void arrays_hierarchy_may_lead_to_unsafety() {\n\r\n Object[] objectArray = new Long[1];\r\n objectArray[0] = \"boom\"; // Throws ArrayStoreException\r\n\r\n // Generic Collections are invariant (don't preserve inheritance):\r\n // i.e. if Child extends Parent, then List<Child> isn't a subtype of List<Parent>.\r\n\r\n // Using Collections, it raises issue at compile time:\r\n\r\n /**\r\n * List<Object> numbers = new ArrayList<Number>();\r\n * numbers.add(\"boom\");\r\n */\r\n\r\n }", "int insert(SysType record);", "public interface SString extends SInlinedSQLType\n{\n}", "public MutableArray(int paramInt, Datum[] paramArrayOfDatum, ORADataFactory paramORADataFactory)\n/* */ {\n/* 89 */ this.sqlType = paramInt;\n/* 90 */ this.factory = paramORADataFactory;\n/* 91 */ this.isNChar = false;\n/* */ \n/* 93 */ setDatumArray(paramArrayOfDatum);\n/* */ }", "private static void writeNonArrayToBuffer(ByteBuffer buffer, Class<?> standardType, Object value) {\n if (null == value) {\n buffer.put(ABIToken.NULL.identifier);\n }\n \n // Primitive types.\n if (ABIToken.BYTE.standardType == standardType) {\n buffer.put(ABIToken.BYTE.identifier);\n buffer.put((Byte) value);\n } else if (ABIToken.BOOLEAN.standardType == standardType) {\n buffer.put(ABIToken.BOOLEAN.identifier);\n buffer.put((byte)((Boolean) value ? 1 : 0));\n } else if (ABIToken.CHAR.standardType == standardType) {\n buffer.put(ABIToken.CHAR.identifier);\n buffer.putChar((Character) value);\n } else if (ABIToken.SHORT.standardType == standardType) {\n buffer.put(ABIToken.SHORT.identifier);\n buffer.putShort((Short) value);\n } else if (ABIToken.INT.standardType == standardType) {\n buffer.put(ABIToken.INT.identifier);\n buffer.putInt((Integer) value);\n } else if (ABIToken.LONG.standardType == standardType) {\n buffer.put(ABIToken.LONG.identifier);\n buffer.putLong((Long) value);\n } else if (ABIToken.FLOAT.standardType == standardType) {\n buffer.put(ABIToken.FLOAT.identifier);\n buffer.putFloat((Float) value);\n } else if (ABIToken.DOUBLE.standardType == standardType) {\n buffer.put(ABIToken.DOUBLE.identifier);\n buffer.putDouble((Double) value);\n \n // Primitive array types.\n } else if (ABIToken.A_BYTE.standardType == standardType) {\n buffer.put(ABIToken.A_BYTE.identifier);\n if (null != value) {\n byte[] cast = (byte[])value;\n writeLength(buffer, cast.length);\n buffer.put(cast);\n }\n } else if (ABIToken.A_BOOLEAN.standardType == standardType) {\n buffer.put(ABIToken.A_BOOLEAN.identifier);\n if (null != value) {\n boolean[] cast = (boolean[])value;\n writeLength(buffer, cast.length);\n byte[] ready = new byte[cast.length];\n for (int i = 0; i < ready.length; ++i) {\n ready[i] = (byte)(cast[i] ? 1 : 0);\n }\n buffer.put(ready);\n }\n } else if (ABIToken.A_CHAR.standardType == standardType) {\n buffer.put(ABIToken.A_CHAR.identifier);\n if (null != value) {\n char[] cast = (char[])value;\n writeLength(buffer, cast.length);\n for (char c : cast) {\n buffer.putChar(c);\n }\n }\n } else if (ABIToken.A_SHORT.standardType == standardType) {\n buffer.put(ABIToken.A_SHORT.identifier);\n if (null != value) {\n short[] cast = (short[])value;\n writeLength(buffer, cast.length);\n for (short s : cast) {\n buffer.putShort(s);\n }\n }\n } else if (ABIToken.A_INT.standardType == standardType) {\n buffer.put(ABIToken.A_INT.identifier);\n if (null != value) {\n int[] cast = (int[])value;\n writeLength(buffer, cast.length);\n for (int i : cast) {\n buffer.putInt(i);\n }\n }\n } else if (ABIToken.A_LONG.standardType == standardType) {\n buffer.put(ABIToken.A_LONG.identifier);\n if (null != value) {\n long[] cast = (long[])value;\n writeLength(buffer, cast.length);\n for (long l : cast) {\n buffer.putLong(l);\n }\n }\n } else if (ABIToken.A_FLOAT.standardType == standardType) {\n buffer.put(ABIToken.A_FLOAT.identifier);\n if (null != value) {\n float[] cast = (float[])value;\n writeLength(buffer, cast.length);\n for (float f : cast) {\n buffer.putFloat(f);\n }\n }\n } else if (ABIToken.A_DOUBLE.standardType == standardType) {\n buffer.put(ABIToken.A_DOUBLE.identifier);\n if (null != value) {\n double[] cast = (double[])value;\n writeLength(buffer, cast.length);\n for (double d : cast) {\n buffer.putDouble(d);\n }\n }\n \n // Special types\n } else if (ABIToken.STRING.standardType == standardType) {\n buffer.put(ABIToken.STRING.identifier);\n if (null != value) {\n byte[] cast = ((String)value).getBytes(StandardCharsets.UTF_8);\n writeLength(buffer, cast.length);\n buffer.put(cast);\n }\n } else if (ABIToken.ADDRESS.standardType == standardType) {\n buffer.put(ABIToken.ADDRESS.identifier);\n if (null != value) {\n byte[] cast = ((Address)value).unwrap();\n RuntimeAssertionError.assertTrue(Address.avm_LENGTH == cast.length);\n buffer.put(cast);\n }\n \n } else {\n // There should be no other kind of case.\n RuntimeAssertionError.unreachable(\"Unknown type in encoder\");\n }\n }", "OsType getObjectStore();", "public <E extends Writeable> void storeObject(String sql, E e);", "HRESULT SafeArrayGetVartype(SAFEARRAY psa, VARTYPEByReference pvt);", "public MutableArray(ARRAY paramARRAY, int paramInt, CustomDatumFactory paramCustomDatumFactory)\n/* */ {\n/* 155 */ this.length = -1;\n/* 156 */ this.elements = null;\n/* 157 */ this.datums = null;\n/* 158 */ this.pickled = paramARRAY;\n/* 159 */ this.pickledCorrect = true;\n/* 160 */ this.sqlType = paramInt;\n/* 161 */ this.old_factory = paramCustomDatumFactory;\n/* 162 */ this.isNChar = false;\n/* */ }", "public interface DBWritable {\r\n\t/**\r\n\t * @return current object converted to DBObject\r\n\t */\r\n\tpublic DBObject asDBObject();\r\n}", "private DataSheet arrayToDs(Object[] row) throws SQLException {\n\t\tString[] columnNames = { this.name };\n\t\tValueType vt = this.getValueType();\n\t\tif (row.length == 0) {\n\t\t\tValueType[] types = { this.dataTypeObject.getValueType() };\n\t\t\treturn new MultiRowsSheet(columnNames, types);\n\t\t}\n\t\tValue[][] values = { vt.toValues(row) };\n\t\treturn new MultiRowsSheet(columnNames, values);\n\t}", "@SuppressWarnings(\"unchecked\")\n public Object getTypeValue(CallableStatement cs, int i, int sqlType, String typeName)\n throws SQLException {\n ARRAY array = (ARRAY) cs.getObject(i);\n if (array == null) {\n return null;\n }\n Object[] structValues = (Object[]) array.getArray();\n\t\tList<T> values = new ArrayList<T>();\n\t\tfor (int x = 0; x < structValues.length; x++) {\n\t\t\tObject struct = structValues[x];\n\t\t\tif (struct != null && struct instanceof STRUCT) {\n\t\t\t\tvalues.add(mapper.fromStruct((STRUCT) struct));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (struct == null) {\n\t\t\t\t\tthrow new InvalidDataAccessApiUsageException(\"Expected STRUCT but got 'null'\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthrow new InvalidDataAccessApiUsageException(\"Expected STRUCT but got \" + struct.getClass().getName());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n return values.toArray();\n }", "public interface IListViewRecord {\r\n\r\n /**\r\n * element : columns of type {urn:partner.soap.sforce.com}ListViewRecordColumn\r\n * java type: com.sforce.soap.partner.ListViewRecordColumn[]\r\n */\r\n\r\n public com.sforce.soap.partner.IListViewRecordColumn[] getColumns();\r\n\r\n public void setColumns(com.sforce.soap.partner.IListViewRecordColumn[] columns);\r\n\r\n\r\n}", "private Object convertFieldToDB(Object value, boolean fullsave) {\n if(value == null)\n return null;\n \n if(value instanceof Enum)\n return ((Enum)value).name();\n\n if(value instanceof Base)\n return convertBaseToDB((Base) value, fullsave);\n \n if (value instanceof Base[]) {\n BasicDBList list = new BasicDBList();\n for(Base b : (Base[])value)\n list.add(convertBaseToDB((Base) b, fullsave));\n \n return list;\n }\n \n if (value instanceof Collection) {\n Collection l = (Collection)value; \n\n if(l.size() > 0 && Base.class.isAssignableFrom(l.iterator().next().getClass())) { \n BasicDBList list = new BasicDBList();\n for(Base b : (Collection<Base>)l)\n list.add(convertBaseToDB(b, fullsave));\n \n return list;\n }\n }\n \n if (value instanceof Map) {\n Map m = (Map)value; \n\n if(m.size() > 0 && m.keySet().iterator().next() instanceof String &&\n Base.class.isAssignableFrom(m.values().iterator().next().getClass())) {\n BasicDBObject map = new BasicDBObject();\n for(Map.Entry<String, Base> e : ((Map<String, Base>)m).entrySet())\n map.put(e.getKey(), convertBaseToDB(e.getValue(), fullsave));\n \n return map;\n }\n }\n \n return value;\n }", "B database(S database);", "abstract T setObjectParams(@NotNull ResultSet rs) throws SQLException;", "public void setSobjectType(java.lang.String sobjectType) {\r\n this.sobjectType = sobjectType;\r\n }", "@Override\n\tpublic void setArray(int parameterIndex, Array x) throws SQLException {\n\t\t\n\t}", "abstract void setObjectId(@NotNull ResultSet rs, @NotNull T object) throws SQLException;", "public ArrayValue( Object array )\n\t{\n\t\tthis( array, (byte) 0, null, 0 );\n\t}", "private DataSheet structsToDs(Record record, Object[] array)\n\t\t\tthrows SQLException {\n\t\tDataSheet ds = record.createSheet(false, false);\n\t\tValueType[] types = ds.getValueTypes();\n\t\tfor (Object struct : array) {\n\t\t\tif (struct == null || struct instanceof Struct == false) {\n\t\t\t\tTracer.trace(\n\t\t\t\t\t\t\"Found an empty row or a non-struct object for stored procedure parameter \"\n\t\t\t\t\t\t\t\t+ this.name\n\t\t\t\t\t\t\t\t+ \". skipping this row, but not throwing an error.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tObject[] rowData = ((Struct) struct).getAttributes();\n\t\t\tValue[] row = this.getRowFromStruct(rowData, types);\n\t\t\tds.addRow(row);\n\t\t}\n\t\treturn ds;\n\t}", "public void append(DataArray<?> array, ResultSet set, int column, int row, int type) throws SQLException {\n\t\tswitch (type) {\n\t\t\tcase Types.ARRAY:\n\t\t\t\tarray.setData(set.getArray(column).getArray(), row);\n\t\t\t\tbreak;\n\t\t\tcase Types.DATALINK:\n\t\t\tcase Types.CHAR:\n\t\t\tcase Types.VARCHAR:\n\t\t\tcase Types.LONGVARCHAR:\n\t\t\tcase Types.NCHAR:\n\t\t\tcase Types.LONGNVARCHAR:\n\t\t\tcase Types.NVARCHAR:\n\t\t\t\tarray.setData(set.getString(column), row);\n\t\t\t\tbreak;\n\t\t\tcase Types.BINARY:\n\t\t\tcase Types.VARBINARY:\n\t\t\tcase Types.LONGVARBINARY:\n\t\t\t\tarray.setData(set.getBytes(column), row);\n\t\t\t\tbreak;\n\t\t\tcase Types.BIT:\n\t\t\tcase Types.BOOLEAN:\n\t\t\t\tarray.setData(set.getBoolean(column), row);\n\t\t\t\tbreak;\n\t\t\tcase Types.TINYINT:\n\t\t\tcase Types.SMALLINT:\n\t\t\t\tarray.setData(set.getShort(column), row);\n\t\t\t\tbreak;\n\t\t\tcase Types.INTEGER:\n\t\t\t\tarray.setData(set.getInt(column), row);\n\t\t\t\tbreak;\n\t\t\tcase Types.BIGINT:\n\t\t\t\tarray.setData(set.getLong(column), row);\n\t\t\t\tbreak;\n\t\t\tcase Types.DOUBLE:\n\t\t\t\tarray.setData(set.getDouble(column), row);\n\t\t\t\tbreak;\n\t\t\tcase Types.FLOAT:\n\t\t\tcase Types.REAL:\n\t\t\t\tarray.setData(set.getFloat(column), row);\n\t\t\t\tbreak;\n\t\t\tcase Types.DECIMAL:\n\t\t\tcase Types.NUMERIC:\n\t\t\t\tif ( array.isIntegerNumber()) {\n\t\t\t\t\tarray.setData( set.getInt(column), row );\n\t\t\t\t} else {\n\t\t\t\t\tarray.setData( set.getDouble(column), row);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase Types.DATE: {\n\t\t\t\tDate time = set.getDate(column);\n\t\t\t\tarray.setData( time.getTime(), row);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase Types.TIME: {\n\t\t\t\tTime time = set.getTime(column);\n\t\t\t\tarray.setData( time.getTime(), row);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase Types.TIMESTAMP: {\n\t\t\t\tTimestamp time = set.getTimestamp(column);\n\t\t\t\tarray.setData( time.getTime(), row);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase Types.BLOB: {\n\t\t\t\tBlob blob = set.getBlob(column);\n\t\t\t\tif( blob != null ) {\n\t\t\t\t\t// Allocate a byte buffer\n\t\t\t\t\tint length = new Long( blob.length() ).intValue();\n\t\t\t\t\tByteBuffer buffer = ByteBuffer.allocate(length);\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tblob.getBinaryStream().read(buffer.array());\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tthrow new SQLException(\"Unable to read clob from database!\", e);\n\t\t\t\t\t}\n\t\t\t\t\t// Get the blob's values\n\t\t\t\t\tbuffer.position(0);\n\t\t\t\t\tarray.setData( buffer.array(), row );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase Types.NCLOB:\n\t\t\tcase Types.CLOB: {\n\t\t\t\t// Get the clob\n\t\t\t\tClob clob = set.getClob(column);\n\t\t\t\t\n\t\t\t\tif( clob != null ) {\n\t\t\t\t\t// Allocate a char buffer\n\t\t\t\t\tint length = new Long( clob.length() ).intValue();\n\t\t\t\t\tCharBuffer buffer = CharBuffer.allocate( length );\n\t\t\t\t\ttry {\n\t\t\t\t\t\tclob.getCharacterStream().read(buffer);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tthrow new SQLException(\"Unable to read clob from database!\", e);\n\t\t\t\t\t}\n\t\t\t\t\t// Get the clob's values\n\t\t\t\t\tbuffer.position(0);\n\t\t\t\t\tString values = buffer.toString();\t\n\t\t\t\t\tarray.setData( values, row );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase Types.DISTINCT:\n\t\t\tcase Types.JAVA_OBJECT:\n\t\t\tcase Types.NULL:\n\t\t\tcase Types.OTHER:\n\t\t\tcase Types.REF:\n\t\t\tcase Types.ROWID:\n\t\t\tcase Types.SQLXML:\n\t\t\tcase Types.STRUCT:\n\t\t\t\tarray.setData(set.getObject(column), row);\n\t\t\t\tbreak;\n\t\t\tdefault: {\n\t\t\t\tObject value = set.getObject(column);\n\t\t\t\tarray.setData(value, row);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tarray.unlock();\n\t}", "public abstract int salvar(Object object) throws SQLException;", "public interface TestInstrumentVOInterface {\n\n\n public int getSizeOfInstrumentIDArray();\n\n public void setSizeOfInstrumentIDArray(int sizeOfInstrumentIDArray);\n\n\n public String getSymbol();\n\n public void setSymbol(@MaxSize(20) String symbol);\n\n\n\n\n public String getCurrencyCode();\n\n public void setCurrencyCode(@MaxSize(4) String currencyCode);\n\n\n public void setInstrumentIDAt(@MaxSize(2) int location, TestInstrumentIDVOInterface instrumentID);\n\n public TestInstrumentIDVOInterface getInstrumentIDAt(int location);\n\n\n interface TestInstrumentIDVOInterface {\n\n\n public String getIdSource();\n\n public void setIdSource(@MaxSize(6) String idSource);\n\n public String getSecurityId();\n\n public void setSecurityId(@MaxSize(100) String securityId);\n\n }\n}", "public List<Object> sqlQuery(Class<Object> class1, String string) {\n return null;\n }", "public void mo44054a(String str, Object obj) {\n if (this.f41052d == null) {\n this.f41052d = new ArrayList(this.f41051c != null ? 2 : 1);\n }\n if (this.f41051c != null) {\n this.f41052d.add(str);\n }\n int i = 0;\n if (obj instanceof byte[]) {\n byte[] bArr = (byte[]) obj;\n ArrayList arrayList = new ArrayList(bArr.length);\n int length = bArr.length;\n while (i < length) {\n arrayList.add(Byte.valueOf(bArr[i]));\n i++;\n }\n this.f41052d.add(arrayList);\n } else if (obj instanceof boolean[]) {\n boolean[] zArr = (boolean[]) obj;\n ArrayList arrayList2 = new ArrayList(zArr.length);\n int length2 = zArr.length;\n while (i < length2) {\n arrayList2.add(Boolean.valueOf(zArr[i]));\n i++;\n }\n this.f41052d.add(arrayList2);\n } else if (obj instanceof short[]) {\n short[] sArr = (short[]) obj;\n ArrayList arrayList3 = new ArrayList(sArr.length);\n int length3 = sArr.length;\n while (i < length3) {\n arrayList3.add(Short.valueOf(sArr[i]));\n i++;\n }\n this.f41052d.add(arrayList3);\n } else if (obj instanceof char[]) {\n char[] cArr = (char[]) obj;\n ArrayList arrayList4 = new ArrayList(cArr.length);\n int length4 = cArr.length;\n while (i < length4) {\n arrayList4.add(Character.valueOf(cArr[i]));\n i++;\n }\n this.f41052d.add(arrayList4);\n } else if (obj instanceof int[]) {\n int[] iArr = (int[]) obj;\n ArrayList arrayList5 = new ArrayList(iArr.length);\n int length5 = iArr.length;\n while (i < length5) {\n arrayList5.add(Integer.valueOf(iArr[i]));\n i++;\n }\n this.f41052d.add(arrayList5);\n } else if (obj instanceof long[]) {\n long[] jArr = (long[]) obj;\n ArrayList arrayList6 = new ArrayList(jArr.length);\n int length6 = jArr.length;\n while (i < length6) {\n arrayList6.add(Long.valueOf(jArr[i]));\n i++;\n }\n this.f41052d.add(arrayList6);\n } else if (obj instanceof float[]) {\n float[] fArr = (float[]) obj;\n ArrayList arrayList7 = new ArrayList(fArr.length);\n int length7 = fArr.length;\n while (i < length7) {\n arrayList7.add(Float.valueOf(fArr[i]));\n i++;\n }\n this.f41052d.add(arrayList7);\n } else if (obj instanceof double[]) {\n double[] dArr = (double[]) obj;\n ArrayList arrayList8 = new ArrayList(dArr.length);\n int length8 = dArr.length;\n while (i < length8) {\n arrayList8.add(Double.valueOf(dArr[i]));\n i++;\n }\n this.f41052d.add(arrayList8);\n } else {\n this.f41052d.add(obj);\n }\n }", "@Override\r\n public boolean isArray() throws Exception\r\n {\n return false;\r\n }", "void writeObj(MyAllTypesSecond aRecord, StrategyI xmlStrat);", "public boolean isArrayType()\n/* */ {\n/* 138 */ return true;\n/* */ }", "@Override\r\n\tpublic Object[] toArray()\r\n\t{\n\t\tthrow new UnsupportedOperationException(\"Series collection doesn't support this operation.\");\r\n\t}", "public static byte[] genAllTypes(){\n byte[] types = { DataType.BAG, DataType.BIGCHARARRAY, DataType.BOOLEAN, DataType.BYTE, DataType.BYTEARRAY,\n DataType.CHARARRAY, DataType.DOUBLE, DataType.FLOAT, DataType.DATETIME,\n DataType.GENERIC_WRITABLECOMPARABLE,\n DataType.INTEGER, DataType.INTERNALMAP,\n DataType.LONG, DataType.MAP, DataType.TUPLE, DataType.BIGINTEGER, DataType.BIGDECIMAL};\n return types;\n }", "public Object[] getOracleArray()\n/* */ throws SQLException\n/* */ {\n/* 272 */ return getOracleArray(0L, Integer.MAX_VALUE);\n/* */ }", "public String[] getDataTypes(T2 ob) {\n\t\tString[] s = null;\t\t\r\n\t\tjava.lang.reflect.Field[] f1=ob.getClass().getDeclaredFields(); \r\n\t\ts=new String[f1.length];\r\n\t\tfor(int i=1;i<f1.length;i++)\r\n\t\t{\r\n\t\tSystem.out.println(f1[i].getType().toString());\t\r\n\t\ts[i]=f1[i].getType().toString();\t\t\r\n\t\t}\t\r\n\t\treturn s;\r\n\t}", "@Test\r\n public void testGenericArray()\r\n {\r\n Type t0 = Types.create(List.class).withType(Number.class).build();\r\n Type arrayType = Types.createGenericArrayType(t0);\r\n test(arrayType);\r\n }", "public abstract java.util.Vector setDB2ListItems();", "@Test\r\n\tvoid testDataSourceConversions() {\r\n\t\tDeconstructor underTest = sampleDataSource.deconstructor();\r\n\t\r\n\t\tassertArrayEquals(stringData.getBytes(StandardCharsets.UTF_8), underTest.getByteArrayByName(STRING_DS_NAME).get());\r\n\t\tassertEquals(byteArrayDataStr, underTest.getStringByName(BYTE_ARRAY_DS_NAME).get());\r\n\t}", "public MutableArray(int paramInt, float[] paramArrayOfFloat, ORADataFactory paramORADataFactory)\n/* */ {\n/* 133 */ this.sqlType = paramInt;\n/* 134 */ this.factory = paramORADataFactory;\n/* 135 */ this.isNChar = false;\n/* */ \n/* 137 */ setArray(paramArrayOfFloat);\n/* */ }", "public Object[] getObjectArray1() {\n Object[] customTypes = new Object[10];\n for (int i = 0; i < customTypes.length; i++) {\n ServerCustomType sct = new ServerCustomType();\n sct.setId(i);\n customTypes[i] = sct;\n }\n return customTypes;\n }", "public interface Column extends List, TetradSerializable {\n static final long serialVersionUID = 23L;\n\n /**\n * Returns the raw data array for this columns. Must be cast to the type of\n * array which supports the particular column implementation being used. The\n * array will typically contain more elements than are actually being used;\n * to obtain the true number of data points, use the size() method. This\n * method should be used by algorithms to retrieve data in columns without\n * incurring the cost of unnecessarruy object creations (e.g. array\n * allocations and generation of primitive data wrappers). </p> Example of\n * proper casting for ContinuousColumn:\n * <pre> double[] data = (double[])column.getRawData(); </pre>\n *\n * @return the raw data array.\n */\n Object getRawData();\n\n /**\n * Returns the variable which governs the type of data stored in this\n * column.\n *\n * @return the variable specification.\n * @see edu.cmu.tetrad.data.Variable\n */\n Node getVariable();\n}", "private void readObject(ObjectInputStream s) throws IOException,\n\t\t\tClassNotFoundException {\n\t\ts.defaultReadObject();\n\t\t// Read in size\n\t\tint size = s.readInt();\n\t\t// Read in all elements\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tadd((Statement) s.readObject());\n\t\t}\n\t}", "public abstract org.omg.CORBA.Object read_Object();", "@SuppressWarnings(\"all\")\n protected static boolean writeArrayType(Output out, Object arrType) {\n log.trace(\"writeArrayType\");\n if (arrType instanceof Collection) {\n out.writeArray((Collection<Object>) arrType);\n } else if (arrType instanceof Iterator) {\n writeIterator(out, (Iterator<Object>) arrType);\n } else if (arrType.getClass().isArray() && arrType.getClass().getComponentType().isPrimitive()) {\n out.writeArray(arrType);\n } else if (arrType instanceof Object[]) {\n out.writeArray((Object[]) arrType);\n } else {\n return false;\n }\n return true;\n }", "public void addNewRecord(Object object){\r\n\t\t\r\n\t\tString typeObject = object.getClass().getSimpleName();\r\n\t\t\r\n\t\taddNewRecordInArray(typeObject);\r\n\t\t\r\n\t\tif (object instanceof AutoParts) {\r\n\t\t\tgoods[goods.length - 1] = (AutoParts) object;\r\n\t\t} else if (object instanceof Prices) {\r\n\t\t\tprices[prices.length - 1] = (Prices) object;\r\n\t\t} else if (object instanceof Client) {\r\n\t\t\tclient[client.length - 1] = (Client) object;\r\n\t\t} else if (object instanceof Shopping){\r\n\t\t\tshop[shop.length - 1] = (Shopping) object;\r\n\t\t} else if (object instanceof BalancesAutoParts){\r\n\t\t\tbalancesAutoParts[balancesAutoParts.length - 1] = (BalancesAutoParts) object;\r\n\t\t} else if (object instanceof Sale) {\r\n\t\t\tsale[sale.length - 1] = (Sale) object;\r\n\t\t}\t\t\r\n\t\t\r\n\t}", "public void testObjectSuperclassOfInterface() throws NoSuchMethodException {\n assertEquals(Object.class, GenericTypeReflector.getExactSuperType(ArrayList.class, Object.class));\n assertEquals(Object.class, GenericTypeReflector.getExactSuperType(List.class, Object.class));\n assertEquals(Object.class, GenericTypeReflector.getExactSuperType(String[].class, Object.class));\n }", "@Test\n public void testToArray_GenericType() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n Integer[] expResult = { 1, 2, 3, 4, 5, 6 };\n Integer[] result = instance.toArray(new Integer[] {});\n assertArrayEquals(expResult, result);\n }", "private void m145765a(C46405c cVar, Object[] objArr) {\n int i;\n long j;\n if (objArr != null) {\n i = objArr.length;\n } else {\n i = 0;\n }\n if (i != cVar.f119506d) {\n StringBuilder sb = new StringBuilder(\"Expected \");\n sb.append(cVar.f119506d);\n sb.append(\" bind arguments but \");\n sb.append(i);\n sb.append(\" were provided.\");\n throw new SQLiteBindOrColumnIndexOutOfRangeException(sb.toString());\n } else if (i != 0) {\n long j2 = cVar.f119505c;\n for (int i2 = 0; i2 < i; i2++) {\n Boolean bool = objArr[i2];\n int a = C46434h.m145968a((Object) bool);\n if (a != 4) {\n switch (a) {\n case 0:\n nativeBindNull(this.f119482o, j2, i2 + 1);\n break;\n case 1:\n nativeBindLong(this.f119482o, j2, i2 + 1, ((Number) bool).longValue());\n break;\n case 2:\n nativeBindDouble(this.f119482o, j2, i2 + 1, ((Number) bool).doubleValue());\n break;\n default:\n if (!(bool instanceof Boolean)) {\n nativeBindString(this.f119482o, j2, i2 + 1, bool.toString());\n break;\n } else {\n long j3 = this.f119482o;\n int i3 = i2 + 1;\n if (bool.booleanValue()) {\n j = 1;\n } else {\n j = 0;\n }\n nativeBindLong(j3, j2, i3, j);\n break;\n }\n }\n } else {\n nativeBindBlob(this.f119482o, j2, i2 + 1, (byte[]) bool);\n }\n }\n }\n }", "public MutableArray(Datum[] paramArrayOfDatum, int paramInt, CustomDatumFactory paramCustomDatumFactory)\n/* */ {\n/* 169 */ this.sqlType = paramInt;\n/* 170 */ this.old_factory = paramCustomDatumFactory;\n/* 171 */ this.isNChar = false;\n/* */ \n/* 173 */ setDatumArray(paramArrayOfDatum);\n/* */ }", "@Override\n public boolean isArray() {\n return false;\n }", "protected OfNonPrimitiveArray(Object value, Class<?> componentType) {\n this.value = value;\n this.componentType = componentType;\n }", "@Override\n\tpublic int insert_all(Object[] ob) {\n\t\treturn 0;\n\t}", "public interface MultiValueTableAdapter {\n\t//public void setComplexTable( ComplexTable table );\n\tpublic Object[] extract( Object o );\n\tpublic Object extractEvenNoValueExist( Object o );\n\tpublic void combine( Object o, Object[] extractValues );\n\tpublic ObjectNewer getObjectNewer();\n}", "public MutableArray(int paramInt, int[] paramArrayOfInt, ORADataFactory paramORADataFactory)\n/* */ {\n/* 122 */ this.sqlType = paramInt;\n/* 123 */ this.factory = paramORADataFactory;\n/* 124 */ this.isNChar = false;\n/* */ \n/* 126 */ setArray(paramArrayOfInt);\n/* */ }", "public MutableArray(double[] paramArrayOfDouble, int paramInt, CustomDatumFactory paramCustomDatumFactory)\n/* */ {\n/* 191 */ this.sqlType = paramInt;\n/* 192 */ this.old_factory = paramCustomDatumFactory;\n/* 193 */ this.isNChar = false;\n/* */ \n/* 195 */ setArray(paramArrayOfDouble);\n/* */ }", "private boolean switchTypes(String colType, Object obj) throws BPlusEngineException {\n switch (colType) {\n case \"INT\":\n if (obj instanceof Integer) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n break;\n case \"VARCHAR\":\n if (obj instanceof String) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n break;\n case \"Double\":\n if (obj instanceof Double) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n break;\n case \"Boolean\":\n if (obj instanceof Boolean) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n break;\n case \"DATE\":\n if (obj instanceof Date) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n break;\n default:\n throw new BPlusEngineException(\"Either You spelled the Type incorectly or the type does not exist, \"\n + \"Supported types: Integer, String, Double, Boolean, Date\");\n }\n return false;\n }", "@Override\n\tpublic String objectToSQLString(Object arg0) {\n\t\treturn null;\n\t}", "@Override\n public Class<SyschecksRecord> getRecordType() {\n return SyschecksRecord.class;\n }", "public Object[] toRawArray();", "public void visitDALOAD(DALOAD o){\n\t\tindexOfInt(o, stack().peek());\n\t\tif (stack().peek(1) == Type.NULL){\n\t\t\treturn;\n\t\t} \n\t\tif (! (stack().peek(1) instanceof ArrayType)){\n\t\t\tconstraintViolated(o, \"Stack next-to-top must be of type double[] but is '\"+stack().peek(1)+\"'.\");\n\t\t}\n\t\tType t = ((ArrayType) (stack().peek(1))).getBasicType();\n\t\tif (t != Type.DOUBLE){\n\t\t\tconstraintViolated(o, \"Stack next-to-top must be of type double[] but is '\"+stack().peek(1)+\"'.\");\n\t\t}\n\t}", "void visitArray(Object array, Type componentType);", "@Test\n public void testArrayCreationWithGeneralReturnType() {\n final Object obj = ArrayUtils.toArray(\"foo\", \"bar\");\n assertTrue(obj instanceof String[]);\n }", "MappedDatatype createMappedDatatype();", "public void setObjectdata(byte[] objectdata)\n {\n\n }", "private ServerError updateDatabase(String conn, String[] objJS, int serverVersion) {\n int numObjJS = objJS.length;\r\n\r\n // In case there are no JSON object to process on the server shows an error message\r\n if (numObjJS == 0) {\r\n return ServerError.OBJECT_NOT_FOUND;\r\n }\r\n\r\n // Instance of List of entities\r\n ArrayList<HttpEntity> objJSEntities = new ArrayList<HttpEntity>();\r\n\r\n // Create a number of JSON arrays equals to the number of JSON objects\r\n // because each JSON object contains a JSON array\r\n JSONArray[] arrayJson = new JSONArray[numObjJS];\r\n\r\n // Check if the objects passed have been parsed correctly, in case even one of those\r\n // has not been parsed correctly the app will return an error\r\n ServerError res = tryToParseJSON(conn, objJS, numObjJS, objJSEntities, arrayJson, serverVersion);\r\n\r\n return res;\r\n }" ]
[ "0.62701625", "0.6001787", "0.59190506", "0.5896174", "0.56076545", "0.55986786", "0.5593873", "0.5554742", "0.5491266", "0.5434515", "0.5389556", "0.5347643", "0.5283941", "0.52790344", "0.5270215", "0.526104", "0.52586496", "0.5224994", "0.52160054", "0.5215911", "0.5214756", "0.5211599", "0.5205843", "0.51839215", "0.51668215", "0.5160041", "0.5136355", "0.51257235", "0.5124929", "0.5119695", "0.5100044", "0.50958174", "0.50443053", "0.50372314", "0.50313926", "0.5015421", "0.4996203", "0.49948522", "0.49857706", "0.49713567", "0.4967702", "0.49657318", "0.49539098", "0.49502814", "0.494686", "0.49405628", "0.49380952", "0.49378082", "0.49355313", "0.49278867", "0.492772", "0.49176094", "0.4912543", "0.49065027", "0.48969698", "0.4879451", "0.48783836", "0.4875733", "0.4874058", "0.4872775", "0.4872401", "0.48701042", "0.4869688", "0.486852", "0.48673928", "0.4862984", "0.48624352", "0.48599106", "0.4859021", "0.48488143", "0.4840814", "0.48405376", "0.48392257", "0.48375756", "0.48375237", "0.48362213", "0.4836121", "0.4835854", "0.4833449", "0.4829212", "0.48256686", "0.48248774", "0.48236895", "0.482128", "0.4821087", "0.4817569", "0.48058692", "0.48037", "0.48031875", "0.48000535", "0.47990263", "0.47954535", "0.47907105", "0.47883075", "0.47813287", "0.47778824", "0.4774252", "0.4772136", "0.47671697", "0.47668138", "0.4759231" ]
0.0
-1
initilize the MDP space
public MarkovDecisionProcess(int totalWorkloadLevel, int totalGreenEnergyLevel, int totalBatteryLevel, double prob[][][][], int maxTimeInterval) { this.totalWorkloadLevel = totalWorkloadLevel; this.totalGreenEnergyLevel = totalGreenEnergyLevel; this.totalBatteryLevel = totalBatteryLevel; this.prob = prob; this.maxTimeInterval = maxTimeInterval; //Initial State, we set it at [0,0,0] initialState = new State(0, 0, 0, 1, -999, -1); initialState.setPath(initialState.toString()); grid = new State[maxTimeInterval][totalWorkloadLevel][totalGreenEnergyLevel][totalBatteryLevel]; //initialize the reward matix as all 0 rewardMatrix = new double[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel]; batteryLevelMatrix = new int[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel]; actionMatrix = new String[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel]; for(int i = 0; i < maxTimeInterval; i++) { for(int j = 0; j < totalWorkloadLevel*totalGreenEnergyLevel; j++) { for(int k = 0; k < totalWorkloadLevel*totalGreenEnergyLevel; k++) { rewardMatrix[i][j][k] = 0.0; batteryLevelMatrix[i][j][k] = 0; actionMatrix[i][j][k] = null; } } } //Initialize actions space, numActions = totalWorkloadLevel * totalBatteryLevel; for(int t =0; t < maxTimeInterval; t++) { for(int i = 0; i < totalWorkloadLevel; i++) { for(int j = 0; j < totalGreenEnergyLevel; j++) { for(int k = 0; k < totalBatteryLevel; k++) { grid[t][i][j][k] = new State(i ,j, k, prob[t][i][j][k], 0.0, t); if( t == maxTimeInterval - 1) { grid[t][i][j][k].setTerminate(); } } } } } reachableStates = new Vector(totalWorkloadLevel*totalGreenEnergyLevel*totalBatteryLevel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initialize()\n\t{\n\t\tfor(int i = 0 ; i < SOM.length; i++)\n\t\t{\n\t\t\tfor(int j=0; j < SOM[0].length; j++)\n\t\t\t{ \n\t\t\t\tSOM[i][j] = new Node(INPUT_DIMENSION,i,j);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSOM_HORIZONTAL_LENGTH = SOM[0].length;\n\t\tSOM_VERTICAL_LENGTH = SOM.length;\n\t}", "protected void aInit()\n {\n \ta_available=WindowSize;\n \tLimitSeqNo=WindowSize*2;\n \ta_base=1;\n \ta_nextseq=1;\n }", "@Override\r\n\tpublic void init() { \r\n\t\t\r\n\t\tsession = -1;\r\n\t\t\r\n\t\tProgressDif = 0;\r\n\t\tnoisFact = 0;\r\n\t\tcompromiseFact = 0;\r\n\t\t\r\n\t\tcompromiseLearn = 20;\r\n\t\tprogressLearn = 10;\r\n\t\tnoisLearn = 0.2;\r\n\t\t\r\n\t\treservationPanic = 0.2;\r\n\t\tmyBids = new ArrayList<Pair<Bid,Double>>();\r\n\t\topponentBidsA = new Vector<ArrayList<Pair<Bid,Double>>>();\r\n\t\topponentBidsB = new Vector<ArrayList<Pair<Bid,Double>>>();\r\n\r\n\t\tdf = utilitySpace.getDiscountFactor();\r\n\t\tif (df==0) df = 1; \r\n\r\n\t\ttry {\r\n\t\t\tinitStates();\r\n\t\t} catch (Exception e) {\r\n \t\t\te.printStackTrace();\r\n\t\t}\t\t\r\n\t}", "private void initialise() {\n \thashFamily = new Hash[this.r];\n for(int i= 0; i < this.r;i++)\n {\n \tthis.hashFamily[i] = new Hash(this.s * 2);\n }\n this.net = new OneSparseRec[this.r][this.s *2];\n for(int i = 0 ; i < this.r; i++)\n \tfor(int j =0 ; j< this.s * 2 ; j++)\n \t\tthis.net[i][j] = new OneSparseRec();\n \n }", "private void initilize()\n\t{\n\t\tdimXNet = project.getNoC().getNumRotX();\n\t\tdimYNet = project.getNoC().getNumRotY();\n\t\t\n\t\taddProperties();\n\t\taddComponents();\n\t\tsetVisible(true);\n\t}", "public void initializeObliqueLaunch(){\r\n world = new Environment();\r\n cannon = new Thrower();\r\n ball = new Projectile();\r\n this.setInitialValues();\r\n }", "@Override\n\tpublic void init() {\n\t\tGraph<Number,Number> ig = Graphs.<Number,Number>synchronizedDirectedGraph(new DirectedSparseMultigraph<Number,Number>());\n\t\tObservableGraph<Number,Number> og = new ObservableGraph<Number,Number>(ig);\n\t\tog.addGraphEventListener(new GraphEventListener<Number,Number>() {\n\n\t\t\tpublic void handleGraphEvent(GraphEvent<Number, Number> evt) {\n\t\t\t\tSystem.err.println(\"got \"+evt);\n\n\t\t\t}});\n\t\tthis.g = og;\n\n\t\tthis.timer = new Timer();\n\t\tthis.layout = new FRLayout2<Number,Number>(g);\n\t\t// ((FRLayout)layout).setMaxIterations(200);\n\t\t// create a simple pickable layout\n\t\tthis.vv = new VisualizationViewer<Number,Number>(layout, new Dimension(600,600));\n\n\n\n\t}", "@Before\r\n\tpublic void init() {\n\t\tfinal List<Integer> container3 = createContainer((int) Math.pow(3, 2));\r\n\t\tcontainer3.set(container3.size() - 1, null);\r\n\t\tgoal3 = new BoardListImpl<>(3, container3);\r\n\r\n\t\t// 4 x 4 board\r\n\t\tfinal List<Integer> container4 = createContainer((int) Math.pow(4, 2));\r\n\t\tcontainer4.set(container4.size() - 1, null);\r\n\t\tgoal4 = new BoardListImpl<>(4, container4);\r\n\t}", "public static void init(){\t\t\n\t\tParameters p = RunEnvironment.getInstance().getParameters();\n\n\t\tSIM_RANDOM_SEED = (Integer)p.getValue(\"randomSeed\");\n\t\tSIM_NUM_AGENTS = (Integer)p.getValue(\"maxAgents\");\n\t\tSIM_NORM_VIOLATION_RATE = (Float) p.getValue(\"Norm Violation Rate\");\n\t\tNUM_TICKS_TO_CONVERGE = (Long)p.getValue(\"NumTicksToConverge\");\n\t\tCONTENTS_QUEUE_SIZE = (Long)p.getValue(\"ContentsQueueSize\");\n\t\t\n\t\tNORM_GEN_EFF_THRESHOLD = (Double)p.getValue(\"NormsGenEffThreshold\");\n\t\tNORM_GEN_NEC_THRESHOLD = (Double)p.getValue(\"NormsGenNecThreshold\");\n\t\tNORM_SPEC_EFF_THRESHOLD = (Double)p.getValue(\"NormsSpecEffThreshold\");\n\t\tNORM_SPEC_NEC_THRESHOLD = (Double)p.getValue(\"NormsSpecNecThreshold\");\n\t\tNORM_UTILITY_WINDOW_SIZE = (Integer)p.getValue(\"NormsPerfRangeSize\");\n\t\tNORM_DEFAULT_UTILITY = (Double)p.getValue(\"NormsDefaultUtility\");\n\n\t\tNORM_SYNTHESIS_STRATEGY = (Integer)p.getValue(\"NormSynthesisStrategy\");\n\t\tNORM_GENERATION_REACTIVE = (Boolean)p.getValue(\"NormGenerationReactive\");\n\t\tNORM_GENERALISATION_MODE = (Integer)p.getValue(\"NormGeneralisationMode\");\n\t\tNORM_GENERALISATION_STEP = (Integer)p.getValue(\"NormGeneralisationStep\");\n\t\tNORM_SPEC_THRESHOLD_EPSILON = (Double)p.getValue(\"NormsSpecThresholdEpsilon\");\n\t\tNORMS_MIN_EVALS_CLASSIFY = (Integer)p.getValue(\"NormsMinEvaluationsToClassify\");\n\t\tNORMS_WITH_USER_ID = (Boolean)p.getValue(\"NormsWithUserId\");\n\n\t\t\n\t\t\n\t\t// System goals and their constants\n\t\tsystemGoals = new ArrayList<Goal>();\n\t\tsystemGoals.add(new GComplaints());\n\n\t\t//\t\tdouble tMinusEpsilon = NORM_SPEC_NEC_THRESHOLD - NORM_SPEC_THRESHOLD_EPSILON;\n\t\t//\t\t\n\t\t//\t\t/* For SIMON+ and LION, set default utility in a different manner... */\n\t\t//\t\tif(NORM_SYNTHESIS_STRATEGY == 3 || NORM_SYNTHESIS_STRATEGY == 4) {\n\t\t//\t\t\tNORM_DEFAULT_UTILITY = (float)(tMinusEpsilon * (NORM_MIN_EVALS+1)); \n\t\t//\t\t}\n\n\t\t/* For SIMON+ and LION, set default utility in a different manner... */\n\t\tif((NORM_SYNTHESIS_STRATEGY == 3 || NORM_SYNTHESIS_STRATEGY == 4) &&\n\t\t\t\t!NORM_GENERATION_REACTIVE) \n\t\t{\n\t\t\tNORM_DEFAULT_UTILITY = 0f; \n\t\t\tSystem.out.println(\"Norm generation is set as Deliberative\");\n\t\t}\n\t}", "@Override\n public void init() {\n robot = new MecanumBotHardware(true,true,true,true);\n robot.init(hardwareMap);\n int deg180=845;\n // Create the state machine and configure states.\n smDrive = new StateMachine(this, 16);\n smDrive.addStartState(new WaitState(\"wait\",0.1,\"MainDriveTeleop\"));\n smDrive.addState(new GigabyteTeleopDriveState(\"MainDriveTeleop\", robot));\n smDrive.addState(new SpinPose(\"90DegSpin\",(int)(deg180*0.5),robot,0.1f));\n smDrive.addState(new SpinPose(\"180DegSpin\",deg180,robot,0.1f));\n smDrive.addState(new SpinPose(\"270DegSpin\",(int)(deg180*1.5),robot,0.1f));\n\n smArm = new StateMachine(this, 16);\n smArm.addStartState(new WaitState(\"wait\",0.1,\"MainArmTeleop\"));\n smArm.addState(new GigabyteTeleopArmState(\"MainArmTeleop\", robot));\n smArm.addState(new ShoulderPose(\"Pose1\", robot,0, \"MainArmTeleop\"));//0.12\n smArm.addState(new ShoulderPose(\"Pose2\", robot,1079, \"MainArmTeleop\"));//0.05\n smArm.addState(new ShoulderPose(\"Pose3\", robot,2602, \"MainArmTeleop\"));//-0.17\n smArm.addState(new ShoulderPose(\"Pose4\", robot,3698, \"MainArmTeleop\" ));//-0.35\n // Init the state machine\n smDrive.init();\n smArm.init();\n }", "public void initialize() {\n\t\tnumRows = gridConfig.getNumRows();\n\t\tnumCols = gridConfig.getNumCols();\n\t\tgridCellCount = numRows * numCols;\n\t\tcreateMaps();\n\t\tsetCurrSimulationMap();\n\t\tcellWidth = SIZE / numCols;\n\t\tcellHeight = SIZE / numRows;\n\t\tcurrentGrid = new Cell[numRows][numCols];\n\t\tnewGrid = new Cell[numRows][numCols];\n\t\tempty(currentGrid);\n\t\tempty(newGrid);\n\t\tsetShapes();\n\t\tsetInitialStates();\n\t}", "public void initialise() {\n heap = new ArrayList<>(inverseHeap.keySet());\n inverseHeap = null; //null inverse heap to save space\n }", "private void init() {\n\t\t\n\t\ttry{\t\t\t\n\t\t\tinfos = new HashMap<String, VariableInfo>();\n\t\t\t\n\t\t\tfor(String var : this.problem.getMyVars()){\n\t\t\t\t\n\t\t\t\tif(this.problem.getNbrNeighbors(var) != 0){ // an isolated variable doesn't need a CryptoScheme and therefore no VariableInfo either\n\t\t\t\t\t\n\t\t\t\t\tVariableInfo info = new VariableInfo(var);\n\t\t\t\t\tinfos.put(var, info);\n\t\t\t\t\t\n\t\t\t\t\tinfo.cs = cryptoConstr.newInstance(this.cryptoParameter);\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//initialize request counter for my own variables\n\t\t\trequestCount = new HashMap<String,Integer>(); \n\t\t\tfor(String var : this.problem.getMyVars()){\n\t\t\t\trequestCount.put(var, 0);\n\t\t\t}\n\t\t\t\n\t\t\tthis.started = true;\t\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t}", "public void initState() {\n\n\t\tdouble bsc_p = 0.09; // TODO : doit dependre du souffle !?\n\t\tfor (int i=0; i<n; i++) lambda[i] = 0;\n\t\taddBSCnoise(lambda, bsc_p); \n\t\t// lambda: log likelihood ratio\n\t\tcalc_q0(lambda);\n\n\t\t// initialization of beta\n\t\tfor (int i = 0; i <= m - 1; i++) {\n\t\t\tfor (int j = 0; j <= row_weight[i] - 1; j++) {\n\t\t\t\tbeta[i][j] = 0.0;\n\t\t\t}\n\t\t}\t\t\n\n\t}", "protected void initialize() {\r\n x = 0;\r\n y = 0;\r\n driveTrain.reInit();\r\n }", "protected void initModel() throws CommandLineFormatException, NullCoordinateException\n\t{\n\t\t\n\t\tfinal Var vdt = command.get(CNFTCommandLine.DT); //default dt\n\t\t\n\t\tcortical = new NeighborhoodMap(CORTICAL, \n\t\t\t\tnew SomUM(inputSpace, vdt, extendedFramedSpace)){\n\t\t\tpublic void compute() throws NullCoordinateException{\n\t\t\t\tsuper.compute();\n\t\t\t\tpotential.resetState();\n\t\t\t}\n\t\t};\n\t\t\n\t\t\n\t\tpotential = getPotential(vdt);\n\t\t\n\t\t\n\t\tcortical.addParameters(input,potential,command.get(CNFTCommandLine.LEARNING_RATE));\n\t\tNeighborhood neigh = new V4Neighborhood2D( extendedFramedSpace, new UnitLeaf((UnitParameter) cortical));\n\t\tneigh.setNullUnit(new ConstantUnit(new Var(0)));\n\t\t((NeighborhoodMap)cortical).addNeighboors(neigh);\n\t\t\n\t\t\n\t\tthis.root = cortical;\n\t\t\n\t\tcorticalPot = new Map(CORTICAL_POT, new Sum(vdt, extendedFramedSpace, new Leaf(cortical)));\n\t\tthis.addParameters(corticalPot);\n\t\t\n\t\t\n\n\t}", "void initialise() {\n this.sleep = false;\n this.owner = this;\n renewNeighbourClusters();\n recalLocalModularity();\n }", "private void initialize() {\n\n\t\tint totalSets, iSet;\n\t\tInformationSet infoSet = null;\n\t\tTreeNode treeNode = null;\n\n\t\tArrayList informationSetList = efg.getInformationSets(iPlayer);\n\n\t\ttotalSets = informationSetList.size();\n\n\t\tmovesLists = new ArrayList[totalSets];\n\t\tprobsLists = new ArrayList[totalSets];\n\n\t\tfor (iSet = 0; iSet < totalSets; iSet++) {\n\t\t\tmovesLists[iSet] = new ArrayList();\n\t\t\tprobsLists[iSet] = new ArrayList();\n\t\t}\n\n\t\tfor (iSet = 0; iSet < totalSets; iSet++) {\n\t\t\tinfoSet = (InformationSet) informationSetList.get(iSet);\n\t\t\ttreeNode = infoSet.getTreeNode(0);\n\t\t\tmovesLists[iSet] = treeNode.getMovesList();\n\t\t}\n\t}", "public void robotInit() {\n \tboardSubsystem = new BoardSubsystem();\n }", "private void initializeGraph() {\r\n map = new HashMap<>();\r\n graph = new List[n];\r\n for (int i = 0; i < n; i++) graph[i] = new ArrayList<>();\r\n\r\n\r\n }", "private void init() {\n\n\n\n }", "protected void initialize ()\n\t{\n\t\tSubsystems.goalVision.processNewImage();\n\t\t\n \t//Send positive values to go forwards.\n \tSubsystems.transmission.setLeftJoystickReversed(true);\n \tSubsystems.transmission.setRightJoystickReversed(true);\n\t}", "public void initialise(Graph graph) {\n Entry[][] matrix = graph.matrix();\n matrix[START_INDEX][0] = new Entry(0.0, 0.0);\n double initial = 1.0 / graph.size();\n\n for (int i = 1; i < graph.size(); i++) {\n matrix[i][0] = new Entry(initial, initial);\n }\n }", "private void initialize()\n {\n for(int i=0;i<4;i++)\n {\n foundationPile[i]= new Pile(Rank.ACE);\n foundationPile[i].setRules(true, false, false, false, true,false, true);\n } \n for(int i=0;i<7;i++)\n {\n tableauHidden[i] = new Pile();\n tableauVisible[i] = new Pile(Rank.KING);\n tableauVisible[i].setRules(false, true, false, false, false,false, true);\n } \n deck.shuffle();\n deck.shuffle();\n dealGame();\n }", "public void setUp() {\r\n\t\tsynchronized(phys) {\r\n\t\t\r\n\t\tReactionSystem reactions = new ReactionSystem();\r\n\t\tphys.getParticles().clear();\r\n\t\tphys.compounds.clear();\r\n\t\tphys.particlecount.clear();\r\n\t\t\r\n\t\t//Add new compounds\r\n\t\t\r\n\t\tfor (Compound c: rm.compounds) {\r\n\t\t\tphys.addCompound(c);\r\n\t\t}\r\n\t\t\r\n\t\t//Add new reactions\r\n\t\t\r\n\t\tfor (CompoundReaction rx: rm.reactions) {\r\n\t\t\trx.convertToReactions(reactions.getReactions());\r\n\t\t}\r\n\t\t\r\n\t\tphys.reactions = reactions;\r\n\t\tphys.calculateAvgMass();\r\n\t\tphys.calculateAvgRadius();\r\n\t\r\n\t\t\r\n\t\tfor (Reaction r: phys.reactions.getReactions()) {\r\n\r\n\t\t\tSystem.out.println(r);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//Add graphs\r\n\t\tscale.reset();\r\n\t\tphys.graphs.clear();\r\n\t\tfor (Compound c: phys.compounds) {\r\n\t\t\tphys.graphs.add(new ConcentrationDataCollector(300, c, scale));\t\r\n\t\t}\r\n\t\t\r\n\t\tphys.time = 0;\r\n\t\tphys.nextcollection = phys.collectioninterval;\r\n\t\tphys.bondenergy = 0;\r\n\t\t}\r\n\t}", "public void initialSetup(GameObserver gameObs) {\n nPlayers = gameObs.getNumPlayers();\n nActs = gameObs.getNumActions().clone();\n eGame = new EmpiricalMatrixGame(nPlayers, nActs);\n eGame.setDefaultPayoff(gameObs.getDefaultPayoff());\n currentPlayer = 0;\n lastPlayerWithBR = nPlayers - 1;\n samplesToConfirmEquilibrium = -1;\n mostStableConfirmed = null;\n confirmedStability = Double.POSITIVE_INFINITY;\n currentOutcome = new int[nPlayers];\n predictedOutcome = new OutcomeDistribution(nActs);\n tabu = new GenericTensor<Boolean>(nActs);\n for (int i = 0; i < tabu.size(); i++) {\n tabu.setValue(false, i);\n }\n deviationTestOrder.initialize(nPlayers, nActs);\n\n // this must be last\n selectRandomUnexploredProfile(gameObs);\n }", "protected void aInit()\r\n {\r\n \t\t//state_sender = STATE_WAIT_FOR_CALL_0_FROM_ABOVE;\r\n \t\tpacketBufferAry = new Packet[LimitSeqNo];\r\n \t\twindow_base = FirstSeqNo;\r\n \t\tnext_seq_num = FirstSeqNo;\r\n \t\tSystem.out.println(\"|aInit| : window_base: \"+Integer.toString(window_base));\r\n \t\tSystem.out.println(\"|aInit| : next_seq_num: \"+Integer.toString(next_seq_num)); \t\t\r\n }", "public abstract void initialize(P msg);", "private Graph<Node, DefaultEdge> initialiseSpaceGraph() {\n Graph<Node, DefaultEdge> g = new SimpleGraph<>(DefaultEdge.class);\n g = addNodes(g);\n g = addEdges(g);\n return g;\n }", "@SuppressWarnings(\"unchecked\")\n\t\tvoid init() {\n\t\t\tsetNodes(offHeapService.newArray(JudyIntermediateNode[].class, NODE_SIZE, true));\n\t\t}", "private void init()\n\t{\n\t\tsetModel(new Model(Id.model, this, null));\n\t\tsetEnviroment(new Enviroment(Id.enviroment, this, model()));\n\t\tsetVaccinationCenter(new VaccinationCenter(Id.vaccinationCenter, this, model()));\n\t\tsetCanteen(new Canteen(Id.canteen, this, vaccinationCenter()));\n\t\tsetRegistration(new Registration(Id.registration, this, vaccinationCenter()));\n\t\tsetExamination(new Examination(Id.examination, this, vaccinationCenter()));\n\t\tsetVaccination(new Vaccination(Id.vaccination, this, vaccinationCenter()));\n\t\tsetWaitingRoom(new WaitingRoom(Id.waitingRoom, this, vaccinationCenter()));\n\t\tsetSyringes(new Syringes(Id.syringes, this, vaccination()));\n\t}", "public void init()\n\t{\n\t\tint inN;\n\t\tdo{\n\t inN=getN();\n\t switch(inN)\n\t {\n\t case 1: problem1();break;\n\t case 2: problem2();break;\n\t case 3: problem3();break;\n\t default:\n\t }\n\t }while(inN != 0);\t\n\t}", "public void setup(){\r\n\t\t\r\n\r\n\t\tsuper.setup();\r\n\t\t\r\n\t\tparams = new String[] {\"numLocations\",\"numFirms\",\"timeHorizon\",\"enteringCosts\",\r\n\t\t\t\t \"reservationPrice\", \"productDifferentiation\",\r\n\t\t\t\t \"adjustEnteringCosts\",\r\n\t\t\t\t \"sdNoiseImitationKnowledge\",\r\n\t\t\t\t \"sdNoiseImitationConcept\",\r\n\t\t\t\t \"sigma\",\"discontFactor\",\"initialInnoEff\",\"fractionEffectivityImitators\",\r\n\t\t\t\t \"initialImiEff\",\"exitingCosts\",\"fractionEffectivityInnovators\",\r\n\t\t\t\t \"locationCosts\",\"isolatedLocation\", \"maxQualityConceptProgress\",\"heterogeneityMode\",\"randomAllocation\", \"numMontecarloRuns\",\r\n\t\t\t\t \"maxQualityConceptProgress\",\"rateLocationDecision\", \"marketEntryCosts\",\r\n\t\t\t\t \"marketEntryHazardRate\", \"parTimeToMarket\",\"ModelModeTimeToMarket\",\"scrapValueParameterInno\",\"scrapValueParameterImi\",\"strategyParameter\",\"targetNumFirms\"};\r\n\r\n\t\r\n\r\n\t\t\r\n\t\tif(graphOutput!=null)\r\n\t\t\tgraphOutput.dispose();\r\n\t\t\r\n\t\tif(graphPrice!=null)\r\n\t\t\tgraphPrice.dispose();\r\n\t\t\r\n\t\tif(graphQuality!=null)\r\n\t\t\tgraphQuality.dispose();\r\n\t\tif(graphNumFirms!=null)\r\n\t\t\tgraphNumFirms.dispose();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tif(graphFirmLocations!=null)\r\n\t\t\tgraphFirmLocations.dispose();\r\n\t\t\r\n\t\tif(graphEnteringCosts!=null)\r\n\t\t\tgraphEnteringCosts.dispose();\r\n\t\t\r\n\t\t\r\n\t\tif(graphAverageProbability!=null)\r\n\t\t\tgraphAverageProbability.dispose();\r\n\t\t\r\n\t\tif(graphTotalProfit!=null)\r\n\t\t\tgraphTotalProfit.dispose();\r\n\t\t\r\n\t\tif(graphClusteringCoefficient!=null)\r\n\t\t\tgraphClusteringCoefficient.dispose();\r\n\t\t\r\n\t\t\r\n\t\tif(graphSingleOutput!=null)\r\n\t\tgraphSingleOutput.dispose();\r\n\t\t\r\n\t\tif(graphSinglePrice!=null)\r\n\t\tgraphSinglePrice.dispose(); \r\n\t\t\r\n\t\tif(graphSingleQuality!=null)\r\n\t\tgraphSingleQuality.dispose(); \r\n\t\t\r\n\t\tif(graphSingleFirmLocations!=null)\r\n\t\tgraphSingleFirmLocations.dispose();\r\n\t\t\r\n\t\tif(graphSingleProbability!=null)\r\n\t\t graphSingleProbability.dispose(); \r\n\t\t\r\n\t\tif(graphSinglelProfit!=null)\r\n\t\tgraphSinglelProfit.dispose();\r\n\t\t\r\n\t\t\r\n\t\tif(graphSingleQualityConcept!=null)\r\n\t\t\tgraphSingleQualityConcept.dispose();\r\n\t\t\r\n\t\t\r\n\t\tif(graphCumProfit!=null)\r\n\t\t\tgraphCumProfit.dispose();\r\n\t\t\r\n\t\t\r\n\t \r\n\t if(dsurfList!=null){\r\n\t\t for(int i=0; i<dsurfList.size();i++){\r\n\t\t \t\t\r\n\t\t \t\tdsurfList.get(i).dispose();\r\n\t\t \r\n\t\t }\r\n\t}\r\n\t \r\n\t gridList = null;\r\n\t dsurfList = null;\r\n\t \r\n\t gridList = new ArrayList<Object2DGrid>() ;\r\n\t dsurfList\t= new\tArrayList<DisplaySurface>() ;\r\n\t \r\n\t \r\n\t dimX = ((int) Math.sqrt(numFirms))+5;\r\n\t dimY=dimX;\r\n\t \r\n\t \r\n\t \r\n\t if (surface != null)\r\n\t surface.dispose ();\r\n\t surface = null;\r\n\t \r\n\t surface = new DisplaySurface (this, \"Firm network\");\r\n\t registerDisplaySurface (\"Firm network\", surface);\r\n\t\t\r\n\t\t\r\n\t}", "private void initialParameters()\n\t{\n\t\tasteroidList = new ArrayList<Asteroid>();\n\t\tfor(int i = 0 ; i < INITIAL_ASTEROIDS ; i++)\n\t\t\tasteroidList.add(new Asteroid(getRandomLocationX(), getRandomLocationY(), SCREEN_WIDTH, SCREEN_HEIGHT));\n\t\t\n\t\t//========== Game Status ===========\n\t\trunning \t= true;\n\t\tisWin \t\t= false;\n\t\tisGameOver \t= false;\n\t\t\n\t\t//========== Game Craft ===========\t\t\n\t\tcraft = new Craft(SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH, SCREEN_HEIGHT);\n\t}", "private void initializeCMNGame() {\n\t\t// populate the moveList with all the possible moves for the\n\t\t// given values of C,M,N\n\n\t\tNUMBER_OF_MOVES = MM + 1;\n\n\t\tmoves1 = new TreeSet<CMNMove>();\n\t\tmoves2 = new TreeSet<CMNMove>();\n\t\tmovesLeft = new TreeSet<CMNMove>();\n\n\t\tfor (int i = 0; i < NUMBER_OF_MOVES; i++)\n\t\t\tmoveList.add(new CMNMove(i));\n\n\t\tmoves1.clear();\n\t\tmoves2.clear();\n\t\tmovesLeft.clear();\n\t\tmovesLeft.addAll(moveList);\n\n\t\tsetWinningTuples();\n\t}", "protected void setup(){\n\n\t\tsuper.setup();\n\n\t\tfinal Object[] args = getArguments();\n\t\tif(args!=null && args[0]!=null && args[1]!=null){\n\t\t\tdeployAgent((Environment) args[0],(EntityType)args[1]);\n\t\t}else{\n\t\t\tSystem.err.println(\"Malfunction during parameter's loading of agent\"+ this.getClass().getName());\n System.exit(-1);\n }\n\t\t\n\t\t//############ PARAMS ##########\n\n\t\tthis.nbmodifsmin \t\t= 30;\t\t\t//nb modifs minimum pour renvoyer la carte\n\t\tthis.timeOut \t\t\t= 1000 * 4;\t\t//secondes pour timeout des messages (*1000 car il faut en ms)\n\t\tthis.sleepbetweenmove \t= 200;\t\t\t//in MS\n\t\tthis.nbmoverandom\t\t= 4;\t\t\t// nb random moves by default\n\t\t\n\t\t//#############################\n\t\t//setup graph\n\t\t//setupgraph();\n\t\tthis.graph = new SingleGraph(\"graphAgent\");\n\t\tinitMyGraph();\n\t\tthis.step = 0;\n\t\tthis.stepMap = new HashMap<String, Integer>();\n\t\tthis.path = new ArrayList<String>();\n\t\tthis.mailbox = new Messages(this);\n\t\tthis.lastMsg = null;\n\t\tthis.switchPath = true;\n\t\tthis.lastsender = null;\n\t\tthis.lastSentMap = new HashMap<String, Integer>(); //nbmodifs\n\t\tthis.remakepath = false; // changes to true if the map changed in a way that requires a new path\n\t\tthis.nbmoverandomoriginal = this.nbmoverandom;\n\t\t\n\t\tthis.toSendMap = new HashMap<String, Graph>(); //actual hashmap graph\n\t\t\n\t\tSystem.out.println(\"the agent \"+this.getLocalName()+ \" is started\");\n\t}", "private void initialize(TransformListener tf, VoxelGrid costmap_ros){\n if (!initialized_){\n tf_ = tf;\n costmap_ros_ = costmap_ros;\n\n rot_stopped_velocity_ = 0.01;\n trans_stopped_velocity_ = 0.01;\n\n current_waypoint_ = 0;\n\n this.params=this.node.getParameterTree();\n\n //base local planner params\n yaw_goal_tolerance_ = params.getDouble(\"yaw_goal_tolerance\", 0.05);\n xy_goal_tolerance_ = params.getDouble(\"xy_goal_tolerance\", 0.10);\n latch_xy_goal_tolerance_ = params.getBoolean(\"latch_xy_goal_tolerance\", false);\n ignore_goal_yaw_ = params.getBoolean(\"ignore_goal_jaw\", false);\n\n\n // ros::NodeHandle nh;//for stand alone??\n\n String IP = null;\n String hostname = null;\n try {\n InetAddress ia = InetAddress.getLocalHost();\n hostname = ia.getHostName();//获取计算机主机名\n IP = ia.getHostAddress();//获取计算机IP\n } catch (UnknownHostException e) {\n e.printStackTrace();\n }\n\n //if (standalone_) {\n // ConnectedNode selfNode;\n String my_id = node.getName().toString();\n if (my_id.equals(\"/\")) {\n my_id = hostname;\n }\n\n my_id = params.getString(\"name\",my_id);\n node.getLog().info(\"My name is: \" + my_id);\n\n\n /*----------init ros agent and set parameters---------*/\n me=new Agent();\n\n //acceleration limits load from params_turtle.yaml and private_nh\n //namespace maybe /CollvoidLocalPlanneri\n me.acc_lim_x_=params.getDouble(\"acc_lim_x\");\n me.acc_lim_y_=params.getDouble(\"acc_lim_y\");\n me.acc_lim_th_=params.getDouble(\"acc_lim_th\");\n\n //holo_robot\n me.holo_robot_=params.getBoolean(\"holo_robot\");\n\n if (!holo_robot_)\n me.wheel_base_=params.getDouble(\"wheel_base\");\n else\n me.wheel_base_ = 0.0;\n\n //min max speeds\n me.max_vel_with_obstacles_=params.getDouble(\"max_vel_with_obstacles\");\n\n me.max_vel_x_=params.getDouble(\"max_vel_x\");\n me.min_vel_x_=params.getDouble(\"min_vel_x\");\n me.max_vel_y_=params.getDouble(\"max_vel_y\");\n me.min_vel_y_=params.getDouble(\"min_vel_y\");\n me.max_vel_th_=params.getDouble(\"max_vel_th\");\n me.min_vel_th_=params.getDouble(\"min_vel_th\");\n me.min_vel_th_inplace_=params.getDouble(\"min_vel_th_inplace\");\n\n //set radius\n me.footprint_radius_=params.getDouble(\"footprint_radius\");\n me.radius=me.footprint_radius_+me.cur_loc_unc_radius_;\n radius_=me.footprint_radius_;\n\n //set frames\n //robot_base_frame_ = costmap_ros_->getBaseFrameID(); need to investigate\n me.base_frame_ = new String(costmap_ros_.getHeader().getFrameId());//may not be right\n me.global_frame_ = new String(params.getString(\"global_frame\", \"/map\"));\n\n //sim period\n GraphName controller_frequency_param_name;\n controller_frequency_param_name=params.search(\"controller_frequency\");\n double sim_period_;\n if(controller_frequency_param_name==null){\n sim_period_ = 0.05;\n }\n else {\n double controller_frequency = 0;\n controller_frequency=params.getDouble(controller_frequency_param_name,20.0);\n\n if(controller_frequency > 0){\n sim_period_ = 1.0 / controller_frequency;\n }else{\n this.node.getLog().warn(\"A controller_frequency less than 0 has been set. Ignoring the parameter, assuming a rate of 20Hz\");\n sim_period_ = 0.05;\n }\n }\n this.node.getLog().info(\"Sim period is set to \"+ String.format(\"%1$.2f\",sim_period_));\n\n me.simPeriod=sim_period_;\n\n //other params agent\n //me.time_horizon_obst_ = getParamDef(private_nh,\"time_horizon_obst\",10.0); currently not used in agent\n me.time_to_holo_ = params.getDouble(\"time_to_holo\", 0.4);\n me.minErrorHolo = params.getDouble(\"min_error_holo\", 0.01);\n me.maxErrorHolo = params.getDouble( \"max_error_holo\", 0.15);\n //delete_observations_ = params.getBoolean(\"delete_observations\", true); currently not used in agent\n //threshold_last_seen_ = params.getDouble(\"threshold_last_seen\",1.0); currently not used in agent\n me.eps_= params.getDouble( \"eps\", 0.1);\n\n boolean orca, convex, clearpath, use_truncation;\n int num_samples, type_vo;\n me.orca=params.getBoolean( \"orca\");\n me.convex=params.getBoolean( \"convex\");\n //params.getBoolean( \"clearpath\", &clearpath); not used\n me.useTruancation=params.getBoolean( \"use_truncation\");\n\n //num_samples = getParamDef(private_nh, \"num_samples\", 400); not used\n me.voType = params.getInteger(\"type_vo\", 0); //HRVO\n\n me.truncTime = params.getDouble(\"trunc_time\",5.0);\n //left_pref_ = getParamDef(private_nh,\"left_pref\",0.1); not used\n\n me.publishPositionsPeriod = 1.0/params.getDouble(\"publish_positions_frequency\",10.0);\n\n me.publishMePeriod = 1.0/params.getDouble(\"publish_me_frequency\",10.0);\n\n //set Footprint\n List<Point> footprint_points=new ArrayList<Point>();\n //TODO:footprint_points = costmap_ros_->getRobotFootprint();\n\n PolygonStamped footprint=messageFactory.newFromType(PolygonStamped._TYPE);\n Point32 p=messageFactory.newFromType(Point32._TYPE);\n List<Point32> points=new ArrayList<Point32>();\n for (int i = 0; i<footprint_points.size(); i++) {\n p.setX((float)footprint_points.get(i).getX());\n p.setY((float) footprint_points.get(i).getY());\n points.add(p);\n }\n Polygon polygon=messageFactory.newFromType(Polygon._TYPE);\n polygon.setPoints(points);\n footprint.setPolygon(polygon);\n\n points.clear();\n if (footprint.getPolygon().getPoints().size()>2)\n me.setFootprint(footprint);\n else {\n double angle = 0;\n double step = 2 * Math.PI / 72;\n while(angle < 2 * Math.PI){\n Point32 pt=messageFactory.newFromType(Point32._TYPE);\n pt.setX((float)(radius_ * Math.cos(angle)));\n pt.setY((float) (radius_ * Math.sin(angle)));\n pt.setZ(0.0f);\n points.add(pt);\n angle += step;\n }\n polygon.setPoints(points);\n footprint.setPolygon(polygon);\n me.setFootprint(footprint);\n }\n\n me.initAsMe(this.node, tf_);\n me.id_=new String(my_id);\n\n\n\n skip_next_ = false;\n Publisher<Path> g_plan_pub_=this.node.newPublisher(\"global_plan\", Path._TYPE);\n Publisher<Path> l_plan_pub_=this.node.newPublisher(\"l_plan_pub_\", Path._TYPE);\n String move_base_name = this.node.getName().toString();\n //ROS_ERROR(\"%s name of node\", thisname.c_str());\n\n Subscriber<GridCells> obstacles_sub_ = this.node.newSubscriber(move_base_name + \"/local_costmap/obstacles\", GridCells._TYPE);\n obstacles_sub_.addMessageListener(new MessageListener<GridCells>() {\n @Override\n public void onNewMessage(GridCells msg) {\n obstaclesCallback(msg);\n }\n });\n\n setup_= false;\n //not implemented yet\n //dsrv_ = new dynamic_reconfigure::Server<collvoid_local_planner::CollvoidConfig>(private_nh);\n //dynamic_reconfigure::Server<collvoid_local_planner::CollvoidConfig>::CallbackType cb = boost::bind(&CollvoidLocalPlanner::reconfigureCB, this, _1, _2);\n //dsrv_->setCallback(cb);\n\n initialized_ = true;\n }\n else {\n node.getLog().info(\"This planner has already been initialized, you can't call it twice, doing nothing\");\n }\n\n }", "private void initializeEngine() {\n engine.setDecayDelay(emotionalAgent.decayTimeMillis());\n\n // Get decay steps parameter from ADF if exists and set decay steps in engine\n engine.setDecaySteps(emotionalAgent.decayStepsToMin());\n\n // Set engine initialized\n engine.setInitialized(true);\n }", "private void init()\n {\n sendData(REG_MMXCOMMAND, MMXCOMMAND_RESET);\n Delay.msDelay(50);\n // init motor operation parameters\n for (int i=0;i<CHANNELS;i++){\n motorParams[MOTPARAM_RAMPING][i] = MOTPARAM_OP_TRUE;\n motorParams[MOTPARAM_ENCODER_BRAKING][i] = MOTPARAM_OP_TRUE;\n motorParams[MOTPARAM_POWER][i] = 0;\n motorParams[MOTPARAM_REGULATE][i] = MOTPARAM_OP_TRUE;\n doCommand(CMD_SETPOWER, 100, i); // will set motorParams[MOTPARAM_POWER][channel]\n }\n \n }", "public void init() {\r\n\r\n\t}", "private static void init() {\n\t\t// TODO Auto-generated method stub\n\t\tviewHeight = VIEW_HEIGHT;\n\t\tviewWidth = VIEW_WIDTH;\n\t\tfwidth = FRAME_WIDTH;\n\t\tfheight = FRAME_HEIGHT;\n\t\tnMines = N_MINES;\n\t\tcellSize = MINE_SIZE;\n\t\tnRows = N_MINE_ROW;\n\t\tnColumns = N_MINE_COLUMN;\n\t\tgameOver = win = lost = false;\n\t}", "public void init()\n\t// throws GameException\n\t{\n\t\tnextPlayer = Game.FIRST_PLAYER;\n\t\tsomeoneQuit = false;\n\t\tonePlayerLeft = null;\n\t\tisGameNew = true;\n\t\twinningPlayer = Game.GAME_NOT_OVER;\n\t\tinitializeCMNGame();\n\t\t// if (WINS.size() <= 0)\n\t\t// throw new GameException (\"Unacceptable input C = \" + CC +\n\t\t// \", M = \" + MM + \", N = \" + NN +\n\t\t// \".\\nExiting...\");\n\t}", "public abstract void initializeProcess();", "@Override\r\n public void initialize(List<Gdl> description) {\r\n try {\r\n \tdescription = sanitizeDistinct(description);\r\n\t\t\tpropNet = OptimizingPropNetFactory.create(description);\r\n\t\t\t//propNet.renderToFile(\"propnet.dot\");\r\n\t\t\troles = propNet.getRoles();\r\n\t\t\tinitPropnetVars();\r\n\t\t\tfor (Component c : propNet.getComponents()) {\r\n\t\t\t\tc.crystalize();\r\n\t\t\t}\r\n } catch (InterruptedException e) {\r\n throw new RuntimeException(e);\r\n }\r\n }", "public static void start(){\n mngr.getStpWds();\n mngr.getDocuments();\n mngr.calculateWeights();\n mngr.getInvertedIndex();\n mngr.getClusters();\n mngr.getCategories();\n mngr.getUserProfiles();\n mngr.makeDocTermMatrix();\n\n }", "private void initProcess(){\n this.getScPanelFriends().getViewport().setOpaque(false);\n this.getScPanelTopics().getViewport().setOpaque(false);\n this.getCenterPanel().setSize(0,0);\n this.getEastPanel().setSize(1700,800);\n //Administrador inhabilitado por defecto hasta implementación\n this.getBtnAdmin().setEnabled(false);\n this.getMenuOption().setLocationRelativeTo(this);\n }", "public void init() {\n\r\n\t}", "public void init() {\n\r\n\t}", "public EnigmaMachine()\n\t{\n\t\t//Instantiating a plugboard inside the enigma\n\t\tplugboard = new Plugboard();\n\t\t//Instantiating the three rotors of the enigma\n\t\trotors = new BasicRotor[3];\n\t}", "protected void initialize() {\r\n\r\n Robot.pneumatics.pneuOpen();\r\n }", "private void initializeGraphAsEmpty() {\n int max = getNumNodes();\n\n parentMatrix = new int[getNumNodes()][max];\n childMatrix = new int[getNumNodes()][max];\n\n for (int i = 0; i < getNumNodes(); i++) {\n parentMatrix[i][0] = 1; //set first node\n childMatrix[i][0] = 1;\n }\n\n for (int i = 0; i < getNumNodes(); i++) {\n for (int j = 1; j < max; j++) {\n parentMatrix[i][j] = -5; //set first node\n childMatrix[i][j] = -5;\n }\n }\n }", "@Override\r\n\tpublic void init() \r\n\t{\r\n\t\tthis.board = new GameBoard();\r\n\t}", "public static void initializePreqs() { \r\n\t\tlist = new ArrayList<Freebody>();\r\n\t\ttrackers = new ArrayList<TrackingPoint>();\r\n\t\tcamPos=new int[3];\r\n\t}", "public void initialize() {\n\t\tmaze = new Block[width][height];\n\t\tborder();\n\t}", "public void initialization() {\n iterations_ = 1;\n\n swarm_ = new SolutionSet(swarmSize_);\n best_ = new Solution[swarmSize_];\n\n dominance_ = new DominanceComparator();\n crowdingDistanceComparator_ = new CrowdingDistanceComparator();\n distance_ = new Distance();\n\n speed_ = new double[swarmSize_][problem_.getNumberOfVariables()];\n\n deltaMax_ = new double[problem_.getNumberOfVariables()];\n deltaMin_ = new double[problem_.getNumberOfVariables()];\n for (int i = 0; i < problem_.getNumberOfVariables(); i++) {\n deltaMax_[i] = (problem_.getUpperLimit(i) -\n problem_.getLowerLimit(i)) / 2.0;\n deltaMin_[i] = -deltaMax_[i];\n }\n\n for (int i = 0; i < swarmSize_; i++) {\n for (int j = 0; j < problem_.getNumberOfVariables(); j++) {\n speed_[i][j] = 0.0;\n }\n }\n }", "public void init(){\r\n\t\t\r\n\t}", "protected void initialize() {\n \tif (state == PistonPositions.Extended) moving = Robot.armPiston.smartExtend();\n \telse Robot.armPiston.smartRetract();\n }", "@Override\r\n\tpublic void init() {\n\r\n\t PetriNet _net = new PetriNet(this, \"PhilosopherNet\", true, true);\r\n\t ContDistExponential dist1 = new ContDistExponential(this, \"waitdist1\", 2, true, true);\r\n\t ContDistExponential dist2 = new ContDistExponential(this, \"waitdist1\", 3, true, true);\r\n\t ContDistExponential dist3 = new ContDistExponential(this, \"durdist1\", 3, true, true);\r\n\r\n\t\t// Declaration of the used types of Tokens. These have to be objects\r\n\t\t// implementing the TokenType interface. Note that there is only one\r\n\t\t// object for each type, no matter how many Tokens of that type may\r\n\t\t// exist. A different object (even of the same class) always declares a\r\n\t\t// new, different type of token.\r\n\t\t\r\n\t\tTokenType type1 = new Fork();\r\n\t\tTokenType type2 = new Fork();\r\n\t\tTokenType type3 = new Fork();\r\n\t\tTokenType type4 = new Fork();\r\n\t\tTokenType type5 = new Fork();\r\n\t\tMap<TokenType, Integer> tokens = TokenMultiSetTools.arrayToMap(\r\n\t\t\t\tnew TokenType[] { type1, type2, type3, type4, type5 },\r\n\t\t\t\tnew int[] { 1, 1, 1, 1, 1 });\r\n\r\n\t\tPlace p1 = new Place(this, _net, \"p1\", tokens, true, true, true);\r\n\r\n\t\tTransitionMode t1 = new TransitionMode(this, _net, \"t1\", dist1, dist3, true, true);\r\n\t\tTransitionMode t2 = new TransitionMode(this, _net, \"t2\", dist2, dist3, true, true);\r\n\t\tTransitionMode t3 = new TransitionMode(this, _net, \"t3\", dist1, dist3, true, true);\r\n\t\tTransitionMode t4 = new TransitionMode(this, _net, \"t4\", dist2, dist3, true, true);\r\n\t\tTransitionMode t5 = new TransitionMode(this, _net, \"t5\", dist1, dist3, true, true);\r\n\r\n\t\tTransition trans = new Transition(this, _net, \"Mahlzeit\", true, true);\r\n\t\ttrans.addTransitionMode(t1);\r\n\t\ttrans.addTransitionMode(t2);\r\n\t\ttrans.addTransitionMode(t3);\r\n\t\ttrans.addTransitionMode(t4);\r\n\t\ttrans.addTransitionMode(t5);\r\n\r\n\t\tt1.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type1,\r\n\t\t\t\ttype2 }, new int[] { 1, 1 }));\r\n\t\tt1.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type1,\r\n\t\t\t\ttype2 }, new int[] { 1, 1 }));\r\n\r\n\t\tt2.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type2,\r\n\t\t\t\ttype3 }, new int[] { 1, 1 }));\r\n\t\tt2.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type2,\r\n\t\t\t\ttype3 }, new int[] { 1, 1 }));\r\n\r\n\t\tt3.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type3,\r\n\t\t\t\ttype4 }, new int[] { 1, 1 }));\r\n\t\tt3.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type3,\r\n\t\t\t\ttype4 }, new int[] { 1, 1 }));\r\n\r\n\t\tt4.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type4,\r\n\t\t\t\ttype5 }, new int[] { 1, 1 }));\r\n\t\tt4.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type4,\r\n\t\t\t\ttype5 }, new int[] { 1, 1 }));\r\n\r\n\t\tt5.addInputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type5,\r\n\t\t\t\ttype1 }, new int[] { 1, 1 }));\r\n\t\tt5.addOutputPlace(p1, TokenMultiSetTools.arrayToMap(new TokenType[] { type5,\r\n\t\t\t\ttype1 }, new int[] { 1, 1 }));\r\n\r\n\t}", "@Override\r\n public void initialize(String type){\r\n lattice = new AtomicLatticeSumSpin(param.s,\"Movie\",type,instId); \r\n parser = new SimProcessParser(parser,getSimPostFix(),getParamPostFix());\r\n currentTime =0;\r\n FixedPostFix=type;\r\n\r\n if(type.equalsIgnoreCase(\"\")){\r\n MakeFixedConfig.clearFixedConfig2D(getFixedPostFix());}\r\n \r\n \r\n //which algo is going to be used\r\n if(param.mcalgo.equalsIgnoreCase(\"metropolis\")){\r\n if(useGPU){\r\n // clear up context on GPU if creating a new context\r\n if(mc != null){\r\n ((CLMetropolisMC)mc).closeOpenCL();\r\n }else{}\r\n mc = new CLMetropolisMC(this,output); \r\n }else{\r\n mc = new MetropolisMC(this,output);\r\n }\r\n }else if (param.mcalgo.equalsIgnoreCase(\"metropolisfix\")){\r\n mc = new MetropolisFixedStrengthMC(this,output);\r\n }else{}\r\n\r\n // get a random seed and save it\r\n currentSeed = Math.abs(Ran.nextInt());\r\n //currentSeed=387483474;\r\n //currentSeed=98437549;\r\n\r\n mc.setSeed(currentSeed);\r\n System.out.println(\"Seed:\"+currentSeed);\t\r\n\r\n // Make Video\r\n if(makeVideo){\r\n vid = new VideoMakerCV(currentSeed,VideoLength,type+\"MOVIERUN\");\r\n vid.setFramesPerCapture(framesPerCapture);\r\n }\r\n }", "public void robotInit() {\n RobotMap.init();\n initDashboardInput();\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n driveTrain = new DriveTrain();\n power = new Power();\n arm = new Arm();\n sensors = new Sensors();\n ballGrabberSubsystem = new BallGrabberSubsystem();\n winch = new Winch();\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n // OI must be constructed after subsystems. If the OI creates Commands\n //(which it very likely will), subsystems are not guaranteed to be\n // constructed yet. Thus, their requires() statements may grab null\n // pointers. Bad news. Don't move it.\n oi = new OI();\n\n // instantiate the command used for the autonomous period\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS\n\n arcadeDrive = new ArcadeDrive();\n\n readPreferences();\n }", "private void Initialize()\n {\n \tEcran = new Rectangle(Framework.gauche, Framework.haut, Framework.frameWidth\n\t\t\t\t- Framework.droite - Framework.gauche, Framework.frameHeight - Framework.bas\n\t\t\t\t- Framework.haut);\n\t\tCentreEcranX = (int)(Ecran.getWidth()/2);\n\t\tCentreEcranY = (int)(Ecran.getHeight()/2);\n\t\twidth = Ecran.getWidth();\n\t\theight = Ecran.getHeight();\t\t\n\t\tpH=height/768;\t\t\n\t\tpW=width/1366;\n\t\tObjets = new ArrayList<Objet>(); // Créer la liste chainée en mémoire\n\t\tMissiles = new ArrayList<Missile>(); // Créer la liste chainée en mémoire\n\t\tStations = new ArrayList<Station>(); // Créer la liste chainée en mémoire\n\t\tJoueurs = new ArrayList<Joueur>();\n\t\tlastTrajectoires = new ArrayList<Trajectoire>();\n\n\t\tDisposeAstres(Framework.niveauChoisi);\n\t\tstationCourante = Stations.get(0);\n\n\t\tetat = ETAT.PREPARATION;\n\t\tmouseClicked = mousePressed = mouseReleased = false;\n\t}", "public pr3s1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1280, 720, 1); \n prepare();\n }", "private void initialisation()\n\t{\n\t\tdaoFactory = new DaoFactory();\n\n\t\ttry\n\t\t{\n\t\t\tequationStandardSessions = EquationCommonContext.getContext().getGlobalProcessingEquationStandardSessions(\n\t\t\t\t\t\t\tsession.getSessionIdentifier());\n\t\t}\n\t\tcatch (Exception eQException)\n\t\t{\n\t\t\tif (LOG.isErrorEnabled())\n\t\t\t{\n\t\t\t\tStringBuilder message = new StringBuilder(\"There is a problem creating Global processing the sessions\");\n\t\t\t\tLOG.error(message.toString(), eQException);\n\t\t\t}\n\t\t}\n\t}", "private void initialize() {\n //Asteroid Shape (8 sided)\n polygon = new Vector2f[]{new Vector2f(400, -800), new Vector2f(-400, -800), new Vector2f(-800, -400),\n new Vector2f(-800, 400), new Vector2f(-400, 800), new Vector2f(400, 800), new Vector2f(800, 400), new Vector2f(800, -400)};\n //Translation variables\n this.tx = spawnX;\n this.ty = spawnY; //Start above screen to gain momentum\n this.velocity = new Vector2f();\n\n //World initialize\n this.world = new Matrix3x3f();\n\n }", "protected void initialize() {\n Constants.frontClimbPlatformPositionSetpoint = SmartDashboard.getNumber(\"Front Climb Platform Setpoint\", Constants.frontClimbPlatformPositionSetpoint);\n\n Constants.frontClimbCommandTimeout = SmartDashboard.getNumber(\"Front Climb Command Timeout\", Constants.frontClimbCommandTimeout);\n\n \tsetTimeout(Constants.frontClimbCommandTimeout);\n\n \tFrontClimb._legState = FrontClimb.LegState.LEGS_MOVING; \t\t\n Robot._frontClimber.moveToPosition(Constants.frontClimbPlatformPositionSetpoint);\n }", "public void robotInit() {\n\t\toi = new OI();\n // instantiate the command used for the autonomous period\n }", "public void robotInit() {\n RobotMap.init();\n driveTrain = new DriveTrain();\n oi = new OI();\n flippy = new Flipper();\n flappy = new Flapper();\n autonomousCommand = new AutoFlip();\n \n OI.init();\n CommandBase.init();\n autoChooser = new SendableChooser();\n autoChooser.addDefault(\"Flap Left\", new AutoFlip());\n SmartDashboard.putData(\"Autonomous_Mode\", autoChooser); \n }", "private void initGP() {\n log.info(\"Initializing GP\");\n geneticProgram.addPopulationObserver(this);\n geneticProgram.initialize();\n frontRunner = geneticProgram.getProgram(0); // A safe default\n }", "protected void initialize() {\n\t\tRobot._driveTrain.setAuton(true);\n\t\tRobot._driveTrain.clearEncoder();\n\t\tRobot._driveTrain.clearGyro();\n\t\tdistanceToCenter = SmartDashboard.getNumber(\"toteOffset\", 0);\n\t\tif (Robot._pneumatics.getArms() != DoubleSolenoid.Value.kReverse) {\n\t\t\tRobot._pneumatics.setArms(DoubleSolenoid.Value.kReverse);\n\t\t}\n\t}", "public void init() {\n // Define and Initialize Motors (note: need to use reference to actual OpMode).\n leftDrive = myOpMode.hardwareMap.get(DcMotor.class, \"left_drive\");\n rightDrive = myOpMode.hardwareMap.get(DcMotor.class, \"right_drive\");\n armMotor = myOpMode.hardwareMap.get(DcMotor.class, \"arm\");\n\n // To drive forward, most robots need the motor on one side to be reversed, because the axles point in opposite directions.\n // Pushing the left stick forward MUST make robot go forward. So adjust these two lines based on your first test drive.\n // Note: The settings here assume direct drive on left and right wheels. Gear Reduction or 90 Deg drives may require direction flips\n leftDrive.setDirection(DcMotor.Direction.REVERSE);\n rightDrive.setDirection(DcMotor.Direction.FORWARD);\n\n // If there are encoders connected, switch to RUN_USING_ENCODER mode for greater accuracy\n // leftDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n // rightDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n\n // Define and initialize ALL installed servos.\n leftHand = myOpMode.hardwareMap.get(Servo.class, \"left_hand\");\n rightHand = myOpMode.hardwareMap.get(Servo.class, \"right_hand\");\n leftHand.setPosition(MID_SERVO);\n rightHand.setPosition(MID_SERVO);\n\n myOpMode.telemetry.addData(\">\", \"Hardware Initialized\");\n myOpMode.telemetry.update();\n }", "public void init() {\n\t\t\n\t}", "public DimensionalSpacePort()\n\t{\n\t\tchainedPortList = new LinkedList[INITIALCAPACITY];\n\t\tnumKeys = 0;\n\t\t//checkSpacePort = false;\n\t\t//No need for the checkSpacePort\n\t}", "private void initiliaze() {\r\n\t\tthis.inputFile = cd.getInputFile();\r\n\t\tthis.flowcell = cd.getFlowcell();\r\n\t\tthis.totalNumberOfTicks = cd.getOptions().getTotalNumberOfTicks();\r\n\t\tthis.outputFile = cd.getOutputFile();\r\n\t\tthis.statistics = cd.getStatistic();\r\n\t}", "private void init() {\n\t\tthis.model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);\n\t\tthis.model.setNsPrefixes(INamespace.NAMSESPACE_MAP);\n\n\t\t// create classes and properties\n\t\tcreateClasses();\n\t\tcreateDatatypeProperties();\n\t\tcreateObjectProperties();\n\t\t// createFraktionResources();\n\t}", "public void creation(){\n\t for(int i=0; i<N;i++) {\r\n\t\t for(int j=0; j<N;j++) {\r\n\t\t\t tab[i][j]=0;\r\n\t\t }\r\n\t }\r\n\t resDiagonale(); \r\n \r\n\t //On remplit le reste \r\n\t conclusionRes(0, nCarre); \r\n \t\t\r\n\t \r\n\t isDone=true;\r\n }", "protected void initialize() {\n Robot.m_drivetrain.resetPath();\n Robot.m_drivetrain.addPoint(0, 0);\n Robot.m_drivetrain.addPoint(3, 0);\n Robot.m_drivetrain.generatePath();\n \n\t}", "void initializeQ()\n\t{\n\t\tfor (int i = 0; i < statesCount; i++)\n\t\t{\n\t\t\tthis.q.add(new ArrayList<>());\n\t\t}\n\t\tfor (int i = 0; i < statesCount; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < statesCount; j++)\n\t\t\t{\n\t\t\t\tthis.q.get(i).add(j, rewards.get(i).get(j).doubleValue());\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void initStateNodes() {\n \tSystem.err.println(Randomizer.getSeed());\n\t\tPartitionedTreeLikelihood likelihood = null;\n\t\tfor (BEASTInterface plugin : getOutputs()) {\n\t\t\tif (plugin instanceof PartitionedTreeLikelihood) {\n\t\t\t\tlikelihood = (PartitionedTreeLikelihood) plugin;\n\t\t\t}\n\t\t}\n\t\tif (likelihood == null) {\n\t\t\tthrow new IllegalArgumentException(\"PartitionProvider must have PartitionedTreeLikelihood as output\");\n\t\t}\n\t\tSiteModel.Base siteModel = (SiteModel.Base) likelihood.siteModelInput.get();\n\t\t\n\t\tif (siteModel instanceof SiteModel) {\n\t\t\tRealParameter mu = ((SiteModel) siteModel).muParameterInput.get();\n\t\t\tif (!mu.isEstimatedInput.get()) {\n\t\t\t\tSystem.err.println(\"Warning: sitemodel mutation rates are NOT estimated. This is probably not what you want\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tString sPartition = BeautiDoc.parsePartition(getID());\n\t\tSet<BEASTInterface> ancestors = new HashSet<BEASTInterface>();\n\t\tBeautiDoc.collectAncestors(this, ancestors, new HashSet<BEASTInterface>());\n\t\tMCMC mcmc = null;\n\t\tfor (BEASTInterface plugin : ancestors) {\n\t\t\tif (plugin instanceof MCMC) {\n\t\t\t\tmcmc = (MCMC) plugin;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tm_pSiteModel.get().add(siteModel);\n\t\tList<BEASTInterface> tabuList = new ArrayList<BEASTInterface>();\n\t\ttabuList.add(this);\n\t\tfor (int i = 1; i < numPartitions.get(); i++) {\n\t\t\tBeautiDoc doc = new BeautiDoc();\n\t\t\tPartitionContext oldContext = new PartitionContext(sPartition);\n\t\t\tPartitionContext newContext = new PartitionContext(sPartition+i);\n\t\t\tBEASTInterface plugin = BeautiDoc.deepCopyPlugin(siteModel, this, mcmc, oldContext, newContext, doc, tabuList);\n\t\t\tm_pSiteModel.get().add((SiteModel.Base) plugin);\n\t\t}\n\t\tif (siteModel instanceof SiteModel) {\n\t\t\tRealParameter mu = ((SiteModel) siteModel).muParameterInput.get();\n\t\t\tmu.isEstimatedInput.setValue(false, mu);\n\t\t\tmu.initByName(\"lower\", \"\"+mu.getValue(), \"upper\" , \"\" + mu.getValue());\n\t\t}\n\t\tState state = mcmc.startStateInput.get();\n\t\tstate.initialise();\n state.setPosterior(mcmc.posteriorInput.get());\n\t\tneedsInitilising = false;\n\t\tinitAndValidate();\n\n\t\tSet<BEASTInterface> plugins = new HashSet<BEASTInterface>();\n\t\tfor (BEASTInterface plugin : mcmc.listActiveBEASTObjects()) {\n\t\t\treinitialise(plugin, plugins);\n\t\t}\n//\t\t\n//\t\tfor (Plugin plugin : ancestors) {\n//\t\t\tif (plugin instanceof PartitionedTreeLikelihood) {\n//\t\t\t\t((PartitionedTreeLikelihood) plugin).initAndValidate();\n//\t\t\t\tbreak;\n//\t\t\t}\n//\t\t}\n\t}", "private void init() {\n }", "public void pgmInitialize() {\n\t\tzzsetdspfind();\n\t\tinzsr();\n\t\t// D e f i n i t i o n s\n\t\tstateVariable.setSflchg(\"0\");\n\t\tstateVariable.setSflrrn(0);\n\t\t// M a i n l i n e C o d e\n\t\tmainline0();\n\t\treturn;\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "public void initPanel() {\n\t\tAgentInterface agent = new RandomAgent();\n\t\t\n\t\t/*\n\t\t * Instantiate the environment\n\t\t * \n\t\t * Simply change the name of the environment to one imported above to \n\t\t * view random behavior in another environment (a couple environments\n\t\t * may not visualize because they are experimental/unfinished code \n\t\t * from RL-Library.\n\t\t * \n\t\t * This agent should work with any discrete state and action environment\n\t\t * and at least a few environments with continuous state and discrete\n\t\t * actions (e.g., mountain car, cart pole, and acrobot).\n\t\t */\n\t\tEnvironmentInterface env = new CartArm(); \n\t\t\n\t\t\n\t\t/*\n\t\t * Initialize the JPanel to be used by the applet.\n\t\t */\n\t\trlPanel.init(agent, env);\n\t\tthis.getContentPane().add(rlPanel);\n\t\tthis.rlPanel.runLocal.addObserver(this);\n\t\t\n\t\t/*\n\t\t * Initialize experiment, which initializes both the environment and \n\t\t * the agent.\n\t\t * \n\t\t * RunLocalExperiment (which runLocal below is an instance of) controls\n\t\t * the timing, calling RLGlue.RL_init() (which calls agent_init() and \n\t\t * env_init()) and step() on the TinyGlueExtended instance that calls \n\t\t * agent_start(), env_start(), agent_step(), and so on.\n\t\t */\n\t\trlPanel.runLocal.initExp();\n\t\t\n\t\t/*\n\t\t * Start experiment. In each episode, agent_start() and env_start() are\n\t\t * called first. Then agent_step() and env_step() are called repeatedly\n\t\t * until the end of the episode, at which point agent_end() and env_end()\n\t\t * are called. See TinyGlueExtended for exact ordering between agent and \n\t\t * env.\n\t\t */\n\t\trlPanel.runLocal.startExp();\n\t}", "@Override\n public void inicio() {\n // inicializa el objetivo\n miObjetivo = \"\";\n // inicializa variables para explorar sucesores\n j = 0;\n m = 0;\n nodo = null;\n suc = null;\n succ = null;\n // inicializa objetos\n actual = \"\";\n g = graph.getGraphics();\n // comienza por el primer nodo\n nodo = graph.getNodes().get(0);\n actual = nodo.toString();\n // siguiente paso\n Step = 0;\n }", "private void init() {\r\n\tlocals = new float[maxpoints * 3];\r\n\ti = new float[] {1, 0, 0};\r\n\tj = new float[] {0, 1, 0};\r\n\tk = new float[] {0, 0, 1};\r\n\ti_ = new float[] {1, 0, 0};\r\n\tk_ = new float[] {0, 0, 1};\r\n }", "public void initForMM(){\n hdBase = HD_BASED_ON_MMS;\n hdNoHdRankThreshold = 0;\n hdCorrection = 1; \n hdCeiling = 9;\n }", "public void robotInit()\n\t{\n\t\toi = new OI();\n\t\t// instantiate the command used for the autonomous period\n\t\t// autonomousCommand = new Driver();\n\t}", "public void init() {\n jgxAdapter = new JGraphXAdapter<DatabaseProcess, DefaultEdge>(this.graph);\n\n getContentPane().add(new mxGraphComponent(jgxAdapter));\n resize(DEFAULT_SIZE);\n\n // positioning via jgraphx layouts\n mxCircleLayout layout = new mxCircleLayout(jgxAdapter);\n layout.execute(jgxAdapter.getDefaultParent());\n }", "public abstract void init();", "public abstract void init();", "public abstract void init();", "public abstract void init();", "public abstract void init();", "public abstract void init();", "public abstract void init();", "public abstract void init();" ]
[ "0.6601136", "0.6157716", "0.61171573", "0.6083329", "0.60725474", "0.60689014", "0.6026129", "0.59705883", "0.59691113", "0.5969023", "0.5964641", "0.5938181", "0.5920524", "0.5860429", "0.586032", "0.5830627", "0.58145696", "0.5762541", "0.57598805", "0.57218087", "0.570203", "0.5697206", "0.56950253", "0.56711215", "0.5654752", "0.5654036", "0.5643373", "0.5636428", "0.5630951", "0.5630573", "0.56290615", "0.56160295", "0.5586962", "0.55848855", "0.5579536", "0.5576902", "0.55757874", "0.5557902", "0.5552281", "0.5549638", "0.5539437", "0.55241644", "0.5523021", "0.5515167", "0.55130464", "0.55115986", "0.5510746", "0.5510746", "0.55097115", "0.5509289", "0.55077434", "0.5506293", "0.55028236", "0.5501749", "0.5494055", "0.54853714", "0.5475245", "0.54747325", "0.5474437", "0.54707456", "0.54694986", "0.5466637", "0.5465113", "0.5464886", "0.54648393", "0.5463265", "0.546192", "0.5461205", "0.5460126", "0.54600215", "0.5459574", "0.54573953", "0.54550105", "0.5448466", "0.54471153", "0.5437051", "0.54364383", "0.5435733", "0.54348654", "0.5432845", "0.54324037", "0.54324037", "0.54324037", "0.5431636", "0.5431636", "0.5431636", "0.5431636", "0.54294884", "0.5428476", "0.5425657", "0.54223084", "0.5419759", "0.5419042", "0.5413398", "0.5413398", "0.5413398", "0.5413398", "0.5413398", "0.5413398", "0.5413398", "0.5413398" ]
0.0
-1
Identify the possible actions at a time interval
public void compileActions(int totalWorkloadLevel, int totalBatteryLevel) { //possible actions possibleActions = new Vector(totalWorkloadLevel * totalBatteryLevel); for(int i = 0; i < totalWorkloadLevel; i++ ) { for(int j = 0; j < totalBatteryLevel; j++) { possibleActions.add(new Action(i ,j)); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected IntervalAction action() {\n CCSize s = Director.sharedDirector().winSize();\n return MoveBy.action(duration, s.width-ADJUST_FACTOR,0);\n }", "public java.lang.String getTimeLimitAction();", "private void getAllTotesCenterTimer()\r\n\t{\r\n\t\tswitch(autoStep)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t{\r\n\t\t\t\tpickUpTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 1:\r\n\t\t\t{\r\n\t\t\t\tstrafeLeftTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 2:\r\n\t\t\t{\r\n\t\t\t\tpickUpTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 3:\r\n\t\t\t{\r\n\t\t\t\tstrafeRightTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 4:\r\n\t\t\t{\r\n\t\t\t\tstrafeRightTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 5:\r\n\t\t\t{\r\n\t\t\t\tpickUpTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 6:\r\n\t\t\t{\r\n\t\t\t\tdriveForwardTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "public void timeLogic(int time){\n //Add logic to decide time increments at which tickets will be granted\n }", "private ActionInterface timeSchedulingTest(PlayerInfo playerInfo, Timestamp executionTime, double responseFactor) {\r\n\r\n User user = playerInfo.getUser();\r\n int favouriteTime = playerInfo.getReceptivityForPlayer().getFavouriteTimeOfDay(ReceptivityProfile.SignificanceLevel.SPECIFIC);\r\n\r\n switch(favouriteTime){\r\n\r\n case ReceptivityProfile.DAY:\r\n\r\n if(randomize3(user, 0)){\r\n\r\n // Schedule correctly\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1000, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.DAY );\r\n }\r\n\r\n if(randomize3(user, 1)){\r\n\r\n // Schedule later\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1001, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.EVENING );\r\n }\r\n\r\n // Schedule earlier\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1002, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.NIGHT );\r\n\r\n case ReceptivityProfile.EVENING:\r\n\r\n if(randomize3(user, 0)){\r\n\r\n // Schedule correctly\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1011, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.EVENING );\r\n }\r\n\r\n if(randomize3(user, 1)){\r\n\r\n // Schedule later\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1012, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.NIGHT );\r\n }\r\n\r\n // Schedule earlier\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1010, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.DAY );\r\n\r\n case ReceptivityProfile.NIGHT:\r\n\r\n if(randomize3(user, 0)){\r\n\r\n // Schedule correctly\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1022, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.DAY );\r\n }\r\n\r\n if(randomize3(user, 1)){\r\n\r\n // Schedule later\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1020, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.EVENING );\r\n }\r\n\r\n // Schedule earlier\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1021, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.NIGHT );\r\n\r\n\r\n default:\r\n\r\n // No specific time of day for user.\r\n\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 3, getState(), responseFactor)\r\n .scheduleInTime( favouriteTime );\r\n\r\n }\r\n\r\n\r\n\r\n\r\n\r\n }", "public CCActionInterval action()\n {\n CCSize s = CCDirector.sharedDirector().getWinSize();\n return new CCMoveBy(m_fDuration, new CCPoint(s.width - 0.5f, 0));\n }", "private void getAllTotesRightTimer()\r\n\t{\r\n\t\tswitch(autoStep)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t{\r\n\t\t\t\tpickUpTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 1:\r\n\t\t\t{\r\n\t\t\t\tstrafeLeftTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 2:\r\n\t\t\t{\r\n\t\t\t\tpickUpTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 3:\r\n\t\t\t{\r\n\t\t\t\tstrafeLeftTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 4:\r\n\t\t\t{\r\n\t\t\t\tpickUpTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 5:\r\n\t\t\t{\r\n\t\t\t\tdriveForwardTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "private void getAllTotesLeftTimer()\r\n\t{\r\n\t\tswitch(autoStep)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t{\r\n\t\t\t\tpickUpTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 1:\r\n\t\t\t{\r\n\t\t\t\tstrafeRightTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 2:\r\n\t\t\t{\r\n\t\t\t\tpickUpTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 3:\r\n\t\t\t{\r\n\t\t\t\tstrafeRightTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 4:\r\n\t\t\t{\r\n\t\t\t\tpickUpTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 5:\r\n\t\t\t{\r\n\t\t\t\tdriveForwardTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "int getTimesCombatActionsCalled();", "public abstract List<Instruction> getPossibleActions();", "void determineNextAction();", "public static ActionListener clock() {\n\n\t\tActionListener action = new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\trepetitions++;\n\t\t\t\tif((repetitions%(new Integer(getConfiguration().getTiempo())/timerRepeater))==0){\n\t\t\t\t\tFileUtils.createDailyReport(getConfiguration());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t};\n\n\t\treturn action;\n\n\t}", "public int getCheckInterval();", "public Types.ACTIONS act(StateObservation stateObs, ElapsedCpuTimer elapsedTimer) {\n\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n if (step == 0) {\n dfs(stateObs);\n }\n return actions.get(step++);\n }", "@Override\n protected void swimAction(long timer){}", "public void act() \n {\n updateTimerDisplay();\n if(timeCounter < 3600){\n timeCounter++;\n \n }else{\n timeElapsed++;\n timeCounter = 0;\n }\n checkHighScore();\n checkRegScore();\n\n }", "public List<Double> getActualActionTime() {\n if(actionIndex==0&&cumTime==0){\n if(actualActionTime==null){\n actualActionTime=new ArrayList<>();\n }\n else{\n actualActionTime.clear();\n }\n for(double t: actionTime){\n if(t==-1){\n actualActionTime.add(Math.random());\n }\n else{\n actualActionTime.add(t);\n }\n }\n }\n return actualActionTime;\n }", "@Then(\"^I choose an interval time$\")\n public void i_choose_an_interval_time() {\n onViewWithId(R.id.startHour).type(\"12:00\");\n onViewWithId(R.id.endHour).type(\"23:59\");\n }", "public void startAgentTime() {\n Timer timer = new Timer(SIBAConst.TIME_AGENT_CHANGE_FOR_HOUR, new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n \t\n \tCalendar c = Calendar.getInstance();\n int minutos = c.get(Calendar.MINUTE);\n int hora = c.get( (Calendar.HOUR_OF_DAY)); \n hora = hora * 60;\n if (minutos >= 30 && minutos <= 59)\n {hora +=30;\t\n }\n if (hora > ctrlHours)\n {ctrlHours = hora;\n //activada bandera de modificacion de programacion\n activatedScheduleChange = true;\n }\n else\n { if (hora < ctrlHours)\n \t ctrlHours = 0;\n }\n \t\n \t\n \n }\n });\n timer.start();\n }", "@Override\n public void act() {\n sleepCheck();\n if (!isAwake()) return;\n while (getActionTime() > 0f) {\n UAction action = nextAction();\n if (action == null) {\n this.setActionTime(0f);\n return;\n }\n if (area().closed) return;\n doAction(action);\n }\n }", "public void resetTimeLimitAction();", "private void getOneToteTimer()\r\n\t{\r\n\t\tswitch(autoStep)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t{\r\n\t\t\t\tpickUpTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 1:\r\n\t\t\t{\r\n\t\t\t\tdriveForwardTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "private ArrayList<String> getPossibleActions() {\n\t\t\n\t\tRandom r = new Random();\n\t\tArrayList<String> possibleActions = new ArrayList<String>();\n\t\tfor (String actionTitle : getAllActions()) {\n\t\t\tif (r.nextDouble() < 0.3) {\n\t\t\t\tpossibleActions.add(actionTitle);\n\t\t\t}\n\t\t}\n\t\treturn possibleActions;\n\t}", "public int actions()\n {\n switch (mState) \n {\n case cProcessInit:\n out();\n if (cSimTimeMicro < cClientCount/cClientTransPerMicro) {\n cSimTimeMicro = cClientCount/cClientTransPerMicro;\n System.out.println(\"\\nSimulation time is too short! It has been reset to \" + cSimTimeMicro + \" micro\\n\");\n }\n cMaxRequestsToSend = (int) (cClientTransPerMicro * cSimTimeMicro);\n System.out.println(\"cMaxRequestsToSend = \" + cMaxRequestsToSend);\n \n if (cTransLogMon)\n {\n System.out.println(cTransMonHeader);\n System.out.println(\"----------------------------------------------------------------------------------------\");\n }\n\n// if (cTick)\n// {\n// activate(new Tick());\n// }\n activate(mTaxJvm);\n return cMeJvm;\n \n case cMeJvm:\n activate(mMeJvm);\n return cMeStandbyJvm;\n\n case cMeStandbyJvm:\n activate(mMeStandbyJvm);\n return cJvmActivated;\n\n case cJvmActivated:\n mClientList = headToArray(mClient.mProcess, new Process[0]);\n \n //double tInterval = 500/tClientList.length; //500 is the minimum response time\n //double tInterval = 1.0/(cClientCount*cClientTransPerMicro); \n \n double tInterval = 1.0D*1000*1000/(cClientCount); //evenly distributed client over 1 second interval\n \n //hold until connect next client to the system \n mHoldTimeBetweenClients = cRandom.normal(tInterval, tInterval*0.3);\n mFor_i = -1;\n // Flow into loop\n\n case cForNext:\n ++mFor_i;\n //for (int i = 0; i < tClientList.length; ++i) //For every client\n if (mFor_i >= mClientList.length)\n {\n return cForEnd;\n }\n\n tClientStartTime = time();\n activate((Process) mClientList[mFor_i]); \n return cNewClient;\n \n case cNewClient:\n hold(mHoldTimeBetweenClients);\n return cForNext;\n\n case cForEnd:\n //hold(cRunTimeMicro);\n //return cHoldRunTimeMicro;\n\n case cHoldRunTimeMicro:\n cActualRunTimeMicro = cSimTimeMicro * 2;\n hold(cActualRunTimeMicro);\n return cHoldRunTime;\n \n case cHoldRunTime:\n if (cTick)\n {\n System.out.println(\"\\nSimulation time = \" + time()/(1000.0*1000.0) + \" sec.\");\n System.out.println(\"Requests = \" + cRequests);\n System.out.println(\"cRequestsToSend = \" + cMaxRequestsToSend);\n System.out.println(\"Av.tax time = \" + cTaxSum/cRequests);\n System.out.println(\"Av.client time = \" + cClientSum/cRequests);\n System.out.println(\"\\nExecution time: \" + ((System.currentTimeMillis() - cStartTime)/1000.0) + \" secs.\"); \n }\n return cProcessDone;\n }\n return cProcessError;\n }", "public void pickUpTimer()\r\n\t{\t\t\r\n\t\tSystem.out.println(timer.get());\r\n\t\tif(timer.get() < Config.Auto.timeIntakeOpen)\r\n\t\t{\r\n\t\t\t//claw.openClaw();\r\n\t\t\tSystem.out.println(\"in second if\");\r\n\t\t}\r\n\t\t\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeElevatorStack)\r\n\t\t{\r\n\t\t\t//elevator.setLevel(elevatorLevel);\r\n\t\t\t//elevatorLevel++;\r\n\t\t}\r\n\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeIntakeClose)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"in first if\");\r\n\t\t\t//claw.closeClaw();\r\n\t\t}\r\n\t\t\r\n\t\telse\r\n\t\t\tendRoutine();\r\n\t}", "private static void selectActions()\n\t{\n\t\t// One Player\n\t\tif (!isMultiplayer)\n\t\t{\n\t\t\tprintBorder();\n\t\t\tSystem.out.print(\"ROUND NUMBER \" + roundNumber + \"!\\n\" + playerOneName + \" has \" + playerOneHealth + \" health left, and \" + opponentName + \" has \" + opponentHealth + \" health left.\\nEnter 1 to kick, 2 to punch, 3 to block: \");\n\t\t\tfighterInput = input.nextInt();\n\t\t\t\n\t\t\t// Test crashes with floats or letters\n\t\t\twhile (fighterInput < 1 || fighterInput > 3)\n\t\t\t{\n\t\t\t\tprintBorder();\n\t\t\t\tSystem.out.print(\"What are you trying to do???\\nYou can only enter 1 to kick, 2 to punch, 3 to block: \");\n\t\t\t\tfighterInput = input.nextInt();\n\t\t\t}\n\t\t\t// Assigns index value of action array\n\t\t\tfighterAction = actionArray[fighterInput - 1];\n\t\t\n\t\t\t// Opponent rolls action\n\t\t\topponentAction = actionArray[(int) (Math.random() * 3)];\n\t\t\t}\n\t\t\t\t\n\t\t\n\t\t// Two Player\n\t\telse\n\t\t{\n\t\t\t// Player1 picks action and test input\n\t\t\tprintBorder();\n\t\t\tSystem.out.print(\"Round Number \" + roundNumber + \"!\\n\" + playerOneName + \" has \" + playerOneHealth + \" health left, and \" + opponentName + \" has \" + opponentHealth + \" health left.\\n\\n\" + playerOneName + \" enter 1 to kick, 2 to punch, 3 to block: \");\n\t\t\tfighterInput = input.nextInt();\n\t\t\twhile (fighterInput < 1 || fighterInput > 3 )\n\t\t\t{\n\t\t\t\tprintBorder();\n\t\t\t\tSystem.out.print(\"What are you trying to do???\\nYou can only enter 1 to kick, 2 to punch, 3 to block: \");\n\t\t\t\tfighterInput = input.nextInt(); // Throws error if input is not an int\n\t\t\t}\n\t\t\tfighterAction = actionArray[fighterInput - 1];\n\t\t\n\t\t\t// Prints lines to hide player one’s action\n\t\t\tfor(int i = 0; i < 50; i++) System.out.println();\n\t\n\t\t\t// Player2 picks action\n\t\t\tSystem.out.print(opponentName + \" enter 1 to kick, 2 to punch, 3 to block: \");\n\t\t\tfighterInput = input.nextInt();\n\t\t\twhile (fighterInput < 1 || fighterInput > 3 )\n\t\t\t{\n\t\t\t\tprintBorder();\n\t\t\t\tSystem.out.print(\"What are you trying to do???\\nYou can only enter 1 to kick, 2 to punch, 3 to block: \");\n\t\t\t\tfighterInput = input.nextInt();\n\t\t\t}\n\t\t\topponentAction = actionArray[fighterInput - 1];\n\t\t\t}\n\t}", "public void action()\n {\n if(timeout > 0 && timeout < 2)\n {\n timeout = 0;\n agent.removeBehaviour(introNegotiation);\n introNegotiation = null;\n counter = 0;\n\n\n }\n //If this is the very first time getting to this state or if the timeout reset the counter to 0\n if(counter < 1)\n {\n //Clean the list of receivers in case there is something\n if(!receivers.isEmpty())\n receivers.removeAllElements();\n //Calculate the duration of the intro\n calculateDurationIntro();\n //Find a receiver\n findAllReceivers();\n constructACLMessage();\n introNegotiation = new IntroNegotiation(agent,msg);\n introNegotiation.setDataStore(getDataStore());\n agent.addBehaviour(introNegotiation);\n }\n\n\n //Handle where I'm heading to from here.\n switch (steps)\n {\n case 0:\n transition = 29;\n break;\n case 1:\n agent.removeBehaviour(introNegotiation);\n introNegotiation = null;\n transition = 17;\n\n }\n\n\n\n }", "private void calculateActions() {\n\n //Generate All Possible Moves In Tree\n this.possibleMoves.clear();\n this.possibleRotation = 0;\n Thread instance = new Thread(this);\n instance.start();\n try {\n instance.join();\n } catch (InterruptedException e) {}\n\n //Choose Best Move From List\n double [] move = chooseBestMove(possibleMoves);\n\n //Calculate Actions from this move and push to queue\n generateActions(move);\n }", "void dailyLife() {\n\t\tString action = inputPrompt.dailyOptions(dailyTime).toLowerCase();\r\n\t\tswitch(action) {\r\n\t\tcase \"exercise\":\tthis.exercise();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"study\":\t\tthis.study();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"rocket\":\t\tthis.buildRocket();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"eat\":\t\t\tthis.eat();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"meds\":\t\tthis.getEnergised();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"fun\":\t\t\tthis.haveFun();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tdefault:\t\t\tdailyLife();\r\n\t\t}\t\r\n\t}", "abstract public boolean timedActionPerformed(ActionEvent e);", "public abstract void userActionStarts(long ms);", "public int showPossibleActions(String[] string);", "public int getAvpfRrInterval();", "public boolean hasReachedGoal(List<Integer> collectTime);", "private int debugCurrentActions(ClusterRegionStatus crs) {\n Map<ServerName, List<CompactAction>> serverCompactActions = getAllActions(crs);\n int totalActions = 0;\n for(ServerName name : serverCompactActions.keySet()) {\n log.info(\"Printing pending compaction actions for server \" + name.getHostname());\n for(CompactAction action : serverCompactActions.get(name)) {\n totalActions++;\n log.info(\"Want to perform \" + action);\n }\n }\n return totalActions;\n }", "public List<Double> getActionTime() {\n return actionTime;\n }", "private void action(String action) {\n\n\t\tSystem.out.println(name + \" is \" + action);\n\n\t\ttry {\n\t\t\tThread.sleep(((long)(Math.random() * 150)));\n\t\t} catch (InterruptedException e) {\n\t\t\tThread.currentThread().interrupt();\n\t\t}\n\t}", "int getWaitTime();", "public DiscoveryActionsFunction() {\n\t\trf = new DiscoveryRewardFunction();\n\t\tfor ( DiscoveryDutyCycle dc : DiscoveryDutyCycle.values() ) {\n\t\t\tallActions.add( dc );\n\t\t}\n\t}", "public static void operations() throws InterruptedException {\n\t\tConstants.driver.findElement(By.xpath(\"//a[contains(@href,'rangeconfiguration')]\")).click();\r\n\t\tThread.sleep(1000);\r\n\t\t\r\n\t\t//Click for Section Option Testing \r\n\t\tConstants.driver.findElement(By.xpath(\"(//a[contains(@href,'rangeconfiguration')]/font)[2]\")).click();\r\n\t\tThread.sleep(2000);\r\n\t\tCurrentOperatorNidRange.currentOperator();\r\n\t\tThread.sleep(2000);\r\n\t\tCurrentOperatorNidRange.clear();\r\n\t\t// CurrentOperatorNidRange.add();\r\n\t\tThread.sleep(1000);\r\n\t\t// CurrentOperatorNidRange.modfiy();\r\n\t\tThread.sleep(2000);\r\n\t\tExecution.test.log(LogStatus.PASS, \"Option 1 Successfully Verfied\");\r\n\t\t\r\n\t\t//Click for Section Option Testing \r\n\t\tConstants.driver.findElement(By.xpath(\"(//a[contains(@href,'rangeconfiguration')]/font)[3]\")).click();\r\n\t\tOtherOperatorNid.otherOperatorNid();\r\n\t\tCurrentOperatorNidRange.clear();\r\n\t\tExecution.test.log(LogStatus.PASS, \"Option 2 Successfully Verfied\");\r\n\t\t\r\n\t\t//Click for 4th Option\r\n\t\tThread.sleep(2000);\r\n\t\tConstants.driver.findElement(By.xpath(\"(//a[contains(@href,'rangeconfiguration')]/font)[4]\")).click();\r\n\t\tOtherOperatorSmpp.otherSmpp();\r\n\t\tOtherOperatorSmpp.bulkNid();\r\n\t\tExecution.test.log(LogStatus.PASS, \"Option 3 Successfully Verfied\");\r\n\t\tThread.sleep(1000);\r\n\t\t\r\n\t\t//Click for 5th Option\r\n\t\tConstants.driver.findElement(By.xpath(\"(//a[contains(@href,'rangeconfiguration')]/font)[5]\")).click();\r\n\t\tBarNidRange.barRange();\r\n\t\tExecution.test.log(LogStatus.PASS, \"Option 4 Successfully Verfied\");\r\n\r\n\t}", "public List<ActionValue> getActions(State state);", "private void makeValidActionsDiscretized() {\n validActionsDiscretized = new ArrayList<>();\n\n List<ActionType> actionTypes = problemSpec.getLevel().getAvailableActions();\n\n // Valid tire pressures\n List<TirePressure> tirePressures = Arrays.asList(\n TirePressure.FIFTY_PERCENT,\n TirePressure.SEVENTY_FIVE_PERCENT,\n TirePressure.ONE_HUNDRED_PERCENT\n );\n\n // Valid fuel levels (note that this is an arbitrary discretization)\n List<Integer> fuelLevels = new ArrayList<>();\n int fuelInterval = ProblemSpec.FUEL_MAX / FUEL_DISCRETE_INTERVALS;\n\n for (int i = 0; i < FUEL_DISCRETE_INTERVALS; i++) {\n fuelLevels.add(fuelInterval * i);\n }\n\n // Go through A1-A8 and add all possible combinations of the parameters\n for (ActionType actionType : actionTypes) {\n switch (actionType.getActionNo()) {\n case 1:\n validActionsDiscretized.add(new Action(actionType));\n break;\n\n case 2:\n for (String car : problemSpec.getCarOrder()) {\n validActionsDiscretized.add(new Action(actionType, car));\n }\n\n break;\n\n case 3:\n for (String driver : problemSpec.getDriverOrder()) {\n validActionsDiscretized.add(new Action(actionType, driver));\n }\n\n break;\n\n case 4:\n for (Tire tire : problemSpec.getTireOrder()) {\n validActionsDiscretized.add(new Action(actionType, tire));\n }\n\n break;\n\n case 5:\n for (int fuel : fuelLevels) {\n validActionsDiscretized.add(new Action(actionType, fuel));\n }\n\n break;\n\n case 6:\n for (TirePressure pressure : tirePressures) {\n validActionsDiscretized.add(new Action(actionType, pressure));\n }\n\n break;\n case 7:\n for (String car : problemSpec.getCarOrder()) {\n for (String driver : problemSpec.getDriverOrder()) {\n validActionsDiscretized.add(new Action(actionType, car, driver));\n }\n }\n\n break;\n\n case 8:\n for (TirePressure pressure : tirePressures) {\n for (int fuel : fuelLevels) {\n for (Tire tire : problemSpec.getTireOrder()) {\n validActionsDiscretized.add(new Action(actionType, tire, fuel,\n pressure));\n }\n }\n }\n\n break;\n }\n }\n }", "public void choosedAction(int action) {\r\n countActions[action]++;\r\n }", "protected void takeAction() {\n lastAction = System.currentTimeMillis();\n }", "public int[] exclusiveTime(int n, List<String> logs) {\n Stack<Integer> s = new Stack<Integer>();\n \n int[] timeForFunctions = new int[n];\n \n // pre means the start of the interval\n int pre = 0;\n for (String l : logs) {\n String[] arr = l.split(\":\");\n int curTime = Integer.parseInt(arr[2]);\n \n if (arr[1].equals(\"start\")) {\n if (!s.isEmpty()) timeForFunctions[s.peek()] += curTime - pre;\n \n s.push(Integer.parseInt(arr[0]));\n pre = curTime;\n } else {\n int curFunctionId = s.pop();\n timeForFunctions[curFunctionId] += curTime - pre + 1;\n \n // arr[2] is end of current interval, belong to current interval. That's why we have +1 here\n pre = curTime + 1;\n // pre means the start of next interval, so we need to +1\n }\n }\n \n return timeForFunctions;\n }", "@Override\n public void defineActions(int range) {\n for (int i = 0; i < range; i++) {\n actions.add(new Fly());\n }\n }", "String[] getActions();", "public void act() \r\n {\r\n if (startTime > 0) {\r\n startTime--;\r\n }\r\n else {\r\n if (isScared()) {\r\n doScareMode();\r\n }\r\n else {\r\n if (counter == 0 || !canMove(currDirectionStr)) {\r\n counter = CELL_SIZE * 4;\r\n prevDirection = currDirection;\r\n do {\r\n currDirection = (int)(Math.random() * 10);\r\n if (currDirection == 0) {\r\n currDirectionStr = \"up\";\r\n }\r\n else if (currDirection == 1) {\r\n currDirectionStr = \"left\";\r\n }\r\n else if (currDirection == 2) {\r\n currDirectionStr = \"down\";\r\n }\r\n else if (currDirection == 3) {\r\n currDirectionStr = \"right\";\r\n }\r\n } while (!canMove(currDirectionStr));\r\n }\r\n \r\n if (canMove(currDirectionStr)) {\r\n move(currDirectionStr);\r\n }\r\n counter--;\r\n } \r\n }\r\n }", "public static void alarmTest1() {\n\tint durations[] = {1000, 10*1000, 100*1000};\n\tlong t0, t1;\n\tfor (int d : durations) {\n\t t0 = Machine.timer().getTime();\n\t ThreadedKernel.alarm.waitUntil (d);\n\t t1 = Machine.timer().getTime();\n\t System.out.println (\"alarmTest1: waited for \" + (t1 - t0) + \" ticks\");\n\t}\n }", "public void updateTimedTasks() {\n if (TimedEventQueue.validTask(this)) {\n String action = TimedEventQueue.getTask().getAction();\n if (action.equals(\"gravityCancelOver\")) {\n this.gravityCancel = false;\n this.yVel = 0;\n } else if (action.equals(\"dodgeCoolDownOver\")) {\n this.dodgeCoolDown = false;\n } else if (action.equals(\"breakSpecialState\")) {\n this.breakSpecialState();\n } else if (action.equals(\"activeAttackState\")) {\n this.activeAttackState = true;\n } else if (action.equals(\"activeAttackStateOver\")) {\n this.activeAttackState = false;\n } else if (action.equals(\"heavySideSpeedUp\")) {\n this.setxTargetSpeed(Util.scaleX(25));\n } else if (action.equals(\"resetXMovement\")) {\n this.resetXMovement();\n }\n } \n }", "public int nextAction() {\n double w = random.nextDouble();\n for (int i = 0; i < nMoves; i++) {\n if (w < probabilities[i]) {\n lastMove = i;\n break;\n }\n w -= probabilities[i];\n }\n nIters++;\n\n if (N_SELECTED_ACTIONS > 1) {\n lastNMoves.add(lastMove);\n if (lastNMoves.size() > N_SELECTED_ACTIONS)\n lastNMoves.poll();\n }\n\n if (LOGGING && nIters % 1000 == 0) {\n for (int i = 0; i < nMoves; i++)\n logWriter.printf(\"%.8f;\", probabilities[i]);\n logWriter.println();\n logWriter.flush();\n }\n\n return lastMove;\n }", "public void actionPerformed(ActionEvent e) {\n\n\t\t\t\tflag = false;\n\t\t\t\t// no_of_instruction=instru.size();\n\t\t\t\twhile (not_completeScorboard(_NumInstruction) && !flag) {\n\t\t\t\t\tSystem.out.print(\" clock:\" + clock);\n\t\t\t\t\tupper_limit = _currentIssue + 1;\n\t\t\t\t\tupper_limit = (upper_limit == _NumInstruction) ? (_NumInstruction - 1) : upper_limit;\n\t\t\t\t\tupdate_flag = false;\n\t\t\t\t\tfor (int i = 0; i <= upper_limit; i++) {\n\t\t\t\t\t\tSystem.out.print(\" current operator: \" + lstInstructionsScorboard.get(i).getOper());\n\t\t\t\t\t\tExecuteInstructionScorboard(i);\n\t\t\t\t\t\tlstInstructionsScorboard.get(i).setStatus(_StatusNextInstructionScorboard.get(i));\n\t\t\t\t\t\tSystem.out.println(\" next_status: \" + _StatusNextInstructionScorboard.get(i) + \" ints: \" + i);\n\t\t\t\t\t}\n\t\t\t\t\tif (update_flag) {\n\t\t\t\t\t\tupdateScorboard1();\n\t\t\t\t\t\tif (!chckbxExeAllScore.isSelected() && clock > counter) {\n\t\t\t\t\t\t\tflag = true;\n\t\t\t\t\t\t\tcounter = clock;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tclock = clock + 1;\n\n\t\t\t\t\t// updateInstructionTableScorboardStudent();\n\n\t\t\t\t\tupdateInstructionTableScorboard();\n\t\t\t\t\tupdateRegisterTableScorboard();\n\t\t\t\t\tupdateALUTableScorboard();\n\n\t\t\t\t}\n\n\t\t\t\t// print_out();\n\t\t\t\tif (!(not_completeScorboard(_NumInstruction))) {\n\t\t\t\t\tJOptionPane.showMessageDialog(new JFrame(), \"complete!\", \"Dialog\", JOptionPane.INFORMATION_MESSAGE);\n\n\t\t\t\t\tcounter = 0;\n\t\t\t\t}\n\n\t\t\t}", "protected boolean performActions() {\n try {\n Thread.sleep(5000);\n } catch (InterruptedException e) {\n // This is simulation, so we will not handle it\n }\n\n return Math.rint(Math.random()) % 20 != 0;\n }", "private static long time(Executor executor, int concurrency, Runnable action) throws InterruptedException {\n CountDownLatch ready = new CountDownLatch(concurrency);\n CountDownLatch start = new CountDownLatch(1);\n CountDownLatch done = new CountDownLatch(concurrency);\n for (int i = 0; i < concurrency; i++) {\n executor.execute(() -> {\n ready.countDown(); // Tell timer we're ready\n try {\n start.await(); // Wait till peers are ready\n action.run();\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n } finally {\n done.countDown(); // Tell timer we're done\n }\n });\n }\n ready.await(); // Wait for all workers to be ready\n long startNanos = System.nanoTime();\n start.countDown(); // And they're off!\n done.await(); // Wait for all workers to finish\n return System.nanoTime() - startNanos;\n }", "int getActionsCount();", "int getActionsCount();", "public void actions() {\n\t\t\tProvider p = array_provider[theTask.int_list_providers_that_tried_task.get(0)];\n\t\t\t\n\t\t\t//there is a percentage of probability that the user will fail to complete the task\n\t\t\tif(random.draw((double)PERCENTAGE_TASK_FAILURE/100)){ // SUCCESS\n\n\t\t\t\ttot_success_tasks++;\n\t \tthrough_time += time() - theTask.entryTime;\n\t\t\t\ttheTask.out();\n\t\t\t\t\n\t\t\t\tif(FIXED_EARNING_FOR_TASK) earning_McSense = earning_McSense + FIXED_EARNING_VALUE;\n\t\t\t\telse {\n\n\t\t\t\t\t//Provider p = (Provider) theTask.providers_that_tried_task.first();\n\t\t\t\t\tearning_McSense = earning_McSense + (p.min_price*PERCENTAGE_EARNING)/100;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\telse { // FAILURE\n\t\t\t\t//we should check again and if the check fails insert the task in rescheduled_waiting\n\t\t\t\ttheTask.into(taskrescheduled);\n\t\t\t\ttot_failed_tasks++;\n\t\t\t\t//new StartTaskExecution(theTask).schedule(time());\n\n\t\t\t}\n\t\t\t// the provider frees one slot\n\t\t\tp.number_of_task_executing--;\n\t\t\ttot_scheduled_completed_in_good_or_bad_tasks++;\n\n \t}", "public void setTimeLimitAction(java.lang.String timeLimitAction);", "private void timerAction(){\n \n timerEnd();\n \n if (timerCounter == TEST_TARGET_APPERANCE + testTargetDelay){\n manageTestTarget();\n }\n \n if (timerCounter == TEST_TARGET_DISAPPERANCE + testTargetDelay){\n labelArray[TEST_TARGET_LOCATION].setIcon(iconSet.getGrayIcon());\n //System.out.println(\"Test End\");\n }\n //creates clickable red target in random, non occupied location\n //and handles removal of unclicked, expired targets\n int randRedTarget = generator.nextInt(100);\n while(labelArray[randRedTarget].getIcon()!=iconSet.getGrayIcon()){\n //System.out.println(\"Already a target in place\");\n randRedTarget = generator.nextInt(100);\n }\n labelArray[randRedTarget].setIcon(iconSet.getRedTargetIcon());\n \n if (timerCounter<ACTIVE_RED_TARGET_TOTAL){\n activeRedTarget[timerCounter] = randRedTarget;\n }\n \n if (timerCounter>=ACTIVE_RED_TARGET_TOTAL){\n if(labelArray[activeRedTarget[0]].getIcon()!=iconSet.getGrayIcon()){\n labelArray[activeRedTarget[0]].setIcon(iconSet.getGrayIcon());\n }\n for(int i = 0; i < activeRedTarget.length-1; i++){\n activeRedTarget[i] = activeRedTarget[i+1];\n }\n activeRedTarget[ACTIVE_RED_TARGET_TOTAL-1] = randRedTarget;\n }\n\n if (timerCounter%4==0){\n manageBlueTargets();\n }\n \n timerCounter++;\n \n if (timerCounter%4==0){\n manageGreenTargets();\n }\n \n System.out.println(\"Timer: \" + timerCounter); \n }", "@Override\n\t\t\t\tpublic void action() {\n\t\t\t\t\t\tRandom r = new Random();\n\t\t\t\t\t\tint Low = 1;\n\t\t\t\t\t\tint High = 999;\n\t\t\t\t\t\tint Result = r.nextInt(High-Low) + Low;\n\t\t\t\t\t\tACLMessage msg = new ACLMessage(ACLMessage.REQUEST);\n\t\t\t\t\t\tmsg.setOntology(\"AirConditioner\");\n\t\t\t\t\t\tmsg.addReceiver(new AID(\"da\", AID.ISLOCALNAME));\n//\t\t\t\t\t\tif (Result % 2 == 0){\n//\t\t\t\t\t\t\t//humid mode\n//\t\t\t\t\t\t\tmsg.setContent(\"humid\");\n//\t\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: humid\" );\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse if((Result % 3 == 0)) {\n//\t\t\t\t\t\t\t//mid\n//\t\t\t\t\t\t\tmsg.setContent(\"mid\");\n//\t\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: mid\" );\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse if((Result % 5 == 0)) {\n//\t\t\t\t\t\t\t//high\n//\t\t\t\t\t\t\tmsg.setContent(\"mid\");\n//\t\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: high\" );\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse {\n//\t\t\t\t\t\t\t//low\n//\t\t\t\t\t\t\tmsg.setContent(\"mid\");\n//\t\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: low\" );\n//\t\t\t\t\t\t}\n\t\t\t\t\t\tmsg.setContent(Airconditioner_Agent.mode);\n\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: \"+Airconditioner_Agent.mode );\n\t\t\t\t\t\tmyAgent.send(msg);\n\t\t\t\t\t}", "public boolean isPossibleTransit(State s, Action a) {\r\n//\t\tint newWorkloadLevel = s.getWorkload() + a.getChangedWorkload();\r\n\t\tint maxBatteryLevel = getNextBatteryLevel(s, a);\r\n\t\tint maxActionLevel = s.getWorkload();\r\n\r\n\t if((a.getChangedWorkload() <= maxActionLevel) && (a.getBatteryUsed() <= maxBatteryLevel))\r\n\t {\r\n\t\treturn true;\r\n\t }\r\n\t else { \r\n\t \treturn false;\r\n\t }\r\n\t}", "private static void checkActions()\n\t{\n\t\tSystem.out.println();\n\t\t\n\t\tif (fighterAction.equals(\"Kick\") && opponentAction.equals(\"Kick\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" smashes shins with \", opponentName);\n\t\t\topponentHurt = true;\n\t\t\tplayerOneHurt = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Kick\") && opponentAction.equals(\"Punch\"))\n\t\t{\n\t\t\tannounce(opponentName,\" gives a big uppercut to \", playerOneName);\n\t\t\tplayerOneHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Kick\") && opponentAction.equals(\"Block\"))\n\t\t{\n\t\t\tannounce(opponentName,\" takes a big kick to the ribs from \", playerOneName);\n\t\t\topponentHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Punch\") && opponentAction.equals(\"Kick\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" gives a big uppercut to \", opponentName);\n\t\t\topponentHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Punch\") && opponentAction.equals(\"Punch\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" exchanges quick jabs with \", opponentName);\n\t\t\topponentHurt = true;\n\t\t\tplayerOneHurt = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Punch\") && opponentAction.equals(\"Block\"))\n\t\t{\n\t\t\tannounce(opponentName,\" parries the punch and deals big damage to \", playerOneName);\n\t\t\tplayerOneHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Block\") && opponentAction.equals(\"Kick\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" takes a big kick to the ribs from \", opponentName);\n\t\t\tplayerOneHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Block\") && opponentAction.equals(\"Punch\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" parries the punch and deals big damage to \", opponentName);\n\t\t\topponentHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\t// Both block\n\t\telse\n\t\t{\n\t\t\tannounce(\"\",\"Both fighters stand still, waiting for the other to make a move!\",\"\");\n\t\t}\n\n\t\tSystem.out.println();\n\t}", "public void act()\n {\n \n if (wait < 75)\n {\n wait = wait + 1;\n }\n \n \n \n \n \n \n if (wait == 75)\n {\n change();\n checkForBounce();\n checkForEdge();\n checkWin(); \n }\n \n \n }", "public void doPerform() {\n int noAct = 0;\n float[] curTable = myIal.getPlaceTable(0, 0, 0);\n \n while(checkNotDone()) {\n if(noAct > 3)\n return;\n\n myIal.wait(150);\n //Do an IAL action *****************************************************************************************************************\n if(myIal.lookBlock(myIal.locx, myIal.locy, myIal.locz).equals(\"air\")) { //Assess current location and change state accordingly\n myIal.myState = Agent.State.PLACE;\n } else {\n myIal.myState = Agent.State.MOVE;\n }\n\n if(myIal.myState == Agent.State.PLACE) {\n curTable = myIal.getPlaceTable(myIal.locx, myIal.locy, myIal.locz);\n noAct = 0;\n }\n else if(myIal.myState == Agent.State.MOVE) {\n curTable = myIal.getMoveTable(myIal.locx, myIal.locy, myIal.locz);\n noAct++;\n }\n \n myIal.doAction(getMaxIndex(curTable));\n //System.out.println(\"IAL action done\");\n\n my2Ial.wait(150);\n //Do a 2IAL action *****************************************************************************************************************\n if(my2Ial.lookBlock(my2Ial.locx, my2Ial.locy, my2Ial.locz) == \"air\") { //Assess current location and change state accordingly\n my2Ial.myState = Agent.State.PLACE;\n } else {\n my2Ial.myState = Agent.State.MOVE;\n }\n //System.out.println(\"ysysy\");\n if(my2Ial.myState == Agent.State.PLACE) {\n \n curTable = my2Ial.getPlaceTable(my2Ial.locx, my2Ial.locy, my2Ial.locz);\n noAct = 0;\n }\n else if(my2Ial.myState == Agent.State.MOVE) {\n curTable = my2Ial.getMoveTable(my2Ial.locx, my2Ial.locy, my2Ial.locz);\n noAct++;\n }\n \n my2Ial.doAction(getMaxIndex(curTable));\n //System.out.println(\"JAL action done\");\n }\n\n System.out.println(\"Building is done :)\");\n }", "public boolean isReadyForAction(long time) {\n return System.currentTimeMillis() - lastAction > time;\n }", "private void updateSimState(Date currentSimDateTime){\n\n SimpleDateFormat ft =\n new SimpleDateFormat(\"E yyyy.MM.dd 'at' hh:mm:ss a\");\n String simDateTime = ft.format(currentSimDateTime);\n\n\n for(Person person : entirePopulation){\n for (Task task : person.getSchedule().getTasks()){\n int taskHour = task.getHourOfDay();\n\n int currentSimHour = currentSimDateTime.getHours();\n\n String output = \"{\" + taskHour + \" , \" + currentSimHour + \"}\";\n Log.d(\"Testing\", output);\n\n if(taskHour == currentSimHour ){\n // Perform given task now.\n Log.d(\"Task Executed: \", task.getTaskName());\n }\n }\n }\n }", "private void informTimeToCross() {\n if (continueAskingTimes) {\n requestTimes();\n }\n }", "abstract public void computeSchedule();", "private void check_this_minute() {\n controlNow = false;\n for (DTimeStamp dayControl : plan) {\n if (dayControl.point == clockTime.point) {\n controlNow = true;\n break;\n }\n }\n for (DTimeStamp simControl : extra) {\n if (simControl.equals(clockTime)) {\n controlNow = true;\n break;\n }\n }\n }", "public void buildSchedule() {\n class SimulationStep extends BasicAction {\n public void execute() {\n SimUtilities.shuffle(rabbitList);\n for (int i = 0; i < rabbitList.size(); i++) {\n RabbitsGrassSimulationAgent rabbit = rabbitList.get(i);\n rabbit.step();\n }\n\n reapDeadRabbits();\n\n displaySurf.updateDisplay();\n }\n }\n schedule.scheduleActionBeginning(0, new SimulationStep());\n\n class GrassGrowth extends BasicAction {\n public void execute() {\n space.spreadGrass(grassGrowthRate);\n }\n }\n schedule.scheduleActionBeginning(0, new GrassGrowth());\n\n class UpdatePopulationPlot extends BasicAction {\n public void execute() {\n populationPlot.step();\n }\n }\n schedule.scheduleActionAtInterval(5, new UpdatePopulationPlot());\n }", "@Override\n\tpublic int getAction() {\n\t\tint bstar = -1;\n\t\tdouble bstarval = Double.NEGATIVE_INFINITY;\n\t\tfor (int b : actions) {\n\t\t\t// now we need to look at each possible state transition\n\t\t\tdouble newStateSum = 0;\n\t\t\t// which means for every possible next state\n\t\t\tfor (int newX = 0; newX < beliefs.length; newX++) {\n\t\t\t\tfor (int newY = 0; newY < beliefs[0].length; newY++) {\n\t\t\t\t\tint[] newState = new int[]{newX,newY};\n\t\t\t\t\t// we need to look at every possible previous state\n\t\t\t\t\tdouble stateSum = 0;\n\t\t\t\t\tfor (int x = 0; x < beliefs.length; x++) {\n\t\t\t\t\t\tfor (int y = 0; y < beliefs[0].length; y++) {\n\t\t\t\t\t\t\tstateSum += beliefs[x][y] * // belief in CURRENT state if we were to make the observation, times\n\t\t\t\t\t\t\t\t\t\tworld.transitionProbability(newX, newY, x, y, b) * // probability of getting into the new state\n\t\t\t\t\t\t\t\t\t\tworld.getReward(newState);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnewStateSum += stateSum;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (newStateSum > bstarval) {\n\t\t\t\tbstar = b;\n\t\t\t\tbstarval = newStateSum;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"(EntropicExplorer) Choosing action: \" + world.actionToString(bstar) + \" (value = \" + bstarval + \")\");\n\t\tlastAction = bstar;\n\t\tadvanceBeliefs(bstar);\n\t\treturn bstar;\n\t}", "private int getActiveTime() {\n\t\treturn 15 + level;\n\t}", "boolean isSetTimeInterval();", "public void preform_action() {\n\t\tCarPanelState car_panel_state;\n\t\tSensorData sensor_data;\n\n\t\tint actuator_comp_time = 300;\n\t\tint actuator_deadline = 1000;\n\t\tNature actuator_nature = Task.Nature.APERIODIC;\n\t\tint actuator_movement_amount = 80;\n\n\t\tint closest = 100000;\n\n\t\tswitch (this.action) {\n\t\tcase SET_CAR_SPEED:\n\t\t\tSystem.out.println(\"set speed:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.set_target_speed(this.set_point);\n\t\t\tbreak;\n\t\tcase MOVE_UP_CAR:\n\t\t\tSystem.out.println(\"Move_UP:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.move_up(this.set_point);\n\t\t\tbreak;\n\t\tcase MOVE_DOWN_CAR:\n\t\t\tSystem.out.println(\"Move_DOWN:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.move_down(this.set_point);\n\t\t\tbreak;\n\t\tcase READ_CONE_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tint move_up = 0;\n\t\t\tint move_down = 0;\n\n\t\t\tSystem.out.println(\"cone sensor:\\t\" + sensor_data.cone_sensor.cones);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Cone cone : sensor_data.cone_sensor.cones) {\n\t\t\t\tif (will_collide(car_panel_state.main_car, cone)) {\n\t\t\t\t\t// check if the top of the cone will hit the car\n\t\t\t\t\tif ((cone.y_pos < car_panel_state.main_car.y_pos + car_panel_state.main_car.height)\n\t\t\t\t\t\t\t&& (cone.y_pos > car_panel_state.main_car.y_pos)) {\n\t\t\t\t\t\t// the bottom of the car will hit, so move up\n\t\t\t\t\t\tmove_down++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the top of the car will hit, so move down\n\t\t\t\t\t\t// this.processing_controller.add_task(task);\n\t\t\t\t\t\tmove_up++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (cone.origional_x_pos < closest) {\n\t\t\t\t\tclosest = cone.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = cone.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we need to move decide what task we need to insert\n\t\t\tif (move_up + move_down > 0) {\n\t\t\t\t// see if more obstacles would be avoided by moving up or down\n\t\t\t\tif (move_down > move_up) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t} else {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_UP_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_OTHER_CAR_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tmove_up = 0;\n\t\t\tmove_down = 0;\n\n\t\t\tSystem.out.println(\"car sensor:\\t\" + sensor_data.other_car_sensor.other_cars);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Car car : sensor_data.other_car_sensor.other_cars) {\n\t\t\t\tif (will_collide(car_panel_state.main_car, car)) {\n\t\t\t\t\t// check if the top of the cone will hit the car\n\t\t\t\t\tif ((car.y_pos < car_panel_state.main_car.y_pos + car_panel_state.main_car.height)\n\t\t\t\t\t\t\t&& (car.y_pos > car_panel_state.main_car.y_pos)) {\n\t\t\t\t\t\t// the bottom of the car will hit, so move up\n\t\t\t\t\t\tmove_down++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the top of the car will hit, so move down\n\t\t\t\t\t\t// this.processing_controller.add_task(task);\n\t\t\t\t\t\tmove_up++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (car.origional_x_pos < closest) {\n\t\t\t\t\tclosest = car.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = car.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we need to move decide what task we need to insert\n\t\t\tif (move_up + move_down > 0) {\n\t\t\t\t// see if more obstacles would be avoided by moving up or down\n\t\t\t\tif (move_down > move_up) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t} else {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_UP_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_SPEED_SIGN_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"speed sensor:\\t\" + sensor_data.speed_sign_sensor.signs);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Sign sign : sensor_data.speed_sign_sensor.signs) {\n\t\t\t\t// check the distance to the sign. If the sign is within 300,\n\t\t\t\t// slow down\n\t\t\t\tint main_car_x = car_panel_state.main_car.origional_x_pos + car_panel_state.main_car.total_moved;\n\t\t\t\tif (sign.origional_x_pos - main_car_x < 1000) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tsign.speed_limit);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (sign.origional_x_pos < closest) {\n\t\t\t\t\tclosest = sign.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = sign.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_STOP_SIGN_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"stop sensor:\\t\" + sensor_data.stop_sign_sensor.signs);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Sign sign : sensor_data.stop_sign_sensor.signs) {\n\t\t\t\t// check the distance to the sign. If the sign is within 300,\n\t\t\t\t// slow down\n\t\t\t\tint main_car_x = car_panel_state.main_car.origional_x_pos + car_panel_state.main_car.total_moved;\n\t\t\t\tif (sign.origional_x_pos - main_car_x < 500) {\n\t\t\t\t\t// submit a task to stop at the stop sign\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller, 0);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\n\t\t\t\t\t// submit a task to start moving again\n\t\t\t\t\ttask = new Task(actuator_comp_time * 100, 0, actuator_deadline * 100, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller, 50);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (sign.origional_x_pos < closest) {\n\t\t\t\t\tclosest = sign.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = sign.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_LANE_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"lane sensor:\\t\" + sensor_data.lane_sensor.within_lane);\n\n\t\t\t// if we aren't within our lane\n\t\t\tif (sensor_data.lane_sensor.within_lane == false) {\n\t\t\t\t// move back to origional y position\n\t\t\t\tint main_car_y_offset = car_panel_state.main_car.origional_y_pos - car_panel_state.main_car.y_pos;\n\t\t\t\t// if car below where it should be\n\n\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\tmain_car_y_offset);\n\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t}", "private ArrayList<int[]> findTransitionsToWithinLimits(char[] pattern) {\n ArrayList<int[]> validtransitions=new ArrayList<int[]>();\n double patternscore=getMatchScore(pattern);\n for (int i=0;i<pattern.length;i++) { // for each position\n for (int j=0;j<4;j++) {\n double newscore=patternscore+transitions[i][j];\n if (newscore>=minMatch && newscore<=maxMatch) {\n validtransitions.add(new int[]{i,j});\n }\n }\n }\n return validtransitions;\n }", "abstract public int getServiceInterval();", "protected void runEach10Minutes() {\n try {\n saveHistoryData();\n if (isEnabledScheduler()) {\n boolean action = getLightSchedule().getCurrentSchedule();\n if (action) {\n if (!currentState) switchOn();\n } else {\n if (currentState) switchOff();\n }\n }\n } catch (RemoteHomeManagerException e) {\n RemoteHomeManager.log.error(44,e);\n } catch (RemoteHomeConnectionException e) {\n RemoteHomeManager.log.error(45,e);\n }\n }", "private Action selectRandomAction() {\n int fuel;\n String car, driver;\n Tire tire;\n TirePressure pressure;\n\n // Possible tire pressures\n List<TirePressure> tirePressures = Arrays.asList(\n TirePressure.FIFTY_PERCENT,\n TirePressure.SEVENTY_FIVE_PERCENT,\n TirePressure.ONE_HUNDRED_PERCENT\n );\n\n // Possible fuel levels (note that this is an arbitrary discretization)\n List<Integer> fuelLevels = new ArrayList<>();\n int fuelInterval = ProblemSpec.FUEL_MAX / FUEL_DISCRETE_INTERVALS;\n\n for (int i = 0; i < FUEL_DISCRETE_INTERVALS; i++) {\n fuelLevels.add(fuelInterval * i);\n }\n\n List<ActionType> validActionTypes = problemSpec.getLevel().getAvailableActions();\n ActionType actionType = getRandomElement(validActionTypes);\n Action action;\n\n // Pick a random action from A1-A8 and then randomize the parameters\n switch (actionType.getActionNo()) {\n case 1:\n action = new Action(actionType);\n break;\n case 2:\n car = getRandomElement(problemSpec.getCarOrder());\n action = new Action(actionType, car);\n break;\n case 3:\n driver = getRandomElement(problemSpec.getDriverOrder());\n action = new Action(actionType, driver);\n break;\n case 4:\n tire = getRandomElement(problemSpec.getTireOrder());\n action = new Action(actionType, tire);\n break;\n case 5:\n fuel = getRandomElement(fuelLevels);\n action = new Action(actionType, fuel);\n break;\n case 6:\n pressure = getRandomElement(tirePressures);\n action = new Action(actionType, pressure);\n break;\n case 7:\n car = getRandomElement(problemSpec.getCarOrder());\n driver = getRandomElement(problemSpec.getDriverOrder());\n action = new Action(actionType, car, driver);\n break;\n default:\n // A8\n tire = getRandomElement(problemSpec.getTireOrder());\n fuel = getRandomElement(fuelLevels);\n pressure = getRandomElement(tirePressures);\n action = new Action(actionType, tire, fuel, pressure);\n }\n\n return action;\n\n }", "boolean hasWaitTime();", "boolean hasDesiredTime();", "public void run() {\n long startTime = 0;\n if (action.getClass().getName().contains(\"TooAction\")) {\n startTime = System.currentTimeMillis();\n LOG.log(Level.WARNING, \"Sending a ToO alert...\");\n }\n\n action.doTriggerAction(change, handback);\n\n // Record the end time and warn if it took too long.\n if (startTime != 0) {\n long curTime = System.currentTimeMillis();\n LOG.log(Level.WARNING, \"Sent ToO alert\");\n\n long elapsed = curTime - startTime;\n if (elapsed > 5000) {\n LOG.log(Level.WARNING, \"Long delay sending ToO alert: \" + elapsed);\n }\n }\n\n }", "@Override\n public Action playTurn(Actions actions, Action lastAction, GameMap map, Display display) {\n\n updateAgilisaurusState(); // update agilisaurus state\n\n if (isPregnant()) {\n pregnantPeriodCount++;\n if (pregnantPeriodCount == 10) {\n // prenant after 10 turns\n this.removeCapability(LifeStage.PREGNANT);\n this.removeCapability(LifeStage.ADULT);\n Egg egg = new Egg(\"Agilisaurus\", true, owner);\n map.locationOf(this).addItem(egg);\n\n pregnantPeriodCount = 0;\n }\n }\n\n if (this.starvationLevel == 20 || this.hitPoints == 0 | this.thirstLevel == 20) {\n this.removeCapability(LiveStatus.LIVE);\n this.addCapability(LiveStatus.DEAD);\n map.locationOf(this).addItem(new Corpse(\"Agilisaurus\"));\n map.removeActor(this);\n }\n\n if (this.foodLevel <= 0) {\n System.out.println(\"Agilisaurus is unwake due to hungry now.\");\n return new DoNothingAction();\n }\n\n Action wander = behaviour.getAction(this, map);\n if (wander != null) {\n return wander;\n } else {\n return new DoNothingAction();\n }\n }", "private void scheduleOptions(int choice) {\n switch (choice) {\n case 8:\n generate();\n if (yesNoQuestion(\"Would you like to filter through the generated schedules?\")) {\n showAllSchedulesFiltered(activeScheduleList);\n } else {\n showAllSchedules(activeScheduleList);\n }\n break;\n case 9:\n saveGeneratedSchedules();\n break;\n case 10:\n viewSavedSchedules();\n break;\n case 11:\n removeFromSavedScheduleList();\n break;\n }\n }", "public void chooseOperation(int i) {\r\n\r\n switch (i) {\r\n case 0:\r\n model.increaseOneHour();\r\n break;\r\n case 1:\r\n model.decreaseOneHour();\r\n break;\r\n case 2:\r\n model.increaseOneMinute();\r\n break;\r\n case 3:\r\n model.decreaseOneMinute();\r\n break;\r\n case 4:\r\n model.increaseOneSecond();\r\n break;\r\n case 5:\r\n model.decreaseOneSecond();\r\n break;\r\n case 6:\r\n view.printMessage(View.BREAK);\r\n break;\r\n }\r\n view.printMessage(model.toString());\r\n }", "private boolean runAction(Canvas cv, SUT system, State state, Taggable fragment){\n\t\tActionStatus actionStatus = new ActionStatus();\n\t\twaitUserActionLoop(cv,system,state,actionStatus);\n\n\t\tcv.begin(); Util.clear(cv);\n\t\t//visualizeState(cv, state);\n\t\tvisualizeState(cv, state,system); // by urueda \n\t\tLogSerialiser.log(\"Building action set...\\n\", LogSerialiser.LogLevel.Debug);\n\t\t\t\t\t\n\t\t// begin by urueda\n\t\tif (actionStatus.isUserEventAction()){ // user action\n\t\t\tCodingManager.buildIDs(state, actionStatus.getAction());\n\t\t} else if (mode() == Modes.AdhocTest){ // adhoc-test action\n\t\t\tif (waitAdhocTestEventLoop(state,actionStatus)){\n\t\t\t\tcv.end(); // by urueda\n\t\t\t\treturn true; // problems\n\t\t\t}\n\t\t} else{ // automatically derived action\n\t\t\tif (waitAutomaticAction(system,state,fragment,actionStatus)){\n\t\t\t\tcv.end(); // by urueda\n\t\t\t\treturn true; // problems\n\t\t\t} else if (actionStatus.getAction() == null && mode() == Modes.Spy){\n\t\t\t\tcv.end(); // by urueda\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// begin by urueda\n\t\tcv.end();\n\t\t\n\t\tif (actionStatus.getAction() == null)\n\t\t\treturn true; // problems\n\t\t// end by urueda\n\t\t\n\t\tif (actionCount == 1 && isESC(actionStatus.getAction())){ // first action in the sequence an ESC?\n\t\t\tSystem.out.println(\"First action ESC? Switching to NOP to wait for SUT UI ... \" + this.timeElapsed());\n\t\t\tUtil.pauseMs(NOP_WAIT_WINDOW); // hold-on for UI to react (e.g. scenario: SUT loading ... logo)\n\t\t\tactionStatus.setAction(new NOP());\n\t\t\tCodingManager.buildIDs(state, actionStatus.getAction());\n\t\t\tnopAttempts++; escAttempts = 0;\n\t\t} else\n\t\t\tnopAttempts = 0;\n\t\t//System.out.println(\"Selected action: \" + action.toShortString() + \" ... count of ESC/NOP = \" + escAttempts + \"/\" + nopAttempts);;\n\t\t// end by urueda\n\t\t\n\t\tLogSerialiser.log(\"Selected action '\" + actionStatus.getAction() + \"'.\\n\", LogSerialiser.LogLevel.Debug);\n\t\t\t\t\n\t\tvisualizeSelectedAction(cv, state, actionStatus.getAction());\n\t\t\n\t\tif(mode() == Modes.Quit) return actionStatus.isProblems();\n\t\t\n\t\tboolean isTestAction = nopAttempts >= MAX_NOP_ATTEMPTS || !isNOP(actionStatus.getAction()); // by urueda\n\t\t\t\n\t\tif(mode() != Modes.Spy){\n\t\t\t// begin by urueda\n\t\t\tString[] actionRepresentation = Action.getActionRepresentation(state,actionStatus.getAction(),\"\\t\");\n\t\t\tint memUsage = NativeLinker.getMemUsage(system);\n\t\t\tif (memUsage < sutRAMbase)\n\t\t\t\tsutRAMbase = memUsage;\n\t\t\tif (memUsage - sutRAMbase > sutRAMpeak)\n\t\t\t\tsutRAMpeak = memUsage - sutRAMbase;\n\t\t\tlong currentCPU[] = NativeLinker.getCPUsage(system),\n\t\t\t\t userms = currentCPU[0] - lastCPU[0],\n\t\t\t\t sysms = currentCPU[1] - lastCPU[1],\n\t\t\t\t cpuUsage[] = new long[]{ userms, sysms, currentCPU[2]}; // [2] = CPU frame\n\t\t\tlastCPU = currentCPU;\n\t\t\tif (isTestAction)\n\t\t\t\tGrapher.notify(state,state.get(Tags.ScreenshotPath, null),\n\t\t\t\t\t\t\t actionStatus.getAction(),protocolUtil.getActionshot(state,actionStatus.getAction()),actionRepresentation[1],\n\t\t\t\t\t\t \t memUsage, cpuUsage);\n\t\t\t// end by urueda\n\t\t\tLogSerialiser.log(String.format(\"Executing (%d): %s...\", actionCount,\n\t\t\t\tactionStatus.getAction().get(Desc, actionStatus.getAction().toString())) + \"\\n\", LogSerialiser.LogLevel.Debug);\n\t\t\t//if((actionSucceeded = executeAction(system, state, action))){\n\t\t\tif (actionStatus.isUserEventAction() ||\n\t\t\t\t(actionStatus.setActionSucceeded(executeAction(system, state, actionStatus.getAction())))){ // by urueda\t\t\t\t\t\n\t\t\t\t//logln(String.format(\"Executed (%d): %s...\", actionCount, action.get(Desc, action.toString())), LogLevel.Info);\n\t\t\t\t// begin by urueda\n\t\t\t\tcv.begin(); Util.clear(cv); cv.end(); // by urueda (overlay is invalid until new state/actions scan)\n\t\t\t\tstampLastExecutedAction = System.currentTimeMillis();\t\t\t\t\t\n\t\t\t\tactionExecuted(system,state,actionStatus.getAction()); // notification\n\t\t\t\tif (actionStatus.isUserEventAction())\n\t\t\t\t\tUtil.pause(settings.get(ConfigTags.TimeToWaitAfterAction)); // wait between actions\n\t\t\t\tdouble sutCPU = ((cpuUsage[0] + cpuUsage[1]) / (double)cpuUsage[2] * 100);\n\t\t\t\tif (sutCPU > sutCPUpeak)\n\t\t\t\t\tsutCPUpeak = sutCPU;\n\t\t\t\tString cpuPercent = String.format(\"%.2f\", sutCPU) + \"%\";\n\t\t\t\tLogSerialiser.log(String.format(\"Executed [%d]: %s\\n%s\",\n\t\t\t\t\t\tactionCount,\n\t\t\t\t\t\t\"action = \" + actionStatus.getAction().get(Tags.ConcreteID) +\n\t\t\t\t\t\t\" (\" + actionStatus.getAction().get(Tags.AbstractID) + \") @state = \" +\n\t\t\t\t\t\tstate.get(Tags.ConcreteID) + \" (\" + state.get(Tags.Abstract_R_ID) + \")\\n\\tSUT_KB = \" +\n\t\t\t\t\t\tmemUsage + \", SUT_ms = \" + cpuUsage[0] + \" x \" + cpuUsage[1] + \" x \" + cpuPercent,\n\t\t\t\t\t\tactionRepresentation[0]) + \"\\n\",\n\t\t\t\t\t\tLogSerialiser.LogLevel.Info);\n\t\t\t\tSystem.out.print(String.format(\n\t\t\t\t\t\t\"S[%1$\" + (1 + (int)Math.log10((double)settings.get(ConfigTags.Sequences))) + \"d=%2$\" + (1 + (int)Math.log10((double)generatedSequenceNumber)) + \"d]-\" + // S = test Sequence\n\t\t\t\t\t\t\"A[%3$\" + (1 + (int)Math.log10((double)settings().get(ConfigTags.SequenceLength))) + // A = Action\n\t\t\t\t\t\t\"d] <%4$3s@%5$3s KCVG>... SR = %6$8d KB / SC = %7$7s ... \", // KCVG = % CVG of Known UI space @ known UI space scale; SR = SUT_RAM; SC = SUT_CPU\n\t\t\t\t\t\tsequenceCount, generatedSequenceNumber, actionCount,\n\t\t\t\t\t\tGrapher.GRAPHS_ACTIVATED ? Grapher.getEnvironment().getExplorationCurveSampleCvg() : -1,\n\t\t\t\t\t\tGrapher.GRAPHS_ACTIVATED ? Grapher.getEnvironment().convertKCVG(Grapher.getEnvironment().getExplorationCurveSampleScale()) : -1,\n\t\t\t\t\t\tmemUsage, cpuPercent)); debugResources();\n\t\t\t\tSystem.out.print(\" ... L/S/T: \" + LogSerialiser.queueLength() + \"/\" + ScreenshotSerialiser.queueLength() + \"/\" + TestSerialiser.queueLength()); // L/S/T = Log/Scr/Test queues\n\t\t\t\t//Example: Seq[1]-Action[1] < 0 KCVG>... SUT_RAM = 17292 KB / SUT_CPU = 17.42% ... TESTAR_CPU: 1.550 s / TESTAR_RAM: 491.0 MB ... Log/Scr/Test queues: 2/2/0\t\t\t\t\n// temp begin\n/*if (Grapher.getEnvironment() != null){\n\tint totalWidgets = 0,\n\t totalUnxActions = 0;\n\tfor (IGraphState gs : Grapher.getEnvironment().getGraphStates()){\n\t\ttotalWidgets += gs.getStateWidgets().size();\n\t\ttotalUnxActions += gs.getUnexploredActions().size();\n\t}\n\tSystem.out.print(\"\\n\\t\" + String.format(\"%7d\",totalWidgets) + \" x \" + String.format(\"%7d\",totalUnxActions) + \"\\t(widgets x unexplored actions)\");\n}*/\n// temp end\n\t\t\t\tif (settings().get(ConfigTags.PrologActivated))\n\t\t\t\t\tSystem.out.println(\" ... prolog: \" + jipWrapper.debugPrologBase());\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t//logln(Grapher.getExplorationCurveSample(),LogLevel.Info);\n\t\t\t\t//logln(Grapher.getLongestPath() + \"\\n\",LogLevel.Info);\n\t\t\t\tif (mode() == Modes.AdhocTest){\n\t\t\t\t\ttry {\n\t\t\t\t\t\tprotocolUtil.adhocTestServerWriter.write(\"OK\\r\\n\"); // adhoc action executed\n\t\t\t\t\t\tprotocolUtil.adhocTestServerWriter.flush();\n\t\t\t\t\t} catch (Exception e){} // AdhocTest client disconnected?\n\t\t\t\t}\n\t\t\t\t// end by urueda\n\n\t\t\t\tif (isTestAction && actionStatus.isActionSucceeded()) // by urueda\n\t\t\t\t\tactionCount++;\n\t\t\t\tfragment.set(ExecutedAction, actionStatus.getAction());\n\t\t\t\tfragment.set(ActionDuration, settings().get(ConfigTags.ActionDuration));\n\t\t\t\tfragment.set(ActionDelay, settings().get(ConfigTags.TimeToWaitAfterAction));\n\t\t\t\tLogSerialiser.log(\"Writing fragment to sequence file...\\n\", LogSerialiser.LogLevel.Debug);\n\t\t\t\t//oos.writeObject(fragment);\n\t\t\t\tTestSerialiser.write(fragment); // by urueda\n\t\n\t\t\t\tLogSerialiser.log(\"Wrote fragment to sequence file!\\n\", LogSerialiser.LogLevel.Debug);\n\t\t\t}else{\n\t\t\t\tLogSerialiser.log(\"Execution of action failed!\\n\");\n\t\t\t\ttry {\n\t\t\t\t\tprotocolUtil.adhocTestServerWriter.write(\"FAIL\\r\\n\"); // action execution failed\n\t\t\t\t\tprotocolUtil.adhocTestServerWriter.flush();\n\t\t\t\t} catch (Exception e) {} // AdhocTest client disconnected?\n\t\t\t}\t\t\t\t\n\t\t}\n\t\t\n\t\tlastExecutedAction = actionStatus.getAction(); // by urueda\n\t\t\n\t\tif(mode() == Modes.Quit) return actionStatus.isProblems();\n\t\tif(!actionStatus.isActionSucceeded()){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn actionStatus.isProblems();\n\t}", "public void checkTimes(){\r\n\t\tcal = Calendar.getInstance();\r\n\t\t//if(alarmList.size() != 0){\r\n\t\tfor(int i = 0; i < alarmList.size(); i++){\r\n\t\t\tAlarmTime current = alarmList.get(i);\r\n\t\t\tif(current.getYear() == cal.get(Calendar.YEAR) && current.getMonth() == cal.get(Calendar.MONTH)\r\n\t\t\t\t\t&& current.getDay() == cal.get(Calendar.DAY_OF_MONTH) && current.getHour() == cal.get(Calendar.HOUR_OF_DAY)\r\n\t\t\t\t\t&& current.getMinute() <= cal.get(Calendar.MINUTE)){\r\n\t\t\t\t//display alarm / play sound\r\n\t\t\t\t\t//alarmList.get(i).setActive(true);\r\n\t\t\t\t\tcurrent.setActive(true);\r\n\t\t\t\t//if(!alarmList.get(i).isActive){\t\t\t\t\t//this can be removed if it needs to repeatedly go off\r\n\r\n//\t\t\t\t\tif(!(activeAlarms.contains(alarmList.get(i)))){\r\n//\t\t\t\t\t\tactiveAlarms.add(alarmList.get(i));\r\n//\t\t\t\t\t}\r\n\t\t\t\t\tif(!(activeAlarms.contains(current))){\r\n\t\t\t\t\t\tactiveAlarms.add(current);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//System.out.println(alarmList.get(i).getMinute());\r\n\t\t\t\t\t//System.out.println(current.getMinute());\r\n\t\t\t\t\tring = new AlarmRingDesign(alarmList.get(i).getMessage(), this, alarmList.get(i));\r\n\t\t\t\t\tring.init();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t//do nothing\r\n\t\t\t}\r\n\t\t}\r\n\t//}\r\n\t}", "@Override\n public void run() {\n // maintenance mode\n if(cluster.isUnderMaintenance()) {\n logger.log(Level.INFO, \"Cluster \" + cluster.getClusterId() + \" is under maintenance mode.\");\n executorThread.schedule(this, confOperatorExecIntervalSec, TimeUnit.SECONDS);\n return;\n }\n // go through all operators and intercept the dispatch calls\n for(OperatorContainer operatorContainer : operatorContainers){\n try {\n operatorContainer.operate(cluster);\n } catch (Exception e){\n logger.log(Level.SEVERE, \"Operator \" + operatorContainer.getOperator().getName() + \" failed to operate\", e);\n }\n }\n\n // compare the shadow list and actual list and determine where the nextIdx is in the shadow queue\n // then swap actual list with shadow list, and clear shadow list\n commitShadowList();\n\n // execute the next action in the actual list\n boolean success = false;\n if(nextIdx < actualList.size()){\n Action nextAction = actualList.get(nextIdx);\n nextAction.setOwner(AUTOMATION_ACTION_OWNER);\n try {\n success = actionEngine.dispatchNow(nextAction);\n if (!success) {\n logger.info(\"Failed to dispatch action \" + nextAction.getName() + \" since there are existing actions in the ActionEngine\");\n } else {\n logger.info(\"Dispatched action: \" + nextAction.getName() + \" on \" + cluster.getClusterId());\n nextIdx++;\n }\n } catch (Exception e) {\n logger.severe(\"Failed to dispatch action \" + nextAction.getName() + \" from operator executor :\" + e);\n nextAction.markFailed(e);\n }\n }\n\n // re-evaluate operators immediately if the actual list is not empty, otherwise run with fix interval\n if(!actualList.isEmpty() && success && nextIdx < actualList.size()){\n executorThread.schedule(this, 0, TimeUnit.SECONDS);\n } else {\n executorThread.schedule(this, confOperatorExecIntervalSec, TimeUnit.SECONDS);\n }\n }", "public void act()\n {\n trackTime();\n showScore();\n \n }", "@Override\n\tpublic void doTimeStep() {\n\t\tint activity = Critter.getRandomInt(3);\n\t\tif(activity == 0) {\n\t\t\twalk(Critter.getRandomInt(8));\n\t\t\tthis.moveFlag = true;\n\t\t}\n\t\telse if(activity == 1) {\t\t\t\t\n\t\t\trun(Critter.getRandomInt(8));\n\t\t\tthis.moveFlag = true;\n\t\t}\n\t\telse if(this.getEnergy() >= Params.min_reproduce_energy) {\n\t\t\tCritter4 egg = new Critter4();\n\t\t\tthis.reproduce(egg,Critter.getRandomInt(8));\n\t\t}\n\t\telse {\n\t\t}\n\t}", "public abstract boolean isScheduled();", "public abstract void schedule();", "@ScheduledMethod(start = 1, interval = 1, priority = -5)\n\tpublic void react() {\n\t\tfor (int i = 0; i < 1; i++) { \n\n\t\t\tfor (Entry<String, Reaction> entry : reactionMap.entrySet()) {\n\n\t\t\t\tlong startTime = System.currentTimeMillis();\n\n\t\t\t\tString key = entry.getKey();\n\t\t\t\tReaction value = entry.getValue();\n\t\t\t\tvalue.react(1.0);\n\t\t\t\tlong endTime = System.currentTimeMillis();\n\n\t\t\t\tSystem.out.println(\"reaction, \" + key + \":\");\n\t\t\t\tSystem.out.println(endTime - startTime);\n\n\t\t\t}\n\t\t}\n\t}", "public void scheduleOptions() {\n System.out.println(\"Would you like to (1) Add an Event, (2) Remove an Event, (3) Exit this menu\");\n }", "@Override\n\tpublic void act(float dt){\n\t\t\n\t}", "public void goapPlanFound(Queue<GoapAction> actions);", "void printActionsRemaining(boolean primary, boolean secondary);", "int getActionLogCount();", "@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 }", "public void compileStates(int timeinterval) {\r\n\t\tif(timeinterval == -1) {\r\n\t\t\t//Add initial State\r\n\t\t\treachableStates.add(initialState);\r\n\t\t\tthis.numReachableState = 1;\r\n\t\t\t\r\n\t\t}else{\t\t\t\t\r\n\t\tState s;\r\n\t\tint index = 0;\r\n\t\treachableStates.clear();\r\n\t\tfor(int i = 0; i < totalWorkloadLevel; i++) {\r\n\t\t\tfor(int j = 0; j < totalGreenEnergyLevel; j++) {\r\n\t\t\t\tfor(int k = 0; k < totalBatteryLevel; k++) {\r\n\t\t\t\t\ts = grid[timeinterval][i][j][k];\r\n\t\t\t\t\tif(s.getProbability() != 0) {\r\n\t\t\t\t\t\t//If probability of state is not 0, put this state into the reachable list. \r\n\t\t\t\t\t\ts.index = index;\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\treachableStates.add(s);\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\tthis.numReachableState = index;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n System.out.println(solution(\"02:03:55\",\"00:14:15\",\n new String[] {\"01:20:15-01:45:14\", \n \"00:40:31-01:00:00\",\n \"00:25:50-00:48:29\",\n \"01:30:59-01:53:29\", \n \"01:37:44-02:02:30\"}));\n \n // \"01:00:00\"\n System.out.println(solution(\"99:59:59\", \"25:00:00\",\n new String[] {\"69:59:59-89:59:59\",\n \"01:00:00-21:00:00\",\n \"79:59:59-99:59:59\",\n \"11:00:00-31:00:00\"}));\n \n // \"00:00:00\"\n System.out.println(solution(\"50:00:00\", \"50:00:00\",\n new String[] {\"15:36:51-38:21:49\",\n \"10:14:18-15:36:51\",\n \"38:21:49-42:51:45\"}));\n \n }", "protected abstract void scheduleSuspicions();" ]
[ "0.62615496", "0.6211173", "0.6034601", "0.5910164", "0.58662784", "0.5834497", "0.5767944", "0.57226425", "0.5710012", "0.5602206", "0.55739397", "0.5552535", "0.5488966", "0.54438037", "0.5385042", "0.5383318", "0.53721845", "0.53507763", "0.5339337", "0.5339281", "0.53338426", "0.5274952", "0.527244", "0.5255725", "0.5242811", "0.5242184", "0.52399373", "0.523815", "0.5226709", "0.52110004", "0.5196786", "0.5159723", "0.5156012", "0.5146484", "0.5131532", "0.5130549", "0.51242894", "0.508343", "0.5077538", "0.5077457", "0.5074141", "0.50734276", "0.5067005", "0.5066313", "0.506085", "0.5043749", "0.50433856", "0.5039827", "0.5039203", "0.5032149", "0.5026658", "0.50234884", "0.50233257", "0.50175345", "0.5010556", "0.5010556", "0.5007715", "0.5002905", "0.5001551", "0.5001378", "0.49895105", "0.4987551", "0.49853212", "0.4976417", "0.4963016", "0.4955293", "0.49441326", "0.49347672", "0.49320444", "0.4925075", "0.49181476", "0.4907547", "0.49062592", "0.4898989", "0.48983788", "0.4888797", "0.48853293", "0.48849863", "0.488405", "0.4882049", "0.48780715", "0.48720878", "0.48692447", "0.4869221", "0.48686373", "0.48667836", "0.4860344", "0.48551556", "0.48463112", "0.48463067", "0.48426837", "0.484193", "0.4841049", "0.48375025", "0.4831445", "0.48313263", "0.4829131", "0.48291257", "0.48246416", "0.482412", "0.482129" ]
0.0
-1
Find the reachable states. The states with 0 probability are not considered. The following 4 methods are related to states
public void compileStates(int timeinterval) { if(timeinterval == -1) { //Add initial State reachableStates.add(initialState); this.numReachableState = 1; }else{ State s; int index = 0; reachableStates.clear(); for(int i = 0; i < totalWorkloadLevel; i++) { for(int j = 0; j < totalGreenEnergyLevel; j++) { for(int k = 0; k < totalBatteryLevel; k++) { s = grid[timeinterval][i][j][k]; if(s.getProbability() != 0) { //If probability of state is not 0, put this state into the reachable list. s.index = index; index++; reachableStates.add(s); } } } } this.numReachableState = index; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Set<Integer> getStatesFromWichReachableAccepting(LabelledTransitionSystem ret) {\n\t\tMap<Integer, Set<Integer>> reversedReachable = this.computeInverseTransitionRelation(ret);\n\n\t\tSet<Integer> reachable = new HashSet<>();\n\n\t\tlogger.debug(\"Accepting states: \" + ret.getAccepting());\n\t\tSet<Integer> current = ret.getAccepting();\n\n\t\tboolean[] visited = new boolean[ret.getStates().length];\n\n\t\twhile (!current.isEmpty()) {\n\t\t\tInteger evaluated = current.iterator().next();\n\t\t\tcurrent.remove(evaluated);\n\t\t\tif (!visited[evaluated]) {\n\t\t\t\tvisited[evaluated] = true;\n\t\t\t\treachable.add(evaluated);\n\t\t\t\tSet<Integer> prev = new HashSet<>(reversedReachable.get(evaluated));\n\t\t\t\tcurrent.addAll(prev);\n\t\t\t}\n\t\t}\n\n\t\treturn reachable;\n\t}", "public HashSet<State> statesReachableOn(State from, Character on) {\n \t\tHashSet<State> reachable = new HashSet<State>();\n \t\tIterator<Transition> iter = from.getTransitions().iterator();\n \t\twhile (iter.hasNext()) {\n \t\t\tTransition t = iter.next();\n \n \t\t\t// Do they want the epsilon transitions?\n \t\t\tboolean equals = false;\n \t\t\tif (on == null)\n \t\t\t\tequals = on == t.c;\n \t\t\telse\n \t\t\t\tequals = on.equals(t.c);\n \n \t\t\t// Add all matching transitions\n \t\t\t// Skip if already added to prevent loops\n \t\t\tif (equals && !reachable.contains(t.to)) {\n \t\t\t\t// Add this state\n \t\t\t\treachable.add(t.to);\n \n \t\t\t\t// Recurse and add all reachable from this state (epsilon transitions)\n \t\t\t\treachable.addAll(statesReachableFrom(t.to));\n \t\t\t}\n \t\t}\n \n \t\treturn reachable;\n \t}", "public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "@Test\n public void genNeighStateProbability() {\n double[] metrics = new double[STATES.length * STATES.length];\n double sum = 0;\n Random rand = new Random();\n for (int i = 0; i < metrics.length; i++) {\n int x = i / STATES.length;\n int y = i % STATES.length;\n if (x == y) {\n metrics[i] = 0;\n } else {\n double d = Math.abs(rand.nextGaussian());//Math.exp(-Math.abs(STATES[x] - STATES[y]) / 3) * Math.abs(rand.nextGaussian());\n metrics[i] = d;\n sum += d;\n }\n }\n final double finalSum = sum;\n metrics = DoubleStream.of(metrics).map(d -> d / finalSum).toArray();\n for (int i = 0; i < metrics.length; i++) {\n int x = i / STATES.length;\n int y = i % STATES.length;\n if (metrics[i] > 0.01) {\n System.out.printf(\"%d:%d:%.4f\\n\", STATES[x], STATES[y], metrics[i]);\n }\n }\n }", "private BDD reachableStates(BDD i, BDD t, BDD x, Map<Integer, Integer> renaming){\n\t\tSystem.out.println(\"\\n\" + \"[*] Computing reachable states\" + \"\\n\");\n\n\t\tBDD result = this.factory.makeZero();\n\t\tBDD rCopy = null;\n\n\t\tint counter = 1;\n\t\tdo{\n\n\t\t\tSystem.out.println(\" - iteration K = \" + counter++);\n\n\t\t\tif(rCopy != null)\n\t\t\t\trCopy.free();\n\n\t\t\trCopy = result;\t\n\n\t\t\tBDD and = t.and(result);\t\t\t\n\t\t\tBDD exist = and.exist(x);\n\t\t\tand.free();\n\n\t\t\tBDD replace = exist.replace(renaming);\n\t\t\tresult = i.or(replace);\n\n\t\t\treplace.free();\n\n\t\t}while(!result.isEquivalentTo(rCopy));\n\n\t\trCopy.free();\n\n\t\tSystem.out.println(\"\\n\" + \"[*] Done computing reachable states\" + \"\\n\");\n\n\t\treturn result;\n\t}", "public HashSet<State> statesReachableFrom(State from) {\n \t\treturn statesReachableOn(from, null);\n \t\t//\t\tHashSet<State> reachable = new HashSet<State>();\n \t\t//\t\tIterator<Transition> iter = from.getTransitions().iterator();\n \t\t//\t\twhile (iter.hasNext()) {\n \t\t//\t\t\tTransition t = iter.next();\n \t\t//\t\t\t\n \t\t//\t\t\t// Add all empty transitions\n \t\t//\t\t\t// Skip if already added to prevent loops\n \t\t//\t\t\tif (t.isEmptyTransition() && !reachable.contains(t.to)) {\n \t\t//\t\t\t\t// Add this state\n \t\t//\t\t\t\treachable.add(t.to);\n \t\t//\t\t\t\t\n \t\t//\t\t\t\t// Recurse and add all reachable from this state\n \t\t//\t\t\t\treachable.addAll(statesReachableFrom(t.to));\n \t\t//\t\t\t}\n \t\t//\t\t}\n \t\t//\t\t\n \t\t//\t\treturn reachable;\n \t}", "public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public void solveGame3() {\n\t\tlosingStates = new HashSet<S>();\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tint[] uncontrollableCount = new int[game.getStates().size()+1];\n\t\tint[] uncontrollableLosingCount = new int[game.getStates().size()+1];\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> uncontrollableSuccesors;\n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\t uncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\n\t\t\t uncontrollableCount[indexCount] = uncontrollableSuccesors.size();\n\t\t\t uncontrollableLosingCount[indexCount] = 0;\n\t\t\t isUncontrollable[indexCount] = game.isUncontrollable(state);\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableLosingCount[i]++;\n\t\t\t\t\tif (uncontrollableLosingCount[i] == uncontrollableCount[i])\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "List<S> getAllPossibleStates(S state);", "public LinkedList<State> getNextAvailableStates() {\n LinkedList<Integer> currentSide = new LinkedList<>();\n LinkedList<Integer> otherSide = new LinkedList<>();\n LinkedList<State> newStates = new LinkedList<>();\n if(isLeft) {\n if(leftSide != null) currentSide = new LinkedList<>(leftSide);\n if(rightSide != null) otherSide = new LinkedList<>(rightSide);\n } else {\n if (rightSide != null) currentSide = new LinkedList<>(rightSide);\n if (leftSide != null) otherSide = new LinkedList<>(leftSide);\n }\n\n // add one people to the other side of the bridge\n for (int index=0; index< currentSide.size(); index++) {\n LinkedList<Integer> newCurrentSide = new LinkedList<>(currentSide);\n LinkedList<Integer> newOtherSide = new LinkedList<>(otherSide);\n int firstPeopleMoved = newCurrentSide.remove(index);\n newOtherSide.add(firstPeopleMoved);\n State state = (isLeft) ? new State(newCurrentSide, newOtherSide, !isLeft,timeTaken+firstPeopleMoved, depth+1, highestSpeed) :\n new State(newOtherSide, newCurrentSide, !isLeft, timeTaken+firstPeopleMoved, depth+1, highestSpeed);\n state.setReward(state.calculateReward(firstPeopleMoved));\n // add this as parent to the child\n state.parents = new LinkedList<>(this.parents);\n state.addParent(this);\n // set the action that get to this state\n String currentAction = \"move \" + firstPeopleMoved;\n currentAction += (isLeft) ? \" across\" : \" back\";\n state.copyActions(this); // copy all the previous actions from the parent\n state.addActions(currentAction); // add new action to state generated by parent\n // add to the new states of list\n newStates.add(state);\n // add two people to the other side of the bridge\n for (int second=0; second < newCurrentSide.size(); second++) {\n LinkedList<Integer> newSecondCurrentSide = new LinkedList<>(newCurrentSide);\n LinkedList<Integer> newSecondOtherSide = new LinkedList<>(newOtherSide);\n int secondPeopleMoved = newSecondCurrentSide.remove(second);\n newSecondOtherSide.add(secondPeopleMoved);\n int slowerSpeed = (firstPeopleMoved > secondPeopleMoved) ? firstPeopleMoved : secondPeopleMoved;\n state = (isLeft) ? new State(newSecondCurrentSide, newSecondOtherSide, !isLeft, timeTaken+slowerSpeed, depth+1, highestSpeed) :\n new State(newSecondOtherSide, newSecondCurrentSide, !isLeft, timeTaken+slowerSpeed, depth+1, highestSpeed);\n state.setReward(state.calculateReward(firstPeopleMoved, secondPeopleMoved));\n // add this as parent to the child\n state.parents = new LinkedList<>(this.parents);\n state.addParent(this);\n // set the action that get to this state\n currentAction = \"move \"+ firstPeopleMoved + \" \" + secondPeopleMoved;\n currentAction += (isLeft) ? \" across\" : \" back\";\n state.copyActions(this);\n state.addActions(currentAction);\n // add to the new states of list\n newStates.add(state);\n }\n\n }\n return newStates;\n }", "private static List<State<StepStateful>> getStates() {\n List<State<StepStateful>> states = new LinkedList<>();\n states.add(s0);\n states.add(s1);\n states.add(s2);\n states.add(s3);\n states.add(s4);\n states.add(s5);\n states.add(s6);\n return states;\n }", "public int numberOfStates();", "protected abstract int numStates();", "public Vector<Integer> mostLikelySequenceOfStates(\n\t\t\tTuple<? extends I> observed ) {\n\n\t\tint length = observed.size( );\n\t\tMatrix<Integer> pointers =\n\t\t\t\tnew DenseMatrix<>( length, core.number_of_states, Integer::sum, -1 );\n\n\t\t/**\n\t\t * [ x s ] -> the probability of the automa to be in state s and the\n\t\t * emission of the first x observed symbols above (given the whole sequence\n\t\t * above/below).\n\t\t */\n\t\tMatrix<Double> probability =\n\t\t\t\tnew DenseMatrix<>( 1 + length, core.number_of_states,\n\t\t\t\t\t\tNumericLogarithm::elnsum2,\n\t\t\t\t\t\tNumericLogarithm.smallLogValue );\n\n\t\tfor ( int t = 0; t < length; t++ ) {\n\n\t\t\t/*\n\t\t\t * For each state s, we must compute the probability of the most probable\n\t\t\t * state sequence responsible for input:0..t that have s as the final\n\t\t\t * state AND that the emission at s is a sequence of symbols with length\n\t\t\t * == gap.\n\t\t\t */\n\t\t\tfor ( int s = 0; s < core.number_of_states; s++ ) {\n\t\t\t\t// for this state, there is a fixed cost, the cost of emission.\n\t\t\t\tdouble cost = emission( s, observed.get( t ) );\n\n\t\t\t\tif ( t > 0 ) {\n\t\t\t\t\tdouble max = 0d;\n\t\t\t\t\tboolean found = false;\n\t\t\t\t\tint best_source = 0;\n\t\t\t\t\tfor ( int input = 0; input < core.number_of_states; input++ ) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * in classic HMM, we would consider only states as they occurred at\n\t\t\t\t\t\t * time t - 1.\n\t\t\t\t\t\t * \n\t\t\t\t\t\t */\n\n\t\t\t\t\t\tdouble tmp = elnproduct( probability.apply( t, input ),\n\t\t\t\t\t\t\t\tcore.transition_table[input][s] );\n\n\t\t\t\t\t\tif ( !found || tmp > max ) {\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tbest_source = input;\n\t\t\t\t\t\t\tmax = tmp;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tpointers.set( t, s, best_source );\n\t\t\t\t\tcost = elnproduct(\n\t\t\t\t\t\t\tcost, probability.apply( t, best_source ),\n\t\t\t\t\t\t\tcore.transition_table[best_source][s] );\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcost = elnproduct( cost, core.initial_table[s] );\n\t\t\t\t}\n\t\t\t\tprobability.set( t + 1, s, cost );\n\n\t\t\t}\n\t\t}\n\n\t\tint best_final_state = 0;\n\t\tdouble final_max = 0d;\n\t\tboolean final_found = false;\n\t\tfor ( int s = 0; s < core.number_of_states; s++ ) {\n\t\t\tDouble tmp = probability.apply( length, s );\n\t\t\tif ( !final_found || tmp > final_max ) {\n\t\t\t\tfinal_found = true;\n\t\t\t\tbest_final_state = s;\n\t\t\t\tfinal_max = tmp;\n\t\t\t}\n\t\t}\n\t\treturn reconstructPath(\n\t\t\t\t( time, state ) -> pointers.apply( time, state ),\n\t\t\t\tlength,\n\t\t\t\tbest_final_state );\n\t}", "private int computeState() {\n int state;\n if (corePd)\n state = 1; //power down state\n else\n state = 2; // core, e.g. crystal on state\n if (!corePd && !biasPd)\n state = 3; // crystal and bias on state\n if (!corePd && !biasPd && !fsPd)\n state = 4; // crystal, bias and synth. on\n if (!corePd && !biasPd && !fsPd && !rxtx && !rxPd)\n state = 5; // receive state\n if (!corePd && !biasPd && !fsPd && rxtx && !txPd)\n state = PA_POW_reg.getPower() + 6;\n return state;\n }", "public int numStates();", "private void buildReachable() {\n // This is a simple search algorithm.\n // It doesn't matter whether it's depth-first or breadth-first.\n this.reachables = new ArrayList<Boolean>();\n for (int n = 0; n < code.size(); n++) {\n this.reachables.add(false);\n }\n\n ArrayDeque<Integer> next = new ArrayDeque<Integer>();\n if (!code.isEmpty()) {\n next.add(0);\n }\n \n while (!next.isEmpty()) {\n int here = next.remove();\n \n if (this.reachables.get(here)) {\n continue;\n }\n this.reachables.set(here, true);\n next.addAll(this.succ(here));\n }\n }", "private void reachable() {\r\n\r\n\t\tSortedSet<String> keys = new TreeSet<String>(vertexMap.keySet());\r\n\t\tIterator it = keys.iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tVertex v = vertexMap.get(it.next());\r\n\t\t\tif (v.isStatus()) {\r\n\t\t\t\tSystem.out.println(v.getName());\r\n\t\t\t\tbfs(v);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void setupDFA() {\r\n\t\tcurrentState = 0;\r\n\t\tif (actor.getScheduleFSM() == null) {\r\n\t\t\t// generate trivial DFA in case there is no schedule fsm.\r\n\t\t\t// 1. only one state\r\n\t\t\t// 2. all actions are eligible\r\n\t\t\t// 3. the successor state is always the same\r\n\t\t\teligibleActions = new Action [][] {actions};\r\n\t\t\tsuccessorState = new int [1] [actions.length];\r\n\t\t\tfor (int i = 0; i < actions.length; i++) {\r\n\t\t\t\tsuccessorState[0][i] = 0;\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tSet stateSets = new HashSet();\r\n\t\t// put initial state into set of state sets\r\n\t\tSet initialState = Collections.singleton(actor.getScheduleFSM().getInitialState());\r\n\t\tstateSets.add(initialState);\r\n\t\tint previousSize = 0;\r\n\t\t// iterate until fixed-point, i.e. we cannot reach any new state set\r\n\t\twhile (previousSize != stateSets.size()) {\r\n\t\t\tpreviousSize = stateSets.size();\r\n\t\t\t// for each action...\r\n\t\t\tfor (int i = 0; i < actions.length; i ++) {\r\n\t\t\t\tSet nextStates = new HashSet();\r\n\t\t\t\t// ... compute the set of states that can be reached through it... \r\n\t\t\t\tfor (Iterator j = stateSets.iterator(); j.hasNext(); ) {\r\n\t\t\t\t\tSet s = (Set) j.next();\r\n\t\t\t\t\tif (isEligibleAction(s, actions[i])) {\r\n\t\t\t\t\t\tnextStates.add(computeNextStateSet(s, actions[i]));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// ... and add them to the state set\r\n\t\t\t\tstateSets.addAll(nextStates);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// The set of all reachable state sets is the state space of the NDA. \r\n\t\tndaStateSets = (Set []) new ArrayList(stateSets).toArray(new Set[stateSets.size()]);\r\n\t\t// Make sure the initial state is state 0.\r\n\t\tfor (int i = 0; i < ndaStateSets.length; i++) {\r\n\t\t\tif (ndaStateSets[i].equals(initialState)) {\r\n\t\t\t\tSet s = ndaStateSets[i];\r\n\t\t\t\tndaStateSets[i] = ndaStateSets[0];\r\n\t\t\t\tndaStateSets[0] = s;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\teligibleActions = new Action [ndaStateSets.length] [];\r\n\t\tsuccessorState = new int [ndaStateSets.length] [];\r\n\t\t// For each state set (i.e. each NDA state), identify the eligible actions,\r\n\t\t// and also the successor state set (i.e. the successor state in the NDA).\r\n\t\tfor (int i = 0; i < ndaStateSets.length; i++) {\r\n\t\t\tList ea = new ArrayList();\r\n\t\t\tList ss = new ArrayList();\r\n\t\t\tfor (int j = 0; j < actions.length; j++) {\r\n\t\t\t\tif (isEligibleAction(ndaStateSets[i], actions[j])) {\r\n\t\t\t\t\tea.add(actions[j]);\r\n\t\t\t\t\tss.add(computeNextStateSet(ndaStateSets[i], actions[j]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\teligibleActions[i] = (Action []) ea.toArray(new Action[ea.size()]);\r\n\t\t\tList ds = Arrays.asList(ndaStateSets); // so we can use List.indexOf()\r\n\t\t\tsuccessorState[i] = new int [ss.size()];\r\n\t\t\t// locta the NDA successor state in array\r\n\t\t\tfor (int j = 0; j < ss.size(); j++) {\r\n\t\t\t\tsuccessorState[i][j] = ds.indexOf(ss.get(j));\r\n\t\t\t\t\r\n\t\t\t\t// must be in array, because we iterated until reaching a fixed point.\r\n\t\t\t\tassert successorState[i][j] >= 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void minimize() {\n D = new boolean[states.length][states.length];\r\n S = new ArrayList<ArrayList<HashSet<Point>>>(); // lol\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int i = 0; i < states.length; i++) {\r\n ArrayList<HashSet<Point>> innerList = new ArrayList<HashSet<Point>>();\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int j = 0; j < states.length; j++) {\r\n Arrays.fill(D[i], false);\r\n innerList.add(new HashSet<Point>());\r\n }\r\n S.add(innerList);\r\n }\r\n\r\n // 2. states with different acceptances are distinguishable\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n if (acceptStates.contains(i) != acceptStates.contains(j)) {\r\n D[i][j] = true;\r\n }\r\n }\r\n }\r\n\r\n // 3. mark as possibly indistinguishable, enforce distinguishability\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n // only pairs that are as of yet indistinguishable\r\n if (D[i][j]) {\r\n continue;\r\n }\r\n\r\n DFAState qi = states[i];\r\n DFAState qj = states[j];\r\n\r\n // one of the things being compared is unreachable\r\n if (qi == null || qj == null) {\r\n continue;\r\n }\r\n\r\n // helps emulate \"for any\"\r\n boolean distinguished = false;\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n // if on the same letter, qm and qn move to distinguishable states\r\n if (D[m][n] || D[n][m]) {\r\n dist(i, j);\r\n distinguished = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!distinguished) {\r\n // qm and qn are indistinguishable\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n if (m < n && !(i == m && j == n)) {\r\n S.get(m).get(n).add(new Point(i, j));\r\n } else if (m > n && !(i == n && j == m)) {\r\n S.get(n).get(m).add(new Point(i, j));\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n mergeStates();\r\n }", "@Override\n\t\tpublic double heuristic() {\n\t\t\tint sum = 0;\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tsum += Math.abs(xGoals[i] - state[i]);\n\t\t\t\tsum += Math.abs(yGoals[i] - state[k + i]);\n\t\t\t}\n\t\t\treturn sum;\n\t\t}", "public abstract int numStates();", "public void optimize(){\n\n NfaState currState;\n HashMap<Integer, State> statesCloned = (HashMap)states.clone();\n\n\n boolean removed;\n\n for(Map.Entry<Integer, State> entry : statesCloned.entrySet()) {//for each state of the nfa\n\n do {\n removed=false;\n Integer id = entry.getKey();\n\n if (states.get(id) == null)//state already been removed\n continue;\n else\n currState = (NfaState) entry.getValue();\n\n HashMap<String, ArrayList<Integer>> startEdges = currState.getOut_edges();\n\n for (Map.Entry<String, ArrayList<Integer>> startEdge : startEdges.entrySet()) {//for each edge of the current state being optimezed\n\n ArrayList<Integer> transactions = new ArrayList(startEdge.getValue());\n\n\n for (Integer state2DegID : transactions) {// for each transaction the 2nd degree state\n NfaState stateDeg2 = (NfaState) states.get(state2DegID);\n\n if (stateDeg2.getOut_edges() == null)\n continue;\n\n\n\n ArrayList<Integer> edgesDeg2 = stateDeg2.getOut_edges().get(EPSILON);\n\n if (edgesDeg2 != null && edgesDeg2.size() == 1 && stateDeg2.getOut_edges().size() == 1) {//if the next state has only a epsilon transaction, we can remove this state\n NfaState successor = (NfaState) states.get(edgesDeg2.get(0));\n\n\n for (Map.Entry<String, ArrayList<Integer>> inEdgesDeg2 : stateDeg2.getIn_edges().entrySet()) {//for every in_edge of the state being removed, update the elements accordingly\n String key = inEdgesDeg2.getKey();\n\n if (inEdgesDeg2.getValue().size() > 0)\n removed = true;\n\n for (Integer stateBeingUpdatedId : inEdgesDeg2.getValue()) {//state to be updated\n NfaState stateBeingUpdated = (NfaState) states.get(stateBeingUpdatedId);\n //add new edge\n stateBeingUpdated.addEdge(key, successor);\n\n //remove out and in edge to intermediate\n stateBeingUpdated.getOut_edges().get(key).remove((Integer) stateDeg2.getId());\n }\n }\n\n //remove out_edges\n for (Map.Entry<String, ArrayList<Integer>> outEdgesDeg2 : stateDeg2.getOut_edges().entrySet()) {\n for (Integer sucId : outEdgesDeg2.getValue()){\n ((NfaState)states.get(sucId)).getIn_edges().get(outEdgesDeg2.getKey()).remove((Integer) stateDeg2.getId());\n }\n }\n //remove state\n states.remove(stateDeg2.getId());\n }\n }\n\n }\n\n }while (removed);\n }\n }", "public State hillClimbing(){\r\n\t\tState currentState = start;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tArrayList<State> successors = currentState.generateNeighbours(currentState);\r\n\t\t\tStatesGenerated= StatesGenerated + successors.size();\r\n\t\t\t\r\n\t\t\tState nextState = null;\r\n\t\t\t\r\n\t\t\tfor(int i=0; i<successors.size(); i++){\r\n\t\t\t\tif(successors.get(i).compareTo(currentState) < 0){\r\n\t\t\t\t\tnextState = successors.get(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(nextState==null)\r\n\t\t\t\treturn currentState;\r\n\t\t\t\r\n\t\t\tcurrentState = nextState;\r\n\t\t}\r\n\t}", "public interface State extends Comparable {\n\n\t/**\n\t * Computes the h value - heuristic grade for this state. This\n\t * method is called only once in the StateImpl class at the moment of\n\t * object creation, the value is stored in an inner variable, and then\n\t * be accessed by getH() method.\n\t *\n\t * @return h value - heuristic grade for this state\n\t */\n\tpublic double computeHeuristicGrade();\n\n\t/**\n\t * Returns the h value - heuristic grade for this state.\n\t *\n\t * @return h value - heuristic grade for this state\n\t */\n\tpublic double getH();\n\n\t/**\n\t * Returns the g value - cost of reaching this state from initial state.\n\t *\n\t * @return g value - cost of reaching this state from initial state\n\t */\n\tpublic double getG();\n\n\t/**\n\t * Sets the g value.\n\t *\n\t * @param aG value to be set\n\t */\n\tpublic void setG(double aG);\n\n\t/**\n\t * Returns the f value - sum of g and h values (f = g + h).\n\t *\n\t * @return f value\n\t */\n\tpublic double getF();\n\n\t/**\n\t * Returns the hash code for this state.\n\t *\n\t * @return hash code for this state\n\t */\n\tpublic String getHashCode();\n\n\t/**\n\t * Returns a list of children of this state (in the search tree).\n\t *\n\t * @return list of children of this state\n\t */\n\tpublic List<State> getChildren();\n\n\t/**\n\t * Sets the reference to the children of this state.\n\t *\n\t * @param aChildren reference to the children to be set\n\t */\n\tpublic void setChildren(List<State> aChildren);\n\n\t/**\n\t * Returns the reference to the parent of this state (in the tree)\n\t * or null if this state is the root.\n\t *\n\t * @return reference to the parent of this state\n\t */\n\tpublic State getParent();\n\n\t/**\n\t * Sets the reference to the parent of this state.\n\t *\n\t * @param aParent reference to the parent of this state to be set\n\t */\n\tpublic void setParent(State aParent);\n\n\t/**\n\t * Returns the boolean showing wether this state is admissible.\n\t * (E.g. in sudoku search some states may be inadmissible, so\n\t * their children should not be considered further.)\n\t *\n\t * @return boolean showing wether this state is admissible\n\t */\n\tpublic boolean isAdmissible();\n\n\t/**\n\t * Useful method for games searching algorithms.\n\t * Returns the string name of the root move (at the top of the\n\t * tree) that led to reaching this state.\n\t *\n\t * @return string representing the root move\n\t */\n\tpublic String getRootMove();\n\n\t/**\n\t * Sets the string name of the root move.\n\t *\n\t * @param aMove string name of the root move to be set.\n\t */\n\tpublic void setRootMove(String aMove);\n\n\t/**\n\t * Returns the guaranteed minimum score (payoff) for the maximizing player.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @return guaranteed minimum score for the maximizing player\n\t */\n\tpublic double getAlpha();\n\n\t/**\n\t * Sets the new value for alpha.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @aAlpha new value to be set\n\t */\n\tpublic void setAlpha(double aAlpha);\n\n\t/**\n\t * Returns the guaranteed maximum score (loss) for the minimizing player.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @return guaranteed maximum score for the minimizing player\n\t */\n\tpublic double getBeta();\n\n\t/**\n\t * Sets the new value for beta.\n\t * (Used only in games search searching algorithms.)\n\t *\n\t * @aBeta new value to be set\n\t */\n\tpublic void setBeta(double aBeta);\n\n\t/**\n\t * Returns the depth property (how deep in the tree is this state).\n\t *\n\t * @return depth property\n\t */\n\tpublic double getDepth();\n\n\t/**\n\t * Sets the depth property.\n\t *\n\t * @param aDepth depth value to be set\n\t */\n\tpublic void setDepth(double aDepth);\n\n public boolean isSolved();\n}", "private List<GlobalState> generateGlobalStates(List<Node> nodes) {\n // Creating a list of global states with an empty state\n List<GlobalState> gStates = new ArrayList();\n gStates.add(new GlobalState(nodes,binding));\n \n // Generating all possible global states\n for(Node n : nodes) {\n // Generating a new list of global states by adding a new pair\n // for each state of current node to those already generated\n List<GlobalState> newGStates = new ArrayList();\n for(String s : n.getProtocol().getStates()) {\n for(GlobalState g : gStates) {\n GlobalState newG = new GlobalState(nodes,binding);\n newG.addMapping(g);\n newG.addMapping(n.getName(),s);\n newGStates.add(newG);\n }\n }\n // Updating the list of global states with the new one\n gStates = newGStates;\n }\n return gStates;\n }", "public boolean removeDeadTransitions() throws Exception{\n \tArrayList<Integer> st=new ArrayList<Integer>(getStates());//st fixes some arbitrary order of states\n \tboolean [][] canReach=buildConnectionMatrix(st);\n\n \t//collect reachable states\n \tStack<Integer> worklist=new Stack<Integer>();\n \tHashSet<Integer> reachableStates=new HashSet<Integer> ();\n \tfor(String var:pointers.keySet())\n \t\tworklist.push(st.indexOf(pointers.get(var)));\n \twhile(!worklist.empty()){\n \t\tint cur=worklist.pop();\n \t\treachableStates.add(st.get(cur));\n \t\tfor(int i=0;i<st.size();i++)\n \t\t\tif(canReach[cur][i]&&!worklist.contains(i)&&!reachableStates.contains(st.get(i)))\n \t\t\t\tworklist.push(i);\n \t}\n \t//remove unreachable states\n \tboolean hasUnreachableNonReferenceStates=false;//might still be a useless state\n \tfor(TreeAutomaton ta:lt){\n \tHashSet<Integer> toRemove=new HashSet<Integer>();\n \t\tfor(int s:ta.getStates())\n \t\t\tif(!reachableStates.contains(s)){\n \t\t\t\ttoRemove.add(s);\n \t\t\t}\n \tfor(int s:toRemove){\n\t\t\t\tif(!ta.isReferenceTo(s, NULL)&&!ta.isReferenceTo(s, UNDEF)&&ta.referenceTo(s)==-1)\n\t\t\t\t\thasUnreachableNonReferenceStates=true;\n \t\t\tta.removeState(s);\n \t}\n \t}\n \treturn hasUnreachableNonReferenceStates;\n }", "@Override\n\tpublic double stateEvaluator(GameState s)\n\t{\r\n\t\tint count = 0;\n\t\tif (s.takenList[1] == 0)\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\telse if(s.lastMove == 1)\r\n\t\t{\r\n\t\t\tfor (int i = 1; i < s.takenList.length ; i++)\r\n\t\t\t{\r\n\t\t\t\tif (s.takenList[i] == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (count % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\treturn -0.5;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\treturn 0.5;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (isPrime(s.lastMove))\r\n\t\t{\r\n\t\t\tfor (int i = 1; i < s.takenList.length; i++)\r\n\t\t\t{\r\n\t\t\t\tif (s.takenList[i] == 0 && i % s.lastMove == 0) // i = 4, % 2\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (count % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\treturn -0.7;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn 0.7;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tint largestPrime = 2;\r\n\t\t\tfor (int i = 2; i < (s.lastMove/2); i++)\r\n\t\t\t{\r\n\t\t\t\tif (s.lastMove % i == 0 && isPrime(i))\r\n\t\t\t\t{\r\n\t\t\t\t\tlargestPrime = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = largestPrime; i <= s.lastMove; i+= largestPrime)\r\n\t\t\t{\r\n\t\t\t\tif (s.takenList[i] == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (count % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\treturn -0.6;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\treturn 0.6;\r\n\t\t\t}\r\n\r\n\t\t}\n\t}", "public static void getInitialStates(int rows, int cols, int [][] states){\n // Create a 2d array for initial state of cells\n states = new int[rows][cols];\n Random rand = new Random();\n int random = rand.nextInt();\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n if (random%100 <= 100*NUM_CELLS/(rows*cols)){\n states[i][j] = 1;\n }\n else{\n states[i][j] = 0;\n }\n }\n }\n }", "public List<S> getAvailableStates();", "public Vector<PuzzleState> aStarSearch() {\r\n System.out.println(\"Starting A*\");\r\n long startTime = (new Date()).getTime();\r\n Vector<PuzzleState> solution = new Vector<PuzzleState>();\r\n HashSet<PuzzleState> closedList = new HashSet<PuzzleState>();\r\n PriorityQueue<PuzzleState> openList = new PriorityQueue<PuzzleState>();\r\n \r\n PuzzleState searchState = state.copy();\r\n searchState.prevState = null;\r\n searchState.depth = 0;\r\n openList.add(searchState);\r\n\r\n while (!openList.isEmpty() && !isGoal(searchState)) {\r\n searchState = openList.poll();\r\n if (!closedList.contains(searchState)) {\r\n closedList.add(searchState);\r\n Vector<PuzzleState> nextStates = possibleNextStates(searchState);\r\n for (PuzzleState s : nextStates)\r\n s.depth = searchState.depth + 1;\r\n openList.addAll(nextStates);\r\n }\r\n }\r\n \r\n // If the goal has been reached, construct the solution\r\n if (isGoal(searchState)) {\r\n for (PuzzleState s = searchState; s.prevState != null; s = s.prevState) {\r\n solution.add(s);\r\n }\r\n Collections.reverse(solution);\r\n }\r\n \r\n long endTime = (new Date()).getTime();\r\n System.out.println(\"A* search ended after \" + (endTime - startTime) + \" ms\");\r\n //for (PuzzleState s : solution)\r\n // System.out.println(s);\r\n return solution;\r\n }", "@Test\n public void genStateTransferMetric() {\n TreeMap<String, Integer> stat = new TreeMap<>();\n int currState = 8;\n for (int i = 1; i < numSteps; i++) {\n int nextStates = getNextState(currState);\n stat.compute(currState + \"-\" + nextStates, (k, v) -> v == null ? 1 : v + 1);\n currState = nextStates;\n }\n stat.forEach((k, v) -> System.out.printf(\"%s:%f\\n\", k.replace('-', ':'), (double) v / numSteps));\n }", "public WumpusState wellItsDarkNow(GameTile[][] visibleMap) {\r\n\t\tQueue<WumpusState> queue = new LinkedList<WumpusState>();\r\n\t\tHashMap<String, Boolean> visitedStates = new HashMap<String, Boolean>();\t\r\n\t\tWumpusState state = new WumpusState(visibleMap, playerX, playerY);\r\n\t\tlong nodesExpanded = 0;\r\n\t\tqueue.add(state);\r\n\t\tif(state.getParent()!=null) {\t\r\n\t\t\tqueue.add(state.getParent());\r\n\t\t}\r\n\t\twhile(!queue.isEmpty()) {\r\n\t\t\tWumpusState currentState = queue.remove();\r\n\t\t\tSystem.out.println(currentState.toString());\r\n\t\t\t\r\n\t\t\tif(currentState.getGoldCollected()) {\r\n\t\t\t\tArrayList<AgentAction> actions = currentState.getAllActions();\r\n\t\t\t\tfor(int i=1;i<actions.size(); i++) {\r\n\t\t\t\t\tSystem.out.println(\"gold\");\r\n\t\t\t\t\tSystem.out.println(actions.get(i));\r\n\t\t\t\t\tnextMoves.add(actions.get(i));\r\n\t\t\t\t}\r\n\t\t\t\tgoldCollected = true;\r\n\t\t\t\treturn currentState;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(currentState.spaceNotVisited()) {\r\n\t\t\t\tArrayList<AgentAction> actions = currentState.getAllActions();\r\n\t\t\t\tfor(int i=1;i<actions.size(); i++) {\r\n\t\t\t\t\tSystem.out.println(\"null\");\r\n\t\t\t\t\tSystem.out.println(actions.get(i));\r\n\t\t\t\t\tnextMoves.add(actions.get(i));\r\n\t\t\t\t}\r\n\t\t\t\treturn currentState;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(visitedStates.containsKey(currentState.toString())) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvisitedStates.put(currentState.toString(), true);\r\n\t\t\t\tWumpusState[] childrenOfCurrentChild = currentState.generateChildrenStates();\r\n\t\t\t\tfor(int j=0; j<childrenOfCurrentChild.length; j++) {\r\n\t\t\t\t\tif(childrenOfCurrentChild[j]!=null) {\r\n\t\t\t\t\t\tqueue.add(childrenOfCurrentChild[j]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tgoldCollected = true;\r\n\t\treturn state;\r\n\t\t\r\n\t}", "@Override\n public ArrayList<AState> getAllPossibleStates(AState state){\n MazeState s = (MazeState)state;\n ArrayList<AState> moves = new ArrayList<AState> ();\n\n\n int row = s.getState().getRowIndex();\n int col = s.getState().getColumnIndex();\n int [][] matrix = mySearchableMaze.getMazeMatrix();\n\n\n if(row+1 < matrix.length){\n if( matrix[row+1][col]==0 ){\n moves.add(new MazeState(new Position(row+1,col),false,s.getCost()+1));\n\n }\n }\n if(row-1 >= 0 ){\n if( matrix[row-1][col]==0){\n moves.add(new MazeState(new Position(row-1,col),false,s.getCost()+1));\n\n }\n }\n if(col+1 < matrix[0].length ){\n if( matrix[row][col+1]==0 ){\n moves.add(new MazeState(new Position(row,col+1),false,s.getCost()+1));\n\n }\n }\n if(col-1 >= 0 ){\n if( matrix[row][col-1]==0 ){\n moves.add(new MazeState(new Position(row,col-1),false,s.getCost()+1));\n }\n }\n return moves;\n }", "private Map<State, State> equivalentStates() {\n\t\tMap<State, State> prevEcc = new HashMap<State, State>();\n\t\tMap<State, State> ecc = new HashMap<State, State>();\n\t\t\n\t\t/*\n\t\t * We will represent each equivalence classes with a representative member and\n\t\t * use a dictionary to map each state to this representative.\n\t\t * \n\t\t * First we create two equivalence classes, put all the accepting states in the\n\t\t * first and all the non accepting states in the second.\n\t\t */\n\n\t\tif (!this.acceptingStates.isEmpty()) {\n\t\t\tState rep = this.acceptingStates.iterator().next();\n\t\t\tfor (State state : this.acceptingStates) {\n\t\t\t\tecc.put(state, rep);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSet<State> nonAcceptingStates = new HashSet<State>(this.states);\n\t\tnonAcceptingStates.removeAll(this.acceptingStates);\n\t\t\n\t\tif (!nonAcceptingStates.isEmpty()) {\n\t\t\tState rep = nonAcceptingStates.iterator().next();\n\t\t\tfor (State state : nonAcceptingStates) {\n\t\t\t\tecc.put(state, rep);\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t * The invariant for the following loop is:\n\t\t\t * \n\t\t\t * 1. for any s -> r association in ecc, s is equivalent to r in prevEcc, 2. for\n\t\t\t * any input symbol c, the destination of the transition from s on c is\n\t\t\t * equivalent (in prevEcc) to the destiation of the transition from r to c, 3.\n\t\t\t * for any two values r1, r2 in ecc, they are not equivalent to each other in\n\t\t\t * prevEcc, 4. all the equivalence classes in prevEcc have a representative in\n\t\t\t * ecc.\n\t\t\t * \n\t\t\t */\n\t\t\t\n\t\t}\n\t\twhile (!prevEcc.equals(ecc)) {\n\t\t\t\n\t\t\tprevEcc = ecc;\n\t\t\t\n\t\t\tecc = new HashMap<State, State>();\n\n\t\t\t/*\n\t\t\t * To establish the invariant we will set ecc with the associations of the form\n\t\t\t * \n\t\t\t * r -> r where r is a representative from prevEcc.\n\t\t\t * \n\t\t\t * This will initially satisfy the invariant because our action establishes\n\t\t\t * condition (4) and conditions (1) and (2) and (3) are correct by induction\n\t\t\t * from the validity of prevEcc.\"\n\t\t\t */\n\t\t\tfor (State state : prevEcc.values()) {\n\t\t\t\tecc.put(state, state);\n\t\t\t}\n\t\t\tfor (State state : this.states) {\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * For each state s, we look in ecc for a rep r that is equivalent to s in\n\t\t\t\t * prevEcc (that is, s's rep in prevEcc is r and for every input they transition\n\t\t\t\t * to the same equivalence class in prevEcc) and add s to ecc with the same\n\t\t\t\t * equivalence rep. If no state is equivalent to s, we add s to ecc as its own\n\t\t\t\t * rep.\n\t\t\t\t */\n\n\t\t\t\tIterator<State> p = ecc.keySet().iterator();\n\t\t\t\tState rep = null;\n\t\t\t\tboolean equivalent = false;\n\t\t\t\twhile (p.hasNext() && !equivalent) {\n\t\t\t\t\trep = (State) p.next();\n\t\t\t\t\tequivalent = this.equivalentIn(prevEcc, state, rep);\n\t\t\t\t}\n\t\t\t\tif (equivalent) {\n\t\t\t\t\tecc.put(state, rep);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tecc.put(state, state);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ecc;\n\t\t\n\t}", "public State[] getSuccessors(State curr) {\n State [] successors = new State [6];\r\n \r\n if(currjug1!=0) {\r\n //e1\r\n successors[0] = new State(capjug1, capjug2, 0, currjug2, goal,depth);\r\n successors[0].parentPt = curr;\r\n successors[0].depth = curr.depth+1;\r\n //p12\r\n int pour = pour(currjug1, currjug2, capjug2);\r\n successors[1] = new State(capjug1, capjug2, currjug1-pour, currjug2+pour, goal,depth);\r\n successors[1].parentPt = curr;\r\n successors[1].depth = curr.depth+1;\r\n }\r\n \r\n if(currjug2!=0) {\r\n //e2\r\n successors[2] = new State(capjug1, capjug2, currjug1, 0, goal,depth);\r\n successors[2].parentPt = curr;\r\n successors[2].depth = curr.depth+1;\r\n }\r\n \r\n //f2\r\n successors[3] = new State(capjug1, capjug2, currjug1, capjug2, goal,depth);\r\n successors[3].parentPt = curr;\r\n successors[3].depth = curr.depth+1;\r\n \r\n if(currjug2!=0) {\r\n //p21\r\n int pour = pour(currjug2, currjug1, capjug1);\r\n successors[4] = new State(capjug1, capjug2, currjug1+pour, currjug2-pour, goal,depth);\r\n successors[4].parentPt = curr;\r\n successors[4].depth = curr.depth+1;\r\n }\r\n \r\n //f1\r\n successors[5] = new State(capjug1, capjug2, capjug1, currjug2, goal,depth);\r\n successors[5].parentPt = curr;\r\n successors[5].depth = curr.depth+1;\r\n \r\n return successors;\r\n }", "public List<MclnState> getAvailableStates();", "double getBranchProbability();", "public abstract double getHeuristic(State state);", "BGPv4FSMState state();", "private byte[] calculateAllPossibleOutboundStates(byte state, byte[] allPossible){\n int stateNumParticles = calcNumParticlesInState(state);\n int[] stateMomentum = calculateMomentum(state);\n ArrayList<Byte> possibleStates = new ArrayList<>();\n for(byte poss:allPossible){\n int possNumPart = calcNumParticlesInState(poss);\n if(possNumPart==stateNumParticles){\n int[] possMomentum = calculateMomentum(poss);\n if(compareMomenta(possMomentum, stateMomentum)){\n possibleStates.add(poss);\n }\n }\n }\n byte[] ret = new byte[possibleStates.size()];\n int i = 0;\n for(Byte b:possibleStates){\n ret[i++] = b.byteValue();\n }\n return ret;\n }", "private Collection<Node> getCandidates(State state) {\n\t\treturn new ArrayList<Node>(Basic_ILS.graph.getNodes());\n\t}", "private Collection<? extends AbstractState> getFollowStates(AutomatonState state, List<AbstractState> otherElements, CFAEdge edge, boolean failOnUnknownMatch) throws CPATransferException {\n Preconditions.checkArgument(!(state instanceof AutomatonUnknownState));\n if (state == cpa.getBottomState()) {\n //return Collections.singleton(state);\n return Collections.emptySet();\n }\n\n if (state.getInternalState().getTransitions().isEmpty()) {\n // shortcut\n return Collections.singleton(state);\n }\n\n Collection<AbstractState> lSuccessors = new HashSet<AbstractState>(2);\n AutomatonExpressionArguments exprArgs = new AutomatonExpressionArguments(state.getVars(), otherElements, edge, logger);\n boolean edgeMatched = false;\n boolean nonDetState = state.getInternalState().isNonDetState();\n\n // these transitions cannot be evaluated until last, because they might have sideeffects on other CPAs (dont want to execute them twice)\n // the transitionVariables have to be cached (produced during the match operation)\n // the list holds a Transition and the TransitionVariables generated during its match\n List<Pair<AutomatonTransition, Map<Integer, String>>> transitionsToBeTaken = new ArrayList<Pair<AutomatonTransition, Map<Integer, String>>>(2);\n\n for (AutomatonTransition t : state.getInternalState().getTransitions()) {\n exprArgs.clearTransitionVariables();\n\n matchTime.start();\n ResultValue<Boolean> match = t.match(exprArgs);\n matchTime.stop();\n if (match.canNotEvaluate()) {\n if (failOnUnknownMatch) {\n throw new CPATransferException(\"Automaton transition condition could not be evaluated: \" + match.getFailureMessage());\n }\n // if one transition cannot be evaluated the evaluation must be postponed until enough information is available\n return Collections.singleton(new AutomatonUnknownState(state));\n } else {\n if (match.getValue()) {\n edgeMatched = true;\n assertionsTime.start();\n ResultValue<Boolean> assertionsHold = t.assertionsHold(exprArgs);\n assertionsTime.stop();\n\n if (assertionsHold.canNotEvaluate()) {\n if (failOnUnknownMatch) {\n throw new CPATransferException(\"Automaton transition assertions could not be evaluated: \" + assertionsHold.getFailureMessage());\n }\n // cannot yet be evaluated\n return Collections.singleton(new AutomatonUnknownState(state));\n\n } else if (assertionsHold.getValue()) {\n if (!t.canExecuteActionsOn(exprArgs)) {\n if (failOnUnknownMatch) {\n throw new CPATransferException(\"Automaton transition action could not be executed\");\n }\n // cannot yet execute, goto UnknownState\n return Collections.singleton(new AutomatonUnknownState(state));\n }\n\n // delay execution as described above\n Map<Integer, String> transitionVariables = ImmutableMap.copyOf(exprArgs.getTransitionVariables());\n transitionsToBeTaken.add(Pair.of(t, transitionVariables));\n\n } else {\n // matching transitions, but unfulfilled assertions: goto error state\n AutomatonState errorState = AutomatonState.automatonStateFactory(Collections.<String, AutomatonVariable>emptyMap(), AutomatonInternalState.ERROR, cpa);\n logger.log(Level.INFO, \"Automaton going to ErrorState on edge \\\"\" + edge.getDescription() + \"\\\"\");\n lSuccessors.add(errorState);\n }\n\n if (!nonDetState) {\n // not a nondet State, break on the first matching edge\n break;\n }\n }\n // do nothing if the edge did not match\n }\n }\n\n if (edgeMatched) {\n // execute Transitions\n for (Pair<AutomatonTransition, Map<Integer, String>> pair : transitionsToBeTaken) {\n // this transition will be taken. copy the variables\n AutomatonTransition t = pair.getFirst();\n Map<Integer, String> transitionVariables = pair.getSecond();\n actionTime.start();\n Map<String, AutomatonVariable> newVars = deepCloneVars(state.getVars());\n exprArgs.setAutomatonVariables(newVars);\n exprArgs.putTransitionVariables(transitionVariables);\n t.executeActions(exprArgs);\n actionTime.stop();\n AutomatonState lSuccessor = AutomatonState.automatonStateFactory(newVars, t.getFollowState(), cpa);\n //if (!(lSuccessor instanceof AutomatonState.BOTTOM)) {\n lSuccessors.add(lSuccessor);\n //} // else add nothing\n }\n return lSuccessors;\n } else {\n // stay in same state, no transitions to be executed here (no transition matched)\n return Collections.singleton(state);\n }\n }", "public static ArrayList genStates(){\n ArrayList states = new ArrayList(44);\n List<String> notes = new ArrayList<String>(Arrays.asList(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\"));\n List<String> beat = new ArrayList<String>(Arrays.asList(\"1\",\"2\",\"3\",\"4\"));\n //List<String> dot = new ArrayList<String>(Arrays.asList(\"1\",\"0\"));\n for(int n = 0; n<=10; n++){\n for(int b = 0; b<=3; b++){\n //for(int d = 0; d<=1; d++){\n String state = \"\"; \n state += notes.get(n);\n state += beat.get(b);\n //state += dot.get(d);\n states.add(state);\n //}\n }\n }\n return states;\n }", "int nParametricStates();", "public States states();", "@Override\n public int numStatesExplored(){\n return numstatesexplored;\n }", "private void calculateStatesStatesPruning(int iNode1, int iNode2, int iNode3) {\n\t\t// prepare the stack\n\t\tm_nOperation[m_nTopOfStack] = OPERATION_SS;\n\t\tif (m_fPartials[m_iCurrentPartials[iNode1]][iNode1] != null && m_fPartials[m_iCurrentPartials[iNode2]][iNode2] != null) {\n\t\t\t// for handling ambiguities\n\t\t\tm_nOperation[m_nTopOfStack] = OPERATION_PP;\n\t\t}\n\t\t\n\t\tm_nNode1[m_nTopOfStack] = iNode1;\n\t\tm_nNode2[m_nTopOfStack] = iNode2;\n\t\tm_nNode3[m_nTopOfStack] = iNode3;\n\t\tm_nTopOfStack++;\n\t}", "private Map<Long, Boolean> searchPaths(Context context, Long initialStateId,\n Long destinationStateId, Map<Long, Boolean> visitedStateIds,\n Map<Long, String> stateOutputEvents) {\n\n Queue<LinkedList<Long>> queueOfPaths = new LinkedList<>();\n LinkedList<Long> currentPath = new LinkedList<>();\n\n currentPath.add(initialStateId);\n queueOfPaths.add(currentPath);\n\n Set<Long> nextDependentStateIds;\n\n while (queueOfPaths.size() != 0) {\n currentPath = queueOfPaths.poll();\n Long lastStateId = currentPath.getLast();\n\n if(lastStateId.equals(destinationStateId)) {\n for (Long stateId : currentPath) {\n visitedStateIds.put(stateId, Boolean.TRUE);\n }\n continue;\n }\n\n nextDependentStateIds = context.getDependentStateIds(stateOutputEvents.get(lastStateId));\n for (Long dependentStateId : nextDependentStateIds) {\n if(!currentPath.contains(dependentStateId)) {\n LinkedList<Long> newPath = new LinkedList<>();\n newPath.addAll(currentPath);\n newPath.add(dependentStateId);\n queueOfPaths.add(newPath);\n }\n }\n }\n return visitedStateIds;\n }", "public S getRandomState();", "public Object[] getPiAndTangibleStates(PetriNetView sourceDataLayer) throws OutOfMemoryError, MarkingNotIntegerException {\n\t\tObject result[] = new Object[2];\n\t\tFile reachabilityGraph = new File(\"results.rg\");\n\t\ttry {\n\t\t\tStateSpaceGenerator.generate(sourceDataLayer, reachabilityGraph,\n\t\t\t\t\tnull);\n\t\t\tresult[0] = SteadyStateSolver.solve(reachabilityGraph);\n\t\t\tresult[1] = new StateList(reachabilityGraph, false);\n\t\t} catch (StateSpaceTooBigException e) {\n\t\t\tSystem.out.println(e);\n\t\t\treturn null;\n\t\t} catch (TimelessTrapException e) {\n\t\t\tSystem.out.println(e);\n\t\t\treturn null;\n\t\t} catch (ImmediateAbortException e) {\n\t\t\tSystem.out.println(e);\n\t\t\treturn null;\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t\treturn null;\n\t\t}\n\n\t\treturn result;\n\t}", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "static int[] getState(Node root){\n if(root==null)\n return new int[]{Integer.MAX_VALUE, Integer.MIN_VALUE,0,0};\n\n int[] leftAns = getState(root.left);\n int[] rightAns = getState(root.right);\n\n if(root.val<leftAns[1] || root.val> rightAns[0]){\n //failed\n return new int[]{Integer.MAX_VALUE, Integer.MIN_VALUE,-1, Math.max(leftAns[3], rightAns[3])};\n }\n else {//(root.val>leftAns[1] && root.val<rightAns[0]){\n\n return new int[] { Math.min(leftAns[0], root.val), Math.max(rightAns[1], root.val) , leftAns[2]+rightAns[2]+1, Math.max(leftAns[2]+rightAns[2]+1,\n Math.max(leftAns[3], rightAns[3])) };\n\n }\n\n\n }", "public void randomizeState() {\n\t\t//System.out.print(\"Randomizing State: \");\n\t\tArrayList<Integer> lst = new ArrayList<Integer>();\n\t\tfor(int i = 0; i<9; i++)// adds 0-8 to list\n\t\t\tlst.add(i);\n\t\tCollections.shuffle(lst);//randomizes list\n\t\tString str=\"\";\n\t\tfor(Integer i : lst)\n\t\t\tstr += String.valueOf(i);\n\t\t//System.out.println(str);\n\t\tcurrent = new PuzzleState(str,current.getString(current.getGoalState()));\n\t\t//pathCost++;\n\t}", "public List<String> getSequentialPlan() {\n // ==========================================\n // Computing the (cheapest) sequence of steps\n // ==========================================\n \n // Maps of steps and cost from the global state s to the others\n Map<GlobalState,List<Step>> steps = new HashMap();\n steps.put(current,new ArrayList());\n Map<GlobalState,Integer> costs = new HashMap();\n costs.put(current,0);\n // List of visited states\n List<GlobalState> visited = new ArrayList();\n visited.add(current);\n\n // List of global states still to be visited\n List<GlobalState> toBeVisited = new ArrayList();\n \n // Adding the states reachable from start to \"toBeVisited\"\n for(Step step : current.getSteps()) {\n GlobalState next = step.getNextGlobalState();\n // Adding the sequence of operations towards \"next\" \n List<Step> stepSeq = new ArrayList();\n stepSeq.add(step);\n steps.put(next,stepSeq);\n // Adding the cost of the sequence of operation towards \"next\"\n costs.put(next,step.getCost());\n toBeVisited.add(next);\n }\n \n // Exploring the graph of global states by exploiting \"toBeVisited\"\n while(toBeVisited.size() > 0) {\n // Removing the first global state to be visited and marking it\n // as visited\n GlobalState current = toBeVisited.remove(0);\n visited.add(current);\n \n for(Step step : current.getSteps()) {\n GlobalState next = step.getNextGlobalState();\n // Adding the sequence of operations from \"start\" to \"next\"\n // (if more convenient)\n int nextCost = costs.get(current) + step.getCost();\n if(visited.contains(next)) {\n // If current path is cheaper, updates \"steps\" and \"costs\"\n if(costs.get(next) > nextCost) {\n List<Step> stepSeq = new ArrayList();\n stepSeq.addAll(steps.get(current));\n stepSeq.add(step);\n steps.put(next,stepSeq);\n costs.put(next,nextCost);\n }\n } else {\n List<Step> stepSeq = new ArrayList();\n stepSeq.addAll(steps.get(current));\n stepSeq.add(step);\n steps.put(next,stepSeq);\n costs.put(next, nextCost);\n if(!(toBeVisited.contains(next))) toBeVisited.add(next);\n }\n }\n }\n \n // ====================================================\n // Computing the sequence of operations from \"s\" to \"t\"\n // ====================================================\n // If no plan is available, return null\n if(steps.get(target) == null) \n return null;\n // Otherwise, return the corresponding sequence of operations\n List<String> opSequence = new ArrayList();\n for(Step step : steps.get(target)) {\n if(!(step.getReason().contains(Step.handling))) {\n opSequence.add(step.getReason());\n }\n }\n return opSequence;\n }", "public void newRandomPuzzle() {\r\n // Start with the goal state\r\n state = goal.copy();\r\n HashSet<PuzzleState> visitedStates = new HashSet<PuzzleState>();\r\n visitedStates.add(state.copy());\r\n System.out.println(state);\r\n \r\n Vector<PuzzleState> aStarSolution = null;\r\n int numMovesLeft = this.minMoves;\r\n while (numMovesLeft > 0) {\r\n for (int move = 0; move < numMovesLeft; move++) {\r\n // Get all the possible next states\r\n Vector<PuzzleState> nextStates = possibleNextStates(state);\r\n \r\n // Randomly pick a new state until it is not one we have seen before\r\n PuzzleState next;\r\n do {\r\n next = nextStates.get(rand.nextInt(nextStates.size()));\r\n } while (visitedStates.contains(next));\r\n \r\n // Update the state and add it to the set of visited states\r\n state = next;\r\n visitedStates.add(state.copy());\r\n System.out.println(\"New state:\");\r\n System.out.println(state);\r\n }\r\n aStarSolution = aStarSearch();\r\n int minMovesAStar = aStarSolution.size();\r\n numMovesLeft = this.minMoves - minMovesAStar;\r\n System.out.println(\"num moves left: \" + numMovesLeft);\r\n }\r\n solution = aStarSolution;\r\n }", "public static int getStartState() {\n int startState = 1;\n int n = 1;\n for (int i = 2; i <= state; i ++) {\n if (stateList.get(i).getN1() == n || stateList.get(i).getN2() == n) {\n startState = i;\n n = i;\n }\n }\n return startState;\n }", "@Override\n\t//loc1 is the start location,loc2 is the destination\n\tpublic ArrayList<MapCoordinate> bfsSearch(MapCoordinate loc1, MapCoordinate loc2, Map m) {\n\t\tSystem.out.println(\"come into bfsSearch\");\n\t\tif(m.isAgentHasAxe() && m.isAgentHasKey()){\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\t//Visited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation()); //add to visited every loop\n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0,s.getLocation()); //add to head\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move east\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){ //this is important else if(cTemp!='~'), not barely else,\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move north\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' &&s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\treturn null;\n\t\t}else if(m.isAgentHasAxe()){ //only have axe\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\t//Visited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation()); //add visited every loop\n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0,s.getLocation()); //add to head\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move north\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}else if(m.isAgentHasKey()){ //only have key\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\t//Visited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation());\n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0, s.getLocation()); //add to head,in this fashion, return the right order of route\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY()); \n\t\t\t\tif(m.hasCoordinate(temp)){//state move east\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY()); //state that move west\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1); //state move north\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1); //state move south\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t\n\t\t/*\n\t\t * \n\t\t **/\t\t\n\t\telse{ //have no key and axe\n\t\t\tSystem.out.println(\"come into the last elas clause\");\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\tVisited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\t//int i=0;\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\t//i++;\n\t\t\t\t//System.out.println(\"come into while: \"+i);\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation()); //add visited, let program won't stuck in \n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tSystem.out.println(\"return computed route\");\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0, s.getLocation()); //add to head\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\tfor(MapCoordinate mc:route){\n\t\t\t\t\t\t//System.out.println(\"print returned route in bfssearch\");\n\t\t\t\t\t\tSystem.out.print(\"mc:\"+mc.getX()+\" \"+mc.getY()+\"->\");\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\t//System.out.println(\"1 if\");\n\t\t\t\t\tif(s.getPrevState()!=null &&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if\");\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 if\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 if\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 else\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.add(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tSystem.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1);\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*'&&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1);\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}//do not do any action for not enough stones situation\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}//do not do any action for not enough stones situation\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\n\tpublic LabelledTransitionSystem apply(LabelledTransitionSystem s) {\n\n\t\tPreconditions.checkNotNull(s, \"The automaton to be considered cannot be null\");\n\t\tLabelledTransitionSystem ret = s.myclone();\n\n\t\tSet<Integer> states = this.getStatesFromWichReachableAccepting(ret);\n\n\t\tlogger.debug(\"States from which an accepting state can be reached: \" + states);\n\n\t\tSet<Integer> allStates = new HashSet<>();\n\t\tfor (int i = 0; i < ret.getNumberOfStates(); i++) {\n\t\t\tallStates.add(i);\n\t\t}\n\t\tallStates.removeAll(states);\n\t\tlogger.debug(\"States from which an accepting state can not be reached: \" + allStates);\n\n\t\tret.removeStates(allStates);\n\n\t\treturn ret;\n\t}", "State(int[][] startBoardState, int [][] goalBoardState){\n this.currentBoardState = startBoardState;\n this.goalBoardState = goalBoardState;\n this.g_cost = 0;\n this.parentState = null;\n }", "public int conflicts() {\n int total = 0;\n int dist;\n if (!isValid()) return 0;\n for (int r = 0; r < Board.dim; r++) {\n int row = r*Board.dim; \n for (int i = row; i < row + Board.dim; i++)\n for (int j = i + 1; j < row + Board.dim; j++) \n if (Board.rowOf[state[i]] == r && \n Board.rowOf[state[j]] == r &&\n state[i] != 0 && state[j] != 0 &&\n state[i] > state[j])\n total = total + 1;\n }\n for (int col = 0; col < Board.dim; col++) \n for (int i = col; i < state.length - Board.dim; i+= Board.dim) {\n for (int j = i + Board.dim; j < state.length; j+= Board.dim) \n if (Board.colOf[state[i]] == col &&\n Board.colOf[state[j]] == col &&\n state[i] != 0 && state[j] != 0 &&\n state[i] > state[j])\n total = total + 1;\n } \n return total; \n }", "public int hamming() { \n int total = 0;\n for (int n = 0; n < state.length; n++) \n if (state[n] != 0 && state[n] != n) total++;\n return total;\n }", "Collection<I_GameState> getRepeatStates(final BiPredicate<I_GameState, I_GameState> predicate);", "public int getStates() {\n return states;\n }", "public int[] getBestStateSequence(){\r\n int endTime=o.length;\r\n int N=hmm.stateCount;\r\n double delta[][]=new double[endTime+1][N];\r\n int phi[][]=new int[endTime+1][N];\r\n\r\n for (int i=0;i<N;++i) delta[0][i]=hmm.pi[i];\r\n for (int t=1;t<=endTime;++t) {\r\n for (int i = 0; i < N; ++i) {\r\n for (int j = 0; j < N; ++j) {\r\n //transfer from j to i\r\n double tmp = delta[t - 1][j] * hmm.a[j][i] * hmm.b[j][i][o[t - 1]];\r\n if (tmp > delta[t][i]) {\r\n delta[t][i] = tmp;\r\n phi[t][i] = j;\r\n }\r\n }\r\n }\r\n }\r\n\r\n int ret[]=new int[endTime+1];\r\n for (int i=0;i<N;++i) {\r\n if (delta[endTime][i]>delta[endTime][ret[endTime]]) ret[endTime]= i;\r\n }\r\n for (int t=endTime-1;t>=0;--t){\r\n ret[t]=phi[t+1][ret[t+1]];\r\n }\r\n return ret;\r\n }", "public static Set<ARGState> getOnePathToARGStateForSimpleProperty(ARGState source, ARGState destination) {\n Set<Integer> seenElements = new HashSet<Integer>();\n ARGState currentARGState = source;\n seenElements.add(source.getStateId());\n List<ARGState> path = new ArrayList<ARGState>();\n path.add(currentARGState);\n // Set<ARGState> result = new HashSet<ARGState>();\n while (currentARGState.getStateId() != destination.getStateId()) {\n boolean end = true;\n if (!currentARGState.getChildren().isEmpty()) {\n Iterator<ARGState> children = currentARGState.getChildren().iterator();\n ARGState childrenElement ;\n do {\n childrenElement = children.next();\n if (!seenElements.contains(childrenElement.getStateId())) {\n path.add(childrenElement);\n currentARGState=childrenElement;\n seenElements.add(childrenElement.getStateId());\n end = false;\n break;\n }\n } while(children.hasNext());\n if(end){\n path.remove(path.size()-1);\n if(path.size()!=0){\n currentARGState=path.get(path.size()-1);\n seenElements.add(currentARGState.getStateId());\n }\n else\n break;\n }\n\n }\n else{\n path.remove(path.size()-1);\n if(path.size()!=0){\n currentARGState=path.get(path.size()-1);\n seenElements.add(currentARGState.getStateId());\n }\n else\n break;\n }\n }\n if(currentARGState.getStateId() != destination.getStateId())\n return null;\n if(!destination.getChildren().contains(source))\n return null;\n System.out.println(\"path.size=\"+path.size());\n Iterator<ARGState> it=path.iterator();\n for(int i=0;i<path.size()-1;i++){\n ARGState pre=path.get(i);\n ARGState suc=path.get(i+1);\n CFAEdge edge=pre.getEdgeToChild(suc);\n if(edge.getRawStatement().equals(\"BLANKEDGE\")){\n pre.getChildren().remove(suc);\n suc.getParents().remove(pre);\n AbstractStates.extractLocation(pre).getLeavingEdge().remove(edge);\n AbstractStates.extractLocation(suc).getEnteringEdges().remove(edge);\n }\n }\n return new HashSet<ARGState>(path);\n }", "public void getSolution(TaskState state){\n\n if(state.isNew) {\n state.isNew = false;\n state.hasSolution = true;\n }\n else {\n if(!(state.hasSolution = rollBack(state)))\n return;\n }\n\n while (state.moveStack.size() < 64 ||\n !state.moveStack.peek().getStandElement().hasNeighbour(state.graph.getFirst())){\n\n if(state.moveStack.size() == 64 && !rollBack(state)) {\n state.hasSolution = false;\n return;\n }\n\n if(state.moveStack.peek().hasNextMove())\n state.moveStack.push(\n new HorseMove(state.moveStack.peek().getNextMove())\n );\n\n else if(!rollBack(state)){\n state.hasSolution = false;\n return;\n }\n\n }\n\n }", "private boolean dfs(StateObservation so) {\n ArrayList<Types.ACTIONS> subActions = so.getAvailableActions();\n states.add(so);\n boolean way = false;\n\n for (int i = 0; i < subActions.size(); i++) {\n StateObservation stCopy = so.copy();\n stCopy.advance(subActions.get(i));\n if (success) {\n way = true;\n break;\n }\n\n if (stCopy.getGameWinner() == Types.WINNER.PLAYER_WINS) {\n actions.add(subActions.get(i));\n success = true;\n way = true;\n break;\n }\n else if (stCopy.getGameWinner() == Types.WINNER.PLAYER_LOSES) {\n continue;\n }\n\n int j;\n for (j = 0; j < states.size(); j++) {\n if (stCopy.equalPosition(states.get(j)))\n break;\n }\n if (j < states.size()) continue;\n\n actions.add(subActions.get(i));\n way = dfs(stCopy);\n if(!way) {\n actions.remove(actions.size() - 1);\n }\n else break;\n }\n\n if(!way) {\n states.remove(states.size() - 1);\n }\n return way;\n }", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6900, \"inverted=true\", \"power=0\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6901, \"inverted=true\", \"power=1\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6902, \"inverted=true\", \"power=2\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6903, \"inverted=true\", \"power=3\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6904, \"inverted=true\", \"power=4\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6905, \"inverted=true\", \"power=5\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6906, \"inverted=true\", \"power=6\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6907, \"inverted=true\", \"power=7\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6908, \"inverted=true\", \"power=8\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6909, \"inverted=true\", \"power=9\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6910, \"inverted=true\", \"power=10\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6911, \"inverted=true\", \"power=11\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6912, \"inverted=true\", \"power=12\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6913, \"inverted=true\", \"power=13\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6914, \"inverted=true\", \"power=14\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6915, \"inverted=true\", \"power=15\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6916, \"inverted=false\", \"power=0\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6917, \"inverted=false\", \"power=1\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6918, \"inverted=false\", \"power=2\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6919, \"inverted=false\", \"power=3\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6920, \"inverted=false\", \"power=4\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6921, \"inverted=false\", \"power=5\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6922, \"inverted=false\", \"power=6\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6923, \"inverted=false\", \"power=7\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6924, \"inverted=false\", \"power=8\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6925, \"inverted=false\", \"power=9\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6926, \"inverted=false\", \"power=10\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6927, \"inverted=false\", \"power=11\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6928, \"inverted=false\", \"power=12\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6929, \"inverted=false\", \"power=13\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6930, \"inverted=false\", \"power=14\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6931, \"inverted=false\", \"power=15\"));\n }", "private static int[] countStatesSafe(List<Sequence> sequences) {\n int[] counts = countStates(sequences);\n int numSequences = counts.length;\n\n boolean anyZero = false;\n\n for (int i=0; i < numSequences; i++) {\n anyZero |= (counts[i] == 0);\n }\n\n // if any of the counts are 0, adjust all of them by 1 to avoid\n // division by 0 in extreme cases\n if (anyZero) {\n for (int i = 0; i < numSequences; ++i) {\n counts[i]++;\n }\n }\n return counts;\n }", "@Test\n public void tr0()\n {\n Graph g = new Graph(1);\n Set<Integer> nodes = new TreeSet<Integer>();\n nodes.add(0);\n assertTrue(g.reachable(nodes, nodes));\n }", "public void MovesRemainingExists() {\n InsideMovesRemainingExists = 1;\n NoMovesRemaining = 1;\n Beginning:\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n previousX = i;\n previousY = j + 1;\n if ((i + 1) < 9) {\n ValidSwitch(i + 1, j + 1);\n if (NoMovesRemaining == 0) { //checks the candies to the right\n ResetState();\n break Beginning; //breaks the loop\n }\n }\n\n if ((i - 1) >= 0) {\n ValidSwitch(i - 1, j + 1);\n if (NoMovesRemaining == 0) { //checks the candies to the left\n ResetState();\n break Beginning;\n }\n }\n\n if ((j + 1) < 9) {\n ValidSwitch(i, j + 2);\n if (NoMovesRemaining == 0) { //checks the candies on the bottom\n ResetState();\n break Beginning;\n }\n }\n\n if ((j - 1) >= 0) {\n ValidSwitch(i, j);\n if (NoMovesRemaining == 0) { //checks the candies at the top\n ResetState();\n break Beginning;\n }\n }\n }\n\n }\n InsideMovesRemainingExists = 0;\n\n}", "public static LocNode intialState() {\n\n\t \n\t char[][] newMatrix =copyMatrix(matrix);\n\t \n\t \n\n\t \n\twhile(true) {\n\t\t\t\n\t\t\t\n\t\tint i=getRandomIndex(size);\n\t\tint j=getRandomIndex(size);\n\t\t\n\t if(newMatrix[i][j]=='-') {\n\t \t\n\t \n\t \t newMatrix[i][j]='c' ;\n\t \t \n\t \t \n\t \t updateVisibility(i, j, newMatrix);\n\t \t \n\t \t\n\t \t LocNode intialState= new LocNode(newMatrix, calculateOpjectiveFunction(newMatrix));\n\t \t \n\t \t\n\t \t return intialState;\n\t }\n\t \n\t }\n }", "public Sq<LifeState> statesForNextLife() {\r\n\r\n Sq<LifeState> dyingBasisSequence = Sq.repeat(Ticks.PLAYER_DYING_TICKS,\r\n new LifeState(lifeStates.head().lives(),\r\n LifeState.State.DYING));\r\n\r\n if (lives() <= 1) {\r\n return dyingBasisSequence.concat(\r\n Sq.constant(new LifeState(0, LifeState.State.DEAD)));\r\n }\r\n\r\n else {\r\n return dyingBasisSequence.concat(Sq\r\n .repeat(Ticks.PLAYER_INVULNERABLE_TICKS,\r\n new LifeState(lifeStates.head().lives() - 1,\r\n LifeState.State.INVULNERABLE))\r\n .concat(Sq.constant(\r\n new LifeState(lifeStates.head().lives() - 1,\r\n LifeState.State.VULNERABLE))));\r\n }\r\n }", "@Override\n public Solution solve(ISearchable domain) {\n if(domain==null)\n return null;\n Solution s2=domain.checkIfIsSmall();\n if(s2!=null){\n domain.isClear();\n return s2;\n }\n Solution sol = new Solution();\n temp.add(domain.getStartState());\n numOfNude++;\n domain.isVisit(domain.getStartState());\n ArrayList<AState> neighbors=new ArrayList<AState>();\n while(!temp.isEmpty()){\n AState curr=temp.poll();\n if(domain.isEqual(domain.getGoalState(),curr)){\n numOfNude++;\n sol =solutionPath(curr,sol);\n\n break;\n }\n neighbors=domain.getAllPossibleState(curr);\n for(int i=0;i<neighbors.size();i++){\n if(domain.isEqual(domain.getGoalState(),neighbors.get(i))){\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n numOfNude++;\n sol =solutionPath(neighbors.get(i),sol);\n break;\n }\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n temp.add(neighbors.get(i));\n numOfNude++;\n }\n }\n\n domain.isClear();\n return sol;\n }", "static void palabras(){\n palabras=(stateCountS-1)*(stateCountP-1);\n System.out.println(\"S: \"+(stateCountS-1)+\" P: \"+(stateCountP-1)+\"palabras: \"+palabras);\n int coincidencias=0;\n for(int i=0;i<100005;i++){\n for(int j=0;j<26;j++){\n if(gs[i][j]!=0 && gs[i][j]!=-1 && gp[i][j]!=0 && gp[i][j]!=-1 && gs[i][j]==gp[i][j]){\n ++coincidencias;\n }\n }\n \n }\n System.out.println(coincidencias);\n \n palabras=palabras-coincidencias;\n System.out.println(palabras);\n }", "public long[] getState() {\n return new long[] {(long)Cg0, (long)Cg1, (long)Cg2,\n (long)Cg3, (long)Cg4, (long)Cg5};\n }", "public LinkedList<GameState> successor(GameState a)\n\t{\n\t\t//temperary gamestates that will be used for the legal moves\n\t\tGameState w = new GameState();\n\t\tGameState x = new GameState();\n\t\tGameState y = new GameState();\n\t\tGameState z = new GameState();\n\t\t//System.out.println(\"THIS IS THE CURR NODE\");\n\t\t//a.printGameState();\n\t\t//System.out.println(a);\n\t\t//create a linked list to return all of the legal moves as game states\n\t\tLinkedList<GameState> ans = new LinkedList<GameState>();\n\t\t//these are arrays that will be used to populate gamestates above\n\t\tint[] d = a.moveDown();\n\t\tint[] r = a.moveRight();\n\t\tint[] u = a.moveUp();\n\t\tint[] l = a.moveLeft();\n\t\t//System.out.println(\"hello\");\n\t\t//this is for the down move\n\t\t//System.out.println(\"DOWN\");\n\t\tif(!same1(d,check)) //make sure that moving down is a legall move\n\t\t{\n\t\t\t//System.out.println(\"hello\");\n\t\t\t//if it is a legal move poplate the fieds with \n\t\t\tw.setBoard(d);\n\t\t\tw.setStateID(count);//giving unique id\n\t\t\tw.setG();\n\t\t\tw.setH(this.h(goalS.getBoard(), w));//passing in the empty space index of the goal node\n\t\t\tw.setF();\n\t\t\tw.setVisited(false);\n\t\t\tw.setParentStateID(a.getStateID());//set the parent id to that of the current game state\n\t\t\t//System.out.println(a.getStateID());\n\t\t\t//w.printGameState();\n\t\t\tw.setPriority(w.getF());//the priority is the f(n)\n\t\t\t \n\t\t\tans.add(w);//add new gamestate to the linked list of legal moves\n\t\t}\n\t\tcount++;//increment count so all the games states have unique ids\n\t\t//this is for the up move\n\t\t//System.out.println(\"UP\");\n\t\tif(!same1(u,check)) //make sure that moving up is a legall move\n\t\t{\n\t\t\tx.setBoard(u);\n\t\t\tx.setStateID(count);//giving unique id\n\t\t\tx.setG();\n\t\t\tx.setH(this.h(goalS.getBoard(), x));//passing in the empty space index of the goal node\n\t\t\tx.setF();\n\t\t\tx.setParentStateID(a.getStateID());//set the parent id to that of the current game state\n\t\t\tx.setVisited(false);\n\t\t\t//x.printGameState();\n\t\t\tx.setPriority(x.getF());//the priority is the f(n)\n\t\t\tans.add(x);//add new gamestate to the linked list of legal moves\n\t\t}\n\t\tcount++;//increment count so all the games states have unique ids\n\t\t//\tSystem.out.println(\"RIGHT\");\n\t\t//this is for the right move\n\t\tif(!same1(r,check)) //make sure that moving right is a legall move\n\t\t{\n\t\t\t//System.out.println(\"hello\");\n\t\t\ty.setBoard(r);\n\t\t\ty.setStateID(count);//giving unique id\n\t\t\ty.setG();\n\t\t\ty.setH(this.h(goalS.getBoard(), y));//passing in the empty space index of the goal node\n\t\t\ty.setF();\n\t\t\ty.setParentStateID(a.stateID);//set the parent id to that of the current game state\n\t\t\ty.setVisited(false);\n\t\t\t//y.printGameState();\n\t\t\ty.setPriority(y.getF());//the priority is the f(n)\n\t\t\tans.add(y);//add new gamestate to the linked list of legal moves\n\t\t}\n\t\tcount++;//increment count so all the games states have unique ids\n\t\t//this is for the left move\n\t\t//System.out.println(\"LEFT\");\n\t\tif(!same1(l,check)) //make sure that moving left is a legall move\n\t\t{\n\t\t\tz.setBoard(l);\n\t\t\tz.setStateID(count);//giving unique id\n\t\t\tz.setG();\n\t\t\tz.setH(this.h(goalS.getBoard(), z));//passing in the empty space index of the goal node\n\t\t\tz.setF();\n\t\t\tz.setVisited(false);\n\t\t\tz.setParentStateID(a.getStateID());//set the parent id to that of the current game state\n\t\t\t//z.printGameState();\n\t\t\tz.setPriority(z.getF());//the priority is the f(n)r\n\t\t\t//count++;\n\t\t\tans.add(z);//add new gamestate to the linked list of legal moves\n\t\t}\n\t\tcount++;//increment count so all the games states have unique ids\n\t\treturn ans;\n\t}", "public ArrayList<UUSearchNode> getSuccessors() {\n\n ArrayList<UUSearchNode> successors = new ArrayList<UUSearchNode>();//this will be returned\n ArrayList<CannibalNode> helper = new ArrayList<CannibalNode>();\n\n if (this.state[2]==1){ //if the boat is on the starting shore\n helper.add(new CannibalNode(this.state[0] - 2, this.state[1],\n this.state[2] - 1, this.depth + 1)); //subtracting <201>\n helper.add(new CannibalNode(this.state[0], this.state[1] - 2,\n this.state[2] - 1, this.depth + 1)); //subtracting <021>\n helper.add(new CannibalNode(this.state[0] - 1, this.state[1] - 1,\n this.state[2] - 1, this.depth + 1)); //subtracting <111>\n helper.add(new CannibalNode(this.state[0] - 1, this.state[1],\n this.state[2] - 1, this.depth + 1)); //subtracting <101>\n helper.add(new CannibalNode(this.state[0], this.state[1] - 1,\n this.state[2] - 1, this.depth + 1)); //subtracting <011>\n }else{ //if the boat is on the opposite shore\n helper.add(new CannibalNode(this.state[0] + 2, this.state[1],\n this.state[2] + 1, this.depth + 1)); //adding <201>\n helper.add(new CannibalNode(this.state[0], this.state[1] + 2,\n this.state[2] + 1, this.depth + 1)); //adding <021>\n helper.add(new CannibalNode(this.state[0] + 1, this.state[1] + 1,\n this.state[2] + 1, this.depth + 1)); //adding <111>\n helper.add(new CannibalNode(this.state[0] + 1, this.state[1],\n this.state[2] + 1, this.depth + 1)); //adding <101>\n helper.add(new CannibalNode(this.state[0], this.state[1] + 1,\n this.state[2] + 1, this.depth + 1)); //adding <011>\n }\n\n //now we check for feasibility and legality\n for(CannibalNode n : helper){\n if(isFeasibleState(n.state) && isLegalState(n.state)){\n successors.add(n);\n }\n }\n return successors;\n }", "public boolean[] eGreedyAction()\n\t{\n\t\t// initialize variables\n\t\tRandom generator = new Random();\n\t\t\n\t\t// find best action\n\t\tList<boolean[]> validActions = getValidActions();\n\t\t\n\t\t// initiate values for comparison\n\t\tStateActionPair sap = new StateActionPair(state, validActions.get(0));\n\t\tboolean[] bestAction = sap.action;\n\t\t\n\t\tdouble bestValue= getStateActionValue(sap);\n\t\t\n\t\tfor(int i=1; i<validActions.size(); i++)\n\t\t{\n\t\t\tsap = new StateActionPair(state, validActions.get(i));\n\t\t\tdouble qValue = getStateActionValue(sap);\n\t\t\tif( qValue > bestValue )\n\t\t\t{\n\t\t\t\tbestAction = sap.action;\n\t\t\t\tbestValue = qValue;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// choose random action\n\t\tif( generator.nextDouble() < epsilon )\t\n\t\t{\n\t\t\tList<boolean[]> randomActions = new ArrayList<boolean[]>(validActions);\n\t\t\trandomActions.remove(bestAction);\t// don't choose the best action\n\t\t\tboolean[] randomAction = randomActions.get(generator.nextInt(randomActions.size()));\n\t\t\treturn randomAction;\n\t\t}\n\t\t\n\n\t\treturn bestAction;\t// choose best action\n\t}", "private void checkTargetsReachable(){\n\t\tPathfinder pathfinder = new Pathfinder(collisionMatrix);\n\t\tLinkedList<Node> removeList = new LinkedList<Node>();\n\t\tboolean pathWasFound = false;\n\t\tLinkedList<Node> currentPath;\n\t\tLinkedList<Node> reversePath;\n\t\t\n\t\t//Go through all starting positions\n\t\tfor(LinkedList<Node> startList : targets){\n\t\t\tprogress += 8;\n\t\t\tsetProgress(progress);\n\t\t\tfor(Node startNode : startList){\n\t\t\t\t\n\t\t\t\tboolean outsideMap = (startNode.getCollisionXPos(scaleCollision) < 0 || startNode.getCollisionXPos(scaleCollision) >= (collisionMatrix.length-1) || startNode.getCollisionYPos(scaleCollision) < 0 || startNode.getCollisionYPos(scaleCollision) >= (collisionMatrix.length-1));\n\t\t\t\t\n\t\t\t\tpathWasFound = false;\n\t\t\t\t//Make sure that target is inside of map\n\t\t\t\tif(!outsideMap){\n\t\t\t\t\t//Check against all target positions\n\t\t\t\t\tfor(LinkedList<Node> targetList : targets){\n\t\t\t\t\t\tfor(Node targetNode : targetList){\n\t\t\t\t\t\t\t//Only check against targets that have not already been marked as unreachable\n\t\t\t\t\t\t\tboolean selfCheck = (targetNode.getXPos() != startNode.getXPos() || targetNode.getYPos() != startNode.getYPos());\n\t\t\t\t\t\t\tif(!removeList.contains(targetNode) && selfCheck){\n\t\t\t\t\t\t\t\t//Check if this path has already been checked\n\t\t\t\t\t\t\t\tif(!preCalculatedPaths.containsKey(startNode.toStringCollision(scaleCollision) + \"-\" + targetNode.toStringCollision(scaleCollision))){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tcurrentPath = new LinkedList<Node>();\n\t\t\t\t\t\t\t\t\t//Check if a path can be found for this start and target node\n\t\t\t\t\t\t\t\t\tif(pathfinder.findPath(startNode.getCollisionXPos(scaleCollision), startNode.getCollisionYPos(scaleCollision), targetNode.getCollisionXPos(scaleCollision), targetNode.getCollisionYPos(scaleCollision), currentPath)){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(Frame.USE_PRECALCULATED_PATHS)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tpreCalculatedPaths.put(startNode.toStringCollision(scaleCollision) + \"-\" + targetNode.toStringCollision(scaleCollision), currentPath);\n\t\t\t\t\t\t\t\t\t\t\treversePath = new LinkedList<Node>();\n\t\t\t\t\t\t\t\t\t\t\treversePath.addAll(currentPath);\n\t\t\t\t\t\t\t\t\t\t\tCollections.reverse(reversePath);\n\t\t\t\t\t\t\t\t\t\t\treversePath.removeFirst();\n\t\t\t\t\t\t\t\t\t\t\treversePath.add(startNode);\n\t\t\t\t\t\t\t\t\t\t\tpreCalculatedPaths.put(targetNode.toStringCollision(scaleCollision) + \"-\" + startNode.toStringCollision(scaleCollision) ,reversePath);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tpathWasFound = true;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tpathWasFound = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Remove nodes which we cannot find a path from\n\t\t\t\tif(!pathWasFound){\n\t\t\t\t\tremoveList.add(startNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Go through the remove list and remove unreachable nodes\n\t\tfor(Node node : removeList){\n\t\t\tfor(LinkedList<Node> startList : targets){\n\t\t\t\tstartList.remove(node);\n\t\t\t}\n\t\t}\n\t}", "public void updateNeighbours(int i) {\n if (currentState[i] != 0) {\n int ix0 = (i - STEPX) & MASKX;\n int iy0 = (i - STEPY) & MASKY;\n int iz0 = (i - STEPZ) & MASKZ;\n\n int ix1 = (i) & MASKX;\n int iy1 = (i) & MASKY;\n int iz1 = (i) & MASKZ;\n\n int ix2 = (i + STEPX) & MASKX;\n int iy2 = (i + STEPY) & MASKY;\n int iz2 = (i + STEPZ) & MASKZ;\n\n ++nextState[ix0 | iy0 | iz0];\n ++nextState[ix0 | iy0 | iz1];\n ++nextState[ix0 | iy0 | iz2];\n ++nextState[ix0 | iy1 | iz0];\n ++nextState[ix0 | iy1 | iz1];\n ++nextState[ix0 | iy1 | iz2];\n ++nextState[ix0 | iy2 | iz0];\n ++nextState[ix0 | iy2 | iz1];\n ++nextState[ix0 | iy2 | iz2];\n\n ++nextState[ix1 | iy0 | iz0];\n ++nextState[ix1 | iy0 | iz1];\n ++nextState[ix1 | iy0 | iz2];\n ++nextState[ix1 | iy1 | iz0];\n\n //!\t\t++nextState[ix1|iy1|iz1];\n ++nextState[ix1 | iy1 | iz2];\n ++nextState[ix1 | iy2 | iz0];\n ++nextState[ix1 | iy2 | iz1];\n ++nextState[ix1 | iy2 | iz2];\n\n ++nextState[ix2 | iy0 | iz0];\n ++nextState[ix2 | iy0 | iz1];\n ++nextState[ix2 | iy0 | iz2];\n ++nextState[ix2 | iy1 | iz0];\n ++nextState[ix2 | iy1 | iz1];\n ++nextState[ix2 | iy1 | iz2];\n ++nextState[ix2 | iy2 | iz0];\n ++nextState[ix2 | iy2 | iz1];\n ++nextState[ix2 | iy2 | iz2];\n }\n }", "@Override\r\n\tpublic Set<NFAState> eClosure(NFAState s) {\r\n\t\tSet<NFAState> l = new HashSet<>();\r\n\t\treturn depthFirstSearch(l, s);\r\n\t}", "public List<Integer> getNeighborStates(Grid theGrid) {\n ArrayList<Integer> neighborStates = new ArrayList();\n int[] neighborColIndexForMyRow = getNeighborColIndex();\n\n for (int i = 0; i < neighborColIndexForMyRow.length; i++) {\n if (theGrid.isValidIndex(myRow + neighborRowIndex[i], myCol + neighborColIndexForMyRow[i])) {\n neighborStates.add(\n theGrid.getCell((myRow + neighborRowIndex[i]), (myCol + neighborColIndexForMyRow[i]))\n .getCurrentState());\n } else if (toroidal) {\n int[] newIndexes = getTorodialIndex(theGrid, i);\n if (theGrid.isValidIndex(newIndexes[0], newIndexes[1])) {\n neighborStates.add(\n theGrid.getCell(newIndexes[0], newIndexes[1]).getCurrentState());\n }\n }\n\n }\n return neighborStates;\n }", "public void gameOfLife(int[][] board) {\n int m = board.length;\n int n = ( m > 0 ? board[0].length : 0);\n int[] dx = {-1, -1, -1, 0, 1, 1, 1, 0};\n int[] dy = {-1, 0, 1, 1, 1, 0, -1, -1};\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n int cnt = 0;\n /**\n * Count the neighbors with live status.\n */\n for (int k = 0; k < 8; k++) {\n int x = i + dx[k];\n int y = j + dy[k];\n /**\n * Notice using board[x][y] here, not board[i][j]\n * The next state is created by applying the above rules simultaneously to every cell in the current state,\n * so we concern state==1 and state==2(both states indicate live)\n */\n if (x >= 0 && x < m && y >= 0 && y < n && (board[x][y] == 1 || board[x][y] == 2)) {\n cnt++;\n }\n }\n if (board[i][j] == 1 && (cnt < 2 || cnt > 3)) {\n /**\n * From live to dead.\n */\n board[i][j] = 2;\n }\n if (board[i][j] == 0 && cnt == 3) {\n /**\n * From dead to live\n */\n board[i][j] = 3;\n }\n }\n }\n /**\n * Restore state back to 0 and 1.\n */\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n board[i][j] %= 2;\n }\n }\n }", "private boolean isFeasibleState(int[] state){\n if((state[0] <= totalMissionaries && state[0] >= 0)&&(state[1] <= totalCannibals && state[1] >= 0)) {\n return true;\n }\n return false;\n }", "protected Double successProbability(){\n\t\tnodeKValues = collectKValues();\n\t\tList<Integer[]> placements = getDistinctPlacements(getMinKPath());\n\t\tlong maxNumberOfColorings = 0;\n\t\tfor (Integer[] placement : placements){\n\t\t\tlong colorings = numberOfColorings(placement);\n\t\t\tif (colorings > maxNumberOfColorings)\n\t\t\t\tmaxNumberOfColorings = colorings;\n\t\t}\n\t\tDouble probability = 1.0/maxNumberOfColorings;\n\t\tfor (int i=1; i<=pathLength; i++){ // factorial of pathlength\n\t\t\tprobability = probability * i;\n\t\t}\n\t\treturn probability;\n\t}", "private GlobalState search(Map<String,String> stateMapping) {\n GlobalState desired = new GlobalState(nodes,binding);\n desired.addMapping(stateMapping);\n for(GlobalState g : globalStates) {\n if(g.equals(desired))\n return g;\n }\n return null;\n }", "int countObjectFlowStates();", "public void testLPState()\n \t{\n \t\tsolver.buildLPState();\n \t\tassertTrue(solver.hasLPState());\n \t\t\n \t\tfinal int nLPVars = solver.getNumberOfLPVariables();\n \t\tassertTrue(nLPVars >= 0);\n \t\t\n \t\tfinal double[] objective = solver.getObjectiveFunction();\n \t\tassertEquals(nLPVars, objective.length);\n \t\t\n \t\tint nVarsUsed = 0;\n \t\t\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tassertSame(svar, solver.createVariable(var));\n \t\t\t\n \t\t\tDiscrete mvar = svar.getModelObject();\n \t\t\tassertSame(var, mvar);\n \t\t\tassertSame(solver, svar.getParentGraph());\n \t\t\t\n \t\t\t// Test do-nothing methods\n \t\t\tsvar.resetEdgeMessages(0);\n \t\t\tsvar.updateEdge(0);\n \t\t\tsvar.moveMessages(null, 0, 1);\n \t\t\tassertNull(svar.getInputMsg(0));\n \t\t\tassertNull(svar.getOutputMsg(0));\n \t\t\tassertNull(svar.createMessages(null));\n \t\t\tassertNull(svar.resetInputMessage(null));\n \t\t\t\n \t\t\tint lpVar = svar.getLPVarIndex();\n \t\t\tint nValidAssignments = svar.getNumberOfValidAssignments();\n \t\t\t\n \t\t\tif (var.hasFixedValue())\n \t\t\t{\n \t\t\t\t// Currently the converse is not true because model variables\n \t\t\t\t// do not currently check to see if there is only one non-zero input weight.\n \t\t\t\tassertTrue(svar.hasFixedValue());\n \t\t\t}\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tassertFalse(svar.hasLPVariable());\n \t\t\t}\n \t\t\tif (svar.hasLPVariable())\n \t\t\t{\n \t\t\t\tassertTrue(lpVar >= 0);\n \t\t\t\tassertTrue(nValidAssignments > 1);\n \t\t\t\t++nVarsUsed;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tassertEquals(-1, lpVar);\n \t\t\t\tassertTrue(nValidAssignments <= 1);\n \t\t\t}\n \t\t\t\n \t\t\tdouble[] weights = mvar.getInput();\n \t\t\tdouble totalWeight = 0.0;\n \t\t\tfor (double w : weights)\n \t\t\t{\n \t\t\t\ttotalWeight += w;\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0, end = svar.getModelObject().getDomain().size(); i < end; ++i)\n \t\t\t{\n \t\t\t\tdouble w = mvar.getInput()[i];\n \t\t\t\tint lpVarForValue = svar.domainIndexToLPVar(i);\n \t\t\t\tint i2 = svar.lpVarToDomainIndex(lpVarForValue);\n \t\t\t\tif (lpVarForValue >= 0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(i, i2);\n\t\t\t\t\tassertEquals(Math.log(w), objective[lpVarForValue], 1e-6);\n \t\t\t\t}\n \t\t\t\tif (!svar.hasLPVariable() || mvar.getInput()[i] == 0.0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(-1, lpVarForValue);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tfor (Factor factor : model.getFactors())\n \t\t{\n \t\t\tSTableFactor sfactor = solver.getSolverFactor(factor);\n \t\t\tassertSame(sfactor, solver.createFactor(factor));\n \t\t\tassertSame(factor, sfactor.getModelObject());\n \t\t\tassertSame(solver, sfactor.getParentGraph());\n \t\t\t\n \t\t\t// Test do nothing methods\n \t\t\tsfactor.createMessages();\n \t\t\tsfactor.updateEdge(0);\n \t\t\tsfactor.resetEdgeMessages(0);\n \t\t\tsfactor.moveMessages(null, 0 , 1);\n \t\t\tassertNull(sfactor.getInputMsg(0));\n \t\t\tassertNull(sfactor.getOutputMsg(0));\n \t\t}\n \t\t\n \t\tfinal List<IntegerEquation> constraints = solver.getConstraints();\n \t\tassertNotNull(constraints);\n \n \t\tint nConstraints = solver.getNumberOfConstraints();\n \t\tint nVarConstraints = solver.getNumberOfVariableConstraints();\n \t\tint nMarginalConstraints = solver.getNumberOfMarginalConstraints();\n \t\tassertEquals(nConstraints, constraints.size());\n \t\tassertEquals(nConstraints, nVarConstraints + nMarginalConstraints);\n \t\tassertEquals(nVarsUsed, nVarConstraints);\n \t\t\n \t\t{\n \t\t\tMatlabConstraintTermIterator termIter = solver.getMatlabSparseConstraints();\n \t\t\tList<Integer> constraintTerms = new ArrayList<Integer>(termIter.size() * 3);\n \t\t\t\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tfor (int row = 1; constraintIter.hasNext(); ++ row)\n \t\t\t{\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\t\n \t\t\t\tint nExpectedTerms = -1;\n \t\t\t\tint lpVar = -1;\n \t\t\t\t\n \t\t\t\tif (row <= nVarConstraints)\n \t\t\t\t{\n \t\t\t\t\tLPVariableConstraint varConstraint = constraint.asVariableConstraint();\n \t\t\t\t\tassertNotNull(varConstraint);\n \t\t\t\t\tassertNull(constraint.asFactorConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSVariable svar = varConstraint.getSolverVariable();\n \t\t\t\t\tassertTrue(svar.hasLPVariable());\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(1, varConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = svar.getNumberOfValidAssignments();\n \t\t\t\t\t\n \t\t\t\t\tlpVar = svar.getLPVarIndex();\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tLPFactorMarginalConstraint factorConstraint = constraint.asFactorConstraint();\n \t\t\t\t\tassertNotNull(factorConstraint);\n \t\t\t\t\tassertNull(constraint.asVariableConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSTableFactor sfactor = factorConstraint.getSolverFactor();\n \t\t\t\t\tlpVar = sfactor.getLPVarIndex();\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(0, factorConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = sfactor.getNumberOfValidAssignments();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tint[] lpvars = constraint.getVariables();\n \t\t\t\tassertEquals(constraint.size(), lpvars.length);\n \t\t\t\tassertEquals(0, constraint.getCoefficient(-1));\n \t\t\t\tassertEquals(0, constraint.getCoefficient(lpVar + nExpectedTerms));\n \t\t\t\tassertFalse(constraint.hasCoefficient(-1));\n \t\t\t\t\n \t\t\t\tassertTrue(lpVar >= 0);\n \n \t\t\t\tIntegerEquation.TermIterator constraintTermIter = constraint.getTerms();\n \t\t\t\tfor (int i = 0; constraintTermIter.advance(); ++i)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(lpvars[i], constraintTermIter.getVariable());\n \t\t\t\t\tassertEquals(constraintTermIter.getCoefficient(), constraint.getCoefficient(lpvars[i]));\n \t\t\t\t\tassertTrue(constraint.hasCoefficient(lpvars[i]));\n \t\t\t\t\tconstraintTerms.add(row);\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getVariable());\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getCoefficient());\n \t\t\t\t}\n \t\t\t\tassertFalse(constraintTermIter.advance());\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0; termIter.advance(); i += 3)\n \t\t\t{\n \t\t\t\tassertEquals((int)constraintTerms.get(i), termIter.getRow());\n \t\t\t\tassertEquals(constraintTerms.get(i+1) + 1, termIter.getVariable());\n \t\t\t\tassertEquals((int)constraintTerms.get(i+2), termIter.getCoefficient());\n \t\t\t}\n \t\t\tassertFalse(termIter.advance());\n \t\t}\n \t\t\n \t\t\n \t\tif (expectedConstraints != null)\n \t\t{\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tassertEquals(expectedConstraints.length, solver.getNumberOfConstraints());\n \t\t\tfor (int i = 0, end = expectedConstraints.length; i < end; ++i)\n \t\t\t{\n \t\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\tconstraint.print(new PrintStream(out));\n \t\t\t\tString actual = out.toString().trim();\n \n \t\t\t\tString expected = expectedConstraints[i].trim();\n \n \t\t\t\tif (!expected.equals(actual))\n \t\t\t\t{\n \t\t\t\t\tSystem.out.format(\"Constraint %d mismatch:\\n\", i);\n \t\t\t\t\tSystem.out.format(\"Expected: %s\\n\", expected);\n \t\t\t\t\tSystem.out.format(\" Actual: %s\\n\", actual);\n \t\t\t\t}\n \t\t\t\tassertEquals(expected, actual);\n \t\t\t}\n \t\t}\n \t\t\n \t\t// Test setting solution. A real solution will only use ones and zeros,\n \t\t// but we will use random values to make sure they are assigned correctly.\n \t\tdouble[] solution = new double[nLPVars];\n \t\tRandom rand = new Random();\n \t\tfor (int i = solution.length; --i>=0;)\n \t\t{\n \t\t\tsolution[i] = rand.nextDouble();\n \t\t}\n \t\tsolver.setSolution(solution);\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tdouble[] belief = svar.getBelief();\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tint vali = svar.getValueIndex();\n \t\t\t\tfor (int i = belief.length; --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tif (i == vali)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(1.0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0.0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tfor (int i = svar.getModelObject().getDomain().size(); --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tint lpVar = svar.domainIndexToLPVar(i);\n \t\t\t\t\tif (lpVar < 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(solution[lpVar], belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tsolver.clearLPState();\n \t\tassertInitialState();\n \t}", "public List<Action> getActionsBasedOnProbability(final State state) {\r\n double bestProbability = 0;\r\n final List<Action> bestActions = new LinkedList<Action>();\r\n\r\n for (final Map.Entry<Action, Double> actionProb : getProperties(state).getActionProbabilities().entrySet()) {\r\n final double probability = actionProb.getValue();\r\n if (probability > bestProbability) {\r\n bestActions.clear();\r\n bestProbability = probability;\r\n }\r\n if (probability >= bestProbability) {\r\n bestActions.add(actionProb.getKey());\r\n }\r\n }\r\n\r\n return bestActions;\r\n }", "public Set<StateVertex> getAllStates() {\n\t\treturn sfg.vertexSet();\n\t}", "private int checkerboardToState(int[][] paraCheckerboard) {\n\t\tint resultState = 0;\n\t\tint tempExponential = 1;\n\t\tfor (int i = 0; i < SIZE; i++) {\n\t\t\tfor (int j = 0; j < SIZE; j++) {\n\t\t\t\tresultState += paraCheckerboard[i][j] * tempExponential;\n\t\t\t\ttempExponential *= SIZE;\n\t\t\t} // Of for j\n\t\t} // Of for i\n\n\t\treturn resultState;\n\t}", "List<State> adj() {\n\t\t\tList<State> adj = new ArrayList<State>();\n\t\t\tList<Edge> edgeList = edgeMap.get(city);\n\n\t\t\tfor (Edge e : edgeList) {\n\t\t\t\tboolean isPlane = e.cost == 0;\n\t\t\t\tif (ticketUsed == true && isPlane) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tint toCity = e.to;\n\t\t\t\tState s = new State(toCity, isPlane, dist + e.cost);\n\n\t\t\t\tadj.add(s);\n\t\t\t}\n\n\t\t\treturn adj;\n\t\t}" ]
[ "0.6960649", "0.6578546", "0.6324636", "0.63120854", "0.62913", "0.6270745", "0.6253968", "0.62040216", "0.6181632", "0.6178198", "0.61097604", "0.59901774", "0.5923785", "0.59135926", "0.5866732", "0.5804204", "0.5799127", "0.5793137", "0.5774621", "0.5748617", "0.5748397", "0.5702795", "0.5680113", "0.56642675", "0.56402147", "0.56305796", "0.5627931", "0.5603753", "0.5592331", "0.55882865", "0.5584865", "0.5578051", "0.55648977", "0.5558027", "0.55519444", "0.5550534", "0.55478746", "0.553747", "0.5527334", "0.55040795", "0.5503617", "0.5498607", "0.547242", "0.54638094", "0.54631746", "0.5453214", "0.54423803", "0.5439001", "0.54375446", "0.54344773", "0.5427374", "0.5406864", "0.54034966", "0.54034966", "0.54034966", "0.54034966", "0.54034966", "0.54034966", "0.54014975", "0.53896415", "0.53852683", "0.5376609", "0.5364113", "0.53503436", "0.5348535", "0.5326105", "0.531406", "0.53033847", "0.5296462", "0.5284341", "0.5282495", "0.5278361", "0.5268482", "0.5234201", "0.5222644", "0.5221854", "0.52182543", "0.52173597", "0.52164966", "0.52157176", "0.52155656", "0.5210248", "0.5203415", "0.51958466", "0.5186139", "0.5178326", "0.5177316", "0.5171507", "0.5166627", "0.5161956", "0.51534", "0.51510864", "0.5150309", "0.514884", "0.51459706", "0.51444036", "0.5139798", "0.5136225", "0.5133808", "0.5123932" ]
0.614467
10
The following methods are related to actions.
public void setAction(State s, Action a) { if(s.isTerminated()) return ; s.action = a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\r\n\tpublic void action() {\n\t\t\r\n\t}", "@Override\n\tpublic void action() {\n\n\t}", "public void actionOffered();", "public void act() \r\n {\r\n // Add your action code here.\r\n }", "public void act() \r\n {\r\n // Add your action code here.\r\n }", "public void action() {\n }", "public abstract Action getAction();", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "@Override\n \tpublic void addActions() {\n \t\t\n \t}", "public void action() {\n action.action();\n }", "public interface Actions {\n void initScreen();\n void getRevenues(String date, String accessToken);\n void requestWithdrawl(String accessToken, float amount);\n\n }", "public abstract void action();", "public abstract void action();", "public abstract void action();", "public abstract void action();", "public interface Actions {\n void initScreen();\n void submitReview(String accessToken,\n String productID,\n String rating,\n String orderDID,\n String comment);\n }", "@Override\r\n\tpublic void initActions() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void execute(ActionContext ctx) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void visit(SimpleAction action)\r\n\t{\n\t\t\r\n\t}", "public void performAction() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void performAction();", "@Override\n\tpublic void action() {\n\t\tSystem.out.println(\"action now!\");\n\t}", "abstract public void performAction();", "public void createAction() {\n }", "@Override\n\tpublic String getAction() {\n\t\treturn action;\n\t}", "public abstract void init_actions() throws Exception;", "@Override\r\n\t\tpublic void action()\r\n\t\t{\r\n// throw new UnsupportedOperationException(\"Not supported yet.\");\r\n\t\t}", "private void act() {\n\t\tmyAction.embodiment();\n\t}", "public void act() \n {\n // Add your action code here.\n klawisze();\n stawiaj();\n pobierzJablka();\n }", "@Override\r\n protected void doActionDelegate(int actionId)\r\n {\n \r\n }", "protected abstract void action(Object obj);", "@Override\n public String getActions() {\n\treturn \"\";\n }", "public void executeAction( String actionInfo );", "public void doAction(){}", "public void act() \r\n {\r\n \r\n // Add your action code here\r\n MovimientoNave();\r\n DisparaBala();\r\n Colisiones();\r\n //muestraPunto();\r\n //archivoTxt();\r\n }", "public abstract void onAction();", "protected void createActions()\n {\n super.createActions();\n \n wireAction(\n new ContentAssistAction(\n PerlEditorMessages.getResourceBundle(),\n \"ContentAssistProposal.\",\n this),\n PerlEditorCommandIds.CONTENT_ASSIST,\n PerlEditorActionIds.CONTENT_ASSIST);\n \n // each marker clearing action gets its own wiring\n wireAction(new ClearMarkerAction.Critic(this), PerlEditorCommandIds.CLEAR_MARKER,\n PerlEditorActionIds.CLEAR_CRITIC_MARKERS);\n wireAction(new ClearMarkerAction.PodChecker(this), PerlEditorCommandIds.CLEAR_MARKER,\n PerlEditorActionIds.CLEAR_POD_MARKERS);\n wireAction(new ClearMarkerAction.AllMarkers(this), PerlEditorCommandIds.CLEAR_MARKER,\n PerlEditorActionIds.CLEAR_ALL_MARKERS);\n \n wireAction(new PodCheckerAction(this), PerlEditorCommandIds.POD_CHECKER,\n PerlEditorActionIds.POD_CHECKER);\n wireAction(new ToggleCommentAction(this), PerlEditorCommandIds.TOGGLE_COMMENT,\n PerlEditorActionIds.TOGGLE_COMMENT);\n wireAction(new PerlCriticAction(this), PerlEditorCommandIds.CRITIQUE_SOURCE,\n PerlEditorActionIds.PERL_CRITIC);\n wireAction(new FormatSourceAction(this), PerlEditorCommandIds.FORMAT_SOURCE,\n PerlEditorActionIds.FORMAT_SOURCE);\n wireAction(new Jump2BracketAction(this), PerlEditorCommandIds.MATCHING_BRACKET,\n PerlEditorActionIds.MATCHING_BRACKET);\n wireAction(new ExportHtmlSourceAction(this), PerlEditorCommandIds.HTML_EXPORT,\n PerlEditorActionIds.HTML_EXPORT);\n wireAction(new ValidateSourceAction(this), PerlEditorCommandIds.VALIDATE_SYNTAX,\n PerlEditorActionIds.VALIDATE_SYNTAX);\n wireAction(new OpenDeclarationAction(this), PerlEditorCommandIds.OPEN_DECLARATION,\n PerlEditorActionIds.OPEN_DECLARATION);\n wireAction(new PerlDocAction(this), PerlEditorCommandIds.PERL_DOC,\n PerlEditorActionIds.PERL_DOC);\n wireAction(new ExtractSubroutineAction(this), PerlEditorCommandIds.EXTRACT_SUBROUTINE,\n PerlEditorActionIds.EXTRACT_SUBROUTINE);\n }", "@Override\n\tpublic void setAction() {\n\t}", "public ActionList getActions();", "public void toSelectingAction() {\n }", "@Override\n\tpublic void newAction() {\n\t\t\n\t}", "public void performAction(HandlerData actionInfo) throws ActionException;", "@Override\n\tpublic void onActionStart(int action) {\n\t\t\n\t}", "public void setAction(String action) { this.action = action; }", "@Override\n\tpublic void handleAction(Action action, Object sender, Object target) {\n\t\t\n\t}", "@Override\n public void act() {\n }", "public void act() \r\n {\r\n // Add your action code here.\r\n tembak();\r\n gerakKiri();\r\n gerakKanan();\r\n \r\n \r\n \r\n }", "private void createActions() {\n\n\t\t//-----------------------------------------------\n\t\t// Check if Party Exists\n\t\t//-----------------------------------------------\n\t\tpartyExists = new GuardedRequest<Party>() {\n\t\t\tprotected boolean error() {return emailaddressField.noValue();}\n\t\t\tprotected void send() {super.send(getValue(new PartyExists()));}\n\t\t\tprotected void receive(Party party) {\n\t\t\t\tif (party != null ) {setValue(party);}\n\t\t\t}\n\t\t};\n\n\t\t//-----------------------------------------------\n\t\t// Read Party\n\t\t//-----------------------------------------------\n\t\tactorRead = new GuardedRequest<Party>() {\n\t\t\tprotected boolean error() {return partyField.noValue();}\n\t\t\tprotected void send() {super.send(getValue(new ActorRead()));}\n\t\t\tprotected void receive(Party party){setValue(party);}\n\t\t};\n\n\t\t//-----------------------------------------------\n\t\t// Update Party\n\t\t//-----------------------------------------------\n\t\tactorUpdate = new GuardedRequest<Party>() {\n\t\t\tprotected boolean error() {\n\t\t\t\treturn (\n\t\t\t\t\t\tifMessage(AbstractRoot.noOrganizationid(), Level.TERSE, AbstractField.CONSTANTS.errOrganizationid(), partyField)\n\t\t\t\t\t\t|| ifMessage(partyField.noValue(), Level.TERSE, AbstractField.CONSTANTS.errId(), partyField)\n\t\t\t\t\t\t|| ifMessage(emailaddressField.noValue(), Level.ERROR, AbstractField.CONSTANTS.errEmailaddress(), emailaddressField)\n\t\t\t\t\t\t|| ifMessage(formatdateField.noValue(), Level.ERROR, CONSTANTS.formatdateError(), formatdateField)\n\t\t\t\t\t\t|| ifMessage(formatphoneField.noValue(), Level.ERROR, CONSTANTS.formatphoneError(), formatphoneField)\n\t\t\t\t\t\t|| ifMessage(!Party.isEmailAddress(emailaddressField.getValue()), Level.ERROR, AbstractField.CONSTANTS.errEmailaddress(), emailaddressField)\n//\t\t\t\t\t\t|| ifMessage((typesField.hasValue(Party.Type.Agent.name()) || typesField.hasValue(Party.Type.Organization.name())) && !partyField.hasValue(AbstractRoot.getOrganizationid()), Level.ERROR, CONSTANTS.partytypeError(), partyField)\n\t\t\t\t);\n\t\t\t}\n\t\t\tprotected void send() {super.send(getValue(new ActorUpdate()));}\n\t\t\tprotected void receive(Party party) {\n\t\t\t\tif (parentTable != null) {parentTable.execute(true);}\n\t\t\t\thide();\n\t\t\t}\n\t\t};\n\n\t\t//-----------------------------------------------\n\t\t// Delete Party\n\t\t//-----------------------------------------------\n\t\tactorDelete = new GuardedRequest<Party>() {\n\t\t\tprotected String popup() {return AbstractField.CONSTANTS.errDeleteOK();}\n\t\t\tpublic void cancel() {state = oldstate;}\n\t\t\tprotected boolean error() {\n\t\t\t\treturn (\n\t\t\t\t\t\tifMessage(partyField.noValue(), Level.TERSE, AbstractField.CONSTANTS.errId(), partyField)\n\t\t\t\t);\n\t\t\t}\n\t\t\tprotected void send() {super.send(getValue(new ActorDelete()));}\n\t\t\tprotected void receive(Party party){\n\t\t\t\tif (parentTable != null) {parentTable.execute(true);}\n\t\t\t\thide();\n\t\t\t}\n\t\t};\t\n\t}", "private void registerActions() {\n // File menu :\n new NewAction();\n new LoadOIFitsAction();\n new LoadFitsImageAction();\n\n new ExportOIFitsAction();\n new ExportFitsImageAction();\n\n // Edit menu :\n new DeleteSelectionAction();\n\n // Processing menu :\n new RunAction();\n new ResampleImageAction();\n\n // Interop menu :\n // Send OIFits (SAMP) :\n new SendOIFitsAction();\n // Send Fits (SAMP) :\n new SendFitsAction();\n }", "protected abstract void actionExecuted(SUT system, State state, Action action);", "public abstract void addAction(Context context, NAAction action);", "public void act() {\n\t}", "@Override\n\tpublic void actionHandler(Actions action, int arg1, int arg2) {\n\t\tlogic.actionHandler(action, arg1, arg2);\n\t}", "public void act();", "@Override\n\tpublic void createAction(Model m) {\n\t\t\n\t}", "@Override\n protected void doAct() {\n }", "@Override\r\n\tpublic void act() {\n\t\tausgeben();\r\n\t}", "public abstract void executeActionButton();", "public int getActionType();", "private void handleActionFoo(String param1, String param2){\n\t// TODO: Handle action Foo\n\tthrow new UnsupportedOperationException(\"Not yet implemented\");\n }", "public int getAction() {\n\t\treturn action;\n\t}", "public void a_Action(){}", "public int getAction()\n {\n return m_action;\n }", "public A getAction() {\r\n\t\treturn action;\r\n\t}", "public interface AppAction\n{\n void login(String name, String password, Handler handler);\n\n void access(Handler handler, String ...s);\n\n void gdata(Handler handler, List<EHentaiMangaInfo> list);\n\n void getMangaInfo(Handler handler);\n\n void getNews(Handler handler);\n\n void getNews(Handler handler, String title, String page);\n\n void getImg( String url, ImageView imageView,AppActionImpl.Callback<Void> callback,int height,int width);\n}", "public void act() \r\n {\n }", "public void act() \r\n {\n }", "public void act() \r\n {\n }", "public void includeAction(){\n actions.showActions();\n }", "public int getAction() {\n return action;\n }", "@Override\n protected void hookUpActionListeners() {\n }", "public GetIndividualsFullAction() {\n super();\n }", "public abstract ActionInMatch act();", "public interface Action { //придумываем интерфейс для описания действий, присущих роботу\n Action dogo(MapOfAction mapOfAction); //объявляем функцию для действий, которой передаём карту\n\n}", "@Override\n\tpublic void showAction(int id) {\n\t\t\n\t}", "@Override\n protected Action[] createActions() {\n return new Action[0];\n }", "public List<Action> getActions(){return actions;}", "public interface Action {\n\n /**\n * Set local database connection\n */\n public void setDatabase(Connection _db);\n\n /**\n * Execute business logic\n */\n public boolean execute(HttpServletRequest _req, HttpServletResponse _res)\n throws ServletException, IOException;\n\n /**\n * Return the page name (and path) to display the view\n */\n public String getView();\n\n /**\n * Return a JavaBean containing the model (data)\n */\n public Object getModel();\n\n}", "public void initiateAction() {\r\n\t\t// TODO Auto-generated method stub\t\r\n\t}", "public int getAction() {\n return action_;\n }", "@Override\n public void action(Jugador jugador) {\n\n }", "com.google.protobuf.ByteString\n getActionBytes();", "public interface ActionHandler {\n ModelApiResponse handleActionChoice(ActionChoice choice);\n List<AvailableActions> getActionsCurrentlyAvailable();\n}", "@Override\n public ServiceResult performAction() throws UpdateException {\n children.add(createDeleteEnrichmentAction());\n children.add(createMoveEnrichmentToCommonRecordAction());\n return ServiceResult.newOkResult();\n }", "interface Action {\n /**\n * Executes the action. Called upon state entry or exit by an automaton.\n */\n void execute();\n }", "@Override\n\t\t\tpublic void dealWithCustomAction(Context context, UMessage msg)\n\t\t\t{\n\t\t\t}", "public void takeAction(BoardGameController.BoardBugAction action)\n {\n\n }", "public interface MyActions {\n\n String GET_ROUTINES = \"get-routines\";\n String RENAME_ROUTINE = \"rename-routine\";\n String DELETE_ROUTINE = \"delete-routine\";\n String CREATE_ROUTINE = \"create-routine\";\n String UPDATE_TASKS = \"update-tasks\";\n String GET_TASKS = \"get-tasks\";\n\n String CREATE_TASK = \"create-task\";\n String DELETE_TASK = \"delete-task\";\n void deleteTask(String routine, Task task);\n String UPDATE_TASK = \"update-task\";\n String UPDATE_BREAK_INTERVAL = \"update-break-interval\";\n String GET_BREAK_INTERVAL = \"get-break-interval\";\n String SAVE_HISTORY = \"save-history\"; //save after each task completes\n String GET_HISTORY = \"get-history\";\n String LOGIN = \"login\";\n\n void getRoutines();\n\n void renameRoutine(String oldName, String newName);\n\n void deleteRoutine(String routine);\n\n void createRoutine(String name, int priority);\n\n void updateTask(String routine, Task oldTask, Task newTask, int position);\n\n void updateBreakInterval(String routine, int interval);\n\n void getBreakInterval(String routine);\n\n void getTasks(String routine);\n\n void createTask(String routine, Task task, int priority);\n\n void updateTasks(String routine, List<Task> tasks);\n\n void login(String userEmail);\n\n void saveHistory(String routine, Task task, String date, String time);\n\n void getHistory();\n\n}", "public void processAction(CIDAction action);", "@Override\n public void onAction(RPObject player, RPAction action) {\n }", "@Override\r\n\tpublic Message doAction() {\n\t\treturn null;\r\n\t}" ]
[ "0.7511674", "0.7511674", "0.7511674", "0.7497134", "0.7301133", "0.7022942", "0.701082", "0.701082", "0.6969324", "0.6966433", "0.6960882", "0.6960882", "0.6960882", "0.6960882", "0.6960882", "0.6960882", "0.6960882", "0.6960882", "0.69602305", "0.6944075", "0.6889046", "0.68507856", "0.68507856", "0.68507856", "0.68507856", "0.68050283", "0.67564607", "0.67318296", "0.67023045", "0.66611326", "0.6607063", "0.66038096", "0.65881956", "0.6578469", "0.65746236", "0.65562826", "0.65529364", "0.65421057", "0.65402037", "0.6537983", "0.6520888", "0.6509144", "0.6506143", "0.6500349", "0.6495096", "0.6476413", "0.64570546", "0.64459574", "0.64233226", "0.64066833", "0.63708204", "0.6355411", "0.6354175", "0.63533974", "0.6349886", "0.63487667", "0.6345744", "0.6330261", "0.63257104", "0.6305216", "0.6300026", "0.62973565", "0.62877053", "0.62575835", "0.625343", "0.6251925", "0.6220902", "0.62174404", "0.62155247", "0.6185926", "0.61726594", "0.6171893", "0.61710316", "0.61706764", "0.6168891", "0.6157571", "0.6157571", "0.6157571", "0.6150855", "0.6150395", "0.613817", "0.6135133", "0.61341345", "0.613342", "0.61324733", "0.6124019", "0.6120249", "0.6117795", "0.611703", "0.61159766", "0.6115755", "0.61115897", "0.61016566", "0.6100449", "0.609015", "0.6088194", "0.60873276", "0.60712117", "0.60575926", "0.6055279", "0.60486597" ]
0.0
-1
To validate the transit is possible, e.g. using some actions can reach out of boundary. The next state should belong to [0, maxLevel)
public boolean isPossibleTransit(State s, Action a) { // int newWorkloadLevel = s.getWorkload() + a.getChangedWorkload(); int maxBatteryLevel = getNextBatteryLevel(s, a); int maxActionLevel = s.getWorkload(); if((a.getChangedWorkload() <= maxActionLevel) && (a.getBatteryUsed() <= maxBatteryLevel)) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isFeasibleState(int[] state){\n if((state[0] <= totalMissionaries && state[0] >= 0)&&(state[1] <= totalCannibals && state[1] >= 0)) {\n return true;\n }\n return false;\n }", "private boolean isLegalState(int[] state){\n int[] stateOtherSide = new int[3];\n stateOtherSide[0] = totalMissionaries - state[0];\n stateOtherSide[1] = totalCannibals - state[1];\n stateOtherSide[2] = state[2]==0 ? 1 : 0;\n\n if((state[0] < state[1]) && state[0] >0 || (stateOtherSide[0] < stateOtherSide[1]) && stateOtherSide[0] > 0) {\n return false;\n }else{\n return true;\n }\n }", "public void validate() throws Exception {\r\n\t\tCollection<String> types = getTaskTypes();\r\n\t\tIterator<String> it = types.iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tString type = it.next();\r\n\t\t\tString init = getInitialState(type);\r\n\t\t\tCollection<String> states = getStates(type);\r\n\t\t\tif (init.equals(\"OPEN\") && !states.contains(\"OPEN\"))\r\n\t\t\t\tthrow new Exception(Resource.getResourceString(\"NoOpenState\")\r\n\t\t\t\t\t\t+ type);\r\n\t\t}\r\n\t}", "boolean canTransit(final Map<T, Integer> state) {\n for (Entry<T, Integer> x : input.entrySet())\n if (get(state, x.getKey()) < x.getValue())\n return false;\n for (T x : inhibitor)\n if (get(state, x) != 0)\n return false;\n return true;\n }", "public HashMap<String,ArrayList<Rule_in_State>> get_rules_of_next_state() throws Exception;", "private void validation(Solution sol) {\n List<Route> routes = sol.getRoutes();\n double totalDist = 0;\n double totalPenalty = 0;\n for (Route route : routes) {\n double dist = 0;\n double penalty = 0;\n double time = 0;\n double load = 0;\n List<Node> routeNodes = route.getNodes();\n for (int i = 1; i < routeNodes.size(); i++) {\n Node prevNode = routeNodes.get(i - 1);\n Node node = routeNodes.get(i);\n load += node.getq();\n if (!Utils.doubleEqual(node.getQ(), load)) throw new IllegalArgumentException(\"Wrong with load.\");\n if (load < 0 || load > route.getVehicle().getCapacity()) throw new IllegalArgumentException(\"Load Violation.\");\n time = Math.max(node.getTw1(), prevNode.gets() + time + Utils.calculateDistance(prevNode, node));\n if (node.getMembership() == 1 && time > node.getTw2()) throw new IllegalArgumentException(\"Time window violation.\");\n if (!Utils.doubleEqual(time, node.getT())) throw new IllegalArgumentException(\"Wrong with time.\");\n double tempPenalty = Math.max(0, time - node.getTw2());\n if (!Utils.doubleEqual(tempPenalty, node.getDL())) throw new IllegalArgumentException(\"Wrong penalty\");\n penalty += tempPenalty;\n dist += Utils.calculateDistance(prevNode, node);\n }\n if (!Utils.doubleEqual(dist, route.getDist())) throw new IllegalArgumentException(\"Wrong route distance\");\n// System.out.println(penalty + \" \" + route.getPenalty());\n if (!Utils.doubleEqual(penalty, route.getPenalty())) throw new IllegalArgumentException(\"Wrong route penalty\");\n totalDist += dist;\n totalPenalty += penalty;\n }\n if (!Utils.doubleEqual(totalDist, sol.getTotalDist())) throw new IllegalArgumentException(\"Wrong solution distance\");\n if (!Utils.doubleEqual(totalPenalty, sol.getTotalPenalty())) throw new IllegalArgumentException(\"Wrong solution penalty\");\n }", "private static void _VerifyAllowedTransition(short oldState, short newState){\r\n\t\tswitch (oldState){\r\n\t\t\tcase STATE_INSTALLED: {\r\n\t\t\t\tif (newState == STATE_SELECTED) {break;}\r\n\t\t\t\tif (newState == STATE_BLOCKED) {break;}\r\n\r\n\t\t\t\tthrow new RuntimeException(\"State transition is not allowed\");\r\n\t\t\t}\r\n\t\t\tcase STATE_SELECTED: {\r\n\t\t\t\tif (newState == STATE_BLOCKED) {break;}\r\n\r\n\t\t\t\tthrow new RuntimeException(\"State transition is not allowed\");\r\n\t\t\t}\r\n\t\t\tcase STATE_UPLOADED: {\r\n\t\t\t\tif (newState == STATE_INSTALLED) {break;}\r\n\r\n\t\t\t\tthrow new RuntimeException(\"State transition is not allowed\");\r\n\t\t\t}\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new RuntimeException(\"State transition is not allowed\");\r\n\t\t}\r\n\t}", "public boolean isValidTransition(MutableInteger value, RandomAccess<MutableInteger> tr) {\n\t\treturn value.getValue() <= maxdenominator;\r\n\t}", "@Test\n public void stateFromInitWithAuthFailToError() {\n // given a newly created ticket in initial state\n CreateTicketVO createTicketVO = CreateTicketVO.newBuilder()\n .ticketIssuingType(TicketIssuingType.ONE_TICKET_FOR_ALL_PRODUCTS)\n .products(this.products)\n .paymentType(PaymentType.NO_PAYMENT)\n .account(this.account).build();\n TicketOrder ticketOrder = this.ticketFactory.createTickets(createTicketVO);\n Ticket ticket = ticketOrder.getBillingTicket();\n assertTicketInState(ticket, TicketStateType.TICKET_ORDER_REQUEST_RECEIVED, TransactionStateType.TRANSACTION_NULL, 1);\n\n // when/then ticket moves from state [1,0] -> [8,0] -> [8,1] -> [8,16] -> [16,16]\n // [1,0] -> [8,0]\n ticket.nextStateOk();\n assertTicketInState(ticket, TicketStateType.TICKET_ORDERED, TransactionStateType.TRANSACTION_NULL, 2);\n\n // [8,0] -> [8,1]\n ticket.nextStateOk();\n assertTicketInState(ticket, TicketStateType.TICKET_ORDERED, TransactionStateType.TRANSACTION_INITIALIZED, 3);\n\n // [8,1] -> [8,16]\n ticket.nextStateTransactionError(100);\n assertTicketInState(ticket, TicketStateType.TICKET_ORDERED, TransactionStateType.TRANSACTION_ERROR, 4);\n\n // [8,16] -> [16,16]\n ticket.nextStateTransactionError(200);\n assertTicketInState(ticket, TicketStateType.TICKET_ERROR, TransactionStateType.TRANSACTION_ERROR, 5);\n }", "private void checkValidDFA() throws IllegalArgumentException {\n for (State s : states) {\n Set<Character> transLabels = new HashSet<>();\n for (Transition t : getTransitionsFromState(s)) {\n if (!transLabels.add(t.getLabel())) {\n throw new IllegalArgumentException(\"State \" + s + \" has more than one transition for label \" + t.getLabel());\n }\n }\n if (!transLabels.containsAll(alphabet)) {\n Set<Character> missingSet = new HashSet<>(alphabet);\n missingSet.removeAll(transLabels);\n throw new IllegalArgumentException(\"State \" + s + \" is missing a transition for label(s): \" + missingSet);\n }\n }\n }", "private boolean isValid() throws InvalidStateException{\n if (this.homeTeam == null || this.visitingTeam == null){\n return false;\n }else{\n return true;\n }\n }", "private void checkState() {\r\n\t\tswitch (this.stepPanel.getStep()) {\r\n\t\tcase StepPanel.STEP_HOST_GRAPH:\r\n\t\t\tcheckHostGraphAndNextStep();\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_STOP_GRAPH:\r\n\t\t\tcheckStopGraphAndNextStep();\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_CRITICAL_PAIRS:\r\n\t\t\tcheckPairsAndNextStep();\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_FINISH:\r\n\t\t\tcheckIfReadyToParse();\r\n\t\t\tquitDialog();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public void checkState() {\r\n\t\tout.println(state);\r\n\t\tif(getEnergy() < 80 && getOthers() > 5) {\r\n\t\t\tstate = 1;\r\n\t\t\tturnLeft(getHeading() % 90);\r\n\t\t\tahead(moveAmount);\r\n\t\t}\r\n\t\telse if(getEnergy() < 80 && getOthers() < 5) {\r\n\t\t\tstate = 0;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tstate = 0;\r\n\t\t}\r\n\t\t\r\n\t}", "public InvalidTransitionException() {\r\n super(\"Invalid FSM Transition.\");\r\n }", "@Test\n\tvoid getEndTransitionsAfterMinimisation_LegalCase() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"a|bc*\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tArrayList<Integer> endStates = new ArrayList<Integer>();\n\t\t\tendStates.add(1);\n\t\t\tendStates.add(2);\n\t\t\tassertEquals(endStates, a.getEnd());\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\tactualScore += 10;\n\t}", "public void MovesRemainingExists() {\n InsideMovesRemainingExists = 1;\n NoMovesRemaining = 1;\n Beginning:\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n previousX = i;\n previousY = j + 1;\n if ((i + 1) < 9) {\n ValidSwitch(i + 1, j + 1);\n if (NoMovesRemaining == 0) { //checks the candies to the right\n ResetState();\n break Beginning; //breaks the loop\n }\n }\n\n if ((i - 1) >= 0) {\n ValidSwitch(i - 1, j + 1);\n if (NoMovesRemaining == 0) { //checks the candies to the left\n ResetState();\n break Beginning;\n }\n }\n\n if ((j + 1) < 9) {\n ValidSwitch(i, j + 2);\n if (NoMovesRemaining == 0) { //checks the candies on the bottom\n ResetState();\n break Beginning;\n }\n }\n\n if ((j - 1) >= 0) {\n ValidSwitch(i, j);\n if (NoMovesRemaining == 0) { //checks the candies at the top\n ResetState();\n break Beginning;\n }\n }\n }\n\n }\n InsideMovesRemainingExists = 0;\n\n}", "public ReportResult validateStages() {\n\t\tReportResult report = new ReportResult(scriptName + \" Script Report\");\n\n\t\tLocation lastApplicableLocation; // The last location that the entity was moved to\n\t\tif (getActionsForStage(1).containsKey(StageAction.START)) {\n\t\t\treport.addCheckMessage(\"Stage 1 contains a starting point for the entity\", ResultType.SUCCESS);\n\t\t\tlastApplicableLocation = ((LocationComponent) getActionsForStage(1).get(StageAction.START)).getValue();\n\t\t} else {\n\t\t\treport.addCheckMessage(\"Stage 1 does NOT contain a starting point for the entity\", ResultType.ERROR);\n\t\t\treturn report; // Further validation requires a starting position as reference\n\t\t}\n\n\t\tfor (int i = 1; i <= amountOfStages; i++) {\n\t\t\tMap<StageAction, StageComponent> actions = getActionsForStage(i);\n\n\t\t\tif (actions.isEmpty()) {\n\t\t\t\treport.addCheckMessage(\"Stage \" + i + \" is redundant: Has no actions\", ResultType.WARN);\n\t\t\t\tcontinue; // Without any actions, there is nothing more to validate here\n\t\t\t}\n\n\t\t\tint stopActionOccurrences = 0;\n\t\t\tfor (StageAction action : actions.keySet()) {\n\t\t\t\tif (action.equals(StageAction.WALK_TO)) {\n\t\t\t\t\tLocation location = ((LocationComponent) actions.get(action)).getValue();\n\t\t\t\t\tif (location.distance(lastApplicableLocation) > 20) {\n\t\t\t\t\t\treport.addCheckMessage(\"A \" + StageAction.WALK_TO.name()\n\t\t\t\t\t\t\t\t\t\t+ \" (Stage \" + i + \") action is more than 20 blocks from the last location, \"\n\t\t\t\t\t\t\t\t\t\t+ \"which will cause an execution error\",\n\t\t\t\t\t\t\t\tResultType.ERROR);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treport.addCheckMessage(\n\t\t\t\t\t\t\t\t\"The entity at Stage \" + i + \" walks no more than 20 blocks from the last location\",\n\t\t\t\t\t\t\t\tResultType.SUCCESS);\n\t\t\t\t\t}\n\n\t\t\t\t\tlastApplicableLocation = location;\n\t\t\t\t} else if (action.equals(StageAction.STOP)) {\n\t\t\t\t\tstopActionOccurrences++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (stopActionOccurrences == 0) {\n\t\t\t\treport.addCheckMessage(\"The script has no stop action meaning the entity won't despawn\",\n\t\t\t\t\t\tResultType.WARN);\n\t\t\t} else if (stopActionOccurrences > 1) {\n\t\t\t\treport.addCheckMessage(\"The script has a redundant stop action: More than 1 stop action found\",\n\t\t\t\t\t\tResultType.WARN);\n\t\t\t} else {\n\t\t\t\treport.addCheckMessage(\"There is a single stop action to end the script properly\", ResultType.SUCCESS);\n\t\t\t}\n\t\t}\n\n\t\treturn report;\n\t}", "boolean isValidMove(int move)\n\t{\n\t\treturn move >= 0 && move <= state.size() - 1 && state.get(move) == 0;\n\t}", "static int[] getState(Node root){\n if(root==null)\n return new int[]{Integer.MAX_VALUE, Integer.MIN_VALUE,0,0};\n\n int[] leftAns = getState(root.left);\n int[] rightAns = getState(root.right);\n\n if(root.val<leftAns[1] || root.val> rightAns[0]){\n //failed\n return new int[]{Integer.MAX_VALUE, Integer.MIN_VALUE,-1, Math.max(leftAns[3], rightAns[3])};\n }\n else {//(root.val>leftAns[1] && root.val<rightAns[0]){\n\n return new int[] { Math.min(leftAns[0], root.val), Math.max(rightAns[1], root.val) , leftAns[2]+rightAns[2]+1, Math.max(leftAns[2]+rightAns[2]+1,\n Math.max(leftAns[3], rightAns[3])) };\n\n }\n\n\n }", "public ShortestPathStateSpaceValidator(StateValidator validator) {\n\t\tsuper();\n\t\tif (validator==null) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tthis.validator = validator;\n\t}", "private ArrayList<int[]> findTransitionsToWithinLimits(char[] pattern) {\n ArrayList<int[]> validtransitions=new ArrayList<int[]>();\n double patternscore=getMatchScore(pattern);\n for (int i=0;i<pattern.length;i++) { // for each position\n for (int j=0;j<4;j++) {\n double newscore=patternscore+transitions[i][j];\n if (newscore>=minMatch && newscore<=maxMatch) {\n validtransitions.add(new int[]{i,j});\n }\n }\n }\n return validtransitions;\n }", "private boolean validateMove(Move m, int v, Graph g, Board B) {\n\n int final_dest_R = 0, final_dest_C = 0;\n\n final_dest_R = (m.getY() + (v / B.width));\n final_dest_C = (m.getX() + (v % B.width));\n\n\n if (final_dest_R < B.height && final_dest_R >= 0\n && final_dest_C < B.width && final_dest_C >= 0) {\n\n if (!B.a.get(final_dest_R).get(final_dest_C).Reachable) {\n return false;\n }\n\n return true;\n }\n\n\n return false;\n }", "public void setStateFromRules (int state) {\n \tswitch(state) {\n\t\tcase 31:\n\t\t\tthis.visitState = VisitState.NOT_MATCHED;\n\t\n\t\t//TODO: add more cases here\n\t}\n \t\n }", "int maxOffsetErrors(int parametricState);", "@Override\r\n\tpublic boolean isNodeValid() {\n\t\treturn (SKILLS.HITPOINTS.getActualLevel() >= 25\r\n\t\t\t\t&& SKILLS.THIEVING.getActualLevel() >= 28\r\n\t\t\t\t&& Inventory.getCount(\"Coins\") >= 30 && (Location.karamjaFirstStepCheck.atLocation(Player.getPosition()) ||Location.karamjaBoatLandTile.equals(Player.getPosition()) ));\r\n\t}", "public void solveGame3() {\n\t\tlosingStates = new HashSet<S>();\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tint[] uncontrollableCount = new int[game.getStates().size()+1];\n\t\tint[] uncontrollableLosingCount = new int[game.getStates().size()+1];\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> uncontrollableSuccesors;\n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\t uncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\n\t\t\t uncontrollableCount[indexCount] = uncontrollableSuccesors.size();\n\t\t\t uncontrollableLosingCount[indexCount] = 0;\n\t\t\t isUncontrollable[indexCount] = game.isUncontrollable(state);\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableLosingCount[i]++;\n\t\t\t\t\tif (uncontrollableLosingCount[i] == uncontrollableCount[i])\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public LinkedList<State> getNextAvailableStates() {\n LinkedList<Integer> currentSide = new LinkedList<>();\n LinkedList<Integer> otherSide = new LinkedList<>();\n LinkedList<State> newStates = new LinkedList<>();\n if(isLeft) {\n if(leftSide != null) currentSide = new LinkedList<>(leftSide);\n if(rightSide != null) otherSide = new LinkedList<>(rightSide);\n } else {\n if (rightSide != null) currentSide = new LinkedList<>(rightSide);\n if (leftSide != null) otherSide = new LinkedList<>(leftSide);\n }\n\n // add one people to the other side of the bridge\n for (int index=0; index< currentSide.size(); index++) {\n LinkedList<Integer> newCurrentSide = new LinkedList<>(currentSide);\n LinkedList<Integer> newOtherSide = new LinkedList<>(otherSide);\n int firstPeopleMoved = newCurrentSide.remove(index);\n newOtherSide.add(firstPeopleMoved);\n State state = (isLeft) ? new State(newCurrentSide, newOtherSide, !isLeft,timeTaken+firstPeopleMoved, depth+1, highestSpeed) :\n new State(newOtherSide, newCurrentSide, !isLeft, timeTaken+firstPeopleMoved, depth+1, highestSpeed);\n state.setReward(state.calculateReward(firstPeopleMoved));\n // add this as parent to the child\n state.parents = new LinkedList<>(this.parents);\n state.addParent(this);\n // set the action that get to this state\n String currentAction = \"move \" + firstPeopleMoved;\n currentAction += (isLeft) ? \" across\" : \" back\";\n state.copyActions(this); // copy all the previous actions from the parent\n state.addActions(currentAction); // add new action to state generated by parent\n // add to the new states of list\n newStates.add(state);\n // add two people to the other side of the bridge\n for (int second=0; second < newCurrentSide.size(); second++) {\n LinkedList<Integer> newSecondCurrentSide = new LinkedList<>(newCurrentSide);\n LinkedList<Integer> newSecondOtherSide = new LinkedList<>(newOtherSide);\n int secondPeopleMoved = newSecondCurrentSide.remove(second);\n newSecondOtherSide.add(secondPeopleMoved);\n int slowerSpeed = (firstPeopleMoved > secondPeopleMoved) ? firstPeopleMoved : secondPeopleMoved;\n state = (isLeft) ? new State(newSecondCurrentSide, newSecondOtherSide, !isLeft, timeTaken+slowerSpeed, depth+1, highestSpeed) :\n new State(newSecondOtherSide, newSecondCurrentSide, !isLeft, timeTaken+slowerSpeed, depth+1, highestSpeed);\n state.setReward(state.calculateReward(firstPeopleMoved, secondPeopleMoved));\n // add this as parent to the child\n state.parents = new LinkedList<>(this.parents);\n state.addParent(this);\n // set the action that get to this state\n currentAction = \"move \"+ firstPeopleMoved + \" \" + secondPeopleMoved;\n currentAction += (isLeft) ? \" across\" : \" back\";\n state.copyActions(this);\n state.addActions(currentAction);\n // add to the new states of list\n newStates.add(state);\n }\n\n }\n return newStates;\n }", "private void validate() throws FlightCreationException {\n validateNotNull(\"number\", number);\n validateNotNull(\"company name\", companyName);\n validateNotNull(\"aircraft\", aircraft);\n validateNotNull(\"pilot\", pilot);\n validateNotNull(\"origin\", origin);\n validateNotNull(\"destination\", destination);\n validateNotNull(\"departure time\", scheduledDepartureTime);\n\n if (scheduledDepartureTime.isPast()) {\n throw new FlightCreationException(\"The departure time cannot be in the past\");\n }\n\n if (origin.equals(destination)) {\n throw new FlightCreationException(\"The origin and destination cannot be the same\");\n }\n }", "public void setAsUp () \n\t{ \n\t\tn.setFailureState(true);\n\t\tfinal SortedSet<WLightpathRequest> affectedDemands = new TreeSet<> ();\n\t\tgetOutgoingFibers().forEach(f->affectedDemands.addAll(f.getTraversingLpRequestsInAtLeastOneLp()));\n\t\tgetIncomingFibers().forEach(f->affectedDemands.addAll(f.getTraversingLpRequestsInAtLeastOneLp()));\n\t\tfor (WLightpathRequest lpReq : affectedDemands)\n\t\t\tlpReq.internalUpdateOfRoutesCarriedTrafficFromFailureState();\n\t}", "public static boolean getOnePathToARGState1(ARGState pLastElement, ARGState destination) {\n Set<ARGState> seenElements = new HashSet<ARGState>();\n\n // each element of the path consists of the abstract state and the outgoing\n // edge to its successor\n\n ARGState currentARGState = pLastElement;\n // add the error node and its -first- outgoing edge\n // that edge is not important so we pick the first even\n // if there are more outgoing edges\n\n\n\n seenElements.add(currentARGState);\n\n while (!currentARGState.getParents().isEmpty() && currentARGState.getStateId() != destination.getStateId()) {\n Iterator<ARGState> parents = currentARGState.getParents().iterator();\n\n ARGState parentElement = parents.next();\n //System.out.println(currentARGState.getStateId()+\":\"+parentElement);\n while (!seenElements.add(parentElement) && parents.hasNext()) {\n // while seenElements already contained parentElement, try next parent\n parentElement = parents.next();\n // System.out.println(currentARGState.getStateId()+\":\"+parentElement);\n }\n\n currentARGState = parentElement;\n }\n if (currentARGState.getStateId() != destination.getStateId())\n return false;\n // System.out.println(\"跳出getOnePathTo\");\n return true;\n }", "private static boolean isMoveValid( int x, int y ){\n int path[] = new int[8];\n for( int distance = 1; distance < 8; distance ++ ){\n checkPath( path, 0, x + distance, y, distance );\n checkPath( path, 1, x + distance, y + distance, distance );\n checkPath( path, 2, x, y + distance, distance );\n checkPath( path, 3, x - distance, y, distance );\n checkPath( path, 4, x - distance, y - distance, distance );\n checkPath( path, 5, x, y - distance, distance );\n checkPath( path, 6, x + distance, y - distance, distance );\n checkPath( path, 7, x - distance, y + distance, distance );\n }\n for( int i = 0; i < 8; i++ ){\n if( path[ i ] > 1 ){\n return true;\n }\n }\n return false;\n }", "@Override\n\tpublic void stateCheck() {\n\t\tif(balance<0 && balance>=-1000)\n\t\t{\n\t\t\tacc.setState(new YellowState(this));\n\t\t}\n\t\telse if(balance<-1000)\n\t\t{\n\t\t\tacc.setState(new RedState(this));\n\t\t}\n\t}", "public Action[] getFeasibleActions(int[] state)\n\t{\n\t int x = state[0];\n\t int y = state[1];\n\t\tArrayList<Action> actionsList = new ArrayList<Action>();\n\n\t\tif ( x == 0) {\n\t\t\t// Action for filling x from tap\n\t\t actionsList.add(new Action(\"tap\", \"x\", 4));\n\t\t}\n\n\t\tif (y == 0) {\n\t\t\t// Action for filling y from tap\n\t\t actionsList.add(new Action(\"tap\", \"y\", 3));\n\t\t}\n\n\t\tif (x == 4) {\n\t\t\t// Action for emptying x\n\t\t\tactionsList.add(new Action(\"x\", \"ground\", x));\n\t\t}\n\n\t\tif (y == 3) {\n\t\t\t// Action for emptying y\n\t\t\tactionsList.add(new Action(\"y\", \"ground\", y));\n\t\t}\n\n // Add action for filling one jug with another\n // if only it is possible to and there is the need for it\n if ((x > 0) && ((3-y) > 0)) {\n \t// if (x >= (3 - y)) fill with ( 3 - y) else fill with x\n\t\t\tactionsList.add(new Action(\"x\", \"y\", Math.min((3-y), x)));\n }\n\n if ((y > 0) && ((4 -x) > 0)) {\n \t// If (y >= (4-x) fill with (4-x)) else fill with y\n\t actionsList.add(new Action(\"y\", \"x\", Math.min((4-x), y)));\t \n\t }\n\n Action[] actionsArray = new Action[actionsList.size()];\n\t\treturn actionsList.toArray(actionsArray);\n\t}", "private static String getStateInput() {\n\t\treturn getQuery(\"Valid State\");\n\t}", "public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public boolean canHandleString(String s){\n\t\tArrayList<State> curStates=new ArrayList<State>(startStates);\n\t\tboolean ret=false;\n\t\t//System.err.println(\"Begin Processing \"+s);//+\" with:\\n\"+curStates);\n\n\t\t\tfor(char c :s.toCharArray()){\n\t\t\t\t//copy into new array so we aren't messing with original\n\t\t\t\tArrayList<Integer> addStateIdxs = new ArrayList<Integer>();\n\t\t\t\tArrayList<Integer> removeStateIdxs = new ArrayList<Integer>();\n\t\t\t\t\n\t\t\t\t//Step 1: check all curStates for char\n\t\t\t\tfor(int i=0;i<curStates.size();i++){\n\t\t\t\t\t//Step 1.1: if curStates[i] can move to a new state,\n\t\t\t\t\tArrayList<Integer> goesTo=curStates.get(i).goesTo(\"\"+c);\n\t\t\t\t\tif(goesTo!=null && goesTo.size()>0){\n\t\t\t\t\t\t//1.1.1: add to removeStateIdxs\n\t\t\t\t\t\tremoveStateIdxs.add(i);\n\t\t\t\t\t\t//1.1.2: append to newStateIdxs\n\t\t\t\t\t\taddStateIdxs.addAll(curStates.get(i).goesTo(\"\"+c));\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//1.1.3: add to removeStateIdxs if we can't go anywhere\n\t\t\t\t\t\tremoveStateIdxs.add(i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tCollections.sort(removeStateIdxs);\n\t\t\t\t//Step 2: remove currentStates[removeStateIdxs]\n\t\t\t\tfor(int i=removeStateIdxs.size()-1;i>=0;i--){\n\t\t\t\t\tif(curStates. get(i)!=null)\n\t\t\t\t\t\tcurStates.remove(i);\n\t\t\t\t}\n\t\t\t\t//Step 3: append addStateIdxs to curState\n\t\t\t\tfor(int i:addStateIdxs){\n//\t\t\t\t\tif(theStates.get(i)!=null)\n\t\t\t\t\t\tcurStates.add(theStates.get(i));\n\t\t\t\t}\n\n\t\t\t\t//System.err.println(\"at \"+c+\": \"+curStates);\n\t\t\t}\n\t\t\t\n\t\t\tfor(State S:curStates){\n\t\t\t\tif(S.getAccept()){\n\t\t\t\t\tret=true;\n\t\t\t\t\t//System.out.println(\"ACCEPTS!\");\n\t\t\t\t}\n\t\t\t}\n//\t\t\tSystem.out.println((ret?\"ACCEPTS!\":\"REJECTS!\"));\n\t\t\n\t\treturn ret;\n\t}", "public boolean isMaxState();", "@SuppressWarnings(\"resource\")\n\tpublic synchronized void advance() {\n\t\t/*\n\t\t * Do not advance the state machine if it is still valid. This is a convenience to application code\n\t\t * that can now try to advance the state machine redundantly without it getting costly.\n\t\t * \n\t\t * Here we have to be careful. We cannot just read valid() flag as that would create reactive dependency\n\t\t * that would be invalidated a few lines below when the valid() flag is set to true.\n\t\t * Such immediate invalidation would force another controlling (outer) reactive computation to run immediately after the current one ends.\n\t\t * While such overhead is common in reactive code and it is usually acceptable, it can be very wasteful here in some important use cases,\n\t\t * for example in ReactiveLazy where it would double compute cost of all reactive computations that read new/changed ReactiveLazy.\n\t\t *\n\t\t * We cannot just check for non-null trigger either as that would make the check completely non-reactive.\n\t\t * The controlling (outer) computation wouldn't run again when the state is invalidated and advancement would stop forever.\n\t\t *\n\t\t * Instead of creating dependency on the full valid() flag, we will reactively depend only on trigger state.\n\t\t * The difference is that trigger state only tracks validity of the last controlled (inner) computation\n\t\t * while the valid() flag tracks all current and future state of the whole reactive state machine.\n\t\t * Trigger state can change only in one direction from not fired to fired while valid() changes both ways.\n\t\t * This reduction in the scope of the dependency is sufficient to avoid redundant reactive computations\n\t\t * while keeping the dependency wide enough to ensure the state machine appears to be fully reactive.\n\t\t * \n\t\t * Trigger itself is of course non-reactive, because it is a low-level reactive primitive.\n\t\t * So how do we depend on its state? We will read valid() flag but only after we have already set it to true.\n\t\t * This breaks the basic principle of reactive programming that dependencies are recorded before reads,\n\t\t * but it is safe here, because it is equivalent to a scenario, in which another thread advances the state machine\n\t\t * and the current thread executed shortly afterwards, reads the valid() flag (which is true), and returns without advancing.\n\t\t * \n\t\t * This solution is so efficient that a lot of code can just blindly advance all the time without ever checking valid().\n\t\t * This may be actually more performant thanks to the reduced dependency optimization.\n\t\t */\n\t\tif (trigger != null) {\n\t\t\t/*\n\t\t\t * If the trigger is non-null, then valid() is true and we can just return without advancing.\n\t\t\t * We will record dependency on valid() to ensure that the controlling (outer) computation\n\t\t\t * tries to advance the state machine again when valid() becomes false.\n\t\t\t */\n\t\t\tvalid.get();\n\t\t\treturn;\n\t\t}\n\t\tReactiveScope scope = OwnerTrace.of(new ReactiveScope())\n\t\t\t.parent(this)\n\t\t\t.target();\n\t\tif (pins != null)\n\t\t\tscope.pins(pins);\n\t\tpins = null;\n\t\ttry (CloseableScope computation = scope.enter()) {\n\t\t\tReactiveValue<T> value = ReactiveValue.capture(supplier);\n\t\t\t/*\n\t\t\t * We will be sending two invalidations to the controlling reactive computation.\n\t\t\t * We will first discourage redundant advancement by setting valid() to true.\n\t\t\t * Only then we set the output. This prevents unnecessary attempts to advance the state machine.\n\t\t\t */\n\t\t\tvalid.set(true);\n\t\t\toutput.value(value);\n\t\t}\n\t\t/*\n\t\t * As mentioned above, we will create dependency on valid() to ensure the controlling (outer) computation\n\t\t * tries to advance again when the current state is invalidated, i.e. when valid() is set to false.\n\t\t * We have to do this after setting valid() to true above to avoid immediately invalidating current computation.\n\t\t * We also have to do it before arming the trigger, because trigger could fire immediately (inline)\n\t\t * and such firing involves setting valid() to false, by which time the dependency on valid() must already exist.\n\t\t * We have to be additionally careful not to create the dependency inside the controlled (inner) computation.\n\t\t */\n\t\tvalid.get();\n\t\tif (scope.blocked())\n\t\t\tpins = scope.pins();\n\t\ttrigger = OwnerTrace\n\t\t\t.of(new ReactiveTrigger()\n\t\t\t\t.callback(this::invalidate))\n\t\t\t.parent(this)\n\t\t\t.target();\n\t\t/*\n\t\t * Arming the trigger can cause it to fire immediately.\n\t\t * We don't worry about that, because our invalidation callback is very fast and non-conflicting.\n\t\t */\n\t\ttrigger.arm(scope.versions());\n\t}", "T transformToAndValidateInitialState(VendingMachine vendingMachine);", "@Test\n public void blockArea() {\n EdgeIteratorState edge1 = graph.edge(0, 1).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(10).set(speedEnc, 10, 10);\n EdgeIteratorState edge2 = graph.edge(2, 3).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(0, 4).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(4, 5).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(6, 3).setDistance(100).set(speedEnc, 10, 10);\n\n // usually we would take the direct route\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE), 3, 30, 3000, nodes(0, 1, 2, 3));\n\n // with forced edges we might have to go around\n assertPath(calcPath(0, 3, 3, ANY_EDGE), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n assertPath(calcPath(0, 3, ANY_EDGE, 6), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n\n // with avoided edges we also have to take a longer route\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE, createAvoidEdgeWeighting(edge1)), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE, createAvoidEdgeWeighting(edge2)), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n\n // enforcing forbidden start/target edges still does not allow using them\n assertNotFound(calcPath(0, 3, edge1.getEdge(), edge2.getEdge(), createAvoidEdgeWeighting(edge1)));\n assertNotFound(calcPath(0, 3, edge1.getEdge(), edge2.getEdge(), createAvoidEdgeWeighting(edge2)));\n\n // .. even when the nodes are just next to each other\n assertNotFound(calcPath(0, 1, edge1.getEdge(), ANY_EDGE, createAvoidEdgeWeighting(edge1)));\n assertNotFound(calcPath(0, 1, ANY_EDGE, edge2.getEdge(), createAvoidEdgeWeighting(edge2)));\n }", "private boolean shouldReplanPath(State.StateView state, History.HistoryView history, Stack<MapLocation> currentPath)\n {\n \t\t/* TODO: Write this method\n \t\t * Check if the path is blocked every step or check if the next spot is blocked?\n \t\t * Does enemy attack if you get too close?\n \t\t */\n \t\n \t\n \t\t//checking if the next step is blocked\n \t\t//setting up local fields\n \t\tUnitView enemy = state.getUnit(enemyFootmanID);\n \t\tMapLocation next;\n \t\tif (!path.isEmpty()) {\n \t\t\tnext = path.peek();\n \t\t\n \t\t\tif(next.x == enemy.getXPosition() && next.y == enemy.getYPosition()) \n \t\t\t\treturn true;\n \t\t\t\n \t\t}\n \t\t\n return false;\n }", "private void checkLegal() {\n\tif (undoStack.size() == 2) {\n ArrayList<Integer> canGo = \n getMoves(undoStack.get(0), curBoard);\n boolean isLegal = false;\n int moveTo = undoStack.get(1);\n for (int i = 0; i < canGo.size(); i++) {\n if(canGo.get(i) == moveTo) {\n isLegal = true;\n break;\n }\n }\n\n if(isLegal) {\n curBoard = moveUnit(undoStack.get(0), \n moveTo, curBoard);\n clearStack();\n\n moveCount++;\n\t setChanged();\n\t notifyObservers();\n }\n\t}\n }", "void blockState(BooleanFormula pState, int pMaxLevel, CFANode pLocation);", "private HashMap<List<Integer>,List<Integer>> obtainValidActions(){\n\t\tHashMap<List<Integer>,List<Integer>> mapp= new HashMap<List<Integer>,List<Integer>>();\n\t\tfor (int i = 0;i<states.size();i++) {\n\t\t\tList<Integer> act= new ArrayList<Integer>();\n\t\t\tfor (int j = 0; j < actions.size(); j++) {\n\t\t\t\tif (isActionValid(states.get(i), actions.get(j))) \n\t\t\t\t\t//System.out.println(\"Inside Validation if\\n\");\n\t\t\t\t\tact.add(j);\n\t\t\t}\n\t\t\tmapp.put(states.get(i),act);\n\t\t}\n\t\treturn mapp;\n\t}", "public boolean isValid(GameState gameState);", "@Override\n\tpublic boolean isStartingState(State state, MaxNode maxNode) {\n\t\treturn false;\n\t}", "public boolean checkExplosiveState () { return isExploding;}", "private int handleStateTransition(int r18, int r19, java.lang.String r20, java.lang.String r21) {\n /*\n r17 = this;\n r1 = r17\n r0 = r18\n r2 = r19\n r3 = r20\n r4 = r21\n com.thoughtworks.xstream.core.util.FastStack r5 = r1.stack\n int r5 = r5.size()\n com.thoughtworks.xstream.core.util.FastStack r6 = r1.stack\n java.lang.Object r6 = r6.peek()\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$StackElement r6 = (com.thoughtworks.xstream.io.json.AbstractJsonWriter.StackElement) r6\n java.lang.Class r6 = r6.type\n r7 = 0\n r8 = 1\n if (r5 <= r8) goto L_0x0026\n boolean r9 = r1.isArray(r6)\n if (r9 == 0) goto L_0x0026\n r9 = 1\n goto L_0x0027\n L_0x0026:\n r9 = 0\n L_0x0027:\n if (r5 <= r8) goto L_0x003c\n com.thoughtworks.xstream.core.util.FastStack r10 = r1.stack\n int r11 = r5 + -2\n java.lang.Object r10 = r10.get(r11)\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$StackElement r10 = (com.thoughtworks.xstream.io.json.AbstractJsonWriter.StackElement) r10\n java.lang.Class r10 = r10.type\n boolean r10 = r1.isArray(r10)\n if (r10 == 0) goto L_0x003c\n r7 = 1\n L_0x003c:\n r10 = 64\n r11 = 4\n if (r0 == r8) goto L_0x0353\n r13 = 128(0x80, float:1.794E-43)\n r14 = 2\n if (r0 == r14) goto L_0x0326\n r15 = 8\n r14 = 32\n r12 = 16\n r8 = 512(0x200, float:7.175E-43)\n if (r0 == r11) goto L_0x02c9\n java.lang.String r16 = \"@\"\n java.lang.String r11 = \"\"\n if (r0 == r15) goto L_0x01e9\n if (r0 == r12) goto L_0x01eb\n r12 = 256(0x100, float:3.59E-43)\n if (r0 == r14) goto L_0x01ca\n if (r0 == r10) goto L_0x0111\n if (r0 == r13) goto L_0x00b5\n if (r0 == r12) goto L_0x009c\n if (r0 != r8) goto L_0x0096\n r4 = 1\n if (r2 == r4) goto L_0x0087\n if (r2 == r13) goto L_0x007d\n if (r2 != r12) goto L_0x0077\n int r0 = r1.mode\n r3 = 4\n r0 = r0 & r3\n if (r0 != 0) goto L_0x0076\n if (r9 == 0) goto L_0x0076\n r17.endArray()\n L_0x0076:\n return r2\n L_0x0077:\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException r4 = new com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException\n r4.<init>(r0, r2, r3)\n throw r4\n L_0x007d:\n r3 = 0\n int r0 = r1.handleStateTransition(r0, r12, r3, r3)\n r4 = 2\n r1.handleStateTransition(r0, r4, r3, r3)\n return r2\n L_0x0087:\n r3 = 0\n r4 = 2\n int r0 = r1.handleStateTransition(r0, r12, r3, r3)\n int r0 = r1.handleStateTransition(r0, r4, r3, r3)\n r4 = 1\n r1.handleStateTransition(r0, r4, r3, r3)\n return r2\n L_0x0096:\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException r4 = new com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException\n r4.<init>(r0, r2, r3)\n throw r4\n L_0x009c:\n r4 = 2\n if (r2 != r4) goto L_0x00af\n int r0 = r1.mode\n r3 = 4\n r0 = r0 & r3\n if (r0 == 0) goto L_0x00ae\n r17.endArray()\n r17.endArray()\n r17.endObject()\n L_0x00ae:\n return r2\n L_0x00af:\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException r4 = new com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException\n r4.<init>(r0, r2, r3)\n throw r4\n L_0x00b5:\n r10 = 1\n if (r2 == r10) goto L_0x0106\n r10 = 2\n if (r2 == r10) goto L_0x00d3\n r10 = 4\n if (r2 == r10) goto L_0x00d5\n if (r2 == r13) goto L_0x00d3\n if (r2 != r12) goto L_0x00cd\n int r0 = r1.mode\n r0 = r0 & r10\n if (r0 != 0) goto L_0x00cc\n if (r9 == 0) goto L_0x00cc\n r17.endArray()\n L_0x00cc:\n return r2\n L_0x00cd:\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException r4 = new com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException\n r4.<init>(r0, r2, r3)\n throw r4\n L_0x00d3:\n r3 = 0\n goto L_0x00f2\n L_0x00d5:\n r17.nextElement()\n if (r7 != 0) goto L_0x0111\n int r10 = r1.mode\n r14 = 4\n r10 = r10 & r14\n if (r10 != 0) goto L_0x0111\n java.lang.String r0 = r1.encodeNode(r3)\n r1.addLabel(r0)\n int r0 = r1.mode\n r0 = r0 & r14\n if (r0 != 0) goto L_0x00f1\n if (r9 == 0) goto L_0x00f1\n r17.startArray()\n L_0x00f1:\n return r2\n L_0x00f2:\n int r0 = r1.handleStateTransition(r0, r12, r3, r3)\n r10 = 2\n r1.handleStateTransition(r0, r10, r3, r3)\n int r0 = r1.mode\n r3 = 4\n r0 = r0 & r3\n if (r0 != 0) goto L_0x0105\n if (r9 != 0) goto L_0x0105\n r17.endObject()\n L_0x0105:\n return r2\n L_0x0106:\n r3 = 0\n r10 = 2\n int r0 = r1.handleStateTransition(r0, r10, r3, r3)\n r4 = 1\n r1.handleStateTransition(r0, r4, r3, r3)\n return r2\n L_0x0111:\n r10 = 2\n r14 = 4\n if (r2 == r14) goto L_0x0192\n if (r2 == r13) goto L_0x0182\n if (r2 == r12) goto L_0x0182\n if (r2 != r8) goto L_0x017c\n int r0 = r1.mode\n r0 = r0 & r10\n if (r0 == 0) goto L_0x012b\n if (r5 == r10) goto L_0x0123\n goto L_0x012b\n L_0x0123:\n com.thoughtworks.xstream.converters.ConversionException r0 = new com.thoughtworks.xstream.converters.ConversionException\n java.lang.String r2 = \"Single value cannot be root element\"\n r0.<init>((java.lang.String) r2)\n throw r0\n L_0x012b:\n if (r4 != 0) goto L_0x0148\n java.lang.Class<com.thoughtworks.xstream.mapper.Mapper$Null> r0 = com.thoughtworks.xstream.mapper.Mapper.Null.class\n if (r6 != r0) goto L_0x0139\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$Type r0 = com.thoughtworks.xstream.io.json.AbstractJsonWriter.Type.NULL\n java.lang.String r3 = \"null\"\n r1.addValue(r3, r0)\n goto L_0x017b\n L_0x0139:\n int r0 = r1.mode\n r3 = 4\n r0 = r0 & r3\n if (r0 != 0) goto L_0x017b\n if (r9 != 0) goto L_0x017b\n r17.startObject()\n r17.endObject()\n goto L_0x017b\n L_0x0148:\n int r0 = r1.mode\n r0 = r0 & r15\n if (r0 == 0) goto L_0x0174\n java.lang.Class r0 = java.lang.Long.TYPE\n if (r6 == r0) goto L_0x0155\n java.lang.Class<java.lang.Long> r0 = java.lang.Long.class\n if (r6 != r0) goto L_0x0174\n L_0x0155:\n long r7 = java.lang.Long.parseLong(r21)\n r9 = 9007199254740992(0x20000000000000, double:4.450147717014403E-308)\n int r0 = (r7 > r9 ? 1 : (r7 == r9 ? 0 : -1))\n if (r0 > 0) goto L_0x016e\n r9 = -9007199254740992(0xffe0000000000000, double:-8.98846567431158E307)\n int r0 = (r7 > r9 ? 1 : (r7 == r9 ? 0 : -1))\n if (r0 >= 0) goto L_0x0166\n goto L_0x016e\n L_0x0166:\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$Type r0 = r1.getType(r6)\n r1.addValue(r4, r0)\n goto L_0x017b\n L_0x016e:\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$Type r0 = com.thoughtworks.xstream.io.json.AbstractJsonWriter.Type.STRING\n r1.addValue(r4, r0)\n goto L_0x017b\n L_0x0174:\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$Type r0 = r1.getType(r6)\n r1.addValue(r4, r0)\n L_0x017b:\n return r2\n L_0x017c:\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException r4 = new com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException\n r4.<init>(r0, r2, r3)\n throw r4\n L_0x0182:\n int r0 = r1.mode\n r3 = 4\n r0 = r0 & r3\n if (r0 != 0) goto L_0x0191\n if (r9 == 0) goto L_0x018e\n r17.endArray()\n goto L_0x0191\n L_0x018e:\n r17.endObject()\n L_0x0191:\n return r2\n L_0x0192:\n int r0 = r1.mode\n r6 = 1\n r0 = r0 & r6\n if (r0 == 0) goto L_0x019e\n r0 = 2\n if (r5 <= r0) goto L_0x019c\n goto L_0x019e\n L_0x019c:\n r3 = 4\n goto L_0x01bf\n L_0x019e:\n if (r7 == 0) goto L_0x01a6\n int r0 = r1.mode\n r5 = 4\n r0 = r0 & r5\n if (r0 == 0) goto L_0x01b6\n L_0x01a6:\n boolean r0 = r11.equals(r4)\n if (r0 != 0) goto L_0x01af\n r17.startObject()\n L_0x01af:\n java.lang.String r0 = r1.encodeNode(r3)\n r1.addLabel(r0)\n L_0x01b6:\n int r0 = r1.mode\n r3 = 4\n r0 = r0 & r3\n if (r0 == 0) goto L_0x01bf\n r17.startArray()\n L_0x01bf:\n int r0 = r1.mode\n r0 = r0 & r3\n if (r0 != 0) goto L_0x01c9\n if (r9 == 0) goto L_0x01c9\n r17.startArray()\n L_0x01c9:\n return r2\n L_0x01ca:\n r4 = 2\n if (r2 == r4) goto L_0x01df\n if (r2 != r10) goto L_0x01d9\n int r0 = r1.mode\n r3 = 4\n r0 = r0 & r3\n if (r0 != 0) goto L_0x01e8\n r17.nextElement()\n goto L_0x01e8\n L_0x01d9:\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException r4 = new com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException\n r4.<init>(r0, r2, r3)\n throw r4\n L_0x01df:\n r0 = 0\n int r3 = r1.handleStateTransition(r10, r12, r0, r0)\n r4 = 2\n r1.handleStateTransition(r3, r4, r0, r0)\n L_0x01e8:\n return r2\n L_0x01e9:\n if (r2 == r12) goto L_0x02a0\n L_0x01eb:\n r5 = 1\n if (r2 == r5) goto L_0x0291\n r5 = 4\n if (r2 == r5) goto L_0x01f9\n if (r2 == r12) goto L_0x0220\n if (r2 == r14) goto L_0x020b\n if (r2 == r13) goto L_0x0201\n if (r2 != r8) goto L_0x01fb\n L_0x01f9:\n r5 = 0\n goto L_0x0250\n L_0x01fb:\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException r4 = new com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException\n r4.<init>(r0, r2, r3)\n throw r4\n L_0x0201:\n r3 = 0\n int r0 = r1.handleStateTransition(r0, r14, r3, r3)\n r4 = 2\n r1.handleStateTransition(r0, r4, r3, r3)\n return r2\n L_0x020b:\n int r3 = r1.mode\n r4 = 4\n r3 = r3 & r4\n if (r3 == 0) goto L_0x021f\n if (r0 != r12) goto L_0x0216\n r17.endObject()\n L_0x0216:\n r17.endArray()\n r17.nextElement()\n r17.startArray()\n L_0x021f:\n return r2\n L_0x0220:\n if (r9 == 0) goto L_0x0229\n int r0 = r1.mode\n r5 = 4\n r0 = r0 & r5\n if (r0 == 0) goto L_0x024f\n goto L_0x022a\n L_0x0229:\n r5 = 4\n L_0x022a:\n r17.nextElement()\n java.lang.StringBuilder r0 = new java.lang.StringBuilder\n r0.<init>()\n int r6 = r1.mode\n r5 = r5 & r6\n if (r5 != 0) goto L_0x0239\n r11 = r16\n L_0x0239:\n r0.append(r11)\n r0.append(r3)\n java.lang.String r0 = r0.toString()\n java.lang.String r0 = r1.encodeAttribute(r0)\n r1.addLabel(r0)\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$Type r0 = com.thoughtworks.xstream.io.json.AbstractJsonWriter.Type.STRING\n r1.addValue(r4, r0)\n L_0x024f:\n return r2\n L_0x0250:\n int r0 = r1.handleStateTransition(r0, r14, r5, r5)\n int r0 = r1.handleStateTransition(r0, r10, r5, r5)\n r5 = 2\n if (r2 == r5) goto L_0x0287\n r5 = 4\n if (r2 == r5) goto L_0x027c\n if (r2 == r8) goto L_0x0261\n goto L_0x0290\n L_0x0261:\n int r3 = r1.mode\n r3 = r3 & r5\n if (r3 != 0) goto L_0x026f\n java.lang.String r3 = \"$\"\n java.lang.String r3 = r1.encodeNode(r3)\n r1.addLabel(r3)\n L_0x026f:\n r3 = 0\n r1.handleStateTransition(r0, r8, r3, r4)\n int r0 = r1.mode\n r0 = r0 & r5\n if (r0 != 0) goto L_0x0290\n r17.endObject()\n goto L_0x0290\n L_0x027c:\n int r4 = r1.mode\n r4 = r4 & r5\n if (r4 != 0) goto L_0x0282\n goto L_0x0283\n L_0x0282:\n r11 = 0\n L_0x0283:\n r1.handleStateTransition(r0, r5, r3, r11)\n goto L_0x0290\n L_0x0287:\n r3 = 0\n int r0 = r1.handleStateTransition(r0, r8, r3, r3)\n r4 = 2\n r1.handleStateTransition(r0, r4, r3, r3)\n L_0x0290:\n return r2\n L_0x0291:\n r3 = 0\n r4 = 2\n int r0 = r1.handleStateTransition(r0, r14, r3, r3)\n int r0 = r1.handleStateTransition(r0, r4, r3, r3)\n r4 = 1\n r1.handleStateTransition(r0, r4, r3, r3)\n return r2\n L_0x02a0:\n if (r3 == 0) goto L_0x02c8\n java.lang.StringBuilder r0 = new java.lang.StringBuilder\n r0.<init>()\n int r5 = r1.mode\n r6 = 4\n r5 = r5 & r6\n if (r5 != 0) goto L_0x02af\n r11 = r16\n L_0x02af:\n r0.append(r11)\n r0.append(r3)\n java.lang.String r0 = r0.toString()\n r17.startObject()\n java.lang.String r0 = r1.encodeAttribute(r0)\n r1.addLabel(r0)\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$Type r0 = com.thoughtworks.xstream.io.json.AbstractJsonWriter.Type.STRING\n r1.addValue(r4, r0)\n L_0x02c8:\n return r2\n L_0x02c9:\n r5 = 1\n if (r2 == r5) goto L_0x02f9\n r6 = 4\n if (r2 == r6) goto L_0x02fa\n if (r2 == r15) goto L_0x02f0\n if (r2 == r12) goto L_0x02de\n if (r2 == r13) goto L_0x02fa\n if (r2 != r8) goto L_0x02d8\n goto L_0x02fa\n L_0x02d8:\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException r4 = new com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException\n r4.<init>(r0, r2, r3)\n throw r4\n L_0x02de:\n int r5 = r1.mode\n r5 = r5 & r6\n if (r5 != 0) goto L_0x02e7\n if (r9 != 0) goto L_0x02e6\n goto L_0x02e7\n L_0x02e6:\n return r6\n L_0x02e7:\n r5 = 0\n int r0 = r1.handleStateTransition(r0, r15, r5, r5)\n r1.handleStateTransition(r0, r12, r3, r4)\n return r2\n L_0x02f0:\n int r0 = r1.mode\n r0 = r0 & r6\n if (r0 == 0) goto L_0x02f8\n r17.startArray()\n L_0x02f8:\n return r2\n L_0x02f9:\n r6 = 4\n L_0x02fa:\n if (r7 == 0) goto L_0x0304\n int r5 = r1.mode\n r5 = r5 & r6\n if (r5 == 0) goto L_0x0302\n goto L_0x0304\n L_0x0302:\n r5 = 0\n goto L_0x030c\n L_0x0304:\n r5 = 0\n int r0 = r1.handleStateTransition(r0, r15, r5, r5)\n r1.handleStateTransition(r0, r14, r5, r5)\n L_0x030c:\n r0 = 1\n if (r2 == r0) goto L_0x031e\n if (r2 == r6) goto L_0x031a\n if (r2 == r13) goto L_0x031e\n if (r2 == r8) goto L_0x0316\n goto L_0x0325\n L_0x0316:\n r1.handleStateTransition(r10, r8, r5, r4)\n goto L_0x0325\n L_0x031a:\n r1.handleStateTransition(r10, r6, r3, r5)\n goto L_0x0325\n L_0x031e:\n int r0 = r1.handleStateTransition(r10, r8, r5, r5)\n r1.handleStateTransition(r0, r2, r5, r5)\n L_0x0325:\n return r2\n L_0x0326:\n r6 = 4\n r4 = 1\n if (r2 == r4) goto L_0x0341\n if (r2 == r6) goto L_0x0338\n if (r2 != r13) goto L_0x0332\n r17.nextElement()\n return r2\n L_0x0332:\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException r4 = new com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException\n r4.<init>(r0, r2, r3)\n throw r4\n L_0x0338:\n r4 = 0\n int r0 = r1.handleStateTransition(r0, r13, r4, r4)\n r1.handleStateTransition(r0, r6, r3, r4)\n return r2\n L_0x0341:\n int r0 = r1.mode\n r3 = 1\n r0 = r0 & r3\n if (r0 == 0) goto L_0x034a\n r0 = 2\n if (r5 <= r0) goto L_0x0352\n L_0x034a:\n int r0 = r1.mode\n r0 = r0 & r6\n if (r0 != 0) goto L_0x0352\n r17.endObject()\n L_0x0352:\n return r2\n L_0x0353:\n r6 = 4\n if (r2 != r6) goto L_0x035b\n r0 = 0\n r1.handleStateTransition(r10, r6, r3, r0) // Catch:{ Throwable -> 0x0361 }\n return r2\n L_0x035b:\n com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException r4 = new com.thoughtworks.xstream.io.json.AbstractJsonWriter$IllegalWriterStateException\n r4.<init>(r0, r2, r3)\n throw r4\n L_0x0361:\n r0 = move-exception\n r2 = r0\n throw r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.thoughtworks.xstream.io.json.AbstractJsonWriter.handleStateTransition(int, int, java.lang.String, java.lang.String):int\");\n }", "private void setupDFA() {\r\n\t\tcurrentState = 0;\r\n\t\tif (actor.getScheduleFSM() == null) {\r\n\t\t\t// generate trivial DFA in case there is no schedule fsm.\r\n\t\t\t// 1. only one state\r\n\t\t\t// 2. all actions are eligible\r\n\t\t\t// 3. the successor state is always the same\r\n\t\t\teligibleActions = new Action [][] {actions};\r\n\t\t\tsuccessorState = new int [1] [actions.length];\r\n\t\t\tfor (int i = 0; i < actions.length; i++) {\r\n\t\t\t\tsuccessorState[0][i] = 0;\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tSet stateSets = new HashSet();\r\n\t\t// put initial state into set of state sets\r\n\t\tSet initialState = Collections.singleton(actor.getScheduleFSM().getInitialState());\r\n\t\tstateSets.add(initialState);\r\n\t\tint previousSize = 0;\r\n\t\t// iterate until fixed-point, i.e. we cannot reach any new state set\r\n\t\twhile (previousSize != stateSets.size()) {\r\n\t\t\tpreviousSize = stateSets.size();\r\n\t\t\t// for each action...\r\n\t\t\tfor (int i = 0; i < actions.length; i ++) {\r\n\t\t\t\tSet nextStates = new HashSet();\r\n\t\t\t\t// ... compute the set of states that can be reached through it... \r\n\t\t\t\tfor (Iterator j = stateSets.iterator(); j.hasNext(); ) {\r\n\t\t\t\t\tSet s = (Set) j.next();\r\n\t\t\t\t\tif (isEligibleAction(s, actions[i])) {\r\n\t\t\t\t\t\tnextStates.add(computeNextStateSet(s, actions[i]));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// ... and add them to the state set\r\n\t\t\t\tstateSets.addAll(nextStates);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// The set of all reachable state sets is the state space of the NDA. \r\n\t\tndaStateSets = (Set []) new ArrayList(stateSets).toArray(new Set[stateSets.size()]);\r\n\t\t// Make sure the initial state is state 0.\r\n\t\tfor (int i = 0; i < ndaStateSets.length; i++) {\r\n\t\t\tif (ndaStateSets[i].equals(initialState)) {\r\n\t\t\t\tSet s = ndaStateSets[i];\r\n\t\t\t\tndaStateSets[i] = ndaStateSets[0];\r\n\t\t\t\tndaStateSets[0] = s;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\teligibleActions = new Action [ndaStateSets.length] [];\r\n\t\tsuccessorState = new int [ndaStateSets.length] [];\r\n\t\t// For each state set (i.e. each NDA state), identify the eligible actions,\r\n\t\t// and also the successor state set (i.e. the successor state in the NDA).\r\n\t\tfor (int i = 0; i < ndaStateSets.length; i++) {\r\n\t\t\tList ea = new ArrayList();\r\n\t\t\tList ss = new ArrayList();\r\n\t\t\tfor (int j = 0; j < actions.length; j++) {\r\n\t\t\t\tif (isEligibleAction(ndaStateSets[i], actions[j])) {\r\n\t\t\t\t\tea.add(actions[j]);\r\n\t\t\t\t\tss.add(computeNextStateSet(ndaStateSets[i], actions[j]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\teligibleActions[i] = (Action []) ea.toArray(new Action[ea.size()]);\r\n\t\t\tList ds = Arrays.asList(ndaStateSets); // so we can use List.indexOf()\r\n\t\t\tsuccessorState[i] = new int [ss.size()];\r\n\t\t\t// locta the NDA successor state in array\r\n\t\t\tfor (int j = 0; j < ss.size(); j++) {\r\n\t\t\t\tsuccessorState[i][j] = ds.indexOf(ss.get(j));\r\n\t\t\t\t\r\n\t\t\t\t// must be in array, because we iterated until reaching a fixed point.\r\n\t\t\t\tassert successorState[i][j] >= 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void seeRoute() {\n\t\tRoute route = game.getIncidentRoutes();\n\t\tSystem.out.println(route);\n\t\tSystem.out.println(\"Total sailing days required is \"+ game.calculateSailingDays(route)+\" days\");\n\t\tboolean state = false;\n\t\twhile (state == false) {\n\t\t\tSystem.out.println(\"Choose your actions: \");\n\t\t\tSystem.out.println(\"(1) Go back!\");\n\t\t\tSystem.out.println(\"(2) Set Sail\");\n\t\t\ttry { \n\t\t\t\tint selectedAction = scanner.nextInt();\n\t\t\t\tif (selectedAction <= 2 && selectedAction > 0) {\n\t\t\t\tstate = true;\n\t\t\t\tif (selectedAction == 1) {\n\t\t\t\t\tgame.backToMain();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (game.isIslandReachable(route)) {\n\t\t\t\t\t\tif (game.checkMyShipHealth()) {\n\t\t\t\t\t\t\tgame.payCrew(route);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out.println(\"You should repair your ship first!\" + \"\\n\" + \"you will be redirected to store at your current Island\" + \"\\n\");\n\t\t\t\t\t\t\tgame.repairMyShip();\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\tSystem.out.println(\"This Island is not accessible because you don't have enough days left, you can choose other Island\");\n\t\t\t\t\t\tgame.backToMain();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Please choose from actions above\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(INPUT_REQUIREMENTS);\n\t\t\t\tscanner.nextLine();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public boolean validateState(String state, int line)\n {\n if (!statesModel.validateState(state))\n {\n ThreadLocalToolkit.log(new StateResolutionError(state), getSourcePath(), line);\n return false;\n }\n return true;\n }", "private Estado getStateError() {\n\t\tEstado state = null;\n\t\tif (!automata.containState(cerraduras.size())) {\n\t\t\tstate = new Estado(cerraduras.size());\n\t\t\tstate.setError(true);\n\t\t\tautomata.addEstado(state);\n\t\t} else {\n\t\t\tstate = automata.getState(cerraduras.size());\n\t\t}\n\t\treturn state;\n\t}", "public int calculateMisplacedTiles(List<Integer> currentState, List<Integer> goalState) {\n\t\tint edgeCost = 0;\n\t\tfor (int index = 0; index < currentState.size(); index++) {\n\t\t\tif(currentState.get(index).equals(0)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!currentState.get(index).equals(goalState.get(index))) {\n\t\t\t\tedgeCost++;\n\t\t\t}\n\t\t}\n\t\treturn edgeCost;\n\t}", "private Action bestActionFromFinishedTree() {\n return Collections.max(validActionsDiscretized, Comparator.comparing(\n c -> root.getActionReward(c) / (double) root.getActionVisits(c)));\n }", "public boolean validMove(TileEnum from, TileEnum to) {\n if (!isMyTurn() || hasMoved()\n || (getMyPlayerNumber() == 1 && TileStateEnum.PLAYERONE != getTileState(from))\n || (getMyPlayerNumber() == 2 && TileStateEnum.PLAYERTWO != getTileState(from)))\n return false;\n\n List<TileEnum> fromNeighbors = getNeighborsOf(from);\n for (TileEnum otherTile : fromNeighbors) {\n if (to.equals(otherTile)) return TileStateEnum.FREE.equals(getTileState(otherTile));\n\n List<TileEnum> otherNeighbors = getNeighborsOf(otherTile);\n for (TileEnum anotherTile : otherNeighbors) {\n if (to.equals(anotherTile)) return TileStateEnum.FREE.equals(getTileState(anotherTile));\n }\n }\n return false;\n }", "public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private TraversalResult traverseAction(DeterministicBoardStateNode current, String currentState, String action, int depth, double sampleRate, double maxSamples,\n boolean filterLethal, RNGBoardStateNode nextRNG) {\n ResolutionResult result = this.b.executePlayerAction(new StringTokenizer(action));\n BoardStateNode node;\n double nextMaxSamples = maxSamples;\n double nextSampleRate = sampleRate;\n if (depth + 1 >= SAMPLING_MIN_DEPTH) {\n if (depth + 1 == SAMPLING_MIN_DEPTH) {\n nextMaxSamples = this.config.maxSamples;\n } else {\n nextMaxSamples = maxSamples * this.config.maxSamplesMultiplier;\n }\n nextSampleRate = sampleRate * current.getWeightedProportionOfAction(action) * this.config.sampleRateMultiplier;\n }\n if (result.rng) {\n // the number of trials we've already done to get to this node\n int cumTrials = 0;\n if (nextRNG != null) {\n String state = this.b.stateToString();\n UUID stateHash = UUID.nameUUIDFromBytes(state.getBytes());\n cumTrials += nextRNG.getCount(this.nodeMap.get(stateHash));\n }\n nextSampleRate *= 1 - (this.config.rngPenalty * Math.pow(this.config.rngPenaltyReduction, cumTrials));\n }\n if (this.b.getWinner() != 0 || depth == SAMPLING_MAX_DEPTH) {\n // no more actions can be taken\n node = new TerminalBoardStateNode(current.team, evaluateAdvantage(this.b, current.team));\n if (!result.rng && this.b.getWinner() == current.team) {\n current.lethal = true; // the current node has an action that results in a lethal 100% of the time\n }\n } else if (Integer.parseInt(action.substring(0, 1)) == EndTurnAction.ID || this.b.getCurrentPlayerTurn() != current.team) {\n // assess what's the worst the opponent can do\n if (filterLethal) {\n // not part of my pay grade\n node = new TerminalBoardStateNode(current.team * -1, evaluateAdvantage(this.b, current.team * -1));\n } else {\n node = this.getBestTurn(current.team * -1, depth + 1,\n Math.max(nextSampleRate, this.config.enemySampleRate),\n Math.max(nextMaxSamples, this.config.maxSamplesEnemy),\n true);\n }\n } else {\n DeterministicBoardStateNode dbsn = this.getBestTurn(current.team, depth + 1, nextSampleRate, nextMaxSamples, filterLethal);\n if (dbsn == null) {\n // something went wrong, here's a bandaid\n node = new TerminalBoardStateNode(current.team, evaluateAdvantage(this.b, current.team));\n } else {\n if (dbsn.lethal) {\n current.lethal = true; // the current node has an action that leads to a node that eventually results in lethal\n }\n node = dbsn;\n }\n }\n List<Event> undoStack = new LinkedList<>(result.events);\n while (!undoStack.isEmpty()) {\n undoStack.get(undoStack.size() - 1).undo(this.b);\n undoStack.remove(undoStack.size() - 1);\n }\n // aura difference checking isn't updated by undoing, we have to update it ourselves\n this.b.updateAuraLastCheck();\n this.b.updateDependentStatsLastCheck();\n String stateAfterUndo = this.b.stateToString();\n if (!currentState.equals(stateAfterUndo)) {\n System.out.println(\n \"Discrepancy after executing \" + action + \", rng = \" + result.rng + \", depth = \" + depth);\n for (Event e : result.events) {\n System.out.print(e.toString());\n }\n System.out.println(\"Before:\");\n System.out.println(currentState);\n System.out.println(\"After:\");\n System.out.println(stateAfterUndo);\n throw new RuntimeException();\n }\n return new TraversalResult(node, result.rng);\n }", "@Test\n public void stateTransitionsTest() throws ApiException {\n Long loanId = null;\n PostSelfLoansLoanIdRequest body = null;\n String command = null;\n PostSelfLoansLoanIdResponse response = api.stateTransitions(loanId, body, command);\n\n // TODO: test validations\n }", "public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public boolean validate(LineState state) {\n\t\tAugmentedNode<ILineSegment> s = state.root();\n\t\tif (s == null) return true;\n\t\t\n\t\treturn validateNode(s);\n\t}", "protected boolean isTransferTransactionValid(StateTransferTransaction tr) {\n\t\tString fromAddressPublicKey = ((StateTransferTransaction)tr).from;\n\t\tString toAddressPublicKey = ((StateTransferTransaction)tr).to;\t\t\t\t\n\t\tdouble amount = ((StateTransferTransaction)tr).amount;\n\t\tint nonce = ((StateTransferTransaction)tr).getNonce();\n\t\t\t\n\t\t// getting the fromAccount to be modified\n\t\tAccountInterface accountFromModify = null;\n\t\tint accountFromModifyFound = 0;\n\t\tboolean accountFromIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(fromAddressPublicKey)){\n\t\t\t\taccountFromModify = account;\n\t\t\t\taccountFromModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountFromModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"more than one matching account has been found at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountFromModifyFound == 1) {\n\t\t\tif (tr.getNonce() != accountFromModify.getNonce() + 1) {\n\t\t\t\t// error -> nonce not matching -> pssible replay attack\n\t\t\t\tServiceBus.logger.log(\"Nonce is not valid at transaction, possible replay aatack\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\t\t\t\t\n\t\t\t\tif (accountFromModify.getBalance() < amount){\n\t\t\t\t\t// not enoguh fund on the account\n\t\t\t\t\tServiceBus.logger.log(\"Not enoguh fund on the account at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// all cool but still not return because the second account has to be checked as well\n\t\t\t\telse {\n\t\t\t\t\taccountFromIsGood = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}else if (accountFromModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The account from which you want to transfer the fund does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\n\t\t// getting the toAccount to be modified\n\t\tAccountInterface accountToModify = null;\n\t\tint accountToModifyFound = 0;\n\t\tboolean accountToIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(toAddressPublicKey)){\n\t\t\t\taccountToModify = account;\n\t\t\t\taccountToModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountToModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"More than one account is found at matching the transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountToModifyFound == 1) {\n\t\t\taccountToIsGood = true;\n\t\t\t\t\n\t\t}else if (accountToModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The to account does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// transfer is only possible if the asset type is the same, otherwise it is an exchange\n\t\tif (!accountToModify.getAssetType().equals(accountFromModify.getAssetType())){\n\t\t\t// error, from and to asset type must be the same\n\t\t\tServiceBus.logger.log(\"From and to asset type must be the same, TrID : \" + tr.getTransctionId(), Severity.WARNING);\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\t\t\t\n\t\t// final check if all good return true\n\t\tif (accountFromIsGood && accountToIsGood){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// default value\n\t\treturn false;\t\t\t\n\t}", "private Collection<? extends AbstractState> getFollowStates(AutomatonState state, List<AbstractState> otherElements, CFAEdge edge, boolean failOnUnknownMatch) throws CPATransferException {\n Preconditions.checkArgument(!(state instanceof AutomatonUnknownState));\n if (state == cpa.getBottomState()) {\n //return Collections.singleton(state);\n return Collections.emptySet();\n }\n\n if (state.getInternalState().getTransitions().isEmpty()) {\n // shortcut\n return Collections.singleton(state);\n }\n\n Collection<AbstractState> lSuccessors = new HashSet<AbstractState>(2);\n AutomatonExpressionArguments exprArgs = new AutomatonExpressionArguments(state.getVars(), otherElements, edge, logger);\n boolean edgeMatched = false;\n boolean nonDetState = state.getInternalState().isNonDetState();\n\n // these transitions cannot be evaluated until last, because they might have sideeffects on other CPAs (dont want to execute them twice)\n // the transitionVariables have to be cached (produced during the match operation)\n // the list holds a Transition and the TransitionVariables generated during its match\n List<Pair<AutomatonTransition, Map<Integer, String>>> transitionsToBeTaken = new ArrayList<Pair<AutomatonTransition, Map<Integer, String>>>(2);\n\n for (AutomatonTransition t : state.getInternalState().getTransitions()) {\n exprArgs.clearTransitionVariables();\n\n matchTime.start();\n ResultValue<Boolean> match = t.match(exprArgs);\n matchTime.stop();\n if (match.canNotEvaluate()) {\n if (failOnUnknownMatch) {\n throw new CPATransferException(\"Automaton transition condition could not be evaluated: \" + match.getFailureMessage());\n }\n // if one transition cannot be evaluated the evaluation must be postponed until enough information is available\n return Collections.singleton(new AutomatonUnknownState(state));\n } else {\n if (match.getValue()) {\n edgeMatched = true;\n assertionsTime.start();\n ResultValue<Boolean> assertionsHold = t.assertionsHold(exprArgs);\n assertionsTime.stop();\n\n if (assertionsHold.canNotEvaluate()) {\n if (failOnUnknownMatch) {\n throw new CPATransferException(\"Automaton transition assertions could not be evaluated: \" + assertionsHold.getFailureMessage());\n }\n // cannot yet be evaluated\n return Collections.singleton(new AutomatonUnknownState(state));\n\n } else if (assertionsHold.getValue()) {\n if (!t.canExecuteActionsOn(exprArgs)) {\n if (failOnUnknownMatch) {\n throw new CPATransferException(\"Automaton transition action could not be executed\");\n }\n // cannot yet execute, goto UnknownState\n return Collections.singleton(new AutomatonUnknownState(state));\n }\n\n // delay execution as described above\n Map<Integer, String> transitionVariables = ImmutableMap.copyOf(exprArgs.getTransitionVariables());\n transitionsToBeTaken.add(Pair.of(t, transitionVariables));\n\n } else {\n // matching transitions, but unfulfilled assertions: goto error state\n AutomatonState errorState = AutomatonState.automatonStateFactory(Collections.<String, AutomatonVariable>emptyMap(), AutomatonInternalState.ERROR, cpa);\n logger.log(Level.INFO, \"Automaton going to ErrorState on edge \\\"\" + edge.getDescription() + \"\\\"\");\n lSuccessors.add(errorState);\n }\n\n if (!nonDetState) {\n // not a nondet State, break on the first matching edge\n break;\n }\n }\n // do nothing if the edge did not match\n }\n }\n\n if (edgeMatched) {\n // execute Transitions\n for (Pair<AutomatonTransition, Map<Integer, String>> pair : transitionsToBeTaken) {\n // this transition will be taken. copy the variables\n AutomatonTransition t = pair.getFirst();\n Map<Integer, String> transitionVariables = pair.getSecond();\n actionTime.start();\n Map<String, AutomatonVariable> newVars = deepCloneVars(state.getVars());\n exprArgs.setAutomatonVariables(newVars);\n exprArgs.putTransitionVariables(transitionVariables);\n t.executeActions(exprArgs);\n actionTime.stop();\n AutomatonState lSuccessor = AutomatonState.automatonStateFactory(newVars, t.getFollowState(), cpa);\n //if (!(lSuccessor instanceof AutomatonState.BOTTOM)) {\n lSuccessors.add(lSuccessor);\n //} // else add nothing\n }\n return lSuccessors;\n } else {\n // stay in same state, no transitions to be executed here (no transition matched)\n return Collections.singleton(state);\n }\n }", "@Test\n void getCurrentUpgradeCost() {\n EnumMap<Resource,Integer> oracle = new EnumMap<Resource, Integer>(Resource.class);\n oracle.put(Resource.CLAY, 2);\n assertEquals(oracle, this.wonder.getCurrentUpgradeCost()); //index/state = 0, cost stage 1\n\n wonder.setState(wonder.getState() + 1); // stage one is build\n oracle = new EnumMap<Resource, Integer>(Resource.class);\n oracle.put(Resource.WOOD, 3);\n assertEquals(oracle, this.wonder.getCurrentUpgradeCost()); // index/state = 1, cost stage 2\n\n wonder.setState(wonder.getState() + 1); // 2 stage build\n oracle = new EnumMap<Resource, Integer>(Resource.class);\n oracle.put(Resource.CLAY, 4);\n assertEquals(oracle, this.wonder.getCurrentUpgradeCost()); // index/state = 2, cost stage 3\n wonder.setState(wonder.getState() + 1); // Build the last stage\n\n //return an outIndexError when we call this method\n }", "private boolean isFeasible(FlowNetwork G, int s, int t) {\n\t double EPSILON = 1E-11;\n\n\t // check that capacity constraints are satisfied\n\t for (int v = 0; v < G.V(); v++) {\n\t for (FlowEdge e : G.adj(v)) {\n\t if (e.flow() < -EPSILON || e.flow() > e.capacity() + EPSILON) {\n\t System.err.println(\"Edge does not satisfy capacity constraints: \" + e);\n\t return false;\n\t }\n\t }\n\t }\n\n\t // check that net flow into a vertex equals zero, except at source and sink\n\t if (Math.abs(value + excess(G, s)) > EPSILON) {\n\t System.err.println(\"Excess at source = \" + excess(G, s));\n\t System.err.println(\"Max flow = \" + value);\n\t return false;\n\t }\n\t if (Math.abs(value - excess(G, t)) > EPSILON) {\n\t System.err.println(\"Excess at sink = \" + excess(G, t));\n\t System.err.println(\"Max flow = \" + value);\n\t return false;\n\t }\n\t for (int v = 0; v < G.V(); v++) {\n\t if (v == s || v == t) continue;\n\t else if (Math.abs(excess(G, v)) > EPSILON) {\n\t System.err.println(\"Net flow out of \" + v + \" doesn't equal zero\");\n\t return false;\n\t }\n\t }\n\t return true;\n\t }", "private Collection<ReplayState<C>> executeEnabledMismatches(ReplayState<C> state, Collection<Transition> transitions) {\r\n\t\tCollection<ReplayState<C>> states = new ArrayList<ReplayState<C>>();\r\n\t\tif (!state.trace.isEmpty()) {\r\n\t\t\tfor (Transition transition : transitions) {\r\n\t\t\t\tif (transition.isInvisible() || !map.containsKey(transition)) {\r\n\t\t\t\t} else if (!map.get(transition).equals(state.trace.get(0))) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Determine new marking.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tMarking newMarking;\r\n\t\t\t\t\t\tsynchronized (semantics) {\r\n\t\t\t\t\t\t\tsemantics.setCurrentState(state.marking);\r\n\t\t\t\t\t\t\tsemantics.executeExecutableTransition(transition);\r\n\t\t\t\t\t\t\tnewMarking = semantics.getCurrentState();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Determine new cost.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tC newCost = addOperator.add(state.cost, ReplayAction.INSERT_ENABLED_MISMATCH, transition, null);\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Add new state.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\taddState(states, state, newMarking, transition, newCost, state.trace);\r\n\t\t\t\t\t} catch (IllegalTransitionException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn states;\r\n\t}", "public int conflicts() {\n int total = 0;\n int dist;\n if (!isValid()) return 0;\n for (int r = 0; r < Board.dim; r++) {\n int row = r*Board.dim; \n for (int i = row; i < row + Board.dim; i++)\n for (int j = i + 1; j < row + Board.dim; j++) \n if (Board.rowOf[state[i]] == r && \n Board.rowOf[state[j]] == r &&\n state[i] != 0 && state[j] != 0 &&\n state[i] > state[j])\n total = total + 1;\n }\n for (int col = 0; col < Board.dim; col++) \n for (int i = col; i < state.length - Board.dim; i+= Board.dim) {\n for (int j = i + Board.dim; j < state.length; j+= Board.dim) \n if (Board.colOf[state[i]] == col &&\n Board.colOf[state[j]] == col &&\n state[i] != 0 && state[j] != 0 &&\n state[i] > state[j])\n total = total + 1;\n } \n return total; \n }", "@Test\n public void testTargetSquares_cannotEnterGate() {\n Board board = new Board(p1, p2);\n Token ant = p1.getFromSupply(BugType.SPIDER);\n board.addToken(ant, 0, 3);\n board.addToken(p2.getFromSupply(BugType.QUEEN_BEE), 1, 0);\n board.addToken(p2.getFromSupply(BugType.SPIDER), 2, 0);\n board.addToken(p2.getFromSupply(BugType.GRASSHOPPER), 2, 1);\n board.addToken(p2.getFromSupply(BugType.SOLDIER_ANT), 0, 1);\n board.addToken(p2.getFromSupply(BugType.BEETLE), 0, 2);\n\n List<Hex> targets = Rules.getInstance().getTargetHexes(ant, board);\n assertEquals(2, targets.size());\n assertTrue(targets.contains(board.getHex(-1, 1)));\n assertTrue(targets.contains(board.getHex(3, 1)));\n }", "@Test\n void getCurrentRewardsFromUpgradeTest() {\n EnumMap<CardPoints,Integer> oracle = new EnumMap<CardPoints, Integer>(CardPoints.class);\n oracle.put(CardPoints.VICTORY, 3);\n assertEquals(oracle, this.wonder.getCurrentRewardsFromUpgrade()); //index/state = 0, cost stage 1\n assertEquals(oracle, this.wonder.getProp().get(this.wonder.getState()).y); //index/state = 0, cost stage 1\n\n wonder.setState(wonder.getState() + 1); // stage one is build\n oracle = new EnumMap<CardPoints, Integer>(CardPoints.class);\n //reward is an effect, so no cardpoints\n assertEquals(oracle, this.wonder.getCurrentRewardsFromUpgrade()); // index/state = 1, cost stage 2\n\n wonder.setState(wonder.getState() + 1); // 2 stage build\n oracle = new EnumMap<CardPoints, Integer>(CardPoints.class);\n oracle.put(CardPoints.VICTORY, 7);\n assertEquals(oracle, this.wonder.getCurrentRewardsFromUpgrade()); // index/state = 2, cost stage 3\n wonder.setState(wonder.getState() + 1); // Build the last stage\n\n //return an outIndexError when we call this method\n }", "private void ensureMachineHasIndex(int i){\n\t\tif (theStates.size()<=i)\n\t\t\tfor (int j=theStates.size();j<=i;j++)\n\t\t\t\ttheStates.add(new State(j));\n\t}", "private boolean transmissionFailure(Message[] pumpStates, Message[] pumpControlStates) {\n // Check level readings\n boolean w = false;\n boolean s = false;\n for (int i = 0; i < this.incoming.size(); i++) {\n Message msg = this.incoming.read(i);\n if (msg.getKind().equals(MessageKind.LEVEL_v)) {\n w = true;\n }\n if (msg.getKind().equals(MessageKind.STEAM_v)) {\n s = true;\n }\n }\n\n if (!w || !s) {\n return true;\n }\n\n if (pumpStates.length != this.configuration.getNumberOfPumps()) {\n // Nonsense pump state readings\n return true;\n } else if (pumpControlStates.length != this.configuration.getNumberOfPumps()) {\n // Nonsense pump control state readings\n return true;\n }\n // Done\n return false;\n }", "@Override\r\n\tpublic int move(int lastMove, int[] takenList, int depthLimit) \r\n\t{\r\n\t\tGameState myState = new GameState(takenList, lastMove);\r\n\t\tdouble maxValue = max_value(myState, depthLimit);\r\n\t\tint myBestMove = myState.bestMove;\r\n\t\tif (myState.leaf) //why did i do this\r\n\t\t{\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn myBestMove;\r\n\t}", "public boolean isFlowValid()\n\t{\n\t\t// TODO will need to implement this...\n\t\treturn true;\n\t}", "public abstract State getDestinationState ();", "protected void validateMinActiveAndTopStateReplica(IdealState is, ExternalView ev,\n int minActiveReplica, int numNodes) {\n StateModelDefinition stateModelDef =\n BuiltInStateModelDefinitions.valueOf(is.getStateModelDefRef()).getStateModelDefinition();\n String topState = stateModelDef.getStatesPriorityList().get(0);\n int replica = Integer.valueOf(is.getReplicas());\n\n Map<String, Integer> stateCount = stateModelDef.getStateCountMap(numNodes, replica);\n Set<String> activeStates = stateCount.keySet();\n\n for (String partition : is.getPartitionSet()) {\n Map<String, String> assignmentMap = ev.getRecord().getMapField(partition);\n Assert.assertNotNull(assignmentMap,\n is.getResourceName() + \"'s best possible assignment is null for partition \" + partition);\n Assert.assertTrue(!assignmentMap.isEmpty(),\n is.getResourceName() + \"'s partition \" + partition + \" has no best possible map in IS.\");\n\n boolean hasTopState = false;\n int activeReplica = 0;\n for (String state : assignmentMap.values()) {\n if (topState.equalsIgnoreCase(state)) {\n hasTopState = true;\n }\n if (activeStates.contains(state)) {\n activeReplica++;\n }\n }\n\n if (activeReplica < minActiveReplica) {\n int a = 0;\n }\n\n Assert.assertTrue(hasTopState, String.format(\"%s missing %s replica\", partition, topState));\n Assert.assertTrue(activeReplica >= minActiveReplica,\n String.format(\"%s has less active replica %d then required %d\", partition, activeReplica,\n minActiveReplica));\n }\n }", "private boolean isFeasible(FlowNetwork G, int s, int t) {\r\n\r\n // check that capacity constraints are satisfied\r\n for (int v = 0; v < G.V(); v++) {\r\n for (FlowEdge e : G.adj(v)) {\r\n if (e.flow() < -FLOATING_POINT_EPSILON\r\n || e.flow() > e.capacity() + FLOATING_POINT_EPSILON) {\r\n System.err\r\n .println(\"Edge does not satisfy capacity constraints: \" + e);\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n // check that net flow into a vertex equals zero, except at source and\r\n // sink\r\n if (Math.abs(value + excess(G, s)) > FLOATING_POINT_EPSILON) {\r\n System.err.println(\"Excess at source = \" + excess(G, s));\r\n System.err.println(\"Max flow = \" + value);\r\n return false;\r\n }\r\n if (Math.abs(value - excess(G, t)) > FLOATING_POINT_EPSILON) {\r\n System.err.println(\"Excess at sink = \" + excess(G, t));\r\n System.err.println(\"Max flow = \" + value);\r\n return false;\r\n }\r\n for (int v = 0; v < G.V(); v++) {\r\n if (v == s || v == t)\r\n continue;\r\n else if (Math.abs(excess(G, v)) > FLOATING_POINT_EPSILON) {\r\n System.err.println(\"Net flow out of \" + v + \" doesn't equal zero\");\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public Graph calculateEnforcedGraph(Vector2 robotTarget) {\n\n Graph g = this.clone();\n // Clear enforce values of all states.\n for (State s : g.states) {\n s.enforceValue = -1;\n }\n\n List<State> targetStates = g.findStatesForRobotPosition(robotTarget);\n System.out.println(robotTarget);\n\n // Set enforce value to 0 for targetstates.\n for (State s : targetStates)\n s.enforceValue = 0;\n\n // Go from here and calculate more enforce values for 1-acceptance\n Queue<State> calcStack = new LinkedBlockingQueue<>(targetStates);\n\n while (!calcStack.isEmpty()) {\n State enfI = calcStack.poll();\n //if (enfI.equals(initialState)) continue;\n\n List<Transition> transitionsTo = g.getTransitionsTo(enfI);\n for (Transition t : transitionsTo) {\n State enfIP1 = t.from;\n if (enfIP1.isRobotState) {\n // At least one transition is enough for this\n if (enfIP1.enforceValue == -1) {\n enfIP1.enforceValue = enfI.enforceValue + 1;\n calcStack.add(enfIP1);\n }\n } else {\n List<Transition> fromTransitions = g.getTransitionsFrom(enfIP1);\n // All transitions from this eumel have to lead into a lower value enforce.\n int enforceValue = enfI.enforceValue + 1;\n boolean enforceable = true;\n for (Transition trans : fromTransitions) {\n if (trans.to.enforceValue == -1 || trans.to.enforceValue >= enforceValue)\n enforceable = false;\n }\n\n if (enforceable && enfIP1.enforceValue == -1) {\n enfIP1.enforceValue = enforceValue;\n calcStack.add(enfIP1);\n }\n }\n }\n }\n\n\n // Now let's calculate Enforce+\n boolean statesChanged = true;\n while (statesChanged) {\n statesChanged = false;\n\n for (State s : g.states.stream().filter(s -> s.enforceValue == -1).collect(Collectors.toList())) {\n // Find the states from which we can enforce a step to Enforce in 1\n if (s.isRobotState) {\n // We need at least one Transitions which leads into enforce. We will then choose the lowest of it.\n List<Transition> transitions = g.getTransitionsFrom(s);\n Optional<Transition> cheapestTransition = transitions.stream().filter(t -> t.to.enforceValue != -1).min(Comparator.comparingInt(o -> o.to.enforceValue));\n if (cheapestTransition.isPresent()) {\n // We found a way into enforce. We can now set an enforce value on this!\n System.out.println(\"Renf+\");\n statesChanged = true;\n s.enforceValue = cheapestTransition.get().to.enforceValue + 1;\n }\n } else {\n // All the transitions coming from this have to lead into enforce. Let's check.\n List<Transition> transitions = g.getTransitionsFrom(s);\n boolean leadsToEnforce = transitions.stream().noneMatch(t -> t.to.enforceValue == -1);\n if (leadsToEnforce) {\n\n Optional<Integer> newEnforce = transitions.stream().map((transition) -> transition.to.enforceValue).max(Comparator.comparingInt(o -> o));\n if(newEnforce.isPresent()) {\n s.enforceValue = newEnforce.get() + 1;\n System.out.println(\"Cenf+\");\n statesChanged = true;\n }\n }\n }\n }\n\n }\n\n // Eliminate Transitions for Buechi-Acceptance\n\n /*List<State> unreachableStates = new ArrayList<>();\n\n // Remove all states with an enforce value of -1, as the cannot be reached\n Iterator<State> it = g.states.iterator();\n while (it.hasNext()) {\n State s = it.next();\n if (s.enforceValue == -1) {\n it.remove();\n unreachableStates.add(s);\n }\n }\n\n g.transitions.removeIf(t -> unreachableStates.contains(t.from) || unreachableStates.contains(t.to));*/\n\n return g;\n }", "protected boolean isTransferTransactionValidEx(StateTransferTransaction tr) {\n\t\tString fromAddressPublicKey = ((StateTransferTransaction)tr).from;\n\t\tString toAddressPublicKey = ((StateTransferTransaction)tr).to;\t\t\t\t\n\t\tdouble amount = ((StateTransferTransaction)tr).amount;\n\t\tint nonce = ((StateTransferTransaction)tr).getNonce();\n\t\t\t\n\t\t// getting the fromAccount to be modified\n\t\tAccountInterface accountFromModify = null;\n\t\tint accountFromModifyFound = 0;\n\t\tboolean accountFromIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(fromAddressPublicKey)){\n\t\t\t\taccountFromModify = account;\n\t\t\t\taccountFromModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountFromModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"more than one matching account has been found at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountFromModifyFound == 1) {\n\t\t\tif (tr.getNonce() != accountFromModify.getNonce() + 1) {\n\t\t\t\t// error -> nonce not matching -> pssible replay attack\n\t\t\t\tServiceBus.logger.log(\"Nonce is not valid at transaction, possible replay aatack\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\t\t\t\t\n\t\t\t\tif (accountFromModify.getBalance() < amount){\n\t\t\t\t\t// not enoguh fund on the account\n\t\t\t\t\tServiceBus.logger.log(\"Not enoguh fund on the account at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// all cool but still not return because the second account has to be checked as well\n\t\t\t\telse {\n\t\t\t\t\taccountFromIsGood = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}else if (accountFromModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The account from which you want to transfer the fund does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\n\t\t// getting the toAccount to be modified\n\t\tAccountInterface accountToModify = null;\n\t\tint accountToModifyFound = 0;\n\t\tboolean accountToIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(toAddressPublicKey)){\n\t\t\t\taccountToModify = account;\n\t\t\t\taccountToModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountToModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"More than one account is found at matching the transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountToModifyFound == 1) {\n\t\t\taccountToIsGood = true;\n\t\t\t\t\n\t\t}else if (accountToModifyFound == 0) {\n\t\t\t// to account can be added to the state, asset type logic is questionable\n\t\t\t\n\t\t\tAccountBase account = new AccountBase(\n\t\t\t\t\t((StateTransferTransaction)tr).from,\n\t\t\t\t\t((StateTransferTransaction)tr).getNonce(),\n\t\t\t\t\t\"\",\n\t\t\t\t\t((StateTransferTransaction)tr).amount,\n\t\t\t\t\taccountFromModify.getAssetType());\t\n\t\t\taccounts.add(account);\n\t\t\t\n\t\t\taccountToIsGood = true;\n\t\t}\n\t\t\n\t\t// transfer is only possible if the asset type is the same, otherwise it is an exchange\n\t\tif (!accountToModify.getAssetType().equals(accountFromModify.getAssetType())){\n\t\t\t// error, from and to asset type must be the same\n\t\t\tServiceBus.logger.log(\"From and to asset type must be the same, TrID : \" + tr.getTransctionId(), Severity.WARNING);\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\t\t\t\n\t\t// final check if all good return true\n\t\tif (accountFromIsGood && accountToIsGood){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// default value\n\t\treturn false;\t\t\t\n\t}", "private Collection<ReplayState<C>> executeDisabledMismatches(ReplayState<C> state,\r\n\t\t\tCollection<Transition> transitions) {\r\n\t\tCollection<ReplayState<C>> states = new ArrayList<ReplayState<C>>();\r\n\t\tif (!state.trace.isEmpty()) {\r\n\t\t\tfor (Transition transition : transitions) {\r\n\t\t\t\tif (transition.isInvisible() || !map.containsKey(transition)) {\r\n\t\t\t\t} else if (!map.get(transition).equals(state.trace.get(0))) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Enable the disabled transition by adding sufficient\r\n\t\t\t\t\t\t * tokens in its preset places.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tMarking preMarking = new Marking(state.marking);\r\n\t\t\t\t\t\tCollection<PetrinetEdge<? extends PetrinetNode, ? extends PetrinetNode>> edges = transition\r\n\t\t\t\t\t\t\t\t.getGraph().getInEdges(transition);\r\n\t\t\t\t\t\tfor (PetrinetEdge<? extends PetrinetNode, ? extends PetrinetNode> e : edges) {\r\n\t\t\t\t\t\t\tif (e instanceof Arc) {\r\n\t\t\t\t\t\t\t\tArc arc = (Arc) e;\r\n\t\t\t\t\t\t\t\tif (arc.getWeight() > state.marking.occurrences(arc.getSource())) {\r\n\t\t\t\t\t\t\t\t\tpreMarking.add((Place) arc.getSource(), arc.getWeight()\r\n\t\t\t\t\t\t\t\t\t\t\t- state.marking.occurrences(arc.getSource()));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Determine the new marking.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tMarking newMarking;\r\n\t\t\t\t\t\tsynchronized (semantics) {\r\n\t\t\t\t\t\t\tsemantics.setCurrentState(preMarking);\r\n\t\t\t\t\t\t\tsemantics.executeExecutableTransition(transition);\r\n\t\t\t\t\t\t\tnewMarking = semantics.getCurrentState();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Determine the new cost.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tC newCost = addOperator\r\n\t\t\t\t\t\t\t\t.add(state.cost, ReplayAction.INSERT_DISABLED_MISMATCH, transition, null);\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Add new state.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\taddState(states, state, newMarking, transition, newCost, state.trace);\r\n\t\t\t\t\t} catch (IllegalTransitionException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn states;\r\n\t}", "private void addTransitionsToFailed() {\n List<ReplicateStatus> abortable = getFailableStatuses();\n addTransition(abortable, FAILED);\n addTransition(WORKER_LOST, FAILED); // when <status> -> WORKER_LOST -> FAILED\n addTransition(RECOVERING, FAILED); // when <status> -> RECOVERING -> FAILED\n }", "@Override // com.google.protobuf.Utf8.Processor\n public int partialIsValidUtf8(int state, byte[] bytes, int index, int limit) {\n int index2;\n if (state == 0) {\n index2 = index;\n } else if (index >= limit) {\n return state;\n } else {\n int byte1 = (byte) state;\n if (byte1 < -32) {\n if (byte1 >= -62) {\n index2 = index + 1;\n if (bytes[index] > -65) {\n }\n }\n return -1;\n } else if (byte1 < -16) {\n byte b = (byte) (~(state >> 8));\n if (b == 0) {\n int index3 = index + 1;\n b = bytes[index];\n if (index3 >= limit) {\n return Utf8.incompleteStateFor(byte1, b);\n }\n index = index3;\n }\n if (b <= -65 && ((byte1 != -32 || b >= -96) && (byte1 != -19 || b < -96))) {\n index2 = index + 1;\n if (bytes[index] > -65) {\n }\n }\n return -1;\n } else {\n byte b2 = (byte) (~(state >> 8));\n byte b3 = 0;\n if (b2 == 0) {\n int index4 = index + 1;\n b2 = bytes[index];\n if (index4 >= limit) {\n return Utf8.incompleteStateFor(byte1, b2);\n }\n index = index4;\n } else {\n b3 = (byte) (state >> 16);\n }\n if (b3 == 0) {\n int index5 = index + 1;\n b3 = bytes[index];\n if (index5 >= limit) {\n return Utf8.incompleteStateFor(byte1, b2, b3);\n }\n index = index5;\n }\n if (b2 <= -65 && (((byte1 << 28) + (b2 + 112)) >> 30) == 0 && b3 <= -65) {\n int index6 = index + 1;\n if (bytes[index] <= -65) {\n index2 = index6;\n }\n }\n return -1;\n }\n }\n return partialIsValidUtf8(bytes, index2, limit);\n }", "@Test\n\tpublic void testValidRemainingActions() {\n\t\tassertFalse(Player.isValidRemainingActions(Player.MAX_ALLOWED_ACTIONS + 1));\n\t}", "private void checkFlowFromTo(\n NodeAdaptor source, NodeAdaptor target) {\n if (source.isChoreographyActivity() && target.isChoreographyActivity()) {\n Collection<NodeAdaptor> nodesWithoutParticipation =\n getFinalTasksWithoutParticipant(source,\n ((ChoreographyNodeAdaptor) target).getActiveParticipant());\n if (!nodesWithoutParticipation.isEmpty()) {\n validator.addMessage(\n \"initiatorOfChoreographyActivityNotParticipantInPriorActivity\",\n target, nodesWithoutParticipation);\n }\n }\n }", "public boolean removeDeadTransitions() throws Exception{\n \tArrayList<Integer> st=new ArrayList<Integer>(getStates());//st fixes some arbitrary order of states\n \tboolean [][] canReach=buildConnectionMatrix(st);\n\n \t//collect reachable states\n \tStack<Integer> worklist=new Stack<Integer>();\n \tHashSet<Integer> reachableStates=new HashSet<Integer> ();\n \tfor(String var:pointers.keySet())\n \t\tworklist.push(st.indexOf(pointers.get(var)));\n \twhile(!worklist.empty()){\n \t\tint cur=worklist.pop();\n \t\treachableStates.add(st.get(cur));\n \t\tfor(int i=0;i<st.size();i++)\n \t\t\tif(canReach[cur][i]&&!worklist.contains(i)&&!reachableStates.contains(st.get(i)))\n \t\t\t\tworklist.push(i);\n \t}\n \t//remove unreachable states\n \tboolean hasUnreachableNonReferenceStates=false;//might still be a useless state\n \tfor(TreeAutomaton ta:lt){\n \tHashSet<Integer> toRemove=new HashSet<Integer>();\n \t\tfor(int s:ta.getStates())\n \t\t\tif(!reachableStates.contains(s)){\n \t\t\t\ttoRemove.add(s);\n \t\t\t}\n \tfor(int s:toRemove){\n\t\t\t\tif(!ta.isReferenceTo(s, NULL)&&!ta.isReferenceTo(s, UNDEF)&&ta.referenceTo(s)==-1)\n\t\t\t\t\thasUnreachableNonReferenceStates=true;\n \t\t\tta.removeState(s);\n \t}\n \t}\n \treturn hasUnreachableNonReferenceStates;\n }", "private void computeExternalState(InternalState newState) {\n if (internalState != newState) {\n switch (internalState) {\n case BUILD:\n Preconditions.checkState(newState == InternalState.PROBE_IN || newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n\n case PROBE_IN:\n Preconditions.checkState(newState == InternalState.PROBE_PIVOT_AND_OUT ||\n newState == InternalState.PROJECT_NON_MATCHES ||\n newState == InternalState.REPLAY ||\n newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n\n case PROBE_OUT:\n case PROBE_PIVOT_AND_OUT:\n Preconditions.checkState(newState == InternalState.PROBE_IN ||\n newState == InternalState.PROBE_OUT ||\n newState == InternalState.PROBE_PIVOT_AND_OUT ||\n newState == InternalState.PROJECT_NON_MATCHES ||\n newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n\n case PROJECT_NON_MATCHES:\n Preconditions.checkState(newState == InternalState.REPLAY || newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n\n case REPLAY:\n Preconditions.checkState(newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n }\n internalState = newState;\n }\n computeExternalState();\n }", "public void actionPerformed(ActionEvent e) {\n timer.stop();\n //get all the available moves\n ArrayList<Point> possibleMoves = getCurrentlyValidMoves();\n canLastPlayerMove = false;\n try {\n //check if we can move\n if( possibleMoves.size() == 0 ){\n return;\n }\n //make an array to store the best moves available\n ArrayList<Point> bestMoves = new ArrayList<Point>();\n //the lower the level, the higher priority is assigned to the move\n //a move of level 10 is the absolute lowest\n //this heuristic follows the strategy I use, omitting situation-specific content\n int level = 10;\n for (Point p : possibleMoves) {\n int x = (int) p.getX();\n int y = (int) p.getY();\n if ((x == 0 || x == 7) && (y == 0 || y == 7)) {\n if (level > 0) {\n bestMoves.clear();\n level = 0;\n }\n bestMoves.add( p );\n } else if (level >= 1 && (x == 0 || y == 0 || x == 7 || y == 7)) {\n if (level > 1) {\n bestMoves.clear();\n level = 1;\n }\n bestMoves.add( p );\n } else if (level >= 2 && (x > 2 && x < 6 && y > 2 && y < 6)) {\n if ( level > 2) {\n bestMoves.clear();\n level = 2;\n }\n bestMoves.add( p );\n } else if (level >= 3 && x != 1 && x != 6 && y != 1 && y != 6) {\n if (level > 3) {\n bestMoves.clear();\n level = 3;\n }\n bestMoves.add(p);\n } else if (level >= 4) {\n bestMoves.add(p);\n }\n }\n //for debugging purposes, output the level of move chosen by the ai\n System.out.println(level);\n //select a random move from the pool of best moves\n Point move = bestMoves.get((int) (Math.random() * bestMoves.size()));\n int aix = (int) move.getX();\n int aiy = (int) move.getY();\n //move there\n attemptMove(aix, aiy);\n gamepieces[aix][aiy] = currentPlayer;\n //the ai moved, so this is true\n canLastPlayerMove = true;\n } finally { //if the ai moved or if it didn't\n //change the player\n currentPlayer = Color.WHITE;\n gameFrame.repaint();\n //if the human player has no moves left\n if( getCurrentlyValidMoves().size() == 0 ){\n if( canLastPlayerMove ){ //... and the ai could move\n //switch players, enable the ai to move again in 1 second\n currentPlayer = Color.BLACK;\n timer.start();\n }else{ //... and the ai couldn't move\n gameOver();\n }\n }\n }\n }", "public boolean checkIsValid() {\n for (Terminal s : sources) {\n if (!s.isValid()) {\n return false;\n }\n }\n for (Terminal t : sinks) {\n if (!t.isValid()) {\n return false;\n }\n }\n\n // check cap constraints on edges\n for (SingleEdge[] row : matrix) {\n for (SingleEdge e : row) {\n if (e != null && !e.isValid()) {\n return false;\n }\n }\n }\n\n // check for conversation of flow at all nodes\n for (int i = 0; i < n; i++) {\n // compute the flow in and out \n double in = 0;\n double out = 0;\n for (int j = 0; j < n; j++) {\n if (matrix[j][i] != null) {\n in += matrix[j][i].getFlow();\n }\n }\n for (int j = 0; j < n; j++) {\n if (matrix[i][j] != null) {\n out += matrix[i][j].getFlow();\n }\n }\n // make sure it aligns \n if (!isSource(i) && !isSink(i)) {\n if (in != out) {\n return false;\n }\n } else if (isSource(i)) {\n if (out - in != getNode(i).getFlow()) {\n return false;\n }\n } else { // is sink\n if (in - out != getNode(i).getFlow()) {\n return false;\n }\n }\n }\n return true;\n }", "public boolean validStep(int agentId) {\n\t\tLinkedList<Command> plan = planMap.get(agentId);\r\n\t\tif (plan.isEmpty())\r\n\t\t\treturn true;\r\n\t\t\r\n\t\tLinkedList<Command> nextStepPlan = new LinkedList<>();\r\n\t\tnextStepPlan.add(plan.get(0));\r\n\r\n\t\tfor (Map.Entry<Integer, LinkedList<Command>> entry : planMap.entrySet()) {\r\n\t\t\tif (agentId != entry.getKey()) {\r\n\t\t\t\tAgent otherAgent = getAgent(entry.getKey());\r\n\t\t\t\tLinkedList<Command> otherPlan = planMap.get(otherAgent.getId());\r\n\t\r\n\t\t\t\tboolean conflict = checkPlans(agentId, nextStepPlan, otherAgent.getId(), otherPlan);\r\n\t\t\t\tif(conflict) {\r\n\t\t\t\t\tif(handleBlockingAgentConflict(getAgent(agentId), otherAgent, plan)) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (agentId > entry.getKey()) {\t\t\t\t\t\t\r\n\t\t\t\t\t\t//LinkedList<Command> otherPlan = entry.getValue();\t\t\t\t\t\r\n\t\t\t\t\t\t/* There is a conflict but the other agent has no intention to move\r\n\t\t\t\t\t\tif(otherPlan.isEmpty() && (getJob(otherAgent) == null) && \r\n\t\t\t\t\t\t\t\t(otherAgent.getPosition().equals(otherAgent.getLastPosition()))) {\r\n\t\t\t\t\t\t\tPriorityQueue<SafePoint> safePoints = SafeSpotDetector.detectSafeSpots(this);\r\n\t\t\t\t\t\t\tPoint movePos = safePoints.poll();\r\n\t\t\t\t\t\t\tthis.addJob(new TravelSubIntention(movePos, otherAgent.getId(), null));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t*/\r\n\t\t\t\t\t\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\treturn true;\r\n\t}", "@Test\n public void testCancel_2() throws IllegalStateTransitionException {\n TrainPlanningEntry entry = singleton();\n entry.setResources(Arrays.asList(new TrainCabin(1, TrainCabinType.BUSINESS, 10, 2020),\n new TrainCabin(2, TrainCabinType.FIRST_CLASS, 20, 2020)));\n entry.allocated();\n entry.cancel();\n assertTrue(entry.getState() instanceof CancelledState);\n }", "protected TransitionFunction makeValidTransitionFunction(int sizeOfNeighborhood, int numberOfStates) {\n\t\tList<Integer> stateFunction = validStateFunction(sizeOfNeighborhood, numberOfStates);\t\t\n\t\treturn new TransitionFunction(stateFunction, sizeOfNeighborhood, numberOfStates);\n\t}", "@Override\n public void \n validatePhase()\n throws PipelineException\n {\n super.validatePhase();\n \n pShotNamer = \n ShotNamer.getNamerFromNodeName\n (pSubmitNode, pClient, pQueue, getBuilderInformation());\n pProjectNamer = \n ProjectNamer.getGeneratedNamer\n (pClient, pQueue, getBuilderInformation(), pProjectName);\n \n pRequiredNodes = new TreeSet<String>();\n pRequiredNodes.add(pProjectNamer.getLightingProductMEL());\n }", "public static void getValidActionsTest() {\n\t\tVTicTacToe tempEnvironment = new VTicTacToe();\n\t\tint[] tempTestStates = { 0, 13, 39, 26, 6643 };\n\n\t\tint[] tempResultArray;\n\t\tfor (int i = 0; i < tempTestStates.length; i++) {\n\t\t\ttempResultArray = tempEnvironment.getValidActions(tempTestStates[i]);\n\t\t\tSystem.out.println(\"The valid actions of \" + tempTestStates[i] + \" is: \"\n\t\t\t\t\t+ Arrays.toString(tempResultArray));\n\t\t} // Of for i\n\t}", "@Override\r\n public void validate()\r\n {\r\n List<Connection> connections = model.getConnections();\r\n List<String> connectionsRelation = new ArrayList<>();\r\n\r\n for (Connection c : connections)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n sb.append(c.getSource().getId());\r\n sb.append(\"-\");\r\n sb.append(c.getTarget().getId());\r\n connectionsRelation.add(sb.toString());\r\n }\r\n\r\n List<String> answerRelations = Arrays.asList(task.getAnswerRelations().split(\";\"));\r\n\r\n if (connectionsRelation.isEmpty())\r\n {\r\n connectionsRelation.add(\"\");\r\n }\r\n\r\n if (ModelUtils.areEqualLists(connectionsRelation, answerRelations))\r\n {\r\n quizBean.setPoints(quizBean.getPoints() + 1);\r\n }\r\n\r\n quizBean.game();\r\n }", "void validateState() throws EPPCodecException {\n // add/chg/rem\n if ((addDsData == null) && (chgDsData == null) && (remKeyTag == null)) {\n throw new EPPCodecException(\"EPPSecDNSExtUpdate required attribute missing\");\n }\n \n // Ensure there is only one non-null add, chg, or rem\n\t\tif (((addDsData != null) && ((chgDsData != null) || (remKeyTag != null)))\n\t\t\t\t|| ((chgDsData != null) && ((addDsData != null) || (remKeyTag != null)))\n\t\t\t\t|| ((remKeyTag != null) && ((chgDsData != null) || (addDsData != null)))) {\n\t\t\tthrow new EPPCodecException(\"Only one add, chg, or rem is allowed\");\n\t\t}\n }", "public DFSM(Set<State> states, Alphabet alphabet, Set<Transition> transitions, State initialState,\n\t\t\tSet<State> acceptingStates) throws Exception {\n\t\tsuper(states, alphabet, transitions, initialState, acceptingStates);\n\t\tthis.transitionFunction().veryifyTotal(states, alphabet);\n\t\tthis.transitionFunction().verifyNoEpsilonTransitions();\n\t}", "@Override\n\t\tpublic boolean goalTest() {\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tif (state[i] != xGoals[i] || state[i + k] != yGoals[i]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "@Test\n public void genStateTransferMetric() {\n TreeMap<String, Integer> stat = new TreeMap<>();\n int currState = 8;\n for (int i = 1; i < numSteps; i++) {\n int nextStates = getNextState(currState);\n stat.compute(currState + \"-\" + nextStates, (k, v) -> v == null ? 1 : v + 1);\n currState = nextStates;\n }\n stat.forEach((k, v) -> System.out.printf(\"%s:%f\\n\", k.replace('-', ':'), (double) v / numSteps));\n }", "List<Direction> getValidDirectionsForMovement();", "public int checkGoals() {\n\t\tupdateUnsupportedPreconditionInconsistencies(maxLevel);\n\t\tcountInconsistencies();\n\t\tgraphQuality = calculateQuality();\n\t\treturn this.inconsistencyCount;\n\t}", "public boolean validateEntry_OutgoingTransitionCount(Entry entry,\r\n\t\t\tDiagnosticChain diagnostics, Map<Object, Object> context) {\r\n\t\tif (entry.getOutgoingTransitions().size() == 0\r\n\t\t\t\t&& ((Entry) entry).getKind().equals(EntryKind.INITIAL)) {\r\n\t\t\treturn warning(entry, diagnostics,\r\n\t\t\t\t\tISSUE_INITIAL_ENTRY_WITHOUT_OUT_TRANS);\r\n\t\t}\r\n\t\tif (entry.getOutgoingTransitions().size() > 1) {\r\n\t\t\treturn error(entry, diagnostics,\r\n\t\t\t\t\tISSUE_ENTRY_WITH_MULTIPLE_OUT_TRANS);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public InvalidTransitionException() {\n\t\tthis(\"Invalid FSM Transition.\");\n\t}" ]
[ "0.6315222", "0.6267551", "0.582121", "0.57448274", "0.56248367", "0.55508405", "0.54710585", "0.5460037", "0.5436863", "0.543296", "0.5431234", "0.5420635", "0.54013866", "0.53622645", "0.535507", "0.53387207", "0.53198844", "0.5304792", "0.5287709", "0.5286305", "0.5277106", "0.5260632", "0.522501", "0.52191406", "0.5214838", "0.5203409", "0.5184448", "0.51771635", "0.51701444", "0.5168078", "0.51635176", "0.5158348", "0.51577616", "0.51326495", "0.5130431", "0.5123292", "0.51198834", "0.51178414", "0.5113645", "0.51074296", "0.5087812", "0.50687164", "0.5062868", "0.50605077", "0.5056685", "0.5040474", "0.5035157", "0.50268817", "0.5024028", "0.5023139", "0.50144696", "0.50098836", "0.5008782", "0.50001454", "0.49995297", "0.49980447", "0.4983304", "0.49778405", "0.49746382", "0.4974001", "0.49699825", "0.4965657", "0.49559665", "0.49553934", "0.49533457", "0.4948673", "0.49476004", "0.49472544", "0.49412784", "0.49363962", "0.49353197", "0.4932476", "0.49283913", "0.49261376", "0.49241567", "0.49230057", "0.49158618", "0.4913212", "0.49069417", "0.49032244", "0.49030548", "0.4899896", "0.48982853", "0.4897988", "0.48972237", "0.48963985", "0.48914218", "0.48899594", "0.48882583", "0.48866552", "0.48860517", "0.48707318", "0.486579", "0.48634094", "0.48615748", "0.48615745", "0.4860868", "0.48559037", "0.48525223", "0.4847398" ]
0.60037935
2
Handle when the module create
private void onModuleCreate(HTMLCanvasElement element, Display.Preference preference) { Window.current().getDocument().addEventListener("visibilitychange", evt -> { if (isHidden()) { mLifecycle.onPause(); } else { mLifecycle.onResume(); } }); mDisplay.onModuleCreate(element, preference); //! //! Create audio module. //! mAudio.onModuleCreate(new WebOpenALES10()); mAudioThread.schedule(new TimerTask() { @Override public void run() { mAudio.onModuleUpdate(); } }, 0L, THREAD_AUDIO_DELAY); //! //! Create input module. //! mInput.onModuleCreate( new WebInputKeyboard(Window.current().getDocument().getDocumentElement()), new WebInputMouse(element)); mInputThread.schedule(new TimerTask() { @Override public void run() { mInput.onModuleUpdate(); } }, 0L, THREAD_INPUT_DELAY); //! //! Create render module. //! mRender.onModuleCreate(new WebOpenGLES32(element)); //! //! Create resource module. //! mResources.registerAssetLocator("EXTERNAL", new XHRAssetLocator()); mResources.registerAssetLoader(new TexturePNGAssetLoader(), "png"); mResources.registerAssetLoader(new TextureDDSAssetLoader(), "dds", "s3tc"); mResources.registerAssetLoader(new AudioWAVAssetLoader(), "wav"); mResources.registerAssetLoader(new AudioOGGAssetLoader(), "ogg"); mResources.registerAssetLoader(new FontBinaryAssetLoader(), "fnt"); mResources.registerAssetLoader(new ShaderBinaryAssetLoader(QKRender.getCapabilities()), "shader"); //! //! Handle the create notification. //! mLifecycle.onCreate(); mLifecycle.onResize(mDisplay.getWidth(), mDisplay.getHeight()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Module createModule();", "private void onModuleCreate(Display.Preference preference) {\n //!\n //! Create display module.\n //!\n final GLFWFramebufferSizeCallback resize = GLFWFramebufferSizeCallback.create((window, width, height) ->\n {\n mLifecycle.onResize(width, height);\n\n //!\n //! NOTE: This is required due to GLFW3 limitation.\n //!\n onModuleRender(GLFW.glfwGetTime());\n });\n final GLFWWindowIconifyCallback iconify = GLFWWindowIconifyCallback.create((window, iconified) ->\n {\n if (iconified) {\n mLifecycle.onPause();\n } else {\n mLifecycle.onResume();\n }\n });\n mDisplay.onModuleCreate(preference, resize, iconify);\n\n //!\n //! Create audio module.\n //!\n mAudio.onModuleCreate(new DesktopALES10());\n mAudioThread.schedule(new TimerTask() {\n @Override\n public void run() {\n mAudio.onModuleUpdate();\n }\n }, 0L, THREAD_AUDIO_DELAY);\n\n //!\n //! Create input module.\n //!\n mInput.onModuleCreate(new DesktopInputKeyboard(mDisplay.getHandle()), new DesktopInputMouse(mDisplay.getHandle()));\n mInputThread.schedule(new TimerTask() {\n @Override\n public void run() {\n mInput.onModuleUpdate();\n }\n }, 0L, THREAD_INPUT_DELAY);\n\n //!\n //! Create render module.\n //!\n mRender.onModuleCreate(new DesktopGLES32());\n\n //!\n //! Create resource module.\n //!\n mResources.registerAssetLocator(\"INTERNAL\", new ClassAssetLocator());\n mResources.registerAssetLocator(\"EXTERNAL\", new FilesAssetLocator());\n\n mResources.registerAssetLoader(new TexturePNGAssetLoader(), \"png\");\n mResources.registerAssetLoader(new TextureDDSAssetLoader(), \"dds\", \"s3tc\");\n mResources.registerAssetLoader(new AudioWAVAssetLoader(), \"wav\");\n mResources.registerAssetLoader(new AudioOGGAssetLoader(), \"ogg\");\n mResources.registerAssetLoader(new FontBinaryAssetLoader(), \"fnt\");\n mResources.registerAssetLoader(new ShaderBinaryAssetLoader(QKRender.getCapabilities()), \"shader\");\n\n //!\n //! Handle the create notification.\n //!\n mLifecycle.onCreate();\n mLifecycle.onResize(mDisplay.getWidth(), mDisplay.getHeight());\n }", "abstract protected T createModuleNode(NodeDescriptor node);", "ModuleDefine createModuleDefine();", "protected void initModules()\n {\n\n }", "public Module createModule(String bundleName, String moduleTypeName) {\n Bundle bundle = getBundle(bundleName);\n if (bundle == null) {\n return null;\n }\n //System.err.println(\"creating \"+bundleName+\":\"+moduleTypeName);\n CModule newModule = createCModule(bundleName, moduleTypeName);\n //System.err.println(\"done\");\n return newModule;\n }", "CreateHandler()\n {\n }", "RegistrationModule createRegistrationModule();", "@Override\n public void onModuleLoad() {\n }", "@Override\n\tpublic void prepareModule() throws Exception {\n\n\t}", "public void create() {\n\t\t\n\t}", "private Module createModule() throws Exception\n {\n Map headerMap = m_archive.getCurrentRevision().getManifestHeader();\n\n // Create the module instance.\n ModuleImpl module = new ModuleImpl(\n getFramework().getLogger(),\n getFramework().getConfig(),\n getFramework().getResolver(),\n this,\n Long.toString(getBundleId())\n + \".\" + m_archive.getCurrentRevisionNumber().toString(),\n headerMap,\n m_archive.getCurrentRevision().getContent(),\n getFramework().getBundleStreamHandler(),\n getFramework().getBootPackages(),\n getFramework().getBootPackageWildcards());\n\n // Verify that the bundle symbolic name + version is unique.\n if (module.getManifestVersion().equals(\"2\"))\n {\n Version bundleVersion = module.getVersion();\n bundleVersion = (bundleVersion == null) ? Version.emptyVersion : bundleVersion;\n String symName = module.getSymbolicName();\n\n Bundle[] bundles = getFramework().getBundles();\n for (int i = 0; (bundles != null) && (i < bundles.length); i++)\n {\n long id = ((BundleImpl) bundles[i]).getBundleId();\n if (id != getBundleId())\n {\n String sym = bundles[i].getSymbolicName();\n Version ver = ((ModuleImpl)\n ((BundleImpl) bundles[i]).getCurrentModule()).getVersion();\n if ((symName != null) && (sym != null) && symName.equals(sym) && bundleVersion.equals(ver))\n {\n throw new BundleException(\n \"Bundle symbolic name and version are not unique: \"\n + sym + ':' + ver, BundleException.DUPLICATE_BUNDLE_ERROR);\n }\n }\n }\n }\n\n return module;\n }", "@Override\n\tpublic void create () {\n\n\t}", "public void addTodoModule(){\n final Dialog dialog = new Dialog(context);\n dialog.setContentView(R.layout.add_todomodule);\n dialog.setTitle(R.string.name_module_todo);\n\n Button cancel = (Button) dialog.findViewById(R.id.cancel);\n cancel.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n dialog.dismiss();\n }\n });\n\n Button validate = (Button) dialog.findViewById(R.id.validatenewmodule);\n validate.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n TodoModuleService service = TodoModuleAPI.getInstance();\n service.addTodoModule(event.getId(),new Callback<Response>() {\n @Override\n public void success(Response s, Response response) {\n Toast.makeText(AddModule.this, \"Le module a bien été ajouté!\", Toast.LENGTH_SHORT).show();\n finish();\n }\n\n @Override\n public void failure(RetrofitError error) {\n error.printStackTrace();\n finish();\n }\n });\n dialog.dismiss();\n }\n });\n\n dialog.show();\n }", "@Override\n\tpublic void create() {\n\n\t}", "@Override\n\tpublic void create() {\n\t\t\n\t}", "ModuleDefinition createModuleDefinition();", "@Override\r\n\tpublic void create() {\n\r\n\t}", "@Override\r\n\tpublic void create() {\n\t\t\r\n\t}", "void additionalCreationCallback() {\n }", "public void create(){}", "public HALeaseManagementModule() {\n\n }", "private Module createModule(String moduleId, String ownerId, String copyId) throws NoFactoryForModuleException{\n\t\tIModuleFactory factory = factories.get(moduleId);\n\t\tif (factory==null){\n\t\t\tthrow new NoFactoryForModuleException(moduleId);\n\t\t}\n\t\treturn factory.createModule(ownerId, copyId);\n\t}", "public abstract void create();", "ModulePackage createModulePackage();", "public void createPackageContents() {\n\t\tif (isCreated) return;\n\t\tisCreated = true;\n\n\t\t// Create classes and their features\n\t\tbluetoothPortEClass = createEClass(BLUETOOTH_PORT);\n\n\t\tl2CAPInJobEClass = createEClass(L2CAP_IN_JOB);\n\n\t\tl2CAPoutJobEClass = createEClass(L2CA_POUT_JOB);\n\t}", "public static void setupModules(){\n\t\tStart.setupModules();\n\t\t//add\n\t\t//e.g.: special custom scripts, workers, etc.\n\t}", "public void create(HandlerContext context, Management request, Management response) {\n\t\t// TODO Auto-generated method stub\n\n\t}", "protected BackendModule(){ }", "protected void onPreCreateApplication() {\n\n\t}", "public void onCreation(java.lang.Object init)\n {\n }", "public void onModuleLoad() {\r\n\r\n Mvp4gModule module = (Mvp4gModule)GWT.create( Mvp4gModule.class );\r\n module.createAndStartModule();\r\n RootPanel.get().add( (IsWidget)module.getStartView() );\r\n\t\t// Use RootPanel.get() to get the entire body element\r\n\r\n\r\n\t}", "private void newProject()\n\t{\n\t\tnew FenetreCreationProjet();\n\t}", "public void onModuleLoad() {\r\n\t\tWindow.setTitle(Common.APPNAME);\r\n\t\tcloseButton = new Button(\"Close\", new ClickListener() {\r\n\t public void onClick(Widget sender) {\r\n\t \tdialogBox.hide();\r\n\t \tmanualRegisterBtn.setEnabled(true);\r\n\t }\r\n\t });\r\n\t\tcloseButton.setWidth(\"100%\");\r\n\t\tdialogBox.setWidget(closeButton);\r\n\t\t//\r\n\t\t// setup registration process\r\n\t\t//\r\n\t\tString requestUri = GWT.getHostPageBaseURL() + REGISTER_URI;\r\n\t\tregisterService.setup(requestUri, new AsyncCallback<List<String>>() {\r\n\t\t\tpublic void onFailure(Throwable caught) {\r\n\t\t\t\t// Show the RPC error message to the user\r\n\t\t\t\tlogger.severe(\"Error message from server trying to get providers ...\");\r\n\t\t\t}\r\n\r\n\t\t\tpublic void onSuccess(List<String> result) {\r\n\t\t\t\tlogger.info(\"Got urls ... # of item(s): \" + result.size());\r\n\t\t\t\tif (result != null && result.size() > 0) {\r\n\t\t\t\t\tbuildUI(result);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "public void postCreate(MavenProject project, ArtifactHandlerManager artifactHandlerManager) {\n if (types.isEmpty()) {\n Type t = new Type();\n ArtifactHandler h = artifactHandlerManager.getArtifactHandler(project.getPackaging());\n if (h!=null)\n t.type = h.getExtension();\n else\n t.type = h.getPackaging();\n types.add(t);\n }\n }", "@Override\n public void create() {\n // enable logging\n Gdx.app.setLogLevel(Application.LOG_DEBUG);\n log.debug(\"create()\");\n }", "public void createPackageContents()\n\t{\n\t\tif (isCreated) return;\n\t\tisCreated = true;\n\n\t\t// Create data types\n\t\tfeatureNotFoundExceptionEDataType = createEDataType(FEATURE_NOT_FOUND_EXCEPTION);\n\t}", "@RequestMapping(value = { \"/newModule\" }, method = RequestMethod.GET)\n\t\tpublic String newModule(ModelMap model) {\n\t\t\tModule module = new Module();\n\t\t\tmodel.addAttribute(\"module\", module);\n\t\t\tmodel.addAttribute(\"edit\", false);\n\t\t\t\n\t\t\treturn \"addNewModule\";\n\t\t}", "void instanceCreated(String pid, IDefinition definition);", "public void onModuleLoad() {\n\n\t\tJsonpRequestBuilder requestBuilder = new JsonpRequestBuilder();\n\t\t// requestBuilder.setTimeout(10000);\n//\t\trequestBuilder.requestObject(SERVER_URL, new Jazz10RequestCallback());\n\n\t}", "@Override\n public void run() {\n if ((generate_modules_based_on_keyword==null)||(generate_modules_based_on_keyword.equals(\"\"))) {\n System.err.println(\"Error in module generation definition. Check format 'key:name1;name2;'\");\n } else {\n String[] parts = generate_modules_based_on_keyword.split(\":\",2);\n if (parts.length==2) {\n ArrayList<String> channelsToGenerate = new ArrayList<>();\n String[] channelNames = parts[1].split(\";\");\n for (int i=0;i<channelNames.length;i++) {\n channelsToGenerate.add(channelNames[i]);\n }\n pipe_out = pipe_in.generatePipe(parts[0], channelsToGenerate);\n pipe_out.name=pipe_in.toString()+pipe_suffix;\n } else {\n System.err.println(\"Error in module generation definition. Check format 'key:name1;name2;'\");\n }\n }\n }", "private void handleCreateCommand() throws IOException,\r\n ClassNotFoundException,\r\n InstantiationException,\r\n IllegalAccessException {\r\n final String className = (String) m_in.readObject();\r\n Class klass = Class.forName(className, false, m_loader);\r\n final Object instance = klass.newInstance();\r\n final String handle = RemoteProxy.wrapInstance(instance);\r\n m_out.writeObject(handle);\r\n m_out.flush();\r\n }", "protected void onAfterCreateApplication() {\n\n\t}", "public void handleCreateProject(SelectEvent event) {\n\t}", "public static void created() {\n\t\t// TODO\n\t}", "@Override\n\tpublic void create(IWizardEntity entity, WizardRunner runner) {\n\t\t\n\t}", "@Override\n\tpublic void onModuleLoad() {\n\t\tfinal ModuleList modList = new ModuleList();\n\t\tfinal TabLayoutPanel configTabs = new TabLayoutPanel(2, Unit.EM);\n\n\t\t// Creates the module map.\n\t\t//final ModuleMap modMap = new ModuleMap(modList);\n\n\t\t// Creates the weather feed.\n\t\tfinal Weather weather = new Weather();\n\n\t\t// Creates configuration map.\n\t\tfinal ModuleConfiguration fullConfig = new ModuleConfiguration();\n\t\tfinal ModuleConfiguration fullConfig2 = new ModuleConfiguration();\n\t\tfinal ModuleConfiguration min1Config = new ModuleConfiguration();\n\t\tfinal ModuleConfiguration min2Config = new ModuleConfiguration();\n\t\tmin1Config.setMinimumConfigOne(modList);\n\t\tmin2Config.setMinimumConfigTwo(modList);\n\n\t\t// GPS Data object.\n\t\t//final GPSDataTransfer dataTransfer = new GPSDataTransfer(modList);\n\n\t\t// Creates the root panel and sizes it.\n\t\tRootPanel.get().setSize(this.width, this.height);\n\n\t\t// Command to show login.\n\t\tCommand loginCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tfinal Login login = new Login();\n\t\t\t\tlogin.show();\n\t\t\t}\n\t\t};\n\n\n\t\t// Command to show the add module popup.\n\t\tCommand addModulePopupCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tfinal AddModulePopup popup = new AddModulePopup(modList, BUS);\n\t\t\t\tpopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {\n\t\t\t\t\tpublic void setPosition(final int offsetWidth, final int offsetHeight) {\n\t\t\t\t\t\tint left = (Window.getClientWidth() - offsetWidth) / MAGIC_NUMBER;\n\t\t\t\t\t\tint top = (Window.getClientHeight() - offsetHeight) / MAGIC_NUMBER;\n\t\t\t\t\t\tpopup.setPopupPosition(left, top);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tpopSound.play();\n\t\t\t}\n\t\t};\n\n\t\t//Command to show the GPS Data Transfer popup.\n\t\tCommand gpsDataPopupCmd = new Command() {\n\t\t\tpublic void execute(){\n\t\t\t\tfinal GPSDataPopup gpsPopup = new GPSDataPopup(modList, BUS);\n\t\t\t\t\tgpsPopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {\n\t\t\t\t\tpublic void setPosition(final int offsetWidth, final int offsetHeight) {\n\t\t\t\t\t\tint left = (Window.getClientWidth() - offsetWidth) / MAGIC_NUMBER;\n\t\t\t\t\t\tint top = (Window.getClientHeight() - offsetHeight) / MAGIC_NUMBER;\n\t\t\t\t\t\tgpsPopup.setPopupPosition(left, top);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tpopSound.play();\n\t\t\t}\n\t\t};\n\t\t\n\t\t// Command to calculate full configurations and add to new tabs.\n\t\tCommand configurationCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tCoordinates center = fullConfig.findBestCenterOfGravity(modList, ModuleConfiguration.FOUR);\n\t\t\t\tCoordinates center2 = fullConfig2.findBestCenterOfGravity(modList, ModuleConfiguration.THREE);\n\t\t\t\t\n\t\t\t\tif (fullConfig.calculateConfiguration(modList, center.getX(), center.getY(), ModuleConfiguration.FOUR)) {\n\t\t\t\t\tfullConfig2.calculateConfiguration(modList, center2.getX(), center2.getY(), ModuleConfiguration.THREE);\n\t\t\t\t\tMarsHabitatConfigurationSystem.successSound.play();\t\n\t\t\t\t\t\n\t\t\t\t\tconfigTabs.clear();\n\t\t\t\t\tconfigTabs.add(new ModuleMap(modList), MODULE_MAP_STRING);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min1Config), MIN1_CONFIG);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min2Config), MIN2_CONFIG);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(fullConfig), FULL_CONFIG);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(fullConfig2), FULL_CONFIG2);\n\t\t\t\t\tconfigTabs.selectTab(FULL_INDEX);\n\t\t\t\t\t\n\t\t\t\t\tWindow.alert(\"Full Configuration Available!\");\n\t\t\t\t} else {\n\t\t\t\t\tMarsHabitatConfigurationSystem.errorSound.play();\n\t\t\t\t\tWindow.alert(\"Full Configuration not Available!\");\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t\n\t\t// Command for clearing the module list and configurations\n\t\tCommand clearCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tmodList.clearList();\n\t\t\t\tfullConfig.clearConfig();\n\t\t\t\t\n\t\t\t\tconfigTabs.clear();\n\t\t\t\tconfigTabs.add(new ModuleMap(modList), MODULE_MAP_STRING);\n\t\t\t\tconfigTabs.selectTab(0);\n\t\t\t\tMINIMUM_CONFIG_REACHED = false;\n\t\t\t}\n\t\t};\n\n\t\t// Command for saving the full configuration.\n\t\tCommand saveConfigCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tif (configTabs.getSelectedIndex() == FULL_INDEX) {\n\t\t\t\t\tif (fullConfig.saveConfiguration(FULL_CONFIG)) {\n\t\t\t\t\t\tsuccessSound.play();\n\t\t\t\t\t\tWindow.alert(\"Full Configuration Saved!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrorSound.play();\n\t\t\t\t\t\tWindow.alert(\"No Full Configuration Exists!\");\n\t\t\t\t\t}\n\t\t\t\t} else if (configTabs.getSelectedIndex() == FULL_INDEX + 1) {\n\t\t\t\t\tif (fullConfig2.saveConfiguration(FULL_CONFIG)) {\n\t\t\t\t\t\tsuccessSound.play();\n\t\t\t\t\t\tWindow.alert(\"Full Configuration Saved!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrorSound.play();\n\t\t\t\t\t\tWindow.alert(\"No Full Configuration Exists!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Command for loading the full configuration.\n\t\tCommand loadConfigCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tif (fullConfig.loadConfiguration(FULL_CONFIG)) {\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(fullConfig), FULL_CONFIG);\n\t\t\t\t\tsuccessSound.play();\n\t\t\t\t\tWindow.alert(\"Full Configuration loaded!\");\n\t\t\t\t} else {\n\t\t\t\t\terrorSound.play();\n\t\t\t\t\tWindow.alert(\"No full configuration found in storage!\");\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Command for GPS data transfer.\n//\t\tCommand gpsDataCmd = new Command() {\n//\t\t\tpublic void execute() {\n//\t\t\t\tdataTransfer.getData();\n//\t\t\t\tBUS.fireEvent(new AddEvent());\n//\t\t\t}\n//\t\t};\n\t\t\n\t\t// Command for changing the center of gravity.\n\t\tCommand gravityCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tgravityPopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {\n\t\t\t\t\tpublic void setPosition(final int offsetWidth, final int offsetHeight) {\n\t\t\t\t\t\tint left = (Window.getClientWidth() - offsetWidth) / MAGIC_NUMBER;\n\t\t\t\t\t\tint top = (Window.getClientHeight() - offsetHeight) / MAGIC_NUMBER;\n\t\t\t\t\t\tgravityPopup.setPopupPosition(left, top);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tpopSound.play();\n\t\t\t}\n\t\t};\n\t\t\n\t\t// Command for getting the size of moving task.\n\t\tCommand movingTaskCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tfinal MovingTaskPopup popup = new MovingTaskPopup(\n\t\t\t\t\t\tmodList.getSizeOfMovingTask(fullConfig.getCenterColumn(), fullConfig.getCenterRow()));\n\t\t\t\tpopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {\n\t\t\t\t\tpublic void setPosition(final int offsetWidth, final int offsetHeight) {\n\t\t\t\t\t\tint left = (Window.getClientWidth() - offsetWidth) / MAGIC_NUMBER;\n\t\t\t\t\t\tint top = (Window.getClientHeight() - offsetHeight) / MAGIC_NUMBER;\n\t\t\t\t\t\tpopup.setPopupPosition(left, top);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tpopSound.play();\n\t\t\t}\n\t\t};\n\n\t\t// Creates the menu for the menu bar.\n\t\tMenuBar theMenu = new MenuBar(true);\n\t\ttheMenu.setAnimationEnabled(true);\n\t\ttheMenu.addItem(\"Add Module\", addModulePopupCmd);\n\t\ttheMenu.addItem(\"GPS Data Transfer\", gpsDataPopupCmd);\n\t\ttheMenu.addSeparator();\n\t\ttheMenu.addItem(\"Calculate Full Configuration\", configurationCmd);\n\t\ttheMenu.addItem(\"Change Center of Gravity\", gravityCmd);\n\t\ttheMenu.addItem(\"Save Full Configuration\", saveConfigCmd);\n\t\ttheMenu.addItem(\"Load Full Configuration\", loadConfigCmd);\n\t\ttheMenu.addSeparator();\n\t\ttheMenu.addItem(\"Size of Moving Task\", movingTaskCmd);\n\t\ttheMenu.addSeparator();\n\t\ttheMenu.addItem(\"Clear Modules and Configuration\", clearCmd);\n\t\ttheMenu.addSeparator();\n\t\ttheMenu.addItem(\"Log off\", loginCmd);\n\n\t\t// Creates the menu bar and adds the menu to itself.\n\t\tMenuBar menu = new MenuBar();\n\t\tmenu.setAnimationEnabled(true);\n\t\tmenu.addItem(\"Menu\", theMenu);\n\t\tmenu.setWidth(this.width);\n\n\t\t// Creates the tabs for the various configurations and module map.\n\t\tconfigTabs.add(new ModuleMap(modList), MODULE_MAP_STRING);\n\t\tconfigTabs.setHeight(this.height);\n\t\tconfigTabs.setWidth(this.width);\n\n\t\t// Adds everything to the root panel.\n\t\tRootPanel.get().add(menu);\n\t\tRootPanel.get().add(weather);\n\t\tRootPanel.get().add(configTabs);\n\n\t\t// Show login after module has loaded.\n\t\tfinal Login initialLogin = new Login();\n\t\tinitialLogin.show();\n\n\t\t// Start timer to show initial 10 day alert.\n\t\tTimer t = new Timer() {\n\t\t\tpublic void run() {\n\t\t\t\tfinal TenDayAlert initialTenDayAlert = new TenDayAlert();\n\t\t\t\tinitialTenDayAlert.setPopupPositionAndShow(new PopupPanel.PositionCallback() {\n\t\t\t\t\tpublic void setPosition(final int offsetWidth, final int offsetHeight) {\n\t\t\t\t\t\tint left = (Window.getClientWidth() - offsetWidth) / MAGIC_NUMBER;\n\t\t\t\t\t\tint top = (Window.getClientHeight() - offsetHeight) / MAGIC_NUMBER;\n\t\t\t\t\t\tinitialTenDayAlert.setPopupPosition(left, top);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tpopSound.play();\n\t\t\t}\n\t\t};\n\n\t\tt.schedule(ALERT_TIME);\n\n\t\t// Set handler for EventBus when new modules are added.\n\t\tBUS.addHandler(AddEvent.TYPE, new AddEventHandler() {\n\t\t\tpublic void onEvent(final AddEvent event) {\n\n\t\t\t\t// \"Refreshes\" the module map by removing and re-adding the tab\n\t\t\t\tconfigTabs.clear();\n\t\t\t\tconfigTabs.add(new ModuleMap(modList), MODULE_MAP_STRING);\n\t\t\t\tMINIMUM_CONFIG_REACHED = false;\n\t\t\t\t\n\t\t\t\t// Checks to see if requirements are met for the minimum configuration.\n\t\t\t\t// If they are met, the minimum configuration tabs are created and an alert is issued.\n\t\t\t\tif (!MINIMUM_CONFIG_REACHED) {\n\t\t\t\t\tif (modList.getNumOfAirlock() > 0 && modList.getNumOfCanteen() > 0 && modList.getNumOfControl() > 0 &&\n\t\t\t\t\t\t\tmodList.getNumOfDormitory() > 0 && modList.getNumOfPlain() > 2 && modList.getNumOfPower() > 0 &&\n\t\t\t\t\t\t\tmodList.getNumOfSanitation() > 0 && modList.getNumOfWater() > 0) {\n\t\t\t\t\t\tMINIMUM_CONFIG_REACHED = true;\n\n\t\t\t\t\t\tmin1Config.setMinimumConfigOne(modList);\n\t\t\t\t\t\tmin2Config.setMinimumConfigTwo(modList);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Adds minimum configuration one to the tab.\n\t\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min1Config), MIN1_CONFIG);\n\t\t\t\t\t\tconfigTabs.selectTab(MIN1_INDEX);\n\n\t\t\t\t\t\t// Adds minimum configuration two to the tab.\n\t\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min2Config), MIN2_CONFIG);\n\t\t\t\t\t\t\n\t\t\t\t\t\tsuccessSound.play();\n\t\t\t\t\t\tWindow.alert(\"Minimum Configurations Available!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\t// Set handler for when the center of gravity is changed.\n\t\tBUS.addHandler(GravityEvent.TYPE, new GravityEventHandler() {\n\t\t\tpublic void onEvent(final GravityEvent event) {\n\t\t\t\tModuleConfiguration newFullConfig = new ModuleConfiguration();\n\t\t\t\tint wings;\n\t\t\t\t\n\t\t\t\tif (configTabs.getSelectedIndex() == FULL_INDEX) {\n\t\t\t\t\twings = ModuleConfiguration.FOUR;\n\t\t\t\t} else {\n\t\t\t\t\twings = ModuleConfiguration.THREE;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If the center of gravity can be changed to specified coordinates.\n\t\t\t\tif (newFullConfig.calculateConfiguration(modList, event.xcoord, event.ycoord, wings)) {\n\t\t\t\t\tMarsHabitatConfigurationSystem.successSound.play();\t\n\t\t\t\t\tgravityPopup.hide();\n\t\t\t\t\t\n\t\t\t\t\tif (wings == ModuleConfiguration.FOUR) {\n\t\t\t\t\t\tfullConfig.calculateConfiguration(modList, event.xcoord, event.ycoord, wings);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfullConfig2.calculateConfiguration(modList, event.xcoord, event.ycoord, wings);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tconfigTabs.clear();\n\t\t\t\t\tconfigTabs.add(new ModuleMap(modList), MODULE_MAP_STRING);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min1Config), MIN1_CONFIG);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min2Config), MIN2_CONFIG);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(fullConfig), FULL_CONFIG);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(fullConfig2), FULL_CONFIG2);\n\t\t\t\t\tconfigTabs.selectTab(FULL_INDEX);\n\t\t\t\t\t\n\t\t\t\t\tWindow.alert(\"Center of Gravity Changed!\");\n\t\t\t\t} else {\n\t\t\t\t\tMarsHabitatConfigurationSystem.errorSound.play();\n\t\t\t\t\tWindow.alert(\"Configuration can not move to that location!\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Checks for minimum configs on load.\n\t\tif (modList.getNumOfAirlock() > 0 && modList.getNumOfCanteen() > 0 && modList.getNumOfControl() > 0 &&\n\t\t\t\tmodList.getNumOfDormitory() > 0 && modList.getNumOfPlain() > 2 && modList.getNumOfPower() > 0 &&\n\t\t\t\tmodList.getNumOfSanitation() > 0 && modList.getNumOfWater() > 0) {\n\t\t\tMINIMUM_CONFIG_REACHED = true;\n\n\t\t\t// Adds minimum configuration one to the tab.\n\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min1Config), MIN1_CONFIG);\n\n\t\t\t// Adds minimum configuration two to the tab.\n\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min2Config), MIN2_CONFIG);\n\t\t}\n\n\t\tRootPanel.get().addStyleName(\"rootPanel\");\n\t}", "@Override\r\n\tpublic String addModulePage(Module module) {\n\t\ttry {\r\n\t\t\tsessionFactory.getCurrentSession().save(module);\r\n\t\t\treturn \"success\";\r\n\t\t} catch (HibernateException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn \"fail\";\r\n\t\t}\r\n\t}", "public void onInitHandle() {\n }", "public void onCreate() {\r\n\t\tcreatorClass.onCreate(table);\r\n\t}", "@Override\r\n\tprotected void processInit() {\n\r\n\t}", "private void createEvents() {\n\t}", "public ExampleModuleClient() {\r\n }", "protected ProjectCreationDescriptor() {\n\t}", "public void handleNew()\n {\n app.io.misc.playLoadSound();\n if(app.gui.dialogs.confirmSave())\n {\n app.io.loader.handleNew();\n }\n }", "public void createAction() {\n }", "private LECCModule (ModuleName moduleName, ClassLoader foreignClassLoader, GeneratedCodeInfo generatedCodeInfo) {\r\n super (moduleName, foreignClassLoader, generatedCodeInfo);\r\n }", "public void onModuleLoad() {\n\t\tButton saveButton = new Button(\"Save\", new ClickHandler() {\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tsaveModel();\n\t\t\t}\n\t\t});\n\n\t\tmodelText.addKeyPressHandler(new KeyPressHandler() {\n\t\t\t@Override\n\t\t\tpublic void onKeyPress(KeyPressEvent event) {\n\t\t\t\tif (event.getCharCode() == 13) { // ENTER\n\t\t\t\t\tmodelText.setFocus(false);\n\t\t\t\t\tsaveModel();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tHTML modelListTitle = new HTML(\"<h2>Models List</h2>\");\n\t\t\n\t\tRootPanel.get(\"content\").add(modelText);\n\t\tRootPanel.get(\"content\").add(saveButton);\n\t\tRootPanel.get(\"content\").add(modelListTitle);\n\t\tRootPanel.get(\"content\").add(modelList);\n\n\t\tupdateModelList();\n\t}", "private void HandleAysncFromOnCreate(){\n HandleOnCreate create = new HandleOnCreate();\n\n ArrayList<String> GlobalVariables = create.GetGlobalVariables(refact);\n\n for(String variable : GlobalVariables){\n String [] var_list = variable.trim().split(\"\\\\s+\");\n String var = var_list[var_list.length-1];\n cachedGlobalVariables.put(variable, var);\n }\n\n String className = create.GetNameOfAsyncTaskFunction(asyncCached.get(\"extends AsyncTask\"));\n\n //remove any instances associated with async task\n refact = create.HandleInstanceOfAsyncTask(refact, className);\n\n //prompt user\n System.out.println(\"(2) Reformatting the activity onCreate() function\\n\");\n DisplaySleep();\n\n }", "protected void postInstantiate() {}", "@Override\n\tpublic void saveModule() throws Exception {\n\n\t}", "public void onModuleLoad() {\r\n\t\trpcService = GWT.create(ContactService.class);\r\n\t\teventBus = new HandlerManager(null);\r\n\t\tappViewer = new AppController(rpcService, eventBus);\r\n\t\tappViewer.go(RootPanel.get(\"initView\"));\r\n\t}", "public void initForAddNew() {\r\n\r\n\t}", "@Override\n public void install() {\n install(new NewControlerModule());\n install(new ControlerDefaultCoreListenersModule());\n install(new ControlerDefaultsModule());\n install(new ScenarioByInstanceModule(scenario));\n }", "@Override\n public String getName() {\n return \"createblog.do\";\n }", "@Override\r\n\tprotected void processInit() {\n\t\t\r\n\t}", "public void onModuleLoad() {\r\n // Create ClientFactory using deferred binding so we can replace with different impls in gwt.xml\r\n ClientFactory clientFactory = GWT.create(ClientFactory.class);\r\n clientFactory.getApp().run(RootLayoutPanel.get());\r\n }", "public void testAddModule() {\n\t System.out.println(\"addModule\");\n\t Module module = module1;\n\t Student instance = student1;\n\t instance.addModule(module);\n\t }", "public void handleCreateTask(SelectEvent event) {\n\t}", "@Override\n public void Create() {\n\n initView();\n }", "public void onModuleLoad() {\n\t\t//create our main panel\n\t\tfinal DeckPanel panels = new DeckPanel(); \n\t\tRootPanel.get(\"panel\").add(panels);\n\t\t//create our stage panels\n\t\tfinal LoginPanel login = new LoginPanel(panels,wwwordzService);\n\t\tfinal GamePanel game = new GamePanel(panels,wwwordzService); \n\t\tfinal RankingPanel ranking = new RankingPanel(panels,wwwordzService);\n\t\t//add stage panels to main panel\n\t\tpanels.add(login);\n\t\tpanels.add(game);\n\t\tpanels.add(ranking);\n\t\tpanels.showWidget(0);\n\t\t\n\n\t}", "@Override\n\tpublic ModuleInfo setModule(ModuleInfo moduleInfo) throws HFModuleException {\n\t\tLog.d(\"HFModuleManager\", \"setModule\");\n//\t\tif (!this.isCloudChannelLive()) {\n//\t\t\tthrow new HFModuleException(HFModuleException.ERR_USER_OFFLINE,\n//\t\t\t\t\t\"User is not online\");\n//\t\t}\n\t\tif (moduleInfo == null) {\n\t\t\tthrow new IllegalArgumentException(\"moduleinfo is Null\");\n//\t\t\tthrow new HFModuleException(HFModuleException.ERR_SET_MODULE,\n//\t\t\t\t\t\"your moduleinfo is null\");\n\t\t}\n\n\t\tmoduleInfo.setAccessKey(HFConfigration.accessKey);\n\t\tModuleSetRequest request = new ModuleSetRequest(moduleInfo);\n\t\t\n\t\ttry {\n\t\t\tModuleInfoResponse response = cloudModuleManager.setModule(request);\n\t\t\n\t\t\tModuleInfo responseModuleInfo = response.getPayload();\n\t\t\tresponseModuleInfo.setLocalIp(moduleInfo.getLocalIp());\n\t\t\tgetHFModuleHelper().addRemoteModuleInfo(responseModuleInfo);\n\t\t\t\n\t\t\treturn responseModuleInfo;\n\t\t} catch (CloudException e1) {\n\t\t\te1.printStackTrace();\n\t\t\tthrow new HFModuleException(e1.getErrorCode(), e1.getMessage());\n\t\t}\n\t\t\n//\t\ttry {\n//\t\t\tJSONObject joReq = new JSONObject();\n//\t\t\tJSONObject pl = new JSONObject(moduleInfo.toJson());\n//\t\t\tjoReq.put(\"PL\", pl);\n//\t\t\tjoReq.put(\"CID\", 30011);\n//\t\t\tjoReq.put(\"SID\", this.getsid());\n//\n//\t\t\tString req = joReq.toString();\n//\t\t\tString rsp = null;\n//\t\t\trsp = HttpProxy.reqByHttpPost(req);\n//\t\t\tJSONObject jo = new JSONObject(rsp);\n//\n//\t\t\tif (jo.isNull(\"RC\")) {\n//\t\t\t\tthrow new HFModuleException(HFModuleException.ERR_SET_MODULE,\n//\t\t\t\t\t\t\"can not set module\");\n//\t\t\t}\n//\n//\t\t\tif (jo.getInt(\"RC\") == 1) {\n//\t\t\t\tJSONObject rspPL = jo.getJSONObject(\"PL\");\n//\t\t\t\tModuleInfo rspInfo = new ModuleInfo();\n//\t\t\t\trspInfo.fromJson(pl);\n//\n//\t\t\t\trspInfo.setLocalIp(moduleInfo.getLocalIp());\n//\t\t\t\tgetHFModuleHelper().addRemoteModuleInfo(rspInfo);\n//\n//\t\t\t\treturn rspInfo;\n//\t\t\t} else {\n//\t\t\t\tthrow new HFModuleException(HFModuleException.ERR_SET_MODULE,\n//\t\t\t\t\t\t\"can not set module\");\n//\t\t\t}\n//\t\t} catch (JSONException e) {\n//\t\t\tthrow new HFModuleException(HFModuleException.ERR_SET_MODULE,\n//\t\t\t\t\t\"can not set module\");\n//\t\t}\n\t}", "public void createPackageContents() {\n\t\tif (isCreated) return;\n\t\tisCreated = true;\n\n\t\t// Create classes and their features\n\t\taudioEClass = createEClass(AUDIO);\n\t\tcreateEAttribute(audioEClass, AUDIO__CONTENT);\n\t\tcreateEAttribute(audioEClass, AUDIO__NAME);\n\t\tcreateEAttribute(audioEClass, AUDIO__TEXT);\n\n\t\taudioManagerEClass = createEClass(AUDIO_MANAGER);\n\n\t\taudioRecorderEClass = createEClass(AUDIO_RECORDER);\n\n\t\taudioPlayerEClass = createEClass(AUDIO_PLAYER);\n\n\t\t// Create enums\n\t\taudioStyleEEnum = createEEnum(AUDIO_STYLE);\n\t}", "public void create()\n throws Exception\n {\n super.start();\n\n BeanMetaData md = getContainer().getBeanMetaData();\n ejbName = md.getEjbName();\n\n // Should we log call details\n callLogging = md.getContainerConfiguration().getCallLogging();\n }", "@Override\n public void onCreate() {\n L.d(\"onCreate is called\");\n super.onCreate();\n }", "public Project_Create_Process() {\n initComponents();\n }", "public ObjectFactoryModuleCalendar() {\n }", "public void newTask() {\r\n\r\n todoTaskGui(\"Create\", null);\r\n }", "public modGenRoomControl() {\r\n //construct MbModule\r\n super();\r\n roomObjects = new HashMap(32);\r\n gui = new GUI();\r\n //we depend on the RemoteControl-module\r\n addDependency(\"RemoteControl\");\r\n //we depend on the ARNE-module\r\n addDependency(\"ARNE\");\r\n //register our packet data handler\r\n setPacketDataHandler(new PacketDataHandler());\r\n //we have a html-interface, so lets register it\r\n setHTMLInterface(new HTMLInterface());\r\n }", "@Override\n\tprotected void onCreate() {\n\t\tSystem.out.println(\"onCreate\");\n\t}", "public void onModuleLoad() {\n RootPanel.get(\"mock-simple-container\").add(new RpcSampleView());\n }", "ModuleRule createModuleRule();", "private void writeFactory(GenModule module) throws Exception {\n\t\tMustacheFactory mf = new DefaultMustacheFactory();\n\t\tMustache template = mf.compile(\"factoryTemplate.hbs\"); \n\t\tElement[] sources = getSourcesOf(module);\n\t\tJavaFileObject fileObject = filer.createSourceFile(module\n\t\t\t\t.getPackageName() + \".\" + module.getClassName()); //we dont report the sources so that we keep the generated file on touching e.g. a @singleton component \n\t\tOutputStream outputStream = fileObject.openOutputStream();\n\t\ttry (Writer writer = new PrintWriter(outputStream)) {\n\t\t\t//template.apply(module, writer);\n\t\t\ttemplate.execute(writer, module);\n\t\t\twriter.flush();\n\t\t}\n\t\t;\n\t}", "@Override\n public void Create() {\n initView();\n initData();\n }", "@Override\r\n\tpublic void onModuleLoad() {\n\t\tProposalHistory history=new ProposalHistory();\t\r\n\t\tPresenter presenter=new ProposalHistoryPresenter(history.addProposal(), new ProposalHistoryWidget());\r\n\t\tpresenter.go(RootPanel.get());\r\n\t}", "@SuppressWarnings(\"deprecation\")\n\t@Override\n\tpublic void onModuleLoad() {\n\t\t/*\n\t\t * Create file interface\n\t\t */\n\t\t// Create a FormPanel and point it at a service.\n\t\tform = new FormPanel();\n\t\tform.setAction(GWT.getModuleBaseURL() + \"greet\");\n\t\tform.setEncoding(FormPanel.ENCODING_MULTIPART);\n\t\tform.setMethod(FormPanel.METHOD_POST);\n\n\t\tform.setWidget(secondPanel);\n\t\t// secondPanel.add(statusLabel);\n\t\t// fileUpload.setName(form.getTitle());\n\t\tfileUpload.setName(\"UploadFile\");\n\n\t\tsecondPanel.add(fileUpload);\n\t\tuploadedOntologies.add(loadFile);\n\t\tClickHandler load_handler = new ClickHandler() {\n\t\t\t@Override\n\t\t\tpublic void onClick(final ClickEvent event) {\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t};\n\t\tloadFile.addClickHandler(load_handler);\n\n\t\tontologies = new ListBox();\n\t\tontologies.setSize(\"152px\", \"18px\");\n\t\n\t\tuploadedOntologies.add(ontologies);\n\t\tuploadedOntologies.setSpacing(5);\n\t\t// secondPanel.add(uploadedOntologies);\n\n\t\t/*\n\t\t * end file creation\n\t\t */\n\t\tlogger.log(Level.SEVERE, \"Log!\");\n\t\tOnt_Table.setText(1, 0, \"Class\"); // 3 columns\n\t\tOnt_Table.setText(1, 2, \"Object Property\");\n\t\tOnt_Table.setText(1, 4, \"Data Property\");\n\t\tdouble wi = Window.getClientWidth() / 3.5;\n\t\tString tablewidth = Double.toString(wi);\n\t\ttripleTable.getColumnFormatter().setWidth(0, tablewidth);\n\t\ttripleTable.getColumnFormatter().setWidth(1, tablewidth);\n\t\ttripleTable.getColumnFormatter().setWidth(2, tablewidth);\n\t\ttripleTable.setStyleName(\"Prompt-User\");\n\t\ttripleTable.setText(0, 0, \"Subject\");\n\t\ttripleTable.setText(0, 1, \"Predicate\");\n\t\ttripleTable.setText(0, 2, \"Object\");\n\t\ttripleTable.getRowFormatter().addStyleName(0, \"Prompt-User\");\n\t\ttripleTable.getColumnFormatter().addStyleName(0, \"columnOne\");\n\t\ttripleTable.getColumnFormatter().addStyleName(1, \"columnTwo\");\n\t\ttripleTable.getColumnFormatter().addStyleName(2, \"columnThree\");\n\t\ttripleTable.addStyleName(\"tripleTable\");\n\t\trow = tripleTable.getRowCount();\n\n\t\twebBox.setText(url);\n\t\twebBox.setWidth(\"340px\");\n\t\tframeWidth = String.valueOf(Window.getClientWidth() / 3.3) + \"px\";\n\t\tqueryBox.setText(\"\\n\\n\\n\\n\\n\\t\\t\\t\\t\\tEnter Query\");\n\t\tqueryBox.setSize(\"369px\", \"332px\");\n\n\t\tqueryBox.addFocusHandler(new FocusHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void onFocus(FocusEvent event) {\n\t\t\t\tqueryBox.selectAll();\n\t\t\t}\n\n\t\t});\n\t\tontology_from_disk.setText(\"/Users/markhender/ontologies/pizzas/pizza.rdf\");\n\t\tontology_from_disk.setWidth(\"340px\");\n\t\tframe = new Frame();\n\t\tframe.setUrl(url);\n\t\tframeWidth = String.valueOf(Window.getClientWidth() / 1.5) + \"px\"; // works\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// cross\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// browsers\n\t\tframeHeight = String.valueOf(String.valueOf(Window.getClientHeight() / 1.3) + \"px\");\n\t\tframe.setWidth(frameWidth);\n\t\tframe.setHeight(frameHeight);\n\t\tframe.setVisible(true);\n\n\t\t/*\n\t\t * Popup Panel\n\t\t */\n\t\tpopupHolder.add(closePopup);\n\n\t\tpopup.setWidget(popupContents);\n\t\tclosePopup.addClickHandler(new ClickHandler() {\n\t\t\t@Override\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tint end_of_list = ft.getRowCount();\n\t\t\t\tint count = 1;\n\n\t\t\t\twhile (count < end_of_list) {\n\t\t\t\t\tlogger.log(Level.SEVERE, \"line\");\n\t\t\t\t\tCheckBox box = (CheckBox) ft.getWidget(count, 3);\n\t\t\t\t\tif (box.getValue()) {\n\t\t\t\t\t\t// tripleTable.setText(tripleTable.getRowCount(), 0,\n\t\t\t\t\t\t// ft.getText(count, 0));\n\t\t\t\t\t\tprintSuggestedSubject(ft.getText(count, 0));\n\t\t\t\t\t\taddPredicate(ft.getText(count, 1));\n\t\t\t\t\t\tif (ft.getText(count, 1).endsWith(\"*\"))\n\t\t\t\t\t\t\taddLitObject(ft.getText(count, 2));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\taddObject(ft.getText(count, 2));\n\t\t\t\t\t}\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tlogger.log(Level.SEVERE, \"BINGO\");\n\t\t\t\tft.removeAllRows();\n\n\t\t\t\tpopup.hide();\n\t\t\t\tpopupContents.clear();\n\t\t\t\tpopupContents.add(popupHolder);\n\t\t\t}\n\t\t});\n\t\tcontent.setText(\"Search for content in webpage\");\n\t\tcontent.addFocusHandler(new FocusHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void onFocus(FocusEvent event) {\n\t\t\t\tcontent.setFocus(true);\n\t\t\t\tif (content.getText().equals(\"Search for content in webpage\"))\n\t\t\t\t\tcontent.setText(\"\");\n\t\t\t\telse\n\t\t\t\t\tcontent.selectAll();\n\t\t\t}\n\t\t});\n\t\taddPanel.add(webBox);\n\n\t\tsearchPanel.add(content); // content search box\n\t\tsearchPanel.add(search); // trigger content search button\n\t\tsearch.setHeight(\"37px\");\n\t\tdBox.setText(\"Triple Report\");\n\t\tclose.setText(\"Close\");\n\t\tclose.addClickListener(new ClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(Widget sender) {\n\t\t\t\tdialogBoxContents.clear();\n\t\t\t\tdBox.hide();\n\t\t\t}\n\t\t});\n\t\tdialogBoxholder.add(close);\n\n\t\tloadOntologyInternet.add(ontology_from_internet);\n\t\tloadOntologyInternet.add(load_ontology_web_button);\n\t\tradioButtonPanel.add(radioA);\n\t\tradioButtonPanel.add(radioB);\n\t\tsearchPanel.add(radioButtonPanel);\n\t\tbottomOfScreen.add(searchPanel);\n\t\tbottomOfScreen.add(tripleTable);\n\t\ttripleTable.setSize(\"981px\", \"67px\");\n\t\t// bottomOfScreen.setSpacing(10);\n\t\tsearch.setText(\"Enter\");\n\t\tcontent.setSize(\"282px\", \"29px\");\n\t\tListBox listbox = new ListBox();\n\t\tontology_Classes = new ListBox(); // Ontology class listbox\n\t\tproperty_Resources = new ListBox(); // \" property listbox\n\t\tproperty_Literals = new ListBox(); // \" individual listbox\n\t\tontology_Classes.setWidth(\"100px\");\n\t\tproperty_Resources.setWidth(\"100px\");\n\t\tproperty_Literals.setWidth(\"100px\");\n\n\t\tlistbox.setWidth(\"100px\");\n\t\tlistbox.setHeight(\"400px\");\n\t\tsave.setText(\"Save\");\n\t\tlistbox.setVisible(false);\n\t\t/*\n\t\t * before new page\n\t\t */\n\t\tfinal PopupPanel contextpanel = new PopupPanel();\n\n\t\tfinal Button ok = new Button(\"OK\");\n\t\tfinal HorizontalPanel hori = new HorizontalPanel();\n\t\tcontextpanel.setWidget(hori);\n\t\tentercontext.setText(\"context\");\n\t\thori.add(ok);\n\t\tfinal ClickHandler download_handler = new ClickHandler() {\n\t\t\t@Override\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tgreetingService.downloadRepository(entercontext.getText(), new downloadRepository());\n\t\t\t\tif (repository_downloaded)\n\t\t\t\t\tloadPageTwo(export_fp);\n\t\t\t\trepository_downloaded = true;\n\t\t\t\tlogger.log(Level.SEVERE, \"download_handler called\");\n\t\t\t}\n\t\t};\n\t\tClickHandler newpage_handler = new ClickHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tcontextpanel.center();\n\t\t\t\tok.addClickHandler(new ClickHandler() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\t\t\tif (repository_downloaded)\n\t\t\t\t\t\t\tloadPageTwo(export_fp);\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tdownload_handler.onClick(event);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontextpanel.hide();\n\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t\tlogger.log(Level.SEVERE, \"export path: \" + filepathofexport);\n\n\t\t\t}\n\n\t\t};\n\t\tnew_page.addClickHandler(newpage_handler);\n\t\tdownload_repository.addClickHandler(download_handler);\n\t\t/* Return to homepage */\n\t\thome_page.addClickHandler(new ClickHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tloadHomePage();\n\t\t\t}\n\t\t});\n\t\t/* home page */\n\n\t\t//mainPanel.add(frame); // browser\n\t\tmainPanel.add(uploadedOntologies);\n\t\tmainPanel.add(addPanel); // url for browser\n\t\t\t\taddPanel.add(webSend);\n\t\t\t\twebSend.setHeight(\"32px\");\n\t\t\n\t\t\t\twebSend.setText(\"GO\");\n\t\t\t\t\n\t\t\t\t\t\t// Listen for mouse events on webSend Button\n\t\t\t\t\t\t// to get new website\n\t\t\t\t\t\twebSend.addClickHandler(new ClickHandler() {\n\t\t\t\t\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\t\t\t\t\tframe.setUrl(webBox.getText()); // take url from textbox\n\t\t\t\t\t\t\t\tlogger.log(Level.SEVERE, frame.getUrl());\n\t\t\t\t\t\t\t\tcontent.setFocus(true);\n\t\t\t\t\t\t\t\tcontent.selectAll();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\tmainPanel.add(loadOntologyInternet);\n\t\tmainPanel.add(Ont_Table); // listboxes\n\t\tmainPanel.add(queryBox);\n\t\tmainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);\n\t\tmainPanel.add(queryButton);\n\t\tmainPanel.add(new_page);\n\t\tmainPanel.add(download_repository);\n\n\t\tRootPanel.get(\"stockList\").add(frame, RootPanel.get(\"stockList\").getAbsoluteLeft(), RootPanel.get(\"stockList\").getAbsoluteTop());\n\t\tRootPanel.get(\"stockList\").add(bottomOfScreen, 0, 725);\n\t\tbottomOfScreen.setSize(\"984px\", \"128px\");\n\t\tRootPanel.get(\"stockList\").add(form, frame.getOffsetWidth() + 10, frame.getAbsoluteTop());\n\t\tRootPanel.get(\"stockList\").add(mainPanel, frame.getOffsetWidth() + 10, form.getOffsetHeight() + frame.getAbsoluteTop());\n\t\t// listen for keyboard events in the textbox\n\t\twebBox.addKeyUpHandler(new KeyUpHandler() {\n\t\t\t@Override\n\t\t\tpublic void onKeyUp(KeyUpEvent event) {\n\t\t\t\tif (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {\n\t\t\t\t\tframe.setUrl(webBox.getText());\n\t\t\t\t\tcontent.setFocus(true);\n\t\t\t\t\tcontent.selectAll();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tframe.addLoadHandler(new LoadHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void onLoad(LoadEvent event) {\n\t\t\t\t\n\t\t\t}\n\n\t\t});\n\t\tfinal AsyncCallback<ArrayList<String>> ontology_class = new AsyncCallback<ArrayList<String>>() {\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(ArrayList<String> result) {\n\t\t\t\tclasses = result;\n\t\t\t\tontology.get(ontology.size() - 1).setClasses(result);\n\t\t\t\tif (ontology.size() == 1)\n\t\t\t\t\tpopulate_ClassBox(0);\n\t\t\t}\n\t\t};\n\t\tfinal AsyncCallback<ArrayList<String>> property_resource = new AsyncCallback<ArrayList<String>>() {\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(ArrayList<String> result) {\n\t\t\t\tproperties = result;\n\t\t\t\tontology.get(ontology.size() - 1).setProperties(result);\n\t\t\t\tif (ontology.size() == 1)\n\t\t\t\t\tpopulate_PropertyBox(0);\n\t\t\t}\n\t\t};\n\t\tfinal AsyncCallback<ArrayList<String>> property_literal = new AsyncCallback<ArrayList<String>>() {\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(ArrayList<String> result) {\n\t\t\t\tliterals = result;\n\t\t\t\tontology.get(ontology.size() - 1).setLiterals(result);\n\t\t\t\tif (ontology.size() == 1)\n\t\t\t\t\tpopulate_LiteralBox(0);\n\t\t\t}\n\t\t};\n\n\t\tload_ontology_web_button.addClickHandler(new ClickHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\t// TODO load ontologies from a web address\n\t\t\t}\n\n\t\t});\n\t\tfinal AsyncCallback<Integer[]> subjectIndexOfContent = new AsyncCallback<Integer[]>() {\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(Integer[] result) {\n\t\t\t\tif (result[0] != -99 && result[1] != -99) {\n\t\t\t\t\t// word found\n\t\t\t\t\tprintSubject();\n\t\t\t\t} else\n\t\t\t\t\tWindow.alert(\"Word not found\");\n\t\t\t}\n\n\t\t};\n\n\t\tfinal AsyncCallback<String> getOntName = new AsyncCallback<String>() {\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(String result) {\n\t\t\t\tontName = result;\n\t\t\t\tontology.get(ontology.size() - 1).setName(result);\n\t\t\t\tlogger.log(Level.SEVERE, (\"OntologyName = \" + ontName));\n\t\t\t}\n\n\t\t};\n\n\t\tfinal AsyncCallback<String> geturi = new AsyncCallback<String>() {\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(String result) {\n\t\t\t\tbaseURI = result;\n\t\t\t\tontology.get(ontology.size() - 1).setBaseURI(result);\n\t\t\t\tlogger.log(Level.SEVERE, \"The baseURI is \" + baseURI);\n\t\t\t}\n\n\t\t};\n\t\tfinal AsyncCallback<ArrayList<String[]>> suggestedTriples = new AsyncCallback<ArrayList<String[]>>() {\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(ArrayList<String[]> result) {\n\t\t\t\tlogger.log(Level.SEVERE, \"First\");\n\t\t\t\tpopulateSuggestedTriples(result);\n\t\t\t\tWindow.alert(\"Pass\");\n\t\t\t}\n\n\t\t};\n\t\ttripleTable.addClickHandler(new ClickHandler() {\n\t\t\t@Override\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tcom.google.gwt.user.client.ui.HTMLTable.Cell cell = tripleTable.getCellForEvent(event);\n\t\t\t\tint cellIndex = cell.getCellIndex();\n\t\t\t\tint rowIndex = cell.getRowIndex();\n\t\t\t\tif (cellIndex == 4 || cellIndex == 0) {\n\t\t\t\t\tlogger.log(Level.SEVERE, \"Sending: \" + tripleTable.getText(rowIndex, 0));\n\t\t\t\t\tgreetingService.suggestedTriples(tripleTable.getHTML(rowIndex, 0), suggestedTriples);\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\n\t\tsearch.addClickHandler(new ClickHandler() {\n\t\t\t@Override\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tString blah = content.getText();\n\t\t\t\tif (radioA.isChecked() || !radioB.isChecked())\n\t\t\t\t\tgreetingService.wordExists(blah, webBox.getText(), subjectIndexOfContent);\n\t\t\t\telse{\n\t\t\t\t\tprintSubject();\n\t\t\t\t}\n\t\t\t\tcontent.setFocus(true);\n\t\t\t\tcontent.selectAll();\n\t\t\t}\n\t\t});\n\n\t\tcontent.addKeyUpHandler(new KeyUpHandler() {\n\t\t\t@Override\n\t\t\tpublic void onKeyUp(KeyUpEvent event) {\n\n\t\t\t\tif (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {\n\t\t\t\t\tif (radioA.isChecked() || !radioB.isChecked())\n\t\t\t\t\t\tgreetingService.wordExists(content.getText(), webBox.getText(), subjectIndexOfContent);\n\t\t\t\t\telse\n\t\t\t\t\t\tprintSubject();\n\t\t\t\t\tcontent.setFocus(true);\n\t\t\t\t\tcontent.selectAll();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tsave.addClickHandler(new ClickHandler() {\n\t\t\t@Override\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tString[] temp = new String[3];\n\t\t\t\ttemp = getTriples();\n\t\t\t\trepository_downloaded = false;\n\t\t\t}\n\t\t});\n\t\t\n\t\tOnt_Table.setWidget(0, 2, menuBar);\n\t\tmenuBar.setSize(\"100%\", \"100%\");\n\t\t\n\t\tClasses = new MenuItem(\"Classes\", false, menuBar_3);\n\t\tOntology_Contents_Holder.addItem(Classes);\n\t\tmenuBar_2.addItem(mntmObject);\n\t\tmenuBar_2.addItem(mntmData);\n\t\tOntology_Contents_Holder.addItem(Properties);\n\t\tmenuBar.addItem(Ontology_Name);\n\t\t\n\t\tOnt_Table.setWidget(2, 2, property_Resources);\n\t\tOnt_Table.setWidget(2, 4, property_Literals);\n\n\t\t/*\n\t\t * Adding Change listener to listboxes\n\t\t */\n\t\tontologies.addChangeListener(new ChangeListener() {\n\t\t\t@Override\n\t\t\tpublic void onChange(Widget sender) {\n\t\t\t\tint listIndex = ontologies.getSelectedIndex();\n\n\t\t\t\tpopulate_ClassBox(listIndex);\n\t\t\t\tpopulate_PropertyBox(listIndex);\n\t\t\t\tpopulate_LiteralBox(listIndex);\n\t\t\t}\n\t\t});\n\t\tontology_Classes.addChangeListener(new ChangeListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onChange(Widget sender) {\n\t\t\t\tint listIndex = ontology_Classes.getSelectedIndex();\n\t\t\t\tString uri = ontology.get(ontologies.getSelectedIndex()).getBaseURI();\n\t\t\t\tString item = uri + ontology_Classes.getItemText(listIndex);\n\t\t\t\taddObject(item);\n\t\t\t}\n\n\t\t});\n\t\tproperty_Resources.addChangeListener(new ChangeListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onChange(Widget sender) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tint listIndex = property_Resources.getSelectedIndex();\n\t\t\t\tlogger.log(Level.SEVERE, property_Resources.getItemText(listIndex));\n\t\t\t\tif (!(property_Resources.getItemText(listIndex).equals(\"RDF.type\"))) {\n\t\t\t\t\tlogger.log(Level.SEVERE, \"not rdf.type\");\n\t\t\t\t\tString uri = ontology.get(ontologies.getSelectedIndex()).getBaseURI();\n\t\t\t\t\tString item = uri + property_Resources.getItemText(listIndex);\n\t\t\t\t\taddPredicate(item);\n\t\t\t\t} else {\n\t\t\t\t\tlogger.log(Level.SEVERE, \"rdf.type\");\n\t\t\t\t\tString item = property_Resources.getItemText(listIndex);\n\t\t\t\t\taddPredicate(item);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t});\n\n\t\tproperty_Literals.addChangeListener(new ChangeListener() {\n\t\t\t@Override\n\t\t\tpublic void onChange(Widget sender) {\n\t\t\t\tif (property_Literals.getItemCount() == 0)\n\t\t\t\t\tWindow.alert(\"This list is empty!\");\n\t\t\t\telse {\n\t\t\t\t\tint listIndex = property_Literals.getSelectedIndex();\n\t\t\t\t\tString uri = ontology.get(ontologies.getSelectedIndex()).getBaseURI();\n\t\t\t\t\tString item = uri + property_Literals.getItemText(listIndex);\n\t\t\t\t\taddPredicate(item);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/*\n\t\t * File submit handling\n\t\t */\n\t\tform.addFormHandler(new FormHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void onSubmit(FormSubmitEvent event) {\n\t\t\t\t// logger.log(Level.SEVERE, \"form title: \"+\n\t\t\t\t// fileUpload.getFilename().substring(fileUpload.getFilename().lastIndexOf('\\\\')\n\t\t\t\t// + 1));\n\t\t\t\tontName = fileUpload.getFilename().substring(fileUpload.getFilename().lastIndexOf('\\\\') + 1);\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSubmitComplete(FormSubmitCompleteEvent event) {\n\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t}\n\n\t\t});\n\t\tform.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void onSubmitComplete(SubmitCompleteEvent event) {\n\t\t\t\tlogger.log(Level.SEVERE, \"form title: \" + form.getTitle());\n\t\t\t\tform.reset();\n\t\t\t\tAsyncCallback<String> pathfile = new AsyncCallback<String>() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tWindow.alert(\"Fail\");\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onSuccess(String result) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tpath_of_uploaded_file = result;\n\t\t\t\t\t\tontology.get(ontology.size() - 1).setFilePath(result);\n\t\t\t\t\t\tWindow.alert(\"Pass\");\n\t\t\t\t\t\tgreetingService.greetServer(list, path_of_uploaded_file, 1, ontology_class);\n\t\t\t\t\t\tgreetingService.greetServer(list, path_of_uploaded_file, 2, property_resource);\n\t\t\t\t\t\tgreetingService.greetServer(list, path_of_uploaded_file, 3, property_literal);\n\n\t\t\t\t\t\tontologies.addItem(ontology.get(ontology.size() - 1).getName());\n\n\t\t\t\t\t\t// logger.log(Level.SEVERE, baseURI);\n\t\t\t\t\t}\n\n\t\t\t\t};\n\t\t\t\tgreetingService.filePath(pathfile);\n\t\t\t\tgreetingService.getBaseURI(geturi);\n\t\t\t\t// greetingService.getOntName(getOntName);\n\t\t\t\tontology.add(new Ontology(ontName, path_of_uploaded_file, baseURI, classes, properties, literals));\n\t\t\t\t// greetingService.getOntName(getOntName);\n\t\t\t\tif (ontology.size() == 1) {\n\t\t\t\t\t// populate_listBoxes();\n\t\t\t\t}\n\t\t\t\tlogger.log(Level.SEVERE, \"baseuri = \" + baseURI);\n\t\t\t}\n\n\t\t});\n\n\t}", "private ModuleLoader() {\r\n }", "protected abstract void instantiateDataForAddNewTemplate (AsyncCallback<DATA> callbackOnSampleCreated) ;", "private void registerModule(Module module) {\n \t\tif (module.register()) {\n \t\t\t_availableModules.add(module);\n \t\t}\n \t}", "public void createPackageContents()\n {\n\t\tif (isCreated) return;\n\t\tisCreated = true;\n\n\t\t// Create classes and their features\n\t\tclarityAbstractObjectEClass = createEClass(CLARITY_ABSTRACT_OBJECT);\n\t\tcreateEAttribute(clarityAbstractObjectEClass, CLARITY_ABSTRACT_OBJECT__CLARITY_CONNECTION);\n\n\t\tclarityAddFilesEClass = createEClass(CLARITY_ADD_FILES);\n\n\t\tclarityGetBatchResultEClass = createEClass(CLARITY_GET_BATCH_RESULT);\n\n\t\tclarityGetKeyEClass = createEClass(CLARITY_GET_KEY);\n\n\t\tclarityQueryBatchEClass = createEClass(CLARITY_QUERY_BATCH);\n\n\t\tclarityReloadFileEClass = createEClass(CLARITY_RELOAD_FILE);\n\n\t\tclarityRemoveFilesEClass = createEClass(CLARITY_REMOVE_FILES);\n\n\t\tstartBatchEClass = createEClass(START_BATCH);\n\t}", "public void createPackageContents() {\n\t\tif (isCreated) return;\n\t\tisCreated = true;\n\n\t\t// Create classes and their features\n\t\trepositoryEClass = createEClass(REPOSITORY);\n\t\tcreateEAttribute(repositoryEClass, REPOSITORY__NAME);\n\t\tcreateEAttribute(repositoryEClass, REPOSITORY__LOCATION);\n\n\t\trepositoryManagerEClass = createEClass(REPOSITORY_MANAGER);\n\t}", "public void createPackageContents() {\n\t\tif (isCreated) return;\n\t\tisCreated = true;\n\n\t\t// Create classes and their features\n\t\tldprojectEClass = createEClass(LDPROJECT);\n\t\tcreateEAttribute(ldprojectEClass, LDPROJECT__NAME);\n\t\tcreateEAttribute(ldprojectEClass, LDPROJECT__LIFECYCLE);\n\t\tcreateEAttribute(ldprojectEClass, LDPROJECT__ROBUSTNESS);\n\t\tcreateEOperation(ldprojectEClass, LDPROJECT___PUBLISH);\n\t\tcreateEOperation(ldprojectEClass, LDPROJECT___UNPUBLISH);\n\t\tcreateEOperation(ldprojectEClass, LDPROJECT___UPDATE);\n\n\t\tlddatabaselinkEClass = createEClass(LDDATABASELINK);\n\t\tcreateEAttribute(lddatabaselinkEClass, LDDATABASELINK__DATABASE);\n\t\tcreateEAttribute(lddatabaselinkEClass, LDDATABASELINK__PORT);\n\n\t\tldprojectlinkEClass = createEClass(LDPROJECTLINK);\n\n\t\tldnodeEClass = createEClass(LDNODE);\n\t\tcreateEAttribute(ldnodeEClass, LDNODE__NAME);\n\t\tcreateEAttribute(ldnodeEClass, LDNODE__MONGO_HOSTS);\n\t\tcreateEAttribute(ldnodeEClass, LDNODE__MAIN_PROJECT);\n\t\tcreateEAttribute(ldnodeEClass, LDNODE__ANALYTICS_READ_PREFERENCE);\n\n\t\t// Create enums\n\t\tlifecycleEEnum = createEEnum(LIFECYCLE);\n\t\trobustnessEEnum = createEEnum(ROBUSTNESS);\n\t}", "@Override\n public void prepare() {\n System.out.println(\"Add Pepporonie!!\");\n }", "private static Module createEditedModule(Module moduleToEdit,\n EditModuleCommand.EditModuleDescriptor editModuleDescriptor) {\n assert moduleToEdit != null;\n\n ModuleName updatedName = editModuleDescriptor.getModuleName();\n\n UniqueStudentList studentList = moduleToEdit.getUniqueStudentList();\n UniqueTaskList taskList = moduleToEdit.getTaskList();\n\n return new Module(updatedName, studentList, taskList);\n }", "@Override\r\n public void create() {\r\n super.create();\r\n setTitle(title);\r\n }", "public interface Constants {\n\n /**\n * Add new modules\n * params: \"Title\", \"Description\", \"Module Tag\", \"Image url\"\n */\n Module moduleMaps = new Module(\"Maps\", \"Google map integrations with geofencing & more...\", \"\", \"http://3.bp.blogspot.com/_ZaGO7GjCqAI/Rh47v0ZvaoI/AAAAAAAABjA/20hcUi_0XVo/s640/maps-building-layer.png\");\n Module moduleVolley = new Module(\"Volley\", \"Network calls, caching & queuing...\", \"personal.aron.devstuff.views.VolleyActivity\", \"http://4.bp.blogspot.com/-K7j65NVErX4/Vg1fo0yVl5I/AAAAAAAACIM/e9vbLaxqA-U/s1600/image00.png\");\n Module moduleDynamicForms = new Module(\"Dynamic Forms\", \"Creating forms using json...\", \"personal.aron.devstuff.views.DynamicFormActivity\", \"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQEXcK-FALJ2WYj0GM015I70-al_Xxe7rkXRqtczHs6bZqRiau1xQ\");\n Module modulePermissions = new Module(\"App Permissions\", \"Asking permissions and handling it...\", \"personal.aron.devstuff.views.PermissionsActivity\", \"https://i.kinja-img.com/gawker-media/image/upload/s--Mjlv9Tan--/c_fill,fl_progressive,g_center,h_450,q_80,w_800/18hvgdkyebym4jpg.jpg\");\n\n public Module[] moduleList = {moduleMaps, moduleVolley, moduleDynamicForms, modulePermissions};\n\n public int numColumnsGridHome = 2;\n public String homeBackDrop = \"http://wallarthd.com/wp-content/uploads/2014/08/Art-Android-Wallpaper-Background.jpg\";\n\n}", "public void create_new_package(View V) {\n make_request();\r\n progressDialog.show();\r\n }", "@Override\r\n\tpublic void onNew() {\n\t\t\r\n\t}", "interface WithCreate extends DefinitionStages.WithNotes, DefinitionStages.WithOwners {\n /**\n * Executes the create request.\n *\n * @return the created resource.\n */\n ManagementLockObject create();\n\n /**\n * Executes the create request.\n *\n * @param context The context to associate with this operation.\n * @return the created resource.\n */\n ManagementLockObject create(Context context);\n }", "@Override\n\tpublic void onCreate() {\n\n\t}" ]
[ "0.68034625", "0.6711702", "0.6527934", "0.6393818", "0.63243264", "0.6164201", "0.6121402", "0.6116891", "0.6078842", "0.6066631", "0.6059779", "0.6052971", "0.6052953", "0.6026041", "0.6000761", "0.5979037", "0.5970702", "0.5948964", "0.59469575", "0.5939309", "0.5925476", "0.5870224", "0.5810648", "0.57695967", "0.576846", "0.5718254", "0.5717543", "0.5712772", "0.5647074", "0.56132823", "0.5583764", "0.55672", "0.55642235", "0.55571616", "0.5552332", "0.5549705", "0.5545797", "0.55431706", "0.5531952", "0.55250365", "0.5519305", "0.5507918", "0.5501242", "0.55003834", "0.5456184", "0.5454413", "0.5451833", "0.54514164", "0.54503554", "0.5445637", "0.5444642", "0.54413587", "0.5437883", "0.5425012", "0.5405407", "0.54026616", "0.53970516", "0.539164", "0.53886294", "0.5373679", "0.53713125", "0.53642464", "0.5363613", "0.5360543", "0.5359393", "0.5355302", "0.5330897", "0.5326623", "0.53264004", "0.53254426", "0.5324481", "0.53215754", "0.53115654", "0.53063625", "0.53009367", "0.5298964", "0.5293568", "0.5286708", "0.52861696", "0.52804077", "0.5278273", "0.5274843", "0.52642083", "0.52638906", "0.52522343", "0.5247347", "0.52443737", "0.52420086", "0.52419895", "0.52408063", "0.5239862", "0.52380455", "0.5233815", "0.52222", "0.52149373", "0.5205117", "0.5201394", "0.5198358", "0.5195665", "0.5193467" ]
0.62566835
5
Handle when the module destroy
private void onModuleDestroy() { //! //! Handle the destroy notification. //! mLifecycle.onPause(); mLifecycle.onDispose(); //! //! Unload resource module. //! mResources.onModuleDestroy(); mResources.unloadAll(); //! //! Unload input module. //! mInputThread.cancel(); mInput.onModuleDestroy(); //! //! Unload audio module. //! mAudioThread.cancel(); mAudio.onModuleDestroy(); //! //! Unload render module. //! //! NOTE: Update the render to destroy all render component(s) //! mRender.onModuleUpdate(); mRender.onModuleDestroy(); //! //! Unload display module. //! mDisplay.onModuleDestroy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void onModuleDestroy() {\n //!\n //! Handle the destroy notification.\n //!\n mLifecycle.onPause();\n mLifecycle.onDispose();\n\n //!\n //! Unload resource module.\n //!\n mResources.onModuleDestroy();\n mResources.unloadAll();\n\n //!\n //! Unload input module.\n //!\n mInputThread.cancel();\n mInput.onModuleDestroy();\n\n //!\n //! Unload audio module.\n //!\n mAudioThread.cancel();\n mAudio.onModuleDestroy();\n\n //!\n //! Unload render module.\n //!\n //! NOTE: Update the render to destroy all render component(s)\n //!\n mRender.onModuleDestroy();\n\n //!\n //! Unload display module.\n //!\n mDisplay.onModuleDestroy();\n }", "abstract void onDestroy();", "public void onDestroy();", "public void onDestroy();", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tSystem.exit(0);\n\t}", "@Override\n protected void onDestroy() {\n Initialization.exit(this);\n super.onDestroy();\n }", "protected void onDestroy() {\n }", "@Override\n\tprotected void onDestroy() {\n\t\t\n\t\tsuper.onDestroy();\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tCleanup();\r\n\t}", "@Override\r\n\tpublic void onCustomDestroy() {\n\t\t\r\n\t}", "public void onDestroy() {\r\n }", "@Override\r\n public void onDestroy() {\n }", "@Override\n public void onDestroy() {\n }", "void destroy(HandlerContext context);", "@Override\r\n\tpublic void onDestroy() {\n\t\t\r\n\t}", "@Override\n public void onDestroy() {\n // Cleanup service before destruction\n mHandlerThread.quit();\n }", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\thandler.removeCallbacks(null);\n\t\tMyApplication.Tag = 0;\n\t\tsuper.onDestroy();\n\t}", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\n\tprotected void onDestroy()\n\t{\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tXSDK.getInstance().onDestroy();\r\n\t\tsuper.onDestroy();\r\n\t}", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n\tprotected void onDestroy() {\n\t\tSystem.out.println(\"onDestroy\");\n\t}", "public void onDestroy() {\n LOG.mo8825d(\"[onDestroy]\");\n super.onDestroy();\n }", "@Override\r\n public void destroy() {\n }", "@Override\r\n public void destroy() {\n }", "void onDestroy();", "void onDestroy();", "void onDestroy();", "void onDestroy();", "public void onDestroy() {\n }", "@Override\n\tpublic void onDestroy() {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onDestroy();\n\t}", "@Override\n public void onDestroy() {\n }", "@Override\n public void onDestroy() {\n }", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t\t\n\t}", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tLog.e(TAG, \"ondestory\");\r\n\t}", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tLog.e(TAG, \"ondestory\");\r\n\t}", "@Override\n public void destroy() {\n }", "@Override\r\n\tpublic void onDestroy() {\n\t}", "public void onDestroy(){\n\t\tsuper.onDestroy();\n\t\tdoUnbind();\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tEventManager.getInstance().removeHandlerListenner(mHandler);\n\t}", "@Override\r\n\tpublic void destroy()\r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tcontroller.onDestroy();\n\t\tsuper.onDestroy();\n\n\t}", "@Override\r\n\tpublic void destroy() {\n\t}", "@Override\n public void destroy() {\n\n }", "@Override\n public void destroy() {\n\n }", "@Override\n public void destroy() {\n\n }", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}" ]
[ "0.8181511", "0.75969905", "0.7558324", "0.7558324", "0.7441234", "0.7431554", "0.74286646", "0.74250126", "0.7419767", "0.74126613", "0.73860735", "0.7385367", "0.73809224", "0.7374312", "0.7363231", "0.7361256", "0.73571324", "0.73571324", "0.73571324", "0.73571324", "0.735693", "0.73519456", "0.73519456", "0.73519456", "0.73519456", "0.7348915", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.7347569", "0.73470956", "0.73470956", "0.73470956", "0.73470956", "0.73470956", "0.73470956", "0.73470956", "0.73470956", "0.73470956", "0.73470956", "0.7344729", "0.7344394", "0.73425424", "0.73425424", "0.73425424", "0.73425424", "0.73425424", "0.73412544", "0.73325306", "0.73318", "0.73318", "0.73263377", "0.73263377", "0.73263377", "0.73263377", "0.73202264", "0.73122907", "0.730891", "0.730891", "0.7307359", "0.7306904", "0.7306904", "0.73047835", "0.73045117", "0.72979695", "0.72920084", "0.7289408", "0.72857225", "0.7282503", "0.72779346", "0.72779346", "0.72779346", "0.7274241", "0.7274241", "0.7274241", "0.7274241", "0.7274241", "0.7274241", "0.7274241", "0.7274241" ]
0.81478137
1
Handle when the module update
private void onModuleUpdate() { if (mTime == -1L) { mTime = System.currentTimeMillis(); } //! //! Render until the display is not active. //! onModuleRender(System.currentTimeMillis()); //! //! Request to render again. //! onAnimationRequest(this::onModuleUpdate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\t\t\tpublic void onUpdateFound(boolean newVersion, String whatsNew) {\n\t\t\t\t\t}", "public void receivedUpdateFromServer();", "protected void onUpdate() {\r\n\r\n\t}", "private void checkForUpdates() {\n UpdateManager.register(this);\n }", "private void checkForUpdates() {\n UpdateManager.register(this);\n }", "public void onUpdateFound(final String newVersion);", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tsuper.run();\r\n\t\t\t\tif(mSp.getBoolean(\"auto_update\", true)){\r\n\t\t\t\t\tupdateUtils.getCloudVersion();//当获取当前包名后就发出请求\r\n\t\t\t\t}else{\r\n\t\t\t\t\tupdateUtils.enterHome();\r\n\t\t\t\t}\t\r\n\t\t\t}", "public void updateManager();", "EventChannel.Update update();", "public void willbeUpdated() {\n\t\t\n\t}", "void onConfigChanged(ConfigUpdate update);", "@Override\r\n\tpublic void onCustomUpdate() {\n\t\t\r\n\t}", "public void handleUpdate(){\n increaseDecrease(\"i\");\n action=\"update\";\n buttonSave.setVisible(true);\n admission.setEditable(false);\n\n }", "@Override\n\tpublic void onConfigurationUpdate() {\n\t}", "public void update() {}", "public void update() {\n \t\tissueHandler.checkAllIssues();\n \t\tlastUpdate = System.currentTimeMillis();\n \t}", "@Override\n public String getHandlerName() {\n return \"UpdateHandler\";\n }", "private void hockeyAppCheckForUpdates() {\n UpdateManager.register(this);\n }", "@Override\n public void update() {\n }", "public void update() {\n\t}", "public void update() {\n\t}", "public void update() {\n\t}", "public void update() {\n\t}", "public void update() {\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}", "@Override\r\n\tpublic void update() {\n\t}", "@Override\r\n\tpublic void update() {\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}", "@Override\n\tpublic void update() {\n\n\t}", "public void onVersionChanged(String oldVersion, String newVersion);", "@Override\n public void update() {\n\n }", "@Override\n public void update()\n {\n\n }", "void configurationUpdated();", "@Override\r\n\tpublic void update() {\r\n\r\n\t}", "public void update(){\r\n }", "public void setUpdatesHandler(UpdatesHandler coreHandler);", "@Override\n public void update() {\n \n }", "@Override\n\tpublic void update() {\n\t}", "@Override\n\tpublic void update() {\n\t}", "@Override\n\tpublic void update() {\n\t}", "@Override\n\tpublic void updateInfo(Integer moduleClassId, ModuleClassInfo moduleClassInfo) throws Exception {\n\n\t}", "@Override\r\n\tpublic void update(BaseGameHandler gameHandler)\r\n\t{\n\t}", "@Override\r\n\tpublic void update() {\r\n\t}", "@Override\n\tpublic void update() {}", "@Override\n\tpublic void update() {}", "@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\r\n\tpublic void update() {\n\r\n\t}", "@Override\r\n\tpublic void update() {\n\r\n\t}", "public void update() {\n\n }", "public void update() {\n\n }", "public void updateModule (final double timestep);", "@Override\n public void update() {\n }", "abstract protected void notifyModuleNode(T node);", "@Override\n\tpublic void onUpdate() {\n\t\tlistener.onUpdate();\n\t}", "public void update(){\n }", "public void update(){\n \t//NOOP\n }", "@Override\r\n public void onUpdate() {\n super.onUpdate();\r\n }", "public void checkForUpdate();", "public void update() {\n\t\t\n\t}", "@Override\n\tpublic void processUpdate(ITabActivity act) {\n\t\t\n\t}", "@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 updateModules()\n throws Exception\n {\n LogUtil.put(LogFactory.getInstance(\"Start\", this, \"updateModules\"));\n \n Vector vector = this.findNewModules();\n Iterator iterator = vector.iterator();\n while(iterator.hasNext())\n {\n Bundle bundle = this.install((URL) iterator.next());\n \n if(bundle != null)\n {\n bundle.start(MODULES_START_LEVEL);\n }\n }\n }", "@Override\n\tpublic void update() { }", "public void update(){}", "public void update(){}", "public void update(){\r\n\t\t\r\n\t}", "public void update() {\r\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\tpublic void update(UpdateInfo updateInfo) {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void changedUpdate(DocumentEvent de) {\n\n\t}", "public void onInstalled() {\n }", "@Override\n\t\t\tpublic void changedUpdate(DocumentEvent arg0) {\n\t\t\t}", "@Override\n\tpublic void handleEventWorldUpdate(World world) {\n\t}", "@Override\n\tpublic void mpdUpdated(int arg0) {\n\t\t\n\t}", "private void handleAccountUpdateOnPre() {\n }", "@Override\n\t\t\t\t\t\t\tpublic void appUpdateFaild() {\n\t\t\t\t\t\t\t\thandler.sendEmptyMessage(1);\n\t\t\t\t\t\t\t}", "@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tswitch(msg.what){\n\t\t\t\tcase SHOW_UPDATE_DIALOG:\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"准备升级中\", Toast.LENGTH_LONG).show();\n\t\t\t\t\tupdate();\n\t\t\t\t\tbreak;\n\t\t\t\tcase NET_ERROR:\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"网络异常\", Toast.LENGTH_LONG).show();\n\t\t\t\t\tgoHome();\n\t\t\t\t\tbreak;\n\t\t\t\tcase JSON_ERROR:\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"JSON解析出错\", Toast.LENGTH_LONG).show();\n\t\t\t\t\tbreak;\n\t\t\t\tcase URL_ERROR:\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"URL出错\", Toast.LENGTH_LONG).show();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t}\n\t\t}", "@Override\n public void run() {\n super.run();\n\n try {\n has_newVersion = hasServerVersion();\n newVerName = getNewVersionURL();\n\n if (has_newVersion) {\n handler.sendEmptyMessage(Const.NEWVERSION);\n }\n\n }\n catch (NameNotFoundException e) {\n e.printStackTrace();\n }\n }", "public void update() ;" ]
[ "0.6469783", "0.64249146", "0.6423273", "0.62885034", "0.62885034", "0.62644833", "0.6256242", "0.62548566", "0.62518567", "0.62348956", "0.6197051", "0.6189723", "0.61573714", "0.6141606", "0.61268306", "0.61223435", "0.61118865", "0.6096208", "0.6074734", "0.6072602", "0.6072602", "0.6072602", "0.6072602", "0.6071563", "0.60640514", "0.60640514", "0.60640514", "0.60640514", "0.60640514", "0.605997", "0.605997", "0.6058915", "0.6058915", "0.6058915", "0.6058915", "0.6058915", "0.6058915", "0.6050551", "0.6045904", "0.6045408", "0.60389596", "0.60376084", "0.6035495", "0.6033747", "0.6027441", "0.60256183", "0.60256183", "0.60256183", "0.60243297", "0.602227", "0.6021707", "0.60195744", "0.60195744", "0.60136724", "0.60136724", "0.60136724", "0.6011859", "0.6011859", "0.6009942", "0.6009942", "0.60089374", "0.6005765", "0.60056686", "0.600344", "0.5995282", "0.5995121", "0.59937", "0.5968588", "0.59677577", "0.59644216", "0.59631014", "0.59631014", "0.5959691", "0.594215", "0.593743", "0.593743", "0.5934333", "0.5932406", "0.5927845", "0.5926815", "0.5926176", "0.5926176", "0.5926176", "0.5926176", "0.5926176", "0.5926176", "0.5926176", "0.5926176", "0.5926176", "0.5926176", "0.590385", "0.59024626", "0.59014344", "0.5900867", "0.5898304", "0.58928597", "0.5883077", "0.58785355", "0.5877483", "0.5863105" ]
0.6269706
5
Handle when the module render
private void onModuleRender(long time) { //! //! Handle the render notification. //! mLifecycle.onRender((time - mTime) / 1000.0f); //! //! Update the new delta time. //! mTime = time; //! //! Update the render. //! //! NOTE: House-keeping of render component(s). //! mRender.onModuleUpdate(); //! //! Update the display. //! //! NOTE: Will synchronise with the window. //! mDisplay.onModuleUpdate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onModuleLoad() {\n }", "protected void render(){}", "private void onModuleUpdate() {\n if (mTime == -1L) {\n mTime = System.currentTimeMillis();\n }\n\n //!\n //! Render until the display is not active.\n //!\n onModuleRender(System.currentTimeMillis());\n\n //!\n //! Request to render again.\n //!\n onAnimationRequest(this::onModuleUpdate);\n }", "private void onModuleRender(double time) {\n //!\n //! Handle the render notification.\n //!\n mLifecycle.onRender((float) (time - mTime));\n\n //!\n //! Update the new delta time.\n //!\n mTime = time;\n\n //!\n //! Update the render.\n //!\n //! NOTE: House-keeping of render component(s).\n //!\n mRender.onModuleUpdate();\n\n //!\n //! Update the display.\n //!\n //! NOTE: Will synchronise with the window.\n //!\n mDisplay.onModuleUpdate();\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n viewModule(request, response);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void displayModule() throws Exception {\n\n\t}", "protected void onComponentRendered()\n\t{\n\t}", "void onRender(RenderArguments arguments);", "private void doAfterRenderResponse(final PhaseEvent arg0) {\n\t}", "protected void render() {\n\t\tString accion = Thread.currentThread().getStackTrace()[2].getMethodName();\n\t\trender(accion);\n\t}", "@Override\n public void beforeRender()\n {\n\n }", "public void onModuleLoad() {\r\n\r\n Mvp4gModule module = (Mvp4gModule)GWT.create( Mvp4gModule.class );\r\n module.createAndStartModule();\r\n RootPanel.get().add( (IsWidget)module.getStartView() );\r\n\t\t// Use RootPanel.get() to get the entire body element\r\n\r\n\r\n\t}", "public void render() {\r\n\r\n }", "public void onModuleLoad() {\n\t\tGWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onUncaughtException(Throwable e) {\n\t\t\t\tThrowable unwrapped = getExceptionToDisplay(e);\n\t\t\t\tAppClientFactory.printSevereLogger(\"Exception Caught !! \"+unwrapped.getMessage());\n\t\t\t}\n\t\t});\n\t\t\n\t\tDelayedBindRegistry.bind(appInjector);\n\t\tAppClientFactory.setAppGinjector(appInjector);\n\t\t ArrayList<LoadLibrary> loadLibraries = new ArrayList<LoadApi.LoadLibrary>();\n\t\t loadLibraries.add(LoadLibrary.ADSENSE);\n\t\t loadLibraries.add(LoadLibrary.DRAWING);\n\t\t loadLibraries.add(LoadLibrary.GEOMETRY);\n\t\t loadLibraries.add(LoadLibrary.PANORAMIO);\n\t\t loadLibraries.add(LoadLibrary.PLACES);\n\t\t loadLibraries.add(LoadLibrary.WEATHER);\n\t\t loadLibraries.add(LoadLibrary.VISUALIZATION);\n\t\t \n\t\t \n\t\tString device = BrowserAgent.returnFormFactorWithSizeView();\n\t\tString size[] = device.split(\"-\");\n\n\t\t\tappInjector.getAppService().getLoggedInUser(new SimpleAsyncCallback<UserDo>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onSuccess(UserDo loggedInUser) {\n\t\t\t\t\tAppClientFactory.setLoggedInUser(loggedInUser);\n\t\t\t\t\tUcCBundle.INSTANCE.css().ensureInjected();\n\t\t\t\t\tHomeCBundle.INSTANCE.css().ensureInjected();\n\t\t\t\t\tAppClientFactory.getInjector().getWrapPresenter().get().setLoginData(loggedInUser);\n\t\t\t\t\tappInjector.getPlaceManager().revealCurrentPlace();\n\t\t\t\t\tAppClientFactory.setProtocol(getHttpOrHttpsProtocol());\n\t\t\t\t\tregisterWindowEvents();\n\t\t\t\t}\n\t\t\t});\n\t\t\tAppClientFactory.setAppGinjector(appInjector);\n\n\t\tgetloggersStatus();\n\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 240px) and (max-width: 767px) {\" + PlayerStyleBundle.INSTANCE.getPlayerMobileStyle().getText() + \"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 768px) and (max-width: 991px) {\" + PlayerStyleBundle.INSTANCE.getPlayerTabletStyle().getText() + \"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 240px) and (max-width: 550px) {\" + PlayerSmallMobileBundle.INSTANCE.getPlayerSmallMobile().getText() + \"}\");\n\t\tPlayerStyleBundle.INSTANCE.getPlayerStyleResource().ensureInjected();\n\t\t\n\t\tStyleInjector.injectAtEnd(\"@media (max-width: 767px){\"+SearchCBundle.INSTANCE.getResponsiveStyle().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (max-width: 767px) and (orientation:portrait){\"+SearchCBundle.INSTANCE.getResponsive1Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (max-width: 767px) and (orientation:landscape){\"+SearchCBundle.INSTANCE.getResponsive2Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 480px) and (max-width: 767px){\"+SearchCBundle.INSTANCE.getResponsive3Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 240px) and (max-width: 319px){\"+SearchCBundle.INSTANCE.getResponsive4Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 320px) and (max-width: 479px){\"+SearchCBundle.INSTANCE.getResponsive5Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media screen and (min-width: 768px){\"+SearchCBundle.INSTANCE.getResponsive6Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 1200px){\"+SearchCBundle.INSTANCE.getResponsive7Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 768px) and (max-width: 991px) {\"+SearchCBundle.INSTANCE.getResponsive8Style().getText()+\"}\");\n\n\t\tSearchCBundle.INSTANCE.css().ensureInjected();\n\t\t\n\t\t\n\t\t\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 240px) and (max-width: 319px){\"+LoginPopUpCBundle.INSTANCE.getResponsiveStyle().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 320px) and (max-width: 479px){\"+LoginPopUpCBundle.INSTANCE.getResponsive1Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 480px) and (max-width: 767px){\"+LoginPopUpCBundle.INSTANCE.getResponsive2Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 768px) and (max-width: 991px){\"+LoginPopUpCBundle.INSTANCE.getResponsive3Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 1200px){\"+LoginPopUpCBundle.INSTANCE.getResponsive4Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media screen and (max-width: 767px) {\"+LoginPopUpCBundle.INSTANCE.getResponsive5Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media screen and (min-width: 768px) {\"+LoginPopUpCBundle.INSTANCE.getResponsive6Style().getText()+\"}\");\n\n\t\tLoginPopUpCBundle.INSTANCE.css().ensureInjected();\n\t\t\n\t\tStyleInjector.injectAtEnd(\"@media (max-width: 767px) {\"+AnalyticsTabCBundle.INSTANCE.getResponsiveStyle().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 768px) and (max-width: 991px) {\"+AnalyticsTabCBundle.INSTANCE.getResponsive1Style().getText()+\"}\");\n\t\t\n\t\tAnalyticsTabCBundle.INSTANCE.css().ensureInjected();\n\t\t\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 240px) and (max-width: 319px){\"+ResourcePlayerCBundle.INSTANCE.getResponsive1Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 320px) and (max-width: 479px){\"+ResourcePlayerCBundle.INSTANCE.getResponsive2Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 480px) and (max-width: 767px){\"+ResourcePlayerCBundle.INSTANCE.getResponsive3Style().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 768px) and (max-width: 992px){\"+ResourcePlayerCBundle.INSTANCE.getResponsive4Style().getText()+\"}\");\n\n\t\tResourcePlayerCBundle.INSTANCE.css().ensureInjected();\n\t\n\n\t\tStyleInjector.injectAtEnd(\"@media (max-width: 767px) {\"+CollectionSummaryIndividualCBundle.INSTANCE.getResponsiveStyle().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 768px) and (max-width: 991px) {\"+CollectionSummaryIndividualCBundle.INSTANCE.getResponsive1Style().getText()+\"}\");\n\t\t\n\t\tCollectionSummaryIndividualCBundle.INSTANCE.css().ensureInjected();\n\t\t\n\t\tStyleInjector.injectAtEnd(\"@media (max-width: 767px) {\"+CollectionPlaySummaryCBundle.INSTANCE.getResponsiveStyle().getText()+\"}\");\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 768px) and (max-width: 991px) {\"+CollectionPlaySummaryCBundle.INSTANCE.getResponsive1Style().getText()+\"}\");\n\t\t\n\t\tCollectionPlaySummaryCBundle.INSTANCE.css().ensureInjected();\n\t\t\n\t\tStyleInjector.injectAtEnd(\"@media (min-width: 480px) and (max-width: 767px){\"+FolderContainerCBundle.INSTANCE.getResponsiveStyle().getText()+\"}\");\n\t\tFolderContainerCBundle.INSTANCE.css().ensureInjected();\n\t}", "public void onModuleLoad() {\r\n\t\tboolean sensor = true;\r\n\r\n\t\t// load all the libs for use\r\n\t\tArrayList<LoadLibrary> loadLibraries = new ArrayList<LoadApi.LoadLibrary>();\r\n\t\tloadLibraries.add(LoadLibrary.ADSENSE);\r\n\t\tloadLibraries.add(LoadLibrary.DRAWING);\r\n\t\tloadLibraries.add(LoadLibrary.GEOMETRY);\r\n\t\tloadLibraries.add(LoadLibrary.PANORAMIO);\r\n\t\tloadLibraries.add(LoadLibrary.PLACES);\r\n\r\n\t\tRunnable onLoad = new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\t// ajout du label de compte rendu\r\n\t\t\t\tVerticalPanel panelCompteRendu = new VerticalPanel();\r\n\t\t\t\thtmlCompteRendu = new HTML();\r\n\t\t\t\tpanelCompteRendu.add(htmlCompteRendu);\r\n\t\t\t\tRootPanel.get(\"compteRendu\").add(panelCompteRendu);\r\n\t\t\t\t\r\n\t\t\t\tVerticalPanel panelLegende = new VerticalPanel();\r\n\t\t\t\thtmlLegende = new HTML();\r\n\t\t\t\tpanelLegende.add(htmlLegende);\r\n\t\t\t\tRootPanel.get(\"legende\").add(htmlLegende);\r\n\t\t\t\t\r\n\t\t\t\t// temps d'intˇgration restant\r\n\t\t\t\tLabel tempsDIntegrationRestant = new Label();\r\n\t\t\t\tRootPanel.get(\"tempsDIntegrationRestant\").add(tempsDIntegrationRestant);\r\n\t\t\t\t\r\n\t\t\t\t// ajout de la carte\r\n\t\t\t\twMap = new MapFaWidget2(htmlCompteRendu);\r\n\t\t\t\tRootPanel.get(\"carte\").add(wMap);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// ajout du bouton reset\r\n\t\t\t\tButton boutonReset = new Button(\"Nettoyer la carte\");\r\n\t\t\t\tboutonReset.addClickHandler(actionBoutonReset());\r\n\t\t\t\tRootPanel.get(\"boutonReset\").add(boutonReset);\r\n\r\n\t\t\t\t// ajout du formulaire d'intˇgration\r\n\t\t\t\tnew FileUploadView(wMap,htmlLegende, htmlCompteRendu,tempsDIntegrationRestant);\r\n\r\n\t\t\t}\r\n\r\n\t\t};\r\n\r\n\t\tLoadApi.go(onLoad, loadLibraries, sensor);\r\n\t}", "public void render() {\n }", "void dynamicRendering();", "protected void preRender()\n {\n // subclass\n }", "@Override\r\n\tpublic void render() {\n\t\t\r\n\t}", "private void onModuleUpdate() {\n //!\n //! Calculate the initial time of the frame.\n //!\n mTime = GLFW.glfwGetTime();\n\n do {\n //!\n //! Render until the display is not active.\n //!\n onModuleRender(GLFW.glfwGetTime());\n } while (mDisplay.isActive());\n }", "@Override\r\n\tpublic void render() {\n\r\n\t}", "public void render()\r\n\t{\n\t}", "private void doBeforeRenderResponse(final PhaseEvent arg0) {\n\t}", "@Override\n\tpublic void render() {\n\t\t\n\t}", "@Override\n\tpublic void render () {\n\n\t}", "@Override\r\n\tpublic void onPageRender(ComponentSystemEvent event) throws Throwable {\n\t}", "public void onModuleLoad() {\n RootPanel.get(\"mock-simple-container\").add(new RpcSampleView());\n }", "protected void initModules()\n {\n\n }", "@Override\n\tpublic void renderSource() {\n\t\t\n\t}", "private void render() {\n\n StateManager.getState().render();\n }", "public void onModuleLoad() {\n\t\t// set viewport and other settings for mobile\n\t\tMGWT.applySettings(MGWTSettings.getAppSetting());\n\n\t\t// build animation helper and attach it\n\t\tAnimationHelper animationHelper = new AnimationHelper();\n\t\tRootPanel.get().add(animationHelper);\n\n\t\t// build some UI\n\t\tRootFlexPanel rootFlexPanel = new RootFlexPanel();\n\t\tButton button = new Button(\"Hello mgwt\");\n\t\trootFlexPanel.add(button);\n\n\t\t// animate\n\t\tanimationHelper.goTo(rootFlexPanel, Animations.SLIDE);\n\t}", "public void registerRenders() {\n }", "@Override\n public void render() {\n super.render();\n }", "@Override\n public void render() {\n super.render();\n }", "@Override\n\tpublic void render () {\n super.render();\n\t}", "public void onModuleLoad() {\n\t\tButton saveButton = new Button(\"Save\", new ClickHandler() {\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tsaveModel();\n\t\t\t}\n\t\t});\n\n\t\tmodelText.addKeyPressHandler(new KeyPressHandler() {\n\t\t\t@Override\n\t\t\tpublic void onKeyPress(KeyPressEvent event) {\n\t\t\t\tif (event.getCharCode() == 13) { // ENTER\n\t\t\t\t\tmodelText.setFocus(false);\n\t\t\t\t\tsaveModel();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tHTML modelListTitle = new HTML(\"<h2>Models List</h2>\");\n\t\t\n\t\tRootPanel.get(\"content\").add(modelText);\n\t\tRootPanel.get(\"content\").add(saveButton);\n\t\tRootPanel.get(\"content\").add(modelListTitle);\n\t\tRootPanel.get(\"content\").add(modelList);\n\n\t\tupdateModelList();\n\t}", "private void onModuleCreate(Display.Preference preference) {\n //!\n //! Create display module.\n //!\n final GLFWFramebufferSizeCallback resize = GLFWFramebufferSizeCallback.create((window, width, height) ->\n {\n mLifecycle.onResize(width, height);\n\n //!\n //! NOTE: This is required due to GLFW3 limitation.\n //!\n onModuleRender(GLFW.glfwGetTime());\n });\n final GLFWWindowIconifyCallback iconify = GLFWWindowIconifyCallback.create((window, iconified) ->\n {\n if (iconified) {\n mLifecycle.onPause();\n } else {\n mLifecycle.onResume();\n }\n });\n mDisplay.onModuleCreate(preference, resize, iconify);\n\n //!\n //! Create audio module.\n //!\n mAudio.onModuleCreate(new DesktopALES10());\n mAudioThread.schedule(new TimerTask() {\n @Override\n public void run() {\n mAudio.onModuleUpdate();\n }\n }, 0L, THREAD_AUDIO_DELAY);\n\n //!\n //! Create input module.\n //!\n mInput.onModuleCreate(new DesktopInputKeyboard(mDisplay.getHandle()), new DesktopInputMouse(mDisplay.getHandle()));\n mInputThread.schedule(new TimerTask() {\n @Override\n public void run() {\n mInput.onModuleUpdate();\n }\n }, 0L, THREAD_INPUT_DELAY);\n\n //!\n //! Create render module.\n //!\n mRender.onModuleCreate(new DesktopGLES32());\n\n //!\n //! Create resource module.\n //!\n mResources.registerAssetLocator(\"INTERNAL\", new ClassAssetLocator());\n mResources.registerAssetLocator(\"EXTERNAL\", new FilesAssetLocator());\n\n mResources.registerAssetLoader(new TexturePNGAssetLoader(), \"png\");\n mResources.registerAssetLoader(new TextureDDSAssetLoader(), \"dds\", \"s3tc\");\n mResources.registerAssetLoader(new AudioWAVAssetLoader(), \"wav\");\n mResources.registerAssetLoader(new AudioOGGAssetLoader(), \"ogg\");\n mResources.registerAssetLoader(new FontBinaryAssetLoader(), \"fnt\");\n mResources.registerAssetLoader(new ShaderBinaryAssetLoader(QKRender.getCapabilities()), \"shader\");\n\n //!\n //! Handle the create notification.\n //!\n mLifecycle.onCreate();\n mLifecycle.onResize(mDisplay.getWidth(), mDisplay.getHeight());\n }", "@Override\n public void initializedModule(final INaviModule module) {\n }", "@Override\n public void render() { super.render(); }", "private void onModuleCreate(HTMLCanvasElement element, Display.Preference preference) {\n Window.current().getDocument().addEventListener(\"visibilitychange\", evt -> {\n if (isHidden()) {\n mLifecycle.onPause();\n } else {\n mLifecycle.onResume();\n }\n });\n mDisplay.onModuleCreate(element, preference);\n\n //!\n //! Create audio module.\n //!\n mAudio.onModuleCreate(new WebOpenALES10());\n mAudioThread.schedule(new TimerTask() {\n @Override\n public void run() {\n mAudio.onModuleUpdate();\n }\n }, 0L, THREAD_AUDIO_DELAY);\n\n //!\n //! Create input module.\n //!\n mInput.onModuleCreate(\n new WebInputKeyboard(Window.current().getDocument().getDocumentElement()),\n new WebInputMouse(element));\n mInputThread.schedule(new TimerTask() {\n @Override\n public void run() {\n mInput.onModuleUpdate();\n }\n }, 0L, THREAD_INPUT_DELAY);\n\n //!\n //! Create render module.\n //!\n mRender.onModuleCreate(new WebOpenGLES32(element));\n\n\n //!\n //! Create resource module.\n //!\n mResources.registerAssetLocator(\"EXTERNAL\", new XHRAssetLocator());\n\n mResources.registerAssetLoader(new TexturePNGAssetLoader(), \"png\");\n mResources.registerAssetLoader(new TextureDDSAssetLoader(), \"dds\", \"s3tc\");\n mResources.registerAssetLoader(new AudioWAVAssetLoader(), \"wav\");\n mResources.registerAssetLoader(new AudioOGGAssetLoader(), \"ogg\");\n mResources.registerAssetLoader(new FontBinaryAssetLoader(), \"fnt\");\n mResources.registerAssetLoader(new ShaderBinaryAssetLoader(QKRender.getCapabilities()), \"shader\");\n\n //!\n //! Handle the create notification.\n //!\n mLifecycle.onCreate();\n mLifecycle.onResize(mDisplay.getWidth(), mDisplay.getHeight());\n }", "public void onDisplay() {\n }", "public void onDisplay() {\n\n\t}", "@Override\n public void simpleRender(RenderManager rm) {\n }", "@Override\n public void simpleRender(RenderManager rm) {\n }", "@Override\n public void simpleRender(RenderManager rm) {\n }", "@Override\n public void simpleRender(RenderManager rm) {\n }", "@Override\n public void simpleRender(RenderManager rm) {\n }", "@Override\n public void simpleRender(RenderManager rm) {\n }", "public void render() {\n\t\t// do nothing... as we should\n\t}", "public void onRenderTick() {\n updateLang();\n updateRenderEngine();\n }", "void onRenderGui(RenderArguments arguments);", "public void registerRenderInformation() {\n\t}", "public void onInitHandle() {\n }", "@Override\r\n\tpublic void simpleRender(RenderManager rm) {\n\t}", "public void onModuleLoad() {\r\n\t\trpcService = GWT.create(ContactService.class);\r\n\t\teventBus = new HandlerManager(null);\r\n\t\tappViewer = new AppController(rpcService, eventBus);\r\n\t\tappViewer.go(RootPanel.get(\"initView\"));\r\n\t}", "public void onModuleLoad() {\r\n // Create ClientFactory using deferred binding so we can replace with different impls in gwt.xml\r\n ClientFactory clientFactory = GWT.create(ClientFactory.class);\r\n clientFactory.getApp().run(RootLayoutPanel.get());\r\n }", "public void onGoToSearchModule() {\n GWT.log(\"SearchModule loaded\");\n //nothing by default\n }", "public void onInitHandler() {\n }", "public void render(CliContext ctx);", "public void onModuleLoad() {\n useCorrectRequestBaseUrl();\n ClientFactory clientFactory = GWT.create(ClientFactory.class);\n EventBus eventBus = clientFactory.getEventBus();\n //this is for history\n PlaceController placeController = clientFactory.getPlaceController();\n\n ActivityMapper activityMapper = new TritonActivityMapper(clientFactory);\n ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);\n activityManager.setDisplay(appWidget);\n\n TritonPlaceHistoryMapper historyMapper = GWT.create(TritonPlaceHistoryMapper.class);\n PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);\n historyHandler.register(placeController, eventBus, defaultPlace);\n\n RootPanel.get().add(appWidget);\n historyHandler.handleCurrentHistory();\n }", "public void onModuleLoad() {\r\n\t\t// Set GWT container invisible\r\n\t\tDOM.setInnerHTML(RootPanel.get(\"loadingMsg\").getElement(),\"Checking logged-in-edness\");\r\n\t\t// get better exception handling\r\n\t\tsetUncaughtExceptionHandler();\r\n\t\t\r\n\t\tloginService.login(GWT.getHostPageBaseURL() + \"SwagSwapGWT.html\",\r\n\t\t\tnew AsyncCallback<LoginInfo>() {\r\n\t\t\t\tpublic void onFailure(Throwable error) {\r\n\t\t\t\t\tthrow new RuntimeException(\"can't reach SwagSwap server\", error);\r\n\t\t\t\t}\r\n\t\t\t\tpublic void onSuccess(LoginInfo result) {\r\n\t\t\t\t\tloginInfo = result;\r\n\t\t\t\t\tDOM.setInnerHTML(RootPanel.get(\"loadingMsg\").getElement(),\"Fetching Swag Items\");\r\n\t\t\t\t\tbuildGUI();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}", "public void render();", "private void processRenderFunction() {\n if (!hasInterface(processingEnv, component.asType(), HasRender.class)) {\n return;\n }\n\n componentExposedTypeBuilder.addMethod(MethodSpec\n .methodBuilder(\"vg$render\")\n .addModifiers(Modifier.PUBLIC)\n .addAnnotation(JsMethod.class)\n .returns(VNode.class)\n .addParameter(CreateElementFunction.class, \"createElementFunction\")\n .addStatement(\"return super.render(new $T(createElementFunction))\", VNodeBuilder.class)\n .build());\n\n addMethodToProto(\"vg$render\");\n\n // Register the render method\n optionsBuilder.addStatement(\"options.addHookMethod($S, p.$L)\", \"render\", \"vg$render\");\n }", "public void onModuleLoad() {\n\t\t//create our main panel\n\t\tfinal DeckPanel panels = new DeckPanel(); \n\t\tRootPanel.get(\"panel\").add(panels);\n\t\t//create our stage panels\n\t\tfinal LoginPanel login = new LoginPanel(panels,wwwordzService);\n\t\tfinal GamePanel game = new GamePanel(panels,wwwordzService); \n\t\tfinal RankingPanel ranking = new RankingPanel(panels,wwwordzService);\n\t\t//add stage panels to main panel\n\t\tpanels.add(login);\n\t\tpanels.add(game);\n\t\tpanels.add(ranking);\n\t\tpanels.showWidget(0);\n\t\t\n\n\t}", "@Override\n public void prerender() {\n }", "public void handleStart()\n {\n }", "public void onModuleLoad() {\r\n\r\n\t\tnew UseTracking(this.getClass().getName());\r\n\r\n\t\tRootPanel.get(\"main\").clear();\r\n\t\tRootPanel.get(\"main\").setWidth(\"100%\");\r\n\t\tVerticalPanel vpMain = new VerticalPanel();\r\n\t\tvpMain.setSize(\"100%\", \"100%\");\r\n\t\tvpMain.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);\r\n\t\tRootPanel.get(\"main\").add(vpMain, 0, 0);\r\n\r\n\t\tString uniqueID = EncryptText.decrypt(Cookies.getCookie(\"UniqueID\"));\r\n\t\t// uniqueID = \"AllineWatkins_1332886062783\";\r\n\r\n\t\tfinal String company = Location.getParameter(\"company\");\r\n\t\tif (company != null) {\r\n\r\n\t\t\tJSONObject json = new JSONObject();\r\n\t\t\tjson.put(\"ID\", new JSONString(company));\r\n\r\n\t\t\tUniqueIDGlobalVariables.companyUniqueID = json;\r\n\t\t}\r\n\r\n\t\tif (uniqueID == null || uniqueID.equals(\"null\")) {\r\n\r\n\t\t\tString authenticationCode = Location.getParameter(\"code\");\r\n\r\n\t\t\tfinal String error = Location.getParameter(\"error_reason\");\r\n\r\n\t\t\tif (!((null != error && error.equals(\"user_denied\")) || (authenticationCode == null || \"\"\r\n\t\t\t\t\t.equals(authenticationCode)))) {\r\n\r\n\t\t\t\tInitializeApplication.VerifyFacebookLogin(authenticationCode);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tInitializeApplication.verifyParameters(vpMain, uniqueID, company);\r\n\r\n\t}", "public void onModuleLoad() {\n\t\tbentoService = (BentoServiceAsync)GWT.create(BentoService.class);\n\t\tRegistry.register(\"bentoService\", bentoService);\n\n\t\tHistory.addHistoryListener(this);\n\t\tHistory.fireCurrentHistoryState();\n\t}", "public void onModuleLoad() {\n\t\tMaps.loadMapsApi(\"notsupplied\", \"2\", false, new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tbuildUi();\n\t\t\t}\n\t\t});\n\t}", "public void onModuleLoad() {\n\t\tRootPanel.get().addStyleName(\"body-background\");\n\t\tApp app = new App();\n\t\tapp.start();\n\t}", "public void render(){\n//\t\tsetCards();\n//\t\tsetMurderInfo();\n\t}", "@Override\n\tpublic void onDrawFrame(GL10 gl) {\n\t\tLibNative.render();\n\t}", "@Override\n\tpublic void onStart() {\n\t\tsuper.onStart();\n\t\tdisplayEvent();\n\t}", "void renderLoop(RenderLoopCallback renderLoop);", "@Override\n \tprotected void controlRender(RenderManager rm, ViewPort vp) {\n \n \t}", "public abstract void viewRun();", "@Override\n\tpublic void InitView() {\n\t\t\n\t}", "@FXML\n public void handleModuleButton() {\n try {\n this.executeCommand(\"list m\");\n } catch (CommandException | ParseException e) {\n logger.info(\"Invalid command: list m\");\n resultDisplay.setFeedbackToUser(e.getMessage());\n }\n }", "@Override\n\tpublic void forceRender() {\n\n\t}", "@Override\n\tpublic void onDrawFrame(GL10 gl) {\n\t\tif (!mIsActive)\n\t\t\treturn;\n\n\t\t// Call our function to render content from ArVuforiaAppRenderer class\n\t\tmRenderer.render();\n\t}", "@Override\n\tpublic void onModPostInit2(FMLPostInitializationEvent aEvent) {\n\t}", "@Override\n public boolean isToBeRendered()\n {\n return true;\n }", "public abstract void render(Renderer renderer);", "public void onOpenModule(Class<? extends BasePresenter<?, ? extends EventBus>> presenter) {\n\t\tIPresenterFactory pf = application.getPresenterFactory();\n\t\tthis.contentPresenter = pf.createPresenter(presenter);\n\t\tthis.view.setContent((Component) this.contentPresenter.getView());\n\t}", "@Override\r\n public void render(HttpServletRequest request, HttpServletResponse response, Object result) throws Throwable\r\n {\n \r\n }", "protected abstract void onShowRuntime();", "@Override\n\tprotected void initContentView() {\n\t\t\n\t}", "public void registerRenderInformation()\n\t{\n\t //unused server side. -- see ClientProxy for implementation\n\t}", "public void onModuleLoad() {\r\n\t\tWindow.setTitle(Common.APPNAME);\r\n\t\tcloseButton = new Button(\"Close\", new ClickListener() {\r\n\t public void onClick(Widget sender) {\r\n\t \tdialogBox.hide();\r\n\t \tmanualRegisterBtn.setEnabled(true);\r\n\t }\r\n\t });\r\n\t\tcloseButton.setWidth(\"100%\");\r\n\t\tdialogBox.setWidget(closeButton);\r\n\t\t//\r\n\t\t// setup registration process\r\n\t\t//\r\n\t\tString requestUri = GWT.getHostPageBaseURL() + REGISTER_URI;\r\n\t\tregisterService.setup(requestUri, new AsyncCallback<List<String>>() {\r\n\t\t\tpublic void onFailure(Throwable caught) {\r\n\t\t\t\t// Show the RPC error message to the user\r\n\t\t\t\tlogger.severe(\"Error message from server trying to get providers ...\");\r\n\t\t\t}\r\n\r\n\t\t\tpublic void onSuccess(List<String> result) {\r\n\t\t\t\tlogger.info(\"Got urls ... # of item(s): \" + result.size());\r\n\t\t\t\tif (result != null && result.size() > 0) {\r\n\t\t\t\t\tbuildUI(result);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "public void render() {\n renderHud();\n }", "protected void display() {\n\r\n\t}", "@Override\r\n\tpublic void beforeRender(float dt) {\n\r\n\t}", "public void prerender() {\n }", "public void prerender() {\n }", "private void viewInit() {\n }", "public final void handle() {\n runHandler();\n }", "public static void index() {\r\n render();\r\n }", "@Override\n public void prepareView() {\n }", "public void registerRenderers() {\n\n\t}", "@Override\n\tpublic void onModuleLoad() {\n\t\tfinal ModuleList modList = new ModuleList();\n\t\tfinal TabLayoutPanel configTabs = new TabLayoutPanel(2, Unit.EM);\n\n\t\t// Creates the module map.\n\t\t//final ModuleMap modMap = new ModuleMap(modList);\n\n\t\t// Creates the weather feed.\n\t\tfinal Weather weather = new Weather();\n\n\t\t// Creates configuration map.\n\t\tfinal ModuleConfiguration fullConfig = new ModuleConfiguration();\n\t\tfinal ModuleConfiguration fullConfig2 = new ModuleConfiguration();\n\t\tfinal ModuleConfiguration min1Config = new ModuleConfiguration();\n\t\tfinal ModuleConfiguration min2Config = new ModuleConfiguration();\n\t\tmin1Config.setMinimumConfigOne(modList);\n\t\tmin2Config.setMinimumConfigTwo(modList);\n\n\t\t// GPS Data object.\n\t\t//final GPSDataTransfer dataTransfer = new GPSDataTransfer(modList);\n\n\t\t// Creates the root panel and sizes it.\n\t\tRootPanel.get().setSize(this.width, this.height);\n\n\t\t// Command to show login.\n\t\tCommand loginCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tfinal Login login = new Login();\n\t\t\t\tlogin.show();\n\t\t\t}\n\t\t};\n\n\n\t\t// Command to show the add module popup.\n\t\tCommand addModulePopupCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tfinal AddModulePopup popup = new AddModulePopup(modList, BUS);\n\t\t\t\tpopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {\n\t\t\t\t\tpublic void setPosition(final int offsetWidth, final int offsetHeight) {\n\t\t\t\t\t\tint left = (Window.getClientWidth() - offsetWidth) / MAGIC_NUMBER;\n\t\t\t\t\t\tint top = (Window.getClientHeight() - offsetHeight) / MAGIC_NUMBER;\n\t\t\t\t\t\tpopup.setPopupPosition(left, top);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tpopSound.play();\n\t\t\t}\n\t\t};\n\n\t\t//Command to show the GPS Data Transfer popup.\n\t\tCommand gpsDataPopupCmd = new Command() {\n\t\t\tpublic void execute(){\n\t\t\t\tfinal GPSDataPopup gpsPopup = new GPSDataPopup(modList, BUS);\n\t\t\t\t\tgpsPopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {\n\t\t\t\t\tpublic void setPosition(final int offsetWidth, final int offsetHeight) {\n\t\t\t\t\t\tint left = (Window.getClientWidth() - offsetWidth) / MAGIC_NUMBER;\n\t\t\t\t\t\tint top = (Window.getClientHeight() - offsetHeight) / MAGIC_NUMBER;\n\t\t\t\t\t\tgpsPopup.setPopupPosition(left, top);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tpopSound.play();\n\t\t\t}\n\t\t};\n\t\t\n\t\t// Command to calculate full configurations and add to new tabs.\n\t\tCommand configurationCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tCoordinates center = fullConfig.findBestCenterOfGravity(modList, ModuleConfiguration.FOUR);\n\t\t\t\tCoordinates center2 = fullConfig2.findBestCenterOfGravity(modList, ModuleConfiguration.THREE);\n\t\t\t\t\n\t\t\t\tif (fullConfig.calculateConfiguration(modList, center.getX(), center.getY(), ModuleConfiguration.FOUR)) {\n\t\t\t\t\tfullConfig2.calculateConfiguration(modList, center2.getX(), center2.getY(), ModuleConfiguration.THREE);\n\t\t\t\t\tMarsHabitatConfigurationSystem.successSound.play();\t\n\t\t\t\t\t\n\t\t\t\t\tconfigTabs.clear();\n\t\t\t\t\tconfigTabs.add(new ModuleMap(modList), MODULE_MAP_STRING);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min1Config), MIN1_CONFIG);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min2Config), MIN2_CONFIG);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(fullConfig), FULL_CONFIG);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(fullConfig2), FULL_CONFIG2);\n\t\t\t\t\tconfigTabs.selectTab(FULL_INDEX);\n\t\t\t\t\t\n\t\t\t\t\tWindow.alert(\"Full Configuration Available!\");\n\t\t\t\t} else {\n\t\t\t\t\tMarsHabitatConfigurationSystem.errorSound.play();\n\t\t\t\t\tWindow.alert(\"Full Configuration not Available!\");\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t\n\t\t// Command for clearing the module list and configurations\n\t\tCommand clearCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tmodList.clearList();\n\t\t\t\tfullConfig.clearConfig();\n\t\t\t\t\n\t\t\t\tconfigTabs.clear();\n\t\t\t\tconfigTabs.add(new ModuleMap(modList), MODULE_MAP_STRING);\n\t\t\t\tconfigTabs.selectTab(0);\n\t\t\t\tMINIMUM_CONFIG_REACHED = false;\n\t\t\t}\n\t\t};\n\n\t\t// Command for saving the full configuration.\n\t\tCommand saveConfigCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tif (configTabs.getSelectedIndex() == FULL_INDEX) {\n\t\t\t\t\tif (fullConfig.saveConfiguration(FULL_CONFIG)) {\n\t\t\t\t\t\tsuccessSound.play();\n\t\t\t\t\t\tWindow.alert(\"Full Configuration Saved!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrorSound.play();\n\t\t\t\t\t\tWindow.alert(\"No Full Configuration Exists!\");\n\t\t\t\t\t}\n\t\t\t\t} else if (configTabs.getSelectedIndex() == FULL_INDEX + 1) {\n\t\t\t\t\tif (fullConfig2.saveConfiguration(FULL_CONFIG)) {\n\t\t\t\t\t\tsuccessSound.play();\n\t\t\t\t\t\tWindow.alert(\"Full Configuration Saved!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrorSound.play();\n\t\t\t\t\t\tWindow.alert(\"No Full Configuration Exists!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Command for loading the full configuration.\n\t\tCommand loadConfigCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tif (fullConfig.loadConfiguration(FULL_CONFIG)) {\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(fullConfig), FULL_CONFIG);\n\t\t\t\t\tsuccessSound.play();\n\t\t\t\t\tWindow.alert(\"Full Configuration loaded!\");\n\t\t\t\t} else {\n\t\t\t\t\terrorSound.play();\n\t\t\t\t\tWindow.alert(\"No full configuration found in storage!\");\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Command for GPS data transfer.\n//\t\tCommand gpsDataCmd = new Command() {\n//\t\t\tpublic void execute() {\n//\t\t\t\tdataTransfer.getData();\n//\t\t\t\tBUS.fireEvent(new AddEvent());\n//\t\t\t}\n//\t\t};\n\t\t\n\t\t// Command for changing the center of gravity.\n\t\tCommand gravityCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tgravityPopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {\n\t\t\t\t\tpublic void setPosition(final int offsetWidth, final int offsetHeight) {\n\t\t\t\t\t\tint left = (Window.getClientWidth() - offsetWidth) / MAGIC_NUMBER;\n\t\t\t\t\t\tint top = (Window.getClientHeight() - offsetHeight) / MAGIC_NUMBER;\n\t\t\t\t\t\tgravityPopup.setPopupPosition(left, top);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tpopSound.play();\n\t\t\t}\n\t\t};\n\t\t\n\t\t// Command for getting the size of moving task.\n\t\tCommand movingTaskCmd = new Command() {\n\t\t\tpublic void execute() {\n\t\t\t\tfinal MovingTaskPopup popup = new MovingTaskPopup(\n\t\t\t\t\t\tmodList.getSizeOfMovingTask(fullConfig.getCenterColumn(), fullConfig.getCenterRow()));\n\t\t\t\tpopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {\n\t\t\t\t\tpublic void setPosition(final int offsetWidth, final int offsetHeight) {\n\t\t\t\t\t\tint left = (Window.getClientWidth() - offsetWidth) / MAGIC_NUMBER;\n\t\t\t\t\t\tint top = (Window.getClientHeight() - offsetHeight) / MAGIC_NUMBER;\n\t\t\t\t\t\tpopup.setPopupPosition(left, top);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tpopSound.play();\n\t\t\t}\n\t\t};\n\n\t\t// Creates the menu for the menu bar.\n\t\tMenuBar theMenu = new MenuBar(true);\n\t\ttheMenu.setAnimationEnabled(true);\n\t\ttheMenu.addItem(\"Add Module\", addModulePopupCmd);\n\t\ttheMenu.addItem(\"GPS Data Transfer\", gpsDataPopupCmd);\n\t\ttheMenu.addSeparator();\n\t\ttheMenu.addItem(\"Calculate Full Configuration\", configurationCmd);\n\t\ttheMenu.addItem(\"Change Center of Gravity\", gravityCmd);\n\t\ttheMenu.addItem(\"Save Full Configuration\", saveConfigCmd);\n\t\ttheMenu.addItem(\"Load Full Configuration\", loadConfigCmd);\n\t\ttheMenu.addSeparator();\n\t\ttheMenu.addItem(\"Size of Moving Task\", movingTaskCmd);\n\t\ttheMenu.addSeparator();\n\t\ttheMenu.addItem(\"Clear Modules and Configuration\", clearCmd);\n\t\ttheMenu.addSeparator();\n\t\ttheMenu.addItem(\"Log off\", loginCmd);\n\n\t\t// Creates the menu bar and adds the menu to itself.\n\t\tMenuBar menu = new MenuBar();\n\t\tmenu.setAnimationEnabled(true);\n\t\tmenu.addItem(\"Menu\", theMenu);\n\t\tmenu.setWidth(this.width);\n\n\t\t// Creates the tabs for the various configurations and module map.\n\t\tconfigTabs.add(new ModuleMap(modList), MODULE_MAP_STRING);\n\t\tconfigTabs.setHeight(this.height);\n\t\tconfigTabs.setWidth(this.width);\n\n\t\t// Adds everything to the root panel.\n\t\tRootPanel.get().add(menu);\n\t\tRootPanel.get().add(weather);\n\t\tRootPanel.get().add(configTabs);\n\n\t\t// Show login after module has loaded.\n\t\tfinal Login initialLogin = new Login();\n\t\tinitialLogin.show();\n\n\t\t// Start timer to show initial 10 day alert.\n\t\tTimer t = new Timer() {\n\t\t\tpublic void run() {\n\t\t\t\tfinal TenDayAlert initialTenDayAlert = new TenDayAlert();\n\t\t\t\tinitialTenDayAlert.setPopupPositionAndShow(new PopupPanel.PositionCallback() {\n\t\t\t\t\tpublic void setPosition(final int offsetWidth, final int offsetHeight) {\n\t\t\t\t\t\tint left = (Window.getClientWidth() - offsetWidth) / MAGIC_NUMBER;\n\t\t\t\t\t\tint top = (Window.getClientHeight() - offsetHeight) / MAGIC_NUMBER;\n\t\t\t\t\t\tinitialTenDayAlert.setPopupPosition(left, top);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tpopSound.play();\n\t\t\t}\n\t\t};\n\n\t\tt.schedule(ALERT_TIME);\n\n\t\t// Set handler for EventBus when new modules are added.\n\t\tBUS.addHandler(AddEvent.TYPE, new AddEventHandler() {\n\t\t\tpublic void onEvent(final AddEvent event) {\n\n\t\t\t\t// \"Refreshes\" the module map by removing and re-adding the tab\n\t\t\t\tconfigTabs.clear();\n\t\t\t\tconfigTabs.add(new ModuleMap(modList), MODULE_MAP_STRING);\n\t\t\t\tMINIMUM_CONFIG_REACHED = false;\n\t\t\t\t\n\t\t\t\t// Checks to see if requirements are met for the minimum configuration.\n\t\t\t\t// If they are met, the minimum configuration tabs are created and an alert is issued.\n\t\t\t\tif (!MINIMUM_CONFIG_REACHED) {\n\t\t\t\t\tif (modList.getNumOfAirlock() > 0 && modList.getNumOfCanteen() > 0 && modList.getNumOfControl() > 0 &&\n\t\t\t\t\t\t\tmodList.getNumOfDormitory() > 0 && modList.getNumOfPlain() > 2 && modList.getNumOfPower() > 0 &&\n\t\t\t\t\t\t\tmodList.getNumOfSanitation() > 0 && modList.getNumOfWater() > 0) {\n\t\t\t\t\t\tMINIMUM_CONFIG_REACHED = true;\n\n\t\t\t\t\t\tmin1Config.setMinimumConfigOne(modList);\n\t\t\t\t\t\tmin2Config.setMinimumConfigTwo(modList);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Adds minimum configuration one to the tab.\n\t\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min1Config), MIN1_CONFIG);\n\t\t\t\t\t\tconfigTabs.selectTab(MIN1_INDEX);\n\n\t\t\t\t\t\t// Adds minimum configuration two to the tab.\n\t\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min2Config), MIN2_CONFIG);\n\t\t\t\t\t\t\n\t\t\t\t\t\tsuccessSound.play();\n\t\t\t\t\t\tWindow.alert(\"Minimum Configurations Available!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\t// Set handler for when the center of gravity is changed.\n\t\tBUS.addHandler(GravityEvent.TYPE, new GravityEventHandler() {\n\t\t\tpublic void onEvent(final GravityEvent event) {\n\t\t\t\tModuleConfiguration newFullConfig = new ModuleConfiguration();\n\t\t\t\tint wings;\n\t\t\t\t\n\t\t\t\tif (configTabs.getSelectedIndex() == FULL_INDEX) {\n\t\t\t\t\twings = ModuleConfiguration.FOUR;\n\t\t\t\t} else {\n\t\t\t\t\twings = ModuleConfiguration.THREE;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If the center of gravity can be changed to specified coordinates.\n\t\t\t\tif (newFullConfig.calculateConfiguration(modList, event.xcoord, event.ycoord, wings)) {\n\t\t\t\t\tMarsHabitatConfigurationSystem.successSound.play();\t\n\t\t\t\t\tgravityPopup.hide();\n\t\t\t\t\t\n\t\t\t\t\tif (wings == ModuleConfiguration.FOUR) {\n\t\t\t\t\t\tfullConfig.calculateConfiguration(modList, event.xcoord, event.ycoord, wings);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfullConfig2.calculateConfiguration(modList, event.xcoord, event.ycoord, wings);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tconfigTabs.clear();\n\t\t\t\t\tconfigTabs.add(new ModuleMap(modList), MODULE_MAP_STRING);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min1Config), MIN1_CONFIG);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min2Config), MIN2_CONFIG);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(fullConfig), FULL_CONFIG);\n\t\t\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(fullConfig2), FULL_CONFIG2);\n\t\t\t\t\tconfigTabs.selectTab(FULL_INDEX);\n\t\t\t\t\t\n\t\t\t\t\tWindow.alert(\"Center of Gravity Changed!\");\n\t\t\t\t} else {\n\t\t\t\t\tMarsHabitatConfigurationSystem.errorSound.play();\n\t\t\t\t\tWindow.alert(\"Configuration can not move to that location!\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Checks for minimum configs on load.\n\t\tif (modList.getNumOfAirlock() > 0 && modList.getNumOfCanteen() > 0 && modList.getNumOfControl() > 0 &&\n\t\t\t\tmodList.getNumOfDormitory() > 0 && modList.getNumOfPlain() > 2 && modList.getNumOfPower() > 0 &&\n\t\t\t\tmodList.getNumOfSanitation() > 0 && modList.getNumOfWater() > 0) {\n\t\t\tMINIMUM_CONFIG_REACHED = true;\n\n\t\t\t// Adds minimum configuration one to the tab.\n\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min1Config), MIN1_CONFIG);\n\n\t\t\t// Adds minimum configuration two to the tab.\n\t\t\tconfigTabs.add(ConfigurationMap.getConfigurationGrid(min2Config), MIN2_CONFIG);\n\t\t}\n\n\t\tRootPanel.get().addStyleName(\"rootPanel\");\n\t}" ]
[ "0.66186696", "0.6570539", "0.65294087", "0.6513774", "0.6488292", "0.6309487", "0.6306284", "0.62951434", "0.6203096", "0.6157021", "0.612381", "0.61110157", "0.6097233", "0.60969275", "0.60931396", "0.6078594", "0.6070372", "0.6069029", "0.6024401", "0.601679", "0.59685624", "0.59429145", "0.5940268", "0.5939508", "0.59343165", "0.5912127", "0.5852114", "0.5826156", "0.57883185", "0.57843584", "0.57415277", "0.57190657", "0.571531", "0.571531", "0.5711279", "0.5707931", "0.5696273", "0.56883293", "0.56771594", "0.5674308", "0.5641166", "0.56263745", "0.56207657", "0.56207657", "0.56207657", "0.56207657", "0.56207657", "0.56207657", "0.559873", "0.5593297", "0.55842024", "0.5570262", "0.55701315", "0.55684096", "0.5557272", "0.5547429", "0.5532968", "0.55325234", "0.5506703", "0.54930526", "0.5478442", "0.5470574", "0.5458383", "0.5455782", "0.5454513", "0.54534435", "0.5435786", "0.54051524", "0.5401964", "0.5395246", "0.5392433", "0.5391256", "0.5390323", "0.53888166", "0.53789556", "0.53776914", "0.53609324", "0.53518015", "0.5346863", "0.5343679", "0.5335127", "0.53349173", "0.53339756", "0.5332592", "0.53299075", "0.5328808", "0.5323024", "0.5315121", "0.53149515", "0.5310112", "0.53090847", "0.53044885", "0.52999645", "0.52999645", "0.52970964", "0.5290882", "0.5289437", "0.52889943", "0.5287039", "0.5276374" ]
0.64993
4
Construct the conditional element from an XML node
public SCondition(Node node) { super(node); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ConditionalExpression createConditionalExpression();", "public Instruction startConditionalNode(final PsiElement element, final PsiElement condition, final boolean result) {\n final ConditionalInstruction instruction = new ConditionalInstructionImpl(this, element, condition, result);\n addNode(instruction);\n checkPending(instruction);\n return instruction;\n }", "public Conditional(String tag, String value) {\r\n super(tag, value);\r\n }", "public Element compileIf() throws CloneNotSupportedException {\n\t\tElement ele = null;\n\t\tString token, tokenType;\n\t\t\n\t\t//Unique labels for jumping around\n\t\tString elseLabel = label();\n\t\tString endLabel = label();\n\n\t\tElement ifParent = document.createElement(\"ifStatement\");\n\n\t\t// if\n\t\ttokenType = jTokenizer.tokenType();\n\t\tele = createXMLnode(tokenType);\n\t\tifParent.appendChild(ele);\n\n\t\t// (\n\t\tjTokenizer.advance();\n\t\ttokenType = jTokenizer.tokenType();\n\t\tele = createXMLnode(tokenType);\n\t\tifParent.appendChild(ele);\n\n\t\t// expression\n\t\tjTokenizer.advance();\n\t\tifParent.appendChild(compileExpression());\n\n\t\t// )\n\t\tjTokenizer.advance();\n\t\ttokenType = jTokenizer.tokenType();\n\t\tele = createXMLnode(tokenType);\n\t\tifParent.appendChild(ele);\n\t\t\n\t\t//If condition fails, go to else part of the block\n\t\twriter.writeArithmetic(\"not\");\n\t\twriter.writeIf(elseLabel);\n\n\t\t// {\n\t\tjTokenizer.advance();\n\t\ttokenType = jTokenizer.tokenType();\n\t\tele = createXMLnode(tokenType);\n\t\tifParent.appendChild(ele);\n\n\t\t// statement inside the if block\n\t\tjTokenizer.advance();\n\t\tifParent.appendChild(compileStatements());\n\n\t\t// }\n\t\ttokenType = jTokenizer.tokenType();\n\t\tele = createXMLnode(tokenType);\n\t\tifParent.appendChild(ele);\n\n\t\t// if done, go to end\n\t\twriter.writeGoto(endLabel);\n\t\t\n\t\t// Else statements start here\n\t\twriter.writeLabel(elseLabel);\n\n\t\t// else\n\n\t\t// Interesting coding challenge. I had to look ahead by one token to\n\t\t// check if there was an else block, but if it didn't exists, I would be\n\t\t// one token ahead of the XML.\n\t\t// Built a clone of the present tokenizer and used it to look ahead,\n\t\t// if an else exists, advance the main tokenizer as well\n\t\tjackTokenizer clone = new jackTokenizer(jTokenizer);\n\t\tclone.advance();\n\n\t\ttoken = clone.returnTokenVal();\n\t\tif (token.equals(\"else\")) {\n\n\t\t\t// else\n\t\t\tjTokenizer.advance();\n\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\tele = createXMLnode(tokenType);\n\t\t\tifParent.appendChild(ele);\n\n\t\t\t// {\n\t\t\tjTokenizer.advance();\n\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\tele = createXMLnode(tokenType);\n\t\t\tifParent.appendChild(ele);\n\n\t\t\t// statements inside the else block\n\t\t\tjTokenizer.advance();\n\t\t\tifParent.appendChild(compileStatements());\n\n\t\t\t// }\n\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\tele = createXMLnode(tokenType);\n\t\t\tifParent.appendChild(ele);\n\n\t\t\t// End of if-else block\n\t\t\twriter.writeLabel(endLabel);\n\n\t\t\treturn ifParent;\n\t\t} \n\t\telse {\n\n\t\t\t// End of if block\n\n\t\t\twriter.writeLabel(endLabel);\n\t\t\treturn ifParent;\n\t\t}\n\t}", "public static TreeNode makeIf(TreeNode condition,\n TreeNode thenNode,\n TreeNode elseNode,\n ArrowType retType) {\n return new IfNode(condition, thenNode, elseNode, retType);\n }", "Conditional createConditional();", "public Condition(Node n) {\n\t// get the page item properties\n\tsuper(n);\n\ttry {\n\t // assign various attributes\n\t NodeList subnodes = n.getChildNodes();\n\t Node node1 = subnodes.item(1);\n\t Node node2 = subnodes.item(3);\n\t Node node3 = subnodes.item(5);\n\t String node1_name = node1 != null ? node1.getNodeName() : \"\";\n\t String node2_name = node2 != null ? node2.getNodeName() : \"\";\n\t String node3_name = node3 != null ? node3.getNodeName() : \"\";\n\n\t // option 1: if the Condition is a leaf node, first node is a\n\t // \"field\"\n\t if (node1_name.equalsIgnoreCase(\"field\")) {\n\t\t// parse the leaf node\n\t\t// note XML Schema enforces order of: field, operator, (constant\n\t\t// OR field)\n\t\tpre_field = node1.getFirstChild().getNodeValue();\n\t\tjs_expression.append(\"(a['\" + pre_field + \"']\");\n\t\tif (pre_field.equals(\"\"))\n\t\t throw new Exception(\n\t\t\t \"Invalid Precondition: Empty field name before \"\n\t\t\t\t + node2_name);\n\t\t// represent comparison operator as integer, since eval needs\n\t\t// 'switch,' which can't take strings\n\t\tif (node2_name.equalsIgnoreCase(\"gt\")) {\n\t\t operatr_int = 11;\n\t\t js_expression.append(\" > \");\n\t\t} else if (node2_name.equalsIgnoreCase(\"lt\")) {\n\t\t operatr_int = 12;\n\t\t js_expression.append(\" < \");\n\t\t} else if (node2_name.equalsIgnoreCase(\"geq\")) {\n\t\t operatr_int = 13;\n\t\t js_expression.append(\" >= \");\n\t\t} else if (node2_name.equalsIgnoreCase(\"leq\")) {\n\t\t operatr_int = 14;\n\t\t js_expression.append(\" <= \");\n\t\t} else if (node2_name.equalsIgnoreCase(\"eq\")) {\n\t\t operatr_int = 15;\n\t\t js_expression.append(\" = \");\n\t\t} else if (node2_name.equalsIgnoreCase(\"neq\")) {\n\t\t operatr_int = 16;\n\t\t js_expression.append(\" != \");\n\t\t} else\n\t\t throw new Exception(\"Invalid operator in Precondition: \"\n\t\t\t + node2_name);\n\t\t// obtain the value for comparison\n\t\tif (node3_name.equalsIgnoreCase(\"cn\")) {\n\t\t String const_str = node3.getFirstChild().getNodeValue();\n\t\t if (const_str != null) {\n\t\t\tint_constant = new Integer(const_str);\n\t\t\tjs_expression.append(const_str);\n\t\t\tjs_expression.append(\")\");\n\t\t }\n\t\t} else if (node3_name.equalsIgnoreCase(\"field\")) {\n\t\t pre_field_second = node3.getFirstChild().getNodeValue();\n\t\t js_expression.append(pre_field_second);\n\t\t js_expression.append(\")\");\n\t\t if (pre_field_second.equals(\"\"))\n\t\t\tthrow new Exception(\n\t\t\t\t\"Invalid Precondition: Empty field name after \"\n\t\t\t\t\t+ node1_name);\n\t\t} else\n\t\t throw new Exception(\"Invalid comparator in Precondition: \"\n\t\t\t + node3_name);\n\t }\n\t // option 2, syntax: apply, and|or, apply\n\t else if (node1_name.equalsIgnoreCase(\"apply\")) {\n\t\t// recursively parse the nested preconditions\n\t\tcond = new Condition(node1); // the apply node is itself a\n\t\t\t\t\t // predicate\n\t\tjs_expression.append(cond.getJs_expression());\n\t\tif (node2_name.equalsIgnoreCase(\"and\")) {\n\t\t operatr_int = 1;\n\t\t js_expression.append(\" && \");\n\t\t} else if (node2_name.equalsIgnoreCase(\"or\")) {\n\t\t operatr_int = 2;\n\t\t js_expression.append(\" || \");\n\t\t} else\n\t\t throw new Exception(\n\t\t\t \"Invalid boolean operator in Precondition: \"\n\t\t\t\t + node2_name);\n\t\t// recursively parse the 2nd apply node - another nested\n\t\t// precondition\n\t\tif (node3_name.equalsIgnoreCase(\"apply\")) {\n\t\t cond2 = new Condition(node3);\n\t\t js_expression.append(cond2.getJs_expression());\n\t\t}\n\n\t\telse\n\t\t throw new Exception(\n\t\t\t \"Invalid righthand predicate in Precondition: \"\n\t\t\t\t + node3_name);\n\t } else\n\t\tthrow new Exception(\"Invalid Precondition node starting at: \"\n\t\t\t+ node1_name);\n\n\t}// end of try\n\tcatch (Exception e) {\n\t WISE_Application.log_error(\n\t\t \"WISE - CONDITION parse: \" + e.toString(), null);\n\t return;\n\t}\n }", "@Test\n public void basicConditionTest() throws Exception {\n\n assertThat(getNode(\"1 == 2\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"1 == 1\", \"expr\").render(null), is((Object)true));\n }", "public ExpressionNode getCondition();", "public Conditional(){\n\t\tint m,n;\n\t\tLexer.lex();//skip over \"if\"\n\t\tLexer.lex();//skip over '('\n\t\tcpr=new ComparisonExpr();\n\t\tLexer.lex();//skip over ')'\n\t\tswitch(cpr.op){\n\t\tcase '<':\n\t\t\tCode.gen(\"if_icmpge \");\n\t\t\tbreak;\n\t\tcase '>':\n\t\t\tCode.gen(\"if_icmple \");\n\t\t\tbreak;\n\t\tcase '=':\n\t\t\tCode.gen(\"if_icmpne \");\n\t\t\tbreak;\n\t\tcase '!':\n\t\t\tCode.gen(\"if_icmpeq \");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\tn=Code.getPtr();\n\t\tCode.gen(\"\");\n\t\tCode.gen(\"\");\n\t\tstmt=new Statement();\n\t\tif(Lexer.nextToken==Token.KEY_ELSE){//have an else part\n\t\t\tCode.gen(\"goto \");\n\t\t\tm=Code.getPtr();\n\t\t\tCode.gen(\"\");\n\t\t\tCode.gen(\"\");\n\t\t\tCode.backpatch(n, Integer.toString(Code.getPtr()));\n\t\t\tLexer.lex();\n\t\t\tstmtr=new Statement();\n\t\t\tCode.backpatch(m, Integer.toString(Code.getPtr()));\n\t\t}else{\n\t\t\tCode.backpatch(n, Integer.toString(Code.getPtr()));\n\t\t}\n\t\t\n\t}", "ConditionalDeclaration(AST ast) {\r\n\t\tsuper(ast);\r\n\t}", "private Element createXmlElementForSwitch(Switch switch_, Document xmlDocument, Constraint constraint) {\n\t\tElement element = xmlDocument.createElement(XML_SWITCH);\n\n\t\tfor (Case case_ : switch_) {\n\t\t\tElement child = createXmlElementForCase(case_, xmlDocument, constraint);\n\t\t\tif (child != null)\n\t\t\t\telement.appendChild(child);\n\t\t}\n\t\t\n\t\treturn (element.hasChildNodes() ? element : null);\n\t}", "static ExpressionParsingState composeConditionalExpression(\n final ExpressionParsingState state, final int nodeIndex) {\n \n final String input = state.get(nodeIndex).getInput();\n \n if (StringUtils.isEmptyOrWhitespace(input)) {\n return null;\n }\n\n // Trying to fail quickly...\n final int condSuffixPos = input.indexOf(CONDITION_SUFFIX_CHAR);\n if (condSuffixPos == -1) {\n return state;\n }\n \n final String condStr = input.substring(0, condSuffixPos);\n final String remainder = input.substring(condSuffixPos + 1);\n\n if (remainder.indexOf(CONDITION_SUFFIX_CHAR) != -1) {\n // There are two \"?\" symbols\n return null;\n }\n\n final int thenElseSepPos = remainder.indexOf(CONDITION_THENELSE_SEPARATOR_CHAR);\n if (remainder.lastIndexOf(CONDITION_THENELSE_SEPARATOR_CHAR) != thenElseSepPos) {\n // There are two \":\" symbols\n return null;\n }\n\n String thenStr = null;\n String elseStr = null;\n if (thenElseSepPos != -1) {\n if (thenElseSepPos == 0) {\n // Maybe it is a default operation\n return state;\n }\n thenStr = remainder.substring(0, thenElseSepPos);\n elseStr = remainder.substring(thenElseSepPos + 1);\n } else {\n thenStr = remainder;\n }\n\n \n final Expression condExpr = ExpressionParsingUtil.parseAndCompose(state, condStr);\n if (condExpr == null) {\n return null;\n }\n\n final Expression thenExpr = ExpressionParsingUtil.parseAndCompose(state, thenStr);\n if (thenExpr == null) {\n return null;\n }\n\n Expression elseExpr = VariableExpression.NULL_VALUE;\n if (elseStr != null) {\n elseExpr = ExpressionParsingUtil.parseAndCompose(state, elseStr);\n if (elseExpr == null) {\n return null;\n }\n }\n\n \n final ConditionalExpression conditionalExpressionResult = \n new ConditionalExpression(condExpr, thenExpr, elseExpr);\n state.setNode(nodeIndex,conditionalExpressionResult);\n \n return state;\n \n }", "OclExpression getCondition();", "IfPrimaryExpr createIfPrimaryExpr();", "@org.junit.Test\n public void constrCompelemNodeid2() {\n final XQuery query = new XQuery(\n \"for $x in <a b=\\\"b\\\"/>, $y in element elem {$x/@b} return $y/@b is $x/@b\",\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 assertBoolean(false)\n );\n }", "@Override\n public String visit(ConditionalExpr n, Object arg) {\n return null;\n }", "protected Condition parseSequenceFlowCondition(XmlElement seqFlowElement) {\n\n XmlElement conditionExprElement = seqFlowElement.getElement(\"conditionExpression\");\n\n if (conditionExprElement == null) {\n return null;\n }\n\n String expression = conditionExprElement.getText().trim();\n // Condition expressionCondition = new CheckVariableTrueCondition(expression);\n Condition expressionCondition = new JuelExpressionCondition(expression);\n return expressionCondition;\n }", "public void setCondition(ExpressionNode condition);", "public void appendChildActivity(String condition, BPELActivity activity) {\n\t\tactivitiesOK = false;\n\t\tboolean isOtherwise = condition == null\n\t\t\t\t|| condition.compareToIgnoreCase(\"true\") == 0;\n\t\t// Create a case element, unless the condition is null, in which case we\n\t\t// create an otherwise element.\n\t\tElement caseElement = BPEL.staticDocument\n\t\t\t\t.createElement(isOtherwise ? BPELConstants.stringOtherwise\n\t\t\t\t\t\t: BPELConstants.stringCase);\n\t\t// The case/otherwise element will be a child of this element.\n\t\telement.appendChild(caseElement);\n\t\t// Add the condition atribute in case of a case element.\n\t\tif (!isOtherwise) {\n\t\t\telement.setAttribute(\"condition\", condition);\n\t\t}\n\t\t// The element of the given activity will be a child of the\n\t\t// case/otherwise element.\n\t\tcaseElement.appendChild(activity.getElement());\n\t\t// Map the element onto the activity.\n\t\tmap.put(activity.getElement(), activity);\n\t\t// Map the activity onto its condition. Use \"true\" in case of otherwise\n\t\t// element.\n\t\tif (!isOtherwise) {\n\t\t\tcases.put(activity, condition);\n\t\t} else {\n\t\t\tcases.put(activity, \"true\");\n\t\t}\n\t}", "public static Condition makeCondition(TreeNode root) {\n return new Condition(root);\n }", "IfExp createIfExp();", "IfStatement createIfStatement();", "private static Element createNode(Document doc, Element element, String tagName, String value) {\n\t\tif (value == null || \"\".equals(value)) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tif (EMPTY_STRING.equals(value)) {\n\t\t\t\tvalue = \"\";\n\t\t\t}\n\t\t\tElement node = doc.createElement(tagName);\n\t\t\telement.appendChild(node);\n\t\t\tnode.appendChild(doc.createTextNode(value));\n\t\t\treturn node;\n\t\t}\n\t}", "@org.junit.Test\n public void constrCompelemNodeid1() {\n final XQuery query = new XQuery(\n \"for $x in <a/>, $y in element elem {$x} return exactly-one($y/a) is $x\",\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 assertBoolean(false)\n );\n }", "public void visit(BinConditionalExpression x){\n }", "@Override\r\n\tprotected Element createBranchElement(Element parent, AttributeSet a) {\n\t\tswitch (this.branchContext) {\r\n\t\t\tcase FILE_HEADER:\r\n\t\t\t\treturn new FileHeaderBranchElement(parent, a);\r\n\t\t\tcase BEFORE_HEX:\r\n\t\t\t\treturn new BeforeHexBranchElement(parent, a);\r\n\t\t\tcase AFTER_HEX:\r\n\t\t\t\treturn new AfterHexBranchElement(parent, a);\r\n\t\t\tcase HEX_HEADER:\r\n\t\t\t\treturn new HexHeaderBranchElement(parent, a);\r\n\t\t\tcase HEX_CODE:\r\n\t\t\t\treturn new HexCodeBranchElement(parent, a);\r\n\t\t\tdefault:\r\n\t\t\t\t// fall-back case\r\n\t\t\t\treturn super.createBranchElement(parent, a);\r\n\t\t}\r\n\t}", "public StatementNode getStatementNodeOnTrue();", "private Element createXmlElementForCase(Case case_, Document xmlDocument, Constraint constraint) {\n\t\tElement element = xmlDocument.createElement(XML_CASE);\n\t\telement.setAttribute(XML_INFO1, case_.getConstraint().toString());\n\n\t\tElement child = createXmlElementForValue(case_.getValue(), xmlDocument, constraint);\n\t\tif (child != null)\n\t\t\telement.appendChild(child);\n\t\t\n\t\treturn (element.hasChildNodes() ? element : null);\n\t}", "@Override\n public Object visitIfelsestatement(TranslationGrammarParser.IfelsestatementContext ctx) {\n Boolean cond = (Boolean) magicVisit(ctx.condition(), current_node);\n if (cond == null) {\n return null;\n }\n ArrayList<Node<TokenAttributes>> temp;\n if (cond) {\n temp = (ArrayList<Node<TokenAttributes>>) magicVisit(ctx.t, current_node);\n } else {\n temp = (ArrayList<Node<TokenAttributes>>) magicVisit(ctx.f, current_node);\n }\n if (temp == null) {\n return null;\n }\n return temp;\n }", "<C> IfExp<C> createIfExp();", "@Override\n\tpublic void visit(IfNode node) {\n\t\tif (Evaluator.checkScope(node) == false) {\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t * Verificare pentru assert failed\n\t\t */\n\t\tif (Evaluator.checkAssert(node) == false) {\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t * evaluam conditia si preluam rezultatul evaluarii fiului corespunzator\n\t\t * branch-ului de then sau de else\n\t\t */\n\t\tEvaluator.evaluate(node.getChild(0));\n\n\t\t/***\n\t\t * Daca conditia este adevarata, continuam cu evaluarea celui de-al\n\t\t * doiela fiu, iar daca este false evaluam al treilea fiu\n\t\t */\n\t\tif (node.getChild(0).getName().contentEquals(\"true\")) {\n\t\t\tEvaluator.evaluate(node.getChild(1));\n\t\t\tnode.getChild(2).setVisited(true);\n\n\t\t\tif (node.getChild(1) instanceof Variable) {\n\t\t\t\tnode.setName(Evaluator.variables.get(node.getChild(1).getName()));\n\t\t\t} else {\n\t\t\t\tnode.setName(node.getChild(1).getName());\n\t\t\t}\n\t\t} else {\n\t\t\tEvaluator.evaluate(node.getChild(2));\n\t\t\tnode.getChild(1).setVisited(true);\n\n\t\t\tif (node.getChild(2) instanceof Variable) {\n\t\t\t\tnode.setName(Evaluator.variables.get(node.getChild(2).getName()));\n\t\t\t} else {\n\t\t\t\tnode.setName(node.getChild(2).getName());\n\t\t\t}\n\t\t}\n\n\t}", "final public IASTPKGIfElseifContainer IfElseifContainer(IASTPKGConditionExpression conditionNode) throws ParseException {\r\n IASTPKGIfElseifContainer node = null;\r\n//\tIASTLiteralTextNode conditionNode = null;\r\n IASTListNode<IASTPKGStatement> statements = null;\r\n Token start = token;\r\n statements = ConditionalStatements();\r\n//\t\tif (condition != null) {\r\n//\t\t\tconditionNode = getRawLiteralTextNodeSpanning(condition, condition);\r\n//\t\t} else {\r\n//\t\t\tthrow generateParseException();\r\n//\t\t}\r\n node = ASTPKGFactory.createPKGIfElseifContainer(conditionNode, statements);\r\n if (statements != null && statements.getChildren().length > 0) {\r\n ParserUtils.setSourceRangeForListNode(null, statements, null);\r\n ParserUtils.copySourceInfo(node, statements);\r\n } else {\r\n ParserUtils.setSourceRangeFromTokenSpan(statements, start, start);\r\n ParserUtils.setSourceRangeFromTokenSpan(node, start, start);\r\n }\r\n {if (true) return node;}\r\n throw new Error(\"Missing return statement in function\");\r\n }", "@Test(timeout = 4000)\n public void test37() throws Throwable {\n SimpleNode simpleNode0 = new SimpleNode(2836);\n JavaParser javaParser0 = new JavaParser(\"ConditionalAndExpression\");\n SimpleNode simpleNode1 = new SimpleNode(javaParser0, 2836);\n simpleNode0.jjtSetParent(simpleNode1);\n Node node0 = simpleNode0.jjtGetParent();\n simpleNode1.jjtSetParent(node0);\n assertSame(node0, simpleNode1);\n }", "public IfCondition() {\r\n super();\r\n }", "LogicCondition createLogicCondition();", "public SimpleCondition() {\n\n\t}", "@Override\n\t\tpublic String visitIfST(IfSTContext ctx) {\n\t\t\tString type = visit(ctx.getChild(2));\n\t\t\tif(!type.equals(\"boolean\")) throw new RuntimeException(\"Expecting type Boolean in If \"+ctx.getChild(2)+\" is not boolean\");\n\t\t\tvisit(ctx.getChild(4));\n\t\t\tif(ctx.getChildCount()>5){\n\t\t\t\tvisit(ctx.getChild(6));\n\t\t\t}\n\t\t\treturn null;\n\t\t}", "private Element createXmlElementForChoice(Choice choice, Document xmlDocument, Constraint constraint) {\n\t\tElement element = xmlDocument.createElement(XML_CHOICE);\n\t\telement.setAttribute(XML_INFO1, choice.getConstraint().toString());\n\n\t\tElement child1 = createXmlElementForValue(choice.getValue1(), xmlDocument, constraint);\n\t\tif (child1 != null)\n\t\t\telement.appendChild(child1);\n\t\t\n\t\tElement child2 = createXmlElementForValue(choice.getValue2(), xmlDocument, constraint);\n\t\tif (child2 != null)\n\t\t\telement.appendChild(child2);\n\t\t\n\t\treturn (element.hasChildNodes() ? element : null);\n\t}", "private Data iff(Node line, Namespace namespace) {\n\n\t\tNode cond = line.next;\n\t\tNode a = cond.next;\n\t\tNode b = a.next;\n\t\t\n\t\tif (Boolean.TRUE.equals(e.eval(cond, namespace).value)) {\n\t\t\treturn e.eval(a, namespace);\n\t\t} else if (b != null) {\n\t\t\treturn e.eval(b, namespace);\n\t\t}\n\t\t\n\t\treturn NO_RESULT;\n\t}", "@Override\n public R visit(ConditionalAndExpression n, A argu) {\n R _ret = null;\n n.valueLogical.accept(this, argu);\n n.nodeListOptional.accept(this, argu);\n return _ret;\n }", "@org.junit.Test\n public void constrCompelemNodeid5() {\n final XQuery query = new XQuery(\n \"for $x in <a>text</a>, $y in element elem {$x/text()} return exactly-one($y/text()) is exactly-one($x/text())\",\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 assertBoolean(false)\n );\n }", "private XrNode(String nodeName, ElPropertyValue prop, BeanDescriptor<?> parentDesc, StringFormatter formatter,\r\n StringParser parser, XoiNode[] childNodes, XoiAttribute[] attributes, boolean assocBeanValue) {\r\n\r\n super(nodeName, prop, parentDesc, formatter, parser);\r\n \r\n this.assocBeanValue = assocBeanValue;\r\n this.attributes = attributes;\r\n this.hasAttributes = (attributes != null && attributes.length > 0);\r\n\r\n this.childNodes = childNodes;\r\n this.hasChildNodes = (childNodes!= null && childNodes.length > 0);\r\n\r\n boolean selfClosing = false;\r\n \r\n this.beginTagEnd = selfClosing ? \"/>\" : \">\";\r\n this.beginTag = \"<\" + nodeName;\r\n this.endTag = selfClosing ? \"\" : \"</\" + nodeName + \">\";\r\n }", "IFMLNamedElement createIFMLNamedElement();", "private static Element getXML(Transition transition) {\n\t\tElement transitionEle = new Element(\"Transition\");\n\t\ttransitionEle.setAttribute(\"from\", transition.getFromState().getName());\n\t\ttransitionEle.setAttribute(\"to\", transition.getToState().getName());\n\t\tif (transition.getControl() != null) {\n\t\t\ttransitionEle.setAttribute(\"control_x\",\n\t\t\t\t\tString.valueOf(transition.getControl().x));\n\t\t\ttransitionEle.setAttribute(\"control_y\",\n\t\t\t\t\tString.valueOf(transition.getControl().y));\n\t\t} else {\n\t\t\t// this branch is not supposed to enter\n\t\t\ttransitionEle.setAttribute(\"control_x\", \"0\");\n\t\t\ttransitionEle.setAttribute(\"control_y\", \"0\");\n\t\t}\n\t\treturn transitionEle;\n\t}", "public ConditionalStatement(IExpression condition, IStatement s0, IStatement s1)\n {\n super(\"Conditional\", null);\n // TODO - anything else you need\n }", "Condition createCondition();", "@Override\n public R visit(ConditionalOrExpression n, A argu) {\n R _ret = null;\n n.conditionalAndExpression.accept(this, argu);\n n.nodeListOptional.accept(this, argu);\n return _ret;\n }", "private IPredicateElement createPredicate() throws RodinDBException {\n\t\tfinal IContextRoot ctx = createContext(\"ctx\");\n\t\treturn ctx.createChild(IAxiom.ELEMENT_TYPE, null, null);\n\t}", "protected XMLElement createAnotherElement() {\n return new XMLElement(this.conversionTable,\n this.skipLeadingWhitespace,\n false,\n this.ignoreCase);\n }", "final public IASTPKGStatement ConditionalStatement() throws ParseException {\r\n IASTPKGStatement node = null;\r\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r\n case COMMENT_START:\r\n node = CommentStatement();\r\n break;\r\n case OPTIONSLIST_START:\r\n node = OptionsListStatement();\r\n break;\r\n default:\r\n jj_la1[3] = jj_gen;\r\n if (jj_2_2(2147483647)) {\r\n node = EmbeddedSisStatement();\r\n } else {\r\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r\n case OPEN_CURLY_BRACE:\r\n case STRING:\r\n node = InstallFileStatement();\r\n break;\r\n case PLUS:\r\n node = PropertiesStatement();\r\n break;\r\n case IF:\r\n node = ConditionalBlock();\r\n break;\r\n default:\r\n jj_la1[4] = jj_gen;\r\n jj_consume_token(-1);\r\n throw new ParseException();\r\n }\r\n }\r\n }\r\n {if (true) return node;}\r\n throw new Error(\"Missing return statement in function\");\r\n }", "public Object createCustomNodeBean(IParserHandler parserHandler, BeanNode node, XMLAttributeMap att, Locator locator);", "@org.junit.Test\n public void constrCompelemNodeid3() {\n final XQuery query = new XQuery(\n \"for $x in <!--comment-->, $y in element elem {$x} return exactly-one($y/comment()) is $x\",\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 assertBoolean(false)\n );\n }", "@Override\r\n\tprotected Element createLeafElement(Element parent, AttributeSet a, int p0, int p1) {\n\t\tswitch (this.leafContext) {\r\n\t\t\tcase ATTRIBUTE_NAME:\r\n\t\t\t\treturn new AttributeNameLeafElement(parent, a, p0, p1);\r\n\t\t\tcase ATTRIBUTE_VALUE:\r\n\t\t\t\treturn new AttributeValueLeafElement(parent, a, p0, p1);\r\n\t\t\tdefault:\r\n\t\t\t\t// fall-back case\r\n\t\t\t\treturn super.createLeafElement(parent, a, p0, p1);\r\n\t\t}\r\n\t}", "@Override\n\tpublic void startElement(String namespaceURI, String localName,\n\t\t\tString qName, Attributes atts) throws SAXException {\n\n\t\t// abertura da tag \"weather\" ou \"current_condition\"\n\t\tif (localName.equals(\"weather\")) {\n\t\t\tcv = new ContentValues();\n\t\t\tcv.put(WeatherCondition.ID_PLACE, p_id);\n\t\t\tin_weather = true;\n\t\t}\n\n\t\tif (localName.equals(\"current_condition\")) {\n\t\t\tcv = new ContentValues();\n\t\t\tcv.put(WeatherCondition.ID_PLACE, p_id);\n\t\t\tin_current_condition = true;\n\t\t}\n\n\t\t// tag com o URL da imagem da condição\n\t\tif (localName.equals(\"weatherIconUrl\"))\n\t\t\tin_img = true;\n\n\t\t// tag com a temperatura (para condições actuais)\n\t\tif (localName.equals(\"temp_C\"))\n\t\t\tin_temp_c = true;\n\n\t\t// tag com temperatura máxima (para previsões)\n\t\tif (localName.equals(\"tempMaxC\"))\n\t\t\tin_temp_max_c = true;\n\n\t\t// tag com temperatura mínima (para previsões)\n\t\tif (localName.equals(\"tempMinC\"))\n\t\t\tin_temp_min_c = true;\n\n\t\tif (localName.equals(\"observation_time\") || localName.equals(\"date\"))\n\t\t\tin_observation_time = true;\n\n\t\tif (localName.equals(\"weatherDesc\"))\n\t\t\tin_weather_desc = true;\n\n\t\tif (localName.equals(\"windspeedMiles\"))\n\t\t\tin_windspeed_miles = true;\n\n\t\tif (localName.equals(\"windspeedKmph\"))\n\t\t\tin_windspeed_kmph = true;\n\n\t\tif (localName.equals(\"winddir16Point\")\n\t\t\t\t|| localName.equals(\"winddirection\"))\n\t\t\tin_winddir = true;\n\n\t\tif (localName.equals(\"precipMM\"))\n\t\t\tin_precip_mm = true;\n\n\t\tif (localName.equals(\"humidity\"))\n\t\t\tin_humidity = true;\n\t}", "If createIf();", "public ConditionalExpressionTest(String name) {\n\t\tsuper(name);\n\t}", "@Test(timeout = 4000)\n public void test11() throws Throwable {\n SimpleNode simpleNode0 = new SimpleNode(73);\n simpleNode0.setIdentifier(\"`n\\tw8u)p!WbK\");\n StringWriter stringWriter0 = new StringWriter(51);\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"<=\");\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, (String) null);\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \">=\");\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n FileSystemHandling.setPermissions((EvoSuiteFile) null, true, false, false);\n simpleNode0.setIdentifier(\"]\\\"\");\n simpleNode0.setIdentifier(\"<=\");\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n StringWriter stringWriter1 = new StringWriter();\n simpleNode0.setIdentifier(\"UUC^1taN`<+z\");\n FileSystemHandling.setPermissions((EvoSuiteFile) null, true, false, true);\n FileSystemHandling.shouldAllThrowIOExceptions();\n simpleNode0.toString();\n JavaParser javaParser0 = new JavaParser(\"]\\\"\");\n simpleNode0.dump(\"ConditionalExpression\", stringWriter0);\n assertEquals(\"<Block>\\n <identifier>`n\\tw8u)p!WbK</identifier>\\n <identifier>]\\\"</identifier>\\n <identifier>*le</identifier>\\n <identifier>UUC^1taN`<+z</identifier>\\n</Block>\\n\", stringWriter0.toString());\n }", "private Term parseConditional(final boolean required) throws ParseException {\n Term t1 = parseLogicalOr(required);\n int tt = _tokenizer.next();\n if (tt == '?') {\n Term t2 = parseTerm(true);\n tt = _tokenizer.next();\n if (tt == ':') {\n if (isTypeChecking() && !t1.isB()) {\n reportError(\"Boolean operand expected before '?' in conditional '?:' term.\");\n }\n Term t3 = parseTerm(true);\n if (t2.isB() && t3.isB()) {\n t1 = new Term.Cond(Term.TYPE_B, t1, t2, t3);\n } else if ((t2.isD() && t3.isN() || t2.isN() && t3.isD())) {\n t1 = new Term.Cond(Term.TYPE_D, t1, t2, t3);\n } else if ((t2.isI() && t3.isI())) {\n t1 = new Term.Cond(Term.TYPE_I, t1, t2, t3);\n } else if (!isTypeChecking()) {\n t1 = new Term.Cond(Term.TYPE_D, t1, t2, t3);\n } else {\n reportError(\"Boolean or numeric operands expected in conditional '?:' term.\");\n }\n } else {\n _tokenizer.pushBack();\n reportError(\"Missing ':' part of conditional '?:' term.\");\n }\n } else {\n _tokenizer.pushBack();\n }\n return t1;\n }", "private Element createXmlElementForConcat(Concat concat, Document xmlDocument, Constraint constraint) {\n\t\tElement element = xmlDocument.createElement(XML_CONCAT);\n\t\t//element.setAttribute(XML_INFO1, concat.getValue1().toString());\n\t\t//element.setAttribute(XML_INFO2, concat.getValue2().toString());\n\n\t\tfor (Value childValue : concat) {\n\t\t\tElement child = createXmlElementForValue(childValue, xmlDocument, constraint);\n\t\t\tif (child != null)\n\t\t\t\telement.appendChild(child);\n\t\t}\n\t\t\n\t\treturn (element.hasChildNodes() ? element : null);\n\t}", "public Element createXMLnode(String tokenType) {\n\t\tElement temp;\n\t\ttemp = document.createElement(tokenType);\n\t\ttemp.setTextContent(\" \" + jTokenizer.returnTokenVal(tokenType) + \" \");\n\t\treturn temp;\n\t}", "<C> BooleanLiteralExp<C> createBooleanLiteralExp();", "public SPARQLBooleanXMLParser() {\n\t\tsuper();\n\t}", "private Element createXmlElementForValue(Value value, Document xmlDocument, Constraint constraint) {\n\t\tif (value instanceof ScopedValue) {\n\t\t\tLogging.LOGGER.warning(\"In ValueViewer.createXmlElementForValue: value must not be a ScopedValue. Please debug.\");\n\t\t\t\n\t\t\treturn createXmlElementForValue(((ScopedValue) value).getValue(), xmlDocument, constraint);\n\t\t}\n\t\telse if (value instanceof Concat) {\n\t\t\treturn createXmlElementForConcat((Concat) value, xmlDocument, constraint);\n\t\t}\n\t\telse if (value instanceof Choice) {\n\t\t\treturn createXmlElementForChoice((Choice) value, xmlDocument, constraint);\n\t\t}\n\t\telse if (value instanceof Switch) {\n\t\t\treturn createXmlElementForSwitch((Switch) value, xmlDocument, constraint);\n\t\t}\n\t\telse if (value instanceof Undefined) {\n\t\t\treturn createXmlElementForUndefined((Undefined) value, xmlDocument, constraint);\n\t\t}\n\t\telse if (value instanceof ArrayValueImpl) {\n\t\t\treturn createXmlElementForArray((ArrayValueImpl) value, xmlDocument, constraint);\n\t\t}\n\t\telse if (value instanceof ObjectExtValue) {\n\t\t\treturn createXmlElementForObject((ObjectExtValue) value, xmlDocument, constraint);\n\t\t}\n\t\telse {\n\t\t\t//System.out.println(\"Please handle \" + value.getClass().getSimpleName());\n\t\t\tElement element = xmlDocument.createElement(XML_VALUE);\n\t\t\telement.setAttribute(XML_DESC, value.toString());\n\n\t\t\treturn element;\n\t\t}\n\t}", "public Element createEmptyElement(EmptyTask task) {\n\t\tElement empty = this.document.createElement(\"empty\");\n\t\t\n//\t\tBPELUtil.setStandardAttributes(empty, task);\n\t\t\n//\t\treturn createScopeForAttachedHandlers(empty, task);\n\t\treturn null;\n\t\t\n\t}", "private void parsePatientFunctionalCognitiveStatusFromNode(final Node sectionNode, final PatientBuilder patBuilder) {\n\n\t}", "public Object visitConditionalExpression(GNode n) {\n if (dostring) {\n Object a = dispatch(n.getGeneric(0));\n Object b = dispatch(n.getGeneric(1));\n Object c = dispatch(n.getGeneric(2));\n \n if (a instanceof Long) {\n return (! ((Long) a).equals(new Long(0))) ? b : c;\n }\n else {\n return parens(a) + \" ? \" + parens(b) + \" : \" + parens(c);\n }\n }\n else {\n BDD a = ensureBDD(dispatch(n.getGeneric(0)));\n BDD b = ensureBDD(dispatch(n.getGeneric(1)));\n BDD c = ensureBDD(dispatch(n.getGeneric(2)));\n BDD ab, na, nac, bdd;\n \n //implement with a & b | !a & c\n ab = a.and(b);\n b.free();\n na = a.not();\n a.free();\n nac = na.and(c);\n c.free();\n na.free();\n bdd = ab.or(nac);\n nac.free();\n ab.free();\n \n return bdd;\n }\n }", "ConditionalDependency createConditionalDependency();", "public T caseElIfConditional(ElIfConditional object)\n\t{\n\t\treturn null;\n\t}", "public DoNotCacheCondition(\n org.w3c.dom.Element doNotCacheConditionElement) \n throws SAMLException\n {\n Element elt = (Element)doNotCacheConditionElement;\n String eltName = elt.getLocalName();\n if (eltName == null) {\n if (SAMLUtilsCommon.debug.messageEnabled()) { \n SAMLUtilsCommon.debug.message(\"DoNotCacheCondition: \"\n + \"null condition \");\n }\n throw new SAMLRequesterException(SAMLUtilsCommon.bundle.getString(\n \"nullInput\"));\n }\n if (!(eltName.equals(\"DoNotCacheCondition\"))) {\n if (!(eltName.equals(\"Condition\"))) {\n if (SAMLUtilsCommon.debug.messageEnabled()) { \n SAMLUtilsCommon.debug.message(\"DoNotCacheCondition: \"\n + \"unsupported condition \");\n }\n throw new SAMLRequesterException(\n SAMLUtilsCommon.bundle.getString(\n \"unsupportedCondition\"));\n }\n }\n if (eltName.equals(\"Condition\")) { // seems like extension type\n String type = elt.getAttribute(\"xsi:type\");\n if (!(type.equals(\"DoNotCacheCondition\"))) {\n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\n \"DoNotCacheCondition: invalid condition\");\n }\n throw new SAMLRequesterException(\n SAMLUtilsCommon.bundle.getString(\"invalidElement\"));\n }\n } \n }", "ElementDefinition createElementDefinition();", "IfStmtRule createIfStmtRule();", "public static TreeNode makeLiteral(Boolean booleanConstant) {\n return new BooleanNode(booleanConstant);\n }", "public Builder<T> If(BooleanSupplier condition) {\n this.ifCond = condition.getAsBoolean();\n return this;\n }", "public Stmt createIf(Position pos, Expr cond, Stmt thenStmt, Stmt elseStmt) {\n if (null == elseStmt) return xnf.If(pos, cond, thenStmt);\n return xnf.If(pos, cond, thenStmt, elseStmt);\n }", "String getIfFunction(String condition, String exprtrue, String exprfalse);", "public interface INestedIfElseClauseContainer extends IEmbeddedNodeUser {\r\n\t\t/**\r\n\t\t * registers an if-clause (or else-clause) as an inner clause of this clause\r\n\t\t * @param nestedClause\r\n\t\t * @throws NullPointerException: if nestedClause is null\r\n\t\t */\r\n\t\tpublic void addNestedClause(TempTableHeaderCell nestedClause);\r\n\t\t\r\n\t\t/**\r\n\t\t * Looks for the first if/else clause (performing deep scan - searches every nested if/else clause\r\n\t\t * as well) which the bExpression returns true.\r\n\t\t * \r\n\t\t * @param valuesOnCPTColumn: a map which the key is a name of a parent node and\r\n\t\t * the value is its current possible values to be evaluated.\r\n\t\t * For example, if we want to evalueate an expression when for a node \"Node(!ST0)\" we\r\n\t\t * have parents Parent1(!ST0,!Z0), Parent1(!ST0,!Z1), Parent2(!ST0,!T0), and Parent2(!ST0,!T0)\r\n\t\t * with values True, False, Alpha, Beta respectively, the map should be:\r\n\t\t * \t\tentry0, (key:\"Parent1\", values: {True, False});\r\n\t\t * \t\tentry1, (key:\"Parent2\", values: {Alpha, Beta});\r\n\t\t * \r\n\t\t * @return: the first if/else clause which returned true.\r\n\t\t */\r\n\t\tpublic TempTableHeaderCell getFirstTrueClause(Map<String, List<EntityAndArguments>> valuesOnCPTColumn) ;\r\n\t\t\r\n\t\t\r\n\t\t/**\r\n\t\t * Tests if this container has no nested clauses.\r\n\t\t * @return true if this if/else clause container has 0 nested elements\r\n\t\t */\r\n\t\tpublic boolean isEmptyNestedClauses ();\r\n\t\t\r\n\t\t/**\r\n\t\t * @return the clauses\r\n\t\t */\r\n\t\tpublic List<TempTableHeaderCell> getNestedClauses();\r\n\t\t\r\n\t\t/**\r\n\t\t * \r\n\t\t * @return the clause this object is contained within\r\n\t\t */\r\n\t\tpublic INestedIfElseClauseContainer getUpperClause();\r\n\t\t\r\n\t\t\r\n\t\t/**\r\n\t\t * sets the clause this object is contained within\r\n\t\t * @param upper\r\n\t\t */\r\n\t\tpublic void setUpperClause(INestedIfElseClauseContainer upper);\r\n\t\t\r\n\t\t\r\n\t\t/**\r\n\t\t * Initializes the \"isKnownValue\" attributes of TempTableHeader objects\r\n\t\t * by recursively calling this method for all nested causes.\r\n\t\t * @param ssbnnode\r\n\t\t * @see TempTableHeader\r\n\t\t * @throws NullPointerException if ssbnnode is null\r\n\t\t */\r\n\t\tpublic void cleanUpKnownValues(SSBNNode ssbnnode);\r\n\t\t\r\n\r\n\t\t/**\r\n\t\t * Hierarchically searches for user-defined variables in scope.\r\n\t\t * @param key : name of variable to look for\r\n\t\t * @return : value of the variable\r\n\t\t * @see #addUserDefinedVariable(String, IExpressionValue)\r\n\t\t * @see #clearUserDefinedVariables()\r\n\t\t */\r\n\t\tpublic IExpressionValue getUserDefinedVariable(String key);\r\n\t\t\r\n\t\t/**\r\n\t\t * Adds a new user-defined variable retrievable from {@link #getUserDefinedVariable(String)}\r\n\t\t * @see #clearUserDefinedVariables()\r\n\t\t */\r\n\t\tpublic void addUserDefinedVariable(String key, IExpressionValue value);\r\n\t\t\r\n\t\t/**\r\n\t\t * Deletes all user variables that were included by {@link #addUserDefinedVariable(String, IExpressionValue)}.\r\n\t\t * @see #getUserDefinedVariable(String)\r\n\t\t */\r\n\t\tpublic void clearUserDefinedVariables();\r\n\t\t\r\n\t\t/**\r\n\t\t * @return {@link #getUserDefinedVariable(String)} for this clause and all {@link #getNestedClauses()} recursively\r\n\t\t * @param keepFirst : if true, then variables found first will be kept if\r\n\t\t * variables with same name are found. If false, then variables found later will be used\r\n\t\t * in case of duplicate names.\r\n\t\t */\r\n\t\tpublic Map<String, IExpressionValue> getUserDefinedVariablesRecursively(boolean keepFirst);\r\n\t\t\r\n\t\t/**\r\n\t\t * @return instance of resident node whose LPD script is being applied.\r\n\t\t * (this can be used if we are compiling a script before generating SSBN)\r\n\t\t * @see #getSSBNNode()\r\n\t\t */\r\n\t\tpublic IResidentNode getResidentNode();\r\n\t\t\r\n\t\t/**\r\n\t\t * @return : instance of SSBN node whose LPD script is being applied during SSBN generation.\r\n\t\t * May return null if compiler is called before SSBN generation. If so, {@link #getResidentNode()}\r\n\t\t * must be used.\r\n\t\t */\r\n\t\tpublic SSBNNode getSSBNNode();\r\n\t}", "BooleanExpression createBooleanExpression();", "BooleanExpression createBooleanExpression();", "public String marshallNode(XsdNode node, Node element) throws IOException {\n\t\tString marshalling = \"\";\n\t\tif (!node.isUsed) {\n\t\t\treturn marshalling;\n\t\t}\n\n\t\tif (selections.contains(node)) {\n\t\t\tif (firstElement)\n\t\t\t\tfirstElement = false;\n\t\t\telse\n\t\t\t\tmarshalling += separator;\n\n\t\t\t\n\t\t\t\n\t\t\tEnumeration children = node.children();\n\t\t\tboolean filtered = false;\n\t\t\twhile (children.hasMoreElements()) {\n\t\t\t\tXsdNode child = (XsdNode) children.nextElement();\n\t\t\t\n\t\t\t\tif (((Annotated) child.getUserObject()).getStructureType() == Structure.ATTRIBUTE) {\n\t\t\t\t\tif (elementFilters.containsKey(child)) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tString value = ((Element) element)\n\t\t\t\t\t\t\t\t\t.getAttributeNode(child.toString())\n\t\t\t\t\t\t\t\t\t.getNodeValue();\n\t\t\t\t\t\t\t/** TODO: done for managing filter */\n\t\t\t\t\t\t\tif (!value.matches((String) elementFilters\n\t\t\t\t\t\t\t\t\t.get(child))) {\n\t\t\t\t\t\t\t\tfiltered = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif (element != null && filtered == false) {\n\t\t\t\tmarshalling += getElementValue((Element) element);\n\t\t\t}\n\t\t}\n\n\t\tEnumeration children = node.children();\n\t\twhile (children.hasMoreElements()) {\n\t\t\tXsdNode child = (XsdNode) children.nextElement();\n\t\t\tif (child.isUsed) {\n\t\t\t\tswitch (((Annotated) child.getUserObject()).getStructureType()) {\n\t\t\t\tcase Structure.ELEMENT:\n\t\t\t\t\tint cpt = 0;\n\t\t\t\t\t/* create a NodeList with all childs with tagname */\n\t\t\t\t\tif (element != null) {\n\t\t\t\t\t\tNodeList allElements = element.getChildNodes();\n\t\t\t\t\t\tArrayList elements = new ArrayList();\n\t\t\t\t\t\tfor (int i = 0; i < allElements.getLength(); i++) {\n\t\t\t\t\t\t\tif (allElements.item(i).getNodeName().compareTo(\n\t\t\t\t\t\t\t\t\tchild.toString()) == 0) {\n\t\t\t\t\t\t\t\telements.add(allElements.item(i));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/* get references */\n\t\t\t\t\t\t\telse if (isXsRefPath(allElements.item(i)\n\t\t\t\t\t\t\t\t\t)) {\n\t\t\t\t\t\t\t\tElement ref = //document.\n\t\t\t\t\t\t\t\tthis.getElementByKeyRef((Element) allElements\n\t\t\t\t\t\t\t\t\t\t\t\t.item(i));\n\t\t\t\t\t\t\t\tif (ref != null\n\t\t\t\t\t\t\t\t\t\t&& ref.getNodeName().compareTo(\n\t\t\t\t\t\t\t\t\t\t\t\tchild.toString()) == 0) {\n\t\t\t\t\t\t\t\t\telements.add(ref);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* get references */\n\t\t\t\t\t\t\telse if (isRefType(allElements.item(i)\n\t\t\t\t\t\t\t\t\t.getNodeName())) {\n\t\t\t\t\t\t\t\tElement ref = //document.\n\t\t\t\t\t\t\t\tgetElementById(((Element) allElements\n\t\t\t\t\t\t\t\t\t\t\t\t.item(i))\n\t\t\t\t\t\t\t\t\t\t\t\t.getAttribute(refAttribute));\n\t\t\t\t\t\t\t\tif (ref != null\n\t\t\t\t\t\t\t\t\t\t&& ref.getNodeName().compareTo(\n\t\t\t\t\t\t\t\t\t\t\t\tchild.toString()) == 0) {\n\t\t\t\t\t\t\t\t\telements.add(ref);\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\twhile (cpt < elements.size()) {\n\t\t\t\t\t\t\tmarshalling += marshallNode(child, (Node) elements\n\t\t\t\t\t\t\t\t\t.get(cpt));\n\t\t\t\t\t\t\tcpt++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tint maxCount = getMaxCount(child);\n\t\t\t\t\twhile (cpt < maxCount) {\n\t\t\t\t\t\tmarshalling += marshallNode(child, null);\n\t\t\t\t\t\tcpt++;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase Structure.ATTRIBUTE:\n\t\t\t\t\tif (firstElement)\n\t\t\t\t\t\tfirstElement = false;\n\t\t\t\t\telse\n\t\t\t\t\t\tmarshalling += separator;\n\n\t\t\t\t\tif (element != null) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmarshalling += ((Element) element)\n\t\t\t\t\t\t\t\t\t.getAttributeNode(child.toString())\n\t\t\t\t\t\t\t\t\t.getNodeValue();\n\t\t\t\t\t\t} catch (NullPointerException ne) {\n\t\t\t\t\t\t\t/* main cause: the cell does not exist */\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t.println(\"[PSI makers: flattener] ERROR: the node is neither an attribute nor an element\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn marshalling;\n\t}", "@Override\n\tpublic void startElement(String uri, String localName, String qName,\n\t\t\tAttributes attributes) throws SAXException {\n\t\tsuper.startElement(uri, localName, qName, attributes);\n\t\t\n\t\tif (TAG_CONDITION.equals(localName)) {\n\t\t\tmWeatherInfo.setWoeid(woeid);\n\t\t\tfor (int i = 0; i < attributes.getLength(); i++) {\n\t\t\t\tString qn = attributes.getQName(i);\n\t\t\t\t\n\t\t\t\tif (QNAME_CODE.equals(qn)) {\n\t\t\t\t\tmWeatherInfo.getCondition().setCode(attributes.getValue(i));\n\t\t\t\t} else if (QNAME_DATE.equals(qn)) {\n\t\t\t\t\tmWeatherInfo.getCondition().setDate(attributes.getValue(i));\n\t\t\t\t} else if (QNAME_TMP.equals(qn)) {\n\t\t\t\t\tmWeatherInfo.getCondition().setTemp(attributes.getValue(i));\n\t\t\t\t} else if (QNAME_TEXT.equals(qn)) {\n\t\t\t\t\tmWeatherInfo.getCondition().setText(attributes.getValue(i));\n\t\t\t\t\tmWeatherInfo.setUpdateTime(System.currentTimeMillis());//wangjun\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (TAG_FORCAST.equals(localName)) {\n\t\t\tforecast = mWeatherInfo.new Forecast();\n\t\t\tfor (int i = 0; i < attributes.getLength(); i++) {\n\t\t\t\tString qn = attributes.getQName(i);\n\t\t\t\t\n\t\t\t\tif (QNAME_CODE.equals(qn)) {\n\t\t\t\t\tforecast.setCode(attributes.getValue(i));\n\t\t\t\t} else if (QNAME_DAY.equals(qn)) {\n\t\t\t\t\tforecast.setDay(attributes.getValue(i));\n\t\t\t\t} else if (QNAME_HIGH.equals(qn)) {\n\t\t\t\t\tforecast.setHigh(attributes.getValue(i));\n\t\t\t\t} else if (QNAME_LOW.equals(qn)) {\n\t\t\t\t\tforecast.setLow(attributes.getValue(i));\n\t\t\t\t} else if (QNAME_TEXT.equals(qn)) {\n\t\t\t\t\tforecast.setText(attributes.getValue(i));\n\t\t\t\t} else if (QNAME_DATE.equals(qn)) {\n\t\t\t\t\tforecast.setDate(attributes.getValue(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\tmWeatherInfo.getForecasts().add(forecast);\n\t\t}\n\t}", "Element toXML();", "@Override\n\tpublic String getTreeCondition() {\n\t\treturn null;\n\t}", "public static _boolean parse(\n javax.xml.stream.XMLStreamReader reader)\n throws java.lang.Exception {\n _boolean object = new _boolean();\n\n int event;\n javax.xml.namespace.QName currentQName = null;\n java.lang.String nillableValue = null;\n java.lang.String prefix = \"\";\n java.lang.String namespaceuri = \"\";\n\n try {\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n currentQName = reader.getName();\n\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n // Skip the element and report the null value. It cannot have subelements.\n while (!reader.isEndElement())\n reader.next();\n\n return object;\n }\n\n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n\n while (!reader.isEndElement()) {\n if (reader.isStartElement()) {\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.microsoft.com/2003/10/Serialization/\",\n \"boolean\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (!\"true\".equals(nillableValue) &&\n !\"1\".equals(nillableValue)) {\n java.lang.String content = reader.getElementText();\n\n object.set_boolean(org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(\n content));\n } else {\n reader.getElementText(); // throw away text nodes if any.\n }\n } // End of if for expected property start element\n\n else {\n // 3 - A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\n \"Unexpected subelement \" +\n reader.getName());\n }\n } else {\n reader.next();\n }\n } // end of while loop\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "@org.junit.Test\n public void constrCompelemNodeid4() {\n final XQuery query = new XQuery(\n \"for $x in <?pi content?>, $y in element elem {$x} return exactly-one($y/processing-instruction()) is $x\",\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 assertBoolean(false)\n );\n }", "private void Conditional(){\n\t\tLogicOR();\n\t\t\n\t\tfor(;;){\n\t\t\tif(eat(\"for\")){\n\t\t\t\tInlineFor();\n\t\t\t}else if(eat(\"if\")){\n\t\t\t\tExpression();\n\t\t\t\tif(eat(\"else\"))\n\t\t\t\t\tConditional();\n\t\t\t}else if(eat(\"defined\") || eat(\"!defined\"));\n\t\t\telse for(;;){\n\t\t\t\tif(eat(\"?\")){\n\t\t\t\t\tExpression();\n\t\t\t\t\tassert_eat(\":\");\n\t\t\t\t\tConditional();\n\t\t\t\t}else return;\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic Object visit(ASTCondAnd node, Object data) {\n\t\tnode.jjtGetChild(0).jjtAccept(this, data);\n\t\tSystem.out.print(\" and \");\n\t\tnode.jjtGetChild(1).jjtAccept(this, data);\n\t\treturn null;\n\t}", "private IfElement _if(String expression, CodeElement... body)\n {\n return _ifElse(expression, Arrays.asList(body), null);\n }", "public void visit(ConditionElement1 conditionElement1) {\n\t\t\n\t\t// if a != 0, jmp true1\n\t\tCode.loadConst(0);\n\t\tCode.put(Code.jcc+Code.ne);\n\t\tCode.put2(11);\n\t\t\n\t\t// if b != 0, jmp true2\n\t\tCode.loadConst(0);\n\t\tCode.put(Code.jcc + Code.ne);\n\t\tCode.put2(8);\n\t\t\n\t\t// false: put 0,jmp next \n\t\tCode.loadConst(0);\n\t\tCode.put(Code.jmp);\n\t\tCode.put2(5);\n\t\t\n\t\t// true1\n\t\tCode.put(Code.pop);\n\t\t\n\t\t// true2\n\t\tCode.loadConst(1);\n\t\t\n\t\t// next\n\t}", "private boolean getBoolean(Node node, boolean defaultValue) {\r\n boolean value = defaultValue;\r\n if (node != null) {\r\n try {\r\n value = Boolean.parseBoolean(node.getNodeValue());\r\n } catch (Exception e) {\r\n value = defaultValue;\r\n }\r\n }\r\n return value;\r\n }", "cn.infinivision.dataforce.busybee.pb.meta.Expr getCondition();", "private Element createBaseTemporalNode(Node relOpNode, XmlProcessor hqmfXmlProcessor) {\n\n\t\tNamedNodeMap attribMap = relOpNode.getAttributes();\n\t\tElement temporallyRelatedInfoNode = hqmfXmlProcessor.getOriginalDoc()\n\t\t\t\t.createElement(\"temporallyRelatedInformation\");\n\t\ttemporallyRelatedInfoNode.setAttribute(TYPE_CODE, attribMap.getNamedItem(TYPE).getNodeValue().toUpperCase());\n\n\t\tElement temporalInfoNode = hqmfXmlProcessor.getOriginalDoc().createElement(\"qdm:temporalInformation\");\n\t\tString precisionUnit = \"min\"; // use min by default\n\n\t\tif (attribMap.getNamedItem(OPERATOR_TYPE) != null) {\n\t\t\tString operatorType = attribMap.getNamedItem(OPERATOR_TYPE).getNodeValue();\n\t\t\tString quantity = attribMap.getNamedItem(QUANTITY).getNodeValue();\n\t\t\tString unit = attribMap.getNamedItem(UNIT).getNodeValue();\n\n\t\t\tif (\"seconds\".equals(unit)) {\n\t\t\t\tprecisionUnit = \"s\";\n\t\t\t\tunit = \"s\";\n\t\t\t} else if (\"hours\".equals(unit)) {\n\t\t\t\tunit = \"h\";\n\t\t\t} else if (\"minutes\".equals(unit)) {\n\t\t\t\tunit = \"min\";\n\t\t\t} else {\n\t\t\t\tprecisionUnit = \"d\";\n\t\t\t\tif (\"days\".equals(unit)) {\n\t\t\t\t\tunit = \"d\";\n\t\t\t\t} else if (\"weeks\".equals(unit)) {\n\t\t\t\t\tunit = \"wk\";\n\t\t\t\t} else if (\"months\".equals(unit)) {\n\t\t\t\t\tunit = \"mo\";\n\t\t\t\t} else if (\"years\".equals(unit)) {\n\t\t\t\t\tunit = \"a\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tElement deltaNode = hqmfXmlProcessor.getOriginalDoc().createElement(\"qdm:delta\");\n\t\t\tElement lowNode = hqmfXmlProcessor.getOriginalDoc().createElement(\"low\");\n\t\t\tlowNode.setAttribute(UNIT, unit);\n\n\t\t\tElement highNode = hqmfXmlProcessor.getOriginalDoc().createElement(\"high\");\n\t\t\thighNode.setAttribute(UNIT, unit);\n\n\t\t\tif (operatorType.startsWith(\"Greater Than\")) {\n\t\t\t\tlowNode.setAttribute(VALUE, quantity);\n\t\t\t\thighNode.removeAttribute(UNIT);\n\t\t\t\thighNode.setAttribute(NULL_FLAVOR, \"PINF\");\n\t\t\t\tif (\"Greater Than or Equal To\".equals(operatorType)) {\n\t\t\t\t\tdeltaNode.setAttribute(\"lowClosed\", TRUE);\n\t\t\t\t}\n\t\t\t} else if (\"Equal To\".equals(operatorType)) {\n\t\t\t\tdeltaNode.setAttribute(\"lowClosed\", TRUE);\n\t\t\t\tdeltaNode.setAttribute(\"highClosed\", TRUE);\n\t\t\t\tlowNode.setAttribute(VALUE, quantity);\n\t\t\t\thighNode.setAttribute(VALUE, quantity);\n\t\t\t} else if (operatorType.startsWith(\"Less Than\")) {\n\t\t\t\tdeltaNode.setAttribute(\"lowClosed\", TRUE);\n\t\t\t\tlowNode.setAttribute(VALUE, \"0\");\n\t\t\t\thighNode.setAttribute(VALUE, quantity);\n\t\t\t\tif (\"Less Than or Equal To\".equals(operatorType)) {\n\t\t\t\t\tdeltaNode.setAttribute(\"highClosed\", TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeltaNode.appendChild(lowNode);\n\t\t\tdeltaNode.appendChild(highNode);\n\t\t\ttemporalInfoNode.appendChild(deltaNode);\n\t\t}\n\t\ttemporalInfoNode.setAttribute(\"precisionUnit\", precisionUnit);\n\t\ttemporallyRelatedInfoNode.appendChild(temporalInfoNode);\n\t\treturn temporallyRelatedInfoNode;\n\t}", "private Element createXmlElementForNameValuePair(Value name, Value value, Document xmlDocument, Constraint constraint) {\n\t\tif (excludedNames.contains(name.toString()))\n\t\t\treturn null;\n\t\t\n\t\tif (constraint != null)\n\t\t\tname = MultiValue.simplify(name, constraint);\n\t\telse {\n\t\t\tname = MultiValue.simplify(name);\n\t\t}\n\t\tif (name == Undefined.UNDEFINED)\n\t\t\treturn null;\n\n\t\t\t\n\t\tif (constraint != null)\n\t\t\tvalue = MultiValue.simplify(value, constraint);\n\t\telse {\n\t\t\tvalue = MultiValue.simplify(value);\n\t\t}\n\t\tif (value == Undefined.UNDEFINED || value instanceof NullValue)\n\t\t\treturn null;\n\t\t\n\t\tElement element = xmlDocument.createElement(XML_NAME_VALUE);\n\t\telement.setAttribute(XML_DESC, name.toString());\n\t\telement.setAttribute(XML_INFO1, value instanceof ObjectExtValue ? \"Object\" : value.toString());\n\t\t\n\t\tElement childElement = createXmlElementForValue(value, xmlDocument, constraint);\n\t\tif (childElement != null)\n\t\t\telement.appendChild(childElement);\n\t\t\n\t\treturn (element.hasChildNodes() ? element : null);\n\t}", "public static Expression buildFromDOM( Element element ) throws FilterConstructionException {\n\n // check if root element's name is a known expression\n String name = element.getLocalName();\n int id = ExpressionDefines.getIdByName( name );\n Expression expression = null;\n\n switch (id) {\n case ExpressionDefines.EXPRESSION: {\n break;\n }\n case ExpressionDefines.PROPERTYNAME: {\n expression = PropertyName.buildFromDOM( element );\n break;\n }\n case ExpressionDefines.LITERAL: {\n expression = Literal.buildFromDOM( element );\n break;\n }\n case ExpressionDefines.FUNCTION: {\n expression = Function.buildFromDOM( element );\n break;\n }\n case ExpressionDefines.ADD:\n case ExpressionDefines.SUB:\n case ExpressionDefines.MUL:\n case ExpressionDefines.DIV: {\n expression = ArithmeticExpression.buildFromDOM( element );\n break;\n }\n default: {\n throw new FilterConstructionException( \"Unknown expression '\"\n + name + \"'!\" );\n }\n }\n return expression;\n }", "public static GeglNode fromXml(String text)\n\t{\n\t\treturn fromXml(\"/\");\n\t}", "private Element generateCriteriaElementForExcerpt(XmlProcessor hqmfXmlProcessor, NodeList entryChildNodes) {\n\t\tElement criteriaElement = null;\n\t\tfor (int i = 0; i < entryChildNodes.getLength(); i++) {\n\t\t\tNode childNode = entryChildNodes.item(i);\n\t\t\tString childNodeName = childNode.getNodeName();\n\t\t\tif (childNodeName.contains(\"Criteria\")) {\n\t\t\t\tcriteriaElement = hqmfXmlProcessor.getOriginalDoc().createElement(childNodeName);\n\t\t\t\tcriteriaElement.setAttribute(CLASS_CODE,\n\t\t\t\t\t\tchildNode.getAttributes().getNamedItem(CLASS_CODE).getNodeValue());\n\t\t\t\tcriteriaElement.setAttribute(MOOD_CODE,\n\t\t\t\t\t\tchildNode.getAttributes().getNamedItem(MOOD_CODE).getNodeValue());\n\t\t\t\tNodeList criteriaChildNodes = childNode.getChildNodes();\n\t\t\t\tfor (int j = 0; j < criteriaChildNodes.getLength(); j++) {\n\t\t\t\t\tNode criteriaChildNode = criteriaChildNodes.item(j);\n\t\t\t\t\tif (ID.equalsIgnoreCase(criteriaChildNode.getNodeName())) {\n\t\t\t\t\t\tElement idElement = hqmfXmlProcessor.getOriginalDoc().createElement(ID);\n\t\t\t\t\t\tidElement.setAttribute(ROOT,\n\t\t\t\t\t\t\t\tcriteriaChildNode.getAttributes().getNamedItem(ROOT).getNodeValue());\n\t\t\t\t\t\tidElement.setAttribute(EXTENSION,\n\t\t\t\t\t\t\t\tcriteriaChildNode.getAttributes().getNamedItem(EXTENSION).getNodeValue());\n\t\t\t\t\t\tcriteriaElement.appendChild(idElement);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn criteriaElement;\n\t}", "public XMLElement() {\n this(new Properties(), false, true, true);\n }", "private Conditional ifStatement()\n\t{\n\t\t// IfStatement --> if ( Expression ) Statement [ else Statement ]\n\t\tConditional c = null;\n\t\t\n\t\t// if\n\t\tmatch(TokenType.If);\n\t\t// (\n\t\tmatch(TokenType.LeftParen);\n\t\t// <<Expression>>\n\t\tExpression e = expression();\n\t\t// )\n\t\tmatch(TokenType.RightParen);\n\t\t// <<Statement>>\n\t\tStatement s = statement();\n\t\t\n\t\t// else가 나오면\n\t\tif (token.type().equals(TokenType.Else))\n\t\t{\n\t\t\t// else\n\t\t\ttoken = lexer.next();\n\t\t\t\n\t\t\t// <<Statement>>\n\t\t\tStatement elseState = statement();\n\t\t\tc = new Conditional(e, s, elseState);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tc = new Conditional(e, s);\n\t\t}\n\t\t\n\t\treturn c; // student exercise\n\t}", "@Override\n public Object visitIfstatement(TranslationGrammarParser.IfstatementContext ctx) {\n ArrayList<Node<TokenAttributes>> result = new ArrayList<>();\n Boolean cond = (Boolean) magicVisit(ctx.condition(), current_node);\n if (cond == null) {\n return null;\n }\n if (cond) {\n ArrayList<Node<TokenAttributes>> temp = (ArrayList<Node<TokenAttributes>>) magicVisit(ctx.ruleebody(), current_node);\n if (temp == null) {\n return null;\n }\n return temp;\n }\n return result;\n }", "@Override\n public void fromXML(Node node)\n {\n super.fromXML(node);\n\n NodeList children = node.getChildNodes();\n\n for (int j = 0; j < children.getLength(); j++)\n {\n Node child = children.item(j);\n\n if (child.getNodeName().equalsIgnoreCase(\"lethal-range\"))\n {\n this.setLethalRange(Double.parseDouble(child.getTextContent()));\n }\n else if (child.getNodeName().equalsIgnoreCase(\"pk\"))\n {\n this.setPk(Double.parseDouble(child.getTextContent()));\n }\n else if (child.getNodeName().equalsIgnoreCase(\"max-gs\"))\n {\n this.setMaxGs(Double.parseDouble(child.getTextContent()));\n }\n }\n }" ]
[ "0.6060902", "0.59389997", "0.5817393", "0.5599313", "0.5585734", "0.543987", "0.53712994", "0.5344337", "0.5213824", "0.5054645", "0.5044381", "0.49947184", "0.4972317", "0.4969138", "0.4935641", "0.493025", "0.48860538", "0.4874012", "0.48736987", "0.48621866", "0.4859078", "0.48324066", "0.48238823", "0.47701418", "0.4765496", "0.47642037", "0.47383758", "0.47371718", "0.47226045", "0.47163472", "0.4706423", "0.4691851", "0.46822986", "0.46174198", "0.46080136", "0.4599071", "0.45900637", "0.45868284", "0.45855868", "0.4569862", "0.45696503", "0.4556355", "0.4550664", "0.45405293", "0.45324585", "0.45270914", "0.45226863", "0.45135388", "0.44935685", "0.4490383", "0.44845685", "0.44801584", "0.44627273", "0.44567427", "0.44560638", "0.44523394", "0.44464186", "0.4425788", "0.44163617", "0.44112334", "0.44003445", "0.43948603", "0.43907624", "0.43884277", "0.43601257", "0.43490252", "0.43391606", "0.43344882", "0.4332918", "0.43228257", "0.430664", "0.43039456", "0.43033653", "0.4302609", "0.43022817", "0.42988497", "0.42953146", "0.42831856", "0.42831856", "0.4276635", "0.4274898", "0.4272802", "0.42710054", "0.42567486", "0.424627", "0.42397436", "0.42385164", "0.42338294", "0.4232193", "0.42277384", "0.42242616", "0.42237163", "0.42065588", "0.41982028", "0.41946694", "0.4193855", "0.41867822", "0.41845313", "0.41803944", "0.41803473" ]
0.5184418
9
/ access modifiers changed from: protected
public void updateBackground(int i, int i2, int i3, int i4) { if (this.mLauncher.getDeviceProfile().isVerticalBarLayout()) { View revealView = getRevealView(); int i5 = i; int i6 = i2; int i7 = i3; int i8 = i4; InsetDrawable insetDrawable = new InsetDrawable(this.mBaseDrawable, i5, i6, i7, i8); revealView.setBackground(insetDrawable); View contentView = getContentView(); InsetDrawable insetDrawable2 = new InsetDrawable(new ColorDrawable(0), i5, i6, i7, i8); contentView.setBackground(insetDrawable2); return; } getRevealView().setBackground(this.mBaseDrawable); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void prot() {\n }", "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 comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private abstract void privateabstract();", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void smell() {\n\t\t\n\t}", "public abstract Object mo26777y();", "protected void h() {}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "protected abstract Set method_1559();", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public abstract void mo70713b();", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "protected Doodler() {\n\t}", "public abstract void mo27386d();", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "private PropertyAccess() {\n\t\tsuper();\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public abstract void mo56925d();", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void init() {\n }", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "public abstract void mo27385c();", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "@Override\n public void memoria() {\n \n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void smthAbstr() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "public abstract void mo30696a();", "abstract int pregnancy();", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "@Override\n public void init() {\n\n }", "@Override\n void init() {\n }", "@Override\n\tpublic void leti() \n\t{\n\t}", "private TMCourse() {\n\t}", "public abstract void mo35054b();", "@Override\n public void init() {\n }", "@Override\n\tpublic void buscar() {\n\t\t\n\t}", "private Infer() {\n\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void erstellen() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public final void mo51373a() {\n }", "protected void method_3848() {\r\n super.method_3848();\r\n }", "protected FanisamBato(){\n\t}", "public abstract Object mo1771a();", "public abstract void m15813a();", "public void gored() {\n\t\t\n\t}", "@Override\n public void get() {}", "@Override\n\tpublic void dibuja() {\n\t\t\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 }", "private Get() {}", "private Get() {}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public abstract void mo27464a();", "public abstract String mo41079d();", "@Override\n\tpublic void classroom() {\n\t\t\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\n\tpublic void verkaufen() {\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void logic() {\n\n\t}", "public abstract void mo102899a();", "@SuppressWarnings(\"unused\")\n private void _read() {\n }", "public abstract void mo42329d();", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "public void method_4270() {}", "public abstract void mo6549b();", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void function() {\n\t\t\n\t}", "protected void init() {\n // to override and use this method\n }" ]
[ "0.7375736", "0.7042321", "0.6922649", "0.6909494", "0.68470824", "0.6830288", "0.68062353", "0.6583185", "0.6539446", "0.65011257", "0.64917654", "0.64917654", "0.64733833", "0.6438831", "0.64330196", "0.64330196", "0.64295477", "0.6426414", "0.6420484", "0.64083177", "0.6406691", "0.6402136", "0.6400287", "0.63977665", "0.63784796", "0.6373787", "0.63716805", "0.63680965", "0.6353791", "0.63344383", "0.6327005", "0.6327005", "0.63259363", "0.63079315", "0.6279023", "0.6271251", "0.62518364", "0.62254924", "0.62218183", "0.6213994", "0.6204108", "0.6195944", "0.61826825", "0.617686", "0.6158371", "0.6138765", "0.61224854", "0.6119267", "0.6119013", "0.61006695", "0.60922325", "0.60922325", "0.6086324", "0.6083917", "0.607071", "0.6070383", "0.6067458", "0.60568124", "0.6047576", "0.6047091", "0.60342956", "0.6031699", "0.6026248", "0.6019563", "0.60169774", "0.6014913", "0.6011912", "0.59969044", "0.59951806", "0.5994921", "0.599172", "0.59913194", "0.5985337", "0.59844744", "0.59678656", "0.5966894", "0.5966894", "0.5966894", "0.5966894", "0.5966894", "0.5966894", "0.59647757", "0.59647757", "0.59616375", "0.5956373", "0.5952514", "0.59497356", "0.59454703", "0.5941018", "0.5934147", "0.5933801", "0.59318185", "0.5931161", "0.5929297", "0.5926942", "0.5925829", "0.5924853", "0.5923296", "0.5922199", "0.59202504", "0.5918595" ]
0.0
-1
/ access modifiers changed from: protected
public void onFinishInflate() { super.onFinishInflate(); getContentView().setOnFocusChangeListener(new OnFocusChangeListener() { public void onFocusChange(View view, boolean z) { if (z) { AllAppsContainerView.this.mAppsRecyclerView.requestFocus(); } } }); this.mAppsRecyclerView = (AllAppsRecyclerView) findViewById(C0622R.C0625id.apps_list_view); this.mAppsRecyclerView.setApps(this.mApps); this.mAppsRecyclerView.setLayoutManager(this.mLayoutManager); this.mAppsRecyclerView.setAdapter(this.mAdapter); this.mAppsRecyclerView.setHasFixedSize(true); this.mAppsRecyclerView.setItemAnimator(null); this.mAppsRecyclerView.setSpringAnimationHandler(this.mSpringAnimationHandler); this.mSearchContainer = findViewById(C0622R.C0625id.search_container_all_apps); this.mSearchUiManager = (SearchUiManager) this.mSearchContainer; this.mSearchUiManager.initialize(this.mApps, this.mAppsRecyclerView); FocusedItemDecorator focusedItemDecorator = new FocusedItemDecorator(this.mAppsRecyclerView); this.mAppsRecyclerView.addItemDecoration(focusedItemDecorator); this.mAppsRecyclerView.preMeasureViews(this.mAdapter); this.mAdapter.setIconFocusListener(focusedItemDecorator.getFocusListener()); getRevealView().setVisibility(0); getContentView().setVisibility(0); getContentView().setBackground(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void prot() {\n }", "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 comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private abstract void privateabstract();", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void smell() {\n\t\t\n\t}", "public abstract Object mo26777y();", "protected void h() {}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "protected abstract Set method_1559();", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public abstract void mo70713b();", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "protected Doodler() {\n\t}", "public abstract void mo27386d();", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "private PropertyAccess() {\n\t\tsuper();\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public abstract void mo56925d();", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void init() {\n }", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "public abstract void mo27385c();", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "@Override\n public void memoria() {\n \n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void smthAbstr() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "public abstract void mo30696a();", "abstract int pregnancy();", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "@Override\n public void init() {\n\n }", "@Override\n void init() {\n }", "@Override\n\tpublic void leti() \n\t{\n\t}", "private TMCourse() {\n\t}", "public abstract void mo35054b();", "@Override\n public void init() {\n }", "@Override\n\tpublic void buscar() {\n\t\t\n\t}", "private Infer() {\n\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void erstellen() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public final void mo51373a() {\n }", "protected void method_3848() {\r\n super.method_3848();\r\n }", "protected FanisamBato(){\n\t}", "public abstract Object mo1771a();", "public abstract void m15813a();", "public void gored() {\n\t\t\n\t}", "@Override\n public void get() {}", "@Override\n\tpublic void dibuja() {\n\t\t\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 }", "private Get() {}", "private Get() {}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public abstract void mo27464a();", "public abstract String mo41079d();", "@Override\n\tpublic void classroom() {\n\t\t\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\n\tpublic void verkaufen() {\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void logic() {\n\n\t}", "public abstract void mo102899a();", "@SuppressWarnings(\"unused\")\n private void _read() {\n }", "public abstract void mo42329d();", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "public void method_4270() {}", "public abstract void mo6549b();", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void function() {\n\t\t\n\t}", "protected void init() {\n // to override and use this method\n }" ]
[ "0.7375736", "0.7042321", "0.6922649", "0.6909494", "0.68470824", "0.6830288", "0.68062353", "0.6583185", "0.6539446", "0.65011257", "0.64917654", "0.64917654", "0.64733833", "0.6438831", "0.64330196", "0.64330196", "0.64295477", "0.6426414", "0.6420484", "0.64083177", "0.6406691", "0.6402136", "0.6400287", "0.63977665", "0.63784796", "0.6373787", "0.63716805", "0.63680965", "0.6353791", "0.63344383", "0.6327005", "0.6327005", "0.63259363", "0.63079315", "0.6279023", "0.6271251", "0.62518364", "0.62254924", "0.62218183", "0.6213994", "0.6204108", "0.6195944", "0.61826825", "0.617686", "0.6158371", "0.6138765", "0.61224854", "0.6119267", "0.6119013", "0.61006695", "0.60922325", "0.60922325", "0.6086324", "0.6083917", "0.607071", "0.6070383", "0.6067458", "0.60568124", "0.6047576", "0.6047091", "0.60342956", "0.6031699", "0.6026248", "0.6019563", "0.60169774", "0.6014913", "0.6011912", "0.59969044", "0.59951806", "0.5994921", "0.599172", "0.59913194", "0.5985337", "0.59844744", "0.59678656", "0.5966894", "0.5966894", "0.5966894", "0.5966894", "0.5966894", "0.5966894", "0.59647757", "0.59647757", "0.59616375", "0.5956373", "0.5952514", "0.59497356", "0.59454703", "0.5941018", "0.5934147", "0.5933801", "0.59318185", "0.5931161", "0.5929297", "0.5926942", "0.5925829", "0.5924853", "0.5923296", "0.5922199", "0.59202504", "0.5918595" ]
0.0
-1
/ access modifiers changed from: protected
public void onMeasure(int i, int i2) { DeviceProfile deviceProfile = this.mLauncher.getDeviceProfile(); deviceProfile.updateAppsViewNumCols(); if (!(this.mNumAppsPerRow == deviceProfile.inv.numColumns && this.mNumPredictedAppsPerRow == deviceProfile.inv.numColumns)) { this.mNumAppsPerRow = deviceProfile.inv.numColumns; this.mNumPredictedAppsPerRow = deviceProfile.inv.numColumns; this.mAppsRecyclerView.setNumAppsPerRow(deviceProfile, this.mNumAppsPerRow); this.mAdapter.setNumAppsPerRow(this.mNumAppsPerRow); this.mApps.setNumAppsPerRow(this.mNumAppsPerRow, this.mNumPredictedAppsPerRow); } super.onMeasure(i, i2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void prot() {\n }", "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 comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private abstract void privateabstract();", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void smell() {\n\t\t\n\t}", "public abstract Object mo26777y();", "protected void h() {}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "protected abstract Set method_1559();", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public abstract void mo70713b();", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "protected Doodler() {\n\t}", "public abstract void mo27386d();", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "private PropertyAccess() {\n\t\tsuper();\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public abstract void mo56925d();", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void init() {\n }", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "public abstract void mo27385c();", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "@Override\n public void memoria() {\n \n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void smthAbstr() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "public abstract void mo30696a();", "abstract int pregnancy();", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "@Override\n public void init() {\n\n }", "@Override\n void init() {\n }", "@Override\n\tpublic void leti() \n\t{\n\t}", "private TMCourse() {\n\t}", "public abstract void mo35054b();", "@Override\n public void init() {\n }", "@Override\n\tpublic void buscar() {\n\t\t\n\t}", "private Infer() {\n\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void erstellen() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public final void mo51373a() {\n }", "protected void method_3848() {\r\n super.method_3848();\r\n }", "protected FanisamBato(){\n\t}", "public abstract Object mo1771a();", "public abstract void m15813a();", "public void gored() {\n\t\t\n\t}", "@Override\n public void get() {}", "@Override\n\tpublic void dibuja() {\n\t\t\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 }", "private Get() {}", "private Get() {}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public abstract void mo27464a();", "public abstract String mo41079d();", "@Override\n\tpublic void classroom() {\n\t\t\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\n\tpublic void verkaufen() {\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void logic() {\n\n\t}", "public abstract void mo102899a();", "@SuppressWarnings(\"unused\")\n private void _read() {\n }", "public abstract void mo42329d();", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "public void method_4270() {}", "public abstract void mo6549b();", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void function() {\n\t\t\n\t}", "protected void init() {\n // to override and use this method\n }" ]
[ "0.7375736", "0.7042321", "0.6922649", "0.6909494", "0.68470824", "0.6830288", "0.68062353", "0.6583185", "0.6539446", "0.65011257", "0.64917654", "0.64917654", "0.64733833", "0.6438831", "0.64330196", "0.64330196", "0.64295477", "0.6426414", "0.6420484", "0.64083177", "0.6406691", "0.6402136", "0.6400287", "0.63977665", "0.63784796", "0.6373787", "0.63716805", "0.63680965", "0.6353791", "0.63344383", "0.6327005", "0.6327005", "0.63259363", "0.63079315", "0.6279023", "0.6271251", "0.62518364", "0.62254924", "0.62218183", "0.6213994", "0.6204108", "0.6195944", "0.61826825", "0.617686", "0.6158371", "0.6138765", "0.61224854", "0.6119267", "0.6119013", "0.61006695", "0.60922325", "0.60922325", "0.6086324", "0.6083917", "0.607071", "0.6070383", "0.6067458", "0.60568124", "0.6047576", "0.6047091", "0.60342956", "0.6031699", "0.6026248", "0.6019563", "0.60169774", "0.6014913", "0.6011912", "0.59969044", "0.59951806", "0.5994921", "0.599172", "0.59913194", "0.5985337", "0.59844744", "0.59678656", "0.5966894", "0.5966894", "0.5966894", "0.5966894", "0.5966894", "0.5966894", "0.59647757", "0.59647757", "0.59616375", "0.5956373", "0.5952514", "0.59497356", "0.59454703", "0.5941018", "0.5934147", "0.5933801", "0.59318185", "0.5931161", "0.5929297", "0.5926942", "0.5925829", "0.5924853", "0.5923296", "0.5922199", "0.59202504", "0.5918595" ]
0.0
-1
Creates new form UdpExample
public UdpExample() { initComponents(); myInitComponents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createClient() {\n client = new UdpClient(Util.semIp, Util.semPort, this);\n\n // Le paso true porque quiero que lo haga en un hilo nuevo\n client.connect(true);\n }", "private void createThreadUdp(){\n System.out.println(\"dirport: \"+serverDirPort);\n System.out.println(\"udpPort: \"+myUdpPort);\n System.out.println(\"tcpPort: \"+myTcpPort);\n threadHeartbeat=new ThSendHeartBeat(myAddress,serverDirPort,myHeartServer);\n threadHeartbeat.start();\n\n }", "public void createSocket() \n { \n try \n { \n socket = new DatagramSocket(); \n } \n catch (Exception ex) \n { \n System.out.println(\"UDPPinger Exception: \" + ex); \n } \n }", "UDPInstance() {\n this(null, null, null, null);\n }", "private Pdu makePdu(String name)\n {\n Pdu pdu = this.channel.makePdu();\n pdu.putString(\"tkn\", \"PEER-\" + TKN_CPT++);\n pdu.putString(\"name\", name);\n return pdu;\n }", "public UdpEndpoint( UdpKernel kernel, long id, SocketAddress address, DatagramSocket socket )\n {\n this.id = id;\n this.address = address;\n this.socket = socket;\n this.kernel = kernel;\n }", "Adresse createAdresse();", "public void createAuctionTest(){\n\t\tAuction auc = new Auction(new User(),\"Test Auction Description\",1000l);\n\n\t}", "UADev createNewUADev(String id,String name,String title,String desc)\r\n\t{\r\n\t\tUADev ret = new UADev() ;\r\n\t\tret.id = id ;\r\n\t\treturn updateUADev(ret,name,title,desc);\r\n\t}", "public UConnecte() {\n\t\tsuper();\n\t}", "Udt createUdt();", "Device createDevice();", "public UDPclient()\n\t{\n\t}", "public TeIpv6() {\n }", "public RtpPacketTest() {\n\n\t}", "public FedoraLdp() {\n super();\n }", "public void create(){}", "UMOImmutableEndpoint createInboundEndpoint(UMOEndpointBuilder builder, UMOManagementContext managementContext) throws UMOException;", "public UBERequest() {\r\n }", "DD createDD();", "public ICpDeviceList createListUuid(String aUuid, ICpDeviceListListener aListener)\n\t{\n\t\treturn new CpDeviceListUpnpUuid(aUuid, aListener);\n\t}", "private void createOffer() {\n// showToast(\"createOffer\");\n Log.d(TAG, \"createOffer: \");\n sdpConstraints = new MediaConstraints();\n sdpConstraints.mandatory.add(\n new MediaConstraints.KeyValuePair(\"OfferToReceiveAudio\", \"true\"));\n sdpConstraints.mandatory.add(\n new MediaConstraints.KeyValuePair(\"OfferToReceiveVideo\", \"true\"));\n localPeer.createOffer(new CustomSdpObserver(\"localCreateOffer\") {\n @Override\n public void onCreateSuccess(SessionDescription sessionDescription) {\n super.onCreateSuccess(sessionDescription);\n localPeer.setLocalDescription(new CustomSdpObserver(\"localSetLocalDesc\"), sessionDescription);\n Log.d(TAG, \"send offer sdp emit \");\n SignallingClient.getInstance().sendOfferSdp(sessionDescription);\n }\n }, sdpConstraints);\n }", "public CustomPdp() throws Exception {\r\n\r\n }", "public SignUP() {\n initComponents();\n }", "public final void initialise (Uid u, String tn)\n {\n }", "Utilizator createUser(String username, String password, String nume,\n\t\t\tString prenume, String tip, String aux);", "private WfdDevice createWFDDevice(String iface, WfdEnums.WFDDeviceType type) {\n WfdDevice wfdDevice = new WfdDevice();\n wfdDevice.deviceType = type.getCode();\n wfdDevice.macAddress = null;\n wfdDevice.isAvailableForSession = false;//since init is to be called\n wfdDevice.addressOfAP = null;\n wfdDevice.coupledSinkStatus = 0;\n wfdDevice.preferredConnectivity = 0;\n if (type == WfdEnums.WFDDeviceType.SOURCE) {\n wfdDevice.deviceName = \"Source_device\";\n if (iface != null) {\n int index = iface.indexOf(':', 0);\n if (index > 0) {\n wfdDevice.ipAddress = iface.substring(0, index);\n wfdDevice.rtspPort =\n Integer.parseInt(iface.substring(index + 1, iface.length()));\n if (wfdDevice.ipAddress == null ||\n wfdDevice.rtspPort < 1 ||\n wfdDevice.rtspPort > 65535) {\n Log.e(TAG, \"Invalid RTSP port received or no valid IP\");\n return null;\n }\n }\n }\n } else if (type == WfdEnums.WFDDeviceType.PRIMARY_SINK) {\n wfdDevice.deviceName = \"Sink_device\";\n wfdDevice.rtspPort = 0;\n wfdDevice.ipAddress = null;\n } else {\n wfdDevice.deviceName = \"WFD_device\";\n wfdDevice.rtspPort = 0;\n wfdDevice.ipAddress = null;\n }\n return wfdDevice;\n }", "public UdpPacketSender() {\r\n\t\ttry {\r\n\t\t\tthis.socket = new DatagramSocket();\r\n\t\t} catch (final SocketException e) {\r\n\t\t\tlog.log(Level.SEVERE, e.getMessage(), e);\r\n\t\t}\r\n\t}", "private void newNetworkDialogCreateButton(){\n //Create new networkData object here based on the field info\n LabData.NetworkData newNetworkData = new LabData.NetworkData(\n NetworkAddDialogNameTextfield.getText().toUpperCase(),\n NetworkAddDialogMaskTextfield.getText(),\n NetworkAddDialogGatewayTextfield.getText(),\n (int)NetworkAddDialogMacVLanExtSpinner.getValue(),\n (int)NetworkAddDialogMacVLanSpinner.getValue(),\n NetworkAddDialogIPRangeTextfield.getText(),\n NetworkAddDialogTapRadioButton.isSelected()\n );\n \n // Update the list of labs in the current UI data object\n labDataCurrent.getNetworks().add(newNetworkData);\n \n // Add the network into the UI \n addNetworkPanel(newNetworkData);\n \n // Update the Container Config dialogs to include the new network\n updateNetworkReferenceInContainerConfigDialogs(\"Add\", NetworkAddDialogNameTextfield.getText().toUpperCase(), null);\n }", "@Override\n\tpublic void ConstructNetwork() {\n\t\t\n\t\tAddUnit add_r_t=new AddUnit();\n\t\tUnitIterator ui=new UnitIterator();\n\t\tui.unit=add_r_t;\n\n\t\tnetwork=new UnitList();\n\t\tnetwork.unitList.add(ui);\n\t\tnetwork.unitList.add(new AddUnit());\n\t\t\t\n\t}", "DomainElement createDomainElement();", "WithCreate withNetworkProfile(LabNetworkProfile networkProfile);", "protected void create(boolean stream) throws IOException {\n if(!stream)\n throw new IOException(\"Datagram socket not implemented!\");\n }", "public HwPeripheralFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "public Pdu(){\n\n }", "public static void main(String[] args) {\n\t\t\n//\t String url=\"http://123.124.236.149\";\n//\t\tInteger port=8078;\n\t\t\n//\t\tString url=\"http://192.168.1.199\";\n//\t\tInteger port=8078;\n\t\t\n\t\tString url=\"http://gw2.gosmarthome.cn\";\n\t\tInteger port=8079;\n\t\t\n//\t\tString url=\"http://119.40.24.25\";\n//\t\tInteger port=8079;\n\t\t\n//\t\tString url=\"http://10.41.1.29\"; \n//\t\tInteger port=8086;\n\t\t\n//\t\t10.32.2.57 8078\n//\t\tString url=\"http://10.32.2.232\"; \n//\t\tInteger port=8078;\n\n\t\t\n\t\tString factoryId=\"gptest2015\";\n\t UDPClientDemo client=new UDPClientDemo(url,factoryId,port);\n\t try {\n\t\t\tclient.login();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private User(Element user)\n\t\t{\n\t\t\tthis.userElement = user;\n\t\t\tNodeList endpointsNodeList = user.getElementsByTagName(ENDPOINT_ELEMENT_NAME);\n\t\t\tfor (int i = 0; i < endpointsNodeList.getLength(); i++) {\n\t\t\t\tEndpoint endpoint = new Endpoint((Element) endpointsNodeList.item(i));\n\t\t\t\tendpointsList.add(endpoint);\n\t\t\t}\n\t\t}", "private UConnect(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public Usdl_rupStub(java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault {\r\n this(null, targetEndpoint);\r\n }", "public void create() {\n\t\t\n\t}", "public ServicioUjaPack() {\n }", "public CreChqTrnValVerUVOClient() {\n }", "protected void setupUpnp() {\n try {\n GatewayDiscover discover = new GatewayDiscover();\n Map<InetAddress, GatewayDevice> devices = discover.discover();\n for (Map.Entry<InetAddress, GatewayDevice> entry : devices.entrySet()) {\n GatewayDevice gw = entry.getValue();\n logger.info(\"Found a gateway device: local address = {}, external address = {}\",\n gw.getLocalAddress().getHostAddress(), gw.getExternalIPAddress());\n\n gw.deletePortMapping(config.p2pListenPort(), \"TCP\");\n gw.addPortMapping(config.p2pListenPort(), config.p2pListenPort(), gw.getLocalAddress().getHostAddress(),\n \"TCP\", \"Semux P2P network\");\n }\n } catch (IOException | SAXException | ParserConfigurationException e) {\n logger.info(\"Failed to add port mapping\", e);\n }\n }", "public MainFrame() {\n initComponents();\n ButtonGroup buttonGroup = new ButtonGroup();\n typeTCPRadioBtn.setSelected(true);\n buttonGroup.add(typeTCPRadioBtn);\n buttonGroup.add(typeUDPRadioBtn);\n msg = \"\";\n target = \"\";\n port = 0;\n replyMsg = \"\";\n }", "public UDPSocketServer() throws IOException {\n udpSocket = new DatagramSocket( SERVER_PORT );\n serverSocket = new ServerSocket( PORT_WEB);\n System.out.println(\"Started the UDP socket server at port \" + SERVER_PORT);\n System.out.println(\"Started the WebServer at port \" + PORT_WEB);\n\n }", "public Generateur() {\n }", "UMOImmutableEndpoint createOutboundEndpoint(UMOEndpointBuilder builder, UMOManagementContext managementContext) throws UMOException;", "public Domicilio() {\n }", "EchoedRequestType createEchoedRequestType();", "public void createUtilisateur(UtilisateurBean u) {\n\t}", "private void demote() {\n\t\tProgramGUI.this.dispose();\n\t\tframe = new JFrame(\"Demote a User\");\n\t\tframe.setSize(FRAME_WIDTH, FRAME_HEIGHT);\n\t\tframe.setDefaultCloseOperation(EXIT_ON_CLOSE);\n\t\tframe.setLocationRelativeTo(null);\n\t\tJPanel panel = new JPanel();\n\t\tpanel.setLayout(new GridLayout(1, 2));\n\t\tpanel.add(new JLabel(\"Demote user: \"));\n\t\tuser = new JTextField();\n\t\tpanel.add(user);\n\t\tpanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));\n\t\tframe.add(panel, BorderLayout.NORTH);\n\t\tJPanel button = new JPanel();\n\t\tJButton confirm = new JButton(\"Confirm Demotion\");\n\t\tJButton cancel = new JButton(\"Cancel\");\n\t\tcancel.addActionListener(new ButtonListener());\n\t\tconfirm.addActionListener(new DemoteListener());\n\t\tbutton.add(confirm);\n\t\tbutton.add(cancel);\n\t\tframe.add(button, BorderLayout.SOUTH);\n\t\tframe.setVisible(true);\n\t}", "Communicator createCommunicator();", "ch.crif_online.www.webservices.crifsoapservice.v1_00.AddressDescription addNewControlPersons();", "public DefilementFrame(LocalService<DefilementService> d, UDN u) {\n initComponents();\n this.defilementService = d;\n udn = u.toString();\n }", "public LiveConnectDemo() {\n }", "@Override\n public ApiResponse createUser(SignupDto signupDto){\n var userRole = this.roleDAO.findByName(RoleEnum.USER);\n Set<Role> userRoles = new HashSet<Role>(Collections.singletonList(userRole.get()));\n\n Person newPerson = new Person();\n newPerson.setEmail(signupDto.getUsername());\n newPerson.setFirstName(signupDto.getFirstName());\n newPerson.setLastName(signupDto.getLastName());\n newPerson.setRoles(userRoles);\n\n // Encriptamos la contraseña que nos mando el usuario\n var encryptedPassword = this.passwordEncoder.encode(signupDto.getPassword());\n newPerson.setPassword(encryptedPassword);\n\n this.personDAO.save(newPerson);\n\n return new ApiResponse(true, \"Usuario creado\");\n\n }", "Address createAddress();", "public Pdp(Pdp source) {\n this.instanceId = source.instanceId;\n this.pdpState = source.pdpState;\n this.healthy = source.healthy;\n this.message = source.message;\n this.lastUpdate = source.lastUpdate;\n }", "public Group()\r\n {\r\n endpoints = new ArrayList<>();\r\n name = \"NewGroup\";\r\n }", "public CreateRemoteClassic<Msg, Ref> create();", "DL createDL();", "public UPKClient() {\n connectToServer(BASE_URL);\n }", "private SourceRconPacketFactory() {\n }", "private void initSocket() {\n try {\n rtpSocket = new DatagramSocket(localRtpPort);\n rtcpSocket = new DatagramSocket(localRtcpPort);\n } catch (Exception e) {\n System.out.println(\"RTPSession failed to obtain port\");\n }\n\n rtpSession = new RTPSession(rtpSocket, rtcpSocket);\n rtpSession.RTPSessionRegister(this, null, null);\n\n rtpSession.payloadType(96);//dydnamic rtp payload type for opus\n\n //adding participant, where to send traffic\n Participant p = new Participant(remoteIpAddress, remoteRtpPort, remoteRtcpPort);\n rtpSession.addParticipant(p);\n }", "public Signup() {\n initComponents();\n }", "public Packet(final long unique) {\r\n\t\ttype = EvidenceType.NONE;\r\n\t\tcommand = EvidenceBuilder.LOG_CREATE;\r\n\t\tid = unique;\r\n\t\tdata = null;\r\n\t}", "@Test\n void createUserReturnsNull() {\n Address address = new Address(\"Earth\", \"Belgium\", \"City\", \"Street\", 0);\n User user = new User(\"Mira\", \"Vogelsang\", \"0412345678\", \"maarten@maarten\", \"pass\", address);\n\n assertNull(controller.createUser(user));\n }", "<U extends T> U create(String name, Class<U> type) throws InvalidUserDataException;", "Network_Resource createNetwork_Resource();", "@Override\n @POST\n @Path(\"/networks\")\n public Response createNetwork() throws Exception {\n URI resourceUri = new URI(\"/1\");\n return Response.created(resourceUri).build();\n }", "private static PDP getPDPNewInstance(){\n\n PDPConfig pdpConfig = balana.getPdpConfig();\n return new PDP(pdpConfig);\n }", "EndPoint createEndPoint();", "public PetrinetmodelFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "public DNSUDPConnector() {\r\n\t\t\treset();\r\n\t\t}", "ShipmentGatewayUsps createShipmentGatewayUsps();", "@Test\n\tpublic void testAddNewDroid() {\n\t\tassertEquals(\n\t\t\t\t\"05V: UNASSIGNED\\n03V: UNASSIGNED\\n02E: UNASSIGNED\\n01C: UNASSIGNED\\n04C: UNASSIGNED\\n\",\n\t\t\t\ts1.printDroids());\n\n\t\ts1.addNewDroid();\n\n\t\tassertEquals(\n\t\t\t\t\"05V: UNASSIGNED\\n03V: UNASSIGNED\\n02E: UNASSIGNED\\n01C: UNASSIGNED\\n04C: UNASSIGNED\\n06C: UNASSIGNED\\n\",\n\t\t\t\ts1.printDroids());\n\t}", "public void addHostButton(final String ipAddress) {\n\n\tButton btn = new Button(getApplicationContext());\n\tbtn.setText(ipAddress);\n\n\tbtn.setOnClickListener(new View.OnClickListener() {\n\n\t @Override\n\t public void onClick(View v) {\n\n\t\tstartSending(ipAddress);\n\n\t }\n\t});\n\n\tll.addView(btn);\n\n }", "public Friend createFriendWithAddress(String address);", "public void showCreatePickUPTutorial() {\n ShowcaseView mShowcaseViewCreatePickup = new ShowcaseView.Builder(getActivity())\n .setTarget(new ViewTarget(createpickup))\n .setContentText(getResources().getString(R.string.tutorial_msg_create_pickup))\n .setContentTextPaint(Utility.getTextPaint(getActivity()))\n .singleShot(AppConstants.TUTORIAL_CREATE_PICK_UP_ID)\n .hideOnTouchOutside()\n .setStyle(R.style.CustomShowcaseTheme2)\n .build();\n\n RelativeLayout.LayoutParams lps = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);\n lps.addRule(RelativeLayout.ALIGN_PARENT_TOP);\n lps.addRule(RelativeLayout.ALIGN_PARENT_LEFT);\n int margin = ((Number) (getResources().getDisplayMetrics().density * 12)).intValue();\n lps.setMargins(margin, margin, margin, margin);\n mShowcaseViewCreatePickup.setButtonPosition(lps);\n mShowcaseViewCreatePickup.setButtonText(getResources().getString(R.string.tutorial_got_it));\n }", "public Device(Hub h) {\n uuid = UUID.randomUUID();\n status = Status.NORMAL;\n hub = h;\n }", "private MessageNewUser(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "UMOImmutableEndpoint createResponseEndpoint(UMOEndpointBuilder builder, UMOManagementContext managementContext) throws UMOException;", "UOp createUOp();", "private Bluetooth() {}", "Vaisseau_longueur createVaisseau_longueur();", "public EchoClient(String address) {\n try {\n socket = new DatagramSocket();\n } catch (SocketException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n try {\n inetAddress = InetAddress.getByName((address != null) ? address : \"localhost\");\n } catch (UnknownHostException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "@VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)\n void createUpperTransportPDU(@NonNull final Message message) {\n if (message instanceof AccessMessage) {\n //Access message\n final AccessMessage accessMessage = (AccessMessage) message;\n final byte[] encryptedTransportPDU = encryptUpperTransportPDU(accessMessage);\n MeshLogger.verbose(TAG, \"Encrypted upper transport pdu: \" + MeshParserUtils.bytesToHex(encryptedTransportPDU, false));\n accessMessage.setUpperTransportPdu(encryptedTransportPDU);\n } else {\n final ControlMessage controlMessage = (ControlMessage) message;\n final int opCode = controlMessage.getOpCode();\n final byte[] parameters = controlMessage.getParameters();\n final ByteBuffer accessMessageBuffer;\n if (parameters != null) {\n accessMessageBuffer = ByteBuffer.allocate(PROXY_CONFIG_OPCODE_LENGTH + parameters.length)\n .order(ByteOrder.BIG_ENDIAN)\n .put((byte) opCode)\n .put(parameters);\n } else {\n accessMessageBuffer = ByteBuffer.allocate(PROXY_CONFIG_OPCODE_LENGTH);\n accessMessageBuffer.put((byte) opCode);\n }\n final byte[] accessPdu = accessMessageBuffer.array();\n\n MeshLogger.verbose(TAG, \"Created Transport Control PDU \" + MeshParserUtils.bytesToHex(accessPdu, false));\n controlMessage.setTransportControlPdu(accessPdu);\n }\n }", "public CreateRemoteClassic<Msg, Ref> infraCreate();", "private static DatagramPacket createPacket(byte[] data, SocketAddress remote) {\r\n\t\tDatagramPacket packet = new DatagramPacket(data, data.length, remote);\r\n\t\treturn packet;\r\n\t}", "public void crearAutomovil(){\r\n automovil = new Vehiculo();\r\n automovil.setMarca(\"BMW\");\r\n automovil.setModelo(2010);\r\n automovil.setPlaca(\"TWS435\");\r\n }", "@Override\n public void newASdu(ASdu ObjASDU) {\n\t\t\n \t // Inizializza nome thread\n \t Thread.currentThread().setName(\"Receiver\");\n \t\n \t// Variabili locali\n \tint IntIOA;\n \tboolean BolIOA;\n \tList<WireRecord> ObjWireRecords;\n \tInformationObject[] ObjInformationObjects;\t\n \tMap<String, TypedValue<?>> ObjWireValues;\n \tMap<String, TypedValue<?>> ObjCommonValues;\n \t\n\t // Esegue logging\n \tlogger.info(\"Received ASDU [tcp://\"+this.actualConfiguration.Host+\":\"+this.actualConfiguration.Port+\"]\");\n \t \t\n \t// Acquisisce puntatore agli information object\n \tObjInformationObjects = ObjASDU.getInformationObjects();\n \t\n \t// Se l'ASDU non contiene oggetti genera warning ed esce\n \tif ((ObjInformationObjects==null)||(ObjInformationObjects.length==0)) { \t\t\n \t notifyAlert(Event.WARNING_EVENT,\"Received ASDU cannot be decoded. Reason: empty\");\n return;\n \t}\n\t\t\n \t// Prepara le proprietÓ di testata dell'ASDU condivise da tutti gli information objects\n \tObjCommonValues = new HashMap<>();\t\n \t\n \tObjCommonValues.put(\"id\", TypedValues.newStringValue(this.actualConfiguration.DeviceId));\n \tObjCommonValues.put(\"host\", TypedValues.newStringValue(this.actualConfiguration.Host));\n \tObjCommonValues.put(\"port\", TypedValues.newIntegerValue(this.actualConfiguration.Port));\n \tObjCommonValues.put(\"eventId\", TypedValues.newIntegerValue(Event.DATA_EVENT.id));\n \tObjCommonValues.put(\"event\", TypedValues.newStringValue(Event.DATA_EVENT.description));\n\t\t\n \tObjCommonValues.put(\"type\", TypedValues.newStringValue(ObjASDU.getTypeIdentification().name()));\n \tObjCommonValues.put(\"test\", TypedValues.newStringValue(ObjASDU.isTestFrame()?(\"y\"):(\"n\")));\n \tObjCommonValues.put(\"cot\", TypedValues.newStringValue(ObjASDU.getCauseOfTransmission().name()));\n \tObjCommonValues.put(\"oa\", TypedValues.newIntegerValue(ObjASDU.getOriginatorAddress()));\n \tObjCommonValues.put(\"ca\", TypedValues.newIntegerValue(ObjASDU.getCommonAddress()));\n\t\t\n\t\t// Crea un wirerecord per ciascun oggetto\n\t\tObjWireRecords = new ArrayList<>();\n \t\n\t\t// Ciclo di scansione di tutti gli information object\n\t\tfor (InformationObject ObjInformationObject : ObjInformationObjects) {\n\n\t\t\t// Aggiorna lo IOA condiviso da tutti gli information element\n\t\t\tIntIOA = ObjInformationObject.getInformationObjectAddress();\n\t\t\t\n\t\t\t// Verifica se lo IOA Ŕ matchato da una regola di enrichment\n BolIOA = this.actualConfiguration.MatchingEnrichment.containsKey(IntIOA);\n \n // Se l'IOA non matcha ed Ŕ attivo il filtro sull'enrichment esegue, altrimenti procede \n if (!BolIOA&&this.actualConfiguration.Filtering) {\n \t \n \t// Esegue logging\n \tlogger.debug(\"Discarded ASDU [tcp://\"+this.actualConfiguration.Host+\":\"+this.actualConfiguration.Port+\"/IOA=\"+String.valueOf(IntIOA)+\"]\");\n \n } else {\n\t \t\n\t\t\t\t// Inizializza un nuovo wirerecord con le proprietÓ comuni\n\t\t\t\tObjWireValues = new HashMap<>();\n\t\t\t\tObjWireValues.putAll(ObjCommonValues);\n\t\t\t\t\n\t\t\t\tObjWireValues.put(\"ioa\", TypedValues.newIntegerValue(IntIOA));\n\t\t\t\t\n\t\t\t\t// Se l'IOA matcha con regola di enrichment aggiunge metriche, altrimenti aggiunge quelle di default\n\t\t\t\tif (BolIOA) {\n\t\t\t\t\tObjWireValues.putAll(this.actualConfiguration.MatchingEnrichment.get(IntIOA));\t\n\t\t\t\t} else if (this.actualConfiguration.DefaultEnrichment.size()>0) {\n\t\t\t\t\tObjWireValues.putAll(this.actualConfiguration.DefaultEnrichment);\n\t\t\t\t}\n\t\n\t\t\t\t// Ciclo di scansione di tutti gli information element\n\t\t\t\tfor (InformationElement[] ObjInformationElementSet : ObjInformationObject.getInformationElements()) {\n\t \n\t\t\t\t\t// Decodifica l'information element in base al tipo di ASDU e aggiunge record alla lista\n\t\t\t\t\ttry {\n\t\t\t\t\t Iec104Decoder.decode(ObjASDU.getTypeIdentification(), ObjInformationElementSet, ObjWireValues);\n\t\t\t\t\t ObjWireRecords.add(new WireRecord(ObjWireValues)); \n\t\t\t\t\t} \n\t\t\t\t\tcatch (Exception e) {\t\t\t\t\t\n\t\t\t\t\t\tnotifyAlert(Event.WARNING_EVENT,\"Received ASDU cannot be decoded. Reason: \"+e.getMessage());\n\t\t\t\t\t}\t\t\t\t\n\t }\t\n }\n\t\t}\n\t\t\n\t\t// Se ci sono record da trasmettere procede\n\t\tif (ObjWireRecords.size()>0) {\n\t\t this.wireSupport.emit(ObjWireRecords);\n\t\t}\n }", "public Usdl_rupStub(org.apache.axis2.context.ConfigurationContext configurationContext,\r\n java.lang.String targetEndpoint)\r\n throws org.apache.axis2.AxisFault {\r\n this(configurationContext, targetEndpoint, false);\r\n }", "FuelingStation createFuelingStation();", "private void initEmulator() {\n From from;\n\n from = new From();\n Random rnd = new Random();\n int n = rnd.nextInt(900000);\n\n //TODO poner estos datos en configuraciones\n from.setId(\"DL-USER\" + n);\n from.setName(\"CogDLUser\" + n);\n\n mEmulator = new Emulator(from);\n }", "public void createClient(ClientView clientView, int tcpPort, int udpPort, String tcpIPAddress, String clientID) {\n Client client = new Client(clientView, tcpPort, udpPort, tcpIPAddress, udpIPAddress, clientID);\n }", "private static RdvAdvertisement createRdvAdvertisement(PeerID pid, PeerGroupID gid, String addr) {\r\n\r\n try {\r\n // FIX ME: 10/19/2002 [email protected]. We need to properly set up the service ID. Unfortunately\r\n // this current implementation of the PeerView takes a String as a service name and not its ID.\r\n // Since currently, there is only PeerView per group (all peerviews share the same \"service\", this\r\n // is not a problem, but that will have to be fixed eventually.\r\n\r\n // create a new RdvAdvertisement\r\n RdvAdvertisement rdv = (RdvAdvertisement) AdvertisementFactory.newAdvertisement(RdvAdvertisement.getAdvertisementType());\r\n\r\n rdv.setPeerID(pid);\r\n rdv.setGroupID(gid); \r\n rdv.setName(\"RDV seed\");\r\n\r\n RouteAdvertisement ra = (RouteAdvertisement) \r\n AdvertisementFactory.newAdvertisement(RouteAdvertisement.getAdvertisementType());\r\n ra.setDestPeerID(pid);\r\n AccessPointAdvertisement ap = (AccessPointAdvertisement) \r\n AdvertisementFactory.newAdvertisement(AccessPointAdvertisement.getAdvertisementType());\r\n ap.addEndpointAddress(addr);\r\n ra.setDest(ap);\r\n // Insert it into the RdvAdvertisement.\r\n rdv.setRouteAdv(ra);\r\n\r\n return rdv;\r\n } catch (Exception ez) {\r\n if (LOG.isEnabledFor(Priority.WARN)) {\r\n LOG.warn(\"Cannot create Local RdvAdvertisement: \", ez);\r\n }\r\n return null;\r\n }\r\n }", "ch.crif_online.www.webservices.crifsoapservice.v1_00.ControlPerson addNewControlPersonsExt();", "DeviceActuator createDeviceActuator();", "private void createDevice(String host, int port, String name) {\n ThingUID uid = new ThingUID(THING_TYPE_DEVICE, name);\n\n if (uid != null) {\n Map<String, Object> properties = new HashMap<>(1);\n properties.put(\"hostname\", host);\n properties.put(\"port\", port);\n properties.put(\"name\", name);\n DiscoveryResult result = DiscoveryResultBuilder.create(uid).withProperties(properties)\n .withLabel(\"Kinect Device\").build();\n thingDiscovered(result);\n }\n }", "@Override\n default UserpostPrx ice_datagram()\n {\n return (UserpostPrx)_ice_datagram();\n }" ]
[ "0.58957815", "0.57204866", "0.55944467", "0.5585818", "0.5500188", "0.54953784", "0.5358484", "0.5327305", "0.523669", "0.5218695", "0.518186", "0.51683307", "0.5143919", "0.5135067", "0.5125136", "0.51148444", "0.51035833", "0.5090125", "0.50848883", "0.50686747", "0.5038565", "0.5019042", "0.50056016", "0.500393", "0.4995512", "0.49889192", "0.49744478", "0.49736518", "0.49687332", "0.4964958", "0.49411425", "0.49221626", "0.49113294", "0.490759", "0.49030983", "0.4875218", "0.48696697", "0.4863637", "0.4853845", "0.48450208", "0.48447528", "0.4843098", "0.482611", "0.48186812", "0.48153967", "0.4814831", "0.4813568", "0.4806029", "0.48020768", "0.47990054", "0.47817096", "0.47765145", "0.47736245", "0.4768497", "0.4767295", "0.4766086", "0.4764501", "0.47637764", "0.47599745", "0.47592944", "0.47502983", "0.47497007", "0.47346988", "0.47346345", "0.4734129", "0.4732467", "0.47270796", "0.4726815", "0.47228935", "0.4721262", "0.47140884", "0.4713531", "0.4712868", "0.47079158", "0.4703062", "0.47013032", "0.47000894", "0.46943152", "0.46893865", "0.46882308", "0.46874917", "0.4687025", "0.46867988", "0.46827456", "0.46822253", "0.46750975", "0.46732932", "0.46721444", "0.46685228", "0.4663161", "0.46625587", "0.46611524", "0.4660244", "0.46526095", "0.4648578", "0.4643253", "0.46395448", "0.46393928", "0.4637608", "0.4636028" ]
0.6603273
0
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor. //GENBEGIN:initComponents
private void initComponents() { udpServer = new UdpServer(); jLabel1 = new javax.swing.JLabel(); portField = new javax.swing.JFormattedTextField(0); jLabel2 = new javax.swing.JLabel(); groupField = new javax.swing.JTextField(); jPanel1 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); incomingArea = new javax.swing.JTextArea(); jLabel3 = new javax.swing.JLabel(); stateLabel = new javax.swing.JLabel(); startStopButton = new javax.swing.JButton(); jButton1 = new javax.swing.JButton(); receiveIndicator = new IndicatorLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Udp Server Example"); jLabel1.setText("Port:"); portField.setColumns(12); portField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { portFieldActionPerformed(evt); } }); portField.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { portFieldFocusLost(evt); } }); jLabel2.setText("Multicast Group:"); groupField.setColumns(12); groupField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { groupFieldActionPerformed(evt); } }); groupField.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { groupFieldFocusLost(evt); } }); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Incoming")); incomingArea.setColumns(20); incomingArea.setLineWrap(true); incomingArea.setRows(5); incomingArea.setWrapStyleWord(true); jScrollPane1.setViewportView(incomingArea); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 443, Short.MAX_VALUE) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE) .addContainerGap()) ); jLabel3.setText("State:"); stateLabel.setText("Unknown"); startStopButton.setText("Start/Stop"); startStopButton.setEnabled(false); startStopButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { startStopButtonActionPerformed(evt); } }); jButton1.setText("Stress"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); receiveIndicator.setText("RECV"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(portField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(stateLabel)) .addGroup(layout.createSequentialGroup() .addComponent(groupField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(startStopButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addGap(18, 18, 18) .addComponent(receiveIndicator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(4, 4, 4))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(portField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3) .addComponent(stateLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(groupField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(startStopButton) .addComponent(jButton1))) .addComponent(receiveIndicator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public Form() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public form() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public FormPemilihan() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\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 .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public FormCompra() {\n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\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 .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "public FormListRemarking() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public SettingsForm() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\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 .addGap(0, 630, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 431, Short.MAX_VALUE)\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n jLabel10 = new javax.swing.JLabel();\n jLabel11 = new javax.swing.JLabel();\n jLabel12 = new javax.swing.JLabel();\n jLabel13 = new javax.swing.JLabel();\n jLabel14 = new javax.swing.JLabel();\n jLabel15 = new javax.swing.JLabel();\n jLabel16 = new javax.swing.JLabel();\n jLabel17 = new javax.swing.JLabel();\n jLabel18 = new javax.swing.JLabel();\n jLabel19 = new javax.swing.JLabel();\n jLabel20 = new javax.swing.JLabel();\n jLabel21 = new javax.swing.JLabel();\n jLabel22 = new javax.swing.JLabel();\n jLabel23 = new javax.swing.JLabel();\n jLabel24 = new javax.swing.JLabel();\n jLabel25 = new javax.swing.JLabel();\n jLabel26 = new javax.swing.JLabel();\n jLabel27 = new javax.swing.JLabel();\n jLabel28 = new javax.swing.JLabel();\n jLabel29 = new javax.swing.JLabel();\n axTextField = new javax.swing.JTextField();\n bxTextField = new javax.swing.JTextField();\n cxTextField = new javax.swing.JTextField();\n dxTextField = new javax.swing.JTextField();\n siTextField = new javax.swing.JTextField();\n diTextField = new javax.swing.JTextField();\n spTextField = new javax.swing.JTextField();\n bpTextField = new javax.swing.JTextField();\n pcTextField = new javax.swing.JTextField();\n ir1TextField = new javax.swing.JTextField();\n ir2TextField = new javax.swing.JTextField();\n marTextField = new javax.swing.JTextField();\n ivtpTextField = new javax.swing.JTextField();\n mbrTextField = new javax.swing.JTextField();\n ir3TextField = new javax.swing.JTextField();\n ir4TextField = new javax.swing.JTextField();\n xTextField = new javax.swing.JTextField();\n yTextField = new javax.swing.JTextField();\n aTextField = new javax.swing.JTextField();\n bTextField = new javax.swing.JTextField();\n pswTextField = new javax.swing.JTextField();\n imrTextField = new javax.swing.JTextField();\n sbusTextField = new javax.swing.JTextField();\n dbusTextField = new javax.swing.JTextField();\n systemABUSTextField = new javax.swing.JTextField();\n systemDBUSTextField = new javax.swing.JTextField();\n jSeparator1 = new javax.swing.JSeparator();\n jSeparator2 = new javax.swing.JSeparator();\n jSeparator3 = new javax.swing.JSeparator();\n jSeparator4 = new javax.swing.JSeparator();\n okButton = new javax.swing.JButton();\n jLabel30 = new javax.swing.JLabel();\n jLabel31 = new javax.swing.JLabel();\n\n setTitle(\"RegisterDialog\");\n setFocusable(false);\n setMinimumSize(new java.awt.Dimension(688, 285));\n setName(\"\"); // NOI18N\n\n jLabel1.setText(\"AX\");\n\n jLabel2.setText(\"BX\");\n\n jLabel3.setText(\"CX\");\n\n jLabel4.setText(\"DX\");\n\n jLabel5.setText(\"SI\");\n\n jLabel6.setText(\"DI\");\n\n jLabel7.setText(\"SP\");\n\n jLabel8.setText(\"BP\");\n\n jLabel9.setText(\"PC\");\n\n jLabel10.setText(\"IR1\");\n\n jLabel11.setText(\"IR2\");\n\n jLabel12.setText(\"MAR\");\n\n jLabel13.setText(\"MBR\");\n\n jLabel14.setText(\"IVTP\");\n\n jLabel15.setText(\"IR3\");\n\n jLabel16.setText(\"IR4\");\n\n jLabel17.setText(\"X\");\n\n jLabel18.setText(\"Y\");\n\n jLabel19.setText(\"A\");\n\n jLabel20.setText(\"B\");\n\n jLabel21.setText(\"PSW\");\n\n jLabel22.setText(\"IMR\");\n\n jLabel23.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jLabel23.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);\n jLabel23.setText(\"CPU\");\n\n jLabel24.setText(\"sBUS\");\n\n jLabel25.setText(\"dBUS\");\n\n jLabel26.setText(\"ABUS\");\n\n jLabel27.setText(\"DBUS\");\n\n jLabel28.setText(\"bin.\");\n\n jLabel29.setText(\"bin.\");\n\n axTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n axTextField.setText(\"0000\");\n axTextField.setFocusable(false);\n axTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n axTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n bxTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n bxTextField.setText(\"0000\");\n bxTextField.setFocusable(false);\n bxTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n bxTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n cxTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n cxTextField.setText(\"0000\");\n cxTextField.setFocusable(false);\n cxTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n cxTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n dxTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n dxTextField.setText(\"0000\");\n dxTextField.setFocusable(false);\n dxTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n dxTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n siTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n siTextField.setText(\"0000\");\n siTextField.setFocusable(false);\n siTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n siTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n diTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n diTextField.setText(\"0000\");\n diTextField.setFocusable(false);\n diTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n diTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n spTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n spTextField.setText(\"0000\");\n spTextField.setFocusable(false);\n spTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n spTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n bpTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n bpTextField.setText(\"0000\");\n bpTextField.setFocusable(false);\n bpTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n bpTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n pcTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n pcTextField.setText(\"0000\");\n pcTextField.setFocusable(false);\n pcTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n pcTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n ir1TextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n ir1TextField.setText(\"0000\");\n ir1TextField.setFocusable(false);\n ir1TextField.setMaximumSize(new java.awt.Dimension(30, 20));\n ir1TextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n ir2TextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n ir2TextField.setText(\"0000\");\n ir2TextField.setFocusable(false);\n ir2TextField.setMaximumSize(new java.awt.Dimension(30, 20));\n ir2TextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n marTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n marTextField.setText(\"0000\");\n marTextField.setFocusable(false);\n marTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n marTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n ivtpTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n ivtpTextField.setText(\"0000\");\n ivtpTextField.setFocusable(false);\n ivtpTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n ivtpTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n mbrTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n mbrTextField.setText(\"0000\");\n mbrTextField.setFocusable(false);\n mbrTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n mbrTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n ir3TextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n ir3TextField.setText(\"0000\");\n ir3TextField.setFocusable(false);\n ir3TextField.setMaximumSize(new java.awt.Dimension(30, 20));\n ir3TextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n ir4TextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n ir4TextField.setText(\"0000\");\n ir4TextField.setFocusable(false);\n ir4TextField.setMaximumSize(new java.awt.Dimension(30, 20));\n ir4TextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n xTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n xTextField.setText(\"0000\");\n xTextField.setFocusable(false);\n xTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n xTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n yTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n yTextField.setText(\"0000\");\n yTextField.setFocusable(false);\n yTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n yTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n aTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n aTextField.setText(\"0000\");\n aTextField.setFocusable(false);\n aTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n aTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n bTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n bTextField.setText(\"0000\");\n bTextField.setFocusable(false);\n bTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n bTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n pswTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n pswTextField.setText(\"0000000000000000\");\n pswTextField.setFocusable(false);\n pswTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n pswTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n imrTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n imrTextField.setText(\"0000\");\n imrTextField.setFocusable(false);\n imrTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n imrTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n sbusTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n sbusTextField.setText(\"0000\");\n sbusTextField.setFocusable(false);\n sbusTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n sbusTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n dbusTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n dbusTextField.setText(\"0000\");\n dbusTextField.setFocusable(false);\n dbusTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n dbusTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n systemABUSTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n systemABUSTextField.setText(\"0000\");\n systemABUSTextField.setFocusable(false);\n systemABUSTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n systemABUSTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n systemDBUSTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n systemDBUSTextField.setText(\"0000\");\n systemDBUSTextField.setFocusable(false);\n systemDBUSTextField.setMaximumSize(new java.awt.Dimension(30, 20));\n systemDBUSTextField.setMinimumSize(new java.awt.Dimension(30, 20));\n\n jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);\n\n okButton.setText(\"OK\");\n okButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n okButtonActionPerformed(evt);\n }\n });\n\n jLabel30.setFont(new java.awt.Font(\"Tahoma\", 0, 14));\n jLabel30.setText(\"interne \\nmagistrale\");\n\n jLabel31.setFont(new java.awt.Font(\"Tahoma\", 0, 14));\n jLabel31.setText(\"sistemske magistrale\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel4)\n .addGap(18, 18, 18)\n .addComponent(dxTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addGap(18, 18, 18)\n .addComponent(cxTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jLabel1)\n .addComponent(jLabel2))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(bxTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)\n .addComponent(axTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE))))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel7)\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel8))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(siTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)\n .addComponent(diTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)\n .addComponent(spTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)\n .addComponent(bpTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel14)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(ivtpTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel12)\n .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(jLabel13))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(pcTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)\n .addComponent(mbrTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)\n .addComponent(marTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)))))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addComponent(jLabel22)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(imrTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addComponent(jLabel21)\n .addGap(18, 18, 18)\n .addComponent(pswTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel29))))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel16)\n .addComponent(jLabel15)\n .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(ir1TextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)\n .addComponent(ir2TextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)\n .addComponent(ir3TextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)\n .addComponent(ir4TextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 8, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel19)\n .addComponent(jLabel18, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 7, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel17, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 8, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(xTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)\n .addComponent(yTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)\n .addComponent(aTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)\n .addComponent(bTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)))\n .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel25, javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jLabel30)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)\n .addComponent(jLabel24)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(dbusTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)\n .addComponent(sbusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addComponent(jSeparator3, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel27, javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jLabel31)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel26)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(systemDBUSTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)\n .addComponent(systemABUSTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addComponent(jSeparator4)))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(okButton, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(46, 46, 46)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(pcTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel9))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel12)\n .addComponent(marTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(mbrTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(siTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(diTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(spTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel13))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(bpTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel14)\n .addComponent(ivtpTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(axTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(bxTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel6))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(cxTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel7))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(dxTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel8))))\n .addGap(33, 33, 33)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel21)\n .addComponent(pswTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel28))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel22)\n .addComponent(imrTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addComponent(jLabel29)))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel24)\n .addComponent(sbusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel25)\n .addComponent(dbusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addGap(13, 13, 13)\n .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel26)\n .addComponent(systemABUSTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel27)\n .addComponent(systemDBUSTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addComponent(jLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(26, 26, 26)\n .addComponent(okButton))\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel17)\n .addComponent(xTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel18)\n .addComponent(yTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel19)\n .addComponent(aTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel20)\n .addComponent(bTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel10)\n .addComponent(ir1TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel11)\n .addComponent(ir2TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel15)\n .addComponent(ir3TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel16)\n .addComponent(ir4TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(71, 71, 71)\n .addComponent(jLabel23))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\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 .addGap(0, 760, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 446, Short.MAX_VALUE)\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 731, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 638, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jSeparator1 = new javax.swing.JSeparator();\n jLabel4 = new javax.swing.JLabel();\n jTextField1 = new javax.swing.JTextField();\n jButton2 = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jButton1 = new javax.swing.JButton();\n jLabel5 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n jLabel10 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel14 = new javax.swing.JLabel();\n jLabel15 = new javax.swing.JLabel();\n jLabel12 = new javax.swing.JLabel();\n jLabel13 = new javax.swing.JLabel();\n jTextField3 = new javax.swing.JTextField();\n jTextField2 = new javax.swing.JTextField();\n jTextField4 = new javax.swing.JTextField();\n jTextField5 = new javax.swing.JTextField();\n jLabel27 = new javax.swing.JLabel();\n jLabel26 = new javax.swing.JLabel();\n jLabel25 = new javax.swing.JLabel();\n jLabel24 = new javax.swing.JLabel();\n jButton3 = new javax.swing.JButton();\n jSeparator2 = new javax.swing.JSeparator();\n jLabel16 = new javax.swing.JLabel();\n jLabel17 = new javax.swing.JLabel();\n jTextField7 = new javax.swing.JTextField();\n jLabel18 = new javax.swing.JLabel();\n jPasswordField1 = new javax.swing.JPasswordField();\n jPasswordField2 = new javax.swing.JPasswordField();\n jButton4 = new javax.swing.JButton();\n jLabel11 = new javax.swing.JLabel();\n jButton5 = new javax.swing.JButton();\n jLabel19 = new javax.swing.JLabel();\n jLabel20 = new javax.swing.JLabel();\n jLabel21 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Settings\");\n setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowOpened(java.awt.event.WindowEvent evt) {\n formWindowOpened(evt);\n }\n });\n\n jSeparator1.setForeground(new java.awt.Color(102, 0, 153));\n\n jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Tux TV 1280-1024.jpg\"))); // NOI18N\n\n jTextField1.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n\n jButton2.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jButton2.setForeground(new java.awt.Color(51, 51, 255));\n jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Blue-young-icon.png\"))); // NOI18N\n jButton2.setText(\"Search\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jLabel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 18));\n jLabel3.setForeground(new java.awt.Color(51, 51, 255));\n jLabel3.setText(\"<html>Logged In <font color=green>●\");\n\n jLabel2.setBackground(new java.awt.Color(204, 204, 255));\n jLabel2.setFont(new java.awt.Font(\"Arial\", 1, 18));\n jLabel2.setOpaque(true);\n\n jButton1.setBackground(new java.awt.Color(255, 153, 153));\n jButton1.setFont(new java.awt.Font(\"Arial\", 1, 14));\n jButton1.setForeground(new java.awt.Color(255, 0, 0));\n jButton1.setText(\"Log Out\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jLabel5.setFont(new java.awt.Font(\"Arial\", 0, 18));\n jLabel5.setForeground(new java.awt.Color(153, 0, 153));\n jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel5.setText(\"<html><u>Home\");\n jLabel5.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jLabel5MouseClicked(evt);\n }\n });\n\n jLabel7.setFont(new java.awt.Font(\"Arial\", 0, 18));\n jLabel7.setForeground(new java.awt.Color(153, 0, 153));\n jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel7.setText(\"<html><u>Friends\");\n jLabel7.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jLabel7MouseClicked(evt);\n }\n });\n\n jLabel8.setFont(new java.awt.Font(\"Arial\", 0, 18));\n jLabel8.setForeground(new java.awt.Color(153, 0, 153));\n jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel8.setText(\"<html><u>Messages\");\n jLabel8.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jLabel8MouseClicked(evt);\n }\n });\n\n jLabel9.setFont(new java.awt.Font(\"Arial\", 0, 18));\n jLabel9.setForeground(new java.awt.Color(153, 0, 153));\n jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel9.setText(\"<html><u>Notifications\");\n jLabel9.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jLabel9MouseClicked(evt);\n }\n });\n\n jLabel10.setFont(new java.awt.Font(\"Arial\", 0, 18));\n jLabel10.setForeground(new java.awt.Color(153, 0, 153));\n jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel10.setText(\"<html><u>Profile\");\n jLabel10.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jLabel10MouseClicked(evt);\n }\n });\n\n jLabel6.setFont(new java.awt.Font(\"Arial\", 0, 18));\n jLabel6.setForeground(new java.awt.Color(0, 0, 255));\n jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel6.setText(\"<html><u>Settings\");\n\n jLabel14.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jLabel14.setText(\"E-Mail:\");\n\n jLabel15.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jLabel15.setText(\"Phone Number:\");\n\n jLabel12.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jLabel12.setText(\"Name:\");\n\n jLabel13.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jLabel13.setText(\"UserName:\");\n\n jTextField3.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jTextField3.setForeground(new java.awt.Color(102, 0, 102));\n jTextField3.setEnabled(false);\n\n jTextField2.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jTextField2.setForeground(new java.awt.Color(102, 0, 102));\n jTextField2.setEnabled(false);\n\n jTextField4.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jTextField4.setForeground(new java.awt.Color(102, 0, 102));\n jTextField4.setEnabled(false);\n\n jTextField5.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jTextField5.setForeground(new java.awt.Color(102, 0, 102));\n jTextField5.setEnabled(false);\n\n jLabel27.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jLabel27.setForeground(new java.awt.Color(0, 0, 255));\n jLabel27.setText(\"<html><u>Edit\");\n jLabel27.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jLabel27MouseClicked(evt);\n }\n });\n\n jLabel26.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jLabel26.setForeground(new java.awt.Color(0, 0, 255));\n jLabel26.setText(\"<html><u>Edit\");\n jLabel26.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jLabel26MouseClicked(evt);\n }\n });\n\n jLabel25.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jLabel25.setForeground(new java.awt.Color(0, 0, 255));\n jLabel25.setText(\"<html><u>Edit\");\n jLabel25.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jLabel25MouseClicked(evt);\n }\n });\n\n jLabel24.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jLabel24.setForeground(new java.awt.Color(0, 0, 255));\n jLabel24.setText(\"<html><u>Edit\");\n jLabel24.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jLabel24MouseClicked(evt);\n }\n });\n\n jButton3.setFont(new java.awt.Font(\"Tahoma\", 2, 18)); // NOI18N\n jButton3.setForeground(new java.awt.Color(0, 153, 51));\n jButton3.setText(\"Update Info\");\n jButton3.setEnabled(false);\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n\n jSeparator2.setForeground(jSeparator1.getForeground());\n\n jLabel16.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jLabel16.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n jLabel16.setText(\"Old Password:\");\n\n jLabel17.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n jLabel17.setText(\"New Password:\");\n\n jTextField7.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jTextField7.setForeground(new java.awt.Color(102, 0, 102));\n\n jLabel18.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jLabel18.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n jLabel18.setText(\"ReType New Password:\");\n\n jButton4.setFont(new java.awt.Font(\"Tahoma\", 3, 18));\n jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/3.png\"))); // NOI18N\n jButton4.setText(\"Change\");\n jButton4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButton4.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton4ActionPerformed(evt);\n }\n });\n\n jLabel11.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jLabel11.setForeground(new java.awt.Color(0, 0, 255));\n jLabel11.setText(\"<html><u>Wanna See Your Security Code?\");\n jLabel11.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jLabel11MouseClicked(evt);\n }\n });\n\n jButton5.setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n jButton5.setForeground(new java.awt.Color(255, 51, 51));\n jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagesFCG7ZZJL.jpg\"))); // NOI18N\n jButton5.setText(\"Delete My Account\");\n jButton5.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButton5.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton5ActionPerformed(evt);\n }\n });\n\n jLabel19.setFont(new java.awt.Font(\"Tahoma\", 0, 1));\n\n jLabel20.setFont(new java.awt.Font(\"Tahoma\", 0, 1));\n\n jLabel21.setFont(new java.awt.Font(\"Tahoma\", 0, 1));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 636, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 437, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 312, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(78, 78, 78)\n .addComponent(jLabel19)\n .addGap(40, 40, 40)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jLabel9)\n .addGap(18, 18, 18)\n .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE))))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(136, 136, 136)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel12)\n .addComponent(jLabel13))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jTextField3)\n .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE)))\n .addGroup(layout.createSequentialGroup()\n .addGap(103, 103, 103)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel14)\n .addComponent(jLabel15))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jTextField5)\n .addComponent(jTextField4, javax.swing.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel27)\n .addComponent(jLabel26)\n .addComponent(jLabel25))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton5))\n .addComponent(jLabel24))\n .addGap(2, 2, 2))\n .addGroup(layout.createSequentialGroup()\n .addGap(264, 264, 264)\n .addComponent(jButton3))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 636, Short.MAX_VALUE)))\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(25, 25, 25)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addComponent(jLabel16, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jPasswordField2)\n .addComponent(jPasswordField1)\n .addComponent(jTextField7, javax.swing.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addGap(100, 100, 100)\n .addComponent(jLabel20)\n .addGap(73, 73, 73))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel21)\n .addGap(21, 21, 21))))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(199, Short.MAX_VALUE)\n .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 295, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(162, 162, 162))\n .addGroup(layout.createSequentialGroup()\n .addGap(271, 271, 271)\n .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(261, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addGap(13, 13, 13)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel19)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE)\n .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 29, Short.MAX_VALUE))\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 5, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(27, 27, 27)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel12)\n .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel24))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel13)\n .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel25))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel26)\n .addComponent(jLabel14))\n .addGap(12, 12, 12)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel27)\n .addComponent(jLabel15))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(51, 51, 51)\n .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(33, 33, 33)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel16)\n .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel20))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel17)\n .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel18)\n .addComponent(jPasswordField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jLabel11))\n .addGroup(layout.createSequentialGroup()\n .addGap(59, 59, 59)\n .addComponent(jLabel21)))\n .addContainerGap(47, Short.MAX_VALUE))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 731, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 475, Short.MAX_VALUE)\n );\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public quanlixe_form() {\n initComponents();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public Magasin() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public soal2GUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public PatientUI() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\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 .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public Soru1() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public ValidFrequencyForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setLayout(new java.awt.BorderLayout());\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setLayout(new java.awt.BorderLayout());\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setLayout(new java.awt.BorderLayout());\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n jLabel10 = new javax.swing.JLabel();\n jLabel11 = new javax.swing.JLabel();\n jLabel12 = new javax.swing.JLabel();\n jLabel13 = new javax.swing.JLabel();\n jLabel14 = new javax.swing.JLabel();\n jLabel15 = new javax.swing.JLabel();\n jLabel16 = new javax.swing.JLabel();\n jLabel17 = new javax.swing.JLabel();\n jTextField1 = new javax.swing.JTextField();\n jTextField2 = new javax.swing.JTextField();\n jTextField5 = new javax.swing.JTextField();\n jTextField6 = new javax.swing.JTextField();\n jTextField8 = new javax.swing.JTextField();\n jTextField9 = new javax.swing.JTextField();\n jTextField10 = new javax.swing.JTextField();\n jTextField11 = new javax.swing.JTextField();\n jTextField12 = new javax.swing.JTextField();\n jTextField13 = new javax.swing.JTextField();\n jTextField14 = new javax.swing.JTextField();\n jTextField16 = new javax.swing.JTextField();\n jButton2 = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTextArea1 = new javax.swing.JTextArea();\n jButton1 = new javax.swing.JButton();\n jLabel18 = new javax.swing.JLabel();\n jButton3 = new javax.swing.JButton();\n jLabel19 = new javax.swing.JLabel();\n jLabel20 = new javax.swing.JLabel();\n jFormattedTextField1 = new javax.swing.JFormattedTextField();\n jFormattedTextField2 = new javax.swing.JFormattedTextField();\n jFormattedTextField3 = new javax.swing.JFormattedTextField();\n jLabel21 = new javax.swing.JLabel();\n jLabel22 = new javax.swing.JLabel();\n jButton4 = new javax.swing.JButton();\n jFormattedTextField4 = new javax.swing.JFormattedTextField();\n jLabel23 = new javax.swing.JLabel();\n jLabel24 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Personal Profile\");\n\n jLabel1.setFont(new java.awt.Font(\"Lucida Grande\", 1, 24)); // NOI18N\n jLabel1.setText(\"Personal Information\");\n\n jLabel2.setText(\"Name\");\n\n jLabel3.setText(\"Address\");\n\n jLabel4.setText(\"Date of Birth\");\n jLabel4.setToolTipText(\"\");\n\n jLabel5.setText(\"Contact\");\n\n jLabel6.setText(\"Fax Number\");\n\n jLabel7.setText(\"Email\");\n\n jLabel8.setText(\"SSN\");\n\n jLabel9.setText(\"Medical Record No\");\n\n jLabel10.setText(\"Health Plan No\");\n\n jLabel11.setText(\"Bank Acc No\");\n\n jLabel12.setText(\"License No\");\n\n jLabel13.setText(\"Vehicle Identifiers\");\n\n jLabel14.setText(\"Device Identifiers\");\n jLabel14.setToolTipText(\"\");\n\n jLabel15.setText(\"LinkedIn\");\n\n jLabel16.setText(\"IP Address\");\n\n jLabel17.setText(\"Identifier\");\n\n jButton2.setText(\"Submit\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jTextArea1.setColumns(20);\n jTextArea1.setRows(5);\n jTextArea1.setBounds(new java.awt.Rectangle(0, 0, 240, 120));\n jScrollPane1.setViewportView(jTextArea1);\n\n jButton1.setText(\"Clear\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jLabel18.setText(\"Image\");\n\n jButton3.setText(\"Upload\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n\n jFormattedTextField1.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.DateFormatter(java.text.DateFormat.getDateInstance(java.text.DateFormat.SHORT))));\n\n try {\n jFormattedTextField2.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter(\"###-###-####\")));\n } catch (java.text.ParseException ex) {\n ex.printStackTrace();\n }\n\n try {\n jFormattedTextField3.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter(\"###-##-####\")));\n } catch (java.text.ParseException ex) {\n ex.printStackTrace();\n }\n\n jLabel22.setText(\"Biometrics\");\n\n jButton4.setText(\"Upload\");\n jButton4.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton4ActionPerformed(evt);\n }\n });\n\n try {\n jFormattedTextField4.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter(\"###.###.###.###\")));\n } catch (java.text.ParseException ex) {\n ex.printStackTrace();\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 .addGroup(layout.createSequentialGroup()\n .addGap(29, 29, 29)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel21)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel22))\n .addComponent(jLabel18)\n .addComponent(jLabel3)\n .addComponent(jLabel2)\n .addComponent(jLabel4)\n .addComponent(jLabel5)\n .addComponent(jLabel6)\n .addComponent(jLabel7)\n .addComponent(jLabel8)\n .addComponent(jLabel9)\n .addComponent(jLabel10)\n .addComponent(jLabel11)\n .addComponent(jLabel12)\n .addComponent(jLabel13)\n .addComponent(jLabel14)\n .addComponent(jLabel15)\n .addComponent(jLabel16)\n .addComponent(jLabel17))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jTextField1)\n .addComponent(jTextField2)\n .addComponent(jFormattedTextField1)\n .addComponent(jFormattedTextField2)\n .addComponent(jTextField5)\n .addComponent(jTextField6)\n .addComponent(jFormattedTextField3)\n .addComponent(jTextField8)\n .addComponent(jTextField9)\n .addComponent(jTextField10)\n .addComponent(jTextField11)\n .addComponent(jTextField12)\n .addComponent(jTextField13)\n .addComponent(jTextField14)\n .addComponent(jFormattedTextField4, javax.swing.GroupLayout.DEFAULT_SIZE, 367, Short.MAX_VALUE)\n .addComponent(jTextField16))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 440, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabel19, javax.swing.GroupLayout.DEFAULT_SIZE, 209, Short.MAX_VALUE)\n .addComponent(jLabel23, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(24, 24, 24))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jButton3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel20))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jButton4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel24)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(146, 146, 146)\n .addComponent(jButton2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jButton1))\n .addGroup(layout.createSequentialGroup()\n .addGap(423, 423, 423)\n .addComponent(jLabel1)))\n .addContainerGap(566, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(19, 19, 19)\n .addComponent(jLabel1)\n .addGap(27, 27, 27)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel2)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel5)\n .addComponent(jFormattedTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel6)\n .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel7)\n .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel8)\n .addComponent(jFormattedTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel9)\n .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel10)\n .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel11)\n .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel12)\n .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel13)\n .addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel14)\n .addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel15)\n .addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel16)\n .addComponent(jFormattedTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel17)\n .addComponent(jTextField16, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addComponent(jScrollPane1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel18)\n .addComponent(jButton3)\n .addComponent(jLabel20))\n .addGap(7, 7, 7)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel22)\n .addComponent(jButton4)\n .addComponent(jLabel24))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel21)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton2)\n .addComponent(jButton1))\n .addContainerGap(18, Short.MAX_VALUE))\n );\n\n pack();\n }", "public HW3() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public PatientRegForm() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n formKeyPressed(evt);\n }\n public void keyReleased(java.awt.event.KeyEvent evt) {\n formKeyReleased(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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n\n pack();\n }", "public p0() {\n initComponents();\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\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 .addGap(0, 394, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 278, Short.MAX_VALUE)\n );\n\n pack();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public EnterDetailsGUI() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\r\n private void initComponents() {\r\n\r\n jTextField1 = new javax.swing.JTextField();\r\n jButton1 = new javax.swing.JButton();\r\n jTextField2 = new javax.swing.JTextField();\r\n jLabel1 = new javax.swing.JLabel();\r\n jLabel2 = new javax.swing.JLabel();\r\n jLabel3 = new javax.swing.JLabel();\r\n jLabel4 = new javax.swing.JLabel();\r\n jLabel5 = new javax.swing.JLabel();\r\n jLabel6 = new javax.swing.JLabel();\r\n jLabel7 = new javax.swing.JLabel();\r\n jTextField3 = new javax.swing.JTextField();\r\n jTextField4 = new javax.swing.JTextField();\r\n jTextField5 = new javax.swing.JTextField();\r\n jTextField6 = new javax.swing.JTextField();\r\n jTextField7 = new javax.swing.JTextField();\r\n jTextField8 = new javax.swing.JTextField();\r\n jButton2 = new javax.swing.JButton();\r\n jButton3 = new javax.swing.JButton();\r\n jButton4 = new javax.swing.JButton();\r\n lbhora = new javax.swing.JLabel();\r\n jButton5 = new javax.swing.JButton();\r\n jLabel8 = new javax.swing.JLabel();\r\n jButton6 = new javax.swing.JButton();\r\n jLabel9 = new javax.swing.JLabel();\r\n jMenuBar1 = new javax.swing.JMenuBar();\r\n jMenu1 = new javax.swing.JMenu();\r\n jMenuItem4 = new javax.swing.JMenuItem();\r\n jMenuItem5 = new javax.swing.JMenuItem();\r\n jMenu2 = new javax.swing.JMenu();\r\n jMenuItem9 = new javax.swing.JMenuItem();\r\n jMenuItem10 = new javax.swing.JMenuItem();\r\n jMenuItem11 = new javax.swing.JMenuItem();\r\n jMenuItem13 = new javax.swing.JMenuItem();\r\n jMenuItem14 = new javax.swing.JMenuItem();\r\n jMenu3 = new javax.swing.JMenu();\r\n jMenuItem15 = new javax.swing.JMenuItem();\r\n jMenuItem16 = new javax.swing.JMenuItem();\r\n jMenuItem17 = new javax.swing.JMenuItem();\r\n jMenu4 = new javax.swing.JMenu();\r\n\r\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\r\n getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\r\n\r\n jTextField1.setHorizontalAlignment(javax.swing.JTextField.CENTER);\r\n jTextField1.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jTextField1ActionPerformed(evt);\r\n }\r\n });\r\n getContentPane().add(jTextField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 12, 490, 30));\r\n\r\n jButton1.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\r\n jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Imagenes/search-icon-60x60.png\"))); // NOI18N\r\n jButton1.setBorderPainted(false);\r\n jButton1.setContentAreaFilled(false);\r\n jButton1.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jButton1ActionPerformed(evt);\r\n }\r\n });\r\n getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 0, -1, -1));\r\n\r\n jTextField2.setHorizontalAlignment(javax.swing.JTextField.CENTER);\r\n jTextField2.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jTextField2ActionPerformed(evt);\r\n }\r\n });\r\n jTextField2.addKeyListener(new java.awt.event.KeyAdapter() {\r\n public void keyTyped(java.awt.event.KeyEvent evt) {\r\n jTextField2KeyTyped(evt);\r\n }\r\n });\r\n getContentPane().add(jTextField2, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 80, 340, 30));\r\n\r\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\r\n jLabel1.setText(\"NOMBRE\");\r\n getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 90, 72, -1));\r\n\r\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\r\n jLabel2.setText(\"DOMICILIO\");\r\n getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 150, 70, -1));\r\n\r\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\r\n jLabel3.setText(\"CIUDAD\");\r\n getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 290, 60, -1));\r\n\r\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\r\n jLabel4.setText(\"TELEFONO\");\r\n getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 240, 70, -1));\r\n\r\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\r\n jLabel5.setText(\"C.P.\");\r\n getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 360, -1, -1));\r\n\r\n jLabel6.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\r\n jLabel6.setText(\"R.F.C.\");\r\n getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 190, -1, -1));\r\n\r\n jLabel7.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\r\n jLabel7.setText(\"E-MAIL\");\r\n getContentPane().add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 410, 50, -1));\r\n\r\n jTextField3.setHorizontalAlignment(javax.swing.JTextField.CENTER);\r\n jTextField3.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jTextField3ActionPerformed(evt);\r\n }\r\n });\r\n jTextField3.addKeyListener(new java.awt.event.KeyAdapter() {\r\n public void keyTyped(java.awt.event.KeyEvent evt) {\r\n jTextField3KeyTyped(evt);\r\n }\r\n });\r\n getContentPane().add(jTextField3, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 130, 510, 30));\r\n\r\n jTextField4.setHorizontalAlignment(javax.swing.JTextField.CENTER);\r\n jTextField4.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jTextField4ActionPerformed(evt);\r\n }\r\n });\r\n jTextField4.addKeyListener(new java.awt.event.KeyAdapter() {\r\n public void keyTyped(java.awt.event.KeyEvent evt) {\r\n jTextField4KeyTyped(evt);\r\n }\r\n });\r\n getContentPane().add(jTextField4, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 290, 250, 30));\r\n\r\n jTextField5.setHorizontalAlignment(javax.swing.JTextField.CENTER);\r\n jTextField5.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jTextField5ActionPerformed(evt);\r\n }\r\n });\r\n jTextField5.addKeyListener(new java.awt.event.KeyAdapter() {\r\n public void keyTyped(java.awt.event.KeyEvent evt) {\r\n jTextField5KeyTyped(evt);\r\n }\r\n });\r\n getContentPane().add(jTextField5, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 340, 250, 30));\r\n\r\n jTextField6.setHorizontalAlignment(javax.swing.JTextField.CENTER);\r\n jTextField6.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jTextField6ActionPerformed(evt);\r\n }\r\n });\r\n getContentPane().add(jTextField6, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 400, 250, 30));\r\n\r\n jTextField7.setHorizontalAlignment(javax.swing.JTextField.CENTER);\r\n jTextField7.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jTextField7ActionPerformed(evt);\r\n }\r\n });\r\n jTextField7.addKeyListener(new java.awt.event.KeyAdapter() {\r\n public void keyTyped(java.awt.event.KeyEvent evt) {\r\n jTextField7KeyTyped(evt);\r\n }\r\n });\r\n getContentPane().add(jTextField7, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 180, 250, 30));\r\n\r\n jTextField8.setHorizontalAlignment(javax.swing.JTextField.CENTER);\r\n jTextField8.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jTextField8ActionPerformed(evt);\r\n }\r\n });\r\n jTextField8.addKeyListener(new java.awt.event.KeyAdapter() {\r\n public void keyTyped(java.awt.event.KeyEvent evt) {\r\n jTextField8KeyTyped(evt);\r\n }\r\n });\r\n getContentPane().add(jTextField8, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 230, 250, 30));\r\n\r\n jButton2.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\r\n jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Imagenes/add-icon.png\"))); // NOI18N\r\n jButton2.setBorderPainted(false);\r\n jButton2.setContentAreaFilled(false);\r\n jButton2.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jButton2ActionPerformed(evt);\r\n }\r\n });\r\n getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 540, 70, 80));\r\n\r\n jButton3.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\r\n jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Imagenes/edit_60_328965.png\"))); // NOI18N\r\n jButton3.setBorderPainted(false);\r\n jButton3.setContentAreaFilled(false);\r\n jButton3.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jButton3ActionPerformed(evt);\r\n }\r\n });\r\n getContentPane().add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 550, 80, 70));\r\n\r\n jButton4.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\r\n jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Imagenes/delete_action_discard.png\"))); // NOI18N\r\n jButton4.setBorderPainted(false);\r\n jButton4.setContentAreaFilled(false);\r\n jButton4.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jButton4ActionPerformed(evt);\r\n }\r\n });\r\n getContentPane().add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 550, 70, 70));\r\n\r\n lbhora.setFont(new java.awt.Font(\"SansSerif\", 1, 24)); // NOI18N\r\n lbhora.setForeground(new java.awt.Color(240, 240, 240));\r\n lbhora.setText(\"00:00:00\");\r\n getContentPane().add(lbhora, new org.netbeans.lib.awtextra.AbsoluteConstraints(1180, 10, -1, 44));\r\n\r\n jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Imagenes/logout.png\"))); // NOI18N\r\n jButton5.setBorder(null);\r\n jButton5.setBorderPainted(false);\r\n jButton5.setContentAreaFilled(false);\r\n jButton5.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jButton5ActionPerformed(evt);\r\n }\r\n });\r\n getContentPane().add(jButton5, new org.netbeans.lib.awtextra.AbsoluteConstraints(1280, 10, -1, -1));\r\n\r\n jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\r\n jLabel8.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Imagenes/giphy.gif\"))); // NOI18N\r\n getContentPane().add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(1110, 90, -1, -1));\r\n\r\n jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Imagenes/CLEAN-AIR-ICON2.png\"))); // NOI18N\r\n jButton6.setBorderPainted(false);\r\n jButton6.setContentAreaFilled(false);\r\n jButton6.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jButton6ActionPerformed(evt);\r\n }\r\n });\r\n getContentPane().add(jButton6, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 550, -1, -1));\r\n\r\n jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Imagenes/fondo gris.jpg\"))); // NOI18N\r\n getContentPane().add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1350, 760));\r\n\r\n jMenuBar1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"PLANTAS\", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font(\"Tahoma\", 1, 12))); // NOI18N\r\n\r\n jMenu1.setText(\"CAPTURA DE DATOS\");\r\n jMenu1.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\r\n\r\n jMenuItem4.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\r\n jMenuItem4.setText(\"CLIENTES\");\r\n jMenuItem4.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jMenuItem4ActionPerformed(evt);\r\n }\r\n });\r\n jMenu1.add(jMenuItem4);\r\n\r\n jMenuItem5.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\r\n jMenuItem5.setText(\"USUARIOS\");\r\n jMenuItem5.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jMenuItem5ActionPerformed(evt);\r\n }\r\n });\r\n jMenu1.add(jMenuItem5);\r\n\r\n jMenuBar1.add(jMenu1);\r\n\r\n jMenu2.setText(\"PRODUCTOS\");\r\n jMenu2.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\r\n\r\n jMenuItem9.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\r\n jMenuItem9.setText(\"COMPONENTES\");\r\n jMenuItem9.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jMenuItem9ActionPerformed(evt);\r\n }\r\n });\r\n jMenu2.add(jMenuItem9);\r\n\r\n jMenuItem10.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\r\n jMenuItem10.setText(\"MATERIALES\");\r\n jMenuItem10.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jMenuItem10ActionPerformed(evt);\r\n }\r\n });\r\n jMenu2.add(jMenuItem10);\r\n\r\n jMenuItem11.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\r\n jMenuItem11.setText(\"FORMULA\");\r\n jMenuItem11.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jMenuItem11ActionPerformed(evt);\r\n }\r\n });\r\n jMenu2.add(jMenuItem11);\r\n\r\n jMenuItem13.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\r\n jMenuItem13.setText(\"PROCESO\");\r\n jMenuItem13.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jMenuItem13ActionPerformed(evt);\r\n }\r\n });\r\n jMenu2.add(jMenuItem13);\r\n\r\n jMenuItem14.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\r\n jMenuItem14.setText(\"OPB\");\r\n jMenuItem14.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jMenuItem14ActionPerformed(evt);\r\n }\r\n });\r\n jMenu2.add(jMenuItem14);\r\n\r\n jMenuBar1.add(jMenu2);\r\n\r\n jMenu3.setText(\"PRODUCCION\");\r\n jMenu3.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\r\n\r\n jMenuItem15.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\r\n jMenuItem15.setText(\"ORDENES\");\r\n jMenuItem15.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n jMenuItem15ActionPerformed(evt);\r\n }\r\n });\r\n jMenu3.add(jMenuItem15);\r\n\r\n jMenuItem16.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\r\n jMenuItem16.setText(\"OPERACION\");\r\n jMenu3.add(jMenuItem16);\r\n\r\n jMenuItem17.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\r\n jMenuItem17.setText(\"DATOS DESPUES DE LA OPERACION\");\r\n jMenu3.add(jMenuItem17);\r\n\r\n jMenuBar1.add(jMenu3);\r\n\r\n jMenu4.setText(\"REPORTES\");\r\n jMenu4.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\r\n jMenuBar1.add(jMenu4);\r\n\r\n setJMenuBar(jMenuBar1);\r\n\r\n pack();\r\n }", "private void initComponents() {//GEN-BEGIN:initComponents\n\n FormListener formListener = new FormListener();\n\n addMouseListener(formListener);\n\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n addSponsorLogoLabel = new javax.swing.JLabel();\n addSponsorLabel = new javax.swing.JLabel();\n addSponsorNameInput = new javax.swing.JTextField();\n addSponsorNameLabel = new javax.swing.JLabel();\n addSponsorFnameInput = new javax.swing.JTextField();\n addSponsorFnameLabel = new javax.swing.JLabel();\n addSponsorLnameInput = new javax.swing.JTextField();\n addSponsorLnameLabel = new javax.swing.JLabel();\n addSponsorPhoneInput = new javax.swing.JTextField();\n addSponsorPhoneLabel = new javax.swing.JLabel();\n addSponsorPledgeInput = new javax.swing.JTextField();\n addSponsorPledgeLabel = new javax.swing.JLabel();\n addSponsorBackButton = new javax.swing.JButton();\n addSponsorSubmitButton = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBackground(new java.awt.Color(255, 255, 255));\n\n addSponsorLogoLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/eventplanner/horizonlogoTiny.png\"))); // NOI18N\n\n addSponsorLabel.setFont(new java.awt.Font(\"Dialog\", 1, 48)); // NOI18N\n addSponsorLabel.setText(\"Add Sponsor\");\n\n addSponsorNameLabel.setText(\"Name of Sponsor:\");\n\n addSponsorFnameLabel.setText(\"First Name:\");\n\n addSponsorLnameLabel.setText(\"Last Name:\");\n\n addSponsorPhoneLabel.setText(\"Phone:\");\n\n addSponsorPledgeLabel.setText(\"Pledge:\");\n\n addSponsorBackButton.setFont(new java.awt.Font(\"Dialog\", 1, 18)); // NOI18N\n addSponsorBackButton.setText(\"Back\");\n addSponsorBackButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n addSponsorBackButtonActionPerformed(evt);\n }\n });\n\n addSponsorSubmitButton.setFont(new java.awt.Font(\"Dialog\", 1, 18)); // NOI18N\n addSponsorSubmitButton.setText(\"Submit\");\n addSponsorSubmitButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n addSponsorSubmitButtonActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addGap(71, 71, 71)\n .addComponent(addSponsorLabel)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(addSponsorLogoLabel))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addGap(143, 143, 143)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(addSponsorNameLabel)\n .addComponent(addSponsorFnameLabel)\n .addComponent(addSponsorLnameLabel)\n .addComponent(addSponsorPhoneLabel)\n .addComponent(addSponsorPledgeLabel))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(addSponsorNameInput, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(addSponsorFnameInput, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(addSponsorLnameInput, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(addSponsorPhoneInput, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(addSponsorPledgeInput, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addGap(152, 152, 152)\n .addComponent(addSponsorSubmitButton)\n .addGap(33, 33, 33)\n .addComponent(addSponsorBackButton)))\n .addGap(0, 0, Short.MAX_VALUE)))\n .addGap(42, 42, 42))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(addSponsorLogoLabel))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(41, 41, 41)\n .addComponent(addSponsorLabel)\n .addGap(29, 29, 29)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(addSponsorNameLabel)\n .addComponent(addSponsorNameInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(10, 10, 10)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(addSponsorFnameInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(addSponsorFnameLabel))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(addSponsorLnameInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(addSponsorLnameLabel))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(addSponsorPhoneInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(addSponsorPhoneLabel))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(addSponsorPledgeInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(addSponsorPledgeLabel))\n .addGap(28, 28, 28)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(addSponsorSubmitButton)\n .addComponent(addSponsorBackButton))\n .addContainerGap(47, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n\n pack();\n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n businessNameJLabel = new javax.swing.JLabel();\n enterpriseNameJLabel = new javax.swing.JLabel();\n networkNameJLabel = new javax.swing.JLabel();\n jSeparator1 = new javax.swing.JSeparator();\n organizationNameJLabel = new javax.swing.JLabel();\n jSeparator2 = new javax.swing.JSeparator();\n titleJLabel = new javax.swing.JLabel();\n drugNameJLabel = new javax.swing.JLabel();\n drugNameJTextField = new javax.swing.JTextField();\n backJButton = new javax.swing.JButton();\n addToCatalogJButton = new javax.swing.JButton();\n statusJLabel = new javax.swing.JLabel();\n statusJTextField = new javax.swing.JTextField();\n\n businessNameJLabel.setFont(new java.awt.Font(\"Times New Roman\", 1, 20)); // NOI18N\n businessNameJLabel.setText(\"Drug Tracking System\");\n\n enterpriseNameJLabel.setFont(new java.awt.Font(\"Times New Roman\", 1, 20)); // NOI18N\n enterpriseNameJLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n enterpriseNameJLabel.setMinimumSize(new java.awt.Dimension(170, 24));\n enterpriseNameJLabel.setPreferredSize(new java.awt.Dimension(170, 24));\n\n networkNameJLabel.setFont(new java.awt.Font(\"Times New Roman\", 1, 20)); // NOI18N\n networkNameJLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n networkNameJLabel.setMaximumSize(new java.awt.Dimension(195, 24));\n networkNameJLabel.setMinimumSize(new java.awt.Dimension(195, 24));\n networkNameJLabel.setPreferredSize(new java.awt.Dimension(195, 24));\n\n organizationNameJLabel.setFont(new java.awt.Font(\"Times New Roman\", 1, 20)); // NOI18N\n organizationNameJLabel.setMinimumSize(new java.awt.Dimension(170, 24));\n organizationNameJLabel.setPreferredSize(new java.awt.Dimension(190, 24));\n\n titleJLabel.setFont(new java.awt.Font(\"Times New Roman\", 1, 26)); // NOI18N\n titleJLabel.setText(\"Drug Details\");\n\n drugNameJLabel.setFont(new java.awt.Font(\"Times New Roman\", 0, 16)); // NOI18N\n drugNameJLabel.setText(\"Drug Name\");\n\n drugNameJTextField.setEditable(false);\n drugNameJTextField.setFont(new java.awt.Font(\"Times New Roman\", 0, 13)); // NOI18N\n drugNameJTextField.setMinimumSize(new java.awt.Dimension(120, 26));\n drugNameJTextField.setPreferredSize(new java.awt.Dimension(120, 26));\n\n backJButton.setFont(new java.awt.Font(\"Times New Roman\", 1, 15)); // NOI18N\n backJButton.setText(\"Back\");\n backJButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n backJButton.setPreferredSize(new java.awt.Dimension(80, 30));\n backJButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n backJButtonActionPerformed(evt);\n }\n });\n\n addToCatalogJButton.setFont(new java.awt.Font(\"Times New Roman\", 1, 15)); // NOI18N\n addToCatalogJButton.setText(\"Add To Catalog\");\n addToCatalogJButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n addToCatalogJButton.setEnabled(false);\n addToCatalogJButton.setPreferredSize(new java.awt.Dimension(80, 30));\n addToCatalogJButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n addToCatalogJButtonActionPerformed(evt);\n }\n });\n\n statusJLabel.setFont(new java.awt.Font(\"Times New Roman\", 0, 16)); // NOI18N\n statusJLabel.setText(\"Status\");\n\n statusJTextField.setEditable(false);\n statusJTextField.setFont(new java.awt.Font(\"Times New Roman\", 0, 13)); // NOI18N\n statusJTextField.setMinimumSize(new java.awt.Dimension(120, 26));\n statusJTextField.setPreferredSize(new java.awt.Dimension(120, 26));\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 .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jSeparator2)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(organizationNameJLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 322, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(businessNameJLabel)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(enterpriseNameJLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 211, Short.MAX_VALUE)\n .addComponent(networkNameJLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(273, 273, 273)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(47, 47, 47)\n .addComponent(titleJLabel))\n .addGroup(layout.createSequentialGroup()\n .addGap(12, 12, 12)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(statusJLabel)\n .addGap(18, 18, 18)\n .addComponent(statusJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(drugNameJLabel)\n .addGap(18, 18, 18)\n .addComponent(drugNameJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(backJButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(addToCatalogJButton, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(311, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(businessNameJLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(enterpriseNameJLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(networkNameJLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(organizationNameJLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(titleJLabel)\n .addGap(75, 75, 75)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(drugNameJLabel)\n .addComponent(drugNameJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(statusJLabel)\n .addComponent(statusJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(33, 33, 33)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(backJButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(addToCatalogJButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(201, Short.MAX_VALUE))\n );\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ScheduleForm() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "@SuppressWarnings(\"unchecked\")\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\"> \r\n private void initComponents() {\r\n \r\n setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createLineBorder(Color.black), javax.swing.BorderFactory.createBevelBorder(BevelBorder.LOWERED)));\r\n \r\n setEnabled(false);\r\n\r\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\r\n this.setLayout(layout);\r\n layout.setHorizontalGroup(\r\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGap(0, 396, Short.MAX_VALUE));\r\n layout.setVerticalGroup(\r\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGap(0, 324, Short.MAX_VALUE));\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\"> \n private void initComponents() {\n\n addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n mouseClickedHandler(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n mouseExitedHandler(evt);\n }\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n mouseEnteredHandler(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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public intrebarea() {\n initComponents();\n }" ]
[ "0.7392436", "0.7392436", "0.7392436", "0.73524207", "0.7332867", "0.73308986", "0.729576", "0.7267236", "0.72270304", "0.721562", "0.7159843", "0.71548635", "0.715188", "0.71416056", "0.7137083", "0.7133313", "0.71205837", "0.7119088", "0.71151245", "0.7110943", "0.7088094", "0.70869946", "0.70641345", "0.70591116", "0.70330286", "0.7030452", "0.7023519", "0.70221186", "0.7018611", "0.70124155", "0.7004385", "0.69660443", "0.69611055", "0.6959442", "0.69581556", "0.6957996", "0.6957996", "0.69524074", "0.69522285", "0.6940147", "0.6934061", "0.69308704", "0.69296706", "0.6927961", "0.6925887", "0.69235575", "0.69186896", "0.6917181", "0.69160247", "0.69106394", "0.69106394", "0.69106394", "0.69095016", "0.69054914", "0.6900353", "0.68979466", "0.68956655", "0.6895087", "0.6895087", "0.6895087", "0.6895087", "0.6895087", "0.6895087", "0.6895087", "0.6895087", "0.6895087", "0.6895087", "0.6895087", "0.6895087", "0.6895087", "0.6892557", "0.68870544", "0.68870544", "0.68870544", "0.68870544", "0.68870544", "0.68870544", "0.68870544", "0.68870544", "0.68870544", "0.68861574", "0.68850154", "0.6871747", "0.68715745", "0.6868578", "0.6863536", "0.68602425", "0.6855859", "0.68523115", "0.6849962", "0.6847681", "0.6846335", "0.6840558", "0.6838855", "0.6838742", "0.6831164", "0.6828983", "0.68277824", "0.6818169", "0.681586", "0.6813895" ]
0.0
-1
Devuelve el siguiente elemento de la iteracion.
public T getNext() { T elem = handler.getTop(); handler.pop(); return elem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Object nextElement() {\n/* 75 */ return this.iterator.next();\n/* */ }", "@Override public T next() {\n T elem = null;\n if (hasNext()) {\n Nodo<T> nodo = pila.pop();\n elem = nodo.elemento;\n nodo = nodo.derecho;\n while(nodo != null){\n pila.push(nodo);\n nodo = nodo.izquierdo;\n }\n return elem;\n }\n return elem;\n }", "public T getElementoCima(){\r\n\t\r\n\t\treturn this.num.get(this.num.size()-1);\r\n\t}", "public T nextElement() {\r\n\t\treturn items[currentObject++];\r\n \t}", "@Override\r\n\tpublic String nextElement() {\n\t\treturn it.next();\r\n\t}", "public E element() {\r\n\t\tif (isEmpty()) {\r\n\t\t\tthrow new NoSuchElementException();\r\n\t\t}\r\n\t\treturn (E) data.get(0);\r\n\t}", "public Object next()\n {\n return _iterator.next();\n }", "public Object element() { return e; }", "private Object getNextElement()\n {\n return __m_NextElement;\n }", "public T get() {\n return this.elemento;\n }", "public Iterator getIterator() {\n return myElements.iterator();\n }", "public E element() {\n\t\tif (mSize == 0)\n\t\t\tthrow new NoSuchElementException();\n\t\treturn mHead.next.data;\n\t}", "public Nodo obtener_Nodo() {\n\t\treturn this.elem;\n\t}", "@Override\n\tpublic Iterator<WebElement> iterator() {\n\t\treturn this.elements.iterator();\n\t}", "@Override\n public Iterator<E> iterator() {\n return new ElementIterator();\n }", "@Override\n public Iterator<Piedra> iterator() {\n return piedras.iterator();\n \n //crear un iterator propio\n// return new Iterator<Piedra>(){\n// int index=0;\n// @Override\n// public boolean hasNext() {\n// return piedras.size()>index;\n// }\n//\n// @Override\n// public Piedra next() {\n// return piedras.get(index++);\n// }\n// \n// };\n }", "@Override public T next(){\n Vertice v = pila.saca();\n T e = v.elemento;\n v = v.derecho;\n while (v != null) {\n pila.mete(v);\n v = v.izquierdo;\n }\n\t\treturn e;\n }", "Element nextElement () {\n\t\treturn stream.next();\n\t}", "public Elemento getElemento() {\n\t\treturn elemento;\n\t}", "@Override\n public int element() {\n isEmptyList();\n return first.value;\n }", "@Override\n public E element() {\n if (isEmpty()) {\n throw new NoSuchElementException();\n }\n return (E) array[0];\n }", "public T darElemento(){\r\n\t\treturn elemento;\r\n\t}", "public E next()\n {\n if (hasNext())\n {\n E item = currentNode.data();\n currentNode = currentNode.next();\n count--;\n return item;\n }\n else\n {\n throw new NoSuchElementException(\"There isnt another element\");\n\n }\n }", "public int getElem()\r\n\t{\r\n\t\treturn elem;\r\n\t}", "public E getCurrent()\n {\n if (size != 0)\n {\n return current.data();\n }\n else\n {\n throw new NoSuchElementException(\"The list is empty\");\n }\n }", "public K next()\n {\n\tif (hasNext()) {\n\t K element = current.data();\n\t current = current.next(0);\n\t return element; \n\t} else {\n\t return null; \n\t}\n }", "public Iterador() {\n pila = new Pila<Nodo>();\n if (raiz != null) {\n pila.push(raiz);\n Nodo<T> nodo = pila.peek();\n while(nodo != null){\n if (nodo.izquierdo != null) {\n pila.push(nodo.izquierdo);\n }\n nodo = nodo.izquierdo;\n }\n }\n\n }", "public Object getFirst()\n {\n if(first == null){\n throw new NoSuchElementException();}\n \n \n \n return first.data;\n }", "public E next() throws NoSuchElementException{\n\t\tPosition<E> aux=actual;\n\t\tif (aux == null) \n\t\t\tthrow new NoSuchElementException();\t\t\n\t\tthis.avanzar();\n\t\treturn aux.element();\n\t}", "@Override\n\t@TimeComplexity(\"O(1)\")\n\tpublic E element()\n\t{\n\t\treturn element;\n\t}", "public T next() {\n\t\t\tif (hasNext()) {\n\t\t\t\tT nextItem = elements[index];\n\t\t\t\tindex++;\n\t\t\t\t\n\t\t\t\treturn nextItem;\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new java.util.NoSuchElementException(\"No items remaining in the iteration.\");\n\t\t\t\n\t\t}", "public void listarAsignaturasIterator() {\n\t\tSystem.out.println(\"***** Listado con Iterator del grado de \" + nombre + \" *****\");\n\t\tIterator<Asignatura> iterador = asignaturas.iterator();\n\t\twhile (iterador.hasNext()){\n\t\t\tAsignatura elemento = iterador.next();\n\t\t\tSystem.out.println(elemento);\n\t\t}\n\t\tSystem.out.println(\"**************************************************************\\n\");\n\t}", "private E next() {\n\t\tif (hasNext()) {\n\t\t\tE temp = iterator.data;\n\t\t\titerator = iterator.next;\n\t\t\treturn temp;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public void printaPiedras(){\n for(Piedra p: piedras){\n System.out.println(p);\n }\n \n// Iterator<Piedra> it =piedras.iterator();\n// while(it.hasNext()){\n// System.out.println(it.next());\n// }\n \n }", "@Override\r\n\tpublic E element() {\n\t\treturn null;\r\n\t}", "public T getElement() {\r\n\t\t\r\n\t\treturn element;\r\n\t\r\n\t}", "public Object nextElement()\t{\n\t\treturn nextToken();\n\t}", "@Override\n\tpublic Iterator<T> iterator() {\n\t\t\n\t\treturn lista.iterator();\n\t}", "@Override\n public E next() {\n if (this.hasNext()) {\n curr = curr.nextNode;\n return curr.getData();\n }\n else {\n throw new NoSuchElementException();\n }\n }", "public E getElement() { return element; }", "SingelIterator() {\n neste = listehode;\n forrige = listehode;\n }", "@Override\n public Iterator<T> iterator() {\n return this;\n }", "@Override\n public Map.Entry<K, V> next() {\n if (iter.hasNext()) {\n \n lastItemReturned = iter.next();\n return lastItemReturned;\n } else {\n throw new NoSuchElementException();\n }\n }", "@com.francetelecom.rd.stubs.annotation.FieldGet(\"e\")\n\t\tpublic T nextElement() {\n\t\t\treturn null;\n\t\t}", "public final <E extends com.matisse.reflect.MtObject> com.matisse.MtObjectIterator<E> gestionaIterator() {\n return this.<E>successorIterator(getGestionaRelationship(getMtDatabase()), gest_proyectos.Proyecto.class);\n }", "Object getNextElement() throws NoSuchElementException;", "public E next() {\r\n current++;\r\n return elem[current];\r\n }", "public E getElement()\n {\n return this.data;\n }", "public E next() {\n\t\t\tif (mIterModCount != modCount) {\n\t\t\t\tSystem.out.println( mIterModCount + \" : \" + modCount);\n\t\t\t\tthrow new ConcurrentModificationException();\n\t\t\t}\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new java.util.NoSuchElementException();\n\t\t\tmLastNodeReturned = mCurrentNode;\n\t\t\tmCurrentNode = mCurrentNode.next;\n\t\t\tmCurrentIndex++;\n\t\t\tmLastIteration = NEXT;\n\t\t\treturn mLastNodeReturned.data;\n\t\t}", "public T get() {\n return element;\n }", "public T next(){\r\n return itrArr[position++];\r\n }", "public DNode<E> iterator()\n {\n \treturn first;\t\t\n }", "@Override\n public E next() {\n this.modificationCheck();\n E result;\n if (this.position != SimpleArrayList.this.index) {\n result = (E) values[position++];\n } else {\n throw new NoSuchElementException(\"No more suitable elements!\");\n }\n return result;\n }", "public E element () throws NoSuchElementException;", "public Iterator iterator() {\n\t\treturn new IteratorLinkedList<T>(cabeza);\r\n\t}", "public Pair get()\n {\n return this.MapItr.element;\n }", "public E element();", "@SuppressWarnings(\"unchecked\")\n\t\tpublic T next() throws NoSuchElementException {\n\n\t\t\ttry {\n\t\t\t\tint row = cursor / numCols;\n\t\t\t\tint col = cursor % numCols;\n//\t\t\t\tT object = (T)data[cursor];\n//\t\t\t\tSystem.out.println(\"cursor=\"+cursor+\", row=\"+row+\"/\"+numRows+\", col=\"+col+\"/\"+numCols);\n\t\t\t\tT object = get(row, col);\n\t\t\t\tlastRet = cursor++;\n\t\t\t\treturn object;\n\t\t\t} catch ( IndexOutOfBoundsException e ) {\n\t\t\t\tthrow new NoSuchElementException( \"You have iterated past the last element. \" + e.toString() );\n\t\t\t}\n\n\t\t}", "@Override\r\n\tpublic Iterator<T> iterator() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn this.iteratorInOrder();\r\n\t}", "public Object getElement()\r\n\t\t{ return element; }", "public T getElement()\n {\n\n return element;\n }", "public E getElement()\n\t{\n\t\treturn this.data;\n\t}", "public E getElement() {\r\n return element;\r\n }", "public Object next()throws NullPointerException\r\n {\r\n if(hasNext())\r\n return e.get(index+1);\r\n else\r\n throw new NullPointerException();\r\n }", "@Override\n\tpublic final Iterator<T> iterator() {\n\t\treturn new IteratorImpl<>(value.get());\n\t}", "public T getValue(){\n \treturn element;\n }", "public T getElement() {\n\t\treturn element;\n\t}", "public void IteratorParcoAuto(){\n Iterator<AbstractAuto> auto=new AutoIterator();\n auto=parco.lista.iterator();\n int i=1;\n while(auto.hasNext())\n {\n Object element=auto.next();\n if(element instanceof Auto)\n {\n System.out.print(i+\" \"+element +\" \\n\");\n }\n i++;\n }\n }", "@Override\n\t\tpublic E getElement() throws IllegalStateException {\n\t\t\treturn element;\n\t\t}", "public E getFirst() {\n\t\tif (mSize == 0)\n\t\t\tthrow new NoSuchElementException();\n\t\treturn mHead.next.data;\n\t}", "@Override\n public T getCombinedElement()\n {\n return element;\n }", "public Object getFirst() {\r\n if (size == 0)\r\n throw new NoSuchElementException();\r\n\r\n return header.next.element;\r\n }", "public Iterator<ElementType> iterator(){\n return new InnerIterator();\n }", "@Override\n\tpublic ArrayList<Elezione> listaElezioni() {\n\t\tArrayList<Elezione> listaElezioni = caricaElezioni();\n\t\treturn listaElezioni;\n\t}", "@Override\n\tpublic Integer next() {\n\t return iterator.next();\n\t}", "@Override\n public Iterator<E> iterator() {\n return new InsideIterator(first);\n }", "public E next() \n {\n \tfor(int i = 0; i < size; i++)\n \t\tif(tree[i].order == next) {\n \t\t\tnext++;\n \t\t\ttree[i].position = i;\n \t\t\treturn tree[i].element;\n \t\t}\n \treturn null;\n }", "@Override\r\n\t\tpublic E next() {\n\t\t\tcaret = caret.next();\r\n\t\t\tif (caret == null)\r\n\t\t\t\tthrow new NoSuchElementException();\r\n\t\t\tnextIndex++;\r\n\t\t\treturn caret.n.data[caret.idx];\r\n\t\t}", "@SuppressWarnings(\"unchecked\")\r\n\t\tpublic T next( )\r\n\t\t{\r\n\t\t\tif (!hasNext())\r\n\t\t\t\tthrow new NoSuchElementException();\r\n\t\t\t\r\n\t\t\tT result = currentArrayItr.next();\r\n\t\t\t//System.out.println(\"in next iterator LinkedArray \" + result);\r\n\t\t\treturn result;\r\n\r\n\t\t}", "public T getElement() {\n return element;\n }", "public Object firstElement();", "public DatosIteracion mejorIteracionCapturados() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionCapturados(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionCapturados(array);\r\n\t}", "public synchronized Collection getElementos() {\n return elemento.values();\n }", "public Object getElement()\n {return data;}", "public Object element() {\n return queue.element();\n }", "@Override\r\n Iterator<E> iterator();", "public List<NodoRuta> getElementos() { \n \n return new ArrayList<NodoRuta>(nodos);\n }", "public T[] next(){\n\n if(hasNext()){\n int numElements = Math.min(window,lst.length - currentIndex);\n ArrayList<T> returnElements = new ArrayList<T>(numElements);\n for(int i = currentIndex; i < currentIndex + window && i < lst.length; i++ ){\n returnElements.add(lst[i]);\n if(i == lst.length-1){\n hasMore = Boolean.FALSE;\n }\n }\n currentIndex += step;\n return returnElements.toArray((T[]) Array.newInstance(returnElements.get(0).getClass(),0));\n }else{\n throw new NoSuchElementException(\"no elements to iterate \");\n }\n\n }", "@SuppressWarnings(\"unchecked\")\n\t\tpublic T next() throws NoSuchElementException {\n\n\t\t\ttry {\n\n//\t\t\t\tT object = (T)data[currentRow * numCols + currentColumn];\n\t\t\t\tT object = get(currentRow, currentColumn);\n\n\t\t\t\tcurrentRow++;\n\t\t\t\tif ( currentRow == numRows ) {\n\t\t\t\t\tcurrentRow = 0;\n\t\t\t\t\tcurrentColumn++;\n\t\t\t\t}\n\n\t\t\t\tlastRet = cursor++;\n\t\t\t\treturn object;\n\t\t\t} catch ( IndexOutOfBoundsException e ) {\n\t\t\t\tthrow new NoSuchElementException( \"You have iterated past the last element. \" + e.toString() );\n\t\t\t}\n\n\t\t}", "public T getNextElement();", "public ArrayList<Elezione> caricaElezioni() {\n\t\t\t\n\t\t\tDB db = getDB();\n\t\t\tMap<Integer, Elezione> map = db.getTreeMap(\"elezione\");\n\t\t\tArrayList<Elezione> elezioni = new ArrayList<Elezione>();\n\t\t\tSet<Integer> keys = map.keySet();\n\t\t\tfor (int key : keys) {\n\t\t\t\telezioni.add(map.get(key));\n\t\t\t}\n\t\t\treturn elezioni;\n\t\t}", "@Override\n public Iterator<E> iterator() {\n\n Iterator<E> myIt = new Iterator<E>() {\n\n private int currIndex = head;\n\n @Override\n public boolean hasNext() {\n if (currIndex < ringArray.length && ringArray[currIndex] != null) { //Checking if we got to the end and if there are no null elements\n return false;\n }\n return true;\n }\n\n @Override\n public E next() {\n if (!hasNext()) //If there isnt another element then throw an exception\n throw new NoSuchElementException(\"No element\");\n Object nextElement = ringArray[currIndex]; //Getting the next element\n currIndex--; //Decrease the current index by one\n if (currIndex < 0) //If we get to the beginning of the\n currIndex = ringArray.length - 1;\n return (E) nextElement;\n }\n\n @Override\n public void remove() throws UnsupportedOperationException {\n throw new UnsupportedOperationException(\"Remove is not supported\");\n }\n };\n return myIt;\n }", "@Override\r\n\t\tpublic Item next() {\r\n\t\t\treturn arr[index++];\r\n\t\t}", "public Element<T> getNextElement() \n\t{\n\t\treturn nextElement;\n\t}", "public Iterator getIterator() {\n/* 87 */ return this.iterator;\n/* */ }", "@Override\n\t\t\tpublic FplValue next() {\n\t\t\t\treturn subListIter.next();\n\t\t\t}", "@Override\n public Iterator<T> getHojas(){\n return (super.getHojas());\n }", "public Object getFirst()\n {\n if (first == null)\n {\n throw new NoSuchElementException();\n }\n else\n return first.getValue();\n }", "private E element() {\n if (startPos >= queue.length || queue[startPos] == null) throw new NoSuchElementException();\n return (E) queue[startPos];\n }", "public Object getElement() {\n return element;\n }", "public int currentindex() {\n\t\treturn currentElement;\n\t}" ]
[ "0.7192707", "0.6767897", "0.67309755", "0.6702413", "0.6571108", "0.6538033", "0.6536762", "0.6527444", "0.64980906", "0.64886534", "0.647263", "0.64412105", "0.6434362", "0.6362155", "0.63204587", "0.6312327", "0.63089746", "0.6299254", "0.62807673", "0.6239724", "0.6233277", "0.6225568", "0.6209881", "0.6193288", "0.61763537", "0.6176071", "0.6169825", "0.6163849", "0.6159076", "0.61523527", "0.61187875", "0.6103225", "0.61025274", "0.60942405", "0.609076", "0.6081012", "0.60803765", "0.6069803", "0.6068272", "0.60636777", "0.60542774", "0.6049034", "0.60468364", "0.60447514", "0.60374814", "0.60371876", "0.60299677", "0.6025464", "0.60212606", "0.6013455", "0.6011116", "0.60067", "0.59988517", "0.5988625", "0.598708", "0.5982128", "0.5981475", "0.5978717", "0.5972883", "0.5970748", "0.5965101", "0.59608346", "0.59527403", "0.5952189", "0.5951872", "0.5946576", "0.59439003", "0.59347045", "0.592629", "0.5922936", "0.5920544", "0.5920282", "0.5919845", "0.5919762", "0.5917663", "0.591556", "0.59142834", "0.5913815", "0.59080344", "0.5890573", "0.5878243", "0.5875896", "0.5874953", "0.5873491", "0.58705425", "0.58687365", "0.5866953", "0.5866053", "0.5865225", "0.5863", "0.58573884", "0.5855995", "0.5842999", "0.58413094", "0.58350164", "0.58244294", "0.58208364", "0.58167744", "0.5814294", "0.5810199", "0.58067906" ]
0.0
-1
Devuelve cierto si aun quedan elementos sin visitar en la iteracion.
public boolean hasNext() { return !handler.isEmpty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean hasNext() {\n return numeroDiNodiAncoraVisitabili>0;\n }", "@Override\n public boolean hasNext() {\n return nextElementSet || setNextElement();\n }", "public boolean hasNext() {\n return neste.neste != null;\n }", "boolean hasNext() {\n return neste != null;\n }", "public boolean hasNext() {\n\t\t\treturn !elements.isEmpty();\n\t\t}", "@Override\n public boolean hasNext() {\n return (arreglo[i] != null) & arreglo.length > i ;\n }", "public boolean hasNext() \n\t{\n\t\tboolean res = false;\n\t\tif(actual != null) {\n\t\t\tif(esPrimero && actual != null)\n\t\t\t\tres=true;\n\t\t\telse {\n\t\t\t\tres = actual.darSiguiente() != null;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "@Override public boolean hasNext() {\n return !pila.esVacio();\n }", "@Override public boolean hasNext() {\n return !pila.esVacia();\n }", "public boolean hasNext()\r\n {\r\n if(e.get(index+1) == null)\r\n return false;\r\n else\r\n return true;\r\n }", "@Override\n public boolean hasNext() {\n setCurrent();\n return current != null;\n }", "public boolean hasNext() {\r\n if (current + 1 >= elem.length) {\r\n current = 0;\r\n }\r\n return elem[current + 1] != null;\r\n }", "@Override\n public boolean hasNext()\n {\n Node testNode = getNth(idx);\n if(testNode.getElement() == null)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "public boolean hasNext() {\n\t\treturn planificador.hayTareasParaEjecutar();\n\t}", "@Override\r\n\tpublic boolean hasMoreElements() {\n\t\treturn it.hasNext();\r\n\t}", "boolean hasNextElement();", "public boolean hasNextElement();", "@Override\n\t\tpublic boolean hasNext() {\n\t\t\treturn i > 0;\n\t\t}", "public boolean hasNext() {\n return !lov.isEmpty();\n }", "public boolean hasNext() {\n return !lov.isEmpty();\n }", "@Override\n\t\tpublic boolean hasNext() {\t\t\t\n\t\t\treturn current != null;\n\t\t}", "public boolean hasNext(){\n return ci < size;\n }", "public boolean moreToIterate() {\r\n\t\treturn curr != null;\r\n\t}", "public boolean hayIzquierdo() {\n return this.izquierdo != null;\n }", "@Override\n\t\tpublic boolean hasNext() {\n\t\t\treturn nextIndex() >= 0;\n\t\t}", "@Override\n public boolean hasNext() {\n return iter.hasNext();\n }", "@Override\r\n\t\tpublic boolean hasNext() {\n\t\t\treturn current!=null;\r\n\t\t}", "@Override\n\t\tpublic boolean hasNext() {\n\t\t\treturn (this.next != null);\n\t\t}", "public boolean hasNext() {\n for (; pos < elem.length; pos++) {\n if (merges(elem[pos])) {\n elem[pos].setUsed();\n continue;\n }\n\n return true;\n }\n\n return false;\n }", "public boolean hasNextInSet() {\n return (hasNext() &&\n (indexOfCurrentElement + 1 < firstIndexOfCurrentSet + quantity) &&\n (indexOfCurrentElement + 1 >= firstIndexOfCurrentSet)); \n }", "@Override\n public boolean hasNext() {\n return(it.hasNext());\n }", "private boolean hasNext() {\n\t\treturn iterator != null;\n\t}", "public boolean hasNext(){\n if (position == null){\n return (first!=null);\n \n }\n else \n return position.next != null; \n }", "public boolean hasNext(){\n return (index < nElem);\n }", "public boolean hasNext() {\n return nodeIndex != iterN;\n }", "@Override\r\n\t\tpublic boolean hasNext() {\r\n\t\t\tif (first.next == null) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else\r\n\t\t\t\treturn true;\r\n\t\t}", "@Override\n public boolean contiene(T dato) {\n return this.buscar(dato) != null;\n }", "public boolean hasNext() {\n return curr.hasNext();\n }", "public boolean hasNext() {\n return curr.hasNext();\n }", "private boolean hasNext(){\n return current !=null;\n\n }", "@Override\r\n\tpublic boolean buscar(T elemento) {\n\t\treturn false;\r\n\t}", "@Override\n public boolean hasNext() {\n return next != null;\n }", "@Override\n public boolean hasNext() {\n return null != current;\n }", "@Override\n public boolean hasNext() {\n return currentIterator != null;\n }", "public boolean hasNext(){\n return current!=null;\n }", "@Override\n public boolean hasNext() {\n boolean result = false;\n if (checkCurrentIterator(this.currentIterator) && this.currentIterator.hasNext()) {\n return true;\n } else if (it.hasNext()) {\n this.currentIterator = getIterator(it);\n return this.hasNext();\n }\n return result;\n\n }", "@Override\n public boolean hasNext() {\n return i+1 < queries.size();\n }", "@Override\n public boolean hasNext() {\n return (nextItem != null);\n }", "@Override\r\n\t\tpublic boolean hasNext() {\n\t\t\treturn nextNode != null;\r\n\t\t}", "@Override\n public boolean hasNext() {\n return j < size; // size is field of outer instance\n }", "public boolean esConexo() {\n\t\tboolean result = true;\n\t\tint indice = 0;\n\t\tBusquedaEnProfundidad busqueda = new BusquedaEnProfundidad(this, 0);\n\n\t\twhile (result && indice < cantNodos) {\n\t\t\tif (!busqueda.estaVisitado(indice))\n\t\t\t\tresult = false;\n\t\t\tindice++;\n\t\t}\n\n\t\treturn result;\n\t}", "public boolean hasNext() { return (current != null && current.item != null); }", "public boolean hasNext(){\n if(index < size && listI.get(index) != null){\n return true;\n }\n return false;\n }", "public boolean hasNext() {\n return !left_nodes.isEmpty(); // DON'T FORGET TO MODIFY THE RETURN IF NEED BE\r\n\t\t}", "public boolean hasNext()\n\t{\n\t\treturn (curr<vector.size());\n\t}", "public boolean hasNext() {\n return (itrCounter < size());\n }", "@Override\r\n\t\tpublic boolean hasNext() {\r\n\t\t\t\r\n\t\t\treturn currentNode.nextNode != null;\r\n\t\t}", "@Override\n public boolean hasNext() {\n return this.position != values.length && values[this.position] != null;\n }", "@Override\n\tpublic boolean hasNext() {\n\t return current != null;\n\t}", "private boolean checkNext(){\n boolean ret = this.hasNext;\n if ((this.allStatesIterator.hasNext()) || (this.allSubsetsIterator.hasNext()) || (this.allTransitionsIterator.hasNext())){\n hasNext = true;\n return hasNext;\n }\n hasNext = false;\n return ret;\n }", "@Override\n\t\tpublic boolean hasNext() {\n\t\t\treturn nextNode != null;\n\t\t}", "public boolean hasNext()\n {\n\treturn current != null; \n }", "public boolean hasNextElement() {\n return resultsEnumeration.hasMoreElements();\n }", "public boolean hasNext() {\n\t\t\treturn current != null;\r\n\t\t}", "public boolean hasNext()\n {\n return _iterator.hasNext();\n }", "@Override\n public boolean hasNext() {\n return nextNode != null;\n }", "default boolean hasChildren() {\n return iterator().hasNext();\n }", "public boolean hasNext() {\r\n\t\treturn curr != null;\r\n\t}", "@Override\n\t\tpublic boolean hasMoreElements() {\n\t\t\treturn cursor != size();\n\t\t}", "@Override\r\n public boolean hasNext() {\r\n return (next.data != null);\r\n }", "@Override\r\n public boolean hasNext() {\r\n // variable auxiliar t y s para simplificar accesos...\r\n Entry<K, V> t[] = TSB_OAHashtable.this.table;\r\n int s[] = TSB_OAHashtable.this.states;\r\n\r\n if(current_entry >= t.length) { return false; }\r\n\r\n // busco el siguiente indice cerrado\r\n int next_entry = current_entry + 1;\r\n for (int i = next_entry ; i < t.length; i++) {\r\n if (s[i] == 1) return true;\r\n }\r\n\r\n // Si no encontro ninguno retorno false\r\n return false;\r\n }", "@Override\r\n public boolean hasNext() {\r\n // variable auxiliar t y s para simplificar accesos...\r\n Entry<K, V> t[] = TSB_OAHashtable.this.table;\r\n int s[] = TSB_OAHashtable.this.states;\r\n\r\n if(current_entry >= t.length) { return false; }\r\n\r\n // busco el siguiente indice cerrado\r\n int next_entry = current_entry + 1;\r\n for (int i = next_entry ; i < t.length; i++) {\r\n if (s[i] == 1) return true;\r\n }\r\n\r\n // Si no encontro ninguno retorno false\r\n return false;\r\n }", "@Override\r\n public boolean hasNext() {\r\n // variable auxiliar t y s para simplificar accesos...\r\n Entry<K, V> t[] = TSB_OAHashtable.this.table;\r\n int s[] = TSB_OAHashtable.this.states;\r\n\r\n if(current_entry >= t.length) { return false; }\r\n\r\n // busco el siguiente indice cerrado\r\n int next_entry = current_entry + 1;\r\n for (int i = next_entry ; i < t.length; i++) {\r\n if (s[i] == 1) return true;\r\n }\r\n\r\n // Si no encontro ninguno retorno false\r\n return false;\r\n }", "public boolean hasNext() {\n\t\t\treturn current != null;\n\t\t}", "public boolean hasNext() {\r\n\t\t//Mientras no hayan miembros que iterar\r\n\t\twhile((memberIterator == null) || !memberIterator.hasNext()){\r\n\t\t\t//Si hay clase para iterar\r\n\t\t\twhile(this.classIterator.hasNext()){\r\n\t\t\t\tClass<?> clazz = this.classIterator.next();\r\n\t\t\t\tT[] members = this.extractor.evaluateOn(clazz);\r\n\t\t\t\t//Si la clase tiene miembros para iterar\r\n\t\t\t\tif(members.length > 0){\r\n\t\t\t\t\tthis.memberIterator = ArrayIterator.create(members);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//Si hay miembros, se continua normalmente\r\n\t\treturn true;\r\n\t}", "public boolean hasNext() {\n\t\treturn actual!=null;\t\t\n\t}", "public boolean hasNext() {\n return current != null;\n }", "public boolean hasNext() {\n return current != null;\n }", "@Override\r\n public boolean hasNext() {\n return true;\r\n }", "public boolean hasNext() {\n if (this.index < nElem)\n return true;\n else{\n this.index--;\n return false;\n }\n }", "public boolean hasMoreElements() {\n/* 64 */ return this.iterator.hasNext();\n/* */ }", "public boolean hasNext()\n {\n return current != null;\n }", "public boolean hasNext() {\n return this.next != null;\n }", "public boolean hasNext() {\r\n return true;\r\n }", "public boolean hasNext() {\n\t\n\t\tif ( pos == null ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t\n\t}", "public boolean hasNext(){\n\t\treturn hasNext;\n\t}", "@Override\n public boolean hasNext() {\n return (this.index != values.length) && (values[index] != null);\n }", "public boolean hasNext() {\n return true;\n }", "public boolean hasNext()\n {\n // TODO: implement this method\n return false;\n }", "public boolean hasNext() {\r\n return (length > 0);\r\n }", "public boolean hasNext() {\n Object[] tab = traversalTable;\n for (int i = index; i < tab.length; i+=2) {\n Object key = tab[i];\n if (key != null) {\n index = i;\n return indexValid = true;\n }\n }\n index = tab.length;\n return false;\n }", "public boolean repetido(int el){\n boolean repe = false;\n NodoDoble current = inicio;\n while(current != null){\n if(current.dato==el){\n repe = true;\n break; \n }else{\n repe = false;\n } \n current = current.siguiente;\n }\n return repe;\n }", "public boolean hasNext()\n { return current != null; }", "public boolean hasNext()\r\n {\r\n return (next != null);\r\n }", "public boolean hasNext() {\n return true;\n }", "public boolean hasNext() {\n\t\t\tif (index < numberOfElements)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "@Override\n public boolean hasNext() {\n return this.nextObject != null;\n }", "public boolean hasNext(){\r\n return node != null;\r\n }", "public boolean hasNext(){\n if(index < size && listR.get(index) != null){\n return true;\n }\n return false;\n }", "@Override\r\n\t\tpublic boolean hasNext() {\r\n\t\t\treturn arr[index] != null && index < arr.length;\r\n\t\t}", "public boolean hasNext() {\n\t\treturn next_node == null;\n\t}" ]
[ "0.7592424", "0.6926388", "0.6878384", "0.6870281", "0.68617177", "0.68286926", "0.67438436", "0.6730197", "0.67210704", "0.6719351", "0.6699117", "0.6674327", "0.66348255", "0.6598542", "0.6592435", "0.6578686", "0.6569268", "0.65667766", "0.65659076", "0.65659076", "0.6551061", "0.6533034", "0.6532206", "0.64867705", "0.64653146", "0.6441715", "0.64396834", "0.6428303", "0.6427796", "0.64249766", "0.6423477", "0.6411216", "0.640645", "0.64019346", "0.63903165", "0.6374634", "0.6370089", "0.6363638", "0.6363638", "0.63583094", "0.63580734", "0.6352773", "0.6350185", "0.63444704", "0.634213", "0.63396555", "0.63357824", "0.6330577", "0.63290566", "0.6325865", "0.6324868", "0.6322391", "0.6319785", "0.63156474", "0.6313421", "0.6310779", "0.63087916", "0.630662", "0.6305837", "0.62950027", "0.62932664", "0.6290135", "0.6286649", "0.62862664", "0.62847376", "0.6282013", "0.6268371", "0.6266231", "0.6255045", "0.6253308", "0.62478393", "0.62478393", "0.62478393", "0.6236778", "0.62256527", "0.6225461", "0.62224025", "0.62224025", "0.62185764", "0.62137634", "0.62127113", "0.62121487", "0.62114596", "0.6210967", "0.62090343", "0.6208468", "0.6206757", "0.6204356", "0.61985946", "0.61959296", "0.619577", "0.61906934", "0.61869276", "0.6185882", "0.6182823", "0.61809164", "0.6175877", "0.6173484", "0.6173013", "0.615713", "0.6156182" ]
0.0
-1
Restablece el iterador al comienzo.
public void reset() { handler = new StackDynamic<T>(restart); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Iterator<Piedra> iterator() {\n return piedras.iterator();\n \n //crear un iterator propio\n// return new Iterator<Piedra>(){\n// int index=0;\n// @Override\n// public boolean hasNext() {\n// return piedras.size()>index;\n// }\n//\n// @Override\n// public Piedra next() {\n// return piedras.get(index++);\n// }\n// \n// };\n }", "private static void iterator() {\n\t\t\r\n\t}", "SingelIterator() {\n neste = listehode;\n forrige = listehode;\n }", "public void setAtores(Iterator<IPessoa> atores);", "public void setIteracion(int iteracion) {\n this.iteracion = iteracion;\n }", "@Override\n public Iterator<T> postOrden(){\n return (super.postOrden());\n }", "public void IteratorParcoAuto(){\n Iterator<AbstractAuto> auto=new AutoIterator();\n auto=parco.lista.iterator();\n int i=1;\n while(auto.hasNext())\n {\n Object element=auto.next();\n if(element instanceof Auto)\n {\n System.out.print(i+\" \"+element +\" \\n\");\n }\n i++;\n }\n }", "public MeuIterador(Object primeira){//construtor do meu iterador recebe a primeira celula da lista como objeto\r\n\t\tauxiliar=(Celula)primeira;//auxiliar recebe a primeira celula\r\n\t\tthis.primeira=(Celula)primeira;//primeira recebe a primeira celula\r\n\t}", "public Iterador() {\n pila = new Pila<Nodo>();\n if (raiz != null) {\n pila.push(raiz);\n Nodo<T> nodo = pila.peek();\n while(nodo != null){\n if (nodo.izquierdo != null) {\n pila.push(nodo.izquierdo);\n }\n nodo = nodo.izquierdo;\n }\n }\n\n }", "public Iterator iterator() {\n\t\treturn new IteratorLinkedList<T>(cabeza);\r\n\t}", "public final <E extends com.matisse.reflect.MtObject> com.matisse.MtObjectIterator<E> gestionaIterator() {\n return this.<E>successorIterator(getGestionaRelationship(getMtDatabase()), gest_proyectos.Proyecto.class);\n }", "public void listarAsignaturasIterator() {\n\t\tSystem.out.println(\"***** Listado con Iterator del grado de \" + nombre + \" *****\");\n\t\tIterator<Asignatura> iterador = asignaturas.iterator();\n\t\twhile (iterador.hasNext()){\n\t\t\tAsignatura elemento = iterador.next();\n\t\t\tSystem.out.println(elemento);\n\t\t}\n\t\tSystem.out.println(\"**************************************************************\\n\");\n\t}", "@Override\n public Iterator<T> preOrden(){\n return (super.preOrden());\n }", "public Iterator<IPessoa> getAtores();", "@Override\n\tpublic Iterator<T> iterator() {\n\t\t\n\t\treturn lista.iterator();\n\t}", "public void printaPiedras(){\n for(Piedra p: piedras){\n System.out.println(p);\n }\n \n// Iterator<Piedra> it =piedras.iterator();\n// while(it.hasNext()){\n// System.out.println(it.next());\n// }\n \n }", "IEmpleado next();", "@Override\n public Iterator<T> inOrden(){\n return (super.inOrden());\n }", "private void moverCarroLujo() {\n for (Auto auto : arrEnemigosAuto) {\n auto.render(batch);\n\n auto.moverIzquierda();\n }\n }", "@Override\r\n public Iterator iterator(){\n return new MyIterator(this);\r\n }", "@Override\n protected void runOneIteration() throws Exception {\n }", "public DatosIteracion mejorIteracionCapturados() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionCapturados(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionCapturados(array);\r\n\t}", "@Override\n public Iterator<T> iterator() {\n return this;\n }", "public void carroDescansando () {\n\t\t/* Método que passa vez a outras threads */\n\t\tyield();\n\t}", "public zzeiu iterator() {\n return new zzeio(this);\n }", "public Iterator2Iterador(Iterator<E> iterator) {\r\n\t\tthis.iterator = iterator;\r\n\t}", "public IterR(){\n }", "@Override\n public Iterator<NFetchMode> iterator() {\n return Arrays.asList(all).iterator();\n }", "@Override\n\tpublic Iterator<Arco<T>> obtenerArcos() {\n\t\tList arcos = new ArrayList<Arco<T>>();\n\t\tfor (Vertice v: listVertices){//agarro todos los arcos de todos los vertices\n\t\t\tarcos.add(v.getArcos());\n\t\t}\n \t\tIterator<Arco<T>> arcosIT = arcos.iterator();\n\t\treturn new IteradorArco(arcosIT);\n\t}", "private void setNextIterator() {\n\t\t\t\n\t\t\tfor (int i = index; i < inconsistencies.size(); i++){\n\t\t\t\tSet<LPGInconsistency> inconsistencyList = inconsistencies.get(i);\n\t\t\t\tif (!inconsistencyList.isEmpty()) {\n\t\t\t\t\titerator = inconsistencyList.iterator();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tindex++;\n\t\t\t}\n\t\t}", "OIterator<V> after();", "public void revolver() {\n this.lista = Lista.escojerAleatorio(this, this.size()).lista;\n }", "public static void main(String[] args) {\n//\t\tcrearNodos(cantNodos);\n//\t\tlista.extractFront();\n//\t\tlista.extractLast();\n//\t\tlista.insertLast(33);\n//\t\tlista.imprimir();\n//\t\t//System.out.print(lista.get(0));\n//\t\t\n//\t\tIterator<Integer> it1 = lista.iterator();\n//\t\t\twhile(it1.hasNext()) {\n//\t\t\t\tint valor = it1.next();\n//\t\t\t\tSystem.out.println(valor);\n//\t\t\t}\n//\t\tMyIterator<Integer> it2 = lista.iteratorReverse();\n//\t\t\twhile(it2.hasNext()) {\n//\t\t\t\tint valor = it2.back();\n//\t\t\t\tSystem.out.println(valor);\n//\t\t\t}\n\n\t\tlistaDeso1.insertFront(4);\n\t\tlistaDeso1.insertFront(2);\n\t\tlistaDeso1.insertFront(13);\n\t\tlistaDeso1.insertFront(7);\n\t\tlistaDeso1.insertFront(6);\n\n\t\tlistaDeso2.insertFront(9);\n\t\tlistaDeso2.insertFront(4);\n\t\tlistaDeso2.insertFront(6);\n\t\tlistaDeso2.insertFront(5);\n\t\tlistaDeso2.insertFront(13);\n\n//\t\tlistaOrde1.insertFront(2);\n//\t\tlistaOrde1.insertFront(4);\n//\t\tlistaOrde1.insertFront(6);\n//\t\tlistaOrde1.insertFront(8);\n//\t\tlistaOrde1.insertFront(11);\n//\t\t\n//\t\tlistaOrde2.insertFront(1);\n//\t\tlistaOrde2.insertFront(4);\n//\t\tlistaOrde2.insertFront(9);\n//\t\tlistaOrde2.insertFront(11);\n//\t\tlistaOrde2.insertFront(15);\n\t\t\n\t\tEje6<Integer> ord = new Eje6<Integer>();\n\t\t\n\t\tlista=ord.ambasDeso(listaDeso1, listaDeso2);\n\t}", "public DatosIteracion mejorIteracionOptimizada() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionOptimizada(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionOptimizada(array);\r\n\t}", "MoveIterator() {\n _c = 1; _r = 1; _dir = NOWHERE;\n incr();\n }", "public void setIteraciones(int iteraciones) {\r\n this.iteraciones = iteraciones;\r\n }", "protected Iterator rcIterator(){\n return this.mRCList.iterator();\n }", "public void ImprimirRelatorio(Iterator<Despesa> listaDespesa) {\n\t\t\n\t\tfloat totalGasto = 0.0f;\n\t\tString conteudo = \"\";\n\t\tImpressora imp;\n\t\ttotalGasto = calculadora.calcularDespesa(listaDespesa);\n\t\tconteudo = criarConteudo(totalGasto);\n\t\tso.imprimir(conteudo);\n\t}", "@Override\n public Iterator<T> iterator() {\n return new Itr();\n }", "@Override\n public Iterator<T> iterator() {\n return new Itr();\n }", "@Override\n public Iterator<T> iterator() {\n return forwardIterator();\n }", "@Override\r\n Iterator<E> iterator();", "@Override\n Iterator<T> iterator();", "public Individuo Recombinar(Individuo padre, Individuo madre) {\n Individuo hijo = new Individuo(padre.getCAMINOS());\r\n Individuo hijo2 = new Individuo(madre.getCAMINOS());\r\n for (int i = 0; i < padre.getEntradas_individuo().size(); i++) {\r\n if (i < padre.getCAMINOS() / 2) {\r\n Entradas entrada_1 = new Entradas(this.ENTRADAS,this.SUPERIOR,this.INFERIOR);\r\n entrada_1.setValores((ArrayList<Integer>) padre.getEntradas_individuo().get(i).getValores().clone());\r\n entrada_1.setEntradas((ArrayList<String>) padre.getEntradas_individuo().get(i).getEntradas().clone());\r\n entrada_1.setCamino_cubierto(padre.getEntradas_individuo().get(i).getCamino_cubierto());\r\n Entradas entrada_2 = new Entradas(this.ENTRADAS,this.SUPERIOR,this.INFERIOR);\r\n entrada_2.setValores((ArrayList<Integer>) madre.getEntradas_individuo().get(i).getValores().clone());\r\n entrada_2.setEntradas((ArrayList<String>) madre.getEntradas_individuo().get(i).getEntradas().clone());\r\n entrada_2.setCamino_cubierto(madre.getEntradas_individuo().get(i).getCamino_cubierto());\r\n hijo.getEntradas_individuo().add(entrada_1); \r\n hijo2.getEntradas_individuo().add(entrada_2);\r\n } else {\r\n Entradas entrada_1 = new Entradas(this.ENTRADAS,this.SUPERIOR,this.INFERIOR);\r\n entrada_1.setValores((ArrayList<Integer>) madre.getEntradas_individuo().get(i).getValores().clone());\r\n entrada_1.setEntradas((ArrayList<String>) madre.getEntradas_individuo().get(i).getEntradas().clone());\r\n entrada_1.setCamino_cubierto(madre.getEntradas_individuo().get(i).getCamino_cubierto());\r\n Entradas entrada_2 = new Entradas(this.ENTRADAS,this.SUPERIOR,this.INFERIOR);\r\n entrada_2.setValores((ArrayList<Integer>) padre.getEntradas_individuo().get(i).getValores().clone());\r\n entrada_2.setEntradas((ArrayList<String>) padre.getEntradas_individuo().get(i).getEntradas().clone());\r\n entrada_2.setCamino_cubierto(padre.getEntradas_individuo().get(i).getCamino_cubierto());\r\n hijo.getEntradas_individuo().add(entrada_1); \r\n hijo2.getEntradas_individuo().add(entrada_2);\r\n }\r\n }\r\n hijo.caminos_posibles = padre.caminos_posibles;\r\n hijo.caminos_cubiertos = padre.caminos_cubiertos;\r\n hijo2.caminos_posibles = madre.caminos_posibles;\r\n hijo2.caminos_cubiertos = madre.caminos_cubiertos;\r\n Document doc_copy_1 = (Document) this.doc.cloneNode(true);\r\n Document doc_copy_2 = (Document) this.doc.cloneNode(true);\r\n //Mutar(hijo);\r\n //Mutar(hijo2);\r\n hijo.EvaluarIndividuo(doc_copy_1);\r\n hijo2.EvaluarIndividuo(doc_copy_2);\r\n individuos.add(hijo);\r\n individuos.add(hijo2);\r\n if(hijo.getEvaluacion() > hijo2.getEvaluacion())\r\n {\r\n return hijo;\r\n }\r\n else\r\n {\r\n return hijo2;\r\n }\r\n }", "private void gobble(Iterator<String> iter) {\n }", "private void getRecepcionSeros(){\n mRecepcionSeros = estudioAdapter.getListaRecepcionSeroSinEnviar();\n //ca.close();\n }", "@VTID(14)\n java.util.Iterator<Com4jObject> iterator();", "private void moverCarritoGolf() {\n for (AutoGolf carrito : arrEnemigosCarritoGolf) {\n carrito.render(batch);\n\n carrito.moverIzquierda();\n }\n }", "@Override\n\tpublic Iterator<T> iteratorPostOrder() {\n\t\treturn null;\n\t}", "public void generTirarDados() {\n\r\n\t}", "@VTID(11)\r\n java.util.Iterator<Com4jObject> iterator();", "@DISPID(-4)\n @PropGet\n java.util.Iterator<Com4jObject> iterator();", "public void transcribir() \r\n\t{\r\n\t\tpalabras = new ArrayList<List<CruciCasillas>>();\r\n\t\tmanejadorArchivos = new CruciSerializacion();\r\n\t\tint contador = 0;\r\n\t\t\r\n\t\tmanejadorArchivos.leer(\"src/Archivos/crucigrama.txt\");\r\n\t\t\r\n\t\tfor(int x = 0;x<manejadorArchivos.getPalabras().size();x++){\r\n\t\t\t\r\n\t\t\tcontador++;\r\n\t\t\t\r\n\t\t\tif (contador == 4) {\r\n\t\t\t\r\n\t\t\t\tList<CruciCasillas> generico = new ArrayList<CruciCasillas>();\r\n\t\t\t\t\r\n\t\t\t\tfor(int y = 0; y < manejadorArchivos.getPalabras().get(x).length();y++)\r\n\t\t\t\t{\r\n\t\t\t\t\t\tgenerico.add(new CruciCasillas(manejadorArchivos.getPalabras().get(x).charAt(y)));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (y == (manejadorArchivos.getPalabras().get(x).length() - 1)) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tpalabras.add(generico);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tcontador = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t}", "public void setIterator(Iterator iterator) {\n/* 96 */ this.iterator = iterator;\n/* */ }", "@Test\n public void testIterator(){\n while(ROW_ITR.hasNext()){\n ROW_ITR.next();\n }\n }", "private static ArrayList<Compra> listComprasDoCliente(int idCliente) throws Exception {//Inicio mostraCompras\r\n ArrayList<Compra> lista = arqCompra.toList();\r\n lista.removeIf(c -> c.idCliente != idCliente);\r\n return lista;\r\n }", "@Override\n public Iterator<Integer> iterator() {\n return new Iterator<>() {\n int i = 0;\n\n @Override\n public boolean hasNext() {\n return i < Set.this.count;\n }\n\n @Override\n public Integer next() {\n return Set.this.arr[i++];\n }\n };\n }", "@Test\n public void testIterator() {\n System.out.println(\"iterator\");\n Goban g = createGoban();\n ArrayList<PierrePoint> groupeAttendu = new ArrayList<>();\n groupeAttendu.add(g.getPierre(0, 0));\n groupeAttendu.add(g.getPierre(0, 1));\n groupeAttendu.add(g.getPierre(1, 0));\n GroupeDePierres groupe = new GroupeDePierres(g.getPierre(0, 0), g);\n \n for( PierrePoint p : groupe)\n {\n assertTrue(groupeAttendu.contains(p));\n }\n \n assertEquals(groupeAttendu.size(),groupe.size());\n }", "@Override\n public Iterator<Object> iterator() {\n return new MyIterator();\n }", "protected abstract void recombineNext();", "@Override\n\tpublic Iterator<Forme> iterator() {\n\t\treturn this.formes.iterator();\n\t}", "@Override public T next(){\n Vertice v = pila.saca();\n T e = v.elemento;\n v = v.derecho;\n while (v != null) {\n pila.mete(v);\n v = v.izquierdo;\n }\n\t\treturn e;\n }", "@Override\n public Iterator<Space> iterator() {\n return row.iterator();\n }", "private void turnos() {\n\t\tfor(int i=0; i<JuegoListener.elementos.size(); i++){\n\t\t\tElemento elemento = JuegoListener.elementos.get(i);\n\t\t\t\n\t\t\telemento.jugar();\n\t\t}\n\t}", "private void restList() {\n for (Processus tmp : listOfProcess) {\n tmp.resetProcess();\n }\n }", "@Override\n public void reset() {\n iterator = collection.iterator();\n }", "private void limpiarDatos() {\n\t\t\n\t}", "@Override\r\n\tpublic Iterator<QuizCatalogus> iterator() {\n\t\treturn null;\r\n\t}", "@Override\n public void close() {\n CloserUtil.close(iterator);\n }", "final Iterator<T> iterateAndClear() {\n\t\t// Iteration is atomically destructive.\n\t\tObject iteratedValue = value.getAndSet(null);\n\t\treturn new IteratorImpl<>(iteratedValue);\n\t}", "@Override\r\n\tprotected void doNext() {\n\t\t\r\n\t}", "@Override\n public Iterator<T> iterator() {\n return items.iterator();\n }", "@Override\n\tpublic Iterator<Coffee> iterator() {\n\t\treturn null;\n\t}", "@Override\n public Iterator<T> impNiveles(){\n return (super.impNiveles());\n }", "public static void main(String[] args) {\n\n Cliente cliente1 = new Cliente(\"Arguello Leonel Alejandro\", \"Nueva Esperanza\", 775202);\n Cliente cliente2 = new Cliente(\"Orona Marcos Rodrigo\", \"BArgentino\", 989898);\n Cliente cliente3 = new Cliente(\"Galimberti Agustin Alejandro\", \"Zsur\", 45978);\n Cliente cliente4 = new Cliente(\"Vega Yair Herman\", \"DangerZone\", 7597425);\n Cliente cliente5 = new Cliente(\"Ortiz Dario\", \"Lejos\", 485692);\n\n// se va a crear una cola a partir de una linkedlist.\n Queue<Cliente> clientes= new LinkedList<>();\n //se añaden los elementos a la cola\n clientes.add(cliente1);\n clientes.add(cliente2);\n clientes.add(cliente3);\n clientes.add(cliente4);\n System.out.println(\"primer cola: \" + clientes);\n clientes.add(cliente5);\n System.out.println(\"clientes + cliente 5: \" + clientes);\n //se va a eliminar uno los elementos de la cola.\n clientes.remove(cliente3);\n System.out.println(\"la nueva cola es : \" + clientes);\n System.out.println(\"el cliente eliminado fue: \" + cliente3);\n\n //recorriendo la cola con un foreach!! :D\n clientes.forEach((cliente) -> {\n System.out.println(cliente);\n });\n //La naturaleza de las colas no es ordenarse, es decir no es lo ideal ya que su uso es para conseguir\n //una forma FIFO es decir que el primer elemento que ingrese, sea el primero en ser mostrado\n // para implementaciones de orden, lo ideal es usar Listas!\n }", "@Override\r\n\tpublic Iterator<T> iterator() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn this.iteratorInOrder();\r\n\t}", "@Override\n public Iterator<T> getHojas(){\n return (super.getHojas());\n }", "@Override\n public Iterator<Integer> convert(Iterator<Iterator<Integer>> it) throws IteratorException {\n return new Iterator<Integer>() {\n\n private Iterator<Integer> currentIterator;\n\n {\n if (it != null && it.hasNext()) {\n this.currentIterator = it.next();\n } else {\n throw new IteratorException(\"Iterator<Iterator<Integer>> must be not null!\");\n }\n }\n\n /**\n * This method returned true if the iterator has more elements.\n *\n * @return true if the iterator has more elements.\n */\n @Override\n public boolean hasNext() {\n boolean result = false;\n if (checkCurrentIterator(this.currentIterator) && this.currentIterator.hasNext()) {\n return true;\n } else if (it.hasNext()) {\n this.currentIterator = getIterator(it);\n return this.hasNext();\n }\n return result;\n\n }\n\n /**\n * This method returns the next even element in the iteration.\n *\n * @return the next even element in the iteration.\n */\n @Override\n public Integer next() {\n Integer result = null;\n if (checkCurrentIterator(this.currentIterator) && this.currentIterator.hasNext()) {\n while (this.currentIterator.hasNext()) {\n return this.currentIterator.next();\n }\n } else if (it.hasNext()) {\n this.currentIterator = getIterator(it);\n return this.next();\n }\n return result;\n }\n\n /**\n * This method return the next Iterator.\n *\n * @return the next Iterator.\n */\n private Iterator<Integer> getIterator(Iterator<Iterator<Integer>> iter) {\n Iterator<Integer> iterator = null;\n while (iter.hasNext()) {\n iterator = iter.next();\n break;\n }\n return iterator;\n }\n\n /**\n * This method checked Iterator<Integer> iter.\n *\n * @param iter Iterator<Integer> iter.\n * @return true if Iterator<Integer> iter not null.\n */\n private boolean checkCurrentIterator(Iterator<Integer> iter) {\n return iter != null;\n }\n };\n }", "public void ganarDineroPorAutomoviles() {\n for (Persona p : super.getMundo().getListaDoctores()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaCocineros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaAlbaniles()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaHerreros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaCocineros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n }", "public Iterator <item_t> iterator () {\n return new itor ();\n }", "public DAOTablaOperador() {\n\t\trecursos = new ArrayList<Object>();\n\t}", "public Iterator<Item> iterator() { return new ListIterator(); }", "public IterI(){\n }", "public Iterator<E> iterator(){\r\n return new IteratorHelper();\r\n }", "private void caricaLista() {\n /** variabili e costanti locali di lavoro */\n ArrayList unaLista = null;\n CampoDati unCampoDati = null;\n CDBLinkato unCampoDBLinkato = null;\n //@todo da cancellare\n try { // prova ad eseguire il codice\n /* recupera il campo DB specializzato */\n unCampoDBLinkato = (CDBLinkato)unCampoParente.getCampoDB();\n\n /* recupera la lista dal campo DB */\n unaLista = unCampoDBLinkato.caricaLista();\n\n /* recupera il campo dati */\n unCampoDati = unCampoParente.getCampoDati();\n\n /* registra i valori nel modello dei dati del campo */\n if (unaLista != null) {\n unCampoDati.setValoriInterni(unaLista);\n// unCampoDatiElenco.regolaElementiAggiuntivi();\n } /* fine del blocco if */\n\n } catch (Exception unErrore) { // intercetta l'errore\n /* mostra il messaggio di errore */\n Errore.crea(unErrore);\n } /* fine del blocco try-catch */\n\n }", "public void PrepareNextJogada() {\n if (vez == listaJogadores.size() - 1) {\n vez = 0;\n\n } else {\n vez++;\n }\n }", "@Override\n\t\t\tpublic Iterator<Integer> iterator() {\n\t\t\t\treturn new Iterator<Integer>() {\n\n\t\t\t\t\tint index = -1;\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void remove() {\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic Integer next() {\n\t\t\t\t\t\tif (index >= length)\n\t\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t\treturn offset + index * delta;\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean hasNext() {\n\t\t\t\t\t\treturn ++index < length;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}", "public static void main(String[] args) {\n ArrayList<Persona> cola = new ArrayList<>();\r\n \r\n generarCola(cola);\r\n \r\n //Creamos variables que nos seran útiles\r\n double recaudacion;\r\n double recaudacionTotal=0;\r\n Persona espectadorActual;\r\n int edadActual;\r\n int contadorPersonas=0;\r\n \r\n //Creamos el iterator\r\n Iterator<Persona> it=cola.iterator();\r\n \r\n \r\n //Recorremos la cola\r\n while(it.hasNext()){\r\n \r\n espectadorActual=it.next();\r\n \r\n //\"Atendemos\" al espectador para que pague\r\n edadActual=espectadorActual.getEdad();\r\n \r\n //Comprobamosla edad\r\n if(edadActual>=5 && edadActual<=10) { \r\n \trecaudacion=1; \r\n } else if(edadActual>=11 && edadActual<=17) {\r\n \trecaudacion=2.5;\r\n } else {\r\n \trecaudacion=3.5;\r\n }\r\n contadorPersonas++;\r\n recaudacionTotal+=recaudacion;\r\n \r\n System.out.println(\"Una persona de \"+edadActual+\" años se le ha cobrado \" +recaudacion+ \" euros\");\r\n \r\n }\r\n \r\n //Mostramos el resultado\r\n System.out.println(\"La recaudación es de \"+recaudacionTotal+\" euros y han venido \"+contadorPersonas);\r\n \r\n }", "@Override\n public Iterator<Restaurant> iterator () {\n return this.restaurantList.iterator();\n }", "@Override\n public Iterator<E> iterator(){\n return null;\n }", "public DAOTablaOperador() {\r\n\t\trecursos = new ArrayList<Object>();\r\n\t}", "Foreach createForeach();", "private void getObsequios(){\n mObsequios = estudioAdapter.getListaObsequiosSinEnviar();\n //ca.close();\n }", "public RunIterator iterator() {\n // Replace the following line with your solution.\n return new RunIterator(runs.getFirst());\n // You'll want to construct a new RunIterator, but first you'll need to\n // write a constructor in the RunIterator class.\n \n \n }", "public Collection<OrdenCompra> traerTodasLasOrdenesDeCompra() {\n Collection<OrdenCompra> resultado = null;\n try {\n controlOC = new ControlOrdenCompra();\n bitacora.info(\"Registro OrdenCompra Iniciado correctamente\");\n resultado = controlOC.traerTodasLasOrdenesDeCompra();\n } catch (IOException ex) {\n bitacora.error(\"No se pudo iniciar el registro OrdenCompra por \" + ex.getMessage());\n }\n return resultado;\n }", "public void reloadTableCliente() {\n\n this.removeAllData();// borramos toda la data \n for (int i = 0; i < (lista.size()); i++) { // este for va de la primera casilla hast ael largo del arreglo \n Cliente object = lista.get(i);\n this.AddtoTableCliente(object);\n }\n\n }", "@Override\n public Iterator<Integer> iterator() {\n return new IteratorImplementation();\n }", "@Override\n public Iterator<Item> iterator() {\n return new DequeIterator<Item>(first);\n }", "@Override\r\n\tpublic Iterator<T> iterator() {\n\t\treturn new Iterator<T>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic boolean hasNext() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tnodo<T> sig = sentinel;\r\n\t\t\t\tsentinel = sentinel.getNext();\r\n\t\t\t\treturn (sentinel != null) ? true : false;\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic T next() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\treturn sentinel.getValue();\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t}", "private void resetIterator() {\n\t\titerator = head;\n\t}", "public OpIterator iterator() {\n // some code goes here\n // throw new\n // UnsupportedOperationException(\"please implement me for lab2\");\n return new InterAggrIterator();\n }" ]
[ "0.692098", "0.6857741", "0.64886135", "0.6363798", "0.63234025", "0.63232815", "0.6194288", "0.6186084", "0.6163172", "0.61521715", "0.61305285", "0.61029303", "0.60938513", "0.6057746", "0.6014972", "0.59946156", "0.59726554", "0.5968486", "0.58997965", "0.58735925", "0.5871188", "0.5840759", "0.58395284", "0.58385956", "0.58319765", "0.5817106", "0.58141834", "0.5810901", "0.5803051", "0.57771564", "0.57722396", "0.57699054", "0.5761936", "0.576131", "0.57548046", "0.57440406", "0.5743282", "0.57363284", "0.57204884", "0.57204884", "0.57073444", "0.57047594", "0.57022285", "0.56976193", "0.56922", "0.56717527", "0.5668993", "0.56533813", "0.5647408", "0.56312215", "0.5630549", "0.5614918", "0.5614559", "0.5609294", "0.5603849", "0.56033504", "0.55914736", "0.558993", "0.5585239", "0.5577706", "0.5574678", "0.5572413", "0.5572082", "0.5569712", "0.5567452", "0.55616844", "0.5561374", "0.55563444", "0.5556331", "0.5555139", "0.55551076", "0.5550638", "0.5550361", "0.5540982", "0.5539903", "0.55360293", "0.5521913", "0.55128455", "0.55074465", "0.5504044", "0.5495767", "0.5492604", "0.5489725", "0.5475226", "0.5472841", "0.5470371", "0.5468041", "0.5467652", "0.5462856", "0.54611766", "0.5459632", "0.5454051", "0.5453023", "0.544672", "0.5441651", "0.54319745", "0.54302126", "0.5415654", "0.541321", "0.5410989", "0.54092056" ]
0.0
-1
========================================================================== Misc. Method(s) ========================================================================== JBuilder init method. Constructs the Add Vehicle Dialog. Using XYLayout to allow rapid building, final version will use swing layout manager(s).
void jbInit() throws Exception { //setup file dialog filer1.setFrame(f); filer1.setMode(FileDialog.LOAD); filer1.setTitle("Select Vehicle Image"); panel1.setLayout(xYLayout1); jLabel1.setFont(new java.awt.Font("Dialog", 1, 12)); jLabel1.setText("VIN"); jLabel2.setFont(new java.awt.Font("Dialog", 1, 12)); jLabel2.setText("Name"); jLabel3.setFont(new java.awt.Font("Dialog", 1, 12)); jLabel3.setText("Year"); jLabel4.setFont(new java.awt.Font("Dialog", 1, 12)); jLabel4.setText("Make"); jLabel5.setFont(new java.awt.Font("Dialog", 1, 12)); jLabel5.setText("Model"); jLabel6.setFont(new java.awt.Font("Dialog", 1, 12)); jLabel6.setText("Color"); jLabel7.setFont(new java.awt.Font("Dialog", 1, 12)); jLabel7.setText("Mileage"); jLabel8.setForeground(Color.darkGray); jLabel8.setText("(Required)"); addButton.setText("Add Vehicle"); addButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { addButton_actionPerformed(e); } }); cancelButton.setText("Cancel "); cancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { cancelButton_actionPerformed(e); } }); panel1.setBorder(BorderFactory.createLineBorder(Color.black)); jLabel9.setForeground(Color.darkGray); jLabel9.setText("(Required)"); xYLayout1.setHeight(300); xYLayout1.setWidth(462); imagePath.setText("Path to vehicle image"); jButton1.setText("jButton1"); imageLabel.setFont(new java.awt.Font("SansSerif", 1, 12)); imageLabel.setText("Vehicle Image"); getContentPane().add(panel1); panel1.add(jLabel2, new XYConstraints(11, 56, 45, 26)); panel1.add(jLabel1, new XYConstraints(11, 21, 45, 26)); panel1.add(jLabel8, new XYConstraints(306, 21, 76, 20)); panel1.add(vinField, new XYConstraints(92, 21, 196, 26)); panel1.add(nameField, new XYConstraints(92, 56, 159, 26)); panel1.add(mileageField, new XYConstraints(92, 232, 130, 26)); panel1.add(jLabel7, new XYConstraints(11, 232, 45, 26)); panel1.add(jLabel3, new XYConstraints(11, 91, 45, 26)); panel1.add(jLabel5, new XYConstraints(11, 165, 45, 26)); panel1.add(jLabel6, new XYConstraints(11, 200, 45, 26)); panel1.add(yearField, new XYConstraints(92, 91, 74, 26)); panel1.add(modelField, new XYConstraints(92, 165, 130, 26)); panel1.add(colorField, new XYConstraints(92, 200, 130, 26)); panel1.add(makeField, new XYConstraints(92, 128, 130, 26)); panel1.add(jLabel4, new XYConstraints(11, 128, 45, 26)); panel1.add(cancelButton, new XYConstraints(233, 267, 102, 29)); panel1.add(addButton, new XYConstraints(50, 267, 102, 29)); panel1.add(jLabel9, new XYConstraints(306, 60, 76, 20)); panel1.add(imagePath, new XYConstraints(241, 128, 180, 26)); panel1.add(imageLabel, new XYConstraints(241, 103, 97, 22)); panel1.add(jButton1, new XYConstraints(428, 129, 25, 24)); panel1.add(vehicleImageLabel, new XYConstraints(242, 163, 209, 95)); //add listeners imagePath.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(FocusEvent e) { imagePath_focusLost(e); } }); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CarRentalGUI() {\n initComponents();\n this.setLocationRelativeTo(null);\n\n //set outer border\n Border globalBorder = BorderFactory.createMatteBorder(1, 1, 1, 1, Color.BLUE);\n jPanel6.setBorder(globalBorder);\n\n Border labelBorder = BorderFactory.createMatteBorder(1, 1, 1, 1, Color.black);\n minimazeLabel.setBorder(labelBorder);\n closeLabel.setBorder(labelBorder);\n\n createSocket();\n fillExistCombo();\n }", "public UpdateVehicleForm() {\n initComponents();\n\n regNum_txt.setDocument(new LengthRestrictedDocument(8));\n engine_serial_no_txt.setDocument(new LengthRestrictedDocument(10));\n chassisNo_txt.setDocument(new LengthRestrictedDocument(9));\n\n this.setLocationRelativeTo(null);\n this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);\n }", "public AddVehicleShowPage() {\n initComponents();\n }", "public AddAnimalDialog(JFrame frame, String name, String animalFamilyType, String tourType) {\n super(frame, name);\n setLayout(new GridBagLayout());\n\n this.animalFamilyType = animalFamilyType;\n this.tourType = tourType;\n\n imgLabel = new JLabel();\n\n TitledBorder titledBorder = new TitledBorder(\"Current Tournament - \" + animalFamilyType + \" , \" + tourType);\n titledBorder.setTitleColor(Color.RED);\n CompoundBorder border = new CompoundBorder(new EmptyBorder(5, 5, 5, 5), titledBorder);\n super.getRootPane().setBorder(border);\n\n gbc.insets = new Insets(5, 5, 5, 5);\n\n //add the name label\n gbc.fill = GridBagConstraints.HORIZONTAL;\n add(nameLabel, gbc);\n\n //add the name text field\n gbc.gridx = 2;\n gbc.weightx = GridBagConstraints.BOTH;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n add(nameTextField, gbc);\n\n //add the image label\n gbc.gridy = 2;\n gbc.gridx = 0;\n add(imageLabel, gbc);\n\n //add image combobox\n chooseAddItemsToJcb();\n gbc.weightx = GridBagConstraints.BOTH;\n gbc.gridx = 2;\n this.add(imageCbox, gbc);\n\n //add the gender label\n gbc.gridy = 5;\n gbc.gridx = 0;\n add(genLabel, gbc);\n\n //add the radio buttons for gender\n gbc.gridx = 1;\n maleBtn.setActionCommand(\"Male\");\n add(maleBtn, gbc);\n gbc.gridx = 2;\n hermaBtn.setActionCommand(\"Hermaphrodite\");\n add(hermaBtn, gbc);\n gbc.gridx = 3;\n femaleBtn.setActionCommand(\"Female\");\n add(femaleBtn, gbc);\n\n //add buttons to group buttons\n buttons.add(maleBtn);\n buttons.add(femaleBtn);\n buttons.add(hermaBtn);\n\n gbc.gridwidth = 0;\n //add the speed label\n gbc.gridy = 7;\n gbc.gridx = 0;\n add(speedLabel, gbc);\n\n //add the speed slider\n gbc.gridx = 1;\n add(speedSlider, gbc);\n\n //add energy consumption label\n gbc.gridx = 0;\n gbc.gridy = 8;\n add(engLabel, gbc);\n\n //add energy consumption slider\n gbc.gridx = 1;\n add(engSlider, gbc);\n\n //add image choice label\n gbc.gridwidth = 3;\n gbc.gridy = 9;\n gbc.gridx = 0;\n add(imgChoiceLabel, gbc);\n\n //add the create button\n gbc.gridwidth = 2;\n gbc.gridx = 1;\n gbc.gridy = 10;\n gbc.fill = GridBagConstraints.BOTH;\n add(createBtn, gbc);\n\n //adds the matching image\n gbc.fill = GridBagConstraints.HORIZONTAL;\n gbc.gridy = 9;\n gbc.gridx = 2;\n showImage();\n\n nameTextField.addActionListener(this);\n imageCbox.addActionListener(this);\n maleBtn.addActionListener(this);\n hermaBtn.addActionListener(this);\n femaleBtn.addActionListener(this);\n\n speedSlider.setMajorTickSpacing(1);\n speedSlider.setPaintTicks(true);\n speedSlider.setPaintLabels(true);\n\n engSlider.setMajorTickSpacing(10);\n engSlider.setPaintTicks(true);\n engSlider.setPaintLabels(true);\n\n activateSliders();\n\n this.setSize(600, 450);\n this.setVisible(true);\n }", "public RelationshipDialog() {\n super(getRTParent(), \"Add Relationship...\", true);\n getContentPane().setLayout(new BorderLayout(5,5));\n JPanel center = new JPanel(new GridLayout(5,2,5,5));\n center.add(new JLabel(\"From\")); \n center.add(new JLabel(\"To\"));\n\n String blanks[] = KeyMaker.blanks(getRTParent().getRootBundles().getGlobals());\n center.add(from_cb = new JComboBox(blanks));\n center.add(to_cb = new JComboBox(blanks));\n\n center.add(from_symbol_cb = new JComboBox(Utils.SHAPE_STRS));\n center.add(to_symbol_cb = new JComboBox(Utils.SHAPE_STRS));\n center.add(from_typed_cb = new JCheckBox(\"Field Typed\", false));\n center.add(to_typed_cb = new JCheckBox(\"Field Typed\", false));\n center.add(ignore_ns_cb = new JCheckBox(\"Ignore Not Sets\", true));\n getContentPane().add(\"Center\", center);\n\n getContentPane().add(\"North\", style_cb = new JComboBox(STYLE_STRS));\n\n JPanel bottom = new JPanel(new FlowLayout());\n JButton add_bt, cancel_bt;\n bottom.add(add_bt = new JButton(\"Add\"));\n bottom.add(cancel_bt = new JButton(\"Cancel\"));\n getContentPane().add(\"South\", bottom);\n\n // Add listeners\n cancel_bt.addActionListener(new ActionListener() { \n public void actionPerformed(ActionEvent ae) { setVisible(false); dispose(); } } );\n add_bt.addActionListener(new ActionListener() { \n public void actionPerformed(ActionEvent ae) {\n setVisible(false); dispose();\n\t addRelationship((String) from_cb.getSelectedItem(), \n\t (String) from_symbol_cb.getSelectedItem(),\n\t \t\t from_typed_cb.isSelected(),\n\t (String) to_cb.getSelectedItem(), \n\t (String) to_symbol_cb.getSelectedItem(),\n\t\t \t to_typed_cb.isSelected(),\n (String) style_cb.getSelectedItem(), \n\t\t\t ignore_ns_cb.isSelected(), \n\t\t\t false);\n } } );\n pack(); setVisible(true);\n }", "private void initComponent() \n\t{\n\t\t// Setting the frame bounds\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tsetBounds(100, 100, 579, 366);\n\t\t// adding the content pane\n\t\t// and setting the empty border \n\t\tcontentPane = new JPanel();\n\t\tcontentPane.setBorder(new EmptyBorder(5, 5, 5, 5));\n\t\tsetContentPane(contentPane);\n\n\t\t//Label Hotels Options \n\t\tlblHotelsOptions = new JLabel(\"Hotels Options\");\n\t\t// JComboBox Hotels Options displays the 5 different options \n\t\tcbHotelsOptions = new JComboBox(hotelsModel);\n\n\t\t// Setting new panel for the reservation's list\n\t\tpanel = new JPanel();\n\t\tpanel.setBorder(new TitledBorder(null, \"Reservations:\", TitledBorder.LEADING, TitledBorder.TOP, null, null));\n\t\t// Declaring labels for certification \n\t\tlblCheckIn = new JLabel(\"Check-In Info\");\n\t\tlblCheckIn.setVisible(false);\n\t\tlblInMonth = new JLabel(\"Month:\");\n\t\tlblInMonth.setVisible(false);\n\t\tlblInDay = new JLabel(\"Day:\");\n\t\tlblInDay.setVisible(false);\n\t\tlblCheckout = new JLabel(\"Check-Out Info\");\n\t\tlblCheckout.setVisible(false);\n\t\tlblOutMonth = new JLabel(\"Month:\");\n\t\tlblOutMonth.setVisible(false);\n\t\tlblOutDay = new JLabel(\"Day:\");\n\t\tlblOutDay.setVisible(false);\n\t\t// Declaring text fields to allow the user to write in them\n\t\ttxtInMonth = new JTextField();\n\t\ttxtInMonth.setVisible(false);\n\t\ttxtInMonth.setColumns(10);\n\t\ttxtInDay = new JTextField();\n\t\ttxtInDay.setVisible(false);\n\t\ttxtInDay.setColumns(10);\n\t\ttxtOutMonth = new JTextField();\n\t\ttxtOutMonth.setVisible(false);\n\t\ttxtOutMonth.setColumns(10);\n\t\ttxtOutDay = new JTextField();\n\t\ttxtOutDay.setVisible(false);\n\t\ttxtOutDay.setColumns(10);\n\t\t// Declaring the add button\n\t\tbtnAdd = new JButton(\">>\");\n\t\tbtnAdd.setVisible(false);\n\n\t\t// UGLY CODE\n\t\tGroupLayout gl_contentPane = new GroupLayout(contentPane);\n\t\tgl_contentPane.setHorizontalGroup(\n\t\t\t\tgl_contentPane.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(gl_contentPane.createSequentialGroup()\n\t\t\t\t\t\t.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t.addGroup(gl_contentPane.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(gl_contentPane.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblHotelsOptions)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(cbHotelsOptions, GroupLayout.PREFERRED_SIZE, 141, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(Alignment.LEADING, gl_contentPane.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblOutMonth)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(txtOutMonth, GroupLayout.PREFERRED_SIZE, 61, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblOutDay)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(txtOutDay, 0, 0, Short.MAX_VALUE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(Alignment.LEADING, gl_contentPane.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(Alignment.LEADING, gl_contentPane.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblInMonth)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(txtInMonth, 0, 0, Short.MAX_VALUE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblCheckIn, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 115, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblInDay)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(txtInDay, GroupLayout.PREFERRED_SIZE, 67, GroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(55))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(gl_contentPane.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblCheckout, GroupLayout.PREFERRED_SIZE, 124, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(btnAdd, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(18)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(panel, GroupLayout.PREFERRED_SIZE, 242, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addContainerGap())\n\t\t\t\t);\n\t\tgl_contentPane.setVerticalGroup(\n\t\t\t\tgl_contentPane.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t.addGroup(Alignment.LEADING, gl_contentPane.createSequentialGroup()\n\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t.addComponent(panel, GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t.addGroup(gl_contentPane.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblHotelsOptions)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(cbHotelsOptions, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(84)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblCheckIn)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblInMonth)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(txtInMonth, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblInDay)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(txtInDay, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblCheckout)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(btnAdd))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblOutMonth)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(txtOutMonth, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblOutDay)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(txtOutDay, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addContainerGap())\n\t\t\t\t);\n\t\t// Declaring the scroll Pane\n\t\tscrollPane = new JScrollPane();\n\t\tGroupLayout gl_panel = new GroupLayout(panel);\n\t\tgl_panel.setHorizontalGroup(\n\t\t\t\tgl_panel.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(gl_panel.createSequentialGroup()\n\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t.addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 239, Short.MAX_VALUE)\n\t\t\t\t\t\t.addGap(1))\n\t\t\t\t);\n\t\tgl_panel.setVerticalGroup(\n\t\t\t\tgl_panel.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(gl_panel.createSequentialGroup()\n\t\t\t\t\t\t.addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 329, Short.MAX_VALUE)\n\t\t\t\t\t\t.addGap(1))\n\t\t\t\t);\n\n\t\t// Declaring the reservation's list in the scroll pane\n\t\tscrollPane.setViewportView(lstReservation);\n\t\t// Declaring the reservation's list\n\t\tlstReservation = new JList(reservationsModel);\n\t\tscrollPane.setViewportView(lstReservation);\n\t\tpanel.setLayout(gl_panel);\n\t\tcontentPane.setLayout(gl_contentPane);\n\n\t\t// Calling the initHotelsAndReservations method\n\t\tinitHotelsAndReservations();\n\t}", "void buildBasicGUI()\r\n\t{\r\n\t\tJLabel dateLabel;\r\n\t\tJLabel nameLabel;\r\n\t\tJLabel codeLabel;\r\n\t\tJLabel inMileLabel;\r\n\t\tJLabel retMileLabel;\r\n\t\tJLabel billRateLabel;\r\n\t\tJLabel comLabel;\r\n\r\n\t\tdateLabel = new JLabel(\"Date (MM-dd-yyyy)\");\r\n\t\tnameLabel = new JLabel(\"Patient Name\");\r\n\t\tcodeLabel = new JLabel(\"Service Code\");\r\n\t\tinMileLabel = new JLabel(\"Initial Miles\");\r\n\t\tretMileLabel = new JLabel(\"Return Miles\");\r\n\t\tbillRateLabel = new JLabel(\"Bill Rate\");\r\n\t\tcomLabel = new JLabel(\"Comment\");\r\n\r\n\t\tdateOfTripTF = new JTextField(\"\");\r\n\t\tpatientNameTF = new JTextField(\"\");\r\n\t\tinitialMileTF = new JTextField(\"\");\r\n\t\tretMileTF = new JTextField(\"\");\r\n\t\tbillRateTF = new JTextField(\"\");\r\n\t\tcommentTF = new JTextField(\"\");\r\n\r\n\t\tString[] array = new String[]{\"A0428 Non-emergency transport\",\r\n\t\t\t\t\t\t\t\t\t\t\"A0429 Emergency transport\",\r\n\t\t\t\t\t\t\t\t\t\t\"A0427 Advanced life support\",\r\n\t\t\t\t\t\t\t\t\t\t\"A0434 Specialty care transport\"};\r\n\r\n\t\tservCodeList = new JComboBox(array);\r\n\r\n\t\tJPanel panel = new JPanel();\r\n\t\tGroupLayout layout = new GroupLayout(panel);\r\n\t\tpanel.setLayout(layout);\r\n\r\n\t\tlayout.setAutoCreateGaps(true);\r\n\r\n\t\tlayout.setAutoCreateContainerGaps(true);\r\n\r\n\t\tGroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();\r\n\r\n\t\thGroup.addGroup(layout.createParallelGroup().addComponent(dateLabel).\r\n\t\t\t\taddComponent(nameLabel).addComponent(codeLabel).\r\n\t\t\t\taddComponent(inMileLabel).addComponent(retMileLabel).\r\n\t\t\t\taddComponent(billRateLabel).addComponent(comLabel));\r\n\r\n\t\thGroup.addGroup(layout.createParallelGroup().addComponent(dateOfTripTF).\r\n\t\t\t\taddComponent(patientNameTF).addComponent(servCodeList).\r\n\t\t\t\taddComponent(initialMileTF).addComponent(retMileTF).addComponent(billRateTF).\r\n\t\t\t\taddComponent(commentTF));\r\n\r\n\t\tlayout.setHorizontalGroup(hGroup);\r\n\r\n\t\tGroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();\r\n\r\n\t\tvGroup.addGroup(layout.createParallelGroup(Alignment.BASELINE).\r\n\t\t\t\taddComponent(dateLabel).addComponent(dateOfTripTF));\r\n\r\n\t\tvGroup.addGroup(layout.createParallelGroup(Alignment.BASELINE).\r\n\t\t\t\taddComponent(nameLabel).addComponent(patientNameTF));\r\n\r\n\t\tvGroup.addGroup(layout.createParallelGroup(Alignment.BASELINE).\r\n\t\t\t\taddComponent(codeLabel).addComponent(servCodeList));\r\n\r\n\t\tvGroup.addGroup(layout.createParallelGroup(Alignment.BASELINE).\r\n\t\t\t\taddComponent(inMileLabel).addComponent(initialMileTF));\r\n\r\n\t\tvGroup.addGroup(layout.createParallelGroup(Alignment.BASELINE).\r\n\t\t\t\taddComponent(retMileLabel).addComponent(retMileTF));\r\n\r\n\t\tvGroup.addGroup(layout.createParallelGroup(Alignment.BASELINE).\r\n\t\t\t\taddComponent(billRateLabel).addComponent(billRateTF));\r\n\r\n\t\tvGroup.addGroup(layout.createParallelGroup(Alignment.BASELINE).\r\n\t\t\t\taddComponent(comLabel).addComponent(commentTF));\r\n\r\n\t\tlayout.setVerticalGroup(vGroup);\r\n\r\n\t\tadd(panel, BorderLayout.CENTER);\r\n\r\n\t\t//setupDialog();\r\n\t}", "private void buildGUI() {\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setTitle(\"Swing Client Demo - CORBA\");\n \n GridLayout westGridLayout = new GridLayout(4, 1); // rows, columns\n westGridLayout.setHgap(10);\n westGridLayout.setVgap(10);\n JPanel dataEntryWestJPanel = new JPanel(westGridLayout); \n dataEntryWestJPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0));\n \n GridLayout dataEntryGridLayout = new GridLayout(4, 1); // rows, columns\n dataEntryGridLayout.setHgap(10);\n dataEntryGridLayout.setVgap(10);\n JPanel dataEntryCenterJPanel = new JPanel(dataEntryGridLayout);\n dataEntryCenterJPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 10));\n \n FlowLayout buttonLayout = new FlowLayout(FlowLayout.RIGHT);\n buttonLayout.setHgap(10);\n JPanel dataEntryButtonJPanel = new JPanel(buttonLayout);\n \n \n JPanel dataEntryJPanel = new JPanel(new BorderLayout());\n JPanel dataViewJPanel = new JPanel(new GridLayout(1, 1));\n dataViewJPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));\n\n JLabel recordNumLbl = new JLabel(\"Record Number\");\n JLabel omegaLbl = new JLabel(\"Omega\");\n JLabel thetaLbl = new JLabel(\"Theta\");\n JLabel deltaLbl = new JLabel(\"Delat\");\n JLabel uuidLbl = new JLabel(\"UUID\");\n JLabel idLbl = new JLabel(\"ID\");\n\n JButton addJButton = new JButton(\"Add Tuna\");\n JButton viewAllJButton = new JButton(\"View All Tunas\");\n JButton cleanJButton = new JButton(\"Clean text fields\");\n \n recordNumLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));//top,left,bottom,right\n omegaLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));\n thetaLbl.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));\n deltaLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));\n uuidLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));\n idLbl.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));\n \n TunaTxtArea.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));\n addJButton.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));\n viewAllJButton.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));\n cleanJButton.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));\n \n dataEntryWestJPanel.add(recordNumLbl);\n dataEntryWestJPanel.add(omegaLbl);\n dataEntryWestJPanel.add(thetaLbl);\n dataEntryWestJPanel.add(deltaLbl);\n dataEntryWestJPanel.add(uuidLbl);\n dataEntryWestJPanel.add(idLbl);\n\n dataEntryButtonJPanel.add(addJButton);\n dataEntryButtonJPanel.add(viewAllJButton);\n dataEntryButtonJPanel.add(cleanJButton);\n\n dataEntryCenterJPanel.add(recordNumTxtField);\n dataEntryCenterJPanel.add(omegaTxtField);\n dataEntryCenterJPanel.add(thetaTxtField);\n dataEntryCenterJPanel.add(deltaTxtField);\n dataEntryCenterJPanel.add(uuidTxtField);\n dataEntryCenterJPanel.add(idTxtField);\n dataEntryCenterJPanel.add(dataEntryButtonJPanel);\n\n dataEntryJPanel.add(dataEntryWestJPanel, BorderLayout.WEST);\n dataEntryJPanel.add(dataEntryCenterJPanel, BorderLayout.CENTER);\n\n JScrollPane scrollPane = new JScrollPane(TunaTxtArea);\n scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);\n dataViewJPanel.add(scrollPane);\n\n this.getContentPane().add(dataEntryJPanel, BorderLayout.NORTH);\n this.getContentPane().add(dataViewJPanel, BorderLayout.CENTER);\n\n addJButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n try {\n if(remoteTuna != null){\n Tuna Tuna = new Tuna();\n Tuna.setRecordNumber(Integer.parseInt(recordNumTxtField.getText()));\n Tuna.setOmega(omegaTxtField.getText());\n Tuna.setLambda(thetaTxtField.getText());\n Tuna.setOmega(deltaTxtField.getText());\n Tuna.setLambda(uuidTxtField.getText());\n Tuna.setOmega(idTxtField.getText());\n \n remoteTuna.create(Tuna);\n }\n else{\n JOptionPane.showMessageDialog(\n Assignment4SwingClient.this, \"Problem. No remote object available\");\n }\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(\n Assignment4SwingClient.this, \"Problem Cause: \\n\" + ex.getMessage());\n }\n }\n });\n\n viewAllJButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n try {\n if(remoteTuna != null){\n List<Tuna> tunas = remoteTuna.findAll();\n TunaTxtArea.setText(\"\");\n for (Tuna s : tunas) {\n TunaTxtArea.append(s.toString() + \"\\n\");\n }\n }\n else{\n JOptionPane.showMessageDialog(\n Assignment4SwingClient.this, \"Problem. No remote object available\");\n }\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(\n Assignment4SwingClient.this, \"Problem Cause: \\n\" + ex.getMessage());\n }\n }\n });\n \n /** click on clean button to bound to an event to clean the data hold in the text fields */\n cleanJButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n recordNumTxtField.setText(\"\");\n omegaTxtField.setText(\"\");\n thetaTxtField.setText(\"\");\n deltaTxtField.setText(\"\");\n uuidTxtField.setText(\"\");\n idTxtField.setText(\"\");\n }\n });\n\n //this.pack();\n this.setSize(800, 600);\n // null causes window to be centered on screen\n // see: stackoverflow.com (). How to set JFrame to appear centered, regardless of monitor resolution? Retrieved from\n // https://stackoverflow.com/questions/2442599/how-to-set-jframe-to-appear-centered-regardless-of-monitor-resolution\n this.setLocationRelativeTo(null);\n this.setVisible(true);\n this.setResizable(true);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n carDialog = new javax.swing.JDialog();\n saveDlgBtn = new javax.swing.JButton();\n deleteDlgBtn = new javax.swing.JButton();\n cancelDlgBtn = new javax.swing.JButton();\n jPanel4 = new javax.swing.JPanel();\n classCB = new javax.swing.JComboBox();\n yearDlgLbl = new javax.swing.JLabel();\n modelDlgTxt = new javax.swing.JTextField();\n classDlgLbl = new javax.swing.JLabel();\n colorDlgTxt = new javax.swing.JTextField();\n yearDlgSpn = new javax.swing.JSpinner();\n colorDlgLbl = new javax.swing.JLabel();\n statusDlgCB = new javax.swing.JComboBox();\n statusDlgLbl = new javax.swing.JLabel();\n plateDlgLbl = new javax.swing.JLabel();\n plateDlgTxt = new javax.swing.JTextField();\n brandDlgLbl = new javax.swing.JLabel();\n modelDlgLbl = new javax.swing.JLabel();\n brandDlgTxt = new javax.swing.JTextField();\n jPanel5 = new javax.swing.JPanel();\n serviceMonthDlgSpn = new javax.swing.JSpinner();\n milieageDlgTxt = new javax.swing.JTextField();\n mileageDlgLbl = new javax.swing.JLabel();\n branchCB = new javax.swing.JComboBox();\n branchDlgLbl = new javax.swing.JLabel();\n lastServiceMileageDlgTxt = new javax.swing.JTextField();\n lastServiceMileageDlgLbl = new javax.swing.JLabel();\n lastServiceDlgLbl = new javax.swing.JLabel();\n serviceMilesDlgLbl = new javax.swing.JLabel();\n serviceMilesDlgTxt = new javax.swing.JTextField();\n serviceMonthDlgLbl = new javax.swing.JLabel();\n carClassDialog = new javax.swing.JDialog();\n nameDlgLbl = new javax.swing.JLabel();\n nameDlgTxt = new javax.swing.JTextField();\n displayNameDlgLbl = new javax.swing.JLabel();\n displayNameDlgTxt = new javax.swing.JTextField();\n priceDlgLbl = new javax.swing.JLabel();\n priceDlgTxt = new javax.swing.JTextField();\n saveDlgBtn1 = new javax.swing.JButton();\n deleteDlgBtn1 = new javax.swing.JButton();\n cancelDlgBtn1 = new javax.swing.JButton();\n descriptionDlgLbl = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTextArea1 = new javax.swing.JTextArea();\n staffDialog = new javax.swing.JDialog();\n saveDlgBtn2 = new javax.swing.JButton();\n deleteDlgBtn2 = new javax.swing.JButton();\n cancelDlgBtn2 = new javax.swing.JButton();\n jPanel1 = new javax.swing.JPanel();\n staffNameDlgLbl = new javax.swing.JLabel();\n surnameDlgLbl = new javax.swing.JLabel();\n usernameDlgLbl = new javax.swing.JLabel();\n passwordDlgLbl = new javax.swing.JLabel();\n passwordPwd = new javax.swing.JPasswordField();\n usernameDlgTxt = new javax.swing.JTextField();\n surnameDlgTxt = new javax.swing.JTextField();\n staffNameDlgTxt = new javax.swing.JTextField();\n jPanel3 = new javax.swing.JPanel();\n jScrollPane6 = new javax.swing.JScrollPane();\n addressDlgTA = new javax.swing.JTextArea();\n addressDlgLbl = new javax.swing.JLabel();\n jPanel2 = new javax.swing.JPanel();\n dateOfBirthDlgLbl = new javax.swing.JLabel();\n emailDlgLbl = new javax.swing.JLabel();\n PhoneDlgLbl = new javax.swing.JLabel();\n emailDlgTxt = new javax.swing.JTextField();\n phoneDlgTxt = new javax.swing.JTextField();\n extensionDlg = new javax.swing.JDialog();\n oldDateLbl = new javax.swing.JLabel();\n oldDateDP = new org.jdesktop.swingx.JXDatePicker();\n newDateLbl = new javax.swing.JLabel();\n newDateDP = new org.jdesktop.swingx.JXDatePicker();\n Extendsbtn = new javax.swing.JButton();\n mainPanel = new javax.swing.JPanel();\n tabPanel = new javax.swing.JTabbedPane();\n staffPanel = new javax.swing.JPanel();\n carClassSearchPanel1 = new javax.swing.JPanel();\n staffNameLbl = new javax.swing.JLabel();\n staffSurnameLbl = new javax.swing.JLabel();\n staffNameTxt = new javax.swing.JTextField();\n staffSurnameTxt = new javax.swing.JTextField();\n staffAddBtn = new javax.swing.JButton();\n staffClearBtn = new javax.swing.JButton();\n jScrollPane5 = new javax.swing.JScrollPane();\n staffTbl = new org.jdesktop.swingx.JXTable();\n rentalPanel = new javax.swing.JPanel();\n rentalSearchPanel = new javax.swing.JPanel();\n refCodeLbl = new javax.swing.JLabel();\n rentalRefCodeTxt = new javax.swing.JTextField();\n surnameLbl = new javax.swing.JLabel();\n rentalSurnameTxt = new javax.swing.JTextField();\n rentalClearBtn = new javax.swing.JButton();\n rentalDeleteBtn = new javax.swing.JButton();\n jScrollPane2 = new javax.swing.JScrollPane();\n rentalTbl = new org.jdesktop.swingx.JXTable();\n carPanel = new javax.swing.JPanel();\n carSearchPanel = new javax.swing.JPanel();\n plateLbl = new javax.swing.JLabel();\n brandLbl = new javax.swing.JLabel();\n modelLbl = new javax.swing.JLabel();\n classLbl = new javax.swing.JLabel();\n yearLbl = new javax.swing.JLabel();\n colorLbl = new javax.swing.JLabel();\n statusLbl = new javax.swing.JLabel();\n carPlateTxt = new javax.swing.JTextField();\n carBrandTxt = new javax.swing.JTextField();\n carModelTxt = new javax.swing.JTextField();\n carClassCb = new javax.swing.JComboBox();\n carYearTxt = new javax.swing.JTextField();\n carColorTxt = new javax.swing.JTextField();\n carStatusCB = new javax.swing.JComboBox();\n carAddBtn = new javax.swing.JButton();\n carClearBtn = new javax.swing.JButton();\n jScrollPane3 = new javax.swing.JScrollPane();\n carTbl = new org.jdesktop.swingx.JXTable();\n carClassPanel = new javax.swing.JPanel();\n carClassSearchPanel = new javax.swing.JPanel();\n carClassNameLbl = new javax.swing.JLabel();\n carClassDisplayLbl = new javax.swing.JLabel();\n carClassNameTxt = new javax.swing.JTextField();\n carClassDisplayTxt = new javax.swing.JTextField();\n carClassClearBtn = new javax.swing.JButton();\n carClassAddBtn = new javax.swing.JButton();\n jScrollPane4 = new javax.swing.JScrollPane();\n carClassTbl = new org.jdesktop.swingx.JXTable();\n openStaffBtn = new javax.swing.JButton();\n\n carDialog.setAlwaysOnTop(true);\n carDialog.setMinimumSize(new java.awt.Dimension(550, 271));\n carDialog.setName(\"carDialog\"); // NOI18N\n\n org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance().getContext().getResourceMap(AdminView.class);\n saveDlgBtn.setText(resourceMap.getString(\"saveDlgBtn.text\")); // NOI18N\n saveDlgBtn.setName(\"saveDlgBtn\"); // NOI18N\n\n deleteDlgBtn.setText(resourceMap.getString(\"deleteDlgBtn.text\")); // NOI18N\n deleteDlgBtn.setName(\"deleteDlgBtn\"); // NOI18N\n\n cancelDlgBtn.setText(resourceMap.getString(\"cancelDlgBtn.text\")); // NOI18N\n cancelDlgBtn.setName(\"cancelDlgBtn\"); // NOI18N\n\n jPanel4.setName(\"jPanel4\"); // NOI18N\n\n classCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n classCB.setName(\"classCB\"); // NOI18N\n\n yearDlgLbl.setText(resourceMap.getString(\"yearDlgLbl.text\")); // NOI18N\n yearDlgLbl.setName(\"yearDlgLbl\"); // NOI18N\n\n modelDlgTxt.setName(\"modelDlgTxt\"); // NOI18N\n\n classDlgLbl.setText(resourceMap.getString(\"classDlgLbl.text\")); // NOI18N\n classDlgLbl.setName(\"classDlgLbl\"); // NOI18N\n\n colorDlgTxt.setName(\"colorDlgTxt\"); // NOI18N\n\n yearDlgSpn.setName(\"yearDlgSpn\"); // NOI18N\n\n colorDlgLbl.setText(resourceMap.getString(\"colorDlgLbl.text\")); // NOI18N\n colorDlgLbl.setName(\"colorDlgLbl\"); // NOI18N\n\n statusDlgCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n statusDlgCB.setName(\"statusDlgCB\"); // NOI18N\n\n statusDlgLbl.setText(resourceMap.getString(\"statusDlgLbl.text\")); // NOI18N\n statusDlgLbl.setName(\"statusDlgLbl\"); // NOI18N\n\n plateDlgLbl.setText(resourceMap.getString(\"plateDlgLbl.text\")); // NOI18N\n plateDlgLbl.setName(\"plateDlgLbl\"); // NOI18N\n\n plateDlgTxt.setName(\"plateDlgTxt\"); // NOI18N\n\n brandDlgLbl.setText(resourceMap.getString(\"brandDlgLbl.text\")); // NOI18N\n brandDlgLbl.setName(\"brandDlgLbl\"); // NOI18N\n\n modelDlgLbl.setText(resourceMap.getString(\"modelDlgLbl.text\")); // NOI18N\n modelDlgLbl.setName(\"modelDlgLbl\"); // NOI18N\n\n brandDlgTxt.setName(\"brandDlgTxt\"); // NOI18N\n\n javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);\n jPanel4.setLayout(jPanel4Layout);\n jPanel4Layout.setHorizontalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(plateDlgLbl)\n .addComponent(modelDlgLbl)\n .addComponent(yearDlgLbl)\n .addComponent(classDlgLbl)\n .addComponent(colorDlgLbl)\n .addComponent(statusDlgLbl)\n .addComponent(brandDlgLbl))\n .addGap(18, 18, 18)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(classCB, javax.swing.GroupLayout.Alignment.TRAILING, 0, 149, Short.MAX_VALUE)\n .addComponent(modelDlgTxt, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)\n .addComponent(colorDlgTxt, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)\n .addComponent(yearDlgSpn, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)\n .addComponent(plateDlgTxt, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)\n .addComponent(statusDlgCB, javax.swing.GroupLayout.Alignment.TRAILING, 0, 149, Short.MAX_VALUE)\n .addComponent(brandDlgTxt, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)))\n );\n jPanel4Layout.setVerticalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGap(6, 6, 6)\n .addComponent(plateDlgLbl))\n .addComponent(plateDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(brandDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(brandDlgLbl))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGap(8, 8, 8)\n .addComponent(modelDlgLbl))\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGap(2, 2, 2)\n .addComponent(modelDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGap(6, 6, 6)\n .addComponent(classDlgLbl))\n .addComponent(classCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGap(6, 6, 6)\n .addComponent(yearDlgLbl))\n .addComponent(yearDlgSpn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGap(6, 6, 6)\n .addComponent(colorDlgLbl))\n .addComponent(colorDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGap(6, 6, 6)\n .addComponent(statusDlgLbl))\n .addComponent(statusDlgCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n );\n\n jPanel5.setName(\"jPanel5\"); // NOI18N\n\n serviceMonthDlgSpn.setName(\"serviceMonthDlgSpn\"); // NOI18N\n\n milieageDlgTxt.setName(\"milieageDlgTxt\"); // NOI18N\n\n mileageDlgLbl.setText(resourceMap.getString(\"mileageDlgLbl.text\")); // NOI18N\n mileageDlgLbl.setName(\"mileageDlgLbl\"); // NOI18N\n\n branchCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n branchCB.setName(\"branchCB\"); // NOI18N\n\n branchDlgLbl.setText(resourceMap.getString(\"branchDlgLbl.text\")); // NOI18N\n branchDlgLbl.setName(\"branchDlgLbl\"); // NOI18N\n\n lastServiceMileageDlgTxt.setName(\"lastServiceMileageDlgTxt\"); // NOI18N\n\n lastServiceMileageDlgLbl.setText(resourceMap.getString(\"lastServiceMileageDlgLbl.text\")); // NOI18N\n lastServiceMileageDlgLbl.setName(\"lastServiceMileageDlgLbl\"); // NOI18N\n\n lastServiceDlgLbl.setText(resourceMap.getString(\"lastServiceDlgLbl.text\")); // NOI18N\n lastServiceDlgLbl.setName(\"lastServiceDlgLbl\"); // NOI18N\n\n serviceMilesDlgLbl.setText(resourceMap.getString(\"serviceMilesDlgLbl.text\")); // NOI18N\n serviceMilesDlgLbl.setName(\"serviceMilesDlgLbl\"); // NOI18N\n\n serviceMilesDlgTxt.setName(\"serviceMilesDlgTxt\"); // NOI18N\n\n serviceMonthDlgLbl.setText(resourceMap.getString(\"serviceMonthDlgLbl.text\")); // NOI18N\n serviceMonthDlgLbl.setName(\"serviceMonthDlgLbl\"); // NOI18N\n\n javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);\n jPanel5.setLayout(jPanel5Layout);\n jPanel5Layout.setHorizontalGroup(\n jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel5Layout.createSequentialGroup()\n .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(lastServiceDlgLbl)\n .addComponent(branchDlgLbl)\n .addComponent(serviceMonthDlgLbl)\n .addComponent(serviceMilesDlgLbl)\n .addComponent(lastServiceMileageDlgLbl)\n .addComponent(mileageDlgLbl))\n .addGap(18, 18, 18)\n .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(branchCB, 0, 149, Short.MAX_VALUE)\n .addComponent(serviceMilesDlgTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)\n .addGroup(jPanel5Layout.createSequentialGroup()\n .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(lastServiceMileageDlgTxt, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 148, Short.MAX_VALUE)\n .addComponent(milieageDlgTxt, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 148, Short.MAX_VALUE))\n .addGap(1, 1, 1))\n .addComponent(serviceMonthDlgSpn, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)))\n );\n jPanel5Layout.setVerticalGroup(\n jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel5Layout.createSequentialGroup()\n .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel5Layout.createSequentialGroup()\n .addGap(6, 6, 6)\n .addComponent(mileageDlgLbl))\n .addComponent(milieageDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel5Layout.createSequentialGroup()\n .addGap(6, 6, 6)\n .addComponent(lastServiceMileageDlgLbl))\n .addComponent(lastServiceMileageDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(lastServiceDlgLbl)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel5Layout.createSequentialGroup()\n .addGap(6, 6, 6)\n .addComponent(branchDlgLbl))\n .addComponent(branchCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel5Layout.createSequentialGroup()\n .addGap(12, 12, 12)\n .addComponent(serviceMonthDlgLbl))\n .addGroup(jPanel5Layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(serviceMonthDlgSpn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel5Layout.createSequentialGroup()\n .addGap(6, 6, 6)\n .addComponent(serviceMilesDlgLbl))\n .addComponent(serviceMilesDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n );\n\n javax.swing.GroupLayout carDialogLayout = new javax.swing.GroupLayout(carDialog.getContentPane());\n carDialog.getContentPane().setLayout(carDialogLayout);\n carDialogLayout.setHorizontalGroup(\n carDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carDialogLayout.createSequentialGroup()\n .addGroup(carDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carDialogLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(18, 18, 18)\n .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(carDialogLayout.createSequentialGroup()\n .addGap(144, 144, 144)\n .addComponent(saveDlgBtn)\n .addGap(18, 18, 18)\n .addComponent(deleteDlgBtn)\n .addGap(18, 18, 18)\n .addComponent(cancelDlgBtn)))\n .addContainerGap())\n );\n carDialogLayout.setVerticalGroup(\n carDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carDialogLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(carDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(carDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false)\n .addComponent(saveDlgBtn)\n .addComponent(deleteDlgBtn)\n .addComponent(cancelDlgBtn))\n .addContainerGap(47, Short.MAX_VALUE))\n );\n\n carClassDialog.setAlwaysOnTop(true);\n carClassDialog.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n carClassDialog.setMinimumSize(new java.awt.Dimension(409, 296));\n carClassDialog.setModal(true);\n carClassDialog.setName(\"carClassDialog\"); // NOI18N\n\n nameDlgLbl.setText(resourceMap.getString(\"nameDlgLbl.text\")); // NOI18N\n nameDlgLbl.setName(\"nameDlgLbl\"); // NOI18N\n\n nameDlgTxt.setName(\"nameDlgTxt\"); // NOI18N\n\n displayNameDlgLbl.setText(resourceMap.getString(\"displayNameDlgLbl.text\")); // NOI18N\n displayNameDlgLbl.setName(\"displayNameDlgLbl\"); // NOI18N\n\n displayNameDlgTxt.setName(\"displayNameDlgTxt\"); // NOI18N\n\n priceDlgLbl.setText(resourceMap.getString(\"priceDlgLbl.text\")); // NOI18N\n priceDlgLbl.setName(\"priceDlgLbl\"); // NOI18N\n\n priceDlgTxt.setName(\"priceDlgTxt\"); // NOI18N\n\n saveDlgBtn1.setText(resourceMap.getString(\"saveDlgBtn1.text\")); // NOI18N\n saveDlgBtn1.setName(\"saveDlgBtn1\"); // NOI18N\n\n deleteDlgBtn1.setText(resourceMap.getString(\"deleteDlgBtn1.text\")); // NOI18N\n deleteDlgBtn1.setName(\"deleteDlgBtn1\"); // NOI18N\n\n cancelDlgBtn1.setText(resourceMap.getString(\"cancelDlgBtn1.text\")); // NOI18N\n cancelDlgBtn1.setName(\"cancelDlgBtn1\"); // NOI18N\n\n descriptionDlgLbl.setText(resourceMap.getString(\"descriptionDlgLbl.text\")); // NOI18N\n descriptionDlgLbl.setName(\"descriptionDlgLbl\"); // NOI18N\n\n jScrollPane1.setName(\"jScrollPane1\"); // NOI18N\n\n jTextArea1.setColumns(20);\n jTextArea1.setRows(5);\n jTextArea1.setName(\"jTextArea1\"); // NOI18N\n jScrollPane1.setViewportView(jTextArea1);\n\n javax.swing.GroupLayout carClassDialogLayout = new javax.swing.GroupLayout(carClassDialog.getContentPane());\n carClassDialog.getContentPane().setLayout(carClassDialogLayout);\n carClassDialogLayout.setHorizontalGroup(\n carClassDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carClassDialogLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(carClassDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, carClassDialogLayout.createSequentialGroup()\n .addGroup(carClassDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(displayNameDlgLbl)\n .addComponent(priceDlgLbl)\n .addComponent(nameDlgLbl)\n .addComponent(descriptionDlgLbl))\n .addGap(18, 18, 18)\n .addGroup(carClassDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE)\n .addComponent(displayNameDlgTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE)\n .addComponent(priceDlgTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE)\n .addGroup(carClassDialogLayout.createSequentialGroup()\n .addGap(1, 1, 1)\n .addComponent(nameDlgTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE))))\n .addGroup(carClassDialogLayout.createSequentialGroup()\n .addComponent(saveDlgBtn1)\n .addGap(18, 18, 18)\n .addComponent(deleteDlgBtn1)\n .addGap(18, 18, 18)\n .addComponent(cancelDlgBtn1)))\n .addContainerGap())\n );\n carClassDialogLayout.setVerticalGroup(\n carClassDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carClassDialogLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(carClassDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(nameDlgLbl)\n .addComponent(nameDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(carClassDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(displayNameDlgLbl)\n .addComponent(displayNameDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(carClassDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(priceDlgLbl)\n .addComponent(priceDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(11, 11, 11)\n .addGroup(carClassDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carClassDialogLayout.createSequentialGroup()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)\n .addGap(18, 18, 18)\n .addGroup(carClassDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false)\n .addComponent(cancelDlgBtn1)\n .addComponent(deleteDlgBtn1)\n .addComponent(saveDlgBtn1)))\n .addComponent(descriptionDlgLbl))\n .addContainerGap())\n );\n\n staffDialog.setAlwaysOnTop(true);\n staffDialog.setMinimumSize(new java.awt.Dimension(517, 340));\n staffDialog.setModal(true);\n staffDialog.setName(\"staffDialog\"); // NOI18N\n\n saveDlgBtn2.setIcon(resourceMap.getIcon(\"saveDlgBtn2.icon\")); // NOI18N\n saveDlgBtn2.setText(resourceMap.getString(\"saveDlgBtn2.text\")); // NOI18N\n saveDlgBtn2.setName(\"saveDlgBtn2\"); // NOI18N\n\n deleteDlgBtn2.setIcon(resourceMap.getIcon(\"deleteDlgBtn2.icon\")); // NOI18N\n deleteDlgBtn2.setText(resourceMap.getString(\"deleteDlgBtn2.text\")); // NOI18N\n deleteDlgBtn2.setName(\"deleteDlgBtn2\"); // NOI18N\n\n cancelDlgBtn2.setIcon(resourceMap.getIcon(\"cancelDlgBtn2.icon\")); // NOI18N\n cancelDlgBtn2.setText(resourceMap.getString(\"cancelDlgBtn2.text\")); // NOI18N\n cancelDlgBtn2.setName(\"cancelDlgBtn2\"); // NOI18N\n\n jPanel1.setName(\"jPanel1\"); // NOI18N\n\n staffNameDlgLbl.setText(resourceMap.getString(\"staffNameDlgLbl.text\")); // NOI18N\n staffNameDlgLbl.setName(\"staffNameDlgLbl\"); // NOI18N\n\n surnameDlgLbl.setText(resourceMap.getString(\"surnameDlgLbl.text\")); // NOI18N\n surnameDlgLbl.setName(\"surnameDlgLbl\"); // NOI18N\n\n usernameDlgLbl.setText(resourceMap.getString(\"usernameDlgLbl.text\")); // NOI18N\n usernameDlgLbl.setName(\"usernameDlgLbl\"); // NOI18N\n\n passwordDlgLbl.setText(resourceMap.getString(\"passwordDlgLbl.text\")); // NOI18N\n passwordDlgLbl.setName(\"passwordDlgLbl\"); // NOI18N\n\n passwordPwd.setName(\"passwordPwd\"); // NOI18N\n\n usernameDlgTxt.setName(\"usernameDlgTxt\"); // NOI18N\n\n surnameDlgTxt.setName(\"surnameDlgTxt\"); // NOI18N\n\n staffNameDlgTxt.setName(\"staffNameDlgTxt\"); // NOI18N\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(passwordDlgLbl)\n .addComponent(usernameDlgLbl)\n .addComponent(surnameDlgLbl)\n .addComponent(staffNameDlgLbl))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(passwordPwd, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)\n .addComponent(usernameDlgTxt, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)\n .addComponent(surnameDlgTxt, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)\n .addComponent(staffNameDlgTxt, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(staffNameDlgLbl)\n .addComponent(staffNameDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(surnameDlgLbl)\n .addComponent(surnameDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(usernameDlgLbl)\n .addComponent(usernameDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(12, 12, 12)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(passwordDlgLbl)\n .addComponent(passwordPwd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\n );\n\n jPanel3.setName(\"jPanel3\"); // NOI18N\n\n jScrollPane6.setName(\"jScrollPane6\"); // NOI18N\n\n addressDlgTA.setColumns(20);\n addressDlgTA.setRows(5);\n addressDlgTA.setName(\"addressDlgTA\"); // NOI18N\n jScrollPane6.setViewportView(addressDlgTA);\n\n addressDlgLbl.setText(resourceMap.getString(\"addressDlgLbl.text\")); // NOI18N\n addressDlgLbl.setName(\"addressDlgLbl\"); // NOI18N\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(addressDlgLbl)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 448, Short.MAX_VALUE)\n .addContainerGap())\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap(17, Short.MAX_VALUE)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()\n .addComponent(addressDlgLbl)\n .addGap(44, 44, 44))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()\n .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())))\n );\n\n jPanel2.setName(\"jPanel2\"); // NOI18N\n\n dateOfBirthDlgLbl.setText(resourceMap.getString(\"dateOfBirthDlgLbl.text\")); // NOI18N\n dateOfBirthDlgLbl.setName(\"dateOfBirthDlgLbl\"); // NOI18N\n\n emailDlgLbl.setText(resourceMap.getString(\"emailDlgLbl.text\")); // NOI18N\n emailDlgLbl.setName(\"emailDlgLbl\"); // NOI18N\n\n PhoneDlgLbl.setText(resourceMap.getString(\"PhoneDlgLbl.text\")); // NOI18N\n PhoneDlgLbl.setName(\"PhoneDlgLbl\"); // NOI18N\n\n emailDlgTxt.setName(\"emailDlgTxt\"); // NOI18N\n\n phoneDlgTxt.setName(\"phoneDlgTxt\"); // NOI18N\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(dateOfBirthDlgLbl)\n .addComponent(emailDlgLbl)\n .addComponent(PhoneDlgLbl))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(emailDlgTxt, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE)\n .addComponent(phoneDlgTxt, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE))\n .addContainerGap())\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(dateOfBirthDlgLbl)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(emailDlgLbl)\n .addComponent(emailDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(PhoneDlgLbl)\n .addComponent(phoneDlgTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(15, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout staffDialogLayout = new javax.swing.GroupLayout(staffDialog.getContentPane());\n staffDialog.getContentPane().setLayout(staffDialogLayout);\n staffDialogLayout.setHorizontalGroup(\n staffDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, staffDialogLayout.createSequentialGroup()\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(staffDialogLayout.createSequentialGroup()\n .addGap(104, 104, 104)\n .addComponent(saveDlgBtn2, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)\n .addGap(18, 18, 18)\n .addComponent(deleteDlgBtn2, javax.swing.GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE)\n .addGap(18, 18, 18)\n .addComponent(cancelDlgBtn2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(108, 108, 108))\n );\n staffDialogLayout.setVerticalGroup(\n staffDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(staffDialogLayout.createSequentialGroup()\n .addGroup(staffDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(staffDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(deleteDlgBtn2)\n .addComponent(cancelDlgBtn2)\n .addComponent(saveDlgBtn2))\n .addContainerGap())\n );\n\n extensionDlg.setTitle(resourceMap.getString(\"extensionDlg.title\")); // NOI18N\n extensionDlg.setAlwaysOnTop(true);\n extensionDlg.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n extensionDlg.setIconImage(null);\n extensionDlg.setMinimumSize(new java.awt.Dimension(281, 200));\n extensionDlg.setModal(true);\n extensionDlg.setModalExclusionType(java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE);\n extensionDlg.setName(\"extensionDlg\"); // NOI18N\n extensionDlg.setResizable(false);\n\n oldDateLbl.setText(resourceMap.getString(\"oldDateLbl.text\")); // NOI18N\n oldDateLbl.setName(\"oldDateLbl\"); // NOI18N\n\n oldDateDP.setEditable(false);\n oldDateDP.setName(\"oldDateDP\"); // NOI18N\n\n newDateLbl.setText(resourceMap.getString(\"newDateLbl.text\")); // NOI18N\n newDateLbl.setName(\"newDateLbl\"); // NOI18N\n\n newDateDP.setName(\"newDateDP\"); // NOI18N\n\n Extendsbtn.setText(resourceMap.getString(\"Extendsbtn.text\")); // NOI18N\n Extendsbtn.setName(\"Extendsbtn\"); // NOI18N\n\n javax.swing.GroupLayout extensionDlgLayout = new javax.swing.GroupLayout(extensionDlg.getContentPane());\n extensionDlg.getContentPane().setLayout(extensionDlgLayout);\n extensionDlgLayout.setHorizontalGroup(\n extensionDlgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(extensionDlgLayout.createSequentialGroup()\n .addGroup(extensionDlgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, extensionDlgLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(extensionDlgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(oldDateLbl)\n .addComponent(newDateLbl))\n .addGap(23, 23, 23)\n .addGroup(extensionDlgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(newDateDP, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(oldDateDP, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)))\n .addGroup(extensionDlgLayout.createSequentialGroup()\n .addGap(90, 90, 90)\n .addComponent(Extendsbtn)))\n .addContainerGap())\n );\n extensionDlgLayout.setVerticalGroup(\n extensionDlgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(extensionDlgLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(extensionDlgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(oldDateLbl)\n .addComponent(oldDateDP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(extensionDlgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(newDateLbl)\n .addComponent(newDateDP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(Extendsbtn)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(resourceMap.getString(\"Form.title\")); // NOI18N\n setName(\"Admin\"); // NOI18N\n\n mainPanel.setName(\"mainPanel\"); // NOI18N\n\n tabPanel.setName(\"tabPanel\"); // NOI18N\n\n staffPanel.setName(\"staffPanel\"); // NOI18N\n\n carClassSearchPanel1.setName(\"carClassSearchPanel1\"); // NOI18N\n\n staffNameLbl.setText(resourceMap.getString(\"staffNameLbl.text\")); // NOI18N\n staffNameLbl.setName(\"staffNameLbl\"); // NOI18N\n\n staffSurnameLbl.setText(resourceMap.getString(\"staffSurnameLbl.text\")); // NOI18N\n staffSurnameLbl.setName(\"staffSurnameLbl\"); // NOI18N\n\n staffNameTxt.setName(\"staffNameTxt\"); // NOI18N\n\n staffSurnameTxt.setName(\"staffSurnameTxt\"); // NOI18N\n\n javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance().getContext().getActionMap(AdminView.class, this);\n staffAddBtn.setAction(actionMap.get(\"carDialog\")); // NOI18N\n staffAddBtn.setIcon(resourceMap.getIcon(\"staffAddBtn.icon\")); // NOI18N\n staffAddBtn.setText(resourceMap.getString(\"staffAddBtn.text\")); // NOI18N\n staffAddBtn.setName(\"staffAddBtn\"); // NOI18N\n\n staffClearBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/oscar/view/resources/clean.png\"))); // NOI18N\n staffClearBtn.setText(resourceMap.getString(\"staffClearBtn.text\")); // NOI18N\n staffClearBtn.setName(\"staffClearBtn\"); // NOI18N\n\n javax.swing.GroupLayout carClassSearchPanel1Layout = new javax.swing.GroupLayout(carClassSearchPanel1);\n carClassSearchPanel1.setLayout(carClassSearchPanel1Layout);\n carClassSearchPanel1Layout.setHorizontalGroup(\n carClassSearchPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carClassSearchPanel1Layout.createSequentialGroup()\n .addGroup(carClassSearchPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(staffClearBtn)\n .addComponent(staffAddBtn)\n .addGroup(carClassSearchPanel1Layout.createSequentialGroup()\n .addGroup(carClassSearchPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(staffSurnameLbl)\n .addComponent(staffNameLbl))\n .addGap(18, 18, 18)\n .addGroup(carClassSearchPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(staffSurnameTxt)\n .addComponent(staffNameTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE))))\n .addContainerGap())\n );\n carClassSearchPanel1Layout.setVerticalGroup(\n carClassSearchPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carClassSearchPanel1Layout.createSequentialGroup()\n .addGroup(carClassSearchPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(staffNameLbl)\n .addComponent(staffNameTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(carClassSearchPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(staffSurnameLbl)\n .addComponent(staffSurnameTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(staffClearBtn)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(staffAddBtn))\n );\n\n jScrollPane5.setName(\"jScrollPane5\"); // NOI18N\n\n staffTbl.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {},\n {},\n {},\n {}\n },\n new String [] {\n\n }\n ));\n staffTbl.setAutoStartEditOnKeyStroke(false);\n staffTbl.setEditable(false);\n staffTbl.setName(\"staffTbl\"); // NOI18N\n staffTbl.getTableHeader().setReorderingAllowed(false);\n jScrollPane5.setViewportView(staffTbl);\n staffTbl.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n\n javax.swing.GroupLayout staffPanelLayout = new javax.swing.GroupLayout(staffPanel);\n staffPanel.setLayout(staffPanelLayout);\n staffPanelLayout.setHorizontalGroup(\n staffPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(staffPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(carClassSearchPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 544, Short.MAX_VALUE)\n .addContainerGap())\n );\n staffPanelLayout.setVerticalGroup(\n staffPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(staffPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(staffPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)\n .addComponent(carClassSearchPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\n );\n\n tabPanel.addTab(resourceMap.getString(\"staffPanel.TabConstraints.tabTitle\"), staffPanel); // NOI18N\n\n rentalPanel.setName(\"rentalPanel\"); // NOI18N\n\n rentalSearchPanel.setName(\"rentalSearchPanel\"); // NOI18N\n\n refCodeLbl.setText(resourceMap.getString(\"refCodeLbl.text\")); // NOI18N\n refCodeLbl.setName(\"refCodeLbl\"); // NOI18N\n\n rentalRefCodeTxt.setName(\"rentalRefCodeTxt\"); // NOI18N\n\n surnameLbl.setText(resourceMap.getString(\"surnameLbl.text\")); // NOI18N\n surnameLbl.setName(\"surnameLbl\"); // NOI18N\n\n rentalSurnameTxt.setName(\"rentalSurnameTxt\"); // NOI18N\n\n rentalClearBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/oscar/view/resources/clean.png\"))); // NOI18N\n rentalClearBtn.setText(resourceMap.getString(\"rentalClearBtn.text\")); // NOI18N\n rentalClearBtn.setName(\"rentalClearBtn\"); // NOI18N\n\n rentalDeleteBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/oscar/view/resources/delete.png\"))); // NOI18N\n rentalDeleteBtn.setText(resourceMap.getString(\"rentalDeleteBtn.text\")); // NOI18N\n rentalDeleteBtn.setName(\"rentalDeleteBtn\"); // NOI18N\n\n javax.swing.GroupLayout rentalSearchPanelLayout = new javax.swing.GroupLayout(rentalSearchPanel);\n rentalSearchPanel.setLayout(rentalSearchPanelLayout);\n rentalSearchPanelLayout.setHorizontalGroup(\n rentalSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(rentalSearchPanelLayout.createSequentialGroup()\n .addGroup(rentalSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(rentalSearchPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(rentalSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(refCodeLbl)\n .addComponent(surnameLbl))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(rentalSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(rentalRefCodeTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE)\n .addComponent(rentalSurnameTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE)))\n .addComponent(rentalClearBtn)\n .addComponent(rentalDeleteBtn))\n .addContainerGap())\n );\n rentalSearchPanelLayout.setVerticalGroup(\n rentalSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(rentalSearchPanelLayout.createSequentialGroup()\n .addGroup(rentalSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(rentalRefCodeTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(refCodeLbl))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(rentalSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(rentalSurnameTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(surnameLbl))\n .addGap(18, 18, 18)\n .addComponent(rentalClearBtn)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(rentalDeleteBtn))\n );\n\n jScrollPane2.setName(\"jScrollPane2\"); // NOI18N\n\n rentalTbl.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n\n }\n ));\n rentalTbl.setAutoStartEditOnKeyStroke(false);\n rentalTbl.setEditable(false);\n rentalTbl.setName(\"rentalTbl\"); // NOI18N\n rentalTbl.getTableHeader().setReorderingAllowed(false);\n jScrollPane2.setViewportView(rentalTbl);\n rentalTbl.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n\n javax.swing.GroupLayout rentalPanelLayout = new javax.swing.GroupLayout(rentalPanel);\n rentalPanel.setLayout(rentalPanelLayout);\n rentalPanelLayout.setHorizontalGroup(\n rentalPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(rentalPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(rentalSearchPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 488, Short.MAX_VALUE)\n .addContainerGap())\n );\n rentalPanelLayout.setVerticalGroup(\n rentalPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(rentalPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(rentalPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(rentalSearchPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE))\n .addContainerGap())\n );\n\n tabPanel.addTab(resourceMap.getString(\"rentalPanel.TabConstraints.tabTitle\"), rentalPanel); // NOI18N\n\n carPanel.setName(\"carPanel\"); // NOI18N\n\n carSearchPanel.setName(\"carSearchPanel\"); // NOI18N\n\n plateLbl.setText(resourceMap.getString(\"plateLbl.text\")); // NOI18N\n plateLbl.setName(\"plateLbl\"); // NOI18N\n\n brandLbl.setText(resourceMap.getString(\"brandLbl.text\")); // NOI18N\n brandLbl.setName(\"brandLbl\"); // NOI18N\n\n modelLbl.setText(resourceMap.getString(\"modelLbl.text\")); // NOI18N\n modelLbl.setName(\"modelLbl\"); // NOI18N\n\n classLbl.setText(resourceMap.getString(\"classLbl.text\")); // NOI18N\n classLbl.setName(\"classLbl\"); // NOI18N\n\n yearLbl.setText(resourceMap.getString(\"yearLbl.text\")); // NOI18N\n yearLbl.setName(\"yearLbl\"); // NOI18N\n\n colorLbl.setText(resourceMap.getString(\"colorLbl.text\")); // NOI18N\n colorLbl.setName(\"colorLbl\"); // NOI18N\n\n statusLbl.setText(resourceMap.getString(\"statusLbl.text\")); // NOI18N\n statusLbl.setEnabled(false);\n statusLbl.setName(\"statusLbl\"); // NOI18N\n\n carPlateTxt.setName(\"carPlateTxt\"); // NOI18N\n\n carBrandTxt.setName(\"carBrandTxt\"); // NOI18N\n\n carModelTxt.setName(\"carModelTxt\"); // NOI18N\n\n carClassCb.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n carClassCb.setName(\"carClassCb\"); // NOI18N\n\n carYearTxt.setName(\"carYearTxt\"); // NOI18N\n\n carColorTxt.setName(\"carColorTxt\"); // NOI18N\n\n carStatusCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n carStatusCB.setEnabled(false);\n carStatusCB.setName(\"carStatusCB\"); // NOI18N\n\n carAddBtn.setAction(actionMap.get(\"carDialog\")); // NOI18N\n carAddBtn.setIcon(resourceMap.getIcon(\"carAddBtn.icon\")); // NOI18N\n carAddBtn.setText(resourceMap.getString(\"carAddBtn.text\")); // NOI18N\n carAddBtn.setName(\"carAddBtn\"); // NOI18N\n\n carClearBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/oscar/view/resources/clean.png\"))); // NOI18N\n carClearBtn.setText(resourceMap.getString(\"carClearBtn.text\")); // NOI18N\n carClearBtn.setName(\"carClearBtn\"); // NOI18N\n\n javax.swing.GroupLayout carSearchPanelLayout = new javax.swing.GroupLayout(carSearchPanel);\n carSearchPanel.setLayout(carSearchPanelLayout);\n carSearchPanelLayout.setHorizontalGroup(\n carSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carSearchPanelLayout.createSequentialGroup()\n .addGroup(carSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carSearchPanelLayout.createSequentialGroup()\n .addGroup(carSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(brandLbl)\n .addComponent(plateLbl)\n .addComponent(modelLbl)\n .addComponent(classLbl)\n .addComponent(yearLbl)\n .addComponent(colorLbl)\n .addComponent(statusLbl))\n .addGap(18, 18, 18)\n .addGroup(carSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(carStatusCB, javax.swing.GroupLayout.Alignment.LEADING, 0, 66, Short.MAX_VALUE)\n .addComponent(carColorTxt, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE)\n .addComponent(carYearTxt, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE)\n .addComponent(carModelTxt, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE)\n .addComponent(carBrandTxt, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE)\n .addComponent(carPlateTxt, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE)\n .addComponent(carClassCb, 0, 66, Short.MAX_VALUE)))\n .addComponent(carClearBtn)\n .addComponent(carAddBtn))\n .addContainerGap())\n );\n carSearchPanelLayout.setVerticalGroup(\n carSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carSearchPanelLayout.createSequentialGroup()\n .addGroup(carSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(plateLbl)\n .addComponent(carPlateTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(carSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(brandLbl)\n .addComponent(carBrandTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(carSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(modelLbl)\n .addComponent(carModelTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(carSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(classLbl)\n .addComponent(carClassCb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(carSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(yearLbl)\n .addComponent(carYearTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(carSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(colorLbl)\n .addComponent(carColorTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(carSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(statusLbl)\n .addComponent(carStatusCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(carClearBtn)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(carAddBtn))\n );\n\n jScrollPane3.setName(\"jScrollPane3\"); // NOI18N\n\n carTbl.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {},\n {},\n {},\n {}\n },\n new String [] {\n\n }\n ));\n carTbl.setAutoStartEditOnKeyStroke(false);\n carTbl.setEditable(false);\n carTbl.setName(\"carTbl\"); // NOI18N\n carTbl.getTableHeader().setReorderingAllowed(false);\n jScrollPane3.setViewportView(carTbl);\n carTbl.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n\n javax.swing.GroupLayout carPanelLayout = new javax.swing.GroupLayout(carPanel);\n carPanel.setLayout(carPanelLayout);\n carPanelLayout.setHorizontalGroup(\n carPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(carSearchPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 544, Short.MAX_VALUE)\n .addContainerGap())\n );\n carPanelLayout.setVerticalGroup(\n carPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(carPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)\n .addComponent(carSearchPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\n );\n\n tabPanel.addTab(resourceMap.getString(\"carPanel.TabConstraints.tabTitle\"), carPanel); // NOI18N\n\n carClassPanel.setName(\"carClassPanel\"); // NOI18N\n\n carClassSearchPanel.setName(\"carClassSearchPanel\"); // NOI18N\n\n carClassNameLbl.setText(resourceMap.getString(\"carClassNameLbl.text\")); // NOI18N\n carClassNameLbl.setName(\"carClassNameLbl\"); // NOI18N\n\n carClassDisplayLbl.setText(resourceMap.getString(\"carClassDisplayLbl.text\")); // NOI18N\n carClassDisplayLbl.setName(\"carClassDisplayLbl\"); // NOI18N\n\n carClassNameTxt.setName(\"carClassNameTxt\"); // NOI18N\n\n carClassDisplayTxt.setName(\"carClassDisplayTxt\"); // NOI18N\n\n carClassClearBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/oscar/view/resources/clean.png\"))); // NOI18N\n carClassClearBtn.setText(resourceMap.getString(\"carClassClearBtn.text\")); // NOI18N\n carClassClearBtn.setName(\"carClassClearBtn\"); // NOI18N\n\n carClassAddBtn.setAction(actionMap.get(\"carDialog\")); // NOI18N\n carClassAddBtn.setIcon(resourceMap.getIcon(\"carClassAddBtn.icon\")); // NOI18N\n carClassAddBtn.setText(resourceMap.getString(\"carClassAddBtn.text\")); // NOI18N\n carClassAddBtn.setName(\"carClassAddBtn\"); // NOI18N\n\n javax.swing.GroupLayout carClassSearchPanelLayout = new javax.swing.GroupLayout(carClassSearchPanel);\n carClassSearchPanel.setLayout(carClassSearchPanelLayout);\n carClassSearchPanelLayout.setHorizontalGroup(\n carClassSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carClassSearchPanelLayout.createSequentialGroup()\n .addGroup(carClassSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carClassSearchPanelLayout.createSequentialGroup()\n .addGroup(carClassSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(carClassDisplayLbl)\n .addComponent(carClassNameLbl))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(carClassSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(carClassNameTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE)\n .addComponent(carClassDisplayTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE)))\n .addComponent(carClassClearBtn)\n .addComponent(carClassAddBtn))\n .addContainerGap())\n );\n carClassSearchPanelLayout.setVerticalGroup(\n carClassSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carClassSearchPanelLayout.createSequentialGroup()\n .addGroup(carClassSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(carClassNameLbl)\n .addComponent(carClassNameTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(carClassSearchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(carClassDisplayLbl)\n .addComponent(carClassDisplayTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(carClassClearBtn)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(carClassAddBtn))\n );\n\n jScrollPane4.setName(\"jScrollPane4\"); // NOI18N\n\n carClassTbl.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {},\n {},\n {},\n {}\n },\n new String [] {\n\n }\n ));\n carClassTbl.setAutoStartEditOnKeyStroke(false);\n carClassTbl.setEditable(false);\n carClassTbl.setName(\"carClassTbl\"); // NOI18N\n carClassTbl.getTableHeader().setReorderingAllowed(false);\n jScrollPane4.setViewportView(carClassTbl);\n carClassTbl.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n\n javax.swing.GroupLayout carClassPanelLayout = new javax.swing.GroupLayout(carClassPanel);\n carClassPanel.setLayout(carClassPanelLayout);\n carClassPanelLayout.setHorizontalGroup(\n carClassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carClassPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(carClassSearchPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE)\n .addContainerGap())\n );\n carClassPanelLayout.setVerticalGroup(\n carClassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(carClassPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(carClassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)\n .addComponent(carClassSearchPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\n );\n\n tabPanel.addTab(resourceMap.getString(\"carClassPanel.TabConstraints.tabTitle\"), carClassPanel); // NOI18N\n\n openStaffBtn.setIcon(resourceMap.getIcon(\"openStaffBtn.icon\")); // NOI18N\n openStaffBtn.setText(resourceMap.getString(\"openStaffBtn.text\")); // NOI18N\n openStaffBtn.setName(\"openStaffBtn\"); // NOI18N\n\n javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);\n mainPanel.setLayout(mainPanelLayout);\n mainPanelLayout.setHorizontalGroup(\n mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(mainPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(tabPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 722, Short.MAX_VALUE)\n .addComponent(openStaffBtn, javax.swing.GroupLayout.Alignment.TRAILING))\n .addContainerGap())\n );\n mainPanelLayout.setVerticalGroup(\n mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(mainPanelLayout.createSequentialGroup()\n .addComponent(openStaffBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(tabPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 589, Short.MAX_VALUE)\n .addContainerGap())\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 .addGap(0, 746, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(0, 0, 0)\n .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(0, 0, 0)))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 636, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(0, 0, 0)\n .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(0, 0, 0)))\n );\n\n pack();\n }", "private void initUI() {\r\n\t\tthis.form = new XdevGridLayout();\r\n\t\tthis.comboBoxState = new XdevComboBox<>();\r\n\t\tthis.lblSbxValidFrom = new XdevLabel();\r\n\t\tthis.dateSbxValidFrom = new XdevPopupDateField();\r\n\t\tthis.lblSbxAgeStartYear = new XdevLabel();\r\n\t\tthis.txtSbxAgeStartYear = new XdevTextField();\r\n\t\tthis.lblSbxCompany = new XdevLabel();\r\n\t\tthis.txtSbxCompany = new XdevTextField();\r\n\t\tthis.lblSbxWorker = new XdevLabel();\r\n\t\tthis.txtSbxWorker = new XdevTextField();\r\n\t\tthis.lblSbxState = new XdevLabel();\r\n\t\tthis.horizontalLayout = new XdevHorizontalLayout();\r\n\t\tthis.cmdSave = new XdevButton();\r\n\t\tthis.cmdClose = new XdevButton();\r\n\t\tthis.fieldGroup = new XdevFieldGroup<>(SalaryBvgBaseLine.class);\r\n\t\r\n\t\tthis.lblSbxValidFrom.setValue(\"Gültig ab\");\r\n\t\tthis.dateSbxValidFrom.setTabIndex(2);\r\n\t\tthis.lblSbxAgeStartYear.setValue(\"Alter ab\");\r\n\t\tthis.txtSbxAgeStartYear.setTabIndex(3);\r\n\t\tthis.lblSbxCompany.setValue(\"Arbeitgeber %\");\r\n\t\tthis.txtSbxCompany.setConverter(ConverterBuilder.stringToDouble().build());\r\n\t\tthis.txtSbxCompany.setTabIndex(4);\r\n\t\tthis.lblSbxWorker.setValue(\"Arbeitnehmer %\");\r\n\t\tthis.txtSbxWorker.setConverter(ConverterBuilder.stringToDouble().build());\r\n\t\tthis.txtSbxWorker.setTabIndex(5);\r\n\t\tthis.lblSbxState.setValue(\"Status\");\r\n\t\tthis.horizontalLayout.setMargin(new MarginInfo(false));\r\n\t\tthis.cmdSave.setIcon(FontAwesome.SAVE);\r\n\t\tthis.cmdSave.setCaption(\"Speichern\");\r\n\t\tthis.cmdSave.setTabIndex(8);\r\n\t\tthis.cmdSave.setClickShortcut(ShortcutAction.KeyCode.ENTER);\r\n\t\tthis.cmdClose.setIcon(FontAwesome.CLOSE);\r\n\t\tthis.cmdClose.setCaption(\"Schliessen\");\r\n\t\tthis.cmdClose.setClickShortcut(ShortcutAction.KeyCode.ESCAPE);\r\n\t\tthis.fieldGroup.bind(this.dateSbxValidFrom, SalaryBvgBaseLine_.sbxValidFrom.getName());\r\n\t\tthis.fieldGroup.bind(this.txtSbxAgeStartYear, SalaryBvgBaseLine_.sbxAgeStartYear.getName());\r\n\t\tthis.fieldGroup.bind(this.txtSbxCompany, SalaryBvgBaseLine_.sbxCompany.getName());\r\n\t\tthis.fieldGroup.bind(this.txtSbxWorker, SalaryBvgBaseLine_.sbxWorker.getName());\r\n\t\tthis.fieldGroup.bind(this.comboBoxState, SalaryBvgBaseLine_.sbxState.getName());\r\n\t\r\n\t\tthis.cmdSave.setSizeUndefined();\r\n\t\tthis.horizontalLayout.addComponent(this.cmdSave);\r\n\t\tthis.horizontalLayout.setComponentAlignment(this.cmdSave, Alignment.MIDDLE_LEFT);\r\n\t\tthis.cmdClose.setSizeUndefined();\r\n\t\tthis.horizontalLayout.addComponent(this.cmdClose);\r\n\t\tthis.horizontalLayout.setComponentAlignment(this.cmdClose, Alignment.MIDDLE_LEFT);\r\n\t\tthis.form.setColumns(2);\r\n\t\tthis.form.setRows(7);\r\n\t\tthis.comboBoxState.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.comboBoxState, 1, 4);\r\n\t\tthis.lblSbxValidFrom.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxValidFrom, 0, 0);\r\n\t\tthis.dateSbxValidFrom.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.dateSbxValidFrom, 1, 0);\r\n\t\tthis.lblSbxAgeStartYear.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxAgeStartYear, 0, 1);\r\n\t\tthis.txtSbxAgeStartYear.setWidth(100, Unit.PERCENTAGE);\r\n\t\tthis.txtSbxAgeStartYear.setHeight(-1, Unit.PIXELS);\r\n\t\tthis.form.addComponent(this.txtSbxAgeStartYear, 1, 1);\r\n\t\tthis.lblSbxCompany.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxCompany, 0, 2);\r\n\t\tthis.txtSbxCompany.setWidth(100, Unit.PERCENTAGE);\r\n\t\tthis.txtSbxCompany.setHeight(-1, Unit.PIXELS);\r\n\t\tthis.form.addComponent(this.txtSbxCompany, 1, 2);\r\n\t\tthis.lblSbxWorker.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxWorker, 0, 3);\r\n\t\tthis.txtSbxWorker.setWidth(100, Unit.PERCENTAGE);\r\n\t\tthis.txtSbxWorker.setHeight(-1, Unit.PIXELS);\r\n\t\tthis.form.addComponent(this.txtSbxWorker, 1, 3);\r\n\t\tthis.lblSbxState.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxState, 0, 4);\r\n\t\tthis.horizontalLayout.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.horizontalLayout, 0, 5, 1, 5);\r\n\t\tthis.form.setComponentAlignment(this.horizontalLayout, Alignment.TOP_CENTER);\r\n\t\tthis.form.setColumnExpandRatio(1, 100.0F);\r\n\t\tfinal CustomComponent form_vSpacer = new CustomComponent();\r\n\t\tform_vSpacer.setSizeFull();\r\n\t\tthis.form.addComponent(form_vSpacer, 0, 6, 1, 6);\r\n\t\tthis.form.setRowExpandRatio(6, 1.0F);\r\n\t\tthis.form.setSizeFull();\r\n\t\tthis.setContent(this.form);\r\n\t\tthis.setSizeFull();\r\n\t\r\n\t\tthis.cmdSave.addClickListener(event -> this.cmdSave_buttonClick(event));\r\n\t\tthis.cmdClose.addClickListener(event -> this.cmdClose_buttonClick(event));\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n specializationJTextField = new javax.swing.JTextField();\n backJButton = new javax.swing.JButton();\n addDoctorJButton = new javax.swing.JButton();\n\n setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n jLabel1.setFont(new java.awt.Font(\"Times New Roman\", 1, 18)); // NOI18N\n jLabel1.setText(\"Add Doctor Specialization\");\n add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(195, 13, -1, -1));\n\n jLabel2.setText(\"Specialization :\");\n add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(118, 107, -1, -1));\n add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(407, 104, 121, 16));\n add(specializationJTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(217, 104, 183, -1));\n\n backJButton.setText(\"<< Back\");\n backJButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n backJButtonActionPerformed(evt);\n }\n });\n add(backJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(43, 13, -1, -1));\n\n addDoctorJButton.setText(\"Add Doctor\");\n addDoctorJButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n addDoctorJButtonActionPerformed(evt);\n }\n });\n add(addDoctorJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(228, 170, -1, -1));\n }", "public NewJFrame() {\n initComponents();\n \n \n //combo box\n comboCompet.addItem(\"Séléction officielle\");\n comboCompet.addItem(\"Un certain regard\");\n comboCompet.addItem(\"Cannes Courts métrages\");\n comboCompet.addItem(\"Hors compétitions\");\n comboCompet.addItem(\"Cannes Classics\");\n \n \n //redimension\n this.setResizable(false);\n \n planning = new Planning();\n \n \n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jButton2 = new javax.swing.JButton();\n jButton3 = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n jLabel10 = new javax.swing.JLabel();\n jTextField1 = new javax.swing.JTextField();\n jTextField2 = new javax.swing.JTextField();\n jTextField3 = new javax.swing.JTextField();\n jTextField4 = new javax.swing.JTextField();\n jTextField5 = new javax.swing.JTextField();\n jTextField6 = new javax.swing.JTextField();\n jTextField7 = new javax.swing.JTextField();\n jTextField8 = new javax.swing.JTextField();\n jTextField9 = new javax.swing.JTextField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n jButton2.setText(\"Cancel\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(237, 241, -1, -1));\n\n jButton3.setText(\"Add New Doctor\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 240, -1, -1));\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jLabel1.setText(\"Add a Doctor\");\n getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(118, 0, -1, -1));\n\n jLabel2.setText(\"Name\");\n getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(53, 38, -1, -1));\n\n jLabel3.setText(\"Adress\");\n getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(47, 76, -1, -1));\n\n jLabel4.setText(\"Country\");\n getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(47, 114, -1, -1));\n\n jLabel5.setText(\"Login\");\n getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(47, 152, -1, -1));\n\n jLabel6.setText(\"Password\");\n getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(47, 196, -1, -1));\n\n jLabel7.setText(\"Sirname\");\n getContentPane().add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(255, 38, -1, -1));\n\n jLabel8.setText(\"City\");\n getContentPane().add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(255, 76, -1, -1));\n\n jLabel9.setText(\"Birth\");\n getContentPane().add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(255, 114, -1, -1));\n\n jLabel10.setText(\"Specialization\");\n getContentPane().add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 150, -1, -1));\n getContentPane().add(jTextField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 40, 101, -1));\n getContentPane().add(jTextField2, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 70, 100, -1));\n getContentPane().add(jTextField3, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 40, 90, -1));\n getContentPane().add(jTextField4, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 70, 90, -1));\n getContentPane().add(jTextField5, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 110, 100, -1));\n getContentPane().add(jTextField6, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 110, 90, -1));\n getContentPane().add(jTextField7, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 150, 90, -1));\n getContentPane().add(jTextField8, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 150, 100, -1));\n getContentPane().add(jTextField9, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 190, 99, -1));\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n addVehicle_lbl = new javax.swing.JLabel();\n update_btn = new javax.swing.JButton();\n regNum_lbl = new javax.swing.JLabel();\n make_lbl = new javax.swing.JLabel();\n model_lbl = new javax.swing.JLabel();\n regNum_txt = new javax.swing.JTextField();\n make_txt = new javax.swing.JTextField();\n model_txt = new javax.swing.JTextField();\n colour_txt = new javax.swing.JTextField();\n colour_lbl = new javax.swing.JLabel();\n engine_serial_no_txt = new javax.swing.JTextField();\n engine_serial_no_lbl = new javax.swing.JLabel();\n chassisNo_lbl = new javax.swing.JLabel();\n back_btn = new javax.swing.JButton();\n chassisNo_txt = new javax.swing.JTextField();\n purchaseDate_txt = new javax.swing.JTextField();\n purchaseDate_lbl = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n addVehicle_lbl.setFont(new java.awt.Font(\"Tahoma\", 0, 24)); // NOI18N\n addVehicle_lbl.setText(\"Update Vehicle\");\n\n update_btn.setText(\"Update\");\n update_btn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n update_btnActionPerformed(evt);\n }\n });\n\n regNum_lbl.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n regNum_lbl.setText(\"Reg No.\");\n\n make_lbl.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n make_lbl.setText(\"Make\");\n\n model_lbl.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n model_lbl.setText(\"Model\");\n\n colour_lbl.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n colour_lbl.setText(\"Colour\");\n\n engine_serial_no_lbl.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n engine_serial_no_lbl.setText(\"Engine Serial No.\");\n\n chassisNo_lbl.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n chassisNo_lbl.setText(\"Chassis No.\");\n\n back_btn.setText(\"Back\");\n back_btn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n back_btnActionPerformed(evt);\n }\n });\n\n chassisNo_txt.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n chassisNo_txtActionPerformed(evt);\n }\n });\n\n purchaseDate_txt.setToolTipText(\"Vehicle purchase date (dd/mm/yyyy)\");\n\n purchaseDate_lbl.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n purchaseDate_lbl.setText(\"Purchase Date\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(update_btn, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(53, 53, 53)\n .addComponent(addVehicle_lbl)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(back_btn, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addGap(72, 72, 72)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(make_lbl)\n .addComponent(model_lbl)\n .addComponent(colour_lbl))\n .addGap(63, 63, 63)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(model_txt, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)\n .addComponent(make_txt, javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(regNum_txt, javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(colour_txt)))\n .addComponent(regNum_lbl, javax.swing.GroupLayout.Alignment.LEADING)))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(chassisNo_lbl)\n .addComponent(purchaseDate_lbl))\n .addGap(36, 36, 36)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(chassisNo_txt, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(purchaseDate_txt, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(layout.createSequentialGroup()\n .addGap(31, 31, 31)\n .addComponent(engine_serial_no_lbl)\n .addGap(21, 21, 21)\n .addComponent(engine_serial_no_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(0, 115, Short.MAX_VALUE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(55, 55, 55)\n .addComponent(addVehicle_lbl))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(back_btn, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(55, 55, 55)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(regNum_lbl)\n .addComponent(regNum_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(make_lbl)\n .addComponent(make_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(model_lbl)\n .addComponent(model_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(colour_lbl)\n .addComponent(colour_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(engine_serial_no_lbl)\n .addComponent(engine_serial_no_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(chassisNo_lbl)\n .addComponent(chassisNo_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(purchaseDate_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(purchaseDate_lbl))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 40, Short.MAX_VALUE)\n .addComponent(update_btn, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(55, 55, 55))\n );\n\n pack();\n }", "public VehiclesPanel() throws IOException {\n\t\tsuper(new GridLayout(4,3));\n \n\t\t// Frame and title the panel\n\t\tthis.setBorder(BorderFactory.createTitledBorder(\"Vehicles fleet\"));\n\t\t\n\t\t// Fill the nbVehicles combo box with possible fleet sizes\n\t\tthis.nbVBox.addItem(1);\n\t\tthis.nbVBox.addItem(2);\n\t\tthis.nbVBox.addItem(5);\n\t\tthis.nbVBox.addItem(10);\n\t\tthis.nbVBox.addItem(30);\n\t\t\n\t\t// Add the check box that chooses between a limited or infinite number of vehicles\n\t\tthis.add(new JLabel(\"Number of vehicles\"));\n\t\tthis.nbVCheck = new JCheckBox(\"Unlimited\", true);\n\t\tthis.nbVCheck.addItemListener(this);\n\t\tthis.add(this.nbVCheck);\n\t\tthis.nbVCheck.setMnemonic(KeyEvent.VK_C);\n\t\tthis.add(new JPanel());\n\t\tthis.add(new JPanel());\n\t\tthis.add(this.nbVBox);\n\t\tthis.nbVBox.setVisible(false);\n\t\tthis.add(new JPanel());\n\t\t\n\t\t// Fill the capacities combo box with possible capacities\n\t\tthis.capaBox.addItem(1);\n\t\tthis.capaBox.addItem(3);\n\t\tthis.capaBox.addItem(10);\n\t\tthis.capaBox.addItem(30);\n\t\t// Add the check box that chooses between a finite or infinite capacity for each vehicle\n\t\tthis.add(new JLabel(\"Capacity of vehicles\"));\n\t\tthis.capaCheck = new JCheckBox(\"Unlimited\", true);\n\t\tthis.capaCheck.addItemListener(this);\n\t\tthis.add(this.capaCheck);\n\t\tthis.capaCheck.setMnemonic(KeyEvent.VK_G);\n\t\tthis.add(new JPanel());\n\t\tthis.add(new JPanel());\n\t\tthis.add(this.capaBox);\n\t\tthis.capaBox.setVisible(false);\n\t\tthis.add(this.capaExplain);\n\t\tthis.capaExplain.setVisible(false);\n\t}", "private void $$$setupUI$$$() {\r\n createUIComponents();\r\n pnlMain = new JPanel();\r\n pnlMain.setLayout(new FormLayout(\"fill:d:grow\", \"fill:145dlu:noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow\"));\r\n pnlMain.setMinimumSize(new Dimension(560, 270));\r\n pnlMain.setPreferredSize(new Dimension(560, 270));\r\n pnlForm.setLayout(new FormLayout(\"fill:40dlu:noGrow,left:4dlu:noGrow,fill:40dlu:noGrow,left:4dlu:noGrow,fill:40dlu:noGrow,left:4dlu:noGrow,fill:40dlu:noGrow,left:4dlu:noGrow,fill:40dlu:noGrow,left:4dlu:noGrow,fill:40dlu:noGrow\", \"fill:12dlu:noGrow,top:4dlu:noGrow,fill:12dlu:noGrow,top:5dlu:noGrow,fill:12dlu:noGrow,top:4dlu:noGrow,fill:12dlu:noGrow,top:4dlu:noGrow,fill:12dlu:noGrow,top:4dlu:noGrow,center:12dlu:noGrow,top:4dlu:noGrow,center:12dlu:noGrow\"));\r\n CellConstraints cc = new CellConstraints();\r\n pnlMain.add(pnlForm, cc.xy(1, 1));\r\n lblDscto1 = new JLabel();\r\n lblDscto1.setText(\"Dscto 1\");\r\n pnlForm.add(lblDscto1, cc.xy(1, 9));\r\n txtpcDsto1 = new JTextField();\r\n pnlForm.add(txtpcDsto1, cc.xy(3, 9, CellConstraints.FILL, CellConstraints.DEFAULT));\r\n lblDeProducto = new JLabel();\r\n lblDeProducto.setText(\"Producto\");\r\n pnlForm.add(lblDeProducto, cc.xy(1, 1));\r\n txtDeProducto = new JTextField();\r\n pnlForm.add(txtDeProducto, cc.xyw(5, 1, 7, CellConstraints.FILL, CellConstraints.DEFAULT));\r\n lblUnidadProducto = new JLabel();\r\n lblUnidadProducto.setText(\"Unidad\");\r\n pnlForm.add(lblUnidadProducto, cc.xy(1, 3));\r\n txtUnidadProducto = new JTextField();\r\n pnlForm.add(txtUnidadProducto, cc.xy(3, 3, CellConstraints.FILL, CellConstraints.DEFAULT));\r\n txtDeLaboratorio = new JTextField();\r\n pnlForm.add(txtDeLaboratorio, cc.xyw(7, 3, 5, CellConstraints.FILL, CellConstraints.DEFAULT));\r\n lblLaboratorio = new JLabel();\r\n lblLaboratorio.setText(\"Laboratorio\");\r\n pnlForm.add(lblLaboratorio, cc.xy(5, 3));\r\n lblCantidad = new JLabel();\r\n lblCantidad.setText(\"Cantidad\");\r\n pnlForm.add(lblCantidad, cc.xy(1, 7));\r\n txtCaRecibida = new JTextField();\r\n pnlForm.add(txtCaRecibida, cc.xy(3, 7, CellConstraints.FILL, CellConstraints.DEFAULT));\r\n final JSeparator separator1 = new JSeparator();\r\n pnlForm.add(separator1, cc.xyw(1, 5, 11, CellConstraints.FILL, CellConstraints.FILL));\r\n lblPrecio = new JLabel();\r\n lblPrecio.setText(\"Precio\");\r\n pnlForm.add(lblPrecio, cc.xy(5, 7));\r\n txtPrecio = new JTextField();\r\n pnlForm.add(txtPrecio, cc.xy(7, 7, CellConstraints.FILL, CellConstraints.DEFAULT));\r\n lblDscto2 = new JLabel();\r\n lblDscto2.setText(\"Dscto 2\");\r\n pnlForm.add(lblDscto2, cc.xy(5, 9));\r\n txtpcDsto2 = new JTextField();\r\n pnlForm.add(txtpcDsto2, cc.xy(7, 9, CellConstraints.FILL, CellConstraints.DEFAULT));\r\n final JSeparator separator2 = new JSeparator();\r\n pnlForm.add(separator2, cc.xyw(1, 11, 11, CellConstraints.FILL, CellConstraints.FILL));\r\n lblGlosa = new JLabel();\r\n lblGlosa.setText(\"Glosa\");\r\n pnlForm.add(lblGlosa, cc.xy(1, 13));\r\n txtGlosa = new JTextField();\r\n pnlForm.add(txtGlosa, cc.xyw(3, 13, 9, CellConstraints.FILL, CellConstraints.DEFAULT));\r\n lblDscto3 = new JLabel();\r\n lblDscto3.setText(\"Dscto 3\");\r\n pnlForm.add(lblDscto3, cc.xy(9, 9));\r\n txtpcDsto3 = new JTextField();\r\n pnlForm.add(txtpcDsto3, cc.xy(11, 9, CellConstraints.FILL, CellConstraints.DEFAULT));\r\n txtCoProducto = new JTextField();\r\n pnlForm.add(txtCoProducto, cc.xy(3, 1, CellConstraints.FILL, CellConstraints.DEFAULT));\r\n footerPanel = new JPanel();\r\n footerPanel.setLayout(new FormLayout(\"fill:50dlu:noGrow,left:4dlu:noGrow,fill:d:grow\", \"fill:15dlu:noGrow\"));\r\n pnlMain.add(footerPanel, cc.xy(1, 3));\r\n lblF10 = new JLabel();\r\n lblF10.setText(\"F10 = Aceptar\");\r\n footerPanel.add(lblF10, cc.xy(1, 1));\r\n lblEsc = new JLabel();\r\n lblEsc.setHorizontalAlignment(4);\r\n lblEsc.setText(\"Esc = Cancelar\");\r\n footerPanel.add(lblEsc, cc.xy(3, 1));\r\n }", "@SuppressWarnings(\"unchecked\")\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\r\n private void initComponents() {\r\n java.awt.GridBagConstraints gridBagConstraints;\r\n\r\n OptionsPane = new javax.swing.JScrollPane();\r\n Toolbar = new javax.swing.JToolBar();\r\n NewButton = new javax.swing.JButton();\r\n OpenFileButton = new javax.swing.JButton();\r\n SaveButton = new javax.swing.JButton();\r\n SaveAsButton = new javax.swing.JButton();\r\n jSeparator3 = new javax.swing.JToolBar.Separator();\r\n CutButton = new javax.swing.JButton();\r\n CopyButton = new javax.swing.JButton();\r\n PasteButton = new javax.swing.JButton();\r\n DeleteSelection = new javax.swing.JButton();\r\n ClearCircuit = new javax.swing.JButton();\r\n UndoButton = new javax.swing.JButton();\r\n RedoButton = new javax.swing.JButton();\r\n jSeparator6 = new javax.swing.JToolBar.Separator();\r\n MakeImageButton = new javax.swing.JButton();\r\n ToggleGrid = new javax.swing.JButton();\r\n jSeparator5 = new javax.swing.JToolBar.Separator();\r\n RecordButton = new javax.swing.JButton();\r\n StartButton = new javax.swing.JButton();\r\n StopButton = new javax.swing.JButton();\r\n StepForwardButton = new javax.swing.JButton();\r\n SimulatorSpeed = new javax.swing.JSlider();\r\n Toolbox = new javax.swing.JPanel();\r\n jLabel1 = new javax.swing.JLabel();\r\n ToolboxButtons = new javax.swing.JPanel();\r\n Selection = new javax.swing.JButton();\r\n Wire = new javax.swing.JButton();\r\n InsertSubComponent = new javax.swing.JButton();\r\n RotateLeft = new javax.swing.JButton();\r\n RotateRight = new javax.swing.JButton();\r\n SelectionTreeScrollPane = new javax.swing.JScrollPane();\r\n ComponentSelectionTree = new javax.swing.JTree();\r\n optionsPanel = new JPanel();\r\n titleLabel = new javax.swing.JLabel();\r\n typeLabel = new javax.swing.JLabel();\r\n AttributesPanel = new javax.swing.JPanel();\r\n Preview = new PreviewPanel(this);\r\n MainScrollPane = new javax.swing.JScrollPane();\r\n DesktopPane = new ScrollableDesktop();\r\n statusPanel = new javax.swing.JPanel();\r\n javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();\r\n statusMessageLabel = new javax.swing.JLabel();\r\n statusAnimationLabel = new javax.swing.JLabel();\r\n progressBar = new javax.swing.JProgressBar();\r\n MenuBar = new javax.swing.JMenuBar();\r\n File = new javax.swing.JMenu();\r\n New = new javax.swing.JMenuItem();\r\n Open = new javax.swing.JMenuItem();\r\n Save = new javax.swing.JMenuItem();\r\n SaveAs = new javax.swing.JMenuItem();\r\n Preferences = new javax.swing.JMenuItem();\r\n Exit = new javax.swing.JMenuItem();\r\n Edit = new javax.swing.JMenu();\r\n Undo = new javax.swing.JMenuItem();\r\n Redo = new javax.swing.JMenuItem();\r\n jSeparator1 = new javax.swing.JSeparator();\r\n Cut = new javax.swing.JMenuItem();\r\n Copy = new javax.swing.JMenuItem();\r\n Paste = new javax.swing.JMenuItem();\r\n SelectAll = new javax.swing.JMenuItem();\r\n jSeparator2 = new javax.swing.JSeparator();\r\n Delete = new javax.swing.JMenuItem();\r\n Simulation = new javax.swing.JMenu();\r\n Run = new javax.swing.JMenuItem();\r\n Stop = new javax.swing.JMenuItem();\r\n StepForward = new javax.swing.JMenuItem();\r\n Record = new javax.swing.JMenuItem();\r\n Window = new javax.swing.JMenu();\r\n Help = new javax.swing.JMenu();\r\n About = new javax.swing.JMenuItem();\r\n\r\n OptionsPane.setBorder(null);\r\n\r\n setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);\r\n java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle(\"ui/Bundle\"); // NOI18N\r\n setTitle(bundle.getString(\"Editor.title\")); // NOI18N\r\n setBounds(new java.awt.Rectangle(0, 0, 985, 750));\r\n setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\r\n setMinimumSize(new java.awt.Dimension(750, 750));\r\n\r\n Toolbar.setFloatable(false);\r\n Toolbar.setRollover(true);\r\n Toolbar.setBorderPainted(false);\r\n Toolbar.setMaximumSize(new java.awt.Dimension(2000, 34));\r\n Toolbar.setMinimumSize(new java.awt.Dimension(750, 34));\r\n Toolbar.setPreferredSize(new java.awt.Dimension(750, 34));\r\n\r\n NewButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/document-new.png\"))); // NOI18N\r\n NewButton.setText(bundle.getString(\"Editor.NewButton.text\")); // NOI18N\r\n NewButton.setFocusable(false);\r\n NewButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n NewButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n NewButton.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.NewButtonMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(NewButton);\r\n\r\n OpenFileButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/document-open.png\"))); // NOI18N\r\n OpenFileButton.setText(bundle.getString(\"Editor.OpenFileButton.text\")); // NOI18N\r\n OpenFileButton.setFocusable(false);\r\n OpenFileButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n OpenFileButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n OpenFileButton.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.OpenFileButtonMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(OpenFileButton);\r\n\r\n SaveButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/document-save.png\"))); // NOI18N\r\n SaveButton.setText(bundle.getString(\"Editor.SaveButton.text\")); // NOI18N\r\n SaveButton.setEnabled(false);\r\n SaveButton.setFocusable(false);\r\n SaveButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n SaveButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n SaveButton.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.SaveButtonMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(SaveButton);\r\n\r\n SaveAsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/document-save-as.png\"))); // NOI18N\r\n SaveAsButton.setText(bundle.getString(\"Editor.SaveAsButton.text\")); // NOI18N\r\n SaveAsButton.setEnabled(false);\r\n SaveAsButton.setFocusable(false);\r\n SaveAsButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n SaveAsButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n SaveAsButton.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.SaveAsButtonMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(SaveAsButton);\r\n Toolbar.add(jSeparator3);\r\n\r\n CutButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/edit-cut.png\"))); // NOI18N\r\n CutButton.setText(bundle.getString(\"Editor.CutButton.text\")); // NOI18N\r\n CutButton.setFocusable(false);\r\n CutButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n CutButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n CutButton.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.CutButtonMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(CutButton);\r\n\r\n CopyButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/edit-copy.png\"))); // NOI18N\r\n CopyButton.setText(bundle.getString(\"Editor.CopyButton.text\")); // NOI18N\r\n CopyButton.setFocusable(false);\r\n CopyButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n CopyButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n CopyButton.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.CopyButtonMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(CopyButton);\r\n\r\n PasteButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/edit-paste.png\"))); // NOI18N\r\n PasteButton.setText(bundle.getString(\"Editor.PasteButton.text\")); // NOI18N\r\n PasteButton.setEnabled(false);\r\n PasteButton.setFocusable(false);\r\n PasteButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n PasteButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n PasteButton.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.PasteButtonMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(PasteButton);\r\n\r\n DeleteSelection.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/edit-delete.png\"))); // NOI18N\r\n DeleteSelection.setText(bundle.getString(\"Editor.DeleteSelection.text\")); // NOI18N\r\n DeleteSelection.setToolTipText(bundle.getString(\"Editor.DeleteSelection.toolTipText\")); // NOI18N\r\n DeleteSelection.setFocusable(false);\r\n DeleteSelection.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n DeleteSelection.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n DeleteSelection.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.DeleteSelectionMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(DeleteSelection);\r\n\r\n ClearCircuit.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/edit-clear.png\"))); // NOI18N\r\n ClearCircuit.setText(bundle.getString(\"Editor.ClearCircuit.text\")); // NOI18N\r\n ClearCircuit.setToolTipText(bundle.getString(\"Editor.ClearCircuit.toolTipText\")); // NOI18N\r\n ClearCircuit.setFocusable(false);\r\n ClearCircuit.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n ClearCircuit.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n ClearCircuit.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.ClearCircuitMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(ClearCircuit);\r\n\r\n UndoButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/edit-undo.png\"))); // NOI18N\r\n UndoButton.setText(bundle.getString(\"Editor.UndoButton.text\")); // NOI18N\r\n UndoButton.setEnabled(false);\r\n UndoButton.setFocusable(false);\r\n UndoButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n UndoButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n UndoButton.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.UndoButtonMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(UndoButton);\r\n\r\n RedoButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/edit-redo.png\"))); // NOI18N\r\n RedoButton.setText(bundle.getString(\"Editor.RedoButton.text\")); // NOI18N\r\n RedoButton.setEnabled(false);\r\n RedoButton.setFocusable(false);\r\n RedoButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n RedoButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n RedoButton.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.RedoButtonMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(RedoButton);\r\n Toolbar.add(jSeparator6);\r\n\r\n MakeImageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/create-image.png\"))); // NOI18N\r\n MakeImageButton.setText(bundle.getString(\"Editor.MakeImageButton.text\")); // NOI18N\r\n MakeImageButton.setFocusable(false);\r\n MakeImageButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n MakeImageButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n MakeImageButton.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.MakeImageButtonMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(MakeImageButton);\r\n\r\n ToggleGrid.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/grid.png\"))); // NOI18N\r\n ToggleGrid.setText(bundle.getString(\"Editor.ToggleGrid.text\")); // NOI18N\r\n ToggleGrid.setFocusable(false);\r\n ToggleGrid.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n ToggleGrid.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n ToggleGrid.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.ToggleGridActionPerformed(evt);\r\n }\r\n });\r\n Toolbar.add(ToggleGrid);\r\n Toolbar.add(jSeparator5);\r\n\r\n RecordButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/media-record.png\"))); // NOI18N\r\n RecordButton.setText(bundle.getString(\"Editor.RecordButton.text\")); // NOI18N\r\n RecordButton.setFocusable(false);\r\n RecordButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n RecordButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n RecordButton.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.RecordButtonMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(RecordButton);\r\n\r\n StartButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/media-playback-start.png\"))); // NOI18N\r\n StartButton.setText(bundle.getString(\"Editor.StartButton.text\")); // NOI18N\r\n StartButton.setFocusable(false);\r\n StartButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n StartButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n StartButton.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.StartButtonMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(StartButton);\r\n\r\n StopButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/media-playback-stop.png\"))); // NOI18N\r\n StopButton.setText(bundle.getString(\"Editor.StopButton.text\")); // NOI18N\r\n StopButton.setEnabled(false);\r\n StopButton.setFocusable(false);\r\n StopButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n StopButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n StopButton.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.StopButtonMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(StopButton);\r\n\r\n StepForwardButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/media-seek-forward.png\"))); // NOI18N\r\n StepForwardButton.setText(bundle.getString(\"Editor.StepForwardButton.text\")); // NOI18N\r\n StepForwardButton.setEnabled(false);\r\n StepForwardButton.setFocusable(false);\r\n StepForwardButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n StepForwardButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n StepForwardButton.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.StepForwardButtonMouseClicked(evt);\r\n }\r\n });\r\n Toolbar.add(StepForwardButton);\r\n\r\n SimulatorSpeed.setMajorTickSpacing(1);\r\n SimulatorSpeed.setMaximum(10);\r\n SimulatorSpeed.setPaintTicks(true);\r\n SimulatorSpeed.setSnapToTicks(true);\r\n SimulatorSpeed.setMaximumSize(new java.awt.Dimension(200, 33));\r\n SimulatorSpeed.addChangeListener(new javax.swing.event.ChangeListener() {\r\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\r\n controller.SimulatorSpeedStateChanged(evt);\r\n }\r\n });\r\n Toolbar.add(SimulatorSpeed);\r\n\r\n getContentPane().add(Toolbar, java.awt.BorderLayout.NORTH);\r\n\r\n Toolbox.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\r\n\r\n jLabel1.setForeground(javax.swing.UIManager.getDefaults().getColor(\"Button.darkShadow\"));\r\n jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\r\n jLabel1.setText(bundle.getString(\"Editor.jLabel1.text\")); // NOI18N\r\n Toolbox.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 170, -1));\r\n\r\n ToolboxButtons.setLayout(new java.awt.GridBagLayout());\r\n\r\n Selection.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/sml_select.png\"))); // NOI18N\r\n Selection.setText(bundle.getString(\"TestJFrameForm.Selection.text\")); // NOI18N\r\n Selection.setMargin(new java.awt.Insets(2, 2, 2, 2));\r\n Selection.setMaximumSize(new java.awt.Dimension(32, 32));\r\n Selection.setMinimumSize(new java.awt.Dimension(32, 32));\r\n Selection.setPreferredSize(new java.awt.Dimension(32, 32));\r\n Selection.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.SelectionToolClicked(evt);\r\n }\r\n });\r\n gridBagConstraints = new java.awt.GridBagConstraints();\r\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\r\n ToolboxButtons.add(Selection, gridBagConstraints);\r\n\r\n Wire.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/sml_wire.png\"))); // NOI18N\r\n Wire.setText(bundle.getString(\"TestJFrameForm.Wire.text\")); // NOI18N\r\n Wire.setToolTipText(bundle.getString(\"TestJFrameForm.Wire.toolTipText\")); // NOI18N\r\n Wire.setMargin(new java.awt.Insets(2, 2, 2, 2));\r\n Wire.setMaximumSize(new java.awt.Dimension(32, 32));\r\n Wire.setMinimumSize(new java.awt.Dimension(32, 32));\r\n Wire.setPreferredSize(new java.awt.Dimension(32, 32));\r\n Wire.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.WireMouseClicked(evt);\r\n }\r\n });\r\n gridBagConstraints = new java.awt.GridBagConstraints();\r\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\r\n ToolboxButtons.add(Wire, gridBagConstraints);\r\n\r\n InsertSubComponent.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/insert-object.png\"))); // NOI18N\r\n InsertSubComponent.setText(bundle.getString(\"Editor.InsertSubComponent.text\")); // NOI18N\r\n InsertSubComponent.setFocusable(false);\r\n InsertSubComponent.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n InsertSubComponent.setMaximumSize(new java.awt.Dimension(32, 32));\r\n InsertSubComponent.setMinimumSize(new java.awt.Dimension(32, 32));\r\n InsertSubComponent.setPreferredSize(new java.awt.Dimension(32, 32));\r\n InsertSubComponent.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n InsertSubComponent.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.InsertSubComponentActionPerformed(evt);\r\n }\r\n });\r\n ToolboxButtons.add(InsertSubComponent, new java.awt.GridBagConstraints());\r\n\r\n RotateLeft.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/object-rotate-left.png\"))); // NOI18N\r\n RotateLeft.setText(bundle.getString(\"Editor.RotateLeft.text\")); // NOI18N\r\n RotateLeft.setFocusable(false);\r\n RotateLeft.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n RotateLeft.setMaximumSize(new java.awt.Dimension(32, 32));\r\n RotateLeft.setMinimumSize(new java.awt.Dimension(32, 32));\r\n RotateLeft.setPreferredSize(new java.awt.Dimension(32, 32));\r\n RotateLeft.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n RotateLeft.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.RotateLeftMouseClicked(evt);\r\n }\r\n });\r\n gridBagConstraints = new java.awt.GridBagConstraints();\r\n gridBagConstraints.gridx = 3;\r\n gridBagConstraints.gridy = 0;\r\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\r\n ToolboxButtons.add(RotateLeft, gridBagConstraints);\r\n\r\n RotateRight.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/object-rotate-right.png\"))); // NOI18N\r\n RotateRight.setText(bundle.getString(\"Editor.RotateRight.text\")); // NOI18N\r\n RotateRight.setFocusable(false);\r\n RotateRight.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\r\n RotateRight.setMaximumSize(new java.awt.Dimension(32, 32));\r\n RotateRight.setMinimumSize(new java.awt.Dimension(32, 32));\r\n RotateRight.setPreferredSize(new java.awt.Dimension(32, 32));\r\n RotateRight.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\r\n RotateRight.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n controller.RotateRightMouseClicked(evt);\r\n }\r\n });\r\n gridBagConstraints = new java.awt.GridBagConstraints();\r\n gridBagConstraints.gridx = 4;\r\n gridBagConstraints.gridy = 0;\r\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\r\n ToolboxButtons.add(RotateRight, gridBagConstraints);\r\n\r\n Toolbox.add(ToolboxButtons, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 20, 170, 30));\r\n\r\n SelectionTreeScrollPane.setAutoscrolls(true);\r\n\r\n ComponentSelectionTree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {\r\n public void valueChanged(javax.swing.event.TreeSelectionEvent evt) {\r\n controller.ComponentSelectionTreeValueChanged(evt);\r\n }\r\n });\r\n ComponentSelectionTree.addFocusListener(new java.awt.event.FocusAdapter() {\r\n public void focusGained(java.awt.event.FocusEvent evt) {\r\n controller.ComponentSelectionTreeFocusGained(evt);\r\n }\r\n });\r\n ComponentSelectionTree.setModel(getTreeValues());\r\n ComponentSelectionTree.setRootVisible(false);\r\n SelectionTreeScrollPane.setViewportView(ComponentSelectionTree);\r\n\r\n Toolbox.add(SelectionTreeScrollPane, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 60, 170, 250));\r\n\r\n optionsPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 2, 1, 2));\r\n optionsPanel.setMaximumSize(new java.awt.Dimension(72, 232));\r\n optionsPanel.setMinimumSize(new java.awt.Dimension(72, 232));\r\n optionsPanel.setPreferredSize(new java.awt.Dimension(72, 232));\r\n\r\n titleLabel.setText(titleNew);\r\n titleLabel.setForeground(new java.awt.Color(108, 108, 108));\r\n titleLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\r\n\r\n typeLabel.setText(bundle.getString(\"OptionsPanel.jLabel2.text\"));\r\n\r\n AttributesPanel.setMaximumSize(new java.awt.Dimension(72, 500));\r\n AttributesPanel.setMinimumSize(new java.awt.Dimension(72, 72));\r\n AttributesPanel.setPreferredSize(new java.awt.Dimension(72, 72));\r\n AttributesPanel.setLayout(new java.awt.BorderLayout());\r\n\r\n Preview.setMinimumSize(new java.awt.Dimension(72, 80));\r\n Preview.setPreferredSize(new java.awt.Dimension(72, 80));\r\n\r\n org.jdesktop.layout.GroupLayout optionsPanelLayout = new org.jdesktop.layout.GroupLayout(optionsPanel);\r\n optionsPanel.setLayout(optionsPanelLayout);\r\n optionsPanelLayout.setHorizontalGroup(\r\n optionsPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\r\n .add(Preview, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 166, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\r\n .add(titleLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 166, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\r\n .add(typeLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 166, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\r\n .add(AttributesPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 166, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\r\n );\r\n optionsPanelLayout.setVerticalGroup(\r\n optionsPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\r\n .add(optionsPanelLayout.createSequentialGroup()\r\n .add(titleLabel)\r\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\r\n .add(typeLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\r\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\r\n .add(AttributesPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)\r\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\r\n .add(Preview, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\r\n .addContainerGap())\r\n );\r\n\r\n Toolbox.add(optionsPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 320, 170, 290));\r\n\r\n getContentPane().add(Toolbox, java.awt.BorderLayout.WEST);\r\n\r\n MainScrollPane.setPreferredSize(new java.awt.Dimension(800, 600));\r\n\r\n DesktopPane.setBackground(javax.swing.UIManager.getDefaults().getColor(\"Panel.background\"));\r\n DesktopPane.setAutoscrolls(true);\r\n DesktopPane.setDoubleBuffered(true);\r\n DesktopPane.setMinimumSize(new java.awt.Dimension(600, 400));\r\n MainScrollPane.setViewportView(DesktopPane);\r\n\r\n getContentPane().add(MainScrollPane, java.awt.BorderLayout.CENTER);\r\n\r\n statusMessageLabel.setFont(new java.awt.Font(\"Lucida Sans\", 0, 11));\r\n statusMessageLabel.setText(bundle.getString(\"Editor.statusMessageLabel.text\")); // NOI18N\r\n\r\n statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\r\n\r\n org.jdesktop.layout.GroupLayout statusPanelLayout = new org.jdesktop.layout.GroupLayout(statusPanel);\r\n statusPanel.setLayout(statusPanelLayout);\r\n statusPanelLayout.setHorizontalGroup(\r\n statusPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\r\n .add(statusPanelLayout.createSequentialGroup()\r\n .addContainerGap()\r\n .add(statusMessageLabel)\r\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 777, Short.MAX_VALUE)\r\n .add(progressBar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\r\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\r\n .add(statusAnimationLabel)\r\n .addContainerGap())\r\n .add(statusPanelSeparator, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 947, Short.MAX_VALUE)\r\n );\r\n statusPanelLayout.setVerticalGroup(\r\n statusPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\r\n .add(org.jdesktop.layout.GroupLayout.TRAILING, statusPanelLayout.createSequentialGroup()\r\n .add(statusPanelSeparator, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\r\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .add(statusPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)\r\n .add(statusMessageLabel)\r\n .add(statusAnimationLabel)\r\n .add(progressBar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))\r\n .add(3, 3, 3))\r\n );\r\n\r\n getContentPane().add(statusPanel, java.awt.BorderLayout.PAGE_END);\r\n\r\n File.setMnemonic('F');\r\n File.setText(bundle.getString(\"TestJFrameForm.jMenu1.text_1\")); // NOI18N\r\n\r\n New.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));\r\n New.setMnemonic('o');\r\n New.setText(bundle.getString(\"Editor.New.text\")); // NOI18N\r\n New.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.NewActionPerformed(evt);\r\n }\r\n });\r\n File.add(New);\r\n\r\n Open.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));\r\n Open.setMnemonic('o');\r\n Open.setText(bundle.getString(\"Editor.Open.text\")); // NOI18N\r\n Open.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.OpenActionPerformed(evt);\r\n }\r\n });\r\n File.add(Open);\r\n\r\n Save.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));\r\n Save.setMnemonic('s');\r\n Save.setText(bundle.getString(\"Editor.Save.text\")); // NOI18N\r\n Save.setEnabled(false);\r\n Save.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.SaveActionPerformed(evt);\r\n }\r\n });\r\n File.add(Save);\r\n\r\n SaveAs.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));\r\n SaveAs.setMnemonic('v');\r\n SaveAs.setText(bundle.getString(\"Editor.SaveAs.text\")); // NOI18N\r\n SaveAs.setEnabled(false);\r\n SaveAs.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.SaveAsActionPerformed(evt);\r\n }\r\n });\r\n File.add(SaveAs);\r\n\r\n Preferences.setText(bundle.getString(\"Editor.Preferences.text_1\")); // NOI18N\r\n Preferences.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.PreferencesActionPerformed(evt);\r\n }\r\n });\r\n File.add(Preferences);\r\n\r\n Exit.setMnemonic('x');\r\n Exit.setText(bundle.getString(\"Editor.Exit.text\")); // NOI18N\r\n Exit.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.ExitActionPerformed(evt);\r\n }\r\n });\r\n File.add(Exit);\r\n\r\n MenuBar.add(File);\r\n\r\n Edit.setMnemonic('E');\r\n Edit.setText(bundle.getString(\"Editor.Edit.text\")); // NOI18N\r\n\r\n Undo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, java.awt.event.InputEvent.CTRL_MASK));\r\n Undo.setMnemonic('u');\r\n Undo.setText(bundle.getString(\"Editor.Undo.text\")); // NOI18N\r\n Undo.setEnabled(false);\r\n Undo.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.UndoActionPerformed(evt);\r\n }\r\n });\r\n Edit.add(Undo);\r\n\r\n Redo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Y, java.awt.event.InputEvent.CTRL_MASK));\r\n Redo.setMnemonic('r');\r\n Redo.setText(bundle.getString(\"Editor.Redo.text\")); // NOI18N\r\n Redo.setEnabled(false);\r\n Redo.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.RedoActionPerformed(evt);\r\n }\r\n });\r\n Edit.add(Redo);\r\n Edit.add(jSeparator1);\r\n\r\n Cut.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.CTRL_MASK));\r\n Cut.setMnemonic('t');\r\n Cut.setText(bundle.getString(\"Editor.Cut.text\")); // NOI18N\r\n Cut.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.CutActionPerformed(evt);\r\n }\r\n });\r\n Edit.add(Cut);\r\n\r\n Copy.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));\r\n Copy.setMnemonic('y');\r\n Copy.setText(bundle.getString(\"Editor.Copy.text\")); // NOI18N\r\n Copy.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.CopyActionPerformed(evt);\r\n }\r\n });\r\n Edit.add(Copy);\r\n\r\n Paste.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK));\r\n Paste.setMnemonic('p');\r\n Paste.setText(bundle.getString(\"Editor.Paste.text\")); // NOI18N\r\n Paste.setEnabled(false);\r\n Paste.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.PasteActionPerformed(evt);\r\n }\r\n });\r\n Edit.add(Paste);\r\n\r\n SelectAll.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));\r\n SelectAll.setMnemonic('a');\r\n SelectAll.setText(bundle.getString(\"Editor.SelectAll.text\")); // NOI18N\r\n SelectAll.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.SelectAllActionPerformed(evt);\r\n }\r\n });\r\n Edit.add(SelectAll);\r\n Edit.add(jSeparator2);\r\n\r\n Delete.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_DELETE, 0));\r\n Delete.setMnemonic('d');\r\n Delete.setText(bundle.getString(\"Editor.Delete.text\")); // NOI18N\r\n Delete.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.DeleteActionPerformed(evt);\r\n }\r\n });\r\n Edit.add(Delete);\r\n\r\n MenuBar.add(Edit);\r\n\r\n Simulation.setMnemonic('S');\r\n Simulation.setText(bundle.getString(\"Editor.Simulation.text\")); // NOI18N\r\n\r\n Run.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.CTRL_MASK));\r\n Run.setMnemonic('r');\r\n Run.setText(bundle.getString(\"Editor.Run.text_1\")); // NOI18N\r\n Run.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.RunActionPerformed(evt);\r\n }\r\n });\r\n Simulation.add(Run);\r\n\r\n Stop.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.CTRL_MASK));\r\n Stop.setMnemonic('t');\r\n Stop.setText(bundle.getString(\"Editor.Stop.text\")); // NOI18N\r\n Stop.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.StopActionPerformed(evt);\r\n }\r\n });\r\n Simulation.add(Stop);\r\n\r\n StepForward.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));\r\n StepForward.setMnemonic('F');\r\n StepForward.setText(bundle.getString(\"Editor.StepForward.text\")); // NOI18N\r\n StepForward.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.StepForwardActionPerformed(evt);\r\n }\r\n });\r\n Simulation.add(StepForward);\r\n\r\n Record.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.CTRL_MASK));\r\n Record.setMnemonic('l');\r\n Record.setText(bundle.getString(\"Editor.Record.text\")); // NOI18N\r\n Record.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.RecordActionPerformed(evt);\r\n }\r\n });\r\n Simulation.add(Record);\r\n\r\n MenuBar.add(Simulation);\r\n\r\n Window.setMnemonic('W');\r\n Window.setText(bundle.getString(\"Editor.Window.text\")); // NOI18N\r\n MenuBar.add(Window);\r\n\r\n Help.setMnemonic('H');\r\n Help.setText(bundle.getString(\"Editor.Help.text\")); // NOI18N\r\n\r\n About.setText(bundle.getString(\"Editor.About.text\")); // NOI18N\r\n About.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n controller.AboutActionPerformed(evt);\r\n }\r\n });\r\n Help.add(About);\r\n\r\n MenuBar.add(Help);\r\n\r\n setJMenuBar(MenuBar);\r\n\r\n pack();\r\n }", "private void initComponents() {\n\t\tpanel2 = new JDialog();\n\t\tfields = new JPanel();\n\t\tlabel_subjectSource4 = new JLabel();\n\t\tcontainerLabel3 = new JTextField();\n\t\tseparator3 = new JSeparator();\n\t\tlabel_subjectTermType3 = new JLabel();\n\t\tcontainer3Type = new JComboBox();\n\t\tlabel_subjectSource7 = new JLabel();\n\t\tcontainer3Type2 = new JComboBox();\n\t\tseparator2 = new JSeparator();\n\t\tpanel1 = new JPanel();\n\t\trights3 = new JCheckBox();\n\t\trights2 = new JCheckBox();\n\t\tpanel3 = new JPanel();\n\t\tcancel = new JButton();\n\t\tCellConstraints cc = new CellConstraints();\n\n\t\t//======== panel2 ========\n\t\t{\n\t\t\tContainer panel2ContentPane = panel2.getContentPane();\n\t\t\tpanel2ContentPane.setLayout(new BorderLayout());\n\n\t\t\t//======== fields ========\n\t\t\t{\n\t\t\t\tfields.setBorder(Borders.DLU4_BORDER);\n\t\t\t\tfields.setBackground(new Color(234, 201, 250));\n\t\t\t\tfields.setOpaque(false);\n\t\t\t\tfields.setFont(new Font(\"Trebuchet MS\", Font.PLAIN, 13));\n\t\t\t\tfields.setLayout(new FormLayout(\n\t\t\t\t\tnew ColumnSpec[] {\n\t\t\t\t\t\tFormFactory.DEFAULT_COLSPEC,\n\t\t\t\t\t\tFormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n\t\t\t\t\t\tnew ColumnSpec(\"max(default;400px):grow\")\n\t\t\t\t\t},\n\t\t\t\t\tnew RowSpec[] {\n\t\t\t\t\t\tFormFactory.DEFAULT_ROWSPEC,\n\t\t\t\t\t\tFormFactory.LINE_GAP_ROWSPEC,\n\t\t\t\t\t\tFormFactory.DEFAULT_ROWSPEC,\n\t\t\t\t\t\tFormFactory.LINE_GAP_ROWSPEC,\n\t\t\t\t\t\tFormFactory.DEFAULT_ROWSPEC,\n\t\t\t\t\t\tFormFactory.LINE_GAP_ROWSPEC,\n\t\t\t\t\t\tFormFactory.DEFAULT_ROWSPEC,\n\t\t\t\t\t\tFormFactory.LINE_GAP_ROWSPEC,\n\t\t\t\t\t\tFormFactory.DEFAULT_ROWSPEC,\n\t\t\t\t\t\tFormFactory.LINE_GAP_ROWSPEC,\n\t\t\t\t\t\tFormFactory.DEFAULT_ROWSPEC,\n\t\t\t\t\t\tFormFactory.LINE_GAP_ROWSPEC,\n\t\t\t\t\t\tFormFactory.DEFAULT_ROWSPEC\n\t\t\t\t\t}));\n\n\t\t\t\t//---- label_subjectSource4 ----\n\t\t\t\tlabel_subjectSource4.setText(\"Barcode\");\n\t\t\t\tlabel_subjectSource4.setFont(new Font(\"Trebuchet MS\", Font.PLAIN, 13));\n\t\t\t\tATFieldInfo.assignLabelInfo(label_subjectSource4, ArchDescriptionAnalogInstances.class, ArchDescriptionAnalogInstances.PROPERTYNAME_BARCODE);\n\t\t\t\tfields.add(label_subjectSource4, cc.xy(1, 1));\n\n\t\t\t\t//---- containerLabel3 ----\n\t\t\t\tcontainerLabel3.setFont(new Font(\"Trebuchet MS\", Font.PLAIN, 13));\n\t\t\t\tfields.add(containerLabel3, cc.xy(3, 1));\n\n\t\t\t\t//---- separator3 ----\n\t\t\t\tseparator3.setFont(new Font(\"Trebuchet MS\", Font.PLAIN, 13));\n\t\t\t\tseparator3.setForeground(new Color(147, 131, 86));\n\t\t\t\tfields.add(separator3, cc.xywh(1, 3, 3, 1));\n\n\t\t\t\t//---- label_subjectTermType3 ----\n\t\t\t\tlabel_subjectTermType3.setText(\"Container 3 Type\");\n\t\t\t\tlabel_subjectTermType3.setFont(new Font(\"Trebuchet MS\", Font.PLAIN, 13));\n\t\t\t\tATFieldInfo.assignLabelInfo(label_subjectTermType3, ArchDescriptionAnalogInstances.class, ArchDescriptionAnalogInstances.PROPERTYNAME_CONTAINER3_TYPE);\n\t\t\t\tfields.add(label_subjectTermType3, cc.xy(1, 5));\n\n\t\t\t\t//---- container3Type ----\n\t\t\t\tcontainer3Type.setOpaque(false);\n\t\t\t\tcontainer3Type.setFont(new Font(\"Trebuchet MS\", Font.PLAIN, 13));\n\t\t\t\tfields.add(container3Type, cc.xywh(3, 5, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));\n\n\t\t\t\t//---- label_subjectSource7 ----\n\t\t\t\tlabel_subjectSource7.setText(\"User Defined String 2\");\n\t\t\t\tlabel_subjectSource7.setFont(new Font(\"Trebuchet MS\", Font.PLAIN, 13));\n\t\t\t\tATFieldInfo.assignLabelInfo(label_subjectSource7, ArchDescriptionAnalogInstances.class, ArchDescriptionAnalogInstances.PROPERTYNAME_USER_DEFINED_STRING2);\n\t\t\t\tfields.add(label_subjectSource7, cc.xy(1, 7));\n\n\t\t\t\t//---- container3Type2 ----\n\t\t\t\tcontainer3Type2.setOpaque(false);\n\t\t\t\tcontainer3Type2.setFont(new Font(\"Trebuchet MS\", Font.PLAIN, 13));\n\t\t\t\tfields.add(container3Type2, cc.xywh(3, 7, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));\n\n\t\t\t\t//---- separator2 ----\n\t\t\t\tseparator2.setFont(new Font(\"Trebuchet MS\", Font.PLAIN, 13));\n\t\t\t\tseparator2.setForeground(new Color(147, 131, 86));\n\t\t\t\tfields.add(separator2, cc.xywh(1, 9, 3, 1));\n\n\t\t\t\t//======== panel1 ========\n\t\t\t\t{\n\t\t\t\t\tpanel1.setLayout(new FormLayout(\n\t\t\t\t\t\tnew ColumnSpec[] {\n\t\t\t\t\t\t\tnew ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),\n\t\t\t\t\t\t\tFormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n\t\t\t\t\t\t\tnew ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tRowSpec.decodeSpecs(\"default\")));\n\n\t\t\t\t\t//---- rights3 ----\n\t\t\t\t\trights3.setText(\"User Defined Boolean 1\");\n\t\t\t\t\trights3.setOpaque(false);\n\t\t\t\t\trights3.setFont(new Font(\"Trebuchet MS\", Font.PLAIN, 13));\n\t\t\t\t\trights3.setText(ATFieldInfo.getLabel(ArchDescriptionAnalogInstances.class, ArchDescriptionAnalogInstances.PROPERTYNAME_USER_DEFINED_BOOLEAN1));\n\t\t\t\t\tpanel1.add(rights3, cc.xywh(1, 1, 2, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));\n\n\t\t\t\t\t//---- rights2 ----\n\t\t\t\t\trights2.setText(\"User Defined Boolean 2\");\n\t\t\t\t\trights2.setOpaque(false);\n\t\t\t\t\trights2.setFont(new Font(\"Trebuchet MS\", Font.PLAIN, 13));\n\t\t\t\t\trights2.setText(ATFieldInfo.getLabel(ArchDescriptionAnalogInstances.class, ArchDescriptionAnalogInstances.PROPERTYNAME_USER_DEFINED_BOOLEAN2));\n\t\t\t\t\tpanel1.add(rights2, cc.xywh(3, 1, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));\n\t\t\t\t}\n\t\t\t\tfields.add(panel1, cc.xywh(1, 11, 3, 1, CellConstraints.FILL, CellConstraints.DEFAULT));\n\n\t\t\t\t//======== panel3 ========\n\t\t\t\t{\n\t\t\t\t\tpanel3.setLayout(new FormLayout(\n\t\t\t\t\t\tnew ColumnSpec[] {\n\t\t\t\t\t\t\tFormFactory.DEFAULT_COLSPEC,\n\t\t\t\t\t\t\tFormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n\t\t\t\t\t\t\tFormFactory.DEFAULT_COLSPEC\n\t\t\t\t\t\t},\n\t\t\t\t\t\tRowSpec.decodeSpecs(\"default\")));\n\n\t\t\t\t\t//---- cancel ----\n\t\t\t\t\tcancel.setText(\"Cancel\");\n\t\t\t\t\tcancel.addActionListener(new ActionListener() {\n\t\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\t\tcancelActionPerformed(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tpanel3.add(cancel, cc.xy(3, 1));\n\t\t\t\t}\n\t\t\t\tfields.add(panel3, cc.xywh(1, 13, 3, 1, CellConstraints.CENTER, CellConstraints.DEFAULT));\n\t\t\t}\n\t\t\tpanel2ContentPane.add(fields, BorderLayout.CENTER);\n\t\t\tpanel2.pack();\n\t\t\tpanel2.setLocationRelativeTo(panel2.getOwner());\n\t\t}\n\t\t// JFormDesigner - End of component initialization //GEN-END:initComponents\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n titleLbl = new javax.swing.JLabel();\n nameLbl = new javax.swing.JLabel();\n nameTF = new javax.swing.JTextField();\n ageLbl = new javax.swing.JLabel();\n ageTF = new javax.swing.JTextField();\n conditionLbl = new javax.swing.JLabel();\n conditionTF = new javax.swing.JTextField();\n jScrollPane1 = new javax.swing.JScrollPane();\n guiTA = new javax.swing.JTextArea();\n addBTN = new javax.swing.JButton();\n registeredBTN = new javax.swing.JButton();\n nextBTN = new javax.swing.JButton();\n exitBTN = new javax.swing.JButton();\n allocateBtn = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n titleLbl.setForeground(new java.awt.Color(0, 71, 214));\n titleLbl.setText(\"National Covid‐19 Vaccination Programme\");\n\n nameLbl.setText(\"Please enter your name:\");\n\n ageLbl.setText(\"Please enter your age:\");\n\n conditionLbl.setText(\"Do you have a pre-existing medical condition? (enter Y/N):\");\n\n guiTA.setColumns(20);\n guiTA.setRows(5);\n jScrollPane1.setViewportView(guiTA);\n\n addBTN.setText(\"Add Patient\");\n addBTN.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n addBTNActionPerformed(evt);\n }\n });\n\n registeredBTN.setText(\"Display Registered Vaccine Candidates\");\n registeredBTN.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n registeredBTNActionPerformed(evt);\n }\n });\n\n nextBTN.setText(\"Next Candidate\");\n nextBTN.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n nextBTNActionPerformed(evt);\n }\n });\n\n exitBTN.setText(\"Close Application\");\n exitBTN.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n exitBTNActionPerformed(evt);\n }\n });\n\n allocateBtn.setText(\"Assign Priorities\");\n allocateBtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n allocateBtnActionPerformed(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 .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane1)\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(ageLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(ageTF))\n .addGroup(layout.createSequentialGroup()\n .addComponent(nameLbl)\n .addGap(18, 18, 18)\n .addComponent(nameTF))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(titleLbl)))\n .addGap(114, 114, 114))\n .addGroup(layout.createSequentialGroup()\n .addComponent(conditionLbl)\n .addGap(18, 18, 18)\n .addComponent(conditionTF)\n .addGap(56, 56, 56))\n .addGroup(layout.createSequentialGroup()\n .addComponent(addBTN)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(registeredBTN)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(allocateBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(nextBTN)\n .addGap(18, 18, 18)\n .addComponent(exitBTN)))\n .addContainerGap())))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(titleLbl)\n .addGap(29, 29, 29)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(nameLbl)\n .addComponent(nameTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(ageLbl)\n .addComponent(ageTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(conditionLbl)\n .addComponent(conditionTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(38, 38, 38)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(addBTN)\n .addComponent(nextBTN)\n .addComponent(exitBTN)\n .addComponent(allocateBtn))\n .addGap(18, 18, 18)\n .addComponent(registeredBTN)\n .addContainerGap(39, Short.MAX_VALUE))\n );\n\n pack();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n businessNameJLabel = new javax.swing.JLabel();\n enterpriseNameJLabel = new javax.swing.JLabel();\n networkNameJLabel = new javax.swing.JLabel();\n jSeparator1 = new javax.swing.JSeparator();\n organizationNameJLabel = new javax.swing.JLabel();\n jSeparator2 = new javax.swing.JSeparator();\n titleJLabel = new javax.swing.JLabel();\n drugNameJLabel = new javax.swing.JLabel();\n drugNameJTextField = new javax.swing.JTextField();\n backJButton = new javax.swing.JButton();\n addToCatalogJButton = new javax.swing.JButton();\n statusJLabel = new javax.swing.JLabel();\n statusJTextField = new javax.swing.JTextField();\n\n businessNameJLabel.setFont(new java.awt.Font(\"Times New Roman\", 1, 20)); // NOI18N\n businessNameJLabel.setText(\"Drug Tracking System\");\n\n enterpriseNameJLabel.setFont(new java.awt.Font(\"Times New Roman\", 1, 20)); // NOI18N\n enterpriseNameJLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n enterpriseNameJLabel.setMinimumSize(new java.awt.Dimension(170, 24));\n enterpriseNameJLabel.setPreferredSize(new java.awt.Dimension(170, 24));\n\n networkNameJLabel.setFont(new java.awt.Font(\"Times New Roman\", 1, 20)); // NOI18N\n networkNameJLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n networkNameJLabel.setMaximumSize(new java.awt.Dimension(195, 24));\n networkNameJLabel.setMinimumSize(new java.awt.Dimension(195, 24));\n networkNameJLabel.setPreferredSize(new java.awt.Dimension(195, 24));\n\n organizationNameJLabel.setFont(new java.awt.Font(\"Times New Roman\", 1, 20)); // NOI18N\n organizationNameJLabel.setMinimumSize(new java.awt.Dimension(170, 24));\n organizationNameJLabel.setPreferredSize(new java.awt.Dimension(190, 24));\n\n titleJLabel.setFont(new java.awt.Font(\"Times New Roman\", 1, 26)); // NOI18N\n titleJLabel.setText(\"Drug Details\");\n\n drugNameJLabel.setFont(new java.awt.Font(\"Times New Roman\", 0, 16)); // NOI18N\n drugNameJLabel.setText(\"Drug Name\");\n\n drugNameJTextField.setEditable(false);\n drugNameJTextField.setFont(new java.awt.Font(\"Times New Roman\", 0, 13)); // NOI18N\n drugNameJTextField.setMinimumSize(new java.awt.Dimension(120, 26));\n drugNameJTextField.setPreferredSize(new java.awt.Dimension(120, 26));\n\n backJButton.setFont(new java.awt.Font(\"Times New Roman\", 1, 15)); // NOI18N\n backJButton.setText(\"Back\");\n backJButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n backJButton.setPreferredSize(new java.awt.Dimension(80, 30));\n backJButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n backJButtonActionPerformed(evt);\n }\n });\n\n addToCatalogJButton.setFont(new java.awt.Font(\"Times New Roman\", 1, 15)); // NOI18N\n addToCatalogJButton.setText(\"Add To Catalog\");\n addToCatalogJButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n addToCatalogJButton.setEnabled(false);\n addToCatalogJButton.setPreferredSize(new java.awt.Dimension(80, 30));\n addToCatalogJButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n addToCatalogJButtonActionPerformed(evt);\n }\n });\n\n statusJLabel.setFont(new java.awt.Font(\"Times New Roman\", 0, 16)); // NOI18N\n statusJLabel.setText(\"Status\");\n\n statusJTextField.setEditable(false);\n statusJTextField.setFont(new java.awt.Font(\"Times New Roman\", 0, 13)); // NOI18N\n statusJTextField.setMinimumSize(new java.awt.Dimension(120, 26));\n statusJTextField.setPreferredSize(new java.awt.Dimension(120, 26));\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 .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jSeparator2)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(organizationNameJLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 322, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(businessNameJLabel)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(enterpriseNameJLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 211, Short.MAX_VALUE)\n .addComponent(networkNameJLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(273, 273, 273)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(47, 47, 47)\n .addComponent(titleJLabel))\n .addGroup(layout.createSequentialGroup()\n .addGap(12, 12, 12)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(statusJLabel)\n .addGap(18, 18, 18)\n .addComponent(statusJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(drugNameJLabel)\n .addGap(18, 18, 18)\n .addComponent(drugNameJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(backJButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(addToCatalogJButton, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(311, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(businessNameJLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(enterpriseNameJLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(networkNameJLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(organizationNameJLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(titleJLabel)\n .addGap(75, 75, 75)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(drugNameJLabel)\n .addComponent(drugNameJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(statusJLabel)\n .addComponent(statusJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(33, 33, 33)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(backJButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(addToCatalogJButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(201, Short.MAX_VALUE))\n );\n }", "private void init() {\n\t\tthis.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);\n\t\tthis.setSize(400, 350);\n\t\tthis.setResizable(false);\n\t\t\n\n\t\tCenter.centerByWindow(this);\n\t\tlblWareID.setBounds(20,20, 75, 30);\n\t\tlblWareID.setFont(new Font(\"宋体\",Font.BOLD,15));\n\t\ttxtWareID.setBounds(100,20,230,30);\n\t\t\n\t\tlblWareName.setBounds(20, 65, 75, 30);\n\t\tlblWareName.setFont(new Font(\"宋体\",Font.BOLD,15));\n\t\ttxtWareName.setBounds(100,65,230,30);\n\t/*\tlblHandler.setEnabled(false);\n\t\ttxtHandler.setEnabled(false);\n\t\t*/\n\t\tlblWareCap.setBounds(20,110,75,30);\n\t\tlblWareCap.setFont(new Font(\"宋体\",Font.BOLD,15));\n\t\ttxtWareCap.setBounds(100,110,230,30);\n\t\t/*lblPhone.setEnabled(false);\n\t\ttxtPhone.setEnabled(false);*/\n\t\t\n\t\tlblWareAddress.setBounds(20,155,75,30);\n\t\tlblWareAddress.setFont(new Font(\"宋体\",Font.BOLD,15));\n\t\ttxtWareAddress.setBounds(100,155,230,30);\n\t\t\n\t\tlblWareUser.setBounds(20,200,75,30);\n\t\tlblWareUser.setFont(new Font(\"宋体\",Font.BOLD,15));\n\t\ttxtWareUser.setBounds(100,200,230,30);\n\t\t\n\t\tbtnSave.setBounds(80,245,75,25);\n\t\tbtnSave.setFont(new Font(\"宋体\",Font.BOLD,15));\n\t\t\n\t\tbtnQuit.setBounds(235,245,75,25);\n\t\tbtnQuit.setFont(new Font(\"宋体\",Font.BOLD,15));\n\t\t\n\t\tbtnQuit.addActionListener(new CloseView_ActionListener(this));\n\t\tbtnSave.addActionListener(new ActionListener(){\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tSave();\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\t//pnlMain.add(lblWareID);\n\t\tpnlMain.add(lblWareName);\n\t\tpnlMain.add(lblWareCap);\n\t\tpnlMain.add(lblWareAddress);\n\t\tpnlMain.add(lblWareUser);\n\t\t\n\t\t//pnlMain.add(txtWareID);\n\t\tpnlMain.add(txtWareUser);\n\t\tpnlMain.add(txtWareName);\n\t\tpnlMain.add(txtWareCap);\n\t\tpnlMain.add(txtWareAddress);\n\t\t\n\t\tpnlMain.add(btnSave);\n\t\tpnlMain.add(btnQuit);\n\t\t\n\t\t\n\t\tthis.add(pnlMain);\n\t\tthis.setVisible(true);\n\t}", "private void initComponents() {\n label1 = new JLabel();\n version = new JLabel();\n initializeButton = new JRadioButton();\n upgradeButton = new JRadioButton();\n utilitiesButton = new JRadioButton();\n CellConstraints cc = new CellConstraints();\n\n //======== this ========\n setLayout(new FormLayout(\n ColumnSpec.decodeSpecs(\"default:grow\"),\n new RowSpec[] {\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC\n }));\n\n //---- label1 ----\n label1.setText(\"<html><center>Welcome to the<br>ATReference<br>Maintenance Program</center></html>\");\n label1.setFont(new Font(\"Lucida Grande\", Font.BOLD, 16));\n add(label1, cc.xywh(1, 1, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT));\n\n //---- version ----\n version.setText(\"version\");\n version.setFont(new Font(\"Trebuchet MS\", Font.PLAIN, 13));\n add(version, cc.xywh(1, 3, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT));\n\n //---- initializeButton ----\n initializeButton.setText(\"Initialize a blank database\");\n initializeButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n initializeButtonActionPerformed();\n }\n });\n add(initializeButton, cc.xywh(1, 5, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));\n\n //---- upgradeButton ----\n upgradeButton.setText(\"Upgrade an existing database\");\n upgradeButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n upgradeButtonActionPerformed();\n }\n });\n add(upgradeButton, cc.xywh(1, 7, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));\n\n //---- utilitiesButton ----\n utilitiesButton.setText(\"Utilities\");\n utilitiesButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n utilitiesButtonActionPerformed();\n }\n });\n add(utilitiesButton, cc.xywh(1, 9, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));\n\n //---- buttonGroup1 ----\n ButtonGroup buttonGroup1 = new ButtonGroup();\n buttonGroup1.add(initializeButton);\n buttonGroup1.add(upgradeButton);\n buttonGroup1.add(utilitiesButton);\n\t\t// JFormDesigner - End of component initialization //GEN-END:initComponents\n\t}", "public void initComponents() {\n\t\taddButton = new JButton(addFlightText);\n\t\tdelayButton = new JButton(delayFlightText);\n\t\tquitButton = new JButton(quitText);\n\t\t// TODO: Add button instanciations for other operations\n\n\t\t// Initialize display area\n\t\tdisplayArea = new JTextArea(LINE_COUNT, LINE_SIZE);\n\t\tdisplayArea.setEditable(false);\n\t\tscrollPane = new JScrollPane(displayArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,\n\t\t\t\tJScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);\n\t}", "public NewPropertyTypeDialog(JFrame parent) {\r\n super(parent, \"New Property Type\", true);\r\n\r\n JPanel border = new JPanel();\r\n border.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));\r\n this.getContentPane().setLayout(new BorderLayout(8, 8));\r\n this.getContentPane().add(border, BorderLayout.CENTER);\r\n\r\n this.cmbTypes = new JComboBox<String>(AnimationProperties.getAllPropertyTypes());\r\n this.cmbTypes.setPreferredSize(new Dimension(250, this.cmbTypes\r\n .getMinimumSize().height));\r\n this.cmbTypes.setMaximumSize(new Dimension(Integer.MAX_VALUE, this.cmbTypes\r\n .getMinimumSize().height));\r\n this.cmbTypes.setAlignmentX(Component.LEFT_ALIGNMENT);\r\n this.cmbTypes.setActionCommand(\"cmbTypes\");\r\n this.cmbTypes.addActionListener(this);\r\n\r\n this.txtName = new JTextField();\r\n this.txtName.setText(\"\");\r\n this.name = \"\";\r\n this.txtName.setPreferredSize(new Dimension(250, this.txtName\r\n .getMinimumSize().height));\r\n this.txtName.setMaximumSize(new Dimension(Integer.MAX_VALUE, this.txtName\r\n .getMinimumSize().height));\r\n this.txtName.setAlignmentX(Component.LEFT_ALIGNMENT);\r\n\r\n border.setLayout(new BoxLayout(border, BoxLayout.PAGE_AXIS));\r\n JLabel lblType = new JLabel(\"Chose a Property Type:\");\r\n border.add(lblType);\r\n border.add(Box.createRigidArea(new Dimension(0, 4)));\r\n border.add(this.cmbTypes);\r\n border.add(Box.createRigidArea(new Dimension(0, 10)));\r\n JLabel lblName = new JLabel(\"Enter a Name:\");\r\n border.add(lblName);\r\n border.add(Box.createRigidArea(new Dimension(0, 4)));\r\n border.add(this.txtName);\r\n border.add(Box.createRigidArea(new Dimension(0, 16)));\r\n\r\n JPanel pBut = new JPanel();\r\n pBut.setLayout(new BoxLayout(pBut, BoxLayout.LINE_AXIS));\r\n pBut.setAlignmentX(Component.LEFT_ALIGNMENT);\r\n pBut.add(Box.createHorizontalGlue());\r\n\r\n JButton btnCancel = new JButton(\"Cancel\");\r\n btnCancel.setActionCommand(\"cancel\");\r\n btnCancel.addActionListener(this);\r\n pBut.add(btnCancel);\r\n pBut.add(Box.createRigidArea(new Dimension(8, 0)));\r\n\r\n JButton btnOK = new JButton(\"OK\");\r\n btnOK.setActionCommand(\"ok\");\r\n btnOK.addActionListener(this);\r\n pBut.add(btnOK);\r\n\r\n border.add(pBut, BorderLayout.SOUTH);\r\n this.getRootPane().setDefaultButton(btnOK);\r\n this.txtName.requestFocus();\r\n this.pack();\r\n }", "public AddEmployeeGUI() {\r\n\t\tsetBackground(Color.RED);\r\n\t\tsetTitle(\"Add Employee\");\r\n\t\tsetDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\r\n\t\tsetBounds(100, 100, 450, 500);\r\n\t\tcontentPane = new JPanel();\r\n\t\tcontentPane.setBorder(new EmptyBorder(5, 5, 5, 5));\r\n\t\tsetContentPane(contentPane);\r\n\t\tcontentPane.setLayout(null);\r\n\r\n\t\tJLabel lblSelectEmployeeType = new JLabel(\"Select Employee Type\");\r\n\t\tlblSelectEmployeeType.setBounds(5, 0, 207, 25);\r\n\t\tcontentPane.add(lblSelectEmployeeType);\r\n\r\n\t\tlabel = new JLabel(\"\");\r\n\t\tlabel.setBounds(180, 36, 212, 24);\r\n\t\tcontentPane.add(label);\r\n\r\n\t\tJLabel lblFirstName = new JLabel(\"First Name\");\r\n\t\tlblFirstName.setBounds(5, 55, 207, 45);\r\n\t\tcontentPane.add(lblFirstName);\r\n\r\n\t\ttxtFirstName = new JTextField();\r\n\t\ttxtFirstName.setBounds(180, 71, 212, 24);\r\n\t\tcontentPane.add(txtFirstName);\r\n\t\ttxtFirstName.setColumns(10);\r\n\r\n\t\tJLabel lblLastName = new JLabel(\"Last Name\");\r\n\t\tlblLastName.setBounds(5, 105, 207, 45);\r\n\t\tcontentPane.add(lblLastName);\r\n\r\n\t\ttxtLastName = new JTextField();\r\n\t\ttxtLastName.setBounds(180, 119, 212, 24);\r\n\t\tcontentPane.add(txtLastName);\r\n\t\ttxtLastName.setColumns(10);\r\n\r\n\t\tJLabel lblDateOfBirth = new JLabel(\"Date of Birth (yyyy-mm-dd)\");\r\n\t\tlblDateOfBirth.setBounds(5, 155, 207, 45);\r\n\t\tcontentPane.add(lblDateOfBirth);\r\n\r\n\t\ttxtDOB = new JTextField();\r\n\t\ttxtDOB.setBounds(180, 167, 212, 24);\r\n\t\tcontentPane.add(txtDOB);\r\n\t\ttxtDOB.setColumns(10);\r\n\r\n\t\tJLabel lblTelephoneNo = new JLabel(\"Telephone no.\");\r\n\t\tlblTelephoneNo.setBounds(5, 205, 207, 45);\r\n\t\tcontentPane.add(lblTelephoneNo);\r\n\r\n\t\ttxtTel = new JTextField();\r\n\t\ttxtTel.setBounds(180, 215, 212, 24);\r\n\t\tcontentPane.add(txtTel);\r\n\t\ttxtTel.setColumns(10);\r\n\r\n\t\tJLabel lblEmail = new JLabel(\"Email\");\r\n\t\tlblEmail.setBounds(5, 255, 207, 45);\r\n\t\tcontentPane.add(lblEmail);\r\n\r\n\t\ttxtEmail = new JTextField();\r\n\t\ttxtEmail.setBounds(180, 263, 212, 24);\r\n\t\tcontentPane.add(txtEmail);\r\n\t\ttxtEmail.setColumns(10);\r\n\r\n\t\tJLabel lblGener = new JLabel(\"Gender\");\r\n\t\tlblGener.setBounds(5, 305, 207, 45);\r\n\t\tcontentPane.add(lblGener);\r\n\r\n\t\ttxtGender = new JTextField();\r\n\t\ttxtGender.setBounds(180, 311, 212, 24);\r\n\t\tcontentPane.add(txtGender);\r\n\t\ttxtGender.setColumns(10);\r\n\r\n\t\tJLabel lblStartDate = new JLabel(\"Start Date (yyyy-mm-dd)\");\r\n\t\tlblStartDate.setBounds(5, 355, 207, 45);\r\n\t\tcontentPane.add(lblStartDate);\r\n\r\n\t\ttxtStartDate = new JTextField();\r\n\t\ttxtStartDate.setBounds(180, 359, 212, 24);\r\n\t\tcontentPane.add(txtStartDate);\r\n\t\ttxtStartDate.setColumns(10);\r\n\r\n\t\tlabel_1 = new JLabel(\" \");\r\n\t\tlabel_1.setBounds(5, 405, 207, 50);\r\n\t\tcontentPane.add(label_1);\r\n\r\n\t\tbtnAdd = new JButton(\"Add\");\r\n\t\tbtnAdd.setBounds(325, 405, 67, 24);\r\n\t\tcontentPane.add(btnAdd);\r\n\t}", "public CustomerGUI() {\n\t initComponents();\n\t }", "private void buildUI() {\n initComponents();\n\n FormLayout layout = new FormLayout(\"3dlu, pref:grow, 3dlu\",\n \"3dlu, pref, 3dlu, pref, 3dlu, fill:0:grow\");\n\n PanelBuilder builder = new PanelBuilder(layout);\n CellConstraints cc = new CellConstraints();\n\n // Toolbar\n JPanel toolbar = createToolBar();\n toolbar.setOpaque(false);\n builder.add(toolbar, cc.xy(2, 2));\n builder.addSeparator(null, cc.xyw(1, 4, 2));\n\n // Main panel in scroll pane\n JPanel mainPanel = buildMainPanel();\n mainPanel.setOpaque(false);\n JScrollPane scrollPane = new JScrollPane(mainPanel);\n scrollPane.setOpaque(false);\n scrollPane.getVerticalScrollBar().setUnitIncrement(10);\n UIUtil.removeBorder(scrollPane);\n builder.add(scrollPane, cc.xyw(1, 6, 2));\n\n uiComponent = builder.getPanel();\n }", "public Form(){\r\n\t\t\tString[] labelStrings = {\r\n\t\t\t\t\t\"Name: \",\r\n\t\t\t\t\t\"Description: \",\r\n\t\t\t\t\t\"Directions: \",\r\n\t\t\t\t\t\"Ingredients: \"\r\n\t\t\t};\r\n\r\n\t\t\tlabels = new JLabel[labelStrings.length];\r\n\t\t\tfields = new JComponent[labelStrings.length];\r\n\r\n\r\n\t\t\tfor(int i=0; i<4; i++) {\r\n\t\t\t\tlabels[i] = new JLabel(labelStrings[i], JLabel.TRAILING);\r\n\t\t\t\t// labels[i].setBorder(BorderFactory.createEmptyBorder(0,-20,0,0));\r\n\t\t\t}\r\n\r\n\t\t\tnameField = new JTextField(30);\r\n\r\n\t\t\tfields[fieldNum++] = nameField;\r\n\r\n\t\t\tdescriptionField = new JTextField(30);\r\n\t\t\tfields[fieldNum++] = descriptionField;\r\n\r\n\t\t\t// directionsField = new JTextField(30);\r\n\t\t\tdirectionsField = new JTextArea(15,25);\r\n\t\t\tdirectionsField.setLineWrap(true);\r\n\t\t\tdirectionsField.setBorder(new JTextField().getBorder());\r\n\t\t\t\r\n\t\t\t// pressing TAB or SHIFT-TAB in directionsField will move\r\n\t\t\t// the cursor to another component\r\n\t\t\tdirectionsField.addKeyListener(new KeyAdapter() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void keyPressed(KeyEvent e) {\r\n\t\t\t\t\tif (e.getKeyCode() == KeyEvent.VK_TAB) {\r\n\t\t\t\t\t\tif (e.getModifiers() > 0) {\r\n\t\t\t\t\t\t\tdirectionsField.transferFocusBackward();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tdirectionsField.transferFocus();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\te.consume();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t// fields[fieldNum++] = directionsField;\r\n\r\n\t\t\tdirectionsScrollPane = new JScrollPane(directionsField);\r\n\t\t\tfields[fieldNum++] = directionsScrollPane;\r\n\r\n\t\t\tfields[fieldNum++] = ingredientFields.get(0);\r\n\r\n\t\t\tsetLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS)); \r\n\t\t\tsetBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));\r\n\r\n\t\t\taddComponents();\r\n\r\n\t\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jTextField1 = new javax.swing.JTextField();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTextArea1 = new javax.swing.JTextArea();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jComboBox1 = new javax.swing.JComboBox<>();\n jButton1 = new javax.swing.JButton();\n jLabel4 = new javax.swing.JLabel();\n jComboBox2 = new javax.swing.JComboBox<>();\n jLabel5 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jTextField1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextField1ActionPerformed(evt);\n }\n });\n\n jTextArea1.setColumns(20);\n jTextArea1.setRows(5);\n jScrollPane1.setViewportView(jTextArea1);\n\n jLabel1.setText(\"Location\");\n\n jLabel2.setText(\"Status\");\n\n jLabel3.setText(\"Description\");\n\n jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Accident\", \"Breakdown\", \"Vehicle Failure\" }));\n\n jButton1.setText(\"Add Breakdown\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jLabel4.setText(\"Breakdowns\");\n\n jComboBox2.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Bus\", \"Train\" }));\n\n jLabel5.setText(\"Type\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(94, 94, 94)\n .addComponent(jButton1)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel2)\n .addComponent(jLabel5))\n .addGap(42, 42, 42)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jComboBox1, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)\n .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE))\n .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(95, 95, 95))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(105, 105, 105))))\n .addGroup(layout.createSequentialGroup()\n .addGap(34, 34, 34)\n .addComponent(jLabel3)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(7, 7, 7)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addComponent(jLabel2)\n .addGap(18, 18, 18)\n .addComponent(jLabel5)\n .addGap(37, 37, 37)\n .addComponent(jLabel3))\n .addGroup(layout.createSequentialGroup()\n .addGap(15, 15, 15)\n .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 32, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n pack();\n }", "private void init() {\n\t\tthis.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);\n\t\tthis.setSize(350, 300);\n\t\tthis.setResizable(false);\n\t\tlbl1.setFont(new Font(\"微软雅黑\",Font.PLAIN,14));\n\t\tlbl2.setFont(new Font(\"微软雅黑\",Font.PLAIN,14));\n\t\tlbl3.setFont(new Font(\"微软雅黑\",Font.PLAIN,14));\n\t\tlbl4.setFont(new Font(\"微软雅黑\",Font.PLAIN,14));\n\t\tlbl5.setFont(new Font(\"微软雅黑\",Font.PLAIN,14));\n\t\tlbl6.setFont(new Font(\"微软雅黑\",Font.PLAIN,14));\n\t\tlbl7.setFont(new Font(\"微软雅黑\",Font.PLAIN,14));\n\t\tbtncanel.setFont(new Font(\"微软雅黑\",Font.PLAIN,14));\n\t\tbtnsave.setFont(new Font(\"微软雅黑\",Font.PLAIN,14));\n\t\t\n\t\tpnlInfo.setBounds(10,5,320,220);\n//\t\tpnlInfo.setBackground(Color.cyan);\n//\t\tpnlMain.setBackground(Color.green);\n//\t\tbtnsave.setBackground(Color.pink);\n//\t\tbtncanel.setBackground(Color.yellow);\n\t\tbtnsave.setBounds(120, 230, 70, 25);\n\t\tbtncanel.setBounds(210, 230, 70, 25);\n\t\t\n\t\tbtncanel.addActionListener(new AddRederTypeFrame_btncanel_ActionListener(this));\n\t\tbtnsave.addActionListener(new AddRederTypeFrame_btnsave_ActionListener(this));\n\t\t\n//\t\tpnlInfo.setBorder(BorderFactory.createMatteBorder(1, 5, 1, 1, Color.cyan));\n\t\t\n\t\tpnlInfo.add(lbl1);\n\t\tpnlInfo.add(txtname);\n\t\tpnlInfo.add(lbl2);\n\t\tpnlInfo.add(txtcount);\n\t\tpnlInfo.add(lbl3);\n\t\tpnlInfo.add(txtdate);\n\t\tpnlInfo.add(lbl4);\n\t\tpnlInfo.add(txtmtp);\n\t\tpnlInfo.add(lbl5);\n\t\tpnlInfo.add(txtstcharge);\n\t\tpnlInfo.add(lbl6);\n\t\tpnlInfo.add(txtoutcharge);\n\t\tpnlInfo.add(lbl7);\n\t\tpnlInfo.add(txtqty);\n\t\t\n\t\tpnlMain.add(pnlInfo);\n\t\tpnlMain.add(btnsave);\n\t\tpnlMain.add(btncanel);\n\t\tthis.add(pnlMain);\n\t\tthis.setTitle(\"新增用户\");\n\t\tGlobal.setCenterByWindow(this);\n\t\tthis.setVisible(true);\n\t}", "private void buildDialogWindow(Ingredient aIng) {\n\t\t\n \t\tGridBagLayout layout = new GridBagLayout();\n GridBagConstraints lc = new GridBagConstraints();\n getContentPane().setLayout(layout);\n\n \n lc.anchor = GridBagConstraints.EAST;\n lc.insets = new Insets(5, 5, 5, 5);\n\n aLabel = new JLabel(\"Name\");\n lc.gridx = 0; lc.gridy = 0;\n lc.gridwidth = 1; lc.gridheight = 1;\n lc.weightx = 0.0; lc.weighty = 0.0;\n layout.setConstraints(aLabel, lc);\n getContentPane().add(aLabel);\n\n aLabel = new JLabel(\"Food Group\");\n lc.gridx = 0; lc.gridy = 1;\n lc.gridwidth = 1; lc.gridheight = 1;\n lc.weightx = 0.0; lc.weighty = 0.0;\n layout.setConstraints(aLabel, lc);\n getContentPane().add(aLabel);\n \n aLabel = new JLabel(\"Shelf Life\");\n lc.gridx = 0; lc.gridy = 2;\n lc.gridwidth = 1; lc.gridheight = 1;\n lc.weightx = 0.0; lc.weighty = 0.0;\n layout.setConstraints(aLabel, lc);\n getContentPane().add(aLabel);\n\n aLabel = new JLabel(\"Calories\");\n lc.gridx = 0; lc.gridy = 3;\n lc.gridwidth = 1; lc.gridheight = 1;\n lc.weightx = 0.0; lc.weighty = 0.0;\n layout.setConstraints(aLabel, lc);\n getContentPane().add(aLabel);\n\n \t\t// Add the name field\n\t\tnameField = new JTextField(aIng.getName());\n\t\tnameField.setFont(UIFont);\n lc.gridx = 1; lc.gridy = 0;\n lc.gridwidth = 3; lc.gridheight = 1;\n lc.fill = GridBagConstraints.BOTH;\n lc.weightx = 1.0; lc.weighty = 0.0;\n layout.setConstraints(nameField, lc);\n \t\tgetContentPane().add(nameField);\n\n\t\t// Add the address field\n\t\tfoodGroupField = new JTextField(aIng.getFoodGroup());\n\t\tfoodGroupField.setFont(UIFont);\n lc.gridx = 1; lc.gridy = 1;\n lc.gridwidth = 3; lc.gridheight = 1;\n lc.fill = GridBagConstraints.BOTH;\n lc.weightx = 1.0; lc.weighty = 0.0;\n layout.setConstraints(foodGroupField, lc);\n \t\tgetContentPane().add(foodGroupField);\n\n \t\tshelfLifeField = new JTextField(\"\"+aIng.getShelfLife());\n \t\tshelfLifeField.setFont(UIFont);\n lc.gridx = 1; lc.gridy = 2;\n lc.gridwidth = 3; lc.gridheight = 1;\n lc.fill = GridBagConstraints.BOTH;\n lc.weightx = 1.0; lc.weighty = 0.0;\n layout.setConstraints(shelfLifeField, lc);\n \t\tgetContentPane().add(shelfLifeField);\n \t\t\n \t\tcaloriesField = new JTextField(\"\"+aIng.getCalories());\n \t\tcaloriesField.setFont(UIFont);\n lc.gridx = 1; lc.gridy = 3;\n lc.gridwidth = 3; lc.gridheight = 1;\n lc.fill = GridBagConstraints.BOTH;\n lc.weightx = 1.0; lc.weighty = 0.0;\n layout.setConstraints(caloriesField, lc);\n \t\tgetContentPane().add(caloriesField);\n \t\t\n\t\t// Add the Update button\n\t\tupdateButton = new JButton(\"UPDATE\");\n lc.gridx = 1; lc.gridy = 6;\n lc.gridwidth = 1; lc.gridheight = 1;\n lc.weightx = 0.0; lc.weighty = 0.0;\n layout.setConstraints(updateButton, lc);\n \t\tgetContentPane().add(updateButton);\n \n\t\t// Add the Delete button\n\t\tdeleteButton = new JButton(\"DELETE\");\n lc.gridx = 2; lc.gridy = 6;\n lc.gridwidth = 1; lc.gridheight = 1;\n lc.weightx = 0.0; lc.weighty = 0.0;\n layout.setConstraints(deleteButton, lc);\n \t\tgetContentPane().add(deleteButton);\n\n \t\t// Add the Cancel button\n\t\tcancelButton = new JButton(\"CANCEL\");\n \n lc.gridx = 3; lc.gridy = 6;\n lc.gridwidth = 1; lc.gridheight = 1;\n lc.weightx = 0.0; lc.weighty = 0.0;\n layout.setConstraints(cancelButton, lc);\n \t\tgetContentPane().add(cancelButton);\n\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 btnMngAirliners = new javax.swing.JButton();\n btnCreateAirliner = new javax.swing.JButton();\n\n btnMngAirliners.setText(\"Manage airliners\");\n btnMngAirliners.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnMngAirlinersActionPerformed(evt);\n }\n });\n\n btnCreateAirliner.setText(\"Create airliner\");\n btnCreateAirliner.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCreateAirlinerActionPerformed(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(22, 22, 22)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(btnCreateAirliner, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnMngAirliners, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap(481, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(139, 139, 139)\n .addComponent(btnMngAirliners, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(35, 35, 35)\n .addComponent(btnCreateAirliner, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(182, Short.MAX_VALUE))\n );\n }", "public frameAddDepartments() {\n initComponents();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public DriftSwing() {\n initComponents();\n \n // Create an invisible options dialog to initialize options\n options = new OptionsDialog(this);\n }", "private void initializeSelectPatientDialog(){\r\n\r\n selectPatientDialog = new JDialog();\r\n selectPatientDialog.setTitle(\"Search Results\");\r\n\r\n selectPatientPanel = new JPanel(new GridBagLayout());\r\n selectPatientPanel.setBackground(MainGUI.backgroundColor);\r\n selectPatientPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));\r\n\r\n selectPatientPanelConstraints = new GridBagConstraints();\r\n\r\n selectPatient_instructionLabel = new JLabel(\"Choose Patient from Drop down List\");\r\n selectPatient_instructionLabel.setFont(new java.awt.Font(selectPatient_instructionLabel.getFont().getFontName(),\r\n Font.PLAIN, 20));\r\n selectPatient_instructionLabel.setForeground(MainGUI.fontColor);\r\n\r\n selectPatient_choosePatientCB = new JComboBox<String>();\r\n\r\n selectPatient_selectPatientFoundButton = new JButton(\"Select Patient\");\r\n selectPatient_selectPatientFoundButton.setForeground(MainGUI.fontColor);\r\n\r\n // add components to panel\r\n\r\n // add instruction label\r\n selectPatientPanelConstraints.gridx = 10;\r\n selectPatientPanelConstraints.gridy = 10;\r\n selectPatientPanelConstraints.gridwidth = 20;\r\n selectPatientPanelConstraints.weighty = 0.1;\r\n selectPatientPanelConstraints.anchor = GridBagConstraints.NORTH;\r\n selectPatientPanelConstraints.insets = new Insets(20, 0, 0, 0);\r\n selectPatientPanel.add(selectPatient_instructionLabel, selectPatientPanelConstraints);\r\n\r\n // add combo box\r\n selectPatientPanelConstraints.gridy = 20;\r\n selectPatientPanelConstraints.weightx = 0.1;\r\n selectPatientPanelConstraints.anchor = GridBagConstraints.WEST;\r\n selectPatientPanelConstraints.insets = new Insets(0, 80, 0, 0);\r\n selectPatientPanel.add(selectPatient_choosePatientCB, selectPatientPanelConstraints);\r\n\r\n // add select patient button\r\n selectPatientPanelConstraints.gridx = 20;\r\n selectPatientPanelConstraints.ipady = 10;\r\n selectPatientPanelConstraints.anchor = GridBagConstraints.EAST;\r\n selectPatientPanelConstraints.insets = new Insets(0, 0, 0, 80);\r\n selectPatientPanel.add(selectPatient_selectPatientFoundButton, selectPatientPanelConstraints);\r\n\r\n // add panel to dialog\r\n selectPatientDialog.add(selectPatientPanel);\r\n selectPatientDialog.setSize(500, 200);\r\n selectPatientDialog.setLocationRelativeTo(null);\r\n\r\n\r\n }", "public void buildGUI(){\n\n\t\tsetLayout(new BorderLayout());//Setting a borderlayout for the frame\n\t\toptionsPane.setBorder(BorderFactory.createLineBorder(Color.black));//This sets a border around the options panel\n\t\tadd(disclaimer, BorderLayout.SOUTH);//Adds the disclaimer panel to the frame\n\t\tadd(optionsPane, BorderLayout.LINE_START);//Adds the options panel to the frame\n\t\tadd(scrollbar);//Adds the scrollbar to the frame (contains the search frame)\n\t\toptionsPane.add(jpCmbBoxes, BorderLayout.NORTH);//Adds the combo boxes to the options pane\n\t\toptionsPane.add(pic, BorderLayout.SOUTH);//Adds the picture to the options pane\n\t\tdisclaimer.add(disclaim, BorderLayout.LINE_START);//Adds the disclaimer text to the disclaimer panel\n\t\t\n\t\t/*Sets borders around each of the combo boxes, buttons and the disclaimer text */\n\t\ttrackingRange.setBorder(new EmptyBorder(10, 10, 10, 10));\n\t\tgenderBox.setBorder(new EmptyBorder(10, 10, 10, 10));\n\t\tstageofLifeBox.setBorder(new EmptyBorder(10, 10, 10, 10));\n\t\ttagLocationBox.setBorder(new EmptyBorder(10, 10, 10, 10));\n\t\tsearchButton.setBorder(new EmptyBorder(10, 10, 10, 10));\n\t\tdisclaimer.setBorder(new EmptyBorder(10, 10, 10, 10));\n\t\tsearchByName.setBorder(new EmptyBorder(10, 10, 10, 10));\n\t\t\n\t\tsearchResults.setLayout((new BoxLayout(searchResults, BoxLayout.PAGE_AXIS)));//Setting the layout for search results panel\n\t\tsearchResults.setBorder(BorderFactory.createLineBorder(Color.black));//Sets a border around the panel\n\t\t/*Adding components to the combo boxes panel */\n\t\tjpCmbBoxes.setLayout(new BoxLayout(jpCmbBoxes, BoxLayout.Y_AXIS));//Sets the layout for this panel\n\t\tjpCmbBoxes.add(subTitle);\n\t\tjpCmbBoxes.add(trackingRangeLabel);\n\t\tjpCmbBoxes.add(trackingRange);\n\t\tjpCmbBoxes.add(genderLabel);\n\t\tjpCmbBoxes.add(genderBox);\n\t\tjpCmbBoxes.add(stageOfLifeLabel);\n\t\tjpCmbBoxes.add(stageofLifeBox);\n\t\tjpCmbBoxes.add(tagLocationLabel);\n\t\tjpCmbBoxes.add(tagLocationBox);\n\t\tjpCmbBoxes.add(searchButton);\n\t\tjpCmbBoxes.add(searchByName);\n\t\t\n\t\ttry {//Importing the image for this panel\n\t\t\tsharkImage = ImageIO.read(new File(\"source/images/shark2.png\"));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tJLabel image = new JLabel(new ImageIcon(sharkImage));//Creating a label and adding the image to the label\n\t\tpic.add(image);//adding the label to the panel\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n protocolEditPanel = new javax.swing.JPanel();\n closeProtocolEditButton = new javax.swing.JButton();\n protocolSaveOrUpdateButton = new javax.swing.JButton();\n cvParamsPanel = new javax.swing.JPanel();\n cvParamSummaryScrollPane = new javax.swing.JScrollPane();\n cvParamSummaryList = new javax.swing.JList();\n cvParamDualList = new com.compomics.colims.client.compoment.DualList<>();\n protocolCvParamsCrudButton = new javax.swing.JButton();\n nameLabel = new javax.swing.JLabel();\n nameTextField = new javax.swing.JTextField();\n protocolStateInfoLabel = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Protocol management\");\n setPreferredSize(new java.awt.Dimension(720, 377));\n\n protocolEditPanel.setBackground(new java.awt.Color(255, 255, 255));\n\n closeProtocolEditButton.setText(\"close\");\n closeProtocolEditButton.setMaximumSize(new java.awt.Dimension(80, 25));\n closeProtocolEditButton.setMinimumSize(new java.awt.Dimension(80, 25));\n closeProtocolEditButton.setPreferredSize(new java.awt.Dimension(80, 25));\n\n protocolSaveOrUpdateButton.setText(\"save\");\n protocolSaveOrUpdateButton.setMaximumSize(new java.awt.Dimension(80, 25));\n protocolSaveOrUpdateButton.setMinimumSize(new java.awt.Dimension(80, 25));\n protocolSaveOrUpdateButton.setPreferredSize(new java.awt.Dimension(80, 25));\n\n cvParamsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(\"CV params\"));\n cvParamsPanel.setOpaque(false);\n\n cvParamSummaryScrollPane.setViewportView(cvParamSummaryList);\n\n protocolCvParamsCrudButton.setText(\"edit...\");\n protocolCvParamsCrudButton.setToolTipText(\"edit the available CV params of the selected CV param type\");\n protocolCvParamsCrudButton.setMaximumSize(new java.awt.Dimension(80, 25));\n protocolCvParamsCrudButton.setMinimumSize(new java.awt.Dimension(80, 25));\n protocolCvParamsCrudButton.setPreferredSize(new java.awt.Dimension(80, 25));\n\n javax.swing.GroupLayout cvParamsPanelLayout = new javax.swing.GroupLayout(cvParamsPanel);\n cvParamsPanel.setLayout(cvParamsPanelLayout);\n cvParamsPanelLayout.setHorizontalGroup(\n cvParamsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, cvParamsPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(cvParamSummaryScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(cvParamsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(protocolCvParamsCrudButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(cvParamDualList, javax.swing.GroupLayout.DEFAULT_SIZE, 470, Short.MAX_VALUE))\n .addContainerGap())\n );\n cvParamsPanelLayout.setVerticalGroup(\n cvParamsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(cvParamsPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(cvParamsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(cvParamSummaryScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE)\n .addComponent(cvParamDualList, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(protocolCvParamsCrudButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n nameLabel.setText(\"Name*\");\n\n protocolStateInfoLabel.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n protocolStateInfoLabel.setForeground(new java.awt.Color(255, 0, 0));\n protocolStateInfoLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n\n javax.swing.GroupLayout protocolEditPanelLayout = new javax.swing.GroupLayout(protocolEditPanel);\n protocolEditPanel.setLayout(protocolEditPanelLayout);\n protocolEditPanelLayout.setHorizontalGroup(\n protocolEditPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(protocolEditPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(protocolEditPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(cvParamsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, protocolEditPanelLayout.createSequentialGroup()\n .addComponent(protocolStateInfoLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(protocolSaveOrUpdateButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(closeProtocolEditButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, protocolEditPanelLayout.createSequentialGroup()\n .addComponent(nameLabel)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(nameTextField)))\n .addContainerGap())\n );\n protocolEditPanelLayout.setVerticalGroup(\n protocolEditPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(protocolEditPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(protocolEditPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(protocolEditPanelLayout.createSequentialGroup()\n .addGap(6, 6, 6)\n .addComponent(nameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(nameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(cvParamsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(protocolEditPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(protocolEditPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(protocolSaveOrUpdateButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(closeProtocolEditButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(protocolStateInfoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\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 .addGap(0, 720, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(protocolEditPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 375, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(protocolEditPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "public DifferentVehicleOwnerWindow() {\n stage = new Stage();\n person = null;\n\n birthNoLabel = new Label(\"Fødselsnummer:\");\n firstNameLabel = new Label(\"Fornavn:\");\n lastNameLabel = new Label(\"Etternavn:\");\n telephoneNoLabel = new Label(\"Telefonnummer:\");\n emailLabel = new Label(\"Email:\");\n zipCodeLabel = new Label(\"Postnummer:\");\n streetAddressLabel = new Label(\"Adresse:\");\n\n birthNoField = new TextField();\n firstNameField = new TextField();\n lastNameField = new TextField();\n telephoneNoField = new TextField();\n emailField = new TextField();\n zipCodeField = new TextField();\n streetAddressField = new TextField();\n\n registerOwnerButton = new Button(\"Registrer eier\");\n\n container = new GridPane();\n container.addColumn(0, birthNoLabel, firstNameLabel, lastNameLabel,\n telephoneNoLabel, emailLabel, zipCodeLabel,\n streetAddressLabel);\n container.addColumn(1, birthNoField, firstNameField, lastNameField,\n telephoneNoField, emailField, zipCodeField, streetAddressField,\n registerOwnerButton);\n container.backgroundProperty().setValue(\n new Background(new BackgroundFill(Color.web(\"D7EBE6\"),\n CornerRadii.EMPTY, Insets.EMPTY)));\n scene = new Scene(container);\n\n stage.setScene(scene);\n }", "private void $$$setupUI$$$() {\r\n createUIComponents();\r\n pnlMain = new JPanel();\r\n pnlMain.setLayout(new FormLayout(\"fill:d:grow\", \"fill:38dlu:noGrow,top:4dlu:noGrow,fill:225dlu:noGrow,top:4dlu:noGrow,fill:16dlu:noGrow\"));\r\n pnlMain.setMinimumSize(new Dimension(400, 480));\r\n pnlMain.setPreferredSize(new Dimension(500, 480));\r\n pnlForm.setLayout(new FormLayout(\"fill:50dlu:noGrow,left:4dlu:noGrow,fill:100dlu:noGrow,left:4dlu:noGrow,fill:50dlu:noGrow\", \"fill:12dlu:noGrow\"));\r\n CellConstraints cc = new CellConstraints();\r\n pnlMain.add(pnlForm, cc.xy(1, 1));\r\n lblBuscar = new JLabel();\r\n lblBuscar.setText(\"Buscar \");\r\n pnlForm.add(lblBuscar, cc.xy(1, 1));\r\n txtBuscar = new JTextField();\r\n pnlForm.add(txtBuscar, cc.xy(3, 1, CellConstraints.FILL, CellConstraints.DEFAULT));\r\n btnSearch = new JButton();\r\n btnSearch.setText(\"Buscar\");\r\n pnlForm.add(btnSearch, cc.xy(5, 1));\r\n pnlGrid.setLayout(new FormLayout(\"fill:d:grow\", \"center:max(d;4px):noGrow,top:4dlu:noGrow,fill:14dlu:noGrow,top:4dlu:noGrow,fill:d:grow\"));\r\n pnlGrid.setMinimumSize(new Dimension(400, 333));\r\n pnlGrid.setPreferredSize(new Dimension(500, 333));\r\n pnlMain.add(pnlGrid, cc.xy(1, 3));\r\n pnlTitGrid = new JPanel();\r\n pnlTitGrid.setLayout(new FormLayout(\"fill:16dlu:noGrow,left:4dlu:noGrow,fill:100dlu:noGrow\", \"fill:16dlu:noGrow\"));\r\n pnlGrid.add(pnlTitGrid, cc.xy(1, 1));\r\n chkSel = new JCheckBox();\r\n chkSel.setText(\"\");\r\n pnlTitGrid.add(chkSel, cc.xy(1, 1));\r\n lblTitGrid = new JLabel();\r\n lblTitGrid.setText(\"Lista de Laboratorios\");\r\n pnlTitGrid.add(lblTitGrid, cc.xy(3, 1));\r\n pnlResult = new JScrollPane();\r\n pnlResult.setMinimumSize(new Dimension(400, 300));\r\n pnlResult.setPreferredSize(new Dimension(500, 300));\r\n pnlGrid.add(pnlResult, cc.xy(1, 5, CellConstraints.FILL, CellConstraints.FILL));\r\n tblGrid = new JTable();\r\n pnlResult.setViewportView(tblGrid);\r\n pnlToolBarGrid = new JPanel();\r\n pnlToolBarGrid.setLayout(new FormLayout(\"\", \"\"));\r\n pnlGrid.add(pnlToolBarGrid, cc.xy(1, 3));\r\n footerPanel = new JPanel();\r\n footerPanel.setLayout(new FormLayout(\"fill:d:noGrow,left:4dlu:noGrow,right:d:grow\", \"fill:d:grow\"));\r\n pnlMain.add(footerPanel, cc.xy(1, 5));\r\n lblEnter = new JLabel();\r\n lblEnter.setText(\"F2 = Seleccionar\");\r\n footerPanel.add(lblEnter, cc.xy(1, 1));\r\n lblEsc = new JLabel();\r\n lblEsc.setText(\"Esc = Salir\");\r\n footerPanel.add(lblEsc, cc.xy(3, 1));\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLayeredPane1 = new javax.swing.JLayeredPane();\n vehicleCategoryIdLabel = new javax.swing.JLabel();\n vehicleCategoryComboBox = new javax.swing.JComboBox();\n searchButton = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n descriptionTextArea = new javax.swing.JTextArea();\n descriptionLabel = new javax.swing.JLabel();\n backgroundLabel = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLayeredPane1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n vehicleCategoryIdLabel.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n vehicleCategoryIdLabel.setText(\"Vehicle Category ID :\");\n jLayeredPane1.add(vehicleCategoryIdLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 76, -1, -1));\n\n vehicleCategoryComboBox.setBackground(new java.awt.Color(231, 231, 231));\n vehicleCategoryComboBox.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n vehicleCategoryComboBox.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n vehicleCategoryComboBoxActionPerformed(evt);\n }\n });\n jLayeredPane1.add(vehicleCategoryComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 70, 80, -1));\n\n searchButton.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n searchButton.setText(\"Search\");\n searchButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n searchButtonActionPerformed(evt);\n }\n });\n jLayeredPane1.add(searchButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 70, 87, -1));\n\n descriptionTextArea.setEditable(false);\n descriptionTextArea.setBackground(new java.awt.Color(231, 231, 231));\n descriptionTextArea.setColumns(1);\n descriptionTextArea.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n descriptionTextArea.setRows(5);\n descriptionTextArea.setWrapStyleWord(true);\n jScrollPane1.setViewportView(descriptionTextArea);\n\n jLayeredPane1.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 138, 360, 83));\n\n descriptionLabel.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n descriptionLabel.setText(\"Description :\");\n jLayeredPane1.add(descriptionLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 115, -1, -1));\n jLayeredPane1.add(backgroundLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 410, 260));\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(jLayeredPane1)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLayeredPane1)\n );\n\n pack();\n }", "private void initializateGUI() {\n\t\t\n\t\t\n\t\tthis.menuBar = buildMenuBar();\n\t\t\n\t\tthis.toolBar = buildToolBar();\n\t\t\n\t\tthis.container = (JComponent) ContainerViewFactory.getInstance().getContainerView(null);\n\t\t\n\t\tthis.status = buildStatusBar();\n\t\t\n\t\tscrollPane = new JScrollPane();\n\t\tscrollPane.getViewport().add(this.container);\n\t\t\n\t\ttextResources.getString(\"application.title\").ifPresent(super::setTitle);\n\n\t\tif (this.menuBar != null) {\n\t\t\tsuper.setJMenuBar(this.menuBar);\n\t\t}\n\t\tsuper.setPreferredSize(MINIMUM_SIZE);\n\t\tsuper.setMinimumSize(MINIMUM_SIZE);\n\t\tsuper.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));\n\n\t\tsuper.getRootPane().setPreferredSize(MINIMUM_SIZE);\n\t\tsuper.getRootPane().setMinimumSize(MINIMUM_SIZE);\t\t\n\t\tsuper.getRootPane().setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));\n\t\t\n\t\tsuper.setLayout(new BorderLayout());\n\t\t\n\t\tsuper.add(toolBar, BorderLayout.NORTH);\n\t\tsuper.add(scrollPane, BorderLayout.CENTER);\n\t\tsuper.add(status, BorderLayout.SOUTH);\n\t\t\n\t\tsuper.addWindowListener(new WindowAdapter() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void windowOpened(WindowEvent e) {\n\t\t\t\tinitializationDialog = buildInitializationAction();\n\t\t\t\tinitializationDialog.setVisible(true);\n\t\t\t\tinitializationDialog.toFront();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void windowClosing(WindowEvent e) {\n\t\t\t\tconfirmExitAction();\n\t\t\t}\n\t\t});\n\t\tthis.handlerInitializateGUI();\n\t}", "private void setAddVisitDialogUI(Frame parent, Point loc) {\n dialog = new JDialog(parent);\n dialog.setLocation(loc.x + 80, loc.y + 80);\n panel = new JPanel();\n panel.setBackground(new Color(248, 248, 251));\n panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));\n panel.add(Box.createVerticalStrut(20));\n\n message = new JPanel();\n text = new JLabel(\"Add visit\");\n\n text.setFont(new Font(\"Nunito\", Font.PLAIN, 14));\n\n message.setBackground(null);\n message.add(text);\n panel.add(message);\n panel.add(Box.createVerticalStrut(20));\n }", "public addcar() {\n initComponents();\n }", "public guiProntuarioVirtual() {\n initComponents();\n \n }", "void makeDialog()\n\t{\n\t\tfDialog = new ViewOptionsDialog(this.getTopLevelAncestor());\n\t}", "private static void createAndShowGUI() {\r\n JFrame.setDefaultLookAndFeelDecorated(true);\r\n\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n frame.setLayout(new BorderLayout());\r\n\r\n JPanel parametersPanel = new JPanel();\r\n parametersPanel.setPreferredSize(new Dimension(preferredWidth, 50));\r\n \r\n addComponentsToPane(parametersPanel);\r\n \r\n frame.add(parametersPanel, BorderLayout.PAGE_START);\r\n \r\n schedulePanel.add(monLabel);\r\n schedulePanel.add(tueLabel);\r\n schedulePanel.add(wedLabel);\r\n schedulePanel.add(thuLabel);\r\n schedulePanel.add(friLabel);\r\n schedulePanel.setPreferredSize(new Dimension(preferredWidth, 500));\r\n JScrollPane scrollPane = new JScrollPane();\r\n scrollPane.setViewportView(schedulePanel);\r\n JPanel bigPanel = new JPanel(); \r\n bigPanel.setLayout(new BorderLayout());\r\n bigPanel.setPreferredSize(schedulePanel.getPreferredSize());\r\n bigPanel.add(scrollPane, BorderLayout.CENTER);\r\n frame.add(bigPanel, BorderLayout.CENTER);\r\n\r\n frame.setJMenuBar(createMenu());\r\n \r\n frame.pack();\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n \r\n frame.setVisible(true);\r\n frame.setResizable(false);\r\n }", "private void initComponents()\n\t{\n\t\tGridBagConstraints gridBagConstraints;\n\t\tJLabel tempLabel;\n\n\t\tcmbBonusSkillPoints = new JComboBoxEx();\n\t\tcmbBonusFeats = new JComboBoxEx();\n\n\t\t//txtCR = new JTextField();\n\t\tcmbCR = new JComboBoxEx();\n\t\ttxtDisplayName = new JTextField();\n\t\tcmbHands = new JComboBoxEx();\n\t\ttxtHitDiceAdvancement = new JTextField();\n\t\tcmbHitDiceNumber = new JComboBoxEx();\n\t\tcmbHitDiceSize = new JComboBoxEx();\n\t\tcmbLegs = new JComboBoxEx();\n\t\ttxtLevelAdj = new JTextField();\n\t\tcmbMonsterClass = new JComboBoxEx();\n\t\tcmbMonsterLevel = new JComboBoxEx();\n\t\tcmbReach = new JComboBoxEx();\n\t\tcmbSize = new JComboBoxEx();\n\t\tcmbSkillMult = new JComboBoxEx();\n\n\t\tpnlTemplateMisc = new JPanel();\n\n\t\t//pnlTemplateTypes = new AvailableSelectedPanel();\n\t\tpnlTemplateTypes = new TypePanel(PropertyFactory.getString(\"in_demEnterNewType\"));\n\n\t\tsetLayout(new GridBagLayout());\n\n\t\tpnlTemplateMisc.setLayout(new GridBagLayout());\n\n\t\ttempLabel = new JLabel(\"Display Name\");\n\t\tgridBagConstraints = buildConstraints(0, 0);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tgridBagConstraints = buildConstraints(1, 0);\n\t\tgridBagConstraints.gridwidth = 3;\n\t\tgridBagConstraints.weightx = 0.4;\n\t\tpnlTemplateMisc.add(txtDisplayName, gridBagConstraints);\n\n\t\ttempLabel = new JLabel(\"Hands\");\n\t\tgridBagConstraints = buildConstraints(0, 1);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tgridBagConstraints = buildConstraints(1, 1);\n\t\tgridBagConstraints.weightx = 0.4;\n\t\tpnlTemplateMisc.add(cmbHands, gridBagConstraints);\n\n\t\ttempLabel = new JLabel(\"Legs\");\n\t\tgridBagConstraints = buildConstraints(2, 1);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tgridBagConstraints = buildConstraints(3, 1);\n\t\tgridBagConstraints.weightx = 0.4;\n\t\tpnlTemplateMisc.add(cmbLegs, gridBagConstraints);\n\n\t\ttempLabel = new JLabel(\"Reach\");\n\t\tgridBagConstraints = buildConstraints(0, 2);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tgridBagConstraints = buildConstraints(1, 2);\n\t\tgridBagConstraints.weightx = 0.4;\n\t\tpnlTemplateMisc.add(cmbReach, gridBagConstraints);\n\n\t\ttempLabel = new JLabel(\"Skill Multiplier\");\n\t\tgridBagConstraints = buildConstraints(2, 2);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tgridBagConstraints = buildConstraints(3, 2);\n\t\tgridBagConstraints.weightx = 0.4;\n\t\tpnlTemplateMisc.add(cmbSkillMult, gridBagConstraints);\n\n\t\ttempLabel = new JLabel(\"Bonus Skill Pts / Level\");\n\t\tgridBagConstraints = buildConstraints(0, 3);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tgridBagConstraints = buildConstraints(1, 3);\n\t\tgridBagConstraints.weightx = 0.4;\n\t\tpnlTemplateMisc.add(cmbBonusSkillPoints, gridBagConstraints);\n\n\t\ttempLabel = new JLabel(\"Bonus Starting Feats\");\n\t\tgridBagConstraints = buildConstraints(2, 3);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tgridBagConstraints = buildConstraints(3, 3);\n\t\tgridBagConstraints.weightx = 0.4;\n\t\tpnlTemplateMisc.add(cmbBonusFeats, gridBagConstraints);\n\n\t\ttempLabel = new JLabel(\"CR\");\n\t\tgridBagConstraints = buildConstraints(0, 4);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tcmbCR.setEditable(true);\n\t\tgridBagConstraints = buildConstraints(1, 4);\n\t\tgridBagConstraints.weightx = 0.4;\n\n\t\t//pnlTemplateMisc.add(txtCR, gridBagConstraints);\n\t\tpnlTemplateMisc.add(cmbCR, gridBagConstraints);\n\n\t\ttempLabel = new JLabel(\"Level Adjustment\");\n\t\tgridBagConstraints = buildConstraints(2, 4);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tgridBagConstraints = buildConstraints(3, 4);\n\t\tgridBagConstraints.weightx = 0.4;\n\t\tpnlTemplateMisc.add(txtLevelAdj, gridBagConstraints);\n\n\t\ttempLabel = new JLabel(\"Size\");\n\t\tgridBagConstraints = buildConstraints(0, 5);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tgridBagConstraints = buildConstraints(1, 5);\n\t\tgridBagConstraints.weightx = 0.4;\n\t\tpnlTemplateMisc.add(cmbSize, gridBagConstraints);\n\n\t\ttempLabel = new JLabel(\"Hit Dice Advancement\");\n\t\tgridBagConstraints = buildConstraints(2, 5);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tgridBagConstraints = buildConstraints(3, 5);\n\t\tgridBagConstraints.weightx = 0.4;\n\t\tpnlTemplateMisc.add(txtHitDiceAdvancement, gridBagConstraints);\n\n\t\ttempLabel = new JLabel(\"Monster Class\");\n\t\tgridBagConstraints = buildConstraints(0, 6);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tgridBagConstraints = buildConstraints(1, 6);\n\t\tgridBagConstraints.weightx = 0.4;\n\t\tpnlTemplateMisc.add(cmbMonsterClass, gridBagConstraints);\n\n\t\ttempLabel = new JLabel(\"Monster Level\");\n\t\tgridBagConstraints = buildConstraints(2, 6);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tgridBagConstraints = buildConstraints(3, 6);\n\t\tgridBagConstraints.weightx = 0.4;\n\t\tpnlTemplateMisc.add(cmbMonsterLevel, gridBagConstraints);\n\n\t\ttempLabel = new JLabel(\"Number of Hit Dice\");\n\t\tgridBagConstraints = buildConstraints(0, 7);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tgridBagConstraints = buildConstraints(1, 7);\n\t\tgridBagConstraints.weightx = 0.4;\n\t\tpnlTemplateMisc.add(cmbHitDiceNumber, gridBagConstraints);\n\n\t\ttempLabel = new JLabel(\"Hit Dice Size\");\n\t\tgridBagConstraints = buildConstraints(2, 7);\n\t\tpnlTemplateMisc.add(tempLabel, gridBagConstraints);\n\n\t\tgridBagConstraints = buildConstraints(3, 7);\n\t\tgridBagConstraints.weightx = 0.4;\n\t\tpnlTemplateMisc.add(cmbHitDiceSize, gridBagConstraints);\n\n\t\tgridBagConstraints = new GridBagConstraints();\n\t\tgridBagConstraints.gridy = 2;\n\t\tgridBagConstraints.fill = GridBagConstraints.HORIZONTAL;\n\t\tgridBagConstraints.weightx = 1.0;\n\t\tadd(pnlTemplateMisc, gridBagConstraints);\n\n\t\t//pnlTemplateTypes.setHeader(PropertyFactory.getString(\"in_type\"));\n\t\tgridBagConstraints = new GridBagConstraints();\n\t\tgridBagConstraints.gridy = 5;\n\t\tgridBagConstraints.gridheight = 4;\n\t\tgridBagConstraints.fill = GridBagConstraints.BOTH;\n\t\tgridBagConstraints.weightx = 1.0;\n\t\tgridBagConstraints.weighty = 1.0;\n\t\tadd(pnlTemplateTypes, gridBagConstraints);\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\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}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel3 = new javax.swing.JPanel();\n LayeredPane1 = new javax.swing.JLayeredPane();\n choiceComboBox = new javax.swing.JComboBox<>();\n partsTableLayeredPane = new javax.swing.JLayeredPane();\n resTableScrollPane2 = new javax.swing.JScrollPane();\n partsTable = new javax.swing.JTable();\n vehicleLayeredPane = new javax.swing.JLayeredPane();\n resTableScrollPane = new javax.swing.JScrollPane();\n vehiclesTable = new javax.swing.JTable();\n Add_btn1 = new javax.swing.JPanel();\n btn_name = new javax.swing.JLabel();\n icon_plus = new javax.swing.JLabel();\n icon_remove = new javax.swing.JLabel();\n amountText = new javax.swing.JTextField();\n amountSeparator = new javax.swing.JSeparator();\n amountLabel = new javax.swing.JLabel();\n\n addComponentListener(new java.awt.event.ComponentAdapter() {\n public void componentHidden(java.awt.event.ComponentEvent evt) {\n formComponentHidden(evt);\n }\n });\n\n jPanel3.setBackground(new java.awt.Color(235, 255, 255));\n\n choiceComboBox.setBackground(new java.awt.Color(0, 102, 102));\n choiceComboBox.setFont(new java.awt.Font(\"Tahoma\", 1, 16)); // NOI18N\n choiceComboBox.setForeground(new java.awt.Color(255, 255, 255));\n choiceComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Choose one option\", \"Add Vehicle\", \"Add Part\", \"Remove Vehicle\", \"Remove Part\" }));\n choiceComboBox.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n choiceComboBoxItemStateChanged(evt);\n }\n });\n choiceComboBox.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n choiceComboBoxMousePressed(evt);\n }\n public void mouseReleased(java.awt.event.MouseEvent evt) {\n choiceComboBoxMouseReleased(evt);\n }\n });\n\n LayeredPane1.setLayer(choiceComboBox, javax.swing.JLayeredPane.DEFAULT_LAYER);\n\n javax.swing.GroupLayout LayeredPane1Layout = new javax.swing.GroupLayout(LayeredPane1);\n LayeredPane1.setLayout(LayeredPane1Layout);\n LayeredPane1Layout.setHorizontalGroup(\n LayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(LayeredPane1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(choiceComboBox, 0, 272, Short.MAX_VALUE)\n .addContainerGap())\n );\n LayeredPane1Layout.setVerticalGroup(\n LayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, LayeredPane1Layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(choiceComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(79, 79, 79))\n );\n\n resTableScrollPane2.setBackground(new java.awt.Color(235, 255, 255));\n\n partsTable.setAutoCreateRowSorter(true);\n partsTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Part Type Number\", \"Part Type Name\", \"Category\", \"Production Cost\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Integer.class, java.lang.String.class, java.lang.Object.class, java.lang.Double.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n partsTable.setSelectionBackground(new java.awt.Color(76, 188, 188));\n partsTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n partsTable.setShowHorizontalLines(false);\n partsTable.setShowVerticalLines(false);\n partsTable.getTableHeader().setReorderingAllowed(false);\n resTableScrollPane2.setViewportView(partsTable);\n partsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\n public void valueChanged(ListSelectionEvent event) {\n try{\n partsTable.getValueAt(partsTable.getSelectedRow(), 0);\n amountLabel.setVisible(true);\n amountLabel.setEnabled(true);\n amountText.setVisible(true);\n amountText.setEnabled(true);\n amountSeparator.setVisible(true);\n amountSeparator.setEnabled(true);\n }\n catch (IndexOutOfBoundsException e){\n amountLabel.setVisible(false);\n amountLabel.setEnabled(false);\n amountText.setVisible(false);\n amountText.setEnabled(false);\n amountSeparator.setVisible(false);\n amountSeparator.setEnabled(false);\n }\n }\n });\n\n partsTableLayeredPane.setLayer(resTableScrollPane2, javax.swing.JLayeredPane.DEFAULT_LAYER);\n\n javax.swing.GroupLayout partsTableLayeredPaneLayout = new javax.swing.GroupLayout(partsTableLayeredPane);\n partsTableLayeredPane.setLayout(partsTableLayeredPaneLayout);\n partsTableLayeredPaneLayout.setHorizontalGroup(\n partsTableLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(partsTableLayeredPaneLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(resTableScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 790, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(23, Short.MAX_VALUE))\n );\n partsTableLayeredPaneLayout.setVerticalGroup(\n partsTableLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, partsTableLayeredPaneLayout.createSequentialGroup()\n .addContainerGap(17, Short.MAX_VALUE)\n .addComponent(resTableScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n vehiclesTable.setAutoCreateRowSorter(true);\n vehiclesTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"VIN\", \"Model Name\", \"Vehicle Type\", \"HP\", \"Top Speed\", \"Number of Seats\", \"Automatic\", \"Production Cost\", \"Entered Production\", \"Production Plan - Serial Number\", \"Production Plan Type - Serial Number\", \"Production Plan Type - Number of Slots\", \"Order Number\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Boolean.class, java.lang.Double.class, java.lang.Object.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false, false, false, false, false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n vehiclesTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);\n vehiclesTable.setSelectionBackground(new java.awt.Color(76, 188, 188));\n vehiclesTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n vehiclesTable.getTableHeader().setReorderingAllowed(false);\n resTableScrollPane.setViewportView(vehiclesTable);\n\n vehicleLayeredPane.setLayer(resTableScrollPane, javax.swing.JLayeredPane.DEFAULT_LAYER);\n\n javax.swing.GroupLayout vehicleLayeredPaneLayout = new javax.swing.GroupLayout(vehicleLayeredPane);\n vehicleLayeredPane.setLayout(vehicleLayeredPaneLayout);\n vehicleLayeredPaneLayout.setHorizontalGroup(\n vehicleLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(vehicleLayeredPaneLayout.createSequentialGroup()\n .addComponent(resTableScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 806, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 10, Short.MAX_VALUE))\n );\n vehicleLayeredPaneLayout.setVerticalGroup(\n vehicleLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(resTableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 134, Short.MAX_VALUE)\n );\n\n Add_btn1.setBackground(new java.awt.Color(0, 102, 102));\n Add_btn1.setForeground(new java.awt.Color(255, 255, 255));\n Add_btn1.setPreferredSize(new java.awt.Dimension(202, 50));\n Add_btn1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n Add_btn1MouseClicked(evt);\n }\n });\n\n btn_name.setFont(new java.awt.Font(\"Aharoni\", 0, 24)); // NOI18N\n btn_name.setForeground(new java.awt.Color(255, 255, 255));\n btn_name.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n\n icon_plus.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/view/icons/001-signs.png\"))); // NOI18N\n java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle(\"view/MyPanels/show/Bundle\"); // NOI18N\n icon_plus.setText(bundle.getString(\"ShowWarehouseMore.icon_plus.text\")); // NOI18N\n\n icon_remove.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/view/icons/003-interface.png\"))); // NOI18N\n icon_remove.setText(bundle.getString(\"ShowWarehouseMore.icon_remove.text\")); // NOI18N\n\n javax.swing.GroupLayout Add_btn1Layout = new javax.swing.GroupLayout(Add_btn1);\n Add_btn1.setLayout(Add_btn1Layout);\n Add_btn1Layout.setHorizontalGroup(\n Add_btn1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(Add_btn1Layout.createSequentialGroup()\n .addGap(33, 33, 33)\n .addComponent(icon_remove)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btn_name, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(icon_plus)\n .addContainerGap())\n );\n Add_btn1Layout.setVerticalGroup(\n Add_btn1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(Add_btn1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(Add_btn1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(Add_btn1Layout.createSequentialGroup()\n .addComponent(btn_name, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n .addGroup(Add_btn1Layout.createSequentialGroup()\n .addComponent(icon_plus, javax.swing.GroupLayout.DEFAULT_SIZE, 26, Short.MAX_VALUE)\n .addGap(15, 15, 15))\n .addGroup(Add_btn1Layout.createSequentialGroup()\n .addComponent(icon_remove, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)\n .addContainerGap())))\n );\n\n amountText.setBackground(new java.awt.Color(235, 255, 255));\n amountText.setFont(new java.awt.Font(\"Century Gothic\", 0, 14)); // NOI18N\n amountText.setBorder(null);\n amountText.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n amountTextActionPerformed(evt);\n }\n });\n amountText.setVisible(false);\n amountText.setEnabled(false);\n\n amountSeparator.setForeground(new java.awt.Color(102, 102, 102));\n amountSeparator.setFont(new java.awt.Font(\"Arial Narrow\", 1, 14)); // NOI18N\n amountSeparator.setVisible(false);\n amountSeparator.setEnabled(false);\n\n amountLabel.setFont(new java.awt.Font(\"Aharoni\", 0, 16)); // NOI18N\n amountLabel.setForeground(new java.awt.Color(87, 84, 84));\n amountLabel.setText(bundle.getString(\"ShowWarehouseMore.amountLabel.text\")); // NOI18N\n amountLabel.setVisible(false);\n amountLabel.setEnabled(false);\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()\n .addContainerGap(62, Short.MAX_VALUE)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()\n .addComponent(amountLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(amountSeparator)\n .addComponent(amountText, javax.swing.GroupLayout.PREFERRED_SIZE, 342, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(327, 327, 327))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()\n .addComponent(Add_btn1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(62, 62, 62))))\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(vehicleLayeredPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGap(20, 20, 20)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(partsTableLayeredPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(LayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addComponent(LayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(partsTableLayeredPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(vehicleLayeredPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(amountLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addComponent(amountText, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, 0)\n .addComponent(amountSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)\n .addComponent(Add_btn1, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(24, 24, 24))\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 .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n }", "@Override\n public void init() // set up GUI\n {\n setLayout(new FlowLayout());\n\n customerView = new CustomerView(); // initialize customerView\n \n add(customerView); // add customerView to the GUI\n }", "private void buildView() {\n this.setHeaderInfo(model.getHeaderInfo());\n\n CWButtonPanel buttonPanel = this.getButtonPanel();\n \n buttonPanel.add(saveButton);\n buttonPanel.add(saveAndCloseButton);\n buttonPanel.add(cancelButton);\n \n FormLayout layout = new FormLayout(\"pref, 4dlu, 200dlu, 4dlu, min\",\n \"pref, 2dlu, pref, 2dlu, pref, 2dlu, pref\"); // rows\n\n layout.setRowGroups(new int[][]{{1, 3, 5}});\n \n CellConstraints cc = new CellConstraints();\n this.getContentPanel().setLayout(layout);\n \n this.getContentPanel().add(nameLabel, cc.xy (1, 1));\n this.getContentPanel().add(nameTextField, cc.xy(3, 1));\n this.getContentPanel().add(descLabel, cc.xy(1, 3));\n this.getContentPanel().add(descTextField, cc.xy(3, 3));\n this.getContentPanel().add(amountLabel, cc.xy(1, 5));\n this.getContentPanel().add(amountTextField, cc.xy(3, 5));\n }", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\"\n\t// desc=\"Generated Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tjXDatePicker1 = new org.jdesktop.swingx.JXDatePicker();\n\t\tjPanel1 = new javax.swing.JPanel();\n\t\tjLabel1 = new javax.swing.JLabel();\n\t\tjPanel2 = new javax.swing.JPanel();\n\t\tjLabel4 = new javax.swing.JLabel();\n\t\tjLabel5 = new javax.swing.JLabel();\n\t\tpickup_date_field = new org.jdesktop.swingx.JXDatePicker();\n\t\tdelivery_date_field = new org.jdesktop.swingx.JXDatePicker();\n\t\tjLabel6 = new javax.swing.JLabel();\n\t\tdriver_assigned_combolist = new javax.swing.JComboBox();\n\t\tadd_button = new JButton(\"Add\");\n\t\tjLabel7 = new javax.swing.JLabel();\n\t\tjLabel8 = new javax.swing.JLabel();\n\t\tjLabel9 = new javax.swing.JLabel();\n\t\tjLabel10 = new javax.swing.JLabel();\n\t\tjLabel11 = new javax.swing.JLabel();\n\t\tjLabel12 = new javax.swing.JLabel();\n\t\tjLabel13 = new javax.swing.JLabel();\n\t\tjLabel14 = new javax.swing.JLabel();\n\t\tcompany_name_txtfield = new javax.swing.JTextField();\n\t\tcompany_phone_txtfield = new javax.swing.JTextField();\n\t\tdelivery_name_of_place_txtfield = new javax.swing.JTextField();\n\t\tdelivery_street_address_txtfield = new javax.swing.JTextField();\n\t\tdelivery_city_txtfield = new javax.swing.JTextField();\n\t\tdelivery_state_txtfield = new javax.swing.JTextField();\n\t\tdelivery_zipcode_txtfield = new javax.swing.JTextField();\n\t\tjLabel2 = new javax.swing.JLabel();\n\t\tstatus_combolist = new javax.swing.JComboBox();\n\t\tjLabel15 = new javax.swing.JLabel();\n\t\tjLabel16 = new javax.swing.JLabel();\n\t\tjLabel17 = new javax.swing.JLabel();\n\t\tjLabel18 = new javax.swing.JLabel();\n\t\tjLabel19 = new javax.swing.JLabel();\n\t\tpickup_name_of_place_txtfield = new javax.swing.JTextField();\n\t\tpickup_street_address_txtfield = new javax.swing.JTextField();\n\t\tpickup_city_txtfield = new javax.swing.JTextField();\n\t\tpickup_state_txtfield = new javax.swing.JTextField();\n\t\tpickup_zipcode_txtfield = new javax.swing.JTextField();\n\n\t\tsetDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\t\tsetBackground(new java.awt.Color(0, 0, 0));\n\n\t\tjPanel1.setBackground(new Color(135, 206, 235));\n\n\t\tjLabel1.setFont(new Font(\"Cambria Math\", Font.PLAIN, 24)); // NOI18N\n\t\tjLabel1.setText(\"Add New Load\");\n\n\t\tjavax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(\n\t\t\t\tjPanel1);\n\t\tjPanel1Layout.setHorizontalGroup(\n\t\t\tjPanel1Layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t.addGroup(Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n\t\t\t\t\t.addGap(324)\n\t\t\t\t\t.addComponent(jLabel1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t.addGap(326))\n\t\t);\n\t\tjPanel1Layout.setVerticalGroup(\n\t\t\tjPanel1Layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n\t\t\t\t\t.addGap(25)\n\t\t\t\t\t.addComponent(jLabel1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t.addContainerGap())\n\t\t);\n\t\tjPanel1.setLayout(jPanel1Layout);\n\n\t\tjPanel2.setBackground(new java.awt.Color(255, 255, 255));\n\n\t\tjLabel4.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel4.setText(\"Pick Up Date\");\n\n\t\tjLabel5.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel5.setText(\"Delivery Date\");\n\n\t\tjLabel6.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel6.setText(\"Driver Assigned Id\");\n\n\t\tdriver_assigned_combolist.setFont(new java.awt.Font(\"Times New Roman\",\n\t\t\t\t2, 14)); // NOI18N\n\n\t\tadd_button.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tadd_button.setText(\"Save\");\n\t\tadd_button.addMouseListener(new java.awt.event.MouseAdapter() {\n\t\t\tpublic void mouseClicked(java.awt.event.MouseEvent evt) {\n\t\t\t\tadd_buttonMouseClicked(evt);\n\t\t\t}\n\t\t});\n\n\t\tjLabel7.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel7.setText(\"Company Name\");\n\n\t\tjLabel8.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel8.setText(\"Company PhoneNo\");\n\n\t\tjLabel9.setFont(new Font(\"Times New Roman\", Font.BOLD, 16)); // NOI18N\n\t\tjLabel9.setForeground(new Color(135, 206, 235));\n\t\tjLabel9.setText(\"Pickup Info\");\n\n\t\tjLabel10.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel10.setText(\"Name of Place\");\n\n\t\tjLabel11.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel11.setText(\"Street Address\");\n\n\t\tjLabel12.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel12.setText(\"City\");\n\n\t\tjLabel13.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel13.setText(\"State\");\n\n\t\tjLabel14.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel14.setText(\"Zip Code\");\n\n\t\tcompany_name_txtfield.setFont(new java.awt.Font(\"Times New Roman\", 2,\n\t\t\t\t14)); // NOI18N\n\n\t\tcompany_phone_txtfield.setFont(new java.awt.Font(\"Times New Roman\", 2,\n\t\t\t\t14)); // NOI18N\n\n\t\tdelivery_name_of_place_txtfield.setFont(new java.awt.Font(\n\t\t\t\t\"Times New Roman\", 2, 14)); // NOI18N\n\n\t\tdelivery_street_address_txtfield.setFont(new java.awt.Font(\n\t\t\t\t\"Times New Roman\", 2, 14)); // NOI18N\n\n\t\tdelivery_city_txtfield.setFont(new java.awt.Font(\"Times New Roman\", 2,\n\t\t\t\t14)); // NOI18N\n\t\tdelivery_city_txtfield\n\t\t\t\t.addActionListener(new java.awt.event.ActionListener() {\n\t\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\t\t\tdelivery_city_txtfieldActionPerformed(evt);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\tdelivery_state_txtfield.setFont(new java.awt.Font(\"Times New Roman\", 2,\n\t\t\t\t14)); // NOI18N\n\n\t\tdelivery_zipcode_txtfield.setFont(new java.awt.Font(\"Times New Roman\",\n\t\t\t\t2, 14)); // NOI18N\n\n\t\tjLabel2.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel2.setText(\"Status\");\n\n\t\tstatus_combolist.setFont(new java.awt.Font(\"Times New Roman\", 2, 14)); // NOI18N\n\t\tstatus_combolist.setModel(new javax.swing.DefaultComboBoxModel(\n\t\t\t\tnew String[] { \"To be Dispatched\", \"Dispatched\", \"Picked up\",\n\t\t\t\t\t\t\"Delivered\" }));\n\n\t\tjLabel15.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel15.setText(\"Name of Place\");\n\n\t\tjLabel16.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel16.setText(\"Street Address\");\n\n\t\tjLabel17.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel17.setText(\"City\");\n\n\t\tjLabel18.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel18.setText(\"State\");\n\n\t\tjLabel19.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n\t\tjLabel19.setText(\"Zip Code\");\n\n\t\tpickup_name_of_place_txtfield.setFont(new java.awt.Font(\n\t\t\t\t\"Times New Roman\", 2, 14)); // NOI18N\n\n\t\tpickup_street_address_txtfield.setFont(new java.awt.Font(\n\t\t\t\t\"Times New Roman\", 2, 14)); // NOI18N\n\n\t\tpickup_city_txtfield\n\t\t\t\t.setFont(new java.awt.Font(\"Times New Roman\", 2, 14)); // NOI18N\n\t\tpickup_city_txtfield\n\t\t\t\t.addActionListener(new java.awt.event.ActionListener() {\n\t\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\t\t\tpickup_city_txtfieldActionPerformed(evt);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\tpickup_state_txtfield.setFont(new java.awt.Font(\"Times New Roman\", 2,\n\t\t\t\t14)); // NOI18N\n\n\t\tpickup_zipcode_txtfield.setFont(new java.awt.Font(\"Times New Roman\", 2,\n\t\t\t\t14)); // NOI18N\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"Delivery Info\");\n\t\tlblNewLabel.setForeground(new Color(135, 206, 235));\n\t\tlblNewLabel.setFont(new Font(\"Times New Roman\", Font.BOLD, 16));\n\t\tlblNewLabel.setBackground(Color.WHITE);\n\t\t\n\t\tlblNewLabel_1 = new JLabel(\"Company Information\");\n\t\tlblNewLabel_1.setFont(new Font(\"Times New Roman\", Font.BOLD, 16));\n\t\tlblNewLabel_1.setForeground(new Color(135, 206, 235));\n\n\t\tjavax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(\n\t\t\t\tjPanel2);\n\t\tjPanel2Layout.setHorizontalGroup(\n\t\t\tjPanel2Layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(jPanel2Layout.createSequentialGroup()\n\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(jPanel2Layout.createSequentialGroup()\n\t\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t\t.addComponent(jLabel2))\n\t\t\t\t\t\t.addGroup(jPanel2Layout.createSequentialGroup()\n\t\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t.addGroup(jPanel2Layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel6)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel14)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel13)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel12)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel16)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel7)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblNewLabel_1)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel8)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel15))\n\t\t\t\t\t\t\t\t\t\t.addGap(52)\n\t\t\t\t\t\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(pickup_name_of_place_txtfield, GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(pickup_street_address_txtfield, GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(company_phone_txtfield, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(company_name_txtfield, GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(pickup_zipcode_txtfield, GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(pickup_city_txtfield, GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(driver_assigned_combolist, 0, 185, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(status_combolist, 0, 185, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(pickup_state_txtfield, GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(pickup_date_field, GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE))\n\t\t\t\t\t\t\t\t\t\t.addGap(84))\n\t\t\t\t\t\t\t\t\t.addGroup(jPanel2Layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel9, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)))\n\t\t\t\t\t\t\t\t.addGroup(jPanel2Layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t.addComponent(jLabel4)\n\t\t\t\t\t\t\t\t\t.addGap(357)))\n\t\t\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t.addGroup(jPanel2Layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel19)\n\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel18)\n\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel17)\n\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel11)\n\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel10)\n\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel5))\n\t\t\t\t\t\t\t\t\t.addGap(68)\n\t\t\t\t\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(delivery_name_of_place_txtfield, GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(delivery_street_address_txtfield, GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(delivery_city_txtfield, GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(delivery_state_txtfield, GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(delivery_zipcode_txtfield)\n\t\t\t\t\t\t\t\t\t\t.addComponent(delivery_date_field, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n\t\t\t\t\t\t\t\t.addComponent(lblNewLabel))))\n\t\t\t\t\t.addGap(39))\n\t\t\t\t.addGroup(Alignment.TRAILING, jPanel2Layout.createSequentialGroup()\n\t\t\t\t\t.addGap(387)\n\t\t\t\t\t.addComponent(add_button, GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE)\n\t\t\t\t\t.addGap(368))\n\t\t);\n\t\tjPanel2Layout.setVerticalGroup(\n\t\t\tjPanel2Layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(jPanel2Layout.createSequentialGroup()\n\t\t\t\t\t.addGap(20)\n\t\t\t\t\t.addComponent(lblNewLabel_1)\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\n\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t.addComponent(jLabel7)\n\t\t\t\t\t\t.addComponent(company_name_txtfield, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(jPanel2Layout.createSequentialGroup()\n\t\t\t\t\t\t\t.addGap(50)\n\t\t\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t\t\t.addComponent(jLabel9)\n\t\t\t\t\t\t\t\t.addComponent(lblNewLabel))\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t\t\t.addComponent(pickup_name_of_place_txtfield, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(jLabel15)\n\t\t\t\t\t\t\t\t.addComponent(jLabel10)\n\t\t\t\t\t\t\t\t.addComponent(delivery_name_of_place_txtfield, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t\t.addComponent(company_phone_txtfield, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t.addComponent(jLabel8)))\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t\t.addComponent(jLabel16)\n\t\t\t\t\t\t\t.addComponent(jLabel11)\n\t\t\t\t\t\t\t.addComponent(delivery_street_address_txtfield, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addComponent(pickup_street_address_txtfield, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t.addComponent(pickup_city_txtfield, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(jLabel12)\n\t\t\t\t\t\t.addComponent(jLabel17)\n\t\t\t\t\t\t.addComponent(delivery_city_txtfield, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t.addComponent(pickup_state_txtfield, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(jLabel13)\n\t\t\t\t\t\t.addComponent(jLabel18)\n\t\t\t\t\t\t.addComponent(delivery_state_txtfield, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t.addComponent(pickup_zipcode_txtfield, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(jLabel14)\n\t\t\t\t\t\t.addComponent(jLabel19)\n\t\t\t\t\t\t.addComponent(delivery_zipcode_txtfield, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 8, Short.MAX_VALUE)\n\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t.addComponent(jLabel4)\n\t\t\t\t\t\t.addComponent(pickup_date_field, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(jLabel5)\n\t\t\t\t\t\t.addComponent(delivery_date_field, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n\t\t\t\t\t.addGap(49)\n\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t.addComponent(jLabel6)\n\t\t\t\t\t\t.addComponent(driver_assigned_combolist, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t.addGap(12)\n\t\t\t\t\t.addGroup(jPanel2Layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t.addComponent(jLabel2)\n\t\t\t\t\t\t.addComponent(status_combolist, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t.addGap(64)\n\t\t\t\t\t.addComponent(add_button)\n\t\t\t\t\t.addGap(100))\n\t\t);\n\t\tjPanel2.setLayout(jPanel2Layout);\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(\n\t\t\t\tgetContentPane());\n\t\tlayout.setHorizontalGroup(\n\t\t\tlayout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addComponent(jPanel2, GroupLayout.PREFERRED_SIZE, 826, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(jPanel1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n\t\t\t\t\t.addContainerGap())\n\t\t);\n\t\tlayout.setVerticalGroup(\n\t\t\tlayout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t.addComponent(jPanel1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t.addComponent(jPanel2, GroupLayout.PREFERRED_SIZE, 615, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addContainerGap(40, Short.MAX_VALUE))\n\t\t);\n\t\tgetContentPane().setLayout(layout);\n\n\t\tpack();\n\t}", "private void initialize() {\r\n\t\tfrmCreateReservation = new JFrame();\r\n\t\tfrmCreateReservation.setTitle(\"Create reservation\");\r\n\t\tfrmCreateReservation.setBounds(100, 100, 598, 441);\r\n\t\tfrmCreateReservation.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tfrmCreateReservation.getContentPane().setLayout(null);\r\n\r\n\t\tJPanel panel = new JPanel();\r\n\t\tpanel.setBounds(0, 0, 582, 402);\r\n\t\tfrmCreateReservation.getContentPane().add(panel);\r\n\t\tpanel.setLayout(null);\r\n\r\n\t\tJScrollPane scrollPane = new JScrollPane();\r\n\t\tscrollPane.setBounds(259, 26, 313, 213);\r\n\t\tpanel.add(scrollPane);\r\n\r\n\t\tlblUserEmail.setBounds(43, 0, 171, 14);\r\n\t\tpanel.add(lblUserEmail);\r\n\r\n\t\tJLabel lblRoomNumber = new JLabel(\"\");\r\n\t\tlblRoomNumber.setBounds(536, 254, 36, 19);\r\n\t\tpanel.add(lblRoomNumber);\r\n\r\n\t\tJLabel lblRn = new JLabel(\"Room number:\");\r\n\t\tlblRn.setBounds(10, 47, 89, 14);\r\n\t\tpanel.add(lblRn);\r\n\r\n\t\tJLabel lblPr = new JLabel(\"Price:\");\r\n\t\tlblPr.setBounds(10, 72, 70, 14);\r\n\t\tpanel.add(lblPr);\r\n\r\n\t\tJLabel lblRT = new JLabel(\"Room type:\");\r\n\t\tlblRT.setBounds(10, 97, 70, 14);\r\n\t\tpanel.add(lblRT);\r\n\r\n\t\tJLabel lblGetRN = new JLabel(\"\");\r\n\t\tlblGetRN.setBounds(99, 47, 100, 14);\r\n\t\tpanel.add(lblGetRN);\r\n\r\n\t\tJLabel lblGetPr = new JLabel(\"\");\r\n\t\tlblGetPr.setBounds(99, 72, 100, 14);\r\n\t\tpanel.add(lblGetPr);\r\n\r\n\t\tJLabel lblGetRT = new JLabel(\"\");\r\n\t\tlblGetRT.setBounds(99, 97, 100, 14);\r\n\t\tpanel.add(lblGetRT);\r\n\r\n\t\tJLabel lblCheckIn = new JLabel(\"Check in:\");\r\n\t\tlblCheckIn.setBounds(10, 122, 70, 14);\r\n\t\tpanel.add(lblCheckIn);\r\n\r\n\t\tJLabel lblCheckOut = new JLabel(\"Check out:\");\r\n\t\tlblCheckOut.setBounds(10, 147, 70, 14);\r\n\t\tpanel.add(lblCheckOut);\r\n\r\n\t\tJDateChooser dateCheckIn = new JDateChooser();\r\n\t\tdateCheckIn.setBounds(99, 122, 100, 20);\r\n\t\tpanel.add(dateCheckIn);\r\n\r\n\t\tJDateChooser dateCheckOut = new JDateChooser();\r\n\t\tdateCheckOut.setBounds(99, 147, 100, 20);\r\n\t\tpanel.add(dateCheckOut);\r\n\r\n\t\tJLabel lblInvalidDate = new JLabel(\"\");\r\n\t\tlblInvalidDate.setForeground(Color.RED);\r\n\t\tlblInvalidDate.setBounds(20, 172, 229, 14);\r\n\t\tpanel.add(lblInvalidDate);\r\n\t\tJScrollPane scrollPaneDates = new JScrollPane();\r\n\t\tscrollPaneDates.setBounds(30, 288, 229, 103);\r\n\t\tpanel.add(scrollPaneDates);\r\n\t\t\r\n\t\ttableDates = new JTable();\r\n//\t\tCreating table by making some specific rows.\r\n\t\tscrollPaneDates.setViewportView(tableDates);\r\n\t\tmodel = new DefaultTableModel();\r\n\t\tObject[] column = { \"Room number\", \"Price\", \"Room type\" };\r\n\t\tmodel.setColumnIdentifiers(column);\r\n\t\tObject[] row = new Object[3];\r\n\t\r\n\t\r\n\t\tmodelDates = new DefaultTableModel();\r\n\t\tObject[] columnDates = { \"CheckIn\" ,\"CheckOut\"};\r\n\t\tmodelDates.setColumnIdentifiers(columnDates);\r\n\t\tObject[] rowDates = new Object[2];\r\n\r\n\t\tJButton btnCreateReservation = new JButton(\"Create reservation\");\r\n\t\tbtnCreateReservation.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n//\t\t\tclearing the table with the reservations for the selected room\t\r\n\t\t\t\tmodelDates.setRowCount(0);\r\n\t\t\t\tif (dateCheckIn.getDate() == null || dateCheckOut.getDate() == null) {\r\n\t\t\t\t\tlblInvalidDate.setForeground(Color.RED);\r\n\t\t\t\t\tlblInvalidDate.setText(\"No date selected!\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tlong diffDays = ChronoUnit.DAYS.between(dateCheckIn.getDate().toInstant(),\r\n\t\t\t\t\t\t\tdateCheckOut.getDate().toInstant());\r\n\r\n\t\t\t\t\tint selectedRowIndex = table.getSelectedRow();\r\n\r\n\t\t\t\t\tPeriod pastDate = Period.between(date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(),\r\n\t\t\t\t\t\t\tdateCheckIn.getDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate());\r\n\r\n\t\t\t\t\tif (diffDays <= 0 || selectedRowIndex == -1 || pastDate.getDays() < 0) {\r\n\r\n\t\t\t\t\t\tlblInvalidDate.setForeground(Color.RED);\r\n\t\t\t\t\t\tlblInvalidDate.setText(\"Invalid dates or no room selected!\");\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSessionFactory factory = new Configuration().configure(\"hibernate.cfg.xml\")\r\n\t\t\t\t\t\t\t\t.addAnnotatedClass(Customer.class).addAnnotatedClass(Rooms.class)\r\n\t\t\t\t\t\t\t\t.addAnnotatedClass(Reservation.class).addAnnotatedClass(Review.class)\r\n\t\t\t\t\t\t\t\t.buildSessionFactory();\r\n\r\n\t\t\t\t\t\tSession session = factory.getCurrentSession();\r\n\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tsession.beginTransaction();\r\n\t\t\t\t\t\t\tQuery customerQ = session.createQuery(\"from Customer where email=:custEmail\");\r\n\t\t\t\t\t\t\tcustomerQ.setParameter(\"custEmail\", lblUserEmail.getText());\r\n\r\n\t\t\t\t\t\t\tCustomer customer = (Customer) customerQ.getResultList().get(0);\r\n\r\n\t\t\t\t\t\t\tQuery roomQ = session.createQuery(\"from Rooms where roomNumber=:roomNr\");\r\n\t\t\t\t\t\t\troomQ.setParameter(\"roomNr\", lblGetRN.getText());\r\n\t\t\t\t\t\t\tRooms room = (Rooms) roomQ.getResultList().get(0);\r\n\r\n\t\t\t\t\t\t\tQuery resQ = session.createQuery(\"from Reservation where room_id=:roomId\");\r\n\t\t\t\t\t\t\tresQ.setParameter(\"roomId\", room.getId());\r\n\t\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\t\t\t\tList<Reservation> resList = resQ.getResultList();\r\n\t\t\t\t\t\t\tint boolRes = 0;\r\n\t\t\t\t\t\t\tfor(int i = 0; i<resList.size();i++) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif((dateCheckIn.getDate().compareTo(resList.get(i).getCheckOut()) <0) && (dateCheckOut.getDate().compareTo(resList.get(i).getCheckIn()) > 0)) {\r\n\t\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(btnCreateReservation, \"The room is reserved at this date\");\r\n\t\t\t\t\t\t\t\t\tboolRes = 1;\r\n\t\t\t\t\t\t\t\t\trowDates[0] = resList.get(i).getCheckIn();\r\n\t\t\t\t\t\t\t\t\trowDates[1] = resList.get(i).getCheckOut();\r\n\t\t\t\t\t\t\t\t\tmodelDates.addRow(rowDates);\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tboolRes= 0;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttableDates.setModel(modelDates);\r\n\t\t\t\t\t\t\tif(boolRes == 0) {\r\n\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tdouble totalPrice = room.getPrice() * diffDays;\r\n\r\n\t\t\t\t\t\t\tjava.sql.Date sqldateCheckIn = new java.sql.Date(dateCheckIn.getDate().getTime());\r\n\t\t\t\t\t\t\tjava.sql.Date sqldateCheckOut = new java.sql.Date(dateCheckOut.getDate().getTime());\r\n\r\n\t\t\t\t\t\t\tReservation reserve = new Reservation(customer, room, sqldateCheckIn, sqldateCheckOut,\r\n\t\t\t\t\t\t\t\t\ttotalPrice);\r\n\r\n\t\t\t\t\t\t\tint answer = JOptionPane.showConfirmDialog(btnCreateReservation,\r\n\t\t\t\t\t\t\t\t\t\"Total price is: \" + totalPrice + \". Are you agree?\", \"Warning\",\r\n\t\t\t\t\t\t\t\t\tJOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\t\t\tif (answer == JOptionPane.YES_OPTION) {\r\n\r\n\t\t\t\t\t\t\t\tsession.save(reserve);\r\n\t\t\t\t\t\t\t\tlblInvalidDate.setForeground(Color.GREEN);\r\n\t\t\t\t\t\t\t\tlblInvalidDate.setText(\"Reservation succesfully created!\");\r\n\r\n\t\t\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\t\t\t\t\tList<Rooms> roomsList = (List<Rooms>) session\r\n\t\t\t\t\t\t\t\t\t\t.createQuery(\"from Rooms\").list();\r\n\t\t\t\t\t\t\t\tmodel = new DefaultTableModel();\r\n\r\n\t\t\t\t\t\t\t\tmodel.setColumnIdentifiers(column);\r\n\r\n\t\t\t\t\t\t\t\tfor (int i = 0; i < roomsList.size(); i++) {\r\n\t\t\t\t\t\t\t\t\trow[0] = roomsList.get(i).getRoomNumber();\r\n\t\t\t\t\t\t\t\t\trow[1] = roomsList.get(i).getPrice();\r\n\t\t\t\t\t\t\t\t\trow[2] = roomsList.get(i).getRoomType();\r\n\t\t\t\t\t\t\t\t\tmodel.addRow(row);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\ttable.setModel(model);\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tsession.getTransaction().commit();\r\n\t\t\t\t\t\t\t}}\r\n\r\n\t\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t\tfactory.close();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnCreateReservation.setBounds(43, 197, 182, 23);\r\n\t\tpanel.add(btnCreateReservation);\r\n\t\ttable = new JTable();\r\n\t\ttable.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\r\n\t\t\t\tDefaultTableModel model = (DefaultTableModel) table.getModel();\r\n\t\t\t\tint selectedRowIndex = table.getSelectedRow();\r\n\t\t\t\tif (selectedRowIndex > -1) {\r\n\t\t\t\t\tlblGetRN.setText(model.getValueAt(selectedRowIndex, 0).toString());\r\n\t\t\t\t\tlblGetPr.setText(model.getValueAt(selectedRowIndex, 1).toString());\r\n\t\t\t\t\tlblGetRT.setText(model.getValueAt(selectedRowIndex, 2).toString());\r\n\t\t\t\t\tlblRoomNumber.setText(model.getValueAt(selectedRowIndex, 0).toString());\r\n\t\t\t\t\tlblInvalidDate.setText(\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tSessionFactory factory = new Configuration().configure(\"hibernate.cfg.xml\").addAnnotatedClass(Rooms.class)\r\n\t\t\t\t.addAnnotatedClass(Review.class).addAnnotatedClass(Customer.class).addAnnotatedClass(Reservation.class)\r\n\t\t\t\t.buildSessionFactory();\r\n\t\tSession session = factory.getCurrentSession();\r\n\r\n\t\ttry {\r\n\t\t\tsession.beginTransaction();\r\n\r\n\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\tList<Rooms> roomsList = (List<Rooms>) session.createQuery(\"from Rooms\").list();\r\n\r\n\t\t\tfor (int i = 0; i < roomsList.size(); i++) {\r\n\r\n\t\t\t\trow[0] = roomsList.get(i).getRoomNumber();\r\n\t\t\t\trow[1] = roomsList.get(i).getPrice();\r\n\t\t\t\trow[2] = roomsList.get(i).getRoomType();\r\n\r\n\t\t\t\tmodel.addRow(row);\r\n\r\n\t\t\t}\r\n\r\n\t\t\ttable.setModel(model);\r\n\t\t\tsession.getTransaction().commit();\r\n\r\n\t\t} finally {\r\n\r\n\t\t\tfactory.close();\r\n\r\n\t\t}\r\n\r\n\t\ttable.setModel(model);\r\n\r\n\t\tscrollPane.setViewportView(table);\r\n\r\n\t\tJButton btnAddReview = new JButton(\"Write a review for room:\");\r\n\t\tbtnAddReview.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tAddReviewPage addReview = new AddReviewPage();\r\n\r\n\t\t\t\tif (lblGetRN.getText().isEmpty()) {\r\n\r\n\t\t\t\t\tJOptionPane.showMessageDialog(btnAddReview, \"Please select a room!\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\taddReview.frmAddReview.setVisible(true);\r\n\t\t\t\t\taddReview.lblRoomNumber.setText(lblGetRN.getText());\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnAddReview.setBounds(310, 250, 222, 23);\r\n\t\tpanel.add(btnAddReview);\r\n\r\n\t\tJButton btnReviews = new JButton(\"View reviews for all rooms\");\r\n\r\n\t\tbtnReviews.setBounds(310, 284, 222, 23);\r\n\t\tpanel.add(btnReviews);\r\n\t\tbtnReviews.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tReviewPage review = new ReviewPage();\r\n\t\t\t\treview.frmReviews.setVisible(true);\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tJLabel lblNewLabel_1 = new JLabel(\"Hello,\");\r\n\t\tlblNewLabel_1.setBounds(10, 0, 46, 14);\r\n\t\tpanel.add(lblNewLabel_1);\r\n\r\n\t\tJButton btnLogout = new JButton(\"Log out\");\r\n\t\tbtnLogout.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tfrmCreateReservation.setVisible(false);\r\n\t\t\t\tLoginPage login = new LoginPage();\r\n\t\t\t\tlogin.frmLogin.setVisible(true);\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnLogout.setBounds(385, 0, 100, 23);\r\n\t\tpanel.add(btnLogout);\r\n\t\t\r\n\r\n\t\t\r\n\t\tJLabel lblNewLabel = new JLabel(\"The following periods are taken:\");\r\n\t\tlblNewLabel.setBounds(20, 267, 194, 14);\r\n\t\tpanel.add(lblNewLabel);\r\n\t\t\r\n\t\tJButton btnViewYourReservation = new JButton(\"View your reservations\");\r\n\t\tbtnViewYourReservation.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t\r\n\t\t\t\tSessionFactory factory = new Configuration().configure(\"hibernate.cfg.xml\")\r\n\t\t\t\t\t\t.addAnnotatedClass(Customer.class).addAnnotatedClass(Rooms.class)\r\n\t\t\t\t\t\t.addAnnotatedClass(Reservation.class).addAnnotatedClass(Review.class)\r\n\t\t\t\t\t\t.buildSessionFactory();\r\n\r\n\t\t\t\tSession session = factory.getCurrentSession();\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsession.beginTransaction();\r\n\t\t\t\t\tQuery customerQ = session.createQuery(\"from Customer where email=:custEmail\");\r\n\t\t\t\t\tcustomerQ.setParameter(\"custEmail\", lblUserEmail.getText());\r\n\r\n\t\t\t\t\tCustomer customer = (Customer) customerQ.getResultList().get(0);\r\n\r\n\t\t\t\t\t\tCustomerReservationsPage customerReservations = new CustomerReservationsPage();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcustomerReservations.setCustomerId(customer.getId());\r\n\t\t\t\t\t\tcustomerReservations.getReservationInfo();\r\n\t\t\t\t\t\tcustomerReservations.frmReservations.setVisible(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tsession.getTransaction().commit();\r\n\t\t\t\t\r\n\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tfactory.close();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnViewYourReservation.setBounds(43, 231, 182, 23);\r\n\t\tpanel.add(btnViewYourReservation);\r\n\t\t\r\n\r\n\r\n\t}", "public employeeTardinessGUI() {\n initComponents();\n\n }", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(new FormLayout(new ColumnSpec[] {\r\n\t\t\t\tColumnSpec.decode(\"8dlu\"),\r\n\t\t\t\tColumnSpec.decode(\"15dlu\"),\r\n\t\t\t\tColumnSpec.decode(\"80dlu\"),\r\n\t\t\t\tColumnSpec.decode(\"35dlu\"),\r\n\t\t\t\tColumnSpec.decode(\"15dlu\"),\r\n\t\t\t\tFormSpecs.BUTTON_COLSPEC,\r\n\t\t\t\tColumnSpec.decode(\"12dlu\"),\r\n\t\t\t\tFormSpecs.DEFAULT_COLSPEC,\r\n\t\t\t\tColumnSpec.decode(\"100dlu\"),\r\n\t\t\t\tFormSpecs.BUTTON_COLSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_COLSPEC,\r\n\t\t\t\tColumnSpec.decode(\"8dlu\"),},\r\n\t\t\tnew RowSpec[] {\r\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\r\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\r\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\r\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\r\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\r\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\r\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\r\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\r\n\t\t\t\tRowSpec.decode(\"50dlu\"),\r\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\r\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\r\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\r\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\r\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\r\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\r\n\t\t\t\tRowSpec.decode(\"53dlu\"),\r\n\t\t\t\tFormSpecs.UNRELATED_GAP_ROWSPEC,\r\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\r\n\t\t\t\tFormSpecs.PARAGRAPH_GAP_ROWSPEC,}));\r\n\t\t\r\n\t\tJLabel uxAddCourseLabel = new JLabel(\"Add Course\");\r\n\t\tuxAddCourseLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 18));\r\n\t\tframe.getContentPane().add(uxAddCourseLabel, \"2, 2, 6, 1\");\r\n\t\t\r\n\t\tJLabel uxSearchByLabel = new JLabel(\"Search by\");\r\n\t\tuxSearchByLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 18));\r\n\t\tframe.getContentPane().add(uxSearchByLabel, \"3, 4, 7, 1\");\r\n\t\t\r\n\t\tJLabel uxClickCourseLabel = new JLabel(\"Double Click a Course to Add It\");\r\n\t\tuxClickCourseLabel.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\r\n\t\tframe.getContentPane().add(uxClickCourseLabel, \"8, 4, 3, 1, left, bottom\");\r\n\t\t\r\n\t\tJLabel uxCourseNumberLabel = new JLabel(\"Course number\");\r\n\t\tuxCourseNumberLabel.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\r\n\t\tframe.getContentPane().add(uxCourseNumberLabel, \"3, 6, 8, 1\");\r\n\t\t\r\n\t\tsearchResults = new DefaultListModel<Course>();\r\n\t\tuxSearchResultsList = new JList<Course>(searchResults);\r\n\t\tuxSearchResultsList.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\r\n\t\tuxSearchResultsList.addMouseListener(manager.new ResultsDoubleClickListener());\r\n\t\t\r\n\t\tJScrollPane scrollPane = new JScrollPane(uxSearchResultsList);\r\n\t\tframe.getContentPane().add(scrollPane, \"8, 6, 3, 24, fill, fill\");\r\n\t\t\r\n\t\tuxCourseNumberField = new JTextField();\r\n\t\tuxCourseNumberField.setText(courseNumberDefaultText);\r\n\t\tuxCourseNumberField.setForeground(Color.GRAY);\r\n\t\tuxCourseNumberField.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\r\n\t\tframe.getContentPane().add(uxCourseNumberField, \"3, 8, 4, 1, fill, default\");\r\n\t\tuxCourseNumberField.setColumns(10);\r\n\t\tuxCourseNumberField.addFocusListener(manager.new TextFieldDefaultHandler());\r\n\t\t\r\n\t\tJLabel uxCourseNameLabel = new JLabel(\"Course name\");\r\n\t\tuxCourseNameLabel.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\r\n\t\tframe.getContentPane().add(uxCourseNameLabel, \"3, 10, 7, 1\");\r\n\t\t\r\n\t\tuxCourseNameField = new JTextField();\r\n\t\tuxCourseNameField.setText(courseNameDefaultText);\r\n\t\tuxCourseNameField.setForeground(Color.GRAY);\r\n\t\tuxCourseNameField.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\r\n\t\tframe.getContentPane().add(uxCourseNameField, \"3, 12, 4, 1, fill, default\");\r\n\t\tuxCourseNameField.setColumns(10);\r\n\t\tuxCourseNameField.addFocusListener(manager.new TextFieldDefaultHandler());\r\n\t\t\r\n\t\tJCheckBox uxCheckBox = new JCheckBox(\"Show Global Campus\");\r\n\t\tuxCheckBox.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\r\n\t\tframe.getContentPane().add(uxCheckBox, \"3, 13, 2, 2\");\r\n\t\tuxCheckBox.addActionListener(manager.new GlobalCampusListener());\r\n\t\t\r\n\t\tJButton uxSearchButton = new JButton(\"Search\");\r\n\t\tuxSearchButton.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\r\n\t\tframe.getContentPane().add(uxSearchButton, \"6, 14, 1, 1\");\r\n\t\tuxSearchButton.addActionListener(manager.new SearchButtonListener());\r\n\t\t\r\n\t\tselectedCourses = new DefaultListModel<Course>();\r\n\t\tuxSelectedCoursesList = new JList<Course>(selectedCourses);\r\n\t\tuxSelectedCoursesList.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\r\n\t\t\r\n\t\tJScrollPane scrollPane2 = new JScrollPane(uxSelectedCoursesList);\r\n\t\tframe.getContentPane().add(scrollPane2, \"3, 16, 4, 14, default, fill\");\r\n\t\t\r\n\t\tJButton uxRemoveCourseButton = new JButton(\"Remove Course\");\r\n\t\tuxRemoveCourseButton.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\r\n\t\tframe.getContentPane().add(uxRemoveCourseButton, \"4, 31, 3, 1\");\r\n\t\tuxRemoveCourseButton.addActionListener(manager.new RemoveItemButtonListener());\r\n\t\t\r\n\t\tJButton uxCreateScheduleButton = new JButton(\"Create Schedule\");\r\n\t\tuxCreateScheduleButton.setFont(new Font(\"Tahoma\", Font.PLAIN, 18));\r\n\t\tframe.getContentPane().add(uxCreateScheduleButton, \"10, 31, 1, 1\");\r\n\t\tuxCreateScheduleButton.addActionListener(manager.new CreateScheduleListener());\r\n\t\t\r\n\t\tframe.getRootPane().setDefaultButton(uxSearchButton);\r\n\t\t\t\t\r\n\t\tframe.pack();\r\n\t\t\r\n\t\tDimension frameSize = frame.getSize();\r\n\t\tDimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\r\n\t\t\r\n\t\tframe.setLocation((int) (0.5 * (screenSize.getWidth() - frameSize.getWidth())), (int) (0.5 * (screenSize.getHeight() - frameSize.getHeight())));\r\n\t}", "private void initComponents(){\n\t\terrorMessage = new JLabel();\n\t\terrorMessage.setForeground(Color.RED);\n\t\t//elements for registration\n\t\t/*\n\t\tparticipantList =new JComboBox<String>(new String[0]);\n\t\tparticipantList.addActionListener(new java.awt.event.ActionListener(){\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt){\n\t\t\t\tJComboBox<String> cb =(JComboBox<String>) evt.getSource();\n\t\t\t\tselectedParticipant=cb.getSelectedIndex();\n\t\t\t}\n\t\t});\n\t\tparticipantLabel = new JLabel();\n\t\t*/\n\t\t\n\t\talbumList =new JComboBox<String>(new String[0]);\n\t\talbumList.addActionListener(new java.awt.event.ActionListener(){\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt){\n\t\t\t\tJComboBox<String> cb =(JComboBox<String>) evt.getSource();\n\t\t\t\tselectedAlbum=cb.getSelectedIndex();\n\t\t\t}\n\t\t});\n\t\talbumLabel = new JLabel();\n\t\t\n\t\t/*\n\t\tregisterButton =new JButton();\n\t\t\n\t\t\n\t\t//element for participant\n\t\tparticipantNameTextField = new JTextField();\n\t\tparticipantNameLabel = new JLabel();\n\t\taddParticipantButton = new JButton();\n\t\t*/\n\t\t\n\t\t// elements for album\n\t\talbumNameTextField = new JTextField();\n\t\talbumNameLabel = new JLabel();\n\t\t\n\t\tSqlDateModel model = new SqlDateModel();\n\t\tProperties p = new Properties();\n\t\tp.put(\"text.today\", \"Today\");\n\t\tp.put(\"text.month\", \"Month\");\n\t\tp.put(\"text.year\", \"Year\");\n\t\tJDatePanelImpl datePanel = new JDatePanelImpl(model, p);\n\t\treleaseDatePicker = new JDatePickerImpl(datePanel, new DateLabelFormatter());\t\n\t\t\n\t\treleaseDateLabel = new JLabel();\n\t\t/*\n\t\tstartTimeSpinner = new JSpinner (new SpinnerDateModel());\n\t\tJSpinner.DateEditor startTimeEditor = new JSpinner.DateEditor(startTimeSpinner, \"HH:mm\");\n\t\tstartTimeSpinner.setEditor(startTimeEditor);\n\t\tstartTimeLabel = new JLabel();\n\t\tendTimeSpinner = new JSpinner (new SpinnerDateModel());\n\t\tJSpinner.DateEditor endTimeEditor = new JSpinner.DateEditor(endTimeSpinner, \"HH:mm\");\n\t\tendTimeSpinner.setEditor(endTimeEditor);\n\t\tendTimeLabel= new JLabel();\n\t\t*/\n\t\taddAlbumButton = new JButton();\n\t\t\n\t\t//global setting and listeners\n\t\tsetDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n\t\tsetTitle(\"Home Audio System\");\n\t\t\n\t\t//participantLabel.setText(\"Select Participant:\");\n\t\talbumLabel.setText(\"Select Album\");\n\t\t//registerButton.setText(\"Register\");\n//\t\tregisterButton.addActionListener(new java.awt.event.ActionListener() {\n//\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt){\n//\t\t\t\tregisterButtonActionPerformed(evt);\n//\t\t\t}\n//\t\t}\n//\t\t);\n\t\t\n\t\t\n//\t\tparticipantNameLabel.setText(\"Name:\");\n//\t\taddParticipantButton.setText(\"Add Participant\");\n//\t\taddParticipantButton.addActionListener(new java.awt.event.ActionListener() {\n//\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt){\n//\t\t\t\taddParticipantButtonActionPerformed(evt);\n//\t\t\t}\n//\t\t});\n\t\t\n\t\talbumNameLabel.setText(\"Album Name:\");\n\t\treleaseDateLabel.setText(\"Release Date:\");\n\t\tartistNameLabel.setText(\"Artist Name:\");\n\t\tgenreNameLabel.setText(\"Genre:\");\n\t\taddAlbumButton.setText(\"Add Album\");\n\t\taddAlbumButton.addActionListener(new java.awt.event.ActionListener(){\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt){\n\t\t\t\taddEventButtonActionPerformed(evt);\n\t\t\t}\n\t\t});\n\t\t\n\t\t//layout\n\t\tGroupLayout layout = new GroupLayout(getContentPane());\n\t\tgetContentPane().setLayout(layout);\n\t\tlayout.setAutoCreateGaps(true);\n\t\tlayout.setAutoCreateContainerGaps(true);\n\t\tlayout.setHorizontalGroup(\n\t\t\t\tlayout.createParallelGroup()\n\t\t\t\t.addComponent(errorMessage)\n\t\t\t\t.addGroup(layout.createSequentialGroup()\n//\t\t\t\t\t\t.addGroup(layout.createParallelGroup()\n//\t\t\t\t\t\t .addComponent(participantLabel)\n//\t\t\t\t\t\t .addComponent(registerButton)\n//\t\t\t\t .addComponent(participantNameLabel))\n//\t\t\t\t .addGroup(layout.createParallelGroup()\n//\t\t\t\t \t\t.addComponent(participantList)\n//\t\t\t\t\t\t .addComponent(participantNameTextField, 200, 200, 400)\n//\t\t\t\t\t\t .addComponent(addParticipantButton))\n\t\t\t\t .addGroup(layout.createParallelGroup()\n\t\t\t\t\t\t\t\t.addComponent(albumLabel)\n\t\t\t\t\t\t\t\t.addComponent(albumNameLabel)\n\t\t\t\t\t\t .addComponent(releaseDateLabel)\n\t\t\t\t\t\t .addComponent(artistNameLabel)\n\t\t\t\t\t\t .addComponent(genreNameLabel))\n\t\t\t\t .addGroup(layout.createParallelGroup()\n\t\t\t\t \t\t.addComponent(albumList)\n\t\t\t\t \t\t.addComponent(albumNameTextField, 200, 200, 400)\n\t\t\t\t \t\t.addComponent(releaseDatePicker)\n//\t\t\t\t \t\t.addComponent(startTimeSpinner)\n//\t\t\t\t \t\t.addComponent(endTimeSpinner)\n\t\t\t\t \t\t.addComponent(addAlbumButton)))\n\t\t\t\t\t\t);\n//\t\tlayout.linkSize(SwingConstants.HORIZONTAL, new java.awt.Component[]{registerButton,participantLabel});\n//\t\tlayout.linkSize(SwingConstants.HORIZONTAL, new java.awt.Component[]{addParticipantButton,participantNameTextField});\n\t\tlayout.linkSize(SwingConstants.HORIZONTAL, new java.awt.Component[]{addAlbumButton,albumNameTextField});\n\t\t\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t.addComponent(errorMessage)\n\t\t\t\t.addGroup(layout.createParallelGroup()\n//\t\t\t\t\t\t.addComponent(participantLabel)\n//\t\t \t\t.addComponent(participantList)\n\t\t\t\t .addComponent(albumLabel)\n\t\t\t\t .addComponent(albumList))\n//\t\t\t\t.addComponent(registerButton)\n\t\t\t\t.addGroup(layout.createParallelGroup()\n//\t\t\t\t\t\t.addComponent(participantNameLabel)\n//\t\t\t\t\t\t.addComponent(participantNameTextField)\n\t\t\t\t\t\t.addComponent(albumNameLabel)\n\t\t\t\t\t\t.addComponent(albumNameTextField))\n\t\t\t\t.addGroup(layout.createParallelGroup()\n\t\t\t\t\t\t.addComponent(releaseDateLabel)\n\t\t\t\t\t\t.addComponent(releaseDatePicker))\n\t\t\t\t.addGroup(layout.createParallelGroup()\n\t\t\t\t\t\t.addComponent(artistNameLabel)\n\t\t\t\t\t\t.addComponent(artistNameTextField))\n\t\t\t\t.addGroup(layout.createParallelGroup()\n\t\t\t\t\t\t.addComponent(genreNameLabel)\n\t\t\t\t\t\t.addComponent(genreNameTextField))\n\t\t\t\t.addGroup(layout.createParallelGroup()\n//\t\t\t\t\t\t.addComponent(addParticipantButton)\n\t\t\t\t\t\t.addComponent(addAlbumButton))\n\t\t\t\t\t\t\n\t\t\t\t);\n\t\t\n\t\tpack();\n\t}", "public AddEmployee() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jcbSubjects = new javax.swing.JComboBox();\n jcbTeachers = new javax.swing.JComboBox();\n jcbRooms = new javax.swing.JComboBox();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jbtnCancel = new javax.swing.JButton();\n jbtnSave = new javax.swing.JButton();\n\n setLocationByPlatform(true);\n setName(\"Form\"); // NOI18N\n setResizable(false);\n addComponentListener(new java.awt.event.ComponentAdapter() {\n public void componentShown(java.awt.event.ComponentEvent evt) {\n formComponentShown(evt);\n }\n });\n\n jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Dodaj lekcje\")); // NOI18N\n jPanel1.setName(\"jPanel1\"); // NOI18N\n\n jcbSubjects.setName(\"jcbSubjects\"); // NOI18N\n jcbSubjects.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jcbSubjectsActionPerformed(evt);\n }\n });\n\n jcbTeachers.setName(\"jcbTeachers\"); // NOI18N\n jcbTeachers.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jcbTeachersActionPerformed(evt);\n }\n });\n\n jcbRooms.setName(\"jcbRooms\"); // NOI18N\n jcbRooms.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jcbRoomsActionPerformed(evt);\n }\n });\n\n jLabel1.setText(\"Przedmiot:\"); // NOI18N\n jLabel1.setName(\"jLabel1\"); // NOI18N\n\n org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(schoolmanagement.SchoolmanagementApp.class).getContext().getResourceMap(JAddLessonDialog.class);\n jLabel2.setText(resourceMap.getString(\"jLabel2.text\")); // NOI18N\n jLabel2.setName(\"jLabel2\"); // NOI18N\n\n jLabel3.setText(resourceMap.getString(\"jLabel3.text\")); // NOI18N\n jLabel3.setName(\"jLabel3\"); // NOI18N\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap(55, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel1)\n .addComponent(jLabel2)\n .addComponent(jLabel3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jcbSubjects, javax.swing.GroupLayout.Alignment.TRAILING, 0, 241, Short.MAX_VALUE)\n .addComponent(jcbTeachers, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jcbRooms, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jcbSubjects, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jcbTeachers, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jcbRooms, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3)))\n );\n\n jbtnCancel.setText(\"Anuluj\"); // NOI18N\n jbtnCancel.setName(\"jbtnCancel\"); // NOI18N\n jbtnCancel.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtnCancelActionPerformed(evt);\n }\n });\n\n jbtnSave.setText(\"Zapisz\"); // NOI18N\n jbtnSave.setName(\"jbtnSave\"); // NOI18N\n jbtnSave.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtnSaveActionPerformed(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 .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jbtnSave, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 130, Short.MAX_VALUE)\n .addComponent(jbtnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jbtnCancel)\n .addComponent(jbtnSave))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "public InventoryGUI() {\n initComponents();\n }", "private void initialize() {\n\t\tfrmTraderTest = new JFrame();\n\t\tfrmTraderTest.setTitle(\"Trader Test\");\n\t\tfrmTraderTest.setBounds(100, 100, 343, 189);\n\t\tfrmTraderTest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tfrmTraderTest.getContentPane().setLayout(new FormLayout(new ColumnSpec[] {\n\t\t\t\tFormSpecs.RELATED_GAP_COLSPEC,\n\t\t\t\tFormSpecs.DEFAULT_COLSPEC,\n\t\t\t\tFormSpecs.RELATED_GAP_COLSPEC,\n\t\t\t\tColumnSpec.decode(\"default:grow\"),\n\t\t\t\tFormSpecs.RELATED_GAP_COLSPEC,\n\t\t\t\tFormSpecs.DEFAULT_COLSPEC,\n\t\t\t\tFormSpecs.RELATED_GAP_COLSPEC,\n\t\t\t\tColumnSpec.decode(\"default:grow\"),\n\t\t\t\tFormSpecs.RELATED_GAP_COLSPEC,\n\t\t\t\tFormSpecs.DEFAULT_COLSPEC,\n\t\t\t\tFormSpecs.RELATED_GAP_COLSPEC,\n\t\t\t\tFormSpecs.DEFAULT_COLSPEC,\n\t\t\t\tFormSpecs.RELATED_GAP_COLSPEC,\n\t\t\t\tFormSpecs.DEFAULT_COLSPEC,\n\t\t\t\tFormSpecs.RELATED_GAP_COLSPEC,\n\t\t\t\tFormSpecs.DEFAULT_COLSPEC,\n\t\t\t\tFormSpecs.RELATED_GAP_COLSPEC,\n\t\t\t\tFormSpecs.DEFAULT_COLSPEC,\n\t\t\t\tFormSpecs.RELATED_GAP_COLSPEC,\n\t\t\t\tFormSpecs.DEFAULT_COLSPEC,\n\t\t\t\tFormSpecs.RELATED_GAP_COLSPEC,\n\t\t\t\tFormSpecs.DEFAULT_COLSPEC,},\n\t\t\tnew RowSpec[] {\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,\n\t\t\t\tFormSpecs.RELATED_GAP_ROWSPEC,\n\t\t\t\tFormSpecs.DEFAULT_ROWSPEC,}));\n\t\t\n\t\tJLabel lblSalvarEm = new JLabel(\"Salvar Em:\");\n\t\tfrmTraderTest.getContentPane().add(lblSalvarEm, \"2, 2, right, default\");\n\t\t\n\t\tlocation = new JTextField();\n\t\tfrmTraderTest.getContentPane().add(location, \"4, 2, 13, 1\");\n\t\tlocation.setColumns(10);\n\t\t\n\t\tJLabel lblLote = new JLabel(\"Lote:\");\n\t\tfrmTraderTest.getContentPane().add(lblLote, \"2, 6, 1, 3, right, default\");\n\t\t\n\t\tlot = new JTextField();\n\t\tfrmTraderTest.getContentPane().add(lot, \"4, 6, 7, 3, fill, default\");\n\t\tlot.setColumns(10);\n\t\tlot.setText(\"0.10\");\n\t\t\n\t\tJButton btnNewButton = new JButton(\"buy\");\n\t\tbtnNewButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\tList<String> lines = Arrays.asList(lot.getText());\n\t\t\t\t\tFiles.write(Paths.get(location.getText()+\"/buy.txt\"), lines, StandardCharsets.UTF_8,\n\t\t\t\t\t StandardOpenOption.CREATE, StandardOpenOption.APPEND);\n\t\t\t\t\t} catch (Exception ex){\n\t\t\t\t\t\tex.printStackTrace();\n\t\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tfrmTraderTest.getContentPane().add(btnNewButton, \"12, 6\");\n\t\t\n\t\tJButton btnNewButton_1 = new JButton(\"sell\");\n\t\tbtnNewButton_1.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tList<String> lines = Arrays.asList(lot.getText());\n\t\t\t\t\tFiles.write(Paths.get(location.getText()+\"/sell.txt\"), lines, StandardCharsets.UTF_8,\n\t\t\t\t\t StandardOpenOption.CREATE, StandardOpenOption.APPEND);\n\t\t\t\t\t} catch (Exception ex){\n\t\t\t\t\t\tex.printStackTrace();\n\t\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tJButton Close = new JButton(\"Close\");\n\t\tClose.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ttry {\n\t\t\t\t// close\n\t\t\t\tList<String> lines = Arrays.asList();\n\t\t\t\tFiles.write(Paths.get(location.getText()+\"/close.txt\"), lines, StandardCharsets.UTF_8,\n\t\t\t\t StandardOpenOption.CREATE, StandardOpenOption.APPEND);\n\t\t\t\t} catch (Exception ex){\n\t\t\t\t\tex.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\tClose.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\tfrmTraderTest.getContentPane().add(Close, \"14, 6, 1, 3\");\n\t\tfrmTraderTest.getContentPane().add(btnNewButton_1, \"12, 8\");\n\t}", "private void initComponents() {\n\n\t\ttxtId = new javax.swing.JTextField();\n\t\tjLabel1 = new javax.swing.JLabel();\n\t\tjLabel2 = new javax.swing.JLabel();\n\t\ttxtAlert = new javax.swing.JTextField();\n\t\ttxtNbMax = new javax.swing.JTextField();\n\t\tjScrollPane1 = new javax.swing.JScrollPane();\n\t\ttblBollard = new javax.swing.JTable();\n\t\tbtnSave = new javax.swing.JButton();\n\t\tbtnSave.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\tbtnSave.setBackground(new Color(0, 0, 128));\n\t\tbtnSave.setForeground(new Color(0, 0, 0));\n\t\tbtnUpdate = new javax.swing.JButton();\n\t\tbtnUpdate.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\tbtnUpdate.setForeground(new Color(0, 0, 0));\n\t\tbtnUpdate.setBackground(new Color(0, 0, 128));\n\t\tbtnDelete1 = new javax.swing.JButton();\n\t\tbtnDelete1.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\tbtnDelete1.setForeground(new Color(0, 0, 0));\n\t\tbtnDelete1.setBackground(new Color(0, 0, 128));\n\t\tjLabel6 = new javax.swing.JLabel();\n\t\tjLabel6.setForeground(new Color(128, 0, 0));\n\n\t\tsetDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\t\tsetTitle(\"Simulation\");\n\t\tsetResizable(false);\n\n\t\tjLabel1.setFont(new Font(\"Yu Gothic Medium\", Font.BOLD, 13)); // NOI18N\n\t\tjLabel1.setText(\"Id\");\n\n\t\tjLabel2.setFont(new Font(\"Yu Gothic Medium\", Font.BOLD, 13)); // NOI18N\n\t\tjLabel2.setText(\"AlertAirQuality\");\n\n\t\tjLabel6.setFont(new Font(\"Yu Gothic Medium\", Font.BOLD, 20)); // NOI18N\n\t\tjLabel6.setText(\"Simulation Settings\");\n\n\t\ttblBollard.setModel(\n\t\t\t\tnew DefaultTableModel(\n\t\t\tnew Object[][] {\n\t\t\t},\n\t\t\tnew String[] {\n\t\t\t\t\"Id\", \"AlertAirQuality\", \"NbMaxVehicle\", \"nbactuel\"\n\t\t\t}\n\t\t) {\n\t\t\tClass[] columnTypes = new Class[] {\n\t\t\t\tInteger.class, Boolean.class, Integer.class, Integer.class\n\t\t\t};\n\t\t\tpublic Class getColumnClass(int columnIndex) {\n\t\t\t\treturn columnTypes[columnIndex];\n\t\t\t}\n\t\t});\n\t\ttblBollard.setCellSelectionEnabled(true);\n\t\ttblBollard.addMouseListener(new java.awt.event.MouseAdapter() {\n\t\t\tpublic void mouseClicked(java.awt.event.MouseEvent evt) {\n\t\t\t\ttblStudentsMouseClicked(evt);\n\t\t\t}\n\t\t});\n\t\tjScrollPane1.setViewportView(tblBollard);\n\t\tif (tblBollard.getColumnModel().getColumnCount() > 0) {\n\t\t\ttblBollard.getColumnModel().getColumn(2).setResizable(false);\n\t\t}\n\n\t\tbtnSave.setText(\"Save\");\n\t\tbtnSave.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));\n\t\tbtnSave.setIconTextGap(0);\n\t\tbtnSave.setInheritsPopupMenu(true);\n\t\tbtnSave.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\n\t\t\t\ttry {\n\t\t\t\t\tbtnSaveActionPerformed(evt);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\t// TODO Auto-generated catch block\n\n\t\t\t}\n\t\t});\n\n\t\tbtnUpdate.setText(\"Update\");\n\t\tbtnUpdate.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));\n\t\tbtnUpdate.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttry {\n\t\t\t\t\tbtnUpdateActionPerformed(evt);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tbtnDelete1.setText(\"Delete\");\n\t\tbtnDelete1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));\n\t\tbtnDelete1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttry {\n\t\t\t\t\tbtnDelete1ActionPerformed(evt);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\n\t\tjLabel6.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n\t\tjLabel6.setText(\"Simulation Settings\");\n\n\t\tJLabel lblIsactive = new JLabel(\"NbMax\");\n\t\tlblIsactive.setFont(new Font(\"Yu Gothic Medium\", Font.BOLD, 13));\n\n\t\tJButton btnRetour = new JButton(\"Retour\");\n\t\tbtnRetour.setFont(new Font(\"Tahoma\", Font.BOLD, 12));\n\t\tbtnRetour.setForeground(new Color(0, 0, 0));\n\t\tbtnRetour.setBackground(new Color(255, 255, 255));\n\t\tbtnRetour.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tsetVisible(false);\n\t\t\t\tMainClient launchIhm = null;\n\t\t\t\ttry {client.stopConnection();\n\n\t\t\t\t\tlaunchIhm = new MainClient();\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\tlaunchIhm.getFrame().setVisible(true);\n\t\t\t\t\n\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\tlblIdBollard = new JLabel(\"id Bollard\");\n\t\tlblIdBollard.setFont(new Font(\"Tahoma\", Font.BOLD, 12));\n\t\t\n\t\tlblWayOfBollard = new JLabel(\"Way of bollard \");\n\t\tlblWayOfBollard.setFont(new Font(\"Tahoma\", Font.BOLD, 12));\n\t\t\n\t\tlblCarId = new JLabel(\"Car id \");\n\t\tlblCarId.setFont(new Font(\"Tahoma\", Font.BOLD, 12));\n\t\t\n\t\tlblCarLocation = new JLabel(\"Car location\");\n\t\tlblCarLocation.setFont(new Font(\"Tahoma\", Font.BOLD, 12));\n\t\t\n\t\ttxtidBollard = new JTextField();\n\t\ttxtidBollard.setColumns(10);\n\t\t\n\t\ttestWayBollard = new JTextField();\n\t\ttestWayBollard.setColumns(10);\n\t\t\n\t\ttextIdCar = new JTextField();\n\t\ttextIdCar.setColumns(10);\n\t\t\n\t\ttextCarLocation = new JTextField();\n\t\ttextCarLocation.setColumns(10);\n\t\t\n\t\tJButton btnNewButton = new JButton(\"Launch simulation\");\n\t\tbtnNewButton.setFont(new Font(\"Tahoma\", Font.BOLD, 14));\n\t\tbtnNewButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttry {\n\t\t\t\t\tbtnSimulationActionPerformed(evt);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t});\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"Nb actuel\");\n\t\t\n\t\ttextnbactuel = new JTextField();\n\t\ttextnbactuel.setColumns(10);\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n\t\tlayout.setHorizontalGroup(\n\t\t\tlayout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t.addContainerGap(429, Short.MAX_VALUE)\n\t\t\t\t\t.addComponent(btnNewButton)\n\t\t\t\t\t.addGap(252)\n\t\t\t\t\t.addComponent(btnRetour, GroupLayout.PREFERRED_SIZE, 91, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addGap(42))\n\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t.addGap(363)\n\t\t\t\t\t.addComponent(jLabel6, GroupLayout.PREFERRED_SIZE, 249, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addContainerGap(359, Short.MAX_VALUE))\n\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t.addGap(78)\n\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t.addComponent(lblCarLocation)\n\t\t\t\t\t\t\t.addContainerGap())\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblIsactive)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel1, GroupLayout.PREFERRED_SIZE, 74, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(jLabel2, GroupLayout.PREFERRED_SIZE, 74, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(16)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(txtId, 188, 188, 188))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(17)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(txtAlert, GroupLayout.PREFERRED_SIZE, 188, GroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(18)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textnbactuel, GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(txtNbMax, GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblWayOfBollard)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblIdBollard, GroupLayout.PREFERRED_SIZE, 57, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lblCarId))\n\t\t\t\t\t\t\t\t\t\t\t.addGap(18)\n\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(testWayBollard, GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(txtidBollard, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textIdCar, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textCarLocation, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE))))\n\t\t\t\t\t\t\t\t\t.addGap(177))\n\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t.addComponent(lblNewLabel)\n\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)))\n\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(btnSave, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t.addGap(59)\n\t\t\t\t\t\t\t\t\t\t\t.addComponent(btnUpdate, GroupLayout.PREFERRED_SIZE, 75, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t.addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 376, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t.addGap(60))\n\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t.addComponent(btnDelete1, GroupLayout.PREFERRED_SIZE, 75, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t.addGap(93))))))\n\t\t);\n\t\tlayout.setVerticalGroup(\n\t\t\tlayout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t.addGap(23)\n\t\t\t\t\t.addComponent(jLabel6, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addGap(3)\n\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t.addGap(65)\n\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t\t\t.addComponent(jLabel1, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(txtId, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t.addGap(35)\n\t\t\t\t\t\t\t.addComponent(jScrollPane1, 0, 0, Short.MAX_VALUE)))\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t.addComponent(jLabel2, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(txtAlert, GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\n\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t.addComponent(lblIsactive)\n\t\t\t\t\t\t\t\t.addComponent(txtNbMax, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\n\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t.addComponent(lblNewLabel)\n\t\t\t\t\t\t\t\t.addComponent(textnbactuel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t.addGap(7)\n\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t\t\t.addComponent(lblIdBollard)\n\t\t\t\t\t\t\t\t.addComponent(txtidBollard, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t.addGap(18)\n\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(lblWayOfBollard)\n\t\t\t\t\t\t\t\t\t\t.addComponent(testWayBollard, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t.addGap(18)\n\t\t\t\t\t\t\t\t\t.addComponent(lblCarId))\n\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t.addGap(38)\n\t\t\t\t\t\t\t\t\t.addComponent(textIdCar, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t.addGap(18)\n\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t.addComponent(textCarLocation, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(lblCarLocation)))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t\t\t.addComponent(btnDelete1, GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(btnSave, GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(btnUpdate, GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 190, Short.MAX_VALUE)\n\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t.addComponent(btnRetour, GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t.addGap(44))\n\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t.addComponent(btnNewButton, GroupLayout.PREFERRED_SIZE, 49, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t.addGap(59))))))\n\t\t);\n\t\tgetContentPane().setLayout(layout);\n\n\t\tpack();\n\t\tsetLocationRelativeTo(null);\n\t}", "private void initComponentsCustom() {\n SGuiUtils.setWindowBounds(this, 480, 300);\n\n moTextUnitSymbol.setTextSettings(jlUnitSymbol.getText(), 15, 1);\n moTextUnitName.setTextSettings(jlName.getText(), 150, 1);\n moTextShortName.setTextSettings(SGuiUtils.getLabelName(jlAnalysisShortName.getText()), 10, 1);\n moTextName.setTextSettings(SGuiUtils.getLabelName(jlName.getText()), 100, 1);\n moKeyAnalysisType.setKeySettings(miClient, SGuiUtils.getLabelName(jlAnalysisType), true);\n\n moFields.addField(moTextUnitSymbol);\n moFields.addField(moTextUnitName);\n \n moFields.addField(moTextShortName);\n moFields.addField(moTextName);\n \n moFields.addField(moKeyAnalysisType);\n\n moFields.setFormButton(jbSave);\n }", "private void initComponents() {\n wizardManager = new JPanel();\n\n //======== this ========\n setTitle(\"Create New Event\");\n setResizable(false);\n setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);\n Container contentPane = getContentPane();\n contentPane.setLayout(new CardLayout(10, 10));\n\n //======== wizardManager ========\n {\n wizardManager.setBorder(new EmptyBorder(0, 0, 0, 0));\n wizardManager.setLayout(new CardLayout());\n }\n contentPane.add(wizardManager, \"card1\");\n pack();\n setLocationRelativeTo(getOwner());\n // JFormDesigner - End of component initialization //GEN-END:initComponents\n }", "public InitialiserGui(Initialiser init, Integer amount) {\n\n\t\tmyAgent = init;\n\t\tthis.amount = amount;\n\n\t\tsetTitle(myAgent.getLocalName());\n\n JPanel base = new JPanel();\n base.setBorder(new EmptyBorder(15, 15, 15, 15));\n base.setLayout(new BorderLayout(10, 10));\n getContentPane().add(base);\n\n JPanel panel = new JPanel();\n base.add(panel, BorderLayout.WEST);\n panel.setLayout(new BorderLayout(0, 2));\n JPanel pane = new JPanel();\n pane.setLayout(new BorderLayout(0, 0));\n pane.add(new JLabel(\"Message\"), BorderLayout.NORTH);\n\n pane.add(msg = new JTextField(\"No messages recieved\", 15));\n msg.setEditable(false);\n msg.setHorizontalAlignment(JTextField.CENTER);\n panel.add(pane, BorderLayout.NORTH);\n\n JPanel p = new JPanel();\n p.setLayout(new GridLayout(2, 1));\n p.add(carAmount = new JLabel(\"Number of cars: \" + this.amount));\n panel.add(p, BorderLayout.WEST);\n\n\n pane = new JPanel();\n panel.add(pane, BorderLayout.EAST);\n pane.setBorder(new EmptyBorder(0, 20, 130, 0));\n pane.setLayout(new GridLayout(3, 1, 0, 5));\n pane.add(add = new JButton(\"Add Cars\"));\n add.setToolTipText(\"Added Cars\");\n add.addActionListener(this);\n pane.add(remove = new JButton(\"Remove Car\"));\n remove.setToolTipText(\"Remove last car\");\n remove.addActionListener(this);\n pane.add(quit = new JButton(\"QUIT\"));\n quit.setToolTipText(\"Stop agent and exit\");\n quit.addActionListener(this);\n\n\t\taddWindowListener(new WindowAdapter() {\n\t\t\tpublic void windowClosing(WindowEvent e) {\n\t\t\t\tshutDown();\n\t\t\t}\n\t\t});\n\n setSize(300, 300);\n\t\tsetResizable(false);\n\n\t}", "public void callSetupDialog(JDialog jParent, MainWindow oMain) {\n AllometryParameterEdit oWindow = new AllometryParameterEdit(jParent, m_oManager, oMain, this);\n oWindow.pack();\n oWindow.setLocationRelativeTo(null);\n oWindow.setVisible(true);\n }", "public MaterialAdd() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public NewCityDialog(MainWindow owner, boolean showCancelOption) {\r\n\t\tsetText(owner.guiStrings.get(\"welcome.caption\"));\r\n\t\tthis.owner = owner;\r\n\t\t\r\n\t\tVerticalPanel vp1 = new VerticalPanel();\r\n\t\tHorizontalPanel hp1 = new HorizontalPanel();\r\n\t\tvp1.add(hp1);\r\n\t\t\r\n\t\tCanvas canvas = Canvas.createIfSupported();\r\n\t\tif (canvas == null){\r\n\t\t\tWindow.alert(\"canvs not suported\");\r\n\t\t}\r\n\t\tcanvas.setWidth(\"360px\");\r\n\t\tcanvas.setCoordinateSpaceWidth(360);\r\n\r\n\t\tcanvas.setHeight(\"300px\");\r\n\t\tcanvas.setCoordinateSpaceHeight(300);\r\n\t\t\r\n\t\thp1.add(canvas);\r\n\t\t\r\n\t\tVerticalPanel levelBox = new VerticalPanel();\r\n\t\thp1.add(levelBox);\r\n\t\t\r\n\t\tHorizontalPanel buttonPane = new HorizontalPanel();\r\n\t\tvp1.add(buttonPane);\r\n\r\n\t\tengine = new Micropolis();\r\n\t\tnew MapGenerator(engine).generateNewCity();\r\n\t\t\r\n\t\tmapPane = new OverlayMapView(engine,canvas);\r\n\t\t\r\n\t\t//drawArea.add(mapPane, BorderLayout.CENTER);*/\r\n\t\t\r\n\t\tRadioButton radioBtn;\r\n\t\tfor (int lev = GameLevel.MIN_LEVEL; lev <= GameLevel.MAX_LEVEL; lev++) {\r\n\t\t\tfinal int x = lev;\r\n\t\t\tradioBtn = new RadioButton(\"level\",owner.guiStrings.get(\"menu.difficulty.\" + lev));\r\n\t\t\tradioBtn.addClickHandler(new ClickHandler() {\r\n\t\t\t\tpublic void onClick(ClickEvent event) {\r\n\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\tsetGameLevel(x);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tlevelBox.add(radioBtn);\r\n\t\t\tlevelBtns.put(lev, radioBtn);\r\n\t\t}\r\n\t\tsetGameLevel(GameLevel.MIN_LEVEL);\r\n\r\n\t\tButton btn;\r\n\t\tbtn = new Button(owner.guiStrings.get(\"welcome.previous_map\"),new ClickHandler() {\r\n\t\t\tpublic void onClick(ClickEvent event) {\r\n\t\t\t\tonPreviousMapClicked();\r\n\t\t\t}\r\n\t\t});\r\n\t\tbuttonPane.add(btn);\r\n\t\tbtn.setEnabled(false);\r\n\t\tpreviousMapBtn = btn;\r\n\r\n\t\tbtn = new Button(owner.guiStrings.get(\"welcome.next_map\"),new ClickHandler() {\r\n\t\t\tpublic void onClick(ClickEvent event) {\r\n\t\t\t\tonNextMapClicked();\r\n\t\t\t}\r\n\t\t});\r\n\t\tbuttonPane.add(btn);\r\n\r\n\t\tbtn = new Button(owner.guiStrings.get(\"welcome.load_city\"),new ClickHandler() {\r\n\t\t\tpublic void onClick(ClickEvent event) {\r\n\t\t\t\tmicropolis.client.Micropolis.mainWindow.loadGame();\r\n\t\t\t\thide();\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (!micropolis.client.Micropolis.userInfo.logined){\r\n\t\t\tbtn.setEnabled(false);\r\n\t\t}\r\n\t\tbuttonPane.add(btn);\r\n\r\n\t\tbtn = new Button(owner.guiStrings.get(\"welcome.play_this_map\"),new ClickHandler() {\r\n\t\t\tpublic void onClick(ClickEvent event) {\r\n\t\t\t\tonPlayClicked();\r\n\t\t\t}\r\n\t\t});\r\n\t\tbuttonPane.add(btn);\r\n\t\tbtn.setFocus(true);\r\n\t\tif (showCancelOption) {\r\n\t\t\tbtn = new Button(owner.guiStrings.get(\"welcome.cancel\"),new ClickHandler() {\r\n\t\t\t\tpublic void onClick(ClickEvent event) {\r\n\t\t\t\t\tonCancelClicked();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tbuttonPane.add(btn);\r\n\t\t}else{\r\n\t\t\tbtn = new Button(owner.guiStrings.get(\"welcome.quit\"),new ClickHandler() {\r\n\t\t\t\tpublic void onClick(ClickEvent event) {\r\n\t\t\t\t\tonQuitClicked();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tbuttonPane.add(btn);\r\n\t\t}\r\n\t\tadd(vp1);\r\n\t}", "private void initUI() {\r\n\t\t//Äußeres Panel\r\n\t\tContainer pane = getContentPane();\r\n\t\tGroupLayout gl = new GroupLayout(pane);\r\n\t\tpane.setLayout(gl);\r\n\t\t//Abstende von den Containern und dem äußeren Rand\r\n\t\tgl.setAutoCreateContainerGaps(true);\r\n\t\tgl.setAutoCreateGaps(true);\r\n\t\t//TextFeld für die Ausgabe\r\n\t\tJTextField output = view.getTextField();\r\n\t\t//Die jeweiligen Panels für die jeweiigen Buttons\r\n\t\tJPanel brackets = view.getBracketPanel();\r\n\t\tJPanel remove = view.getTop2Panel();\r\n\t\tJPanel numbers = view.getNumbersPanel();\r\n\t\tJPanel last = view.getBottomPanel();\r\n\t\t//Anordnung der jeweiligen Panels durch den Layout Manager\r\n\t\tgl.setHorizontalGroup(gl.createParallelGroup().addComponent(output).addComponent(brackets).addComponent(remove).addComponent(numbers).addComponent(last));\r\n\t\tgl.setVerticalGroup(gl.createSequentialGroup().addComponent(output).addComponent(brackets).addComponent(remove).addComponent(numbers).addComponent(last));\r\n\t\tpack();\r\n\t\tsetTitle(\"Basic - Taschenrechner\");\r\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\t\tsetResizable(false);\r\n\t}", "private void initComponents(){\n\t\n\t\tthis.setLayout(null);\n\t\t\n\t\tscreensize = Toolkit.getDefaultToolkit().getScreenSize();\n\t\t\n\t\tlogo = new JLabel(getLogoIcon(), JLabel.CENTER); // 500x50\n\t\t\n\t\toptionList = new JComboBox();\n\t\t\n\t\tcreate = new JButton(\"Create\");\n\t\tclose = new JButton(\"Close\");\n\t\t\n\t\tcreate.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tcreateActionPerformed(evt);\n\t\t\t}\n\t\t});\n\t\t\n\t\tclose.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tcloseActionPerformed(evt);\n\t\t\t}\n\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 buttonGroup1 = new javax.swing.ButtonGroup();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jRadioButton1 = new javax.swing.JRadioButton();\n jRadioButton2 = new javax.swing.JRadioButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTextArea1 = new javax.swing.JTextArea();\n jTextField1 = new javax.swing.JTextField();\n help = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n add = new javax.swing.JButton();\n\n setClosable(true);\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel1.setText(\" ADD LOCALITY DETAILS\");\n jLabel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 0, 12)); // NOI18N\n jLabel2.setText(\"LOCALITY ADDRESS\");\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 0, 12)); // NOI18N\n jLabel3.setText(\"LOCALITY NAME\");\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 0, 12)); // NOI18N\n jLabel4.setText(\"LOCALITY SIZE\");\n\n buttonGroup1.add(jRadioButton1);\n jRadioButton1.setText(\"LARGE\");\n\n buttonGroup1.add(jRadioButton2);\n jRadioButton2.setText(\"MEDIUM\");\n\n jTextArea1.setColumns(20);\n jTextArea1.setRows(5);\n jScrollPane1.setViewportView(jTextArea1);\n\n jTextField1.setFont(new java.awt.Font(\"Tahoma\", 0, 12)); // NOI18N\n\n help.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/myImages/help.png\"))); // NOI18N\n help.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n helpMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n helpMouseExited(evt);\n }\n });\n\n add.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n add.setText(\"ADD\");\n add.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n addActionPerformed(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 .addGroup(layout.createSequentialGroup()\n .addGap(129, 129, 129)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(help, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(89, 89, 89)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jRadioButton1)\n .addGap(43, 43, 43)\n .addComponent(jRadioButton2))\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(117, 117, 117)\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 448, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(288, 288, 288)\n .addComponent(add, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(95, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(217, 217, 217)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(128, 128, 128)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(436, Short.MAX_VALUE)))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(55, 55, 55)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(26, 26, 26)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(help, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jRadioButton1)\n .addComponent(jRadioButton2)))\n .addGap(18, 18, 18)\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(add, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(124, 124, 124)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(298, Short.MAX_VALUE)))\n );\n\n setBounds(0, 0, 676, 478);\n }", "private void initComponents() {\n\n dropCategory = new sk.stuba.fiit.kvasnicka.topologyvisual.gui.components.DropDownButton(false);\n closeableTabbedPane1 = new sk.stuba.fiit.kvasnicka.topologyvisual.gui.components.closeabletabbedpane.CloseableTabbedPane();\n jButton1 = new javax.swing.JButton();\n\n org.openide.awt.Mnemonics.setLocalizedText(dropCategory, org.openide.util.NbBundle.getMessage(SimulationLogTopComponent.class, \"SimulationLogTopComponent.dropCategory.text\")); // NOI18N\n\n jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sk/stuba/fiit/kvasnicka/topologyvisual/resources/files/clear.png\"))); // NOI18N\n org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(SimulationLogTopComponent.class, \"SimulationLogTopComponent.jButton1.text\")); // NOI18N\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(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(22, 22, 22)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(dropCategory, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(41, 41, 41)\n .addComponent(closeableTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 763, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(23, 23, 23)\n .addComponent(dropCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(44, 44, 44)\n .addComponent(jButton1)\n .addContainerGap(219, Short.MAX_VALUE))\n .addComponent(closeableTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n }", "private void initComponents() {\n lblHAUF = new JLabel();\n jdcHAUF = new JDateChooser();\n lblStation = new JLabel();\n cmbStation = new JComboBox<>();\n lblRoom = new JLabel();\n cmbRoom = new JComboBox<>();\n cbKZP = new JCheckBox();\n\n //======== this ========\n setLayout(new FormLayout(\n \"default, $lcgap, pref, $lcgap, default:grow, $lcgap, default\",\n \"4*(default, $lgap), default\"));\n\n //---- lblHAUF ----\n lblHAUF.setText(\"text\");\n lblHAUF.setFont(new Font(\"Arial\", Font.PLAIN, 14));\n add(lblHAUF, CC.xy(3, 3));\n\n //---- jdcHAUF ----\n jdcHAUF.setFont(new Font(\"Arial\", Font.PLAIN, 14));\n jdcHAUF.addPropertyChangeListener(\"date\", e -> jdcDOBPropertyChange(e));\n add(jdcHAUF, CC.xy(5, 3));\n\n //---- lblStation ----\n lblStation.setText(\"text\");\n lblStation.setFont(new Font(\"Arial\", Font.PLAIN, 14));\n add(lblStation, CC.xy(3, 5));\n\n //---- cmbStation ----\n cmbStation.setFont(new Font(\"Arial\", Font.PLAIN, 14));\n cmbStation.addItemListener(e -> cmbStationItemStateChanged(e));\n add(cmbStation, CC.xy(5, 5));\n\n //---- lblRoom ----\n lblRoom.setText(\"text\");\n lblRoom.setFont(new Font(\"Arial\", Font.PLAIN, 14));\n add(lblRoom, CC.xy(3, 7));\n\n //---- cmbRoom ----\n cmbRoom.setFont(new Font(\"Arial\", Font.PLAIN, 14));\n cmbRoom.addItemListener(e -> cmbRoomItemStateChanged(e));\n add(cmbRoom, CC.xy(5, 7));\n\n //---- cbKZP ----\n cbKZP.setText(\"text\");\n cbKZP.addItemListener(e -> cbKZPItemStateChanged(e));\n add(cbKZP, CC.xywh(3, 9, 3, 1));\n // JFormDesigner - End of component initialization //GEN-END:initComponents\n }", "private void initializeComponent() throws Exception {\n System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(FormReconcileAllergy.class);\n this.labelBatch = new System.Windows.Forms.Label();\n this.gridAllergyExisting = new OpenDental.UI.ODGrid();\n this.gridAllergyImport = new OpenDental.UI.ODGrid();\n this.butRemoveRec = new OpenDental.UI.Button();\n this.butOK = new OpenDental.UI.Button();\n this.butAddNew = new OpenDental.UI.Button();\n this.butAddExist = new OpenDental.UI.Button();\n this.gridAllergyReconcile = new OpenDental.UI.ODGrid();\n this.butClose = new OpenDental.UI.Button();\n this.SuspendLayout();\n //\n // labelBatch\n //\n this.labelBatch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));\n this.labelBatch.Location = new System.Drawing.Point(76, 640);\n this.labelBatch.Name = \"labelBatch\";\n this.labelBatch.Size = new System.Drawing.Size(739, 24);\n this.labelBatch.TabIndex = 152;\n this.labelBatch.Text = \"Clicking OK updates the patient\\'s allergies to match the reconciled list.\";\n this.labelBatch.TextAlign = System.Drawing.ContentAlignment.MiddleRight;\n //\n // gridAllergyExisting\n //\n this.gridAllergyExisting.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));\n this.gridAllergyExisting.setHScrollVisible(false);\n this.gridAllergyExisting.Location = new System.Drawing.Point(4, 12);\n this.gridAllergyExisting.Name = \"gridAllergyExisting\";\n this.gridAllergyExisting.setScrollValue(0);\n this.gridAllergyExisting.setSelectionMode(OpenDental.UI.GridSelectionMode.MultiExtended);\n this.gridAllergyExisting.Size = new System.Drawing.Size(477, 245);\n this.gridAllergyExisting.TabIndex = 65;\n this.gridAllergyExisting.setTitle(\"Current Allergies\");\n this.gridAllergyExisting.setTranslationName(\"GridAllergyExisting\");\n //\n // gridAllergyImport\n //\n this.gridAllergyImport.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right)));\n this.gridAllergyImport.setHScrollVisible(false);\n this.gridAllergyImport.Location = new System.Drawing.Point(497, 12);\n this.gridAllergyImport.Name = \"gridAllergyImport\";\n this.gridAllergyImport.setScrollValue(0);\n this.gridAllergyImport.setSelectionMode(OpenDental.UI.GridSelectionMode.MultiExtended);\n this.gridAllergyImport.Size = new System.Drawing.Size(480, 245);\n this.gridAllergyImport.TabIndex = 77;\n this.gridAllergyImport.setTitle(\"Transition of Care/Referral Summary\");\n this.gridAllergyImport.setTranslationName(\"GridAllergyImport\");\n //\n // butRemoveRec\n //\n this.butRemoveRec.setAdjustImageLocation(new System.Drawing.Point(0, 0));\n this.butRemoveRec.Anchor = System.Windows.Forms.AnchorStyles.Bottom;\n this.butRemoveRec.setAutosize(true);\n this.butRemoveRec.setBtnShape(OpenDental.UI.enumType.BtnShape.Rectangle);\n this.butRemoveRec.setBtnStyle(OpenDental.UI.enumType.XPStyle.Silver);\n this.butRemoveRec.setCornerRadius(4F);\n this.butRemoveRec.Location = new System.Drawing.Point(437, 599);\n this.butRemoveRec.Name = \"butRemoveRec\";\n this.butRemoveRec.Size = new System.Drawing.Size(99, 24);\n this.butRemoveRec.TabIndex = 82;\n this.butRemoveRec.Text = \"Remove Selected\";\n this.butRemoveRec.Click += new System.EventHandler(this.butRemoveRec_Click);\n //\n // butOK\n //\n this.butOK.setAdjustImageLocation(new System.Drawing.Point(0, 0));\n this.butOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));\n this.butOK.setAutosize(true);\n this.butOK.setBtnShape(OpenDental.UI.enumType.BtnShape.Rectangle);\n this.butOK.setBtnStyle(OpenDental.UI.enumType.XPStyle.Silver);\n this.butOK.setCornerRadius(4F);\n this.butOK.Location = new System.Drawing.Point(821, 640);\n this.butOK.Name = \"butOK\";\n this.butOK.Size = new System.Drawing.Size(75, 24);\n this.butOK.TabIndex = 81;\n this.butOK.Text = \"&OK\";\n this.butOK.Click += new System.EventHandler(this.butOK_Click);\n //\n // butAddNew\n //\n this.butAddNew.setAdjustImageLocation(new System.Drawing.Point(0, 0));\n this.butAddNew.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));\n this.butAddNew.setAutosize(true);\n this.butAddNew.setBtnShape(OpenDental.UI.enumType.BtnShape.Rectangle);\n this.butAddNew.setBtnStyle(OpenDental.UI.enumType.XPStyle.Silver);\n this.butAddNew.setCornerRadius(4F);\n this.butAddNew.Image = Resources.getdown();\n this.butAddNew.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;\n this.butAddNew.Location = new System.Drawing.Point(712, 263);\n this.butAddNew.Name = \"butAddNew\";\n this.butAddNew.Size = new System.Drawing.Size(51, 24);\n this.butAddNew.TabIndex = 80;\n this.butAddNew.Text = \"Add\";\n this.butAddNew.TextAlign = System.Drawing.ContentAlignment.MiddleRight;\n this.butAddNew.Click += new System.EventHandler(this.butAddNew_Click);\n //\n // butAddExist\n //\n this.butAddExist.setAdjustImageLocation(new System.Drawing.Point(0, 0));\n this.butAddExist.Anchor = System.Windows.Forms.AnchorStyles.Bottom;\n this.butAddExist.setAutosize(true);\n this.butAddExist.setBtnShape(OpenDental.UI.enumType.BtnShape.Rectangle);\n this.butAddExist.setBtnStyle(OpenDental.UI.enumType.XPStyle.Silver);\n this.butAddExist.setCornerRadius(4F);\n this.butAddExist.Image = Resources.getdown();\n this.butAddExist.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;\n this.butAddExist.Location = new System.Drawing.Point(218, 263);\n this.butAddExist.Name = \"butAddExist\";\n this.butAddExist.Size = new System.Drawing.Size(51, 24);\n this.butAddExist.TabIndex = 79;\n this.butAddExist.Text = \"Add\";\n this.butAddExist.TextAlign = System.Drawing.ContentAlignment.MiddleRight;\n this.butAddExist.Click += new System.EventHandler(this.butAddExist_Click);\n //\n // gridAllergyReconcile\n //\n this.gridAllergyReconcile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));\n this.gridAllergyReconcile.setHScrollVisible(false);\n this.gridAllergyReconcile.Location = new System.Drawing.Point(4, 293);\n this.gridAllergyReconcile.Name = \"gridAllergyReconcile\";\n this.gridAllergyReconcile.setScrollValue(0);\n this.gridAllergyReconcile.setSelectionMode(OpenDental.UI.GridSelectionMode.MultiExtended);\n this.gridAllergyReconcile.Size = new System.Drawing.Size(973, 300);\n this.gridAllergyReconcile.TabIndex = 67;\n this.gridAllergyReconcile.setTitle(\"Reconciled Allergies\");\n this.gridAllergyReconcile.setTranslationName(\"gridAllergyReconcile\");\n //\n // butClose\n //\n this.butClose.setAdjustImageLocation(new System.Drawing.Point(0, 0));\n this.butClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));\n this.butClose.setAutosize(true);\n this.butClose.setBtnShape(OpenDental.UI.enumType.BtnShape.Rectangle);\n this.butClose.setBtnStyle(OpenDental.UI.enumType.XPStyle.Silver);\n this.butClose.setCornerRadius(4F);\n this.butClose.Location = new System.Drawing.Point(902, 640);\n this.butClose.Name = \"butClose\";\n this.butClose.Size = new System.Drawing.Size(75, 24);\n this.butClose.TabIndex = 2;\n this.butClose.Text = \"&Close\";\n this.butClose.Click += new System.EventHandler(this.butCancel_Click);\n //\n // FormReconcileAllergy\n //\n this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;\n this.ClientSize = new System.Drawing.Size(982, 676);\n this.Controls.Add(this.labelBatch);\n this.Controls.Add(this.gridAllergyExisting);\n this.Controls.Add(this.gridAllergyImport);\n this.Controls.Add(this.butRemoveRec);\n this.Controls.Add(this.butOK);\n this.Controls.Add(this.butAddNew);\n this.Controls.Add(this.butAddExist);\n this.Controls.Add(this.gridAllergyReconcile);\n this.Controls.Add(this.butClose);\n this.Icon = ((System.Drawing.Icon)(resources.GetObject(\"$this.Icon\")));\n this.MinimumSize = new System.Drawing.Size(530, 518);\n this.Name = \"FormReconcileAllergy\";\n this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;\n this.Text = \"Reconcile Allergies\";\n this.Load += new System.EventHandler(this.FormReconcileAllergy_Load);\n this.ResumeLayout(false);\n }", "public void initGUI(){\n\t\t\n\t\t//the layout is a new BorderLayout\n\t\tsetLayout(new BorderLayout());\n\t\t\n\t\t//the label will be north\t\n\t\tadd(createHeroList(), BorderLayout.NORTH);\n\t\t\n\t\t//the questions will be displayed center\t\t\n\t\tadd(createQuestions(), BorderLayout.CENTER);\n\t\t//the button panel should be south\n\t\tadd(createAnswerButtonPanel(), BorderLayout.SOUTH);\n\t\t\n\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 metamodel = new sk.tuke.magsa.maketool.component.ResourceComponent();\n externalParser = new sk.tuke.magsa.maketool.component.ExecutableResourceComponent();\n yajco = new sk.tuke.magsa.maketool.component.ExecutableResourceComponent();\n modelFile = new sk.tuke.magsa.maketool.component.ResourceComponent();\n model = new sk.tuke.magsa.maketool.component.ResourceComponent();\n arrow3 = new sk.tuke.magsa.maketool.component.Arrow();\n arrow4 = new sk.tuke.magsa.maketool.component.Arrow();\n arrow13 = new sk.tuke.magsa.maketool.component.Arrow();\n arrow22 = new sk.tuke.magsa.maketool.component.Arrow();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n\n setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle(\"sk/tuke/magsa/maketool/Bundle\"); // NOI18N\n metamodel.setLabel(bundle.getString(\"metamodel\")); // NOI18N\n add(metamodel, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 90, 130, 80));\n\n externalParser.setActionName(bundle.getString(\"parse\")); // NOI18N\n externalParser.setLabel(bundle.getString(\"externalParser\")); // NOI18N\n add(externalParser, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 230, 120, 60));\n\n yajco.setActionName(bundle.getString(\"generate\")); // NOI18N\n yajco.setLabel(bundle.getString(\"yajco\")); // NOI18N\n add(yajco, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 100, 100, 60));\n\n modelFile.setLabel(bundle.getString(\"modelFile\")); // NOI18N\n add(modelFile, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 230, 105, 55));\n\n model.setLabel(bundle.getString(\"model\")); // NOI18N\n add(model, new org.netbeans.lib.awtextra.AbsoluteConstraints(670, 230, 70, 60));\n\n arrow3.setBarbStyle(sk.tuke.magsa.maketool.component.Arrow.BarbStyle.FILLED);\n add(arrow3, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 250, 40, 20));\n\n arrow4.setBarbStyle(sk.tuke.magsa.maketool.component.Arrow.BarbStyle.FILLED);\n add(arrow4, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 120, 40, 20));\n add(arrow13, new org.netbeans.lib.awtextra.AbsoluteConstraints(630, 250, 30, 20));\n\n arrow22.setOrientation(sk.tuke.magsa.maketool.component.Arrow.Orientation.SOUTH);\n add(arrow22, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 170, 40, 50));\n\n jLabel4.setBackground(new java.awt.Color(255, 255, 153));\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 0, 14));\n jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel4.setText(bundle.getString(\"parserGenerationPhase\")); // NOI18N\n jLabel4.setVerticalAlignment(javax.swing.SwingConstants.TOP);\n jLabel4.setOpaque(true);\n add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 40, 310, 150));\n\n jLabel5.setBackground(new java.awt.Color(255, 255, 153));\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 0, 14));\n jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel5.setVerticalAlignment(javax.swing.SwingConstants.TOP);\n jLabel5.setOpaque(true);\n add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 40, 140, 260));\n\n jLabel3.setBackground(new java.awt.Color(241, 182, 139));\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 0, 18));\n jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel3.setText(bundle.getString(\"parsingPhase\")); // NOI18N\n jLabel3.setVerticalAlignment(javax.swing.SwingConstants.TOP);\n jLabel3.setOpaque(true);\n add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1070, 530));\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n headerLbl = new javax.swing.JLabel();\n detailsLbl = new javax.swing.JLabel();\n makeLbl = new javax.swing.JLabel();\n modelLbl = new javax.swing.JLabel();\n jLabel1 = new javax.swing.JLabel();\n makeTf = new javax.swing.JTextField();\n modelTf = new javax.swing.JTextField();\n yearTf = new javax.swing.JTextField();\n addBtn = new javax.swing.JButton();\n removeBtn = new javax.swing.JButton();\n listBtn = new javax.swing.JButton();\n clearBtn = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n detailsTa = new javax.swing.JTextArea();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setLayout(null);\n\n headerLbl.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n headerLbl.setText(\"Richie's ChopShop\");\n jPanel1.add(headerLbl);\n headerLbl.setBounds(120, 10, 160, 30);\n\n detailsLbl.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n detailsLbl.setText(\"Car Details\");\n jPanel1.add(detailsLbl);\n detailsLbl.setBounds(10, 40, 100, 17);\n\n makeLbl.setText(\"Make:\");\n jPanel1.add(makeLbl);\n makeLbl.setBounds(40, 60, 50, 14);\n\n modelLbl.setText(\"Model:\");\n jPanel1.add(modelLbl);\n modelLbl.setBounds(40, 100, 60, 14);\n\n jLabel1.setText(\"Year:\");\n jPanel1.add(jLabel1);\n jLabel1.setBounds(40, 140, 60, 14);\n\n makeTf.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n makeTfActionPerformed(evt);\n }\n });\n jPanel1.add(makeTf);\n makeTf.setBounds(150, 60, 180, 20);\n jPanel1.add(modelTf);\n modelTf.setBounds(150, 100, 180, 20);\n jPanel1.add(yearTf);\n yearTf.setBounds(150, 140, 180, 20);\n\n addBtn.setText(\"Add\");\n addBtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n addBtnActionPerformed(evt);\n }\n });\n jPanel1.add(addBtn);\n addBtn.setBounds(10, 160, 70, 23);\n\n removeBtn.setText(\"Remove\");\n jPanel1.add(removeBtn);\n removeBtn.setBounds(10, 190, 71, 23);\n\n listBtn.setText(\"List\");\n listBtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n listBtnActionPerformed(evt);\n }\n });\n jPanel1.add(listBtn);\n listBtn.setBounds(10, 220, 70, 23);\n\n clearBtn.setText(\"Clear\");\n clearBtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n clearBtnActionPerformed(evt);\n }\n });\n jPanel1.add(clearBtn);\n clearBtn.setBounds(10, 250, 70, 23);\n\n detailsTa.setColumns(20);\n detailsTa.setRows(5);\n jScrollPane1.setViewportView(detailsTa);\n\n jPanel1.add(jScrollPane1);\n jScrollPane1.setBounds(150, 170, 180, 120);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n setSize(new java.awt.Dimension(416, 338));\n setLocationRelativeTo(null);\n }", "private void initComponents() {\n dialogPane = new JPanel();\n contentPanel = new JPanel();\n apiLabel = new JLabel();\n sourceLabel = new JLabel();\n sourceTextField = new JTextField();\n threadLabel = new JLabel();\n threadsTextField = new JTextField();\n copyToASpaceButton = new JButton();\n hostLabel = new JLabel();\n hostTextField = new JTextField();\n repositoryCheckButton = new JButton();\n copyRecordCheckBox = new JCheckBox();\n viewRepositoryCheckReportButton = new JButton();\n continueButton = new JButton();\n adminLabel = new JLabel();\n adminTextField = new JTextField();\n adminPasswordLabel = new JLabel();\n adminPasswordTextField = new JTextField();\n tracerPanel = new JPanel();\n useTracerCheckBox = new JCheckBox();\n tracerComboBox = new JComboBox();\n resetPassswordLabel = new JLabel();\n resetPasswordTextField = new JTextField();\n typeOfExtentDataLabel = new JLabel();\n normalExtentRadioButton = new JRadioButton();\n byuExtentRadioButton = new JRadioButton();\n ignoreUnlinkedRecordsLabel = new JLabel();\n ignoreUnlinkedNamesCheckBox = new JCheckBox();\n ignoreUnlinkedSubjectsCheckBox = new JCheckBox();\n publishPanel = new JPanel();\n label1 = new JLabel();\n publishReposCheckBox = new JCheckBox();\n publishNamesCheckBox = new JCheckBox();\n publishSubjectsCheckBox = new JCheckBox();\n publishAccessionsCheckBox = new JCheckBox();\n publishDigitalObjectsCheckBox = new JCheckBox();\n publishResourcesCheckBox = new JCheckBox();\n simulateCheckBox = new JCheckBox();\n useScriptCheckBox = new JCheckBox();\n editScriptButton = new JButton();\n batchImportCheckBox = new JCheckBox();\n numResourceToCopyLabel = new JLabel();\n numResourceToCopyTextField = new JTextField();\n resourcesToCopyTextField = new JTextField();\n outputConsoleLabel = new JLabel();\n copyProgressBar = new JProgressBar();\n scrollPane1 = new JScrollPane();\n consoleTextArea = new JTextArea();\n recordURIComboBox = new JComboBox();\n paramsLabel = new JLabel();\n paramsTextField = new JTextField();\n viewRecordButton = new JButton();\n testRecordButton = new JButton();\n buttonBar = new JPanel();\n errorLogButton = new JButton();\n saveErrorsLabel = new JLabel();\n errorCountLabel = new JLabel();\n stopButton = new JButton();\n basicUIButton = new JButton();\n okButton = new JButton();\n CellConstraints cc = new CellConstraints();\n\n //======== this ========\n setTitle(\"Archives Space Data Migrator\");\n Container contentPane = getContentPane();\n contentPane.setLayout(new BorderLayout());\n\n //======== dialogPane ========\n {\n dialogPane.setBorder(Borders.DIALOG_BORDER);\n dialogPane.setLayout(new BorderLayout());\n\n //======== contentPanel ========\n {\n contentPanel.setLayout(new FormLayout(\n new ColumnSpec[] {\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC\n },\n new RowSpec[] {\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC,\n FormFactory.LINE_GAP_ROWSPEC,\n new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),\n FormFactory.LINE_GAP_ROWSPEC,\n FormFactory.DEFAULT_ROWSPEC\n }));\n\n //---- apiLabel ----\n apiLabel.setText(\" Archives Space Version: v2.x\");\n apiLabel.setHorizontalTextPosition(SwingConstants.CENTER);\n contentPanel.add(apiLabel, cc.xy(1, 1));\n\n //---- sourceLabel ----\n sourceLabel.setText(\"Source\");\n contentPanel.add(sourceLabel, cc.xy(3, 1));\n\n //---- sourceTextField ----\n sourceTextField.setColumns(4);\n sourceTextField.setText(\"2\");\n contentPanel.add(sourceTextField, cc.xy(5, 1));\n\n //---- threadLabel ----\n threadLabel.setText(\"Threads\");\n contentPanel.add(threadLabel, cc.xy(11, 1));\n\n //---- threadsTextField ----\n threadsTextField.setColumns(4);\n threadsTextField.setText(\"1\");\n contentPanel.add(threadsTextField, cc.xy(13, 1));\n\n //---- copyToASpaceButton ----\n copyToASpaceButton.setText(\"Copy To Archives Space\");\n copyToASpaceButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n CopyToASpaceButtonActionPerformed();\n }\n });\n contentPanel.add(copyToASpaceButton, cc.xy(1, 3));\n\n //---- hostLabel ----\n hostLabel.setText(\"Host\");\n contentPanel.add(hostLabel, cc.xy(3, 3));\n\n //---- hostTextField ----\n hostTextField.setText(\"http://localhost:8089\");\n contentPanel.add(hostTextField, cc.xywh(5, 3, 9, 1));\n\n //---- repositoryCheckButton ----\n repositoryCheckButton.setText(\"Run Repository Check\");\n repositoryCheckButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n repositoryCheckButtonActionPerformed();\n }\n });\n contentPanel.add(repositoryCheckButton, cc.xy(1, 5));\n\n //---- copyRecordCheckBox ----\n copyRecordCheckBox.setText(\"Copy Records When Done\");\n copyRecordCheckBox.setSelected(true);\n contentPanel.add(copyRecordCheckBox, cc.xywh(3, 5, 7, 1));\n\n //---- viewRepositoryCheckReportButton ----\n viewRepositoryCheckReportButton.setText(\"View Report\");\n viewRepositoryCheckReportButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n viewRepositoryCheckReportButtonActionPerformed();\n }\n });\n contentPanel.add(viewRepositoryCheckReportButton, cc.xywh(11, 5, 3, 1));\n\n //---- continueButton ----\n continueButton.setText(\"Continue Previous Migration\");\n continueButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n continueButtonActionPerformed();\n }\n });\n contentPanel.add(continueButton, cc.xy(1, 7));\n\n //---- adminLabel ----\n adminLabel.setText(\"Admin\");\n contentPanel.add(adminLabel, cc.xy(3, 7));\n\n //---- adminTextField ----\n adminTextField.setText(\"asadmin\");\n contentPanel.add(adminTextField, cc.xy(5, 7));\n\n //---- adminPasswordLabel ----\n adminPasswordLabel.setText(\"Password\");\n contentPanel.add(adminPasswordLabel, cc.xy(11, 7));\n\n //---- adminPasswordTextField ----\n adminPasswordTextField.setText(\"admin\");\n contentPanel.add(adminPasswordTextField, cc.xy(13, 7));\n\n //======== tracerPanel ========\n {\n tracerPanel.setLayout(new FlowLayout(FlowLayout.LEFT));\n\n //---- useTracerCheckBox ----\n useTracerCheckBox.setText(\"Use Tracer Database\");\n tracerPanel.add(useTracerCheckBox);\n\n //---- tracerComboBox ----\n tracerComboBox.setModel(new DefaultComboBoxModel(new String[] {\n \"1\",\n \"2\",\n \"3\",\n \"SB\"\n }));\n tracerPanel.add(tracerComboBox);\n }\n contentPanel.add(tracerPanel, cc.xy(1, 9));\n\n //---- resetPassswordLabel ----\n resetPassswordLabel.setText(\"Reset Password\");\n contentPanel.add(resetPassswordLabel, cc.xywh(3, 9, 5, 1));\n\n //---- resetPasswordTextField ----\n resetPasswordTextField.setText(\"archive\");\n contentPanel.add(resetPasswordTextField, cc.xywh(9, 9, 5, 1));\n\n //---- typeOfExtentDataLabel ----\n typeOfExtentDataLabel.setText(\" Specify Type of Extent Data\");\n contentPanel.add(typeOfExtentDataLabel, cc.xy(1, 11));\n\n //---- normalExtentRadioButton ----\n normalExtentRadioButton.setText(\"Normal or Harvard Plugin\");\n normalExtentRadioButton.setSelected(true);\n contentPanel.add(normalExtentRadioButton, cc.xywh(3, 11, 5, 1));\n\n //---- byuExtentRadioButton ----\n byuExtentRadioButton.setText(\"BYU Plugin\");\n contentPanel.add(byuExtentRadioButton, cc.xywh(9, 11, 5, 1));\n\n //---- ignoreUnlinkedRecordsLabel ----\n ignoreUnlinkedRecordsLabel.setText(\" Specify Unlinked Records to NOT Copy\");\n contentPanel.add(ignoreUnlinkedRecordsLabel, cc.xy(1, 13));\n\n //---- ignoreUnlinkedNamesCheckBox ----\n ignoreUnlinkedNamesCheckBox.setText(\"Name Records\");\n contentPanel.add(ignoreUnlinkedNamesCheckBox, cc.xywh(3, 13, 5, 1));\n\n //---- ignoreUnlinkedSubjectsCheckBox ----\n ignoreUnlinkedSubjectsCheckBox.setText(\"Subject Records\");\n contentPanel.add(ignoreUnlinkedSubjectsCheckBox, cc.xywh(9, 13, 5, 1));\n\n //======== publishPanel ========\n {\n publishPanel.setLayout(new FormLayout(\n new ColumnSpec[] {\n new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC\n },\n RowSpec.decodeSpecs(\"default\")));\n\n //---- label1 ----\n label1.setText(\" Records To Publish?\");\n publishPanel.add(label1, cc.xy(1, 1));\n\n //---- publishReposCheckBox ----\n publishReposCheckBox.setText(\"Repositories\");\n publishReposCheckBox.setSelected(true);\n publishPanel.add(publishReposCheckBox, cc.xy(3, 1));\n\n //---- publishNamesCheckBox ----\n publishNamesCheckBox.setText(\"Names\");\n publishPanel.add(publishNamesCheckBox, cc.xy(5, 1));\n\n //---- publishSubjectsCheckBox ----\n publishSubjectsCheckBox.setText(\"Subjects\");\n publishPanel.add(publishSubjectsCheckBox, cc.xy(7, 1));\n\n //---- publishAccessionsCheckBox ----\n publishAccessionsCheckBox.setText(\"Accessions\");\n publishPanel.add(publishAccessionsCheckBox, cc.xy(9, 1));\n\n //---- publishDigitalObjectsCheckBox ----\n publishDigitalObjectsCheckBox.setText(\"Digital Objects\");\n publishDigitalObjectsCheckBox.setSelected(true);\n publishPanel.add(publishDigitalObjectsCheckBox, cc.xy(11, 1));\n\n //---- publishResourcesCheckBox ----\n publishResourcesCheckBox.setText(\"Resources\");\n publishResourcesCheckBox.setSelected(true);\n publishPanel.add(publishResourcesCheckBox, cc.xy(13, 1));\n }\n contentPanel.add(publishPanel, cc.xywh(1, 15, 13, 1));\n\n //---- simulateCheckBox ----\n simulateCheckBox.setText(\"Simulate REST Calls\");\n contentPanel.add(simulateCheckBox, cc.xy(1, 17));\n\n //---- useScriptCheckBox ----\n useScriptCheckBox.setText(\"Use Mapper Script\");\n contentPanel.add(useScriptCheckBox, cc.xywh(3, 17, 5, 1));\n\n //---- editScriptButton ----\n editScriptButton.setText(\"Edit or Load Script\");\n editScriptButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n editScriptButtonActionPerformed();\n }\n });\n contentPanel.add(editScriptButton, cc.xywh(9, 17, 5, 1));\n\n //---- batchImportCheckBox ----\n batchImportCheckBox.setText(\"Use Batch Import for Resources\");\n batchImportCheckBox.setSelected(true);\n contentPanel.add(batchImportCheckBox, cc.xy(1, 19));\n\n //---- numResourceToCopyLabel ----\n numResourceToCopyLabel.setText(\"Number of Resources To Copy\");\n contentPanel.add(numResourceToCopyLabel, cc.xywh(3, 19, 5, 1));\n\n //---- numResourceToCopyTextField ----\n numResourceToCopyTextField.setText(\"100000\");\n contentPanel.add(numResourceToCopyTextField, cc.xywh(9, 19, 5, 1));\n\n //---- resourcesToCopyTextField ----\n resourcesToCopyTextField.setText(\"-refid_unique, -term_default\");\n contentPanel.add(resourcesToCopyTextField, cc.xywh(3, 21, 11, 1));\n\n //---- outputConsoleLabel ----\n outputConsoleLabel.setText(\"Output Console:\");\n contentPanel.add(outputConsoleLabel, cc.xy(1, 23));\n contentPanel.add(copyProgressBar, cc.xywh(3, 23, 11, 1));\n\n //======== scrollPane1 ========\n {\n\n //---- consoleTextArea ----\n consoleTextArea.setRows(12);\n consoleTextArea.setLineWrap(true);\n scrollPane1.setViewportView(consoleTextArea);\n }\n contentPanel.add(scrollPane1, cc.xywh(1, 25, 13, 1));\n\n //---- recordURIComboBox ----\n recordURIComboBox.setModel(new DefaultComboBoxModel(new String[] {\n \"/repositories\",\n \"/users\",\n \"/subjects\",\n \"/agents/families/1\",\n \"/agents/people/1\",\n \"/agents/corporate_entities/1\",\n \"/repositories/2/accessions/1\",\n \"/repositories/2/resources/1\",\n \"/repositories/2/archival_objects/1\",\n \"/config/enumerations\"\n }));\n recordURIComboBox.setEditable(true);\n contentPanel.add(recordURIComboBox, cc.xy(1, 27));\n\n //---- paramsLabel ----\n paramsLabel.setText(\"Params\");\n contentPanel.add(paramsLabel, cc.xy(3, 27));\n\n //---- paramsTextField ----\n paramsTextField.setText(\"page=1\");\n contentPanel.add(paramsTextField, cc.xywh(5, 27, 3, 1));\n\n //---- viewRecordButton ----\n viewRecordButton.setText(\"View\");\n viewRecordButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n viewRecordButtonActionPerformed();\n }\n });\n contentPanel.add(viewRecordButton, cc.xy(11, 27));\n\n //---- testRecordButton ----\n testRecordButton.setText(\"Test\");\n testRecordButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n testRecordButtonActionPerformed();\n }\n });\n contentPanel.add(testRecordButton, cc.xy(13, 27));\n }\n dialogPane.add(contentPanel, BorderLayout.CENTER);\n\n //======== buttonBar ========\n {\n buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER);\n buttonBar.setLayout(new FormLayout(\n new ColumnSpec[] {\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.GLUE_COLSPEC,\n FormFactory.LABEL_COMPONENT_GAP_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.DEFAULT_COLSPEC,\n FormFactory.BUTTON_COLSPEC\n },\n RowSpec.decodeSpecs(\"pref\")));\n\n //---- errorLogButton ----\n errorLogButton.setText(\"View Error Log\");\n errorLogButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n errorLogButtonActionPerformed();\n }\n });\n buttonBar.add(errorLogButton, cc.xy(2, 1));\n\n //---- saveErrorsLabel ----\n saveErrorsLabel.setText(\" Errors/Warnings: \");\n buttonBar.add(saveErrorsLabel, cc.xy(4, 1));\n\n //---- errorCountLabel ----\n errorCountLabel.setText(\"N/A \");\n errorCountLabel.setForeground(Color.red);\n errorCountLabel.setFont(new Font(\"Lucida Grande\", Font.BOLD, 13));\n buttonBar.add(errorCountLabel, cc.xy(6, 1));\n\n //---- stopButton ----\n stopButton.setText(\"Cancel Copy\");\n stopButton.setEnabled(false);\n stopButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n stopButtonActionPerformed();\n stopButtonActionPerformed();\n }\n });\n buttonBar.add(stopButton, cc.xy(9, 1));\n\n //---- basicUIButton ----\n basicUIButton.setText(\"Basic UI\");\n basicUIButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n basicUIButtonActionPerformed();\n }\n });\n buttonBar.add(basicUIButton, cc.xy(10, 1));\n\n //---- okButton ----\n okButton.setText(\"Close\");\n okButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n okButtonActionPerformed();\n }\n });\n buttonBar.add(okButton, cc.xy(12, 1));\n }\n dialogPane.add(buttonBar, BorderLayout.SOUTH);\n }\n contentPane.add(dialogPane, BorderLayout.CENTER);\n pack();\n setLocationRelativeTo(getOwner());\n\n //---- buttonGroup1 ----\n ButtonGroup buttonGroup1 = new ButtonGroup();\n buttonGroup1.add(normalExtentRadioButton);\n buttonGroup1.add(byuExtentRadioButton);\n // JFormDesigner - End of component initialization //GEN-END:initComponents\n }", "private void $$$setupUI$$$() {\n MainPanel = new JPanel();\n MainPanel.setLayout(new GridBagLayout());\n MainPanel.setBackground(new Color(-2171407));\n MainPanel.setFocusTraversalPolicyProvider(true);\n MainPanel.setFocusable(false);\n MainPanel.setMinimumSize(new Dimension(90, 100));\n MainPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));\n SelectionTabs = new JTabbedPane();\n SelectionTabs.setBackground(new Color(-8817257));\n GridBagConstraints gbc;\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.anchor = GridBagConstraints.NORTH;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n MainPanel.add(SelectionTabs, gbc);\n SelectionTabs.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));\n DestinationsTab = new JPanel();\n DestinationsTab.setLayout(new GridBagLayout());\n DestinationsTab.setBackground(new Color(-2171407));\n SelectionTabs.addTab(\"Destinations\", DestinationsTab);\n DestinationsTab.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));\n DomesticDropdown = new JComboBox();\n DomesticDropdown.setBackground(new Color(-8817257));\n final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel();\n defaultComboBoxModel1.addElement(\"Select Destination\");\n defaultComboBoxModel1.addElement(\"Boston (United Airlines)\");\n defaultComboBoxModel1.addElement(\"D.C. (American Airlines)\");\n DomesticDropdown.setModel(defaultComboBoxModel1);\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 1;\n gbc.anchor = GridBagConstraints.NORTHWEST;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n DestinationsTab.add(DomesticDropdown, gbc);\n DomesticTitle = new JLabel();\n DomesticTitle.setText(\"Domestic Destinations\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.weighty = 1.0;\n DestinationsTab.add(DomesticTitle, gbc);\n InternationalTitle = new JLabel();\n InternationalTitle.setText(\"International Destinations\");\n gbc = new GridBagConstraints();\n gbc.gridx = 3;\n gbc.gridy = 0;\n gbc.weighty = 1.0;\n DestinationsTab.add(InternationalTitle, gbc);\n USA = new JLabel();\n USA.setIcon(new ImageIcon(getClass().getResource(\"/USAicon.png\")));\n USA.setInheritsPopupMenu(false);\n USA.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 2;\n gbc.weighty = 1.0;\n DestinationsTab.add(USA, gbc);\n Overseas = new JLabel();\n Overseas.setIcon(new ImageIcon(getClass().getResource(\"/Earthicon.png\")));\n Overseas.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 3;\n gbc.gridy = 2;\n gbc.weighty = 1.0;\n DestinationsTab.add(Overseas, gbc);\n InternationalDropdown = new JComboBox();\n InternationalDropdown.setBackground(new Color(-8817257));\n final DefaultComboBoxModel defaultComboBoxModel2 = new DefaultComboBoxModel();\n defaultComboBoxModel2.addElement(\"Select Destination\");\n defaultComboBoxModel2.addElement(\"Tokyo (Japan Airlines)\");\n defaultComboBoxModel2.addElement(\"Dublin (Aer Lingus)\");\n InternationalDropdown.setModel(defaultComboBoxModel2);\n gbc = new GridBagConstraints();\n gbc.gridx = 3;\n gbc.gridy = 1;\n gbc.anchor = GridBagConstraints.NORTHWEST;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n DestinationsTab.add(InternationalDropdown, gbc);\n DestinationSubmitButton = new JButton();\n DestinationSubmitButton.setBackground(new Color(-8817257));\n DestinationSubmitButton.setText(\"Submit\");\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 3;\n gbc.gridwidth = 2;\n gbc.gridheight = 6;\n gbc.weightx = 1.0;\n gbc.anchor = GridBagConstraints.SOUTH;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n DestinationsTab.add(DestinationSubmitButton, gbc);\n HotelTab = new JPanel();\n HotelTab.setLayout(new GridBagLayout());\n HotelTab.setBackground(new Color(-2171407));\n SelectionTabs.addTab(\"Hotel\", HotelTab);\n HotelTab.setBorder(BorderFactory.createTitledBorder(BorderFactory.createRaisedBevelBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));\n HotelBoston = new JPanel();\n HotelBoston.setLayout(new GridBagLayout());\n HotelBoston.setBackground(new Color(-2171407));\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.weightx = 1.0;\n gbc.anchor = GridBagConstraints.NORTHWEST;\n HotelTab.add(HotelBoston, gbc);\n HotelBoston.setBorder(BorderFactory.createTitledBorder(BorderFactory.createRaisedBevelBorder(), \"Hotel Commonwealth\", TitledBorder.CENTER, TitledBorder.TOP, null, null));\n BostonHotel = new JLabel();\n BostonHotel.setHorizontalAlignment(0);\n BostonHotel.setHorizontalTextPosition(0);\n BostonHotel.setIcon(new ImageIcon(getClass().getResource(\"/HotelCommonwealth.jpg\")));\n BostonHotel.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.weighty = 1.0;\n gbc.anchor = GridBagConstraints.WEST;\n HotelBoston.add(BostonHotel, gbc);\n SelectBoston = new JButton();\n SelectBoston.setLabel(\"Select\");\n SelectBoston.setText(\"Select\");\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 0;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n HotelBoston.add(SelectBoston, gbc);\n HotelDC = new JPanel();\n HotelDC.setLayout(new GridBagLayout());\n HotelDC.setBackground(new Color(-2171407));\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 0;\n gbc.gridheight = 2;\n gbc.weightx = 1.0;\n gbc.anchor = GridBagConstraints.NORTHEAST;\n HotelTab.add(HotelDC, gbc);\n HotelDC.setBorder(BorderFactory.createTitledBorder(BorderFactory.createRaisedBevelBorder(), \"Trump International\", TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION, null, null));\n TrumpInt = new JLabel();\n TrumpInt.setIcon(new ImageIcon(getClass().getResource(\"/DCHotel.png\")));\n TrumpInt.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.weighty = 1.0;\n gbc.anchor = GridBagConstraints.WEST;\n HotelDC.add(TrumpInt, gbc);\n SelectDC = new JButton();\n SelectDC.setText(\"Select\");\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 0;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n HotelDC.add(SelectDC, gbc);\n HotelDublin = new JPanel();\n HotelDublin.setLayout(new GridBagLayout());\n HotelDublin.setBackground(new Color(-2171407));\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 1;\n gbc.gridheight = 2;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.anchor = GridBagConstraints.SOUTHWEST;\n HotelTab.add(HotelDublin, gbc);\n HotelDublin.setBorder(BorderFactory.createTitledBorder(BorderFactory.createRaisedBevelBorder(), \"The Westbury\", TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION, null, null));\n Westbury = new JLabel();\n Westbury.setIcon(new ImageIcon(getClass().getResource(\"/HotelDublin.jpg\")));\n Westbury.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.weighty = 1.0;\n gbc.anchor = GridBagConstraints.WEST;\n HotelDublin.add(Westbury, gbc);\n SelectDublin = new JButton();\n SelectDublin.setText(\"Select\");\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 0;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n HotelDublin.add(SelectDublin, gbc);\n HotelTokyo = new JPanel();\n HotelTokyo.setLayout(new GridBagLayout());\n HotelTokyo.setBackground(new Color(-2171407));\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 2;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.anchor = GridBagConstraints.SOUTHEAST;\n HotelTab.add(HotelTokyo, gbc);\n HotelTokyo.setBorder(BorderFactory.createTitledBorder(BorderFactory.createRaisedBevelBorder(), \"Aman Tokyo\", TitledBorder.CENTER, TitledBorder.TOP, null, null));\n AmanTokyo = new JLabel();\n AmanTokyo.setIcon(new ImageIcon(getClass().getResource(\"/HotelTokyo.jpg\")));\n AmanTokyo.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.weighty = 1.0;\n gbc.anchor = GridBagConstraints.WEST;\n HotelTokyo.add(AmanTokyo, gbc);\n SelectTokyo = new JButton();\n SelectTokyo.setText(\"Select\");\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 0;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n HotelTokyo.add(SelectTokyo, gbc);\n RentalTab = new JPanel();\n RentalTab.setLayout(new GridBagLayout());\n RentalTab.setBackground(new Color(-2171407));\n SelectionTabs.addTab(\"Car Rental\", RentalTab);\n CarBoston = new JLabel();\n CarBoston.setIcon(new ImageIcon(getClass().getResource(\"/BostonCar.png\")));\n CarBoston.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n RentalTab.add(CarBoston, gbc);\n CarDC = new JLabel();\n CarDC.setIcon(new ImageIcon(getClass().getResource(\"/DCcar.jpg\")));\n CarDC.setInheritsPopupMenu(true);\n CarDC.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 0;\n gbc.gridheight = 3;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n RentalTab.add(CarDC, gbc);\n CarTokyo = new JLabel();\n CarTokyo.setIcon(new ImageIcon(getClass().getResource(\"/TokyoCar.jpg\")));\n CarTokyo.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 4;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n RentalTab.add(CarTokyo, gbc);\n CarDublin = new JLabel();\n CarDublin.setIcon(new ImageIcon(getClass().getResource(\"/DublinCar.jpg\")));\n CarDublin.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 4;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n RentalTab.add(CarDublin, gbc);\n hertzDCButton = new JButton();\n hertzDCButton.setText(\"Hertz D.C.\");\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 3;\n gbc.weightx = 1.0;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n RentalTab.add(hertzDCButton, gbc);\n hertzTokyoButton = new JButton();\n hertzTokyoButton.setText(\"Hertz Tokyo\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 5;\n gbc.weightx = 1.0;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n RentalTab.add(hertzTokyoButton, gbc);\n hertzDublinButton = new JButton();\n hertzDublinButton.setText(\"Hertz Dublin\");\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 5;\n gbc.weightx = 1.0;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n RentalTab.add(hertzDublinButton, gbc);\n hertzBostonButton = new JButton();\n hertzBostonButton.setText(\"Hertz Boston\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 3;\n gbc.weightx = 1.0;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n RentalTab.add(hertzBostonButton, gbc);\n ExcursionsTab = new JPanel();\n ExcursionsTab.setLayout(new GridBagLayout());\n ExcursionsTab.setBackground(new Color(-2171407));\n SelectionTabs.addTab(\"Excursions\", ExcursionsTab);\n ActivityFoodie = new JPanel();\n ActivityFoodie.setLayout(new GridBagLayout());\n ActivityFoodie.setBackground(new Color(-2171407));\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.anchor = GridBagConstraints.WEST;\n ExcursionsTab.add(ActivityFoodie, gbc);\n ActivityFoodie.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), \"Foodie Package\", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.TOP, null, null));\n FoodieButton = new JButton();\n FoodieButton.setText(\"Select\");\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 0;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n ActivityFoodie.add(FoodieButton, gbc);\n FoodiePic = new JLabel();\n FoodiePic.setIcon(new ImageIcon(getClass().getResource(\"/FOODIE.png\")));\n FoodiePic.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.weighty = 1.0;\n ActivityFoodie.add(FoodiePic, gbc);\n ActivityHistory = new JPanel();\n ActivityHistory.setLayout(new GridBagLayout());\n ActivityHistory.setBackground(new Color(-2171407));\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 3;\n gbc.gridwidth = 11;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.anchor = GridBagConstraints.WEST;\n ExcursionsTab.add(ActivityHistory, gbc);\n ActivityHistory.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), \"History Package\", TitledBorder.LEFT, TitledBorder.TOP, this.$$$getFont$$$(null, -1, -1, ActivityHistory.getFont()), null));\n HistoryButton = new JButton();\n HistoryButton.setText(\"Select\");\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 0;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n ActivityHistory.add(HistoryButton, gbc);\n HistoryPic = new JLabel();\n HistoryPic.setIcon(new ImageIcon(getClass().getResource(\"/history.png\")));\n HistoryPic.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.weighty = 1.0;\n gbc.anchor = GridBagConstraints.WEST;\n ActivityHistory.add(HistoryPic, gbc);\n ActivitySpa = new JPanel();\n ActivitySpa.setLayout(new GridBagLayout());\n ActivitySpa.setBackground(new Color(-2171407));\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 2;\n gbc.gridwidth = 11;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.anchor = GridBagConstraints.WEST;\n ExcursionsTab.add(ActivitySpa, gbc);\n ActivitySpa.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), \"Spa Package\", TitledBorder.LEFT, TitledBorder.TOP, null, null));\n SpaButton = new JButton();\n SpaButton.setText(\"Select\");\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 0;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n ActivitySpa.add(SpaButton, gbc);\n SpaPic = new JLabel();\n SpaPic.setIcon(new ImageIcon(getClass().getResource(\"/Spa.png\")));\n SpaPic.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.weighty = 1.0;\n gbc.anchor = GridBagConstraints.WEST;\n ActivitySpa.add(SpaPic, gbc);\n ActivityNature = new JPanel();\n ActivityNature.setLayout(new GridBagLayout());\n ActivityNature.setBackground(new Color(-2171407));\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 1;\n gbc.gridwidth = 3;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.anchor = GridBagConstraints.WEST;\n ExcursionsTab.add(ActivityNature, gbc);\n ActivityNature.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), \"Nature Package\", TitledBorder.LEFT, TitledBorder.TOP, null, null));\n NatureButton = new JButton();\n NatureButton.setText(\"Select\");\n gbc = new GridBagConstraints();\n gbc.gridx = 1;\n gbc.gridy = 0;\n gbc.weightx = 1.0;\n gbc.weighty = 1.0;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n ActivityNature.add(NatureButton, gbc);\n NaturePic = new JLabel();\n NaturePic.setIcon(new ImageIcon(getClass().getResource(\"/nature.jpg\")));\n NaturePic.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.weighty = 1.0;\n gbc.anchor = GridBagConstraints.WEST;\n ActivityNature.add(NaturePic, gbc);\n SummaryTab = new JPanel();\n SummaryTab.setLayout(new GridBagLayout());\n SummaryTab.setBackground(new Color(-2171407));\n SelectionTabs.addTab(\"Selection Summary\", SummaryTab);\n SummaryDestinationField = new JTextArea();\n SummaryDestinationField.setBackground(new Color(-2171407));\n SummaryDestinationField.setOpaque(true);\n SummaryDestinationField.setPreferredSize(new Dimension(500, 100));\n SummaryDestinationField.setText(\"\");\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.fill = GridBagConstraints.VERTICAL;\n SummaryTab.add(SummaryDestinationField, gbc);\n SummaryHotelField = new JTextArea();\n SummaryHotelField.setBackground(new Color(-2171407));\n SummaryHotelField.setPreferredSize(new Dimension(500, 100));\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 1;\n gbc.anchor = GridBagConstraints.WEST;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n SummaryTab.add(SummaryHotelField, gbc);\n SummaryCarField = new JTextArea();\n SummaryCarField.setBackground(new Color(-2171407));\n SummaryCarField.setPreferredSize(new Dimension(500, 100));\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 2;\n gbc.anchor = GridBagConstraints.WEST;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n SummaryTab.add(SummaryCarField, gbc);\n SummaryExcursionsField = new JTextArea();\n SummaryExcursionsField.setBackground(new Color(-2171407));\n SummaryExcursionsField.setPreferredSize(new Dimension(500, 100));\n gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.gridy = 3;\n gbc.anchor = GridBagConstraints.WEST;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n SummaryTab.add(SummaryExcursionsField, gbc);\n }", "private void initGUI(Car car){\n onDo1 = new JButton(\"reqData()\");\n onDo2 = new JButton(\"dataRevieved\");\n onDo3 = new JButton(\"Timer\");\n onDo4 = new JButton(\"CheckSum = FALSE\");\n l1 = new JTextArea(\"New Text\");\n // Declare the split pane and panels\n splitPane = new JSplitPane();\n subPanel1 = new JPanel(new GridBagLayout());\n subPanel2 = new JPanel(new GridBagLayout());\n \n splitFrame(); // Fuction to split the frame vertically into two panes\n addComponents(); // Function adds the components into the grids in the panes\n addListeners(car); // Function adds listeners to the button elements\n \n setLocationRelativeTo(null); // Not sure what this one does\n pack(); // Pack to ensure that elements are placed before the frame is visible\n \n setVisible(true); // Show the JFrame\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// Set the close behavor\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n clientPane = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jPanel1 = new javax.swing.JPanel();\n devNameTF = new javax.swing.JTextField();\n jLabel4 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n desTA = new javax.swing.JTextArea();\n jLabel5 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n house_typeTF = new javax.swing.JTextField();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n idCB = new javax.swing.JComboBox();\n jLabel10 = new javax.swing.JLabel();\n subB = new javax.swing.JButton();\n exitB = new javax.swing.JButton();\n cB = new javax.swing.JButton();\n stateCB = new javax.swing.JComboBox();\n lgaCB = new javax.swing.JComboBox();\n jLabel3 = new javax.swing.JLabel();\n jScrollPane3 = new javax.swing.JScrollPane();\n locTA = new javax.swing.JTextArea();\n subB1 = new javax.swing.JButton();\n jLabel6 = new javax.swing.JLabel();\n jScrollPane4 = new javax.swing.JScrollPane();\n addTA = new javax.swing.JTextArea();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n jLabel1.setFont(new java.awt.Font(\"Bookman Old Style\", 1, 24)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(0, 51, 153));\n jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel1.setText(\"DEVICE INFORMATION FORM VIEW\");\n\n jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), \"Fill in Device/Equipment Information\", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font(\"Agency FB\", 1, 14), new java.awt.Color(0, 51, 153))); // NOI18N\n\n devNameTF.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseExited(java.awt.event.MouseEvent evt) {\n devNameTFMouseExited(evt);\n }\n });\n devNameTF.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n devNameTFActionPerformed(evt);\n }\n });\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel4.setForeground(new java.awt.Color(0, 51, 102));\n jLabel4.setText(\"Name\");\n\n desTA.setColumns(20);\n desTA.setRows(5);\n desTA.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseExited(java.awt.event.MouseEvent evt) {\n desTAMouseExited(evt);\n }\n });\n jScrollPane1.setViewportView(desTA);\n\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel5.setForeground(new java.awt.Color(0, 51, 102));\n jLabel5.setText(\"Location(In the House):\");\n\n jLabel7.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel7.setForeground(new java.awt.Color(0, 51, 102));\n jLabel7.setText(\"Type of House:\");\n\n jLabel8.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel8.setForeground(new java.awt.Color(0, 51, 102));\n jLabel8.setText(\"LGA:\");\n\n jLabel9.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel9.setForeground(new java.awt.Color(0, 51, 102));\n jLabel9.setText(\"State:\");\n\n idCB.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n idCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Choose-one\", \"SNOS1\", \"SNOS2\" }));\n idCB.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n idCBItemStateChanged(evt);\n }\n });\n\n jLabel10.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel10.setForeground(new java.awt.Color(0, 51, 102));\n jLabel10.setText(\"Identity:\");\n\n subB.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n subB.setForeground(new java.awt.Color(0, 0, 153));\n subB.setText(\"SUBMIT\");\n subB.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, new java.awt.Color(153, 153, 255), null));\n subB.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n subBActionPerformed(evt);\n }\n });\n\n exitB.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n exitB.setForeground(new java.awt.Color(0, 0, 153));\n exitB.setText(\"Quit\");\n exitB.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, new java.awt.Color(153, 153, 255), null));\n exitB.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n exitBActionPerformed(evt);\n }\n });\n\n cB.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n cB.setForeground(new java.awt.Color(0, 0, 153));\n cB.setText(\"Clear\");\n cB.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, new java.awt.Color(153, 153, 255), null));\n cB.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n cBActionPerformed(evt);\n }\n });\n\n stateCB.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n stateCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Choose-one\", \"Anambra State\", \"Akwa Ibom State\", \"Adamawa State\", \"Abia State\", \"Bauchi State\", \"Bayelsa State\", \"Benue State\", \"Borno State\", \"Cross River State\", \"Delta State\", \"Ebonyi State\", \"Edo State\", \"Enugu State\", \"Ekiti State\", \"Gombe State\", \"Imo State\", \"Jigawa State\", \"Kaduna State\", \"Kano State\", \"Katsina State\", \"Kebbi State\", \"Kogi State\", \"Kwara State\", \"Lagos State\", \"Nasarawa State\", \"Niger State\", \"Ogun State\", \"Ondo State\", \"Osun State\", \"Oyo State\", \"Plateau State\", \"Rivers State\", \"Sokoto State\", \"Taraba State\", \"Yobe State\", \"Zamfara State\" }));\n stateCB.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n stateCBActionPerformed(evt);\n }\n });\n\n lgaCB.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n lgaCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Choose-one\" }));\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel3.setForeground(new java.awt.Color(0, 51, 102));\n jLabel3.setText(\"Description\");\n\n locTA.setColumns(20);\n locTA.setRows(5);\n locTA.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseExited(java.awt.event.MouseEvent evt) {\n locTAMouseExited(evt);\n }\n });\n jScrollPane3.setViewportView(locTA);\n\n subB1.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n subB1.setForeground(new java.awt.Color(0, 0, 153));\n subB1.setText(\"NEXT >>\");\n subB1.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, new java.awt.Color(153, 153, 255), null));\n subB1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n subB1ActionPerformed(evt);\n }\n });\n\n jLabel6.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel6.setForeground(new java.awt.Color(0, 51, 102));\n jLabel6.setText(\"Address:\");\n\n addTA.setColumns(20);\n addTA.setRows(5);\n addTA.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseExited(java.awt.event.MouseEvent evt) {\n addTAMouseExited(evt);\n }\n });\n jScrollPane4.setViewportView(addTA);\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(devNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(lgaCB, 0, 194, Short.MAX_VALUE)\n .addComponent(idCB, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(house_typeTF, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(stateCB, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(30, 30, 30))))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(41, 41, 41)\n .addComponent(cB, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(exitB, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(subB, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(subB1, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(devNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(31, 31, 31)\n .addComponent(jLabel3)\n .addGap(37, 37, 37)\n .addComponent(jLabel5)\n .addGap(42, 42, 42)\n .addComponent(jLabel6))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(12, 12, 12)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel7)\n .addComponent(house_typeTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(47, 47, 47)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel9)\n .addComponent(stateCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(40, 40, 40)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel8)\n .addComponent(lgaCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel10)\n .addComponent(idCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(86, 86, 86)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(subB)\n .addComponent(exitB)\n .addComponent(cB)\n .addComponent(subB1))\n .addGap(35, 35, 35))\n );\n\n javax.swing.GroupLayout clientPaneLayout = new javax.swing.GroupLayout(clientPane);\n clientPane.setLayout(clientPaneLayout);\n clientPaneLayout.setHorizontalGroup(\n clientPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(clientPaneLayout.createSequentialGroup()\n .addGap(69, 69, 69)\n .addGroup(clientPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 492, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(99, Short.MAX_VALUE))\n );\n clientPaneLayout.setVerticalGroup(\n clientPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(clientPaneLayout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(52, 52, 52))\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(clientPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(clientPane, javax.swing.GroupLayout.DEFAULT_SIZE, 691, Short.MAX_VALUE)\n );\n\n pack();\n }", "private void initUI() {\r\n\t\tthis.verticalLayout = new XdevVerticalLayout();\r\n\t\tthis.verticalLayout2 = new XdevVerticalLayout();\r\n\t\r\n\t\tthis.setSpacing(false);\r\n\t\tthis.setMargin(new MarginInfo(false));\r\n\t\tthis.verticalLayout.setSpacing(false);\r\n\t\tthis.verticalLayout.setMargin(new MarginInfo(false));\r\n\t\tthis.verticalLayout2.setMargin(new MarginInfo(false));\r\n\t\r\n\t\tthis.verticalLayout2.setSizeFull();\r\n\t\tthis.verticalLayout.addComponent(this.verticalLayout2);\r\n\t\tthis.verticalLayout.setComponentAlignment(this.verticalLayout2, Alignment.MIDDLE_CENTER);\r\n\t\tthis.verticalLayout.setExpandRatio(this.verticalLayout2, 20.0F);\r\n\t\tthis.verticalLayout.setSizeFull();\r\n\t\tthis.addComponent(this.verticalLayout);\r\n\t\tthis.setComponentAlignment(this.verticalLayout, Alignment.MIDDLE_CENTER);\r\n\t\tthis.setExpandRatio(this.verticalLayout, 10.0F);\r\n\t\tthis.setSizeFull();\r\n\t\r\n\t\tthis.addContextClickListener(event -> this.this_contextClick(event));\r\n\t}", "public VehicleDlg(java.awt.Frame parent, boolean modal) {\n super(parent, modal);\n initComponents();\n\n for (Vehicle.VehicleType value : Vehicle.VehicleType.values()) {\n cmbType.addItem(value);\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel5 = new javax.swing.JLabel();\n jLabel1 = new javax.swing.JLabel();\n nameJTextfield = new javax.swing.JTextField();\n backJButton = new javax.swing.JButton();\n addAdvertiserJButton = new javax.swing.JButton();\n\n setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jLabel5.setText(\"NEW ADVERTISER\");\n add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(221, 27, 230, 30));\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n jLabel1.setText(\"Name\");\n add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 150, 100, 30));\n\n nameJTextfield.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n add(nameJTextfield, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 150, 160, 30));\n\n backJButton.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n backJButton.setText(\"<< Back\");\n backJButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n backJButtonActionPerformed(evt);\n }\n });\n add(backJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 303, 110, 30));\n\n addAdvertiserJButton.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n addAdvertiserJButton.setText(\"Add Advertiser >>\");\n addAdvertiserJButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n addAdvertiserJButtonActionPerformed(evt);\n }\n });\n add(addAdvertiserJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 300, 180, 30));\n }", "public static void createUI (JTextField fName, JTextField lName, JTextField vDesc, JTextField cLoc,\r\n JTextField dLoc, JTextField pNum, JPanel panel) {\n panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));\r\n panel.setAlignmentX(Component.LEFT_ALIGNMENT);\r\n panel.add(new JLabel(\"First Name:\"));\r\n panel.add(fName);\r\n panel.add(Box.createHorizontalStrut(15)); // a spacer\r\n panel.add(new JLabel(\"Last Name:\"));\r\n panel.add(lName);\r\n panel.add(new JLabel(\"Vehicle Description:\"));\r\n panel.add(vDesc);\r\n panel.add(new JLabel(\"Pick Up Location\"));\r\n panel.add(cLoc);\r\n panel.add(new JLabel(\"Drop Off Location\"));\r\n panel.add(dLoc);\r\n panel.add(new JLabel(\"Phone Number\"));\r\n panel.add(pNum);\r\n }", "private void setup(){\n\t\t\n\t\t//set the dialog title\n\t\tsetText(LocaleText.get(\"createSPSSFileDialog\"));\n\t\t//create the status text\n\t\tstatusLabel = new Label();\n\t\t\n\t\t//create the buttons\n\t\tButton btnCancel = new Button(LocaleText.get(\"close\"), new ClickHandler(){\n\t\t\tpublic void onClick(ClickEvent event){\n\t\t\t\tcancel();\n\t\t\t}\n\t\t});\n\t\t\n\t\tButton btnCreate = new Button(LocaleText.get(\"createSPSSFileDialog\"), new ClickHandler(){\n\t\t\tpublic void onClick(ClickEvent event){\n\t\t\t\tcreateSPSSFile();\n\t\t\t}\n\t\t});\n\t\t\n\t\tButton btnSave = new Button(LocaleText.get(\"save\"), new ClickHandler(){\n\t\t\tpublic void onClick(ClickEvent event){\n\t\t\t\tsave();\n\t\t\t}\n\t\t});\n\t\t\n\t\t\t\t\n\t\t\n\t\t//update the languages in the form.\n\t\tFormHandler.updateLanguage(Context.getLocale(), Context.getLocale(), form);\n\t\t//add the languages to the language drop down\n\t\tfor(Locale l : form.getLocales())\n\t\t{\n\t\t\tlistBoxLanguages.addItem(l.getName());\n\t\t}\n\t\t\n\t\t//setup the text area\n\t\tspssText.setCharacterWidth(30);\n\t\tspssText.setPixelSize(300, 300);\n\t\t\n\t\t\n\t\tFlexCellFormatter formatter = table.getFlexCellFormatter();\n\t\t\n\t\t//now add stuff to the UI\n\t\tint row = 0;\n\t\ttable.setWidget(row, 0, new Label(LocaleText.get(\"language\")));\n\t\ttable.setWidget(row, 1, listBoxLanguages);\n\t\trow++;\n\t\ttable.setWidget(row, 0, spssText);\n\t\tformatter.setColSpan(row, 0, 2);\n\t\tformatter.setHeight(row, 0, \"300px\");\n\t\tformatter.setWidth(row, 0, \"300px\");\n\t\trow++;\n\t\ttable.setWidget(row, 0, statusLabel);\n\t\trow++;\n\t\ttable.setWidget(row, 0, btnCreate);\n\t\trow++;\n\t\ttable.setWidget(row, 0, btnSave);\n\t\ttable.setWidget(row, 1, btnCancel);\n\t\trow++;\n\t\ttable.setWidget(row, 0, appletHtml);\n\t\t\n\t\t\t\t\t\t\n\t\t//some random UI stuff to make everything nice and neat\n\t\tVerticalPanel panel = new VerticalPanel();\n\t\tFormUtil.maximizeWidget(panel);\n\t\tpanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);\n\t\tpanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);\n\t\tpanel.add(table);\n\t\t\n\t\tsetWidget(panel);\n\t\t\n\t\tsetWidth(\"200px\");\t\t\n\t}", "private void initializeComponent() throws Exception {\n this.label1 = new System.Windows.Forms.Label();\n this.groupBox1 = new System.Windows.Forms.GroupBox();\n this.radioPurchased = new System.Windows.Forms.RadioButton();\n this.radioSold = new System.Windows.Forms.RadioButton();\n this.radioAll = new System.Windows.Forms.RadioButton();\n this.textSnDesc = new System.Windows.Forms.TextBox();\n this.label7 = new System.Windows.Forms.Label();\n this.butRefresh = new OpenDental.UI.Button();\n this.textDateStart = new OpenDental.ValidDate();\n this.textDateEnd = new OpenDental.ValidDate();\n this.butPrint = new OpenDental.UI.Button();\n this.butAdd = new OpenDental.UI.Button();\n this.gridMain = new OpenDental.UI.ODGrid();\n this.butClose = new OpenDental.UI.Button();\n this.groupBox1.SuspendLayout();\n this.SuspendLayout();\n //\n // label1\n //\n this.label1.Location = new System.Drawing.Point(12, 6);\n this.label1.Name = \"label1\";\n this.label1.Size = new System.Drawing.Size(170, 39);\n this.label1.TabIndex = 7;\n this.label1.Text = \"This list tracks equipment for payment of property taxes.\";\n this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;\n //\n // groupBox1\n //\n this.groupBox1.Controls.Add(this.butRefresh);\n this.groupBox1.Controls.Add(this.textDateStart);\n this.groupBox1.Controls.Add(this.textDateEnd);\n this.groupBox1.Location = new System.Drawing.Point(424, 3);\n this.groupBox1.Name = \"groupBox1\";\n this.groupBox1.Size = new System.Drawing.Size(257, 42);\n this.groupBox1.TabIndex = 23;\n this.groupBox1.TabStop = false;\n this.groupBox1.Text = \"Date Range\";\n //\n // radioPurchased\n //\n this.radioPurchased.Location = new System.Drawing.Point(695, 3);\n this.radioPurchased.Name = \"radioPurchased\";\n this.radioPurchased.Size = new System.Drawing.Size(93, 18);\n this.radioPurchased.TabIndex = 23;\n this.radioPurchased.Text = \"Purchased\";\n this.radioPurchased.UseVisualStyleBackColor = true;\n this.radioPurchased.Click += new System.EventHandler(this.radioPurchased_Click);\n //\n // radioSold\n //\n this.radioSold.Location = new System.Drawing.Point(695, 18);\n this.radioSold.Name = \"radioSold\";\n this.radioSold.Size = new System.Drawing.Size(93, 18);\n this.radioSold.TabIndex = 24;\n this.radioSold.Text = \"Sold\";\n this.radioSold.UseVisualStyleBackColor = true;\n this.radioSold.Click += new System.EventHandler(this.radioSold_Click);\n //\n // radioAll\n //\n this.radioAll.Checked = true;\n this.radioAll.Location = new System.Drawing.Point(695, 33);\n this.radioAll.Name = \"radioAll\";\n this.radioAll.Size = new System.Drawing.Size(93, 18);\n this.radioAll.TabIndex = 25;\n this.radioAll.TabStop = true;\n this.radioAll.Text = \"All\";\n this.radioAll.UseVisualStyleBackColor = true;\n this.radioAll.Click += new System.EventHandler(this.radioAll_Click);\n //\n // textSnDesc\n //\n this.textSnDesc.Location = new System.Drawing.Point(285, 19);\n this.textSnDesc.Name = \"textSnDesc\";\n this.textSnDesc.Size = new System.Drawing.Size(133, 20);\n this.textSnDesc.TabIndex = 39;\n this.textSnDesc.TextChanged += new System.EventHandler(this.textSn_TextChanged);\n //\n // label7\n //\n this.label7.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;\n this.label7.Location = new System.Drawing.Point(174, 19);\n this.label7.Name = \"label7\";\n this.label7.Size = new System.Drawing.Size(105, 20);\n this.label7.TabIndex = 38;\n this.label7.Text = \"SN/Descipt/Loc\";\n this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;\n //\n // butRefresh\n //\n this.butRefresh.setAdjustImageLocation(new System.Drawing.Point(0, 0));\n this.butRefresh.setAutosize(true);\n this.butRefresh.setBtnShape(OpenDental.UI.enumType.BtnShape.Rectangle);\n this.butRefresh.setBtnStyle(OpenDental.UI.enumType.XPStyle.Silver);\n this.butRefresh.setCornerRadius(4F);\n this.butRefresh.Location = new System.Drawing.Point(172, 12);\n this.butRefresh.Name = \"butRefresh\";\n this.butRefresh.Size = new System.Drawing.Size(78, 24);\n this.butRefresh.TabIndex = 23;\n this.butRefresh.Text = \"Refresh\";\n this.butRefresh.Click += new System.EventHandler(this.butRefresh_Click);\n //\n // textDateStart\n //\n this.textDateStart.Location = new System.Drawing.Point(6, 16);\n this.textDateStart.Name = \"textDateStart\";\n this.textDateStart.Size = new System.Drawing.Size(77, 20);\n this.textDateStart.TabIndex = 21;\n //\n // textDateEnd\n //\n this.textDateEnd.Location = new System.Drawing.Point(89, 15);\n this.textDateEnd.Name = \"textDateEnd\";\n this.textDateEnd.Size = new System.Drawing.Size(77, 20);\n this.textDateEnd.TabIndex = 22;\n //\n // butPrint\n //\n this.butPrint.setAdjustImageLocation(new System.Drawing.Point(0, 0));\n this.butPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));\n this.butPrint.setAutosize(true);\n this.butPrint.setBtnShape(OpenDental.UI.enumType.BtnShape.Rectangle);\n this.butPrint.setBtnStyle(OpenDental.UI.enumType.XPStyle.Silver);\n this.butPrint.setCornerRadius(4F);\n this.butPrint.Image = Resources.getbutPrint();\n this.butPrint.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;\n this.butPrint.Location = new System.Drawing.Point(385, 550);\n this.butPrint.Name = \"butPrint\";\n this.butPrint.Size = new System.Drawing.Size(75, 24);\n this.butPrint.TabIndex = 8;\n this.butPrint.Text = \"Print\";\n this.butPrint.Click += new System.EventHandler(this.butPrint_Click);\n //\n // butAdd\n //\n this.butAdd.setAdjustImageLocation(new System.Drawing.Point(0, 0));\n this.butAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));\n this.butAdd.setAutosize(true);\n this.butAdd.setBtnShape(OpenDental.UI.enumType.BtnShape.Rectangle);\n this.butAdd.setBtnStyle(OpenDental.UI.enumType.XPStyle.Silver);\n this.butAdd.setCornerRadius(4F);\n this.butAdd.Image = Resources.getAdd();\n this.butAdd.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;\n this.butAdd.Location = new System.Drawing.Point(141, 550);\n this.butAdd.Name = \"butAdd\";\n this.butAdd.Size = new System.Drawing.Size(75, 24);\n this.butAdd.TabIndex = 6;\n this.butAdd.Text = \"Add\";\n this.butAdd.Click += new System.EventHandler(this.butAdd_Click);\n //\n // gridMain\n //\n this.gridMain.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));\n this.gridMain.setHScrollVisible(false);\n this.gridMain.Location = new System.Drawing.Point(12, 51);\n this.gridMain.Name = \"gridMain\";\n this.gridMain.setScrollValue(0);\n this.gridMain.Size = new System.Drawing.Size(777, 490);\n this.gridMain.TabIndex = 5;\n this.gridMain.setTitle(\"Equipment\");\n this.gridMain.setTranslationName(null);\n this.gridMain.CellDoubleClick = __MultiODGridClickEventHandler.combine(this.gridMain.CellDoubleClick,new OpenDental.UI.ODGridClickEventHandler() \n { \n public System.Void invoke(System.Object sender, OpenDental.UI.ODGridClickEventArgs e) throws Exception {\n this.gridMain_CellDoubleClick(sender, e);\n }\n\n public List<OpenDental.UI.ODGridClickEventHandler> getInvocationList() throws Exception {\n List<OpenDental.UI.ODGridClickEventHandler> ret = new ArrayList<OpenDental.UI.ODGridClickEventHandler>();\n ret.add(this);\n return ret;\n }\n \n });\n //\n // butClose\n //\n this.butClose.setAdjustImageLocation(new System.Drawing.Point(0, 0));\n this.butClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));\n this.butClose.setAutosize(true);\n this.butClose.setBtnShape(OpenDental.UI.enumType.BtnShape.Rectangle);\n this.butClose.setBtnStyle(OpenDental.UI.enumType.XPStyle.Silver);\n this.butClose.setCornerRadius(4F);\n this.butClose.Location = new System.Drawing.Point(714, 550);\n this.butClose.Name = \"butClose\";\n this.butClose.Size = new System.Drawing.Size(75, 24);\n this.butClose.TabIndex = 2;\n this.butClose.Text = \"&Close\";\n this.butClose.Click += new System.EventHandler(this.butClose_Click);\n //\n // FormEquipment\n //\n this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;\n this.ClientSize = new System.Drawing.Size(801, 585);\n this.Controls.Add(this.textSnDesc);\n this.Controls.Add(this.label7);\n this.Controls.Add(this.radioAll);\n this.Controls.Add(this.groupBox1);\n this.Controls.Add(this.radioSold);\n this.Controls.Add(this.radioPurchased);\n this.Controls.Add(this.butPrint);\n this.Controls.Add(this.label1);\n this.Controls.Add(this.butAdd);\n this.Controls.Add(this.gridMain);\n this.Controls.Add(this.butClose);\n this.Name = \"FormEquipment\";\n this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;\n this.Text = \"Equipment\";\n this.Load += new System.EventHandler(this.FormEquipment_Load);\n this.groupBox1.ResumeLayout(false);\n this.groupBox1.PerformLayout();\n this.ResumeLayout(false);\n this.PerformLayout();\n }", "private void initGUI() {\r\n\t\tsetTitle(\"Clients\");\r\n\t\tsetPreferredSize(new Dimension(800, 600));\r\n\t\t\r\n\t\t// buttons\r\n\t\tJButton btnFind = new JButton(\"Find\");\r\n\t\tbtnFind.addActionListener(new ActionListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tcontroller.filter();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tJButton btnAddClient = new JButton(\"Add Client\"); \r\n\t\tbtnAddClient.addActionListener(new ActionListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tcontroller.addClient();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tJButton btnRefresh = new JButton(\"Refresh\");\r\n\t\tbtnRefresh.addActionListener(new ActionListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tcontroller.refresh();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t// toolbar\r\n\t\tlblSession = new JLabel();\r\n\t\tlblSession.setHorizontalAlignment(SwingConstants.RIGHT);\r\n\t\t\r\n\t\tJToolBar toolbar = new JToolBar();\r\n\t\ttoolbar.add(btnFind);\r\n\t\ttoolbar.add(btnAddClient);\r\n\t\ttoolbar.add(btnRefresh);\r\n\t\ttoolbar.add(Box.createHorizontalGlue());\r\n\t\ttoolbar.add(lblSession);\r\n\t\tadd(toolbar, BorderLayout.NORTH);\r\n\t\t\r\n\t\t// table\r\n\t\ttblInventory = new JTable();\r\n\t\ttblInventory.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r\n\t\t\r\n\t\tadd(new JScrollPane(tblInventory), BorderLayout.CENTER);\r\n\t\t\r\n\t\tpack();\r\n\t\tsetLocationRelativeTo(null);\r\n\t}", "public CustomerAddInterFrm() {\r\n\t\tinitComponents();\r\n\t\tthis.setLocation(200, 100);\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, dimension.width, dimension.height);\n\t\tframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\tframe.setVisible(true);\n\t\t\n\t\tJLabel inventoryLabel = new JLabel(\"New Inventory\");\n\t\tinventoryLabel.setForeground(Color.BLACK);\n\t\tinventoryLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tinventoryLabel.setBounds(136, 11, 126, 20);\n\t\tframe.getContentPane().add(inventoryLabel);\n\t\t\n\t\ticfsField = new JTextField();\n\t\ticfsField.setColumns(10);\n\t\ticfsField.setBounds(10, 55, 150, 20);\n\t\tframe.getContentPane().add(icfsField);\n\t\t\n\t\tJLabel icfsLabel = new JLabel(\"Item Cost From Supplier\");\n\t\ticfsLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\ticfsLabel.setBounds(10, 38, 140, 14);\n\t\tframe.getContentPane().add(icfsLabel);\n\t\t\n\t\tJLabel icfsAsteriskLabel = new JLabel(\"*\");\n\t\ticfsAsteriskLabel.setForeground(Color.RED);\n\t\ticfsAsteriskLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\ticfsAsteriskLabel.setBounds(150, 38, 18, 14);\n\t\tframe.getContentPane().add(icfsAsteriskLabel);\n\t\t\n\t\tJLabel legendAsteriskLabel = new JLabel(\"*\");\n\t\tlegendAsteriskLabel.setForeground(Color.RED);\n\t\tlegendAsteriskLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\tlegendAsteriskLabel.setBounds(10, 337, 7, 14);\n\t\tframe.getContentPane().add(legendAsteriskLabel);\n\t\t\n\t\tJLabel legendLabel = new JLabel(\"Must be filled\");\n\t\tlegendLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\tlegendLabel.setBounds(20, 337, 140, 14);\n\t\tframe.getContentPane().add(legendLabel);\n\t\t\n\t\tJLabel ictcLabel = new JLabel(\"Item Cost To Customer\");\n\t\tictcLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\tictcLabel.setBounds(10, 86, 131, 14);\n\t\tframe.getContentPane().add(ictcLabel);\n\t\t\n\t\tictcField = new JTextField();\n\t\tictcField.setColumns(10);\n\t\tictcField.setBounds(10, 103, 150, 20);\n\t\tframe.getContentPane().add(ictcField);\n\t\t\n\t\tJLabel ictcAsteriskLabel = new JLabel(\"*\");\n\t\tictcAsteriskLabel.setForeground(Color.RED);\n\t\tictcAsteriskLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\tictcAsteriskLabel.setBounds(144, 86, 18, 14);\n\t\tframe.getContentPane().add(ictcAsteriskLabel);\n\t\t\n\t\tJLabel itemDescriptionLabel = new JLabel(\"Item Description\");\n\t\titemDescriptionLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\titemDescriptionLabel.setBounds(10, 134, 95, 14);\n\t\tframe.getContentPane().add(itemDescriptionLabel);\n\t\t\n\t\titemDescriptionField = new JTextField();\n\t\titemDescriptionField.setColumns(10);\n\t\titemDescriptionField.setBounds(10, 151, 150, 20);\n\t\tframe.getContentPane().add(itemDescriptionField);\n\t\t\n\t\tJButton createButton = new JButton(\"Create\");\n\t\tcreateButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent event) {\n\t\t\t\tif(!(\t!isFloat(icfsField.getText()) ||\n\t\t\t\t\t\ticfsField.getText().equals(\"\") || \n\t\t\t\t\t\t!isFloat(ictcField.getText()) ||\n\t\t\t\t\t\tictcField.getText().equals(\"\") ||\n\t\t\t\t\t\titemDescriptionField.getText().equals(\"\") ||\n\t\t\t\t\t\t!isInteger(itemInsCovField.getText()) ||\n\t\t\t\t\t\titemInsCovField.getText().equals(\"\") ||\n\t\t\t\t\t\t!isInteger(itemPresField.getText()) ||\n\t\t\t\t\t\titemPresField.getText().equals(\"\") ||\n\t\t\t\t\t\t!isInteger(numberField.getText()) ||\n\t\t\t\t\t\tnumberField.getText().equals(\"\") \t\n\t\t\t\t)){\t\t\t\t\t\n\t\t\t\t\tint ins = Integer.parseInt(itemInsCovField.getText());\n\t\t\t\t\tint pers = Integer.parseInt(itemPresField.getText());\n\t\t\t\t\tif((ins==0||ins==1)&&(pers==0||pers==1)){\n\t\t\t\t\t\tinsert(\tFloat.parseFloat(icfsField.getText()), \n\t\t\t\t\t\t\t\tFloat.parseFloat(ictcField.getText()),\n\t\t\t\t\t\t\t\titemDescriptionField.getText(),\n\t\t\t\t\t\t\t\tInteger.parseInt(itemInsCovField.getText()), \n\t\t\t\t\t\t\t\tInteger.parseInt(itemPresField.getText()), \t\n\t\t\t\t\t\t\t\tInteger.parseInt(numberField.getText()), \n\t\t\t\t\t\t\t\ttrue);\n\t\t\t\t\t\tframe.dispose();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tcreateButton.setForeground(Color.BLACK);\n\t\tcreateButton.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\tcreateButton.setBounds(170, 328, 89, 23);\n\t\tframe.getContentPane().add(createButton);\n\t\t\n\t\tJLabel itemInsCovLabel = new JLabel(\"Item Insurance Coverage (0 = No, 1 = Yes)\");\n\t\titemInsCovLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\titemInsCovLabel.setBounds(10, 182, 242, 14);\n\t\tframe.getContentPane().add(itemInsCovLabel);\n\t\t\n\t\tJLabel itemInsCovAsteriskLabel = new JLabel(\"*\");\n\t\titemInsCovAsteriskLabel.setForeground(Color.RED);\n\t\titemInsCovAsteriskLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\titemInsCovAsteriskLabel.setBounds(255, 182, 18, 14);\n\t\tframe.getContentPane().add(itemInsCovAsteriskLabel);\n\t\t\n\t\titemInsCovField = new JTextField();\n\t\titemInsCovField.setColumns(10);\n\t\titemInsCovField.setBounds(10, 199, 150, 20);\n\t\tframe.getContentPane().add(itemInsCovField);\n\t\t\n\t\tJLabel itemPresLabel = new JLabel(\"Item Prescription Requried (0 = No, 1 = Yes)\");\n\t\titemPresLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\titemPresLabel.setBounds(10, 230, 252, 14);\n\t\tframe.getContentPane().add(itemPresLabel);\n\t\t\n\t\tJLabel itemPresAsteriskLabel = new JLabel(\"*\");\n\t\titemPresAsteriskLabel.setForeground(Color.RED);\n\t\titemPresAsteriskLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\titemPresAsteriskLabel.setBounds(263, 230, 18, 14);\n\t\tframe.getContentPane().add(itemPresAsteriskLabel);\n\t\t\n\t\titemPresField = new JTextField();\n\t\titemPresField.setColumns(10);\n\t\titemPresField.setBounds(10, 247, 150, 20);\n\t\tframe.getContentPane().add(itemPresField);\n\t\t\n\t\tJLabel numberLabel = new JLabel(\"Supplier Number\");\n\t\tnumberLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\tnumberLabel.setBounds(10, 278, 93, 14);\n\t\tframe.getContentPane().add(numberLabel);\n\t\t\n\t\tJLabel numberAsteriskLabel = new JLabel(\"*\");\n\t\tnumberAsteriskLabel.setForeground(Color.RED);\n\t\tnumberAsteriskLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\tnumberAsteriskLabel.setBounds(107, 278, 18, 14);\n\t\tframe.getContentPane().add(numberAsteriskLabel);\n\t\t\n\t\tnumberField = new JTextField();\n\t\tnumberField.setColumns(10);\n\t\tnumberField.setBounds(10, 295, 150, 20);\n\t\tframe.getContentPane().add(numberField);\n\t\t\n\t\tJLabel itemDescriptionAsteriskLabel = new JLabel(\"*\");\n\t\titemDescriptionAsteriskLabel.setForeground(Color.RED);\n\t\titemDescriptionAsteriskLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\titemDescriptionAsteriskLabel.setBounds(107, 134, 18, 14);\n\t\tframe.getContentPane().add(itemDescriptionAsteriskLabel);\n\t}", "public SetupBuilderBox() {\n\tsuper();\n\tsetLayout(new BorderLayout());\n\n\tboard = new EditableBoard(this);\n\tboard.init(cols, rows);\n\tgb = new GraphicalBoard(board);\n\tgb.setDim(32);\n\tgb.init();\n\ttsp = new ToolSelectPanel(this);\n\tsap = new SetupSavePanel(this);\n\tssp = new SetupSettingsPanel(this);\n\n\tJPanel center = new JPanel();\n\tcenter.setLayout(new BorderLayout());\n\tcenter.add(gb, BorderLayout.CENTER);\n\tcenter.add(tsp, BorderLayout.SOUTH);\n\n\tadd(sap, BorderLayout.NORTH);\n\tadd(center, BorderLayout.CENTER);\n\tadd(ssp, BorderLayout.EAST);\n\n }", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setResizable(false);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tJLabel lblRangos = new JLabel(\"Opciones de Rangos\");\n\t\tlblRangos.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tlblRangos.setForeground(Color.BLACK);\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"Rango Inicualnbv x \");\n\t\t\n\t\tJLabel lblNewLabel_1 = new JLabel(\"New label\");\n\t\t\n\t\tJLabel lblNewLabel_2 = new JLabel(\"New label\");\n\t\t\n\t\ttextField = new JTextField();\n\t\ttextField.setColumns(10);\n\t\t\n\t\tJButton btnNewButton = new JButton(\"New button\");\n\t\t\n\t\tJButton btnNewButton_1 = new JButton(\"New button\");\n\t\t\n\t\ttextField_1 = new JTextField();\n\t\ttextField_1.setColumns(10);\n\t\t\n\t\tJSpinner spinner = new JSpinner();\n\t\tGroupLayout groupLayout = new GroupLayout(frame.getContentPane());\n\t\tgroupLayout.setHorizontalGroup(\n\t\t\tgroupLayout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()\n\t\t\t\t\t.addContainerGap(147, Short.MAX_VALUE)\n\t\t\t\t\t.addComponent(lblRangos, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addGap(64))\n\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\n\t\t\t\t\t.addGap(43)\n\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addComponent(lblNewLabel)\n\t\t\t\t\t\t.addComponent(lblNewLabel_2)\n\t\t\t\t\t\t.addComponent(lblNewLabel_1))\n\t\t\t\t\t.addGap(98)\n\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t.addComponent(spinner)\n\t\t\t\t\t\t.addComponent(textField_1, Alignment.TRAILING)\n\t\t\t\t\t\t.addComponent(textField, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE))\n\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\n\t\t\t\t\t.addGap(98)\n\t\t\t\t\t.addComponent(btnNewButton)\n\t\t\t\t\t.addGap(72)\n\t\t\t\t\t.addComponent(btnNewButton_1)\n\t\t\t\t\t.addContainerGap(104, Short.MAX_VALUE))\n\t\t);\n\t\tgroupLayout.setVerticalGroup(\n\t\t\tgroupLayout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\n\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t.addComponent(lblRangos, GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t.addComponent(lblNewLabel)\n\t\t\t\t\t\t.addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t.addGap(28)\n\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t.addComponent(lblNewLabel_1)\n\t\t\t\t\t\t.addComponent(textField_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t.addGap(33)\n\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t.addComponent(lblNewLabel_2)\n\t\t\t\t\t\t.addComponent(spinner, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 32, Short.MAX_VALUE)\n\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t.addComponent(btnNewButton)\n\t\t\t\t\t\t.addComponent(btnNewButton_1))\n\t\t\t\t\t.addGap(28))\n\t\t);\n\t\tframe.getContentPane().setLayout(groupLayout);\n\t}", "public AddBreakdown() {\n initComponents();\n }", "public ElevatorUI() {\n initComponents();\n }", "private void initComponents() {\n\n jButtonGroupTools = new javax.swing.ButtonGroup();\n jButtonGroupFill = new javax.swing.ButtonGroup();\n jSeparator2 = new javax.swing.JSeparator();\n jToolBarTools = new javax.swing.JToolBar();\n jButtonNew = new javax.swing.JButton();\n jButtonOpen = new javax.swing.JButton();\n jButtonSave = new javax.swing.JButton();\n jButtonDuplicate = new javax.swing.JButton();\n jSeparator3 = new javax.swing.JToolBar.Separator();\n jToggleButtonPoint = new javax.swing.JToggleButton();\n jToggleButtonLine = new javax.swing.JToggleButton();\n jToggleButtonRectangle = new javax.swing.JToggleButton();\n jToggleButtonRoundRectangle = new javax.swing.JToggleButton();\n jToggleButtonArc = new javax.swing.JButton();\n jToggleButtonCurve = new javax.swing.JToggleButton();\n jToggleButtonPolyline = new javax.swing.JToggleButton();\n jToggleButtonPolygon = new javax.swing.JToggleButton();\n jToggleButtonEllipse = new javax.swing.JToggleButton();\n jToggleButtonMove = new javax.swing.JToggleButton();\n jToggleButtonText = new javax.swing.JToggleButton();\n jSeparator10 = new javax.swing.JToolBar.Separator();\n jButtonFont = new javax.swing.JButton();\n jSeparator4 = new javax.swing.JToolBar.Separator();\n jButtonColorChooserFront = new UI.ColorChooserButton(Color.BLACK);\n jButtonColorChooserBack = new UI.ColorChooserButton(Color.WHITE);\n jSeparator5 = new javax.swing.JToolBar.Separator();\n jPanelStroke = new UI.StrokeChooserComboBox();\n jSpinnerStroke = new javax.swing.JSpinner();\n jSeparator8 = new javax.swing.JToolBar.Separator();\n jToggleButtonNoFill = new javax.swing.JToggleButton();\n jToggleButtonSolidFill = new javax.swing.JToggleButton();\n jToggleButtonHorizontalFill = new javax.swing.JToggleButton();\n jToggleButtonVerticalFill = new javax.swing.JToggleButton();\n jToggleButtonRadialFill = new javax.swing.JToggleButton();\n jToggleButtonDiagonal1Fill = new javax.swing.JToggleButton();\n jToggleButtonDiagonal2Fill = new javax.swing.JToggleButton();\n jSeparator9 = new javax.swing.JToolBar.Separator();\n jToggleButtonAntialiasing = new javax.swing.JToggleButton();\n jSliderAlpha = new javax.swing.JSlider();\n jSeparator6 = new javax.swing.JToolBar.Separator();\n jToggleButtonRecord = new javax.swing.JToggleButton();\n jLabelRecordTime = new javax.swing.JLabel();\n jSeparator7 = new javax.swing.JToolBar.Separator();\n jButtonWebCam = new javax.swing.JButton();\n jButtonSnapShot = new javax.swing.JButton();\n jPanelCenter = new javax.swing.JPanel();\n jSplitPane1 = new javax.swing.JSplitPane();\n desktop = new javax.swing.JDesktopPane();\n jPanel1 = new javax.swing.JPanel();\n jScrollPane2 = new javax.swing.JScrollPane();\n jListShapes = new javax.swing.JList<String>();\n jPanel2 = new javax.swing.JPanel();\n jButtonMoveUp = new javax.swing.JButton();\n jButtonMoveDown = new javax.swing.JButton();\n jToolBarImage = new javax.swing.JToolBar();\n jPanelImageBrightness = new javax.swing.JPanel();\n jSliderBrightness = new javax.swing.JSlider();\n jPanelImageFilter = new javax.swing.JPanel();\n jComboBoxFilter = new javax.swing.JComboBox<String>();\n jPanelImageContrast = new javax.swing.JPanel();\n jButtonConstrast = new javax.swing.JButton();\n jButtonConstrastBright = new javax.swing.JButton();\n jButtonContrastDark = new javax.swing.JButton();\n jPanelImageOperations = new javax.swing.JPanel();\n jButtonSinus = new javax.swing.JButton();\n jButtonSepia = new javax.swing.JButton();\n jButtonSobel = new javax.swing.JButton();\n jButtonTinted = new javax.swing.JButton();\n jButtonNegative = new javax.swing.JButton();\n jButtonGrayScale = new javax.swing.JButton();\n jButtonRandomBlack = new javax.swing.JButton();\n jPanelImageBinary = new javax.swing.JPanel();\n jButtonBinaryAdd = new javax.swing.JButton();\n jButtonBinarySubstract = new javax.swing.JButton();\n jButtonBinaryProduct = new javax.swing.JButton();\n jSliderBinaryOperations = new javax.swing.JSlider();\n jPanelUmbralization = new javax.swing.JPanel();\n jSliderUmbralization = new javax.swing.JSlider();\n jPanelStatusBar = new javax.swing.JPanel();\n jToolBarImageRotation = new javax.swing.JToolBar();\n jPanelImageRotate = new javax.swing.JPanel();\n jSliderRotate = new javax.swing.JSlider();\n jButtonRotate90 = new javax.swing.JButton();\n jButton180 = new javax.swing.JButton();\n jButtonRotate270 = new javax.swing.JButton();\n jPanelZoom = new javax.swing.JPanel();\n jButtonZoomMinus = new javax.swing.JButton();\n jButtonZoomPlus = new javax.swing.JButton();\n jStatusBarTool = new javax.swing.JLabel();\n jPanelCursorAndColor = new javax.swing.JPanel();\n jStatusBarCursor = new javax.swing.JLabel();\n jStatusBarColor = new javax.swing.JLabel();\n jMenuBar = new javax.swing.JMenuBar();\n jMenuFile = new javax.swing.JMenu();\n jMenuItemNew = new javax.swing.JMenuItem();\n jMenuOpen = new javax.swing.JMenuItem();\n jMenuSave = new javax.swing.JMenuItem();\n jSeparator1 = new javax.swing.JPopupMenu.Separator();\n jMenuItemExit = new javax.swing.JMenuItem();\n jMenuEdit = new javax.swing.JMenu();\n jMenuItemCut = new javax.swing.JMenuItem();\n jMenuItemCopy = new javax.swing.JMenuItem();\n jMenuItemPaste = new javax.swing.JMenuItem();\n jMenuView = new javax.swing.JMenu();\n jCheckBoxMenuItemToolBar = new javax.swing.JCheckBoxMenuItem();\n jCheckBoxMenuItemToolBarImageOperations = new javax.swing.JCheckBoxMenuItem();\n jCheckBoxMenuItemToolBarImageRotation = new javax.swing.JCheckBoxMenuItem();\n jCheckBoxMenuItemStatusBar = new javax.swing.JCheckBoxMenuItem();\n jMenuImage = new javax.swing.JMenu();\n jMenuItemChangeSize = new javax.swing.JMenuItem();\n jMenuItemDuplicateImage = new javax.swing.JMenuItem();\n jMenuItemHistogram = new javax.swing.JMenuItem();\n jMenuHelp = new javax.swing.JMenu();\n jMenuItemHelpAbout = new javax.swing.JMenuItem();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setMinimumSize(new java.awt.Dimension(600, 500));\n\n jToolBarTools.setRollover(true);\n\n jButtonNew.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_new.png\"))); // NOI18N\n jButtonNew.setToolTipText(\"Nueva imagen\");\n jButtonNew.setFocusable(false);\n jButtonNew.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButtonNew.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jButtonNew.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonNewActionPerformed(evt);\n }\n });\n jToolBarTools.add(jButtonNew);\n\n jButtonOpen.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_open.png\"))); // NOI18N\n jButtonOpen.setToolTipText(\"Abrir\");\n jButtonOpen.setFocusable(false);\n jButtonOpen.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButtonOpen.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jButtonOpen.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonOpenActionPerformed(evt);\n }\n });\n jToolBarTools.add(jButtonOpen);\n\n jButtonSave.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_save.png\"))); // NOI18N\n jButtonSave.setToolTipText(\"Guardar\");\n jButtonSave.setFocusable(false);\n jButtonSave.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButtonSave.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jButtonSave.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonSaveActionPerformed(evt);\n }\n });\n jToolBarTools.add(jButtonSave);\n\n jButtonDuplicate.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_duplicate.png\"))); // NOI18N\n jButtonDuplicate.setToolTipText(\"Duplicar\");\n jButtonDuplicate.setFocusable(false);\n jButtonDuplicate.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButtonDuplicate.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jButtonDuplicate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonDuplicateActionPerformed(evt);\n }\n });\n jToolBarTools.add(jButtonDuplicate);\n jToolBarTools.add(jSeparator3);\n\n jButtonGroupTools.add(jToggleButtonPoint);\n jToggleButtonPoint.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_pencil.png\"))); // NOI18N\n jToggleButtonPoint.setSelected(true);\n jToggleButtonPoint.setToolTipText(\"Punto\");\n jToggleButtonPoint.setFocusable(false);\n jToggleButtonPoint.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonPoint.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonPoint.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonPointActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonPoint);\n\n jButtonGroupTools.add(jToggleButtonLine);\n jToggleButtonLine.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_line.png\"))); // NOI18N\n jToggleButtonLine.setToolTipText(\"Linea\");\n jToggleButtonLine.setFocusable(false);\n jToggleButtonLine.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonLine.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonLine.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonLineActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonLine);\n\n jButtonGroupTools.add(jToggleButtonRectangle);\n jToggleButtonRectangle.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_rectangle.png\"))); // NOI18N\n jToggleButtonRectangle.setToolTipText(\"Rectangulo\");\n jToggleButtonRectangle.setFocusable(false);\n jToggleButtonRectangle.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonRectangle.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonRectangle.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonRectangleActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonRectangle);\n\n jButtonGroupTools.add(jToggleButtonRoundRectangle);\n jToggleButtonRoundRectangle.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_roundrectangle.png\"))); // NOI18N\n jToggleButtonRoundRectangle.setToolTipText(\"Rectangulo redondeado\");\n jToggleButtonRoundRectangle.setFocusable(false);\n jToggleButtonRoundRectangle.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonRoundRectangle.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonRoundRectangle.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonRoundRectangleActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonRoundRectangle);\n\n jToggleButtonArc.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_arc.png\"))); // NOI18N\n jToggleButtonArc.setToolTipText(\"Arco\");\n jButtonGroupTools.add(jToggleButtonArc);\n jToggleButtonArc.setFocusable(false);\n jToggleButtonArc.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonArc.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonArc.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonArcActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonArc);\n\n jButtonGroupTools.add(jToggleButtonCurve);\n jToggleButtonCurve.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_curve.png\"))); // NOI18N\n jToggleButtonCurve.setToolTipText(\"Curva\");\n jToggleButtonCurve.setFocusable(false);\n jToggleButtonCurve.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonCurve.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonCurve.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonCurveActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonCurve);\n\n jButtonGroupTools.add(jToggleButtonPolyline);\n jToggleButtonPolyline.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_polygon.png\"))); // NOI18N\n jToggleButtonPolyline.setToolTipText(\"Polilínea\");\n jToggleButtonPolyline.setFocusable(false);\n jToggleButtonPolyline.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonPolyline.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonPolyline.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonPolylineActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonPolyline);\n\n jButtonGroupTools.add(jToggleButtonPolygon);\n jToggleButtonPolygon.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_polygon.png\"))); // NOI18N\n jToggleButtonPolygon.setToolTipText(\"Poligono\");\n jToggleButtonPolygon.setFocusable(false);\n jToggleButtonPolygon.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonPolygon.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonPolygon.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonPolygonActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonPolygon);\n\n jButtonGroupTools.add(jToggleButtonEllipse);\n jToggleButtonEllipse.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_ellipse.png\"))); // NOI18N\n jToggleButtonEllipse.setToolTipText(\"Elipse\");\n jToggleButtonEllipse.setFocusable(false);\n jToggleButtonEllipse.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonEllipse.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonEllipse.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonEllipseActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonEllipse);\n\n jButtonGroupTools.add(jToggleButtonMove);\n jToggleButtonMove.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_move.png\"))); // NOI18N\n jToggleButtonMove.setToolTipText(\"Mover\");\n jToggleButtonMove.setFocusable(false);\n jToggleButtonMove.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonMove.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonMove.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonMoveActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonMove);\n\n jButtonGroupTools.add(jToggleButtonText);\n jToggleButtonText.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_text.png\"))); // NOI18N\n jToggleButtonText.setToolTipText(\"Texto\");\n jToggleButtonText.setFocusable(false);\n jToggleButtonText.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonText.setPreferredSize(new java.awt.Dimension(24, 24));\n jToggleButtonText.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonText.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonTextActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonText);\n jToolBarTools.add(jSeparator10);\n\n jButtonFont.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_font.png\"))); // NOI18N\n jButtonFont.setToolTipText(\"Fuente\");\n jButtonFont.setFocusable(false);\n jButtonFont.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButtonFont.setPreferredSize(new java.awt.Dimension(24, 24));\n jButtonFont.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jButtonFont.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonFontActionPerformed(evt);\n }\n });\n jToolBarTools.add(jButtonFont);\n jToolBarTools.add(jSeparator4);\n\n jButtonColorChooserFront.setToolTipText(\"Color de borde\");\n jButtonColorChooserFront.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));\n jButtonColorChooserFront.setBorderPainted(false);\n jButtonColorChooserFront.setFocusable(false);\n jButtonColorChooserFront.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButtonColorChooserFront.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToolBarTools.add(jButtonColorChooserFront);\n\n jButtonColorChooserBack.setForeground(new java.awt.Color(255, 255, 255));\n jButtonColorChooserBack.setToolTipText(\"Color de fondo\");\n jButtonColorChooserBack.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));\n jButtonColorChooserBack.setBorderPainted(false);\n jButtonColorChooserBack.setFocusable(false);\n jButtonColorChooserBack.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButtonColorChooserBack.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToolBarTools.add(jButtonColorChooserBack);\n jToolBarTools.add(jSeparator5);\n jToolBarTools.add(jPanelStroke);\n\n jSpinnerStroke.setModel(new javax.swing.SpinnerNumberModel(1, 1, 20, 1));\n jSpinnerStroke.setToolTipText(\"Grosor de linea\");\n jSpinnerStroke.setEditor(new javax.swing.JSpinner.NumberEditor(jSpinnerStroke, \"\"));\n jSpinnerStroke.setFocusable(false);\n jSpinnerStroke.setValue(1);\n jSpinnerStroke.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n jSpinnerStrokeStateChanged(evt);\n }\n });\n jToolBarTools.add(jSpinnerStroke);\n jToolBarTools.add(jSeparator8);\n\n jButtonGroupFill.add(jToggleButtonNoFill);\n jToggleButtonNoFill.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_fillno.png\"))); // NOI18N\n jToggleButtonNoFill.setSelected(true);\n jToggleButtonNoFill.setToolTipText(\"Sin relleno\");\n jToggleButtonNoFill.setFocusable(false);\n jToggleButtonNoFill.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonNoFill.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonNoFill.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonNoFillActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonNoFill);\n\n jButtonGroupFill.add(jToggleButtonSolidFill);\n jToggleButtonSolidFill.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_fill.png\"))); // NOI18N\n jToggleButtonSolidFill.setToolTipText(\"Relleno sólido\");\n jToggleButtonSolidFill.setFocusable(false);\n jToggleButtonSolidFill.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonSolidFill.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonSolidFill.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonSolidFillActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonSolidFill);\n\n jButtonGroupFill.add(jToggleButtonHorizontalFill);\n jToggleButtonHorizontalFill.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_fill_horizontal.png\"))); // NOI18N\n jToggleButtonHorizontalFill.setToolTipText(\"Degradado horizontal\");\n jToggleButtonHorizontalFill.setFocusable(false);\n jToggleButtonHorizontalFill.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonHorizontalFill.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonHorizontalFill.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonHorizontalFillActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonHorizontalFill);\n\n jButtonGroupFill.add(jToggleButtonVerticalFill);\n jToggleButtonVerticalFill.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_fill_vertical.png\"))); // NOI18N\n jToggleButtonVerticalFill.setToolTipText(\"Degradado horizontal\");\n jToggleButtonVerticalFill.setFocusable(false);\n jToggleButtonVerticalFill.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonVerticalFill.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonVerticalFill.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonVerticalFillActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonVerticalFill);\n\n jButtonGroupFill.add(jToggleButtonRadialFill);\n jToggleButtonRadialFill.setText(\"R\");\n jToggleButtonRadialFill.setToolTipText(\"Degradado Radial\");\n jToggleButtonRadialFill.setFocusable(false);\n jToggleButtonRadialFill.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonRadialFill.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonRadialFill.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonRadialFillActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonRadialFill);\n\n jButtonGroupFill.add(jToggleButtonDiagonal1Fill);\n jToggleButtonDiagonal1Fill.setText(\"D1\");\n jToggleButtonDiagonal1Fill.setFocusable(false);\n jToggleButtonDiagonal1Fill.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonDiagonal1Fill.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonDiagonal1Fill.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonDiagonal1FillActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonDiagonal1Fill);\n\n jButtonGroupFill.add(jToggleButtonDiagonal2Fill);\n jToggleButtonDiagonal2Fill.setText(\"D2\");\n jToggleButtonDiagonal2Fill.setFocusable(false);\n jToggleButtonDiagonal2Fill.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonDiagonal2Fill.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonDiagonal2Fill.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonDiagonal2FillActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonDiagonal2Fill);\n jToolBarTools.add(jSeparator9);\n\n jToggleButtonAntialiasing.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_antialiasing.png\"))); // NOI18N\n jToggleButtonAntialiasing.setToolTipText(\"Suavizado\");\n jToggleButtonAntialiasing.setFocusable(false);\n jToggleButtonAntialiasing.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonAntialiasing.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonAntialiasing.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonAntialiasingActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonAntialiasing);\n\n jSliderAlpha.setPaintTicks(true);\n jSliderAlpha.setToolTipText(\"Transparencia\");\n jSliderAlpha.setValue(100);\n jSliderAlpha.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n jSliderAlphaStateChanged(evt);\n }\n });\n jToolBarTools.add(jSliderAlpha);\n jToolBarTools.add(jSeparator6);\n\n jToggleButtonRecord.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_record.png\"))); // NOI18N\n jToggleButtonRecord.setToolTipText(\"Grabar\");\n jToggleButtonRecord.setFocusable(false);\n jToggleButtonRecord.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jToggleButtonRecord.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jToggleButtonRecord.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jToggleButtonRecordActionPerformed(evt);\n }\n });\n jToolBarTools.add(jToggleButtonRecord);\n\n jLabelRecordTime.setText(\"00:00\");\n jToolBarTools.add(jLabelRecordTime);\n jToolBarTools.add(jSeparator7);\n\n jButtonWebCam.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_webcam.png\"))); // NOI18N\n jButtonWebCam.setToolTipText(\"Abrir webcam\");\n jButtonWebCam.setFocusable(false);\n jButtonWebCam.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButtonWebCam.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jButtonWebCam.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonWebCamActionPerformed(evt);\n }\n });\n jToolBarTools.add(jButtonWebCam);\n\n jButtonSnapShot.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_snapshot.png\"))); // NOI18N\n jButtonSnapShot.setToolTipText(\"Tomar captura\");\n jButtonSnapShot.setFocusable(false);\n jButtonSnapShot.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButtonSnapShot.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jButtonSnapShot.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonSnapShotActionPerformed(evt);\n }\n });\n jToolBarTools.add(jButtonSnapShot);\n\n getContentPane().add(jToolBarTools, java.awt.BorderLayout.PAGE_START);\n\n jPanelCenter.setLayout(new java.awt.BorderLayout());\n\n desktop.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {\n public void mouseMoved(java.awt.event.MouseEvent evt) {\n desktopMouseMoved(evt);\n }\n });\n desktop.addVetoableChangeListener(new java.beans.VetoableChangeListener() {\n public void vetoableChange(java.beans.PropertyChangeEvent evt)throws java.beans.PropertyVetoException {\n desktopVetoableChange(evt);\n }\n });\n\n javax.swing.GroupLayout desktopLayout = new javax.swing.GroupLayout(desktop);\n desktop.setLayout(desktopLayout);\n desktopLayout.setHorizontalGroup(\n desktopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n desktopLayout.setVerticalGroup(\n desktopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n\n jSplitPane1.setLeftComponent(desktop);\n\n jPanel1.setLayout(new java.awt.BorderLayout());\n\n jListShapes.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n jListShapes.setEnabled(false);\n jListShapes.addListSelectionListener(new javax.swing.event.ListSelectionListener() {\n public void valueChanged(javax.swing.event.ListSelectionEvent evt) {\n jListShapesValueChanged(evt);\n }\n });\n jScrollPane2.setViewportView(jListShapes);\n\n jPanel1.add(jScrollPane2, java.awt.BorderLayout.CENTER);\n\n jPanel2.setLayout(new java.awt.GridLayout(1, 0));\n\n jButtonMoveUp.setText(\"Hacia delante\");\n jButtonMoveUp.setToolTipText(\"Mover Arriba\");\n jButtonMoveUp.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonMoveUpActionPerformed(evt);\n }\n });\n jPanel2.add(jButtonMoveUp);\n\n jButtonMoveDown.setText(\"Hacia el fondo\");\n jButtonMoveDown.setToolTipText(\"Mover Abajo\");\n jButtonMoveDown.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonMoveDownActionPerformed(evt);\n }\n });\n jPanel2.add(jButtonMoveDown);\n\n jPanel1.add(jPanel2, java.awt.BorderLayout.PAGE_START);\n\n jSplitPane1.setRightComponent(jPanel1);\n\n jPanelCenter.add(jSplitPane1, java.awt.BorderLayout.CENTER);\n\n jToolBarImage.setRollover(true);\n jToolBarImage.setMinimumSize(new java.awt.Dimension(544, 90));\n jToolBarImage.setPreferredSize(new java.awt.Dimension(722, 80));\n\n jPanelImageBrightness.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Brillo\"));\n jPanelImageBrightness.setDoubleBuffered(false);\n jPanelImageBrightness.setEnabled(false);\n jPanelImageBrightness.setLayout(new java.awt.GridLayout(1, 0));\n\n jSliderBrightness.setMaximum(255);\n jSliderBrightness.setMinimum(-255);\n jSliderBrightness.setValue(0);\n jSliderBrightness.setPreferredSize(new java.awt.Dimension(70, 29));\n jSliderBrightness.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n jSliderBrightnessStateChanged(evt);\n }\n });\n jSliderBrightness.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n jSliderBrightnessFocusGained(evt);\n }\n public void focusLost(java.awt.event.FocusEvent evt) {\n jSliderBrightnessFocusLost(evt);\n }\n });\n jPanelImageBrightness.add(jSliderBrightness);\n\n jToolBarImage.add(jPanelImageBrightness);\n\n jPanelImageFilter.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Filtro\"));\n jPanelImageFilter.setDoubleBuffered(false);\n jPanelImageFilter.setEnabled(false);\n jPanelImageFilter.setMinimumSize(new java.awt.Dimension(108, 70));\n jPanelImageFilter.setLayout(new java.awt.GridLayout(1, 0));\n\n jComboBoxFilter.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"--seleccione filtro--\", \"Emborronamiento media\", \"Emborronamiento binomial\", \"Enfoque\", \"Relieve\", \"Detector de fronteras laplaciano\" }));\n jComboBoxFilter.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n jComboBoxFilterItemStateChanged(evt);\n }\n });\n jComboBoxFilter.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n jComboBoxFilterFocusGained(evt);\n }\n });\n jComboBoxFilter.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jComboBoxFilterActionPerformed(evt);\n }\n });\n jPanelImageFilter.add(jComboBoxFilter);\n\n jToolBarImage.add(jPanelImageFilter);\n\n jPanelImageContrast.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Constraste\"));\n jPanelImageContrast.setDoubleBuffered(false);\n jPanelImageContrast.setEnabled(false);\n jPanelImageContrast.setMinimumSize(new java.awt.Dimension(96, 70));\n jPanelImageContrast.setLayout(new java.awt.GridLayout(1, 3));\n\n jButtonConstrast.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_contrast.png\"))); // NOI18N\n jButtonConstrast.setToolTipText(\"Constraste\");\n jButtonConstrast.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonConstrastActionPerformed(evt);\n }\n });\n jPanelImageContrast.add(jButtonConstrast);\n\n jButtonConstrastBright.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_bright.png\"))); // NOI18N\n jButtonConstrastBright.setToolTipText(\"Brillante\");\n jButtonConstrastBright.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonConstrastBrightActionPerformed(evt);\n }\n });\n jPanelImageContrast.add(jButtonConstrastBright);\n\n jButtonContrastDark.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_dark.png\"))); // NOI18N\n jButtonContrastDark.setToolTipText(\"Oscuro\");\n jButtonContrastDark.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonContrastDarkActionPerformed(evt);\n }\n });\n jPanelImageContrast.add(jButtonContrastDark);\n\n jToolBarImage.add(jPanelImageContrast);\n\n jPanelImageOperations.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Operaciones\"));\n jPanelImageOperations.setDoubleBuffered(false);\n jPanelImageOperations.setEnabled(false);\n jPanelImageOperations.setPreferredSize(new java.awt.Dimension(158, 64));\n jPanelImageOperations.setLayout(new java.awt.GridLayout(1, 3));\n\n jButtonSinus.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_sinusoidal.png\"))); // NOI18N\n jButtonSinus.setToolTipText(\"Seno\");\n jButtonSinus.setAlignmentX(10.0F);\n jButtonSinus.setAlignmentY(0.0F);\n jButtonSinus.setBorderPainted(false);\n jButtonSinus.setPreferredSize(new java.awt.Dimension(24, 24));\n jButtonSinus.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonSinusActionPerformed(evt);\n }\n });\n jPanelImageOperations.add(jButtonSinus);\n\n jButtonSepia.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_sepia_1.png\"))); // NOI18N\n jButtonSepia.setToolTipText(\"Sepia\");\n jButtonSepia.setAlignmentY(0.0F);\n jButtonSepia.setBorderPainted(false);\n jButtonSepia.setPreferredSize(new java.awt.Dimension(24, 24));\n jButtonSepia.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonSepiaActionPerformed(evt);\n }\n });\n jPanelImageOperations.add(jButtonSepia);\n\n jButtonSobel.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_gradient.png\"))); // NOI18N\n jButtonSobel.setToolTipText(\"Gradiente Sobel\");\n jButtonSobel.setAlignmentY(0.0F);\n jButtonSobel.setBorderPainted(false);\n jButtonSobel.setPreferredSize(new java.awt.Dimension(24, 24));\n jButtonSobel.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonSobelActionPerformed(evt);\n }\n });\n jPanelImageOperations.add(jButtonSobel);\n\n jButtonTinted.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_tinted.png\"))); // NOI18N\n jButtonTinted.setToolTipText(\"Tintado\");\n jButtonTinted.setAlignmentY(0.0F);\n jButtonTinted.setBorderPainted(false);\n jButtonTinted.setPreferredSize(new java.awt.Dimension(24, 24));\n jButtonTinted.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonTintedActionPerformed(evt);\n }\n });\n jPanelImageOperations.add(jButtonTinted);\n\n jButtonNegative.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_negative.png\"))); // NOI18N\n jButtonNegative.setToolTipText(\"Negativo\");\n jButtonNegative.setAlignmentY(0.0F);\n jButtonNegative.setBorderPainted(false);\n jButtonNegative.setPreferredSize(new java.awt.Dimension(24, 24));\n jButtonNegative.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonNegativeActionPerformed(evt);\n }\n });\n jPanelImageOperations.add(jButtonNegative);\n\n jButtonGrayScale.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_gray.png\"))); // NOI18N\n jButtonGrayScale.setToolTipText(\"Escala de grises\");\n jButtonGrayScale.setAlignmentY(0.0F);\n jButtonGrayScale.setBorderPainted(false);\n jButtonGrayScale.setPreferredSize(new java.awt.Dimension(24, 24));\n jButtonGrayScale.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonGrayScaleActionPerformed(evt);\n }\n });\n jPanelImageOperations.add(jButtonGrayScale);\n\n jButtonRandomBlack.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_sepia.png\"))); // NOI18N\n jButtonRandomBlack.setToolTipText(\"Propia\");\n jButtonRandomBlack.setAlignmentY(0.0F);\n jButtonRandomBlack.setBorderPainted(false);\n jButtonRandomBlack.setPreferredSize(new java.awt.Dimension(24, 24));\n jButtonRandomBlack.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonRandomBlackActionPerformed(evt);\n }\n });\n jPanelImageOperations.add(jButtonRandomBlack);\n\n jToolBarImage.add(jPanelImageOperations);\n\n jPanelImageBinary.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Binarias\"));\n jPanelImageBinary.setDoubleBuffered(false);\n jPanelImageBinary.setEnabled(false);\n java.awt.GridBagLayout jPanelImageBinaryLayout = new java.awt.GridBagLayout();\n jPanelImageBinaryLayout.columnWidths = new int[] {10, 10, 10};\n jPanelImageBinaryLayout.rowHeights = new int[] {1};\n jPanelImageBinary.setLayout(jPanelImageBinaryLayout);\n\n jButtonBinaryAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_add.png\"))); // NOI18N\n jButtonBinaryAdd.setToolTipText(\"suma binaria\");\n jButtonBinaryAdd.setMaximumSize(new java.awt.Dimension(20, 28));\n jButtonBinaryAdd.setMinimumSize(new java.awt.Dimension(24, 24));\n jButtonBinaryAdd.setPreferredSize(new java.awt.Dimension(24, 24));\n jButtonBinaryAdd.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonBinaryAddActionPerformed(evt);\n }\n });\n jPanelImageBinary.add(jButtonBinaryAdd, new java.awt.GridBagConstraints());\n\n jButtonBinarySubstract.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_substract.png\"))); // NOI18N\n jButtonBinarySubstract.setToolTipText(\"resta binaria\");\n jButtonBinarySubstract.setPreferredSize(new java.awt.Dimension(24, 24));\n jButtonBinarySubstract.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonBinarySubstractActionPerformed(evt);\n }\n });\n jPanelImageBinary.add(jButtonBinarySubstract, new java.awt.GridBagConstraints());\n\n jButtonBinaryProduct.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_product.png\"))); // NOI18N\n jButtonBinaryProduct.setToolTipText(\"multiplicacion binaria\");\n jButtonBinaryProduct.setMargin(new java.awt.Insets(0, 0, 0, 0));\n jButtonBinaryProduct.setMaximumSize(new java.awt.Dimension(20, 28));\n jButtonBinaryProduct.setMinimumSize(new java.awt.Dimension(24, 24));\n jButtonBinaryProduct.setPreferredSize(new java.awt.Dimension(24, 24));\n jButtonBinaryProduct.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonBinaryProductActionPerformed(evt);\n }\n });\n jPanelImageBinary.add(jButtonBinaryProduct, new java.awt.GridBagConstraints());\n\n jSliderBinaryOperations.setPreferredSize(new java.awt.Dimension(150, 29));\n jSliderBinaryOperations.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n jSliderBinaryOperationsStateChanged(evt);\n }\n });\n jSliderBinaryOperations.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n jSliderBinaryOperationsFocusGained(evt);\n }\n });\n jSliderBinaryOperations.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseExited(java.awt.event.MouseEvent evt) {\n jSliderBinaryOperationsMouseExited(evt);\n }\n });\n jPanelImageBinary.add(jSliderBinaryOperations, new java.awt.GridBagConstraints());\n\n jToolBarImage.add(jPanelImageBinary);\n\n jPanelUmbralization.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Umbralizacion\"));\n jPanelUmbralization.setDoubleBuffered(false);\n jPanelUmbralization.setEnabled(false);\n jPanelUmbralization.setLayout(new java.awt.GridLayout(1, 0));\n\n jSliderUmbralization.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n jSliderUmbralizationStateChanged(evt);\n }\n });\n jSliderUmbralization.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n jSliderUmbralizationFocusGained(evt);\n }\n public void focusLost(java.awt.event.FocusEvent evt) {\n jSliderUmbralizationFocusLost(evt);\n }\n });\n jPanelUmbralization.add(jSliderUmbralization);\n\n jToolBarImage.add(jPanelUmbralization);\n\n jPanelCenter.add(jToolBarImage, java.awt.BorderLayout.PAGE_END);\n\n getContentPane().add(jPanelCenter, java.awt.BorderLayout.CENTER);\n\n jPanelStatusBar.setLayout(new java.awt.BorderLayout());\n\n jToolBarImageRotation.setRollover(true);\n\n jPanelImageRotate.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Rotación\"));\n jPanelImageRotate.setPreferredSize(new java.awt.Dimension(300, 62));\n jPanelImageRotate.setLayout(new java.awt.GridLayout(1, 4));\n\n jSliderRotate.setMaximum(360);\n jSliderRotate.setMinorTickSpacing(90);\n jSliderRotate.setPaintTicks(true);\n jSliderRotate.setValue(0);\n jSliderRotate.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n jSliderRotateStateChanged(evt);\n }\n });\n jSliderRotate.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n jSliderRotateFocusGained(evt);\n }\n });\n jPanelImageRotate.add(jSliderRotate);\n\n jButtonRotate90.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_rotate_90.png\"))); // NOI18N\n jButtonRotate90.setToolTipText(\"90 Grados\");\n jButtonRotate90.setFocusable(false);\n jButtonRotate90.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButtonRotate90.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jButtonRotate90.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonRotate90ActionPerformed(evt);\n }\n });\n jPanelImageRotate.add(jButtonRotate90);\n\n jButton180.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_rotate_180.png\"))); // NOI18N\n jButton180.setToolTipText(\"180 Grados\");\n jButton180.setFocusable(false);\n jButton180.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButton180.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jButton180.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton180ActionPerformed(evt);\n }\n });\n jPanelImageRotate.add(jButton180);\n\n jButtonRotate270.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_rotate_270.png\"))); // NOI18N\n jButtonRotate270.setToolTipText(\"270 Grados\");\n jButtonRotate270.setFocusable(false);\n jButtonRotate270.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButtonRotate270.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jButtonRotate270.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonRotate270ActionPerformed(evt);\n }\n });\n jPanelImageRotate.add(jButtonRotate270);\n\n jToolBarImageRotation.add(jPanelImageRotate);\n\n jPanelZoom.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Escala\"));\n jPanelZoom.setLayout(new java.awt.GridLayout(1, 0));\n\n jButtonZoomMinus.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_zoom_minus.png\"))); // NOI18N\n jButtonZoomMinus.setToolTipText(\"Reducir\");\n jButtonZoomMinus.setFocusable(false);\n jButtonZoomMinus.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButtonZoomMinus.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jButtonZoomMinus.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonZoomMinusActionPerformed(evt);\n }\n });\n jPanelZoom.add(jButtonZoomMinus);\n\n jButtonZoomPlus.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_zoom_plus.png\"))); // NOI18N\n jButtonZoomPlus.setToolTipText(\"Ampliar\");\n jButtonZoomPlus.setFocusable(false);\n jButtonZoomPlus.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButtonZoomPlus.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jButtonZoomPlus.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonZoomPlusActionPerformed(evt);\n }\n });\n jPanelZoom.add(jButtonZoomPlus);\n\n jToolBarImageRotation.add(jPanelZoom);\n\n jPanelStatusBar.add(jToolBarImageRotation, java.awt.BorderLayout.NORTH);\n\n jStatusBarTool.setText(\"Barra Estado\");\n jStatusBarTool.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n jPanelStatusBar.add(jStatusBarTool, java.awt.BorderLayout.WEST);\n\n jPanelCursorAndColor.setLayout(new java.awt.BorderLayout());\n\n jStatusBarCursor.setText(\"(x,y)\");\n jStatusBarCursor.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n jPanelCursorAndColor.add(jStatusBarCursor, java.awt.BorderLayout.WEST);\n\n jStatusBarColor.setText(\"RGB\");\n jStatusBarColor.setOpaque(true);\n jPanelCursorAndColor.add(jStatusBarColor, java.awt.BorderLayout.EAST);\n\n jPanelStatusBar.add(jPanelCursorAndColor, java.awt.BorderLayout.EAST);\n\n getContentPane().add(jPanelStatusBar, java.awt.BorderLayout.SOUTH);\n\n jMenuFile.setText(\"Archivo\");\n\n jMenuItemNew.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.META_MASK));\n jMenuItemNew.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_new.png\"))); // NOI18N\n jMenuItemNew.setText(\"Nuevo\");\n jMenuItemNew.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemNewActionPerformed(evt);\n }\n });\n jMenuFile.add(jMenuItemNew);\n\n jMenuOpen.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_open.png\"))); // NOI18N\n jMenuOpen.setText(\"Abrir\");\n jMenuOpen.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuOpenActionPerformed(evt);\n }\n });\n jMenuFile.add(jMenuOpen);\n\n jMenuSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.META_MASK));\n jMenuSave.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_save.png\"))); // NOI18N\n jMenuSave.setText(\"Guardar\");\n jMenuSave.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuSaveActionPerformed(evt);\n }\n });\n jMenuFile.add(jMenuSave);\n jMenuFile.add(jSeparator1);\n\n jMenuItemExit.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_exit.png\"))); // NOI18N\n jMenuItemExit.setText(\"Salir\");\n jMenuItemExit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemExitActionPerformed(evt);\n }\n });\n jMenuFile.add(jMenuItemExit);\n\n jMenuBar.add(jMenuFile);\n\n jMenuEdit.setText(\"Editar\");\n\n jMenuItemCut.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.META_MASK));\n jMenuItemCut.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_cut.png\"))); // NOI18N\n jMenuItemCut.setText(\"Cortar\");\n jMenuItemCut.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemCutActionPerformed(evt);\n }\n });\n jMenuEdit.add(jMenuItemCut);\n\n jMenuItemCopy.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.META_MASK));\n jMenuItemCopy.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_copy.png\"))); // NOI18N\n jMenuItemCopy.setText(\"Copiar\");\n jMenuItemCopy.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemCopyActionPerformed(evt);\n }\n });\n jMenuEdit.add(jMenuItemCopy);\n\n jMenuItemPaste.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.META_MASK));\n jMenuItemPaste.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_paste.png\"))); // NOI18N\n jMenuItemPaste.setText(\"Pegar\");\n jMenuItemPaste.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemPasteActionPerformed(evt);\n }\n });\n jMenuEdit.add(jMenuItemPaste);\n\n jMenuBar.add(jMenuEdit);\n\n jMenuView.setText(\"Ver\");\n\n jCheckBoxMenuItemToolBar.setSelected(true);\n jCheckBoxMenuItemToolBar.setText(\"Barra de herramientas\");\n jCheckBoxMenuItemToolBar.setToolTipText(\"\");\n jCheckBoxMenuItemToolBar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jCheckBoxMenuItemToolBarActionPerformed(evt);\n }\n });\n jMenuView.add(jCheckBoxMenuItemToolBar);\n\n jCheckBoxMenuItemToolBarImageOperations.setSelected(true);\n jCheckBoxMenuItemToolBarImageOperations.setText(\"Barra de imagen\");\n jCheckBoxMenuItemToolBarImageOperations.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jCheckBoxMenuItemToolBarImageOperationsActionPerformed(evt);\n }\n });\n jMenuView.add(jCheckBoxMenuItemToolBarImageOperations);\n\n jCheckBoxMenuItemToolBarImageRotation.setSelected(true);\n jCheckBoxMenuItemToolBarImageRotation.setText(\"Barra de rotacion y escalado\");\n jCheckBoxMenuItemToolBarImageRotation.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jCheckBoxMenuItemToolBarImageRotationActionPerformed(evt);\n }\n });\n jMenuView.add(jCheckBoxMenuItemToolBarImageRotation);\n\n jCheckBoxMenuItemStatusBar.setSelected(true);\n jCheckBoxMenuItemStatusBar.setText(\"Barra de estado\");\n jCheckBoxMenuItemStatusBar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jCheckBoxMenuItemStatusBarActionPerformed(evt);\n }\n });\n jMenuView.add(jCheckBoxMenuItemStatusBar);\n\n jMenuBar.add(jMenuView);\n\n jMenuImage.setText(\"Imagen\");\n\n jMenuItemChangeSize.setText(\"Cambiar tamaño\");\n jMenuItemChangeSize.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemChangeSizeActionPerformed(evt);\n }\n });\n jMenuImage.add(jMenuItemChangeSize);\n\n jMenuItemDuplicateImage.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_duplicate.png\"))); // NOI18N\n jMenuItemDuplicateImage.setText(\"Duplicar imagen\");\n jMenuItemDuplicateImage.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemDuplicateImageActionPerformed(evt);\n }\n });\n jMenuImage.add(jMenuItemDuplicateImage);\n\n jMenuItemHistogram.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/sm/images/icon_histogram.png\"))); // NOI18N\n jMenuItemHistogram.setText(\"Histograma\");\n jMenuItemHistogram.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemHistogramActionPerformed(evt);\n }\n });\n jMenuImage.add(jMenuItemHistogram);\n\n jMenuBar.add(jMenuImage);\n\n jMenuHelp.setText(\"Ayuda\");\n\n jMenuItemHelpAbout.setText(\"Acerca de...\");\n jMenuItemHelpAbout.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemHelpAboutActionPerformed(evt);\n }\n });\n jMenuHelp.add(jMenuItemHelpAbout);\n\n jMenuBar.add(jMenuHelp);\n\n setJMenuBar(jMenuBar);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n cardetail = new javax.swing.JPanel();\n carvalidity = new javax.swing.JTextField();\n caraverage = new javax.swing.JTextField();\n carcolor = new javax.swing.JTextField();\n carmodel = new javax.swing.JTextField();\n carno = new javax.swing.JTextField();\n submit1 = new javax.swing.JButton();\n cancel1 = new javax.swing.JButton();\n jButton3 = new javax.swing.JButton();\n jButton9 = new javax.swing.JButton();\n jButton7 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jSeparator2 = new javax.swing.JSeparator();\n jLabel1 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setUndecorated(true);\n setResizable(false);\n getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n cardetail.setBackground(new java.awt.Color(204, 0, 51));\n cardetail.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n cardetail.setOpaque(false);\n cardetail.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n carvalidity.setBorder(null);\n carvalidity.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n carvalidityActionPerformed(evt);\n }\n });\n cardetail.add(carvalidity, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 140, 290, 20));\n\n caraverage.setBorder(null);\n caraverage.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n caraverageActionPerformed(evt);\n }\n });\n cardetail.add(caraverage, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 190, 320, 20));\n\n carcolor.setBorder(null);\n carcolor.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n carcolorActionPerformed(evt);\n }\n });\n cardetail.add(carcolor, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 260, 330, 20));\n\n carmodel.setBorder(null);\n cardetail.add(carmodel, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 70, 310, 20));\n\n carno.setBorder(null);\n carno.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n carnoActionPerformed(evt);\n }\n });\n cardetail.add(carno, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 10, 290, 20));\n\n submit1.setBackground(new java.awt.Color(0, 51, 204));\n submit1.setForeground(new java.awt.Color(255, 255, 255));\n submit1.setText(\"submit\");\n submit1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n submit1ActionPerformed(evt);\n }\n });\n cardetail.add(submit1, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 330, 120, 30));\n\n cancel1.setBackground(new java.awt.Color(0, 51, 204));\n cancel1.setForeground(new java.awt.Color(255, 255, 255));\n cancel1.setText(\"cancel\");\n cardetail.add(cancel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 330, 110, 30));\n\n getContentPane().add(cardetail, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 230, 450, 400));\n\n jButton3.setBackground(new java.awt.Color(0, 102, 204));\n jButton3.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jButton3.setForeground(new java.awt.Color(255, 255, 255));\n jButton3.setText(\"add driver\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 310, 170, 40));\n\n jButton9.setBackground(new java.awt.Color(0, 102, 204));\n jButton9.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jButton9.setForeground(new java.awt.Color(255, 255, 255));\n jButton9.setText(\"View\");\n jButton9.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton9ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton9, new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 380, 170, 40));\n\n jButton7.setBackground(new java.awt.Color(0, 102, 204));\n jButton7.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jButton7.setForeground(new java.awt.Color(255, 255, 255));\n jButton7.setText(\"vehicle booking\");\n jButton7.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton7ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton7, new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 180, 170, 40));\n\n jButton2.setBackground(new java.awt.Color(255, 255, 255));\n jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/adminlogin/car/closedicon.png\"))); // NOI18N\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(1337, 0, 20, 30));\n\n jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/adminlogin/car/toplogo.png\"))); // NOI18N\n getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 10, 190, 20));\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jLabel3.setForeground(new java.awt.Color(255, 255, 255));\n jLabel3.setText(\"Add Vehicle\");\n jLabel3.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jLabel3MouseClicked(evt);\n }\n });\n getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(880, 255, 80, 30));\n getContentPane().add(jSeparator2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 30, 1360, 80));\n\n jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/adminlogin/car/addcar.png\"))); // NOI18N\n jLabel1.setText(\"jLabel1\");\n getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(-20, -10, 1500, 760));\n\n pack();\n setLocationRelativeTo(null);\n }", "private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n setList = new javax.swing.JList();\n addSetButton = new javax.swing.JButton();\n delSetButton = new javax.swing.JButton();\n setNameField = new javax.swing.JTextField();\n jSeparator1 = new javax.swing.JSeparator();\n jScrollPane2 = new javax.swing.JScrollPane();\n setStockList = new javax.swing.JList();\n jScrollPane3 = new javax.swing.JScrollPane();\n stocksTree = new javax.swing.JTree();\n jScrollPane4 = new javax.swing.JScrollPane();\n jTextArea1 = new javax.swing.JTextArea();\n delStockButton = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n copySetButton = new javax.swing.JButton();\n vmaxField = new javax.swing.JTextField();\n accelField = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n closeButton = new javax.swing.JButton();\n changeDirectionButton = new javax.swing.JButton();\n\n setTitle(\"Zugeditor\");\n setAlwaysOnTop(true);\n setIconImage(statics.loadGUIImage(\"trainseteditor.png\"));\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowClosing(java.awt.event.WindowEvent evt) {\n formWindowClosing(evt);\n }\n });\n addComponentListener(new java.awt.event.ComponentAdapter() {\n public void componentShown(java.awt.event.ComponentEvent evt) {\n formComponentShown(evt);\n }\n });\n\n setList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n setList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {\n public void valueChanged(javax.swing.event.ListSelectionEvent evt) {\n setListValueChanged(evt);\n }\n });\n jScrollPane1.setViewportView(setList);\n\n addSetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/org/railsim/gui/resources/add.png\"))); // NOI18N\n addSetButton.setText(\"neuen Zug\");\n addSetButton.setMargin(new java.awt.Insets(2, 8, 2, 8));\n addSetButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n addSetButtonActionPerformed(evt);\n }\n });\n\n delSetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/org/railsim/gui/resources/delete.png\"))); // NOI18N\n delSetButton.setText(\"Zug löschen\");\n delSetButton.setEnabled(false);\n delSetButton.setMargin(new java.awt.Insets(2, 8, 2, 8));\n delSetButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n delSetButtonActionPerformed(evt);\n }\n });\n\n setNameField.setEnabled(false);\n setNameField.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n setNameFieldActionPerformed(evt);\n }\n });\n setNameField.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n setNameFieldFocusLost(evt);\n }\n });\n\n setStockList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);\n setStockList.setCellRenderer(new genericPaintInterfaceComboBoxRenderer());\n setStockList.setDragEnabled(true);\n setStockList.setDropMode(javax.swing.DropMode.INSERT);\n setStockList.setEnabled(false);\n jScrollPane2.setViewportView(setStockList);\n\n stocksTree.setCellRenderer(new stocktreeCellRenderer());\n stocksTree.setDragEnabled(true);\n stocksTree.setEnabled(false);\n stocksTree.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n stocksTreeMousePressed(evt);\n }\n });\n jScrollPane3.setViewportView(stocksTree);\n\n jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);\n\n jTextArea1.setColumns(20);\n jTextArea1.setEditable(false);\n jTextArea1.setLineWrap(true);\n jTextArea1.setRows(5);\n jScrollPane4.setViewportView(jTextArea1);\n\n delStockButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/org/railsim/gui/resources/delete.png\"))); // NOI18N\n delStockButton.setToolTipText(\"Wagen löschen\");\n delStockButton.setEnabled(false);\n delStockButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n delStockButtonActionPerformed(evt);\n }\n });\n\n jLabel1.setText(\"<html>Rollmaterial aus der Baumansicht in die linke Liste schieben.</html>\");\n\n copySetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/org/railsim/gui/resources/clone.png\"))); // NOI18N\n copySetButton.setText(\"kopiere Zug\");\n copySetButton.setEnabled(false);\n copySetButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n copySetButtonActionPerformed(evt);\n }\n });\n\n vmaxField.setEditable(false);\n\n accelField.setEditable(false);\n\n jLabel2.setText(\"m/a²\");\n\n jLabel3.setText(\"km/h\");\n\n closeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/org/railsim/gui/resources/ok.png\"))); // NOI18N\n closeButton.setText(\"Ok\");\n closeButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n closeButtonActionPerformed(evt);\n }\n });\n\n changeDirectionButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/org/railsim/gui/resources/rotate.png\"))); // NOI18N\n changeDirectionButton.setToolTipText(\"Wagen umdrehen\");\n changeDirectionButton.setEnabled(false);\n changeDirectionButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n changeDirectionButtonActionPerformed(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(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 657, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(delStockButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(changeDirectionButton))\n .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1, 0, 0, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(closeButton)\n .addGap(71, 71, 71)))\n .addContainerGap())\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 378, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(delSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(copySetButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(addSetButton, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(setNameField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(accelField, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(vmaxField, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 33, Short.MAX_VALUE)\n .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addGap(67, 67, 67)\n .addComponent(setNameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(addSetButton)\n .addComponent(vmaxField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(copySetButton)\n .addComponent(accelField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(delSetButton))\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE)\n .addComponent(jScrollPane3, 0, 0, Short.MAX_VALUE)\n .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(closeButton)\n .addComponent(delStockButton))\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(changeDirectionButton))\n .addContainerGap())\n );\n\n pack();\n }", "private void initUI() {\n\t\tthis.horizontalLayout = new XdevHorizontalLayout();\n\t\tthis.gridLayout = new XdevGridLayout();\n\t\tthis.button = new XdevButton();\n\t\tthis.button2 = new XdevButton();\n\t\tthis.label = new XdevLabel();\n\n\t\tthis.button.setCaption(\"go to HashdemoView\");\n\t\tthis.button2.setCaption(\"go to CommonView\");\n\t\tthis.label.setValue(\"Go into code tab to view comments\");\n\n\t\tthis.gridLayout.setColumns(2);\n\t\tthis.gridLayout.setRows(2);\n\t\tthis.button.setWidth(200, Unit.PIXELS);\n\t\tthis.button.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.button, 0, 0);\n\t\tthis.button2.setWidth(200, Unit.PIXELS);\n\t\tthis.button2.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.button2, 1, 0);\n\t\tthis.label.setWidth(100, Unit.PERCENTAGE);\n\t\tthis.label.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.label, 0, 1, 1, 1);\n\t\tthis.gridLayout.setComponentAlignment(this.label, Alignment.TOP_CENTER);\n\t\tthis.gridLayout.setSizeUndefined();\n\t\tthis.horizontalLayout.addComponent(this.gridLayout);\n\t\tthis.horizontalLayout.setComponentAlignment(this.gridLayout, Alignment.MIDDLE_CENTER);\n\t\tthis.horizontalLayout.setExpandRatio(this.gridLayout, 10.0F);\n\t\tthis.horizontalLayout.setSizeFull();\n\t\tthis.setContent(this.horizontalLayout);\n\t\tthis.setSizeFull();\n\n\t\tthis.button.addClickListener(event -> this.button_buttonClick(event));\n\t\tthis.button2.addClickListener(event -> this.button2_buttonClick(event));\n\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 lstRentals = new javax.swing.JList<>();\n jLabel1 = new javax.swing.JLabel();\n txtCustName = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n txtCar = new javax.swing.JTextField();\n jLabel3 = new javax.swing.JLabel();\n txtDays = new javax.swing.JTextField();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jScrollPane2 = new javax.swing.JScrollPane();\n lstCars = new javax.swing.JList<>();\n jScrollPane3 = new javax.swing.JScrollPane();\n lstCustomers = new javax.swing.JList<>();\n btnCreateRental = new javax.swing.JButton();\n mnuMain = new javax.swing.JMenuBar();\n mnuFile = new javax.swing.JMenu();\n mnuFileOpen = new javax.swing.JMenuItem();\n mnuFileClose = new javax.swing.JMenuItem();\n mnuFileSave = new javax.swing.JMenuItem();\n mnuFileSaveAs = new javax.swing.JMenuItem();\n mnuFileNew = new javax.swing.JMenu();\n mnuFileNewCustomer = new javax.swing.JMenuItem();\n mnuFileNewCar = new javax.swing.JMenuItem();\n mnuTools = new javax.swing.JMenu();\n mnuToolsSearch = new javax.swing.JMenuItem();\n mnuToolsRecursiveExample = new javax.swing.JMenuItem();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n lstRentals.setModel(new javax.swing.AbstractListModel<String>() {\n String[] strings = { \"Data not loaded\" };\n public int getSize() { return strings.length; }\n public String getElementAt(int i) { return strings[i]; }\n });\n lstRentals.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n lstRentals.setEnabled(false);\n lstRentals.addListSelectionListener(new javax.swing.event.ListSelectionListener() {\n public void valueChanged(javax.swing.event.ListSelectionEvent evt) {\n lstRentalsValueChanged(evt);\n }\n });\n jScrollPane1.setViewportView(lstRentals);\n\n jLabel1.setText(\"Customer:\");\n\n txtCustName.setEditable(false);\n txtCustName.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtCustNameActionPerformed(evt);\n }\n });\n\n jLabel2.setText(\"Car:\");\n\n txtCar.setEditable(false);\n txtCar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtCarActionPerformed(evt);\n }\n });\n\n jLabel3.setText(\"Days Renting:\");\n\n jLabel4.setText(\"Active Rentals:\");\n\n jLabel5.setText(\"Available Cars:\");\n\n jLabel6.setText(\"Customers:\");\n\n lstCars.setModel(new javax.swing.AbstractListModel<String>() {\n String[] strings = { \"Data not loaded\" };\n public int getSize() { return strings.length; }\n public String getElementAt(int i) { return strings[i]; }\n });\n lstCars.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n lstCars.setEnabled(false);\n lstCars.addListSelectionListener(new javax.swing.event.ListSelectionListener() {\n public void valueChanged(javax.swing.event.ListSelectionEvent evt) {\n lstCarsValueChanged(evt);\n }\n });\n jScrollPane2.setViewportView(lstCars);\n\n lstCustomers.setModel(new javax.swing.AbstractListModel<String>() {\n String[] strings = { \"Data not loaded\" };\n public int getSize() { return strings.length; }\n public String getElementAt(int i) { return strings[i]; }\n });\n lstCustomers.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n lstCustomers.setEnabled(false);\n lstCustomers.addListSelectionListener(new javax.swing.event.ListSelectionListener() {\n public void valueChanged(javax.swing.event.ListSelectionEvent evt) {\n lstCustomersValueChanged(evt);\n }\n });\n jScrollPane3.setViewportView(lstCustomers);\n\n btnCreateRental.setText(\"Create Rental\");\n btnCreateRental.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCreateRentalActionPerformed(evt);\n }\n });\n\n mnuFile.setText(\"File\");\n\n mnuFileOpen.setText(\"Open\");\n mnuFileOpen.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n mnuFileOpenActionPerformed(evt);\n }\n });\n mnuFile.add(mnuFileOpen);\n\n mnuFileClose.setText(\"Close\");\n mnuFileClose.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n mnuFileCloseActionPerformed(evt);\n }\n });\n mnuFile.add(mnuFileClose);\n\n mnuFileSave.setText(\"Save\");\n mnuFileSave.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n mnuFileSaveActionPerformed(evt);\n }\n });\n mnuFile.add(mnuFileSave);\n\n mnuFileSaveAs.setText(\"Save As\");\n mnuFileSaveAs.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n mnuFileSaveAsActionPerformed(evt);\n }\n });\n mnuFile.add(mnuFileSaveAs);\n\n mnuFileNew.setText(\"New...\");\n\n mnuFileNewCustomer.setText(\"Customer\");\n mnuFileNewCustomer.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n mnuFileNewCustomerActionPerformed(evt);\n }\n });\n mnuFileNew.add(mnuFileNewCustomer);\n\n mnuFileNewCar.setText(\"Car\");\n mnuFileNewCar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n mnuFileNewCarActionPerformed(evt);\n }\n });\n mnuFileNew.add(mnuFileNewCar);\n\n mnuFile.add(mnuFileNew);\n\n mnuMain.add(mnuFile);\n\n mnuTools.setText(\"Tools\");\n\n mnuToolsSearch.setText(\"Search\");\n mnuToolsSearch.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n mnuToolsSearchActionPerformed(evt);\n }\n });\n mnuTools.add(mnuToolsSearch);\n\n mnuToolsRecursiveExample.setText(\"Recursive Example\");\n mnuToolsRecursiveExample.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n mnuToolsRecursiveExampleActionPerformed(evt);\n }\n });\n mnuTools.add(mnuToolsRecursiveExample);\n\n mnuMain.add(mnuTools);\n\n setJMenuBar(mnuMain);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel2))\n .addGap(0, 0, Short.MAX_VALUE))\n .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(24, 24, 24))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(txtCustName, javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtCar)\n .addComponent(txtDays))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnCreateRental)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabel5)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE)\n .addComponent(jScrollPane3))\n .addComponent(jLabel6))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 286, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(jLabel4)\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(txtCustName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtCar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtDays, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel6)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addGap(37, 37, 37)\n .addComponent(btnCreateRental)\n .addGap(20, 20, 20))))\n .addComponent(jScrollPane1))\n .addContainerGap())\n );\n\n pack();\n }" ]
[ "0.6469756", "0.6445048", "0.6428486", "0.6292821", "0.6272948", "0.6254247", "0.6250972", "0.62066776", "0.6204562", "0.6202428", "0.61703134", "0.61426735", "0.61191094", "0.6111631", "0.6110794", "0.6087033", "0.60704136", "0.60688585", "0.6065546", "0.60648066", "0.6062387", "0.6058837", "0.60497046", "0.6042977", "0.60324806", "0.6024618", "0.6021607", "0.5990636", "0.59888315", "0.59870076", "0.5986721", "0.59767884", "0.5975966", "0.59717584", "0.5970744", "0.5962536", "0.594514", "0.5937246", "0.5937059", "0.5928881", "0.5925566", "0.5911857", "0.5911762", "0.5904186", "0.5900366", "0.5897074", "0.588959", "0.5889251", "0.5889013", "0.5886446", "0.5877936", "0.58687544", "0.5868462", "0.5866193", "0.5865804", "0.5863906", "0.586281", "0.586275", "0.5862512", "0.5854271", "0.5850948", "0.58495176", "0.5849052", "0.58455235", "0.584459", "0.58426595", "0.58357847", "0.58349067", "0.58326966", "0.58321357", "0.583071", "0.5828079", "0.58271366", "0.5825614", "0.5817637", "0.5811126", "0.58109385", "0.58094364", "0.58079123", "0.5807539", "0.579992", "0.5799796", "0.5795759", "0.5794501", "0.5780293", "0.5778792", "0.57784975", "0.57747495", "0.577449", "0.57668996", "0.57636243", "0.57614803", "0.57595557", "0.57564163", "0.5755184", "0.574975", "0.57467806", "0.5743833", "0.573997", "0.57380366" ]
0.61838967
10
Add ActionListener(s) to this object's components.
public void addActionlistener(ActionListener l) { cancelButton.addActionListener(l); addButton.addActionListener(l); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addActionListeners() {\n\t\tif(this.actionListener == null)\n\t\t\t\treturn; \n\t\t\n\t\t\n\t\t/**\n\t\t\tADD ACTION LISTENERS FOR BUTTONS HERE \n\t\t*/\n\t\tclearButton.addActionListener(this.actionListener);\n\t\tsinButton.addActionListener(this.actionListener);\n\t\tcosButton.addActionListener(this.actionListener);\n\t\ttanButton.addActionListener(this.actionListener);\n\t\tnegateButton.addActionListener(this.actionListener);\n\t\tsquareButton.addActionListener(this.actionListener);\n\t\tinverseButton.addActionListener(this.actionListener);\n\t\tsqrtButton.addActionListener(this.actionListener);\n\t\tpowerButton.addActionListener(this.actionListener);\n\t\tdivideButton.addActionListener(this.actionListener);\n\t\tmultiplyButton.addActionListener(this.actionListener);\n\t\tsubtractButton.addActionListener(this.actionListener);\n\t\taddButton.addActionListener(this.actionListener);\n\t\tpercentButton.addActionListener(this.actionListener);\n\t\t\n\t\t\n\t\tfor(int i = 0 ; i < valueButtons.length ; ++i) {\n\t\t\tvalueButtons[i].addActionListener(this.actionListener);\n\t\t}\n\t\t\n\t\t\n\t}", "public void addActionListeners() {\n\t\tbtnReadRow.addActionListener(this);\n\t\tbtnPrintRow.addActionListener(this);\n\t\tbtnReadCol.addActionListener(this);\n\t\tbtnPrintCol.addActionListener(this);\n\t}", "private void addListeners()\r\n {\r\n Actions act = new Actions();\r\n btnCountA.addActionListener(act);\r\n btnSearch.addActionListener(act);\r\n btnFindL.addActionListener(act);\r\n }", "public void addActionListeners(){\n terugButton.addActionListener(this);\n klaarButton.addActionListener(this);\n\n }", "public void addActionListener(ActionListener listener){\n\t\n\t\tfor(int i = 0; i< 5; i++){\n\t\t\tfor(int j = 0; j < 5; j++){\n\t\t\t\tbuttons[i][j].addActionListener(listener);\n\t\t\t}\n\t\t}\n\t}", "public void addActionListeners(ActionListener evt)\r\n\t{\r\n\t\tconfirmButton.addActionListener(evt);\r\n\t\tstartButton.addActionListener(evt);\r\n\t}", "public void addListeners() {\r\n\t\tbtnLogin.addActionListener(listener);\r\n\t\tbtnChooseFile.addActionListener(listener);\r\n\t\tbtnSendMessage.addActionListener(listener);\r\n\t\tbtnRemoveImage.addActionListener(listener);\r\n\t\tbtnUpdateMessages.addActionListener(listener);\r\n\t\tbtnUpdateUsers.addActionListener(listener);\r\n\t}", "private void componentsListeners() {\r\n\t\t// NIFs\r\n\t\tbtnRefrescarnifs.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\tcb_nifCliente.setModel(new DefaultComboBoxModel(ContenedorPrincipal.getContenedorPrincipal().getContenedorClientes().getNifs()));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// Clientes\r\n\t\tbtnClientes.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\tcontroladorVehiculos.pulsarClientes();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// Reparaciones\r\n\t\tbtnRepararVehvulo.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\tcontroladorVehiculos.pulsarReparaciones();\r\n\t\t\t}\r\n\t\t});\r\n\t\t// Anterior vehiculo\r\n\t\tbuttonLeftArrow.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tif (!Constantes.MODO_CREAR) {\r\n\t\t\t\t\tcontroladorVehiculos.pulsarLeftArrow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t// Siguiente vehiculo\r\n\t\tbuttonRightArrow.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tif (!Constantes.MODO_CREAR) {\r\n\t\t\t\t\tcontroladorVehiculos.pulsarRightArrow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// Atras\r\n\t\tbtnAtrs.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\tcontroladorVehiculos.pulsarAtras();\r\n\t\t\t}\r\n\t\t});\r\n\t\t// Guarda el vehiculo\r\n\t\tbtnGuardar.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\tif (Constantes.MODO_CREAR) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tcontroladorVehiculos.guardarVehiculo();\r\n\t\t\t\t\t} catch (NumberFormatException e1) {\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Hay campos vacios\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t\t} catch (Exception e2) {\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Algo ha ido mal\", \"Error\", JOptionPane.ERROR_MESSAGE);\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// Borra el vehículo\r\n\t\tbtnBorrarVehiculo.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\tif (Constantes.MODO_CREAR) {\r\n\t\t\t\t\tcontroladorVehiculos.pulsarBorrarVehiculo();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "void addActionListener(ActionListener listener);", "private void agregarListeners() {\n this.vista.jbAceptar.addActionListener(this);\n this.vista.jbAgregar.addActionListener(this);\n this.vista.jbCancelar.addActionListener(this);\n this.vista.jbQuitar.addActionListener(this);\n this.vista.jtPermisosDisponibles.addMouseListener(this);\n this.vista.jtPermisosSeleccionados.addMouseListener(this);\n }", "public void createListeners() {\n\n addRow.addActionListener(e -> gui.addRow());\n deleteRow.addActionListener(e -> gui.deleteRow());\n }", "void addActionListener(IActionListener actionListener);", "@Override\n\tpublic void addActionListener(ActionListener listener) {\n\t\tlisteners.add(listener);\n\t}", "private void initComponents() {\n\n\t\texitMenuItem.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.exit(0);\n\n\t\t\t}\n\t\t});\n\n\t\tnewTaskMenuItem.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tTaskAdditionPanel tap = new TaskAdditionPanel();\n\t\t\t\ttap.register(self);\n\t\t\t\tCustomJFrame frame = new CustomJFrame(\"Add New Tasks\", false);\n\t\t\t\tframe.add(tap);\n\t\t\t}\n\t\t});\n\n\t\tnewSubTaskMenuItem.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSubTaskAdditionPanel stap = new SubTaskAdditionPanel();\n\t\t\t\tstap.register(self);\n\t\t\t\tCustomJFrame frame = new CustomJFrame(\"Add New Sub Tasks\", false);\n\t\t\t\tframe.add(stap);\n\n\t\t\t}\n\t\t});\n\t\t\n\t\tnewTimeMenuItem.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tTimeAdditionPanel tap = new TimeAdditionPanel();\n\t\t\t\ttap.register(self);\n\t\t\t\tCustomJFrame frame = new CustomJFrame(\"Add New Times\", false);\n\t\t\t\tframe.add(tap);\n\n\t\t\t}\n\t\t});\n\n\t\tdeleteTaskMenuItem.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tTaskDeletionPanel tdp = new TaskDeletionPanel();\n\t\t\t\ttdp.register(self);\n\t\t\t\tCustomJFrame frame = new CustomJFrame(\"Delete Tasks\", false);\n\t\t\t\tframe.add(tdp);\n\t\t\t}\n\t\t});\n\n\t\tdeleteSubTaskMenuItem.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSubTaskDeletionPanel stdp = new SubTaskDeletionPanel();\n\t\t\t\tstdp.register(self);\n\t\t\t\tCustomJFrame frame = new CustomJFrame(\"Delete Sub Tasks\", false);\n\t\t\t\tframe.add(stdp);\n\n\t\t\t}\n\t\t});\n\t\tdeleteSubTaskTimeMenuItem.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tTimeDeletionPanel tdp = new TimeDeletionPanel();\n\t\t\t\ttdp.register(self);\n\t\t\t\tCustomJFrame frame = new CustomJFrame(\"Delete Time\", false);\n\t\t\t\tframe.add(tdp);\n\n\t\t\t}\n\t\t});\n\n\t\tviewTimesSubTaskMenuItem.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSubTaskTimeReportGenerationPanel tdp = new SubTaskTimeReportGenerationPanel();\n\n\t\t\t\tCustomJFrame frame = new CustomJFrame(\"Generate Time Card for SubTask\", false);\n\t\t\t\tframe.add(tdp);\n\n\t\t\t}\n\t\t});\n\n\t\tviewTimesTaskMenuItem.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tTaskTimeReportGenerationPanel tdp = new TaskTimeReportGenerationPanel();\n\n\t\t\t\tCustomJFrame frame = new CustomJFrame(\"Generate Time Card for Task\", false);\n\t\t\t\tframe.add(tdp);\n\n\t\t\t}\n\t\t});\n\n\t}", "private void createActionListener() {\n this.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n SearchBox source = (SearchBox) e.getSource();\n searchLinker.doSearch(source.getText());\n }\n });\n }", "public void addActionListener(ActionListener al) {\n\t\tthis.botonGuardarCambios.addActionListener(al);\r\n\t\tthis.botonPersonaje.addActionListener(al);\r\n\t\tthis.botonBorrarEpisodio.addActionListener(al);\r\n\t\tthis.botonModificarEpisodio.addActionListener(al);\r\n\t\tthis.botonNuevoEpisodio.addActionListener(al);\r\n\t\t\r\n\t}", "private void cargaListeners() {\n\t\tbtnGuardar.addActionListener(this);\n\n\t}", "private void addFunctionListeners()\n\t{\n\t\tadd.addActionListener (new functionListener());\n\t\tsubtract.addActionListener (new functionListener());\n\t\tmultiply.addActionListener (new functionListener());\n\t\tdivide.addActionListener (new functionListener());\n\t\tequals.addActionListener (new functionListener());\n\t\tnegate.addActionListener (new functionListener());\n\t\tpercent.addActionListener (new functionListener());\n\t\tsquareRoot.addActionListener (new functionListener());\n\t\tC.addActionListener (new functionListener());\n\t\tcubeRoot.addActionListener (new functionListener());\n\t\txSquare.addActionListener (new functionListener());\n\t\txCube.addActionListener (new functionListener());\n\t\tdel.addActionListener (new functionListener());\n\t\treciprocal.addActionListener (new functionListener());\t\n\t\tPI.addActionListener (new functionListener());\n\t\te.addActionListener (new functionListener());\n\t\ttwoPower.addActionListener (new functionListener());\n\t\tln.addActionListener (new functionListener());\n\t\teToPower.addActionListener (new functionListener());\n\t\tdecimalPoint.addActionListener (new functionListener());\n\t}", "private void addListeners() {\r\n updateMethod.addActionListener(new ActionListener() {\r\n @Override\r\n public void actionPerformed(ActionEvent e) {\r\n enableFieldBasedOnUpdateMethod();\r\n }\r\n });\r\n cbUseLeakyLearning.addActionListener(this);\r\n cbUseLeakyLearning.setActionCommand(\"useLeakyLearning\");\r\n }", "private void addListeners() {\n\t\t\n\t\tresetButton.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\t \n\t\t public void handle(ActionEvent e) {\n\t\t \n\t\t \treset();\n\t\t \t\n\t\t }\n\t\t \n\t\t});\n\t\t\n\t\ttoggleGroup.selectedToggleProperty().addListener(\n\t\t\t (ObservableValue<? extends Toggle> ov, Toggle old_toggle, \n\t\t\t Toggle new_toggle) -> {\n\t\t\t \t\n\t\t\t \tif(rbCourse.isSelected()) {\n\t\t \t\t\n\t\t \t\thbox3.getChildren().set(0, CourseSelectionBox.instance());\n\t\t \t\thbox3.setDisable(false);\n\t\t \t\t\n\t\t \t}else if(rbAuthor.isSelected()) {\n\t\t \t\t\n\t\t \t\thbox3.getChildren().set(0, AuthorSelectionBox.instance());\n\t\t \t\thbox3.setDisable(false);\n\t\t \t\t\n\t\t \t}else if(rbNone.isSelected()) {\n\t\t \t\t\n\t\t \t\thbox3.setDisable(true);\n\t\t \t\t\n\t\t \t}\n\t\t\t \t\n\t\t\t});\n\t\t\n\t\tapplyButton.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\t \n\t\t public void handle(ActionEvent e) {\n\t\t \n\t\t \tfilter();\n\t\t \t\n\t\t }\n\t\t \n\t\t});\n\t\t\n\t\tsearchButton.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\t \n\t\t public void handle(ActionEvent e) {\n\t\t \n\t\t \tResult.instance().search(quizIDField.getText());\n\t\t \t\n\t\t }\n\t\t \n\t\t});\n\t\t\n\t}", "private void addActionListeners() {\r\n\t\tbuttonImport.addActionListener(this);\r\n\t\tbuttonCancel.addActionListener(this);\r\n\t\tcbContainsHeader.addActionListener(this);\r\n\t\tcbEnableLenCorrect.addActionListener(this);\r\n\t\ttextfieldDelimSymbol.addKeyListener(this);\r\n\t\ttextfieldLenCorrection.addKeyListener(this);\r\n\t\ttableSelectionPD.registerSelectedProfilesListener(this);\r\n\t}", "private void listenersInitiation() {\n ActionSelectors listener = new ActionSelectors();\n submit.addActionListener(listener);\n goBack.addActionListener(listener);\n }", "public void addActionListener( ActionListener listener ) {\n if ( _listeners == null )\n _listeners = new ArrayList();\n _listeners.add( listener );\n }", "private void setActionListener(){\r\n \tthis.addPropertyChangeListener(\"Refresh\", this);\r\n \tdeleteButton.addActionListener(this);\r\n \taddNewButton.addActionListener(this);\r\n }", "public void connectListeners(){\n for(int i=0; i<3; i++){\n for(int j=0; j<3; j++){\n grid[i][j].addActionListener(this);\n }\n }\n }", "public void setListeners(){\n\t\t\n\t\tthis.addActionListener(new ActionListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t// chosen to add new patient\n\t\t\t\t\n\t\t\t\tArrayList<String> constructorInput = null;\n\t\t\t\tconstructorInput = NewPatientWindow.showInputdialog(true);\n\t\t\t\t\n\t\t\t\t// if cancel or close chosen on new patient window:\n\t\t\t\tif (constructorInput == null)\n\t\t\t\t\treturn; \n\t\t\t\t\n\t\t\t\t//else:\n\t\t\t\tBrainFreezeMain.patients.add(new Patient(\n\t\t\t\t\t\t(constructorInput.toArray( new String[constructorInput.size()]))));\n\t\t\t\tBrainFreezeMain.currentPatientIndex = BrainFreezeMain.patients.size()-1;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tLeftPanel.refreshPatientLabel(); // change to patient list, update label\n\t\t\t\tLeftPanel.refreshPatientData(); // change to patient, update data\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t}", "public void addActionListener(ActionListener listener) {\r\n colorListeners = AWTEventMulticaster.add(colorListeners, listener);\r\n }", "public void addListeners()\n {\n view.addListeners(new FileButtonClick(view, this), new ViewButtonClick(view, this), new ClassClick(view, this), new RelationshipClick(view, this), new RightClickListenerFactory(view, this));\n\t}", "public void addActionListener(ActionListener al)\n {\n _tf.addActionListener(al);\n }", "public void addListener(ActionListener controller){\n\t\tbtnTests.addActionListener(controller);\n\t\tbtnTests.setActionCommand(\"con1\");\n\t\tbtnCEffects.addActionListener(controller);\t//need instance of controller before can add it as a listener \n\t\tbtnCEffects.setActionCommand(\"con2\");\n\t\n\t\tbtnRepport.setActionCommand(\"con00\");\n\t\tbtnRepport.addActionListener(controller);\t//need instance of controller before can add it as a listener \n\n\t\tbtnLogOut.setActionCommand(\"con00\");\n\t\tbtnLogOut.addActionListener(controller);\t//need instance of controller before can add it as a listener \n\n\t\tbtnProfile.setActionCommand(\"con00\");\n\t\tbtnProfile.addActionListener(controller);\t//need instance of controller before can add it as a listener \n\n\n\t}", "private void createEvents() {\n\t\taddBtn.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbuildOutput();\n\t\t\t}\n\t\t});\n\t}", "public void addEvolveActionListener(ActionListener evolveActionListener) {\n\t\tevolveButton.addActionListener(evolveActionListener);\n\t}", "public void addActionListener(ActionListener l) {\n\t\tbtnCalendar.addActionListener(l);\n\t\tbtnEventlist.addActionListener(l);\n\t\tbtnLogOut.addActionListener(l);\n\n\t}", "private void setButtonListener() {\n for(CellButton[] buttonsRow : mainFrame.getButtons()) {\n for(CellButton button :buttonsRow) {\n button.addButtonListener(this);\n }\n }\n }", "public void addActionListener (ActionListener l)\r\n {\r\n editor.addActionListener (l);\r\n }", "private void addButtonListener() {\n\t\trock.addActionListener(buttonListener);\n\t\tpaper.addActionListener(buttonListener);\n\t\tscissors.addActionListener(buttonListener);\n\t}", "public void actionListenner()\n\t{\n\t\t// Add action Listener to each JButton.\n\t\t// WelcomePanel\n\t\tview.getFrame().add(view.getWelcomePanel().getWelcomePanel());\t\n\t\tview.getFrame().setVisible(true);\n\t\t\n\t\t// welcomeButton\n\t\tview.getWelcomePanel().getWelcomeButton().addActionListener(event -> view.getFrame().remove(view.getWelcomePanel().getWelcomePanel()));\t\t\n\t\tview.getWelcomePanel().getWelcomeButton().addActionListener(event -> view.getFrame().add(view.getMainPanel().getMainPanel()));\t\t\n\t\tview.getWelcomePanel().getWelcomeButton().addActionListener(event -> view.getFrame().pack());\n\n\t\t// MainPanel\n\t\t// playgameButton\n\t\tview.getMainPanel().getPlaygameButtun().addActionListener(event -> view.getFrame().remove(view.getMainPanel().getMainPanel()));\t\n\t\tview.getMainPanel().getPlaygameButtun().addActionListener(event -> view.getFrame().add(view.getPlayerPanel().getPlayerPanel()));\n\t\tview.getMainPanel().getPlaygameButtun().addActionListener(event -> view.getFrame().repaint());\n\t\tview.getMainPanel().getPlaygameButtun().addActionListener(event -> view.getFrame().setSize(600, 800));\n\t\tview.getMainPanel().getPlaygameButtun().addActionListener(event -> view.getFrame().pack());\n\t\t\n\t\t//leaderboardButton\n\t\tview.getMainPanel().getLeaderboardsButton().addActionListener(event -> view.getFrame().remove(view.getMainPanel().getMainPanel()));\n\t\tview.getMainPanel().getLeaderboardsButton().addActionListener(event -> view.add(view.getLeaderboardPanel().getLeaderboardPanel()));\n\t\tview.getMainPanel().getLeaderboardsButton().addActionListener(event -> view.getFrame().repaint());\n\t\tview.getMainPanel().getLeaderboardsButton().addActionListener(event -> view.getFrame().setSize(600, 800));\n\t\tview.getMainPanel().getLeaderboardsButton().addActionListener(event -> view.getFrame().pack());\n\t\t\n\t\t//quit\n\t\tview.getMainPanel().getQuitButton().addActionListener(event -> view.getFrame().remove(view.getMainPanel().getMainPanel()));\n\t\tview.getMainPanel().getQuitButton().addActionListener(event -> view.getFrame().add(view.getQuitPanel().getQuitPane()));\n\t\tview.getMainPanel().getQuitButton().addActionListener(event -> view.getFrame().repaint());\n\t\tview.getMainPanel().getQuitButton().addActionListener(event -> view.getFrame().setSize(600, 800));\n\t\tview.getMainPanel().getQuitButton().addActionListener(event -> view.getFrame().pack());\n\t\t\n\t\t// PlayerPanel\n\t\t// createButton\n\t\tview.getPlayerPanel().getCreateButton().addActionListener(new ActionListener()\n\t\t{\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tString input = view.getPlayerPanel().getInputBox().getText();\n\t\t\t\tSystem.out.println(input);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tboolean validname = gameInfo.getModel().getLeaderboard().isValidNewPlayers(input);\n\t\t\t\tSystem.out.println(validname);\n\t\t\t\t\n\t\t\t\tif(validname)\n\t\t\t\t{\n\t\t\t\t\tgameInfo.getModel().getLeaderboard().addNewPlayer(input);\n\t\t\t\t\tgameInfo.getModel().getLeaderboard().loadPlayer(input);\n\t\t\t\t\tgameInfo.getModel().getGameRule().setLevel(1);\n\t\t\t\t\t\n\t\t\t\t\tview.getInGamePanel().setPlayerInGamePanel(input);\n\t\t\t\t\tview.getInGamePanel().setLabelName(input);\t\n\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setPlayerName(input);\n\t\t\t\t\t\n\t\t\t\t\tview.getInGamePanel().setLevelLabel(Integer.toString(1));\n\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setLevel(1);\n\t\t\t\t\t\n\t\t\t\t\tview.getInGamePanel().setScoreLabel(Integer.toString(0));\n\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setScores(0);\n\t\t\t\t\t\n\t\t\t\t\tview.getInGamePanel().setGameStart(true);\n\t\t\t\t\tview.getFrame().remove(view.getPlayerPanel().getPlayerPanel());\n\t\t\t\t\tview.getFrame().add(view.getInGamePanel().getInGamePanel());\n\t\t\t\t\tview.getInGamePanel().getInGamePanel().setFocusable(true);\n\t\t\t\t\tview.getInGamePanel().getInGamePanel().requestFocusInWindow();\n\t\t\t\t\tview.getFrame().pack();\n\t\t\t\t\tview.getFrame().setSize(800, 890);\n\t\t\t\t\tview.getFrame().repaint();\t\t\n\t\t\t\t\tview.getFrame().setVisible(true);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!validname)\n\t\t\t\t{\n\t\t\t\t\tview.getPlayerPanel().getInputBox().setText(\"INVALID NAME\");\n\t\t\t\t\tview.getPlayerPanel().getInputBox().addMouseListener(new MouseAdapter(){\n\t\t\t @Override\n\t\t\t public void mouseClicked(MouseEvent e){\n\t\t\t \tview.getPlayerPanel().getInputBox().setText(\"\");\n\t\t\t }\n\t\t\t });\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\t// loadPlayer\n\t\tint numberOfLoadPlayer = view.getPlayerPanel().getExistPlayerButton().length;\n\t\tfor(int i = 0; i < numberOfLoadPlayer; i++)\n\t\t{\n\t\t\tview.getPlayerPanel().getExistPlayerButton()[i].addMouseListener(new MouseAdapter()\n\t\t\t{\n\t\t\t\tpublic void mousePressed(MouseEvent e)\n\t\t\t\t{\n\t\t\t\t\tObject o = e.getSource();\n\t\t\t\t\tJButton pressedButton = (JButton) o;\n\t\t\t\t\tString text = pressedButton.getText();\n\t\t\t\t\t\n\t\t\t\t\tview.getInGamePanel().setPlayerInGamePanel(text);\n\t\t\t\t\tview.getInGamePanel().setScoreLabel(Integer.toString(gameInfo.getModel().getGameRule().getScores()));\n\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setScores(gameInfo.getModel().getGameRule().getScores());\n\t\t\t\t\tview.getInGamePanel().setLabelName(text);\n\t\t\t\t\t\n\t\t\t\t\tgameInfo.getModel().getLeaderboard().loadPlayer(text);\n\t\t\t\t\t\n\t\t\t\t\tview.getPlayerPanel().setLoadPlayer(gameInfo.getModel().getLeaderboard().loadPlayer(text));\t\t\t\n\t\t\t\t\tview.setSelectLevelPanel();\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tview.getFrame().remove(view.getPlayerPanel().getPlayerPanel());\t\t\n\t\t\t\t\tview.getFrame().add(view.getSelectLevelPanel().getSelectLevelPanel());\n\t\t\t\t\tview.getFrame().repaint();\n\t\t\t\t\t//view.getFrame().pack();\n\t\t\t\t\tview.getFrame().setVisible(true);\n\t\t\t\t\t\n\t\t\t\t\t// InGamePanel\n\t\t\t\t\t//case select level unlock\n\t\t\t\t\tfor(int i = 1; i <= 5; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(gameInfo.getModel().getLeaderboard().loadPlayer(text).isLevelUnlocked(i) == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tString selectLevel = Integer.toString(i);\n\t\t\t\t\t\t\tint level = i;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tview.getSelectLevelPanel().getLevelButton()[i].addActionListener(event -> view.getInGamePanel().getBoardGamePanel().setPlayerName(gameInfo.getModel().getLeaderboard().loadPlayer(text).getName()));\n\t\t\t\t\t\t\tview.getSelectLevelPanel().getLevelButton()[i].addActionListener(event -> view.getInGamePanel().getBoardGamePanel().setLevel(level));\n\t\t\t\t\t\t\tview.getSelectLevelPanel().getLevelButton()[i].addActionListener(event -> view.getInGamePanel().getBoardGamePanel().setLevel(gameInfo.getModel().getGameRule().getLevel()));\n\t\t\t\t\t\t\tview.getSelectLevelPanel().getLevelButton()[i].addActionListener(event -> gameInfo.getModel().getGameRule().setLevel(level));\n\t\t\t\t\t\t\tview.getSelectLevelPanel().getLevelButton()[i].addActionListener(event -> view.getInGamePanel().setLevelLabel(selectLevel));\n\t\t\t\t\t\t\tview.getSelectLevelPanel().getLevelButton()[i].addActionListener(event -> view.getInGamePanel().setGameStart(true));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tview.getSelectLevelPanel().getLevelButton()[i].addActionListener(event -> view.getFrame().remove(view.getSelectLevelPanel().getSelectLevelPanel()));\n\t\t\t\t\t\t\tview.getSelectLevelPanel().getLevelButton()[i].addActionListener(event -> view.getFrame().setSize(800, 890));\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tview.getSelectLevelPanel().getLevelButton()[i].addActionListener(event -> view.getFrame().add(view.getInGamePanel().getInGamePanel()));\t\n\t\t\t\t\t\t\tview.getSelectLevelPanel().getLevelButton()[i].addActionListener(event -> view.getInGamePanel().getInGamePanel().requestFocusInWindow());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tview.getSelectLevelPanel().getLevelButton()[i].addActionListener(event -> view.getInGamePanel().getInGamePanel().setFocusable(true));\n\t\t\t\t\t\t\tview.getSelectLevelPanel().getLevelButton()[i].addActionListener(event -> view.getFrame().repaint());\t\n\t\t\t\t\t\t\tview.getSelectLevelPanel().getLevelButton()[i].addActionListener(event -> view.getFrame().pack());\n\t\t\t\t\t\t\tview.getSelectLevelPanel().getLevelButton()[i].addActionListener(event -> view.getFrame().setVisible(true));\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\n\t\t\t\t}\t\n\t\t});\t\t\n\t\t}\n\t\t\n\t\t// back\n\t\tview.getPlayerPanel().getBackButton().addActionListener(event -> view.getFrame().remove(view.getPlayerPanel().getPlayerPanel()));\n\t\tview.getPlayerPanel().getBackButton().addActionListener(event -> view.getFrame().add(view.getMainPanel().getMainPanel()));\t\n\t\tview.getPlayerPanel().getBackButton().addActionListener(event -> view.getFrame().setSize(600, 800));\n\t\tview.getPlayerPanel().getBackButton().addActionListener(event -> view.getFrame().repaint());\n\t\tview.getPlayerPanel().getBackButton().addActionListener(event -> view.getFrame().pack());\n\t\t\n\t\t// LeaderboardPanel\n\t\tview.getLeaderboardPanel().getBackButton().addActionListener(event -> view.getFrame().remove(view.getLeaderboardPanel().getLeaderboardPanel()));\n\t\tview.getLeaderboardPanel().getBackButton().addActionListener(event -> view.getFrame().add(view.getMainPanel().getMainPanel()));\t\n\t\tview.getLeaderboardPanel().getBackButton().addActionListener(event -> view.getFrame().repaint());\n\t\tview.getLeaderboardPanel().getBackButton().addActionListener(event -> view.getFrame().setSize(600, 800));\t\n\t\tview.getLeaderboardPanel().getBackButton().addActionListener(event -> view.getFrame().pack());\n\t\t\n\t\t// QuitPanel\n\t\t// no\n\t\tview.getQuitPanel().getNo().addActionListener(event -> view.getFrame().remove(view.getQuitPanel().getQuitPane()));\n\t\tview.getQuitPanel().getNo().addActionListener(event -> view.getFrame().setSize(600, 800));\n\t\tview.getQuitPanel().getNo().addActionListener(event -> view.getFrame().add(view.getMainPanel().getMainPanel()));\n\t\tview.getQuitPanel().getNo().addActionListener(event -> view.getFrame().repaint());\t\n\t\tview.getQuitPanel().getNo().addActionListener(event -> view.getFrame().pack());\n\t\t\n\t\t// yes\n\t\tview.getQuitPanel().getYes().addActionListener(event -> view.getFrame().dispatchEvent(new WindowEvent(view.getFrame(), WindowEvent.WINDOW_CLOSING)));\n\t\t\n\t\t\n\t\t// InGamePanel\n\t\tview.getInGamePanel().getInGamePanel().addKeyListener(new KeyAdapter() {\n\t\t\tpublic void keyTyped(KeyEvent e) {}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tswitch (e.getKeyCode()) {\n\n\t\t\t\t// Case press esc to pause the game\n\t\t\t\tcase KeyEvent.VK_ESCAPE:\t\n\t\t\t\t\tview.getInGamePanel().setGameStart(false);\n\t\t\t\t\tview.getFrame().remove(view.getInGamePanel().getInGamePanel());\n\t\t\t\t\tview.getFrame().add(view.getPausePanel().getPausePanel());\n\t\t\t\t\tview.getFrame().repaint();\n\t\t\t\t\tview.getFrame().setSize(600, 800);\t\n\t\t\t\t\tview.getFrame().pack();\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase KeyEvent.VK_LEFT:\n\t\t\t\t\tmessage = new Message(Message.ValveResponse.MOVE_LEFT);\n\t\t\t\t\ttry \n\t\t\t\t\t{\n\t\t\t\t\t\tviewToControllerQueue.put(message);\n\t\t\t\t\t} \n\t\t\t\t\tcatch (InterruptedException e1) {}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase KeyEvent.VK_RIGHT:\n\t\t\t\t\tmessage = new Message(Message.ValveResponse.MOVE_RIGHT);\n\t\t\t\t\ttry \n\t\t\t\t\t{\n\t\t\t\t\t\tviewToControllerQueue.put(message);\n\t\t\t\t\t} \n\t\t\t\t\tcatch (InterruptedException e1) {}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase KeyEvent.VK_Z:\n\t\t\t\t\tmessage = new Message(Message.ValveResponse.ROTATE_LEFT);\n\t\t\t\t\t\n\t\t\t\t\ttry \n\t\t\t\t\t{\n\t\t\t\t\t\tviewToControllerQueue.put(message);\n\t\t\t\t\t} \n\t\t\t\t\tcatch (InterruptedException e1) {}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase KeyEvent.VK_SPACE:\n\t\t\t\t\tmessage = new Message(Message.ValveResponse.FASTER);\n\t\t\t\t\t\n\t\t\t\t\ttry \n\t\t\t\t\t{\n\t\t\t\t\t\tviewToControllerQueue.put(message);\n\t\t\t\t\t} \n\t\t\t\t\tcatch (InterruptedException e1) {}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase KeyEvent.VK_ENTER:\n\t\t\t\t\tif(lost)\n\t\t\t\t\t{\n\t\t\t\t\t\tview.getInGamePanel().setGameStart(true);\n\t\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setLost(false);\n\t\t\t\t\t\tlost = false;\n\t\t\t\t\t\tmessage = new Message(Message.ValveResponse.RESTART);\n\t\t\t\t\t\ttry \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tviewToControllerQueue.put(message);\n\t\t\t\t\t\t} \n\t\t\t\t\t\tcatch (InterruptedException e1) {}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(winLevel)\n\t\t\t\t\t{\n\t\t\t\t\t\tview.getInGamePanel().setGameStart(true);\n\t\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setWinLevel(false);\n\t\t\t\t\t\twinLevel = false;\n\t\t\t\t\t\tmessage = new Message(Message.ValveResponse.GET_NEXTLEVEL);\n\t\t\t\t\t\ttry \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tviewToControllerQueue.put(message);\n\t\t\t\t\t\t} \n\t\t\t\t\t\tcatch (InterruptedException e1) {}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak;\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic void keyReleased(KeyEvent e) {}\n\t\t});\n\t\t\n\t\t// PausePanel\n\t\t// back\n\t\tview.getPausePanel().getBack().addActionListener(event -> view.getInGamePanel().setGameStart(true));\n\t\tview.getPausePanel().getBack().addActionListener(event -> view.getFrame().remove(view.getPausePanel().getPausePanel()));\n\t\tview.getPausePanel().getBack().addActionListener(event -> view.getFrame().setSize(800, 890));\t\n\t\tview.getPausePanel().getBack().addActionListener(event -> view.getFrame().add(view.getInGamePanel().getInGamePanel()));\n\t\tview.getPausePanel().getBack().addActionListener(event -> view.getFrame().repaint());\n\t\tview.getPausePanel().getBack().addActionListener(event -> view.getFrame().pack());\n\t\t\t\t\n\t\t// LeaderBoardInPausePanel\n\t\tview.getPausePanel().getLeaderboardsButton().addActionListener(event -> view.getFrame().remove(view.getPausePanel().getPausePanel()));\n\t\tview.getPausePanel().getLeaderboardsButton().addActionListener(event -> view.getFrame().add(view.getLeaderboardInPausePanel().getLeaderboardPanel()));\n\t\tview.getPausePanel().getLeaderboardsButton().addActionListener(event -> view.getFrame().repaint());\n\t\tview.getPausePanel().getLeaderboardsButton().addActionListener(event -> view.getFrame().setSize(600, 800));\t\n\t\tview.getPausePanel().getLeaderboardsButton().addActionListener(event -> view.getFrame().pack());\n\t\t\n\t\t// ControlsPanel\n\t\tview.getPausePanel().getControlsButton().addActionListener(event -> view.getFrame().remove(view.getPausePanel().getPausePanel()));\n\t\tview.getPausePanel().getControlsButton().addActionListener(event -> view.getFrame().add(view.getControlsPanel().getControlsPanel()));\n\t\tview.getPausePanel().getControlsButton().addActionListener(event -> view.getFrame().repaint());\n\t\tview.getPausePanel().getControlsButton().addActionListener(event -> view.getFrame().setSize(600, 800));\t\n\t\tview.getPausePanel().getControlsButton().addActionListener(event -> view.getFrame().pack());\n\t\t\t\n\t\tview.getPausePanel().getReturnToMainManuButton().addActionListener(new ActionListener()\n\t\t{\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\t\t\t\t\n\t\t\t\tmessage = new Message(Message.ValveResponse.GET_NEWGAME);\n\t\t\t\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\tviewToControllerQueue.put(message);\n\t\t\t\t} \n\t\t\t\tcatch (InterruptedException e1) {}\n\t\t\t\t\n\t\t\t\tview.getFrame().remove(view.getPausePanel().getPausePanel());\n\t\t\t\tview.getFrame().add(view.getMainPanel().getMainPanel());\t\n\t\t\t\tview.getFrame().pack();\n\t\t\t\tview.getFrame().setSize(600, 800);\t\n\t\t\t\tview.getFrame().repaint();\n\t\t\t\t\n\t\t\t\t//viewAllPanels.getFrame().pack();\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t// LeaderboardInGame\n\t\tview.getLeaderboardInPausePanel().getBackButton().addActionListener(Event -> view.getFrame().remove(view.getLeaderboardInPausePanel().getLeaderboardPanel()));\n\t\tview.getLeaderboardInPausePanel().getBackButton().addActionListener(event -> view.getFrame().add(view.getPausePanel().getPausePanel()));\t\n\t\tview.getLeaderboardInPausePanel().getBackButton().addActionListener(event -> view.getFrame().repaint());\n\t\tview.getLeaderboardInPausePanel().getBackButton().addActionListener(event -> view.getFrame().setSize(600, 800));\t\n\t\tview.getLeaderboardInPausePanel().getBackButton().addActionListener(event -> view.getFrame().pack());\n\t\t\t\n\t\t// ControlPanel\n\t\tview.getControlsPanel().getBack().addActionListener(event -> view.getFrame().remove(view.getControlsPanel().getControlsPanel()));\n\t\tview.getControlsPanel().getBack().addActionListener(event -> view.getFrame().add(view.getPausePanel().getPausePanel()));\t\n\t\tview.getControlsPanel().getBack().addActionListener(event -> view.getFrame().repaint());\n\t\tview.getControlsPanel().getBack().addActionListener(event -> view.getFrame().setSize(600, 800));\t\n\t\tview.getControlsPanel().getBack().addActionListener(event -> view.getFrame().pack());\n\t}", "public void eventos() {\n btnAbrir.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent evt) {\n btnAbrirActionPerformed(evt);\n }\n });\n }", "public void addButtonListener(ActionListener l)\r\n\t{\r\n\t\tbnt_pane.addButtonListener(l);\r\n\t}", "public synchronized void addActionListener(java.awt.event.ActionListener listener) {\n \n if (myListenerList == null ) {\n myListenerList = new javax.swing.event.EventListenerList();\n }\n myListenerList.add(java.awt.event.ActionListener.class, listener);\n }", "public void registerComponents() {\r\n subAwardBudget.btnCancel.addActionListener(this);\r\n subAwardBudget.chkDetails.addActionListener(this);\r\n if(getFunctionType() != TypeConstants.DISPLAY_MODE) {\r\n subAwardBudget.btnAdd.addActionListener(this);\r\n subAwardBudget.btnDelete.addActionListener(this);\r\n subAwardBudget.btnOk.addActionListener(this);\r\n subAwardBudget.lstAttachments.addMouseListener(this);\r\n subAwardBudget.btnTranslate.addActionListener(this);\r\n subAwardBudget.btnUploadPDF.addActionListener(this);\r\n\r\n }else {\r\n subAwardBudget.btnAdd.setEnabled(false);\r\n subAwardBudget.btnDelete.setEnabled(false);\r\n subAwardBudget.btnOk.setEnabled(false);\r\n subAwardBudget.btnTranslate.setEnabled(false);\r\n subAwardBudget.btnUploadPDF.setEnabled(false);\r\n \r\n subAwardBudget.txtArComments.setEnabled(false);\r\n subAwardBudget.lstAttachments.addMouseListener(this);\r\n }\r\n // Added for COEUSQA-2115 : Subaward budgeting for Proposal Development - Start\r\n subAwardBudget.btnSubAwardDetails.addActionListener(this);\r\n // Added for COEUSQA-2115 : Subaward budgeting for Proposal Development - End\r\n subAwardBudget.btnViewPDF.addActionListener(this);\r\n subAwardBudget.btnViewXML.addActionListener(this);\r\n subAwardBudget.txtArStatus.setEnabled(false);\r\n \r\n //Make Table Single Selection\r\n subAwardBudget.tblSubAwardBudget.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r\n \r\n //Setup List Selection Listener so as to update details panel when row selection changes.\r\n subAwardBudget.tblSubAwardBudget.getSelectionModel().addListSelectionListener(this);\r\n \r\n subAwardDlgWindow.addEscapeKeyListener(\r\n new AbstractAction(\"escPressed\"){\r\n public void actionPerformed(ActionEvent ae){\r\n close();\r\n return;\r\n }\r\n });\r\n subAwardDlgWindow.setDefaultCloseOperation(CoeusDlgWindow.DO_NOTHING_ON_CLOSE);\r\n \r\n subAwardDlgWindow.addWindowListener(new WindowAdapter(){\r\n //public void windowActivated(WindowEvent we) {\r\n //requestDefaultFocus();\r\n //}\r\n public void windowClosing(WindowEvent we){\r\n close();\r\n }\r\n });\r\n }", "private void addMenuListeners()\n\t{\n\t\texit.addActionListener (new menuListener());\n\t\treadme.addActionListener (new menuListener());\n\t\tabout.addActionListener (new menuListener());\n\t\tsettings.addActionListener (new menuListener());\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tadd();\n\t\t\t}", "public void addPanelActionListeners() {\n\n iconBase = new IconFactory();\n\n JButton[] iconsArray = LeftPanel.getIconsArray();\n for (JButton button : iconsArray) {\n button.addMouseListener(new MouseAdapter() {\n @Override\n public void mouseClicked(MouseEvent e) {\n super.mouseClicked(e);\n selectedIconText = button.getText();\n }\n });\n\n button.addMouseListener(new MouseAdapter() {\n @Override\n public void mouseReleased(MouseEvent e) {\n super.mouseReleased(e);\n int tabIndex = jTabbedPane.getSelectedIndex();\n WorkingPanel tab = (WorkingPanel) jTabbedPane.getComponent(tabIndex);\n if (tab.getMousePosition() != null) {\n addIconToTab(tab, button.getText());\n tab.repaint();\n }\n\n }\n });\n\n button.addMouseMotionListener(new MouseAdapter() {\n @Override\n public void mouseDragged(MouseEvent e) {\n super.mouseDragged(e);\n selectedIconText = button.getText();\n\n int tabIndex = jTabbedPane.getSelectedIndex();\n WorkingPanel tab = (WorkingPanel) jTabbedPane.getComponent(tabIndex);\n\n icon = iconBase.getIconObject(button.getText(), tab);\n if (icon != null) {\n icon.draw(getGraphics(), (int) (MouseInfo.getPointerInfo().getLocation().getX() - button.getWidth() / 3),\n (int) (MouseInfo.getPointerInfo().getLocation().getY() - button.getHeight() / 3));\n }\n repaint();\n }\n });\n }\n }", "public void registerComponents() {\r\n maintainSponsorHierarchyBaseWindow.addVetoableChangeListener(this);\r\n maintainSponsorHierarchyBaseWindow.btnChangeGroupName.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.btnClose.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.btnCreateNewGroup.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.btnDelete.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.btnDetails.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.btnMoveDown.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.btnMoveUp.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.btnSave.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.btnSearchSponser.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.btnPanel.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.mnuItmChangeGroupName.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.mnuItmChangePassword.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.mnuItmClose.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.mnuItmCreateNewGroup.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.mnuItmDetails.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.mnuItmDelete.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.mnuItmExit.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.mnuItmInbox.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.mnuItmMoveDown.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.mnuItmMoveUp.addActionListener(this);\r\n //Added for Case#3682 - Enhancements related to Delegations - Start\r\n maintainSponsorHierarchyBaseWindow.mnuItmDelegations.addActionListener(this);\r\n //Added for Case#3682 - Enhancements related to Delegations - End\r\n maintainSponsorHierarchyBaseWindow.mnuItmPreferences.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.mnuItmSave.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.mnuItmPanel.addActionListener(this);\r\n maintainSponsorHierarchyBaseWindow.mnuItmSearchSponser.addActionListener(this);\r\n //Case 2110 Start\r\n maintainSponsorHierarchyBaseWindow.mnuItmCurrentLocks.addActionListener(this);\r\n //Case 2110 End\r\n //Addded for Case#2445 - proposal development print forms linked to indiv sponsor, should link to sponsor hierarchy - Start\r\n maintainSponsorHierarchyBaseWindow.mnuItmSponsorForm.addActionListener(this);\r\n //Case#2445 - End \r\n sponsorHierarchyTree.addTreeSelectionListener(this);\r\n sponsorHierarchyTree.addMouseListener(this);\r\n model.addTreeModelListener(this);\r\n }", "private void createListeners() {\n btGeneralSave.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n saveGeneralData();\n }\n });\n }", "public void addListeners() {\n\n startButton.addActionListener(e -> {\n if (play) {\n gameFrame.startGame();\n } else {\n gameFrame.stopGame();\n }\n play = !play;\n setTextOfStartPause();\n });\n saveButton.addActionListener(e -> {\n gameFrame.saveGame();\n });\n loadButton.addActionListener(e -> {\n gameFrame.loadGame();\n });\n resetButton.addActionListener(e -> {\n gameFrame.clearBoard();\n play = true;\n setTextOfStartPause();\n });\n exitButton.addActionListener(e -> {\n gameFrame.exitGame();\n });\n }", "public void addActionListener(final ActionListener l) {\r\n\r\n this.button.addActionListener(l);\r\n\r\n }", "public void addActionListener(ActionListener listener) {\n\t\tlisteners.add(listener);\n\t}", "private void addListeners() {\n\n\t\tfinal ComponentsController serviceController = (ComponentsController) componentsService;\n\t\t/*\n\t\t * service controller listener:\n\t\t */\n\t\tfinal ChangeListener changeListener = new ChangeListener() {\n\t\t\tpublic void modelChanged(ChangeEvent ce) {\n\t\t\t\tPmsChangeEvent event = (PmsChangeEvent) ce;\n\t\t\t\tswitch (event.getType()) {\n\t\t\t\t\tcase PmsChangeEvent.UPDATE:\n\t\t\t\t\t\tonComponentUpdate((InheritedComponentInstanceSelDTO) event.getEventInfo());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PmsChangeEvent.IMPORT:\n\t\t\t\t\t\ttryGetComponents();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: // event not expected: nothing to do here.\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tserviceController.addChangeListener(changeListener);\n\t\t\n\t\t// remove listener from components controller when this panel is detached\n\t\taddListener(Events.Detach, new Listener<BaseEvent>() {\n\t\t\tpublic void handleEvent(BaseEvent be) {\n\t\t\t\tserviceController.removeChangeListener(changeListener);\n\t\t\t}\n\t\t});\n\n\t\t/*\n\t\t * Grid RowClick listener\n\t\t */\n\t\tgrid.addListener(Events.RowClick, new Listener<GridEvent<InheritedComponentInstanceSelModelData>>() {\n\t\t\tpublic void handleEvent(GridEvent<InheritedComponentInstanceSelModelData> ge) {\n\t\t\t\tInheritedComponentInstanceSelModelData model = grid.getSelectionModel().getSelectedItem();\n\t\t\t\tif (model != null) {\n\t\t\t\t\tenableDisableButtons(model);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public void addActionListener (ActionListener listener) {\n\t\t_remoteButton.addActionListener(listener);\n\t}", "private void buttonInit() {\n panel.add(createButton);\n panel.add(editButton);\n panel.add(changeButton);\n createButton.addActionListener(this);\n editButton.addActionListener(this);\n changeButton.addActionListener(this);\n submitNewUser.addActionListener(this);\n editAccTypeBtn.addActionListener(this);\n changePassBtn.addActionListener(this);\n }", "public void registerButtons()\n\t{\n\t\tplot.addActionListener(new ButtonListener());\n\t\tin.addActionListener(new ButtonListener(1));\n\t\tout.addActionListener(new ButtonListener(2));\n\t\t\n\t}", "public void setListeners() {\n buttonPanel.getAddTask().addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n if (toDoList.toDoListLength() >= 6) {\n JDialog errorBox = new JDialog();\n JLabel errorMessage = new JLabel(\"You already have 6 Tasks remove one to add another\");\n errorBox.add(errorMessage);\n errorBox.setSize(450, 100);\n errorBox.setVisible(true);\n } else {\n addDialog = new AddDialog();\n addDialog.setVisible(true);\n addDialog.setSize(500, 500);\n acceptListener();\n }\n }\n });\n saveListener();\n removeListener();\n completeListener();\n editSetup();\n }", "public void addActionListener(ActionListener listener) {\n\t\tactionListener = AWTEventMulticaster.add(actionListener, listener);\n\t}", "public void setListeners(ActionListener l) {\n buttonListener = l;\n }", "public void addOperacoesListener(ActionListener a) {\n operacoesDiaB.addActionListener(a);\n }", "public void addActionListeners() {\n\t\tApp.sc.createListener(\"/\" + this.getID() + \"/action/sent\", new OSCListener() {\n\t\t\t@Override\n\t\t\tpublic void acceptMessage(Date time, OSCMessage message) {\n\t\t\t\tConnector actionOutConnector = getConnector(ConnectorType.ACTION_OUT);\n\t\t\t\tactionOutConnector.flashConnection();\n\t\t\t}\n\t\t});\n\t}", "private void registerListeners() {\n\t\t\n\t\t//Vertical coupler action listener\n\t\tvC.addActionListener(new ActionListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\t//divide facet option FALSE\n\t\t\t\tdivideFacet = false;\n\t\t\t\t//Edit button not enabled for couplers\n\t\t\t\tedit.setEnabled(false);\n\t\t\t\t//Extend button not enabled for couplers\n\t\t\t\textend.setEnabled(false);\n\t\t\t\t//Setting cursor icon configuration for vertical coupler\n\t\t\t\tbuttonAction(ValidOrientations.VERTICAL.getValue());\n\t\t\t\t//MType for couplers equals 1\n\t\t\t\tmType = ValidCouplerMullions.COUPLER.getValue();\n\t\t\t\t//Semaphore vertical coupler option\n\t\t\t\tselectedHV = ValidOrientations.VERTICAL.getValue();\n\t\t\t\t//Semaphore level selected\n\t\t\t\tselectedLevel = ValidCouplerMullions.COUPLER.getValue();\n\n //Filter valid coupler verticals\n List<TypeCouplerMullion> validCouplers = couplerMullionController.filterCouplerMullion(ValidCouplerMullions.COUPLER.getValue(),\n ValidOrientations.VERTICAL.getValue());\n\n List<TypeCouplerMullion> validDividers = couplerMullionController.filterCouplerMullion(ValidCouplerMullions.DIVIDER.getValue(),\n ValidOrientations.VERTICAL.getValue());\n\n validCouplers.addAll(validDividers);\n\n //Init coupler types comboBox\n\t\t\t\tDefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel(validCouplers.toArray());\n couplerTypeC.setModel(comboBoxModel);\n\t\t\t\tcouplerTypeC.setSelectedIndex(0);\n\t\t\t\t\n\t\t\t\t//Remove components options which feature\n\t\t\t\twhichFeature.remove(couplerTypeC);\n\t\t\t\twhichFeature.remove(edit);\n\t\t\t\twhichFeature.remove(extend);\n\t\t\t\t\n\t\t\t\twhichFeature.add(couplerTypeC, new XYConstraints(2, 22, 180, 19));\n\t\t\t\t\n\t\t\t\twhichFeature.validate();\n\t\t\t\twhichFeature.repaint();\n\t\t\t}\n\t\t});\n\t\t\n\t\t//Horizontal coupler action listener\n\t\thC.addActionListener(new ActionListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\t//Semaphore divide facet option FALSE\n\t\t\t\tdivideFacet = false;\n\t\t\t\t//Edit button disabled for horizontal coupler\n\t\t\t\tedit.setEnabled(false);\n\t\t\t\t//Extend button disabled for horizontal coupler\n\t\t\t\textend.setEnabled(false);\n\t\t\t\t//Semaphore level selected\n\t\t\t\tselectedLevel = ValidCouplerMullions.COUPLER.getValue();\n\t\t\t\t//Setting cursor icon configuration for horizontal coupler\n\t\t\t\tbuttonAction(ValidOrientations.HORIZONTAL.getValue());\n\t\t\t\t//MType for couplers equals 1\n\t\t\t\tmType = ValidCouplerMullions.COUPLER.getValue();\n\t\t\t\t//Semaphore horizontal coupler option\n\t\t\t\tselectedHV = ValidOrientations.HORIZONTAL.getValue();\n\t\t\t\t\n\t\t\t\t//Filter valid coupler verticals\n\t\t\t\tList<TypeCouplerMullion> validCouplers = couplerMullionController.filterCouplerMullion(ValidCouplerMullions.COUPLER.getValue(),\n\t\t\t\t\t\t\tValidOrientations.HORIZONTAL.getValue());\n\t\t\t\t\n\t\t\t\t//Init coupler types comboBox\n\t\t\t\tDefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel(validCouplers.toArray());\n couplerTypeC.setModel(comboBoxModel);\n couplerTypeC.setSelectedIndex(0);\n\t\t\t\t\n\t\t\t\t//Remove components options which feature\n\t\t\t\twhichFeature.remove(couplerTypeC);\n\t\t\t\twhichFeature.remove(edit);\n\t\t\t\twhichFeature.remove(extend);\n\t\t\t\t\n\t\t\t\twhichFeature.add(couplerTypeC, new XYConstraints(2, 22, 180, 19));\n\t\t\t\t\n\t\t\t\twhichFeature.validate();\n\t\t\t\twhichFeature.repaint();\n\t\t\t}\n\t\t});\n\t\t\n\t\tvM.addActionListener(new ActionListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\t//myParent.clearCMAlignEdit();\n\t\t\t\tdivideFacet = false;\n\t\t\t\t//MType for mullions equals 2\n\t\t\t\tmType = ValidCouplerMullions.MULLION.getValue();\n\t\t\t\t//Vertical mullions position\n\t\t\t\tselectedHV = ValidOrientations.VERTICAL.getValue();\n\t\t\t\t//Level selected for mullions\n\t\t\t\tselectedLevel = ValidCouplerMullions.MULLION.getValue();\n\t\t\t\t//Edit button enabled for vertical mullions\n\t\t\t\tbuttonAction(ValidOrientations.VERTICAL.getValue());\n\t\t\t\t//Extends button enabled for vertical mullions\n\t\t\t\tenableDisableBySeries();\n\t\t\t\t\n\t\t\t\t//Filter valid coupler verticals\n\t\t\t\tList<TypeCouplerMullion> validMullions = couplerMullionController.filterCouplerMullion(ValidCouplerMullions.MULLION.getValue(),\n\t\t\t\t\t\t\tValidOrientations.VERTICAL.getValue());\n\t\t\t\t\n\t\t\t\t//Init mullion types comboBox\n DefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel(validMullions.toArray());\n couplerTypeC.setModel(comboBoxModel);\n couplerTypeC.setSelectedIndex(0);\n\n whichFeature.remove(couplerTypeC);\n\n\t\t\t\twhichFeature.add(edit, new XYConstraints(132, 0, 24, 19));\n\t\t\t\twhichFeature.add(extend, new XYConstraints(156, 0, 24, 19));\n whichFeature.add(couplerTypeC, new XYConstraints(2, 22, 180, 19));\n\t\t\t\t\n\t\t\t\twhichFeature.validate();\n\t\t\t\twhichFeature.repaint();\n\t\t\t}\n\t\t});\n\t\t\n\t\thM.addActionListener(new ActionListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\t//myParent.clearCMAlignEdit();\n\t\t\t\tdivideFacet = false;\n\t\t\t\t//MType for mullions equals 2\n\t\t\t\tmType = ValidCouplerMullions.MULLION.getValue();\n\t\t\t\t//Horizontal mullions position\n\t\t\t\tselectedHV = ValidOrientations.HORIZONTAL.getValue();\n\t\t\t\t//Selected level for mullions equals 2\n\t\t\t\tselectedLevel = ValidCouplerMullions.MULLION.getValue();\n\t\t\t\t//Edit panel enabled for mullions\n\t\t\t\tenableDisableBySeries();\n\t\t\t\tbuttonAction(ValidOrientations.HORIZONTAL.getValue());\n\t\t\t\t//Filter valid coupler verticals\n\t\t\t\tList<TypeCouplerMullion> validMullions = couplerMullionController.filterCouplerMullion(ValidCouplerMullions.MULLION.getValue(),\n\t\t\t\t\t\t\tValidOrientations.HORIZONTAL.getValue());\n\n //Init mullion types comboBox\n DefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel(validMullions.toArray());\n couplerTypeC.setModel(comboBoxModel);\n couplerTypeC.setSelectedIndex(0);\n\n whichFeature.remove(couplerTypeC);\n\n\t\t\t\twhichFeature.add(edit, new XYConstraints(132, 0, 24, 19));\n\t\t\t\twhichFeature.add(extend, new XYConstraints(156, 0, 24, 19));\n whichFeature.add(couplerTypeC, new XYConstraints(2, 22, 180, 19));\n\t\t\t\t\n\t\t\t\twhichFeature.validate();\n\t\t\t\twhichFeature.repaint();\n\t\t\t}\n\t\t});\n\t\t\n\t\tcancel.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\t//Setting edit visible\n\t\t\t\tsetEditVisible(false, null);\n\t\t\t\t\n\t\t\t\tif (hM.isSelected() || vM.isSelected()) {\n\t\t\t\t\tenableDisableBySeries();\n\t\t\t\t} else if (hC.isSelected() || vC.isSelected()) {\n\t\t\t\t\tenableDisableBySeries();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\t//Edit mullions action listener\n\t\tedit.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\textend.setSelected(false);\n\t\t\t\tedit.setSelected(true);\n\t\t\t\t\n\t\t\t\t//Call edit action event\n\t\t\t\tedit_actionPerformed(e);\n\t\t\t}\n\t\t});\n\t\t\n\t\tpfCombo.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tcomboPF(true);\n\t\t\t}\n\t\t});\n\t\t\n\t\t//Coupler type comboBox listener\n\t\tthis.couplerTypeC.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tcoupleTypeAction();\n\t\t\t}\n\t\t});\n\t\t\n\t\tthis.part.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\tif (part.isSelected()) {\n\t\t\t\t\tparts.setEnabled(true);\n\t\t\t\t\tsetGo.setEnabled(true);\n\t\t\t\t} else {\n\t\t\t\t\tparts.setEnabled(false);\n\t\t\t\t\tif (!endTypeLT.isSelected() && !endTypeRB.isSelected() && !pfFormL.isSelected()) {\n\t\t\t\t\t\tsetGo.setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tthis.extend.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\textend.setSelected(true);\n\t\t\t\tedit.setSelected(false);\n\t\t\t\tcont_actionPerformed(e);\n\t\t\t}\n\t\t});\n\t\t\n\t\tendTypeLT.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (endTypeLT.isSelected()) {\n\t\t\t\t\tlCut.setEnabled(true);\n\t\t\t\t\tsetGo.setEnabled(true);\n\t\t\t\t} else {\n\t\t\t\t\tlCut.setEnabled(false);\n\t\t\t\t\tif (!part.isSelected() && !endTypeRB.isSelected() && !pfFormL.isSelected()) {\n\t\t\t\t\t\tsetGo.setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tendTypeRB.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (endTypeRB.isSelected()) {\n\t\t\t\t\trCut.setEnabled(true);\n\t\t\t\t\tsetGo.setEnabled(true);\n\t\t\t\t} else {\n\t\t\t\t\trCut.setEnabled(false);\n\t\t\t\t\tif (!endTypeLT.isSelected() && !part.isSelected() && !pfFormL.isSelected()) {\n\t\t\t\t\t\tsetGo.setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tpfFormL.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (pfFormL.isSelected()) {\n\t\t\t\t\tpfCombo.setEnabled(true);\n\t\t\t\t\toffsetLT.setEnabled(true);\n\t\t\t\t\toffsetRB.setEnabled(true);\n\t\t\t\t\tdeltaL.setEnabled(true);\n\t\t\t\t\tdeltaR.setEnabled(true);\n\t\t\t\t\toffsetL.setEnabled(true);\n\t\t\t\t\toffsetR.setEnabled(true);\n\t\t\t\t\tsetGo.setEnabled(true);\n\t\t\t\t} else {\n\t\t\t\t\tpfCombo.setEnabled(false);\n\t\t\t\t\toffsetLT.setEnabled(false);\n\t\t\t\t\toffsetRB.setEnabled(false);\n\t\t\t\t\tdeltaL.setEnabled(false);\n\t\t\t\t\tdeltaR.setEnabled(false);\n\t\t\t\t\toffsetL.setEnabled(false);\n\t\t\t\t\toffsetR.setEnabled(false);\n\t\t\t\t\tif (!endTypeLT.isSelected() && !part.isSelected() && !part.isSelected()) {\n\t\t\t\t\t\tsetGo.setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tsetGo.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tset_actionPerformed(e);\n\t\t\t}\n\t\t});\n\t}", "public synchronized void addActionListener(ActionListener al) {\n actionListener = AWTEventMulticaster.add(actionListener, al);\n }", "public void addButtonListener(ActionListener listAll,ActionListener searchName,ActionListener searchId,\n\t\t\tActionListener searchQty, ActionListener decrease,ActionListener addRemove, ActionListener submitName,ActionListener submitID,\n\t\t\tActionListener submitQty,ActionListener submitAdd,ActionListener submitDelete) {\n\t\tlistAllButton.addActionListener(listAll);\n\t\tsearchNameButton.addActionListener(searchName);\n\t\tsearchIDButton.addActionListener(searchId);\n\t\tsearchQuantButton.addActionListener(searchQty);\n\t\tdecreaseButton.addActionListener(decrease);\n\t\taddDeleteButton.addActionListener(addRemove);\n\t\tpromptNameSubmit.addActionListener(submitName);\n\t\tenterIDSubmit.addActionListener(submitID);\n\t\tpromptQtySubmit.addActionListener(submitQty);\n\t\taddButton.addActionListener(submitAdd);\n\t\tdeleteButton.addActionListener(submitDelete);\n }", "private void addALlListeners() {\n\n\t\t// Add phrase listener\n\t\tview.getAddButton().addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString english = view.getEnglishTextField().getText();\n\t\t\t\tString chinese = view.getChineseTextField().getText();\n\t\t\t\tif (english.equals(\"\") && chinese.equals(\"\"))\n\t\t\t\t\treturn;\n\t\t\t\tPhrase p = new Phrase(english, chinese, null);\n\t\t\t\tselectedLesson.addPhrase(p);\n\t\t\t\tview.addPhrase(p);\n\t\t\t\tview.clearEnglishChineseTextField();\n\t\t\t}\n\t\t});\n\n\t\t// Delete phrase listener\n\t\tview.getDeleteButton().addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tint index = view.getPhraseTable().getSelectedRow();\n\t\t\t\tif (index == -1)\n\t\t\t\t\treturn;\n\t\t\t\tPhrase p = selectedLesson.getPhrase(index);\n\t\t\t\tselectedLesson.deletePhrase(p);\n\t\t\t\tview.deletePhrase(index);\n\t\t\t}\n\t\t});\n\n\t\t// Test lesson listener\n\t\tview.getTestButton().addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tTestController.getTestController().setLesson(selectedLesson);\n\t\t\t\tMainController.getMainController().setVisible(false);\n\t\t\t\tselectedLesson.setNeededToRestore(true);\n\t\t\t}\n\t\t});\n\n\t\t// Learn lesson listener\n\t\tview.getLearnButton().addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnew LearnController(selectedLesson);\n\t\t\t\tMainController.getMainController().setVisible(false);\n\t\t\t\tselectedLesson.setNeededToRestore(true);\n\t\t\t}\n\t\t});\n\n\t\t// Sound listener\n\t\tview.getPhraseTable().addMouseListener(new SoundAdapter());\n\n\t}", "private void setActionListeners() {\r\n gm.getSave().addActionListener(e -> {\r\n gtm.saveChanges();\r\n this.serialize();\r\n });\r\n gm.getSaveAs().addActionListener(e -> {\r\n gtm.saveChanges();\r\n this.serializeAs();\r\n });\r\n gm.getOpen().addActionListener(e -> {\r\n if (!newFile && !path.equals(\"\")) {\r\n this.serializeBeforeOpen();\r\n }\r\n this.serializeOpen();\r\n });\r\n gm.getNewToDo().addActionListener(e -> {\r\n gtm.addToDo();\r\n });\r\n gm.getClose().addActionListener(e -> {\r\n System.exit(0);\r\n });\r\n gm.getMinimize().addActionListener(e -> {\r\n this.setState(Frame.ICONIFIED);\r\n });\r\n gm.getZoom().addActionListener(e -> {\r\n this.setExtendedState(this.getExtendedState() | JFrame.MAXIMIZED_BOTH);\r\n });\r\n }", "public void addListeners() {\n\t\tsave.addActionListener(new ActionListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t//Set the window variables\r\n\t\t\t\tEnvironmentVariables.setWidth(Float.parseFloat(width.getText()));\r\n\t\t\t\tEnvironmentVariables.setHeight(Float.parseFloat(height.getText()));\r\n\t\t\t\tEnvironmentVariables.setTitle(title.getText());\r\n\t\t\t\tupdateGameWorld();\r\n\t\t\t\t//go to save function\r\n\t\t\t\tsaveGame();\r\n\t\t\t\t\r\n\t\t\t\tWindow.getFrame().setVisible(false);\r\n\t\t\t\tWindow.getFrame().dispose();\r\n\t\t\t\t\r\n\t\t\t\tHomePage.buildHomePage();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\t//reset to empty world\r\n\t\treset.addActionListener(new ActionListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tEnvironmentVariables.clearWorld();\r\n\t\t\t\tWindow.render();\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private void populateControlPanel() {\n \n ControlListener control = new ControlListener();\n startStopButton = new JButton(\"Start/Stop\");\n startStopButton.addActionListener(control);\n \n saveButton = new JButton(\"Save\");\n saveButton.addActionListener(control);\n \n loadButton = new JButton(\"Load\");\n loadButton.addActionListener(control);\n \n resetButton = new JButton(\"Reset\");\n resetButton.addActionListener(control);\n \n add(startStopButton);\n add(saveButton);\n add(loadButton);\n add(resetButton);\n }", "public void addActionEvent()\n {\n\t depositButton.addActionListener(this);\n \n }", "private void addComponents(){\n GridBagConstraints constraints = new GridBagConstraints();\n constraints.anchor = GridBagConstraints.WEST;\n constraints.insets = new Insets(5, 5, 5, 5);\n constraints.fill = GridBagConstraints.BOTH;\n \n // Add components to the panel\n // Note>> the constraints are applied to both panels\n constraints.gridx = 0;\n constraints.gridy = 0; \n subPanel1.add(onDo1, constraints); // Add button to pane 1\n\n constraints.gridx = 1;\n subPanel1.add(onDo2, constraints); // Add button to pane 1\n \n constraints.gridx = 0;\n constraints.gridy = 1; \n subPanel1.add(onDo3, constraints); // Add button to pane 1\n subPanel2.add(l1, constraints); // Add button to pane 2\n \n constraints.gridx = 1;\n constraints.gridy = 1;\n subPanel1.add(onDo4, constraints); // Add button to pane 1\n \n\n // Set border for sub panel 1 \n subPanel1.setBorder(BorderFactory.createTitledBorder(\n BorderFactory.createEtchedBorder(), \"Events\"));\n \n // Set border for sub panel 2 \n subPanel2.setBorder(BorderFactory.createTitledBorder(\n BorderFactory.createEtchedBorder(), \"Debug\"));\n }", "void addButton_actionPerformed(ActionEvent e) {\n addButton();\n }", "private void addActions()\r\n\t{\n\t\tPlay.addActionListener(new ActionListener()\r\n\t\t{\r\n\t\t\t//Take action performed into a variable for usage\r\n\t\t\tpublic void actionPerformed(ActionEvent e)\r\n\t\t\t{\r\n\t\t\t\t//Wipes out jframe of menu\r\n\t\t\t\tdispose();\r\n\t\t\t\t//then creates new jframe for pong game\r\n\t\t\t\tGame game = new Game();\r\n\t\t\t\t\r\n\t\t\t\tgame.go();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//quit button quits game\r\n\t\tQuit.addActionListener(new ActionListener(){\r\n\t\t\tpublic void actionPerformed(ActionEvent e)\r\n\t\t\t{\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "public void addBtnDodajListener(ActionListener ae) {\n btnDodaj.addActionListener(ae);\n }", "private void registerListeners() {\n\n\t\tline.addActionListener(new LineButtonListener());\n\t\trect.addActionListener(new RectButtonListener());\n\t\toval.addActionListener(new OvalButtonListener());\n\t\timage.addActionListener(new ImageButtonListener());\n\n\t\tMouseListener listener = new ListenToMouse();\n\t\tMouseMotionListener motionListener = new ListenToMouse();\n\n\t\tcanvas.addMouseMotionListener(motionListener);\n\t\tcanvas.addMouseListener(listener);\n\n\t}", "public void addActionListener(ActionListener a) {\n\t\tb.addActionListener(a);\n\t}", "public void registerComponents() \r\n {\r\n grantsByPIForm.jbnRunButton.addActionListener(this);\r\n grantsByPIForm.jbnCloseButton.addActionListener(this);\r\n \r\n }", "@Override\r\n\tprotected SelectionListener createAddButtonActionListener() {\r\n\t\t// the value must by initialized! (don't return new AddActionListener()) \r\n\t\tthis.addButtonListener = new EventTypeAddActionListener();\r\n\t\t\r\n\t\treturn addButtonListener;\r\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\tString cmd = e.getActionCommand();\n\t\tif (cmd.equals(\"Add ball\"))\t{\n\t\t\tadd(ball1.getGOval());\n\t\t\tadd(ball2.getGOval());\n\t\t\tadd(ball3.getGOval());\n\t\t}\n\t}", "public void addComboBoxListener(Controller controller){\n\t\tfilmComboBox.addActionListener(controller);\n\t\tmusicComboBox.addActionListener(controller);\n\t}", "private void setActionListener() {\r\n\t\tactListener = new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tactController.handleMenuAction(e);\r\n\t\t\t}\r\n\t\t};\r\n\t}", "public void addActionListener(ActionListener l) {\n\t\tactionListeners.add(l);\n\t}", "void setActionListener(ActionListener listener) {\n goButton.addActionListener(listener);\n for (JRadioButton rb : buttons) {\n rb.addActionListener(listener);\n }\n }", "private void agregarComponentes() {\n JButton botonEstudiante = new JButton(\"Estudiante\");\r\n JButton botonDocente = new JButton(\"Docente\");\r\n JButton botonEquipo = new JButton(\"Equipo\");\r\n\r\n botonEstudiante.addActionListener(new OyenteListaEstudiante(this));\r\n botonDocente.addActionListener(new OyenteListaDocente(this));\r\n botonEquipo.addActionListener(new OyenteListaEquipo(this));\r\n\r\n // crea objeto Box para manejar la colocación de areaConsulta y\r\n // botonEnviar en la GUI\r\n Box boxNorte = Box.createHorizontalBox();\r\n boxNorte.add(botonDocente);\r\n boxNorte.add(botonEstudiante);\r\n boxNorte.add(botonEquipo);\r\n\r\n // crea delegado de JTable para modeloTabla\r\n tablaDatosIngresdos = new JTable();\r\n add(boxNorte, BorderLayout.NORTH);\r\n\r\n add(new JScrollPane(tablaDatosIngresdos), BorderLayout.CENTER);\r\n\r\n }", "public static void addActionListener(Compile compile) {\n\r\n\t}", "private void addComponents() {\n LOOGER.info(\"Get add Components Entry\");\n // Adding loadButton to first row.\n this.add(loadButton);\n\n // Adding fillButton to first row.\n this.add(fillButton);\n\n // Adding deleteButton to first row.\n this.add(deleteButton);\n LOOGER.info(\"add Components exit\");\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\taddAction();\n\t\t\t}", "public void addMenuItems()\n\t{\n\t\tstartButton = new JButton(\"Start\");\n\t\tstartButton.setLayout(null);\n\t\tstartButton.setBounds(350, 225, 100, 50);\n\t\t\n\t\toptionsButton = new JButton(\"Options\");\n\t\toptionsButton.setLayout(null);\n\t\toptionsButton.setBounds(350, 275, 100, 50);\n\t\t\n\t\texitButton = new JButton(\"Exit\");\n\t\texitButton.setLayout(null);\n\t\texitButton.setBounds(350, 375, 100, 50);\n\t\texitButton.setActionCommand(\"exit\");\n\t\texitButton.addActionListener((ActionListener) this);\n\t\t\n\t\tmainMenuPanel.add(startButton);\n\t\tmainMenuPanel.add(optionsButton);\n\t\tmainMenuPanel.add(startButton);\n\t}", "public synchronized void addActionListener(ActionListener l) {\n if (l == null) {\n return;\n }\n actionListener = AWTEventMulticaster.add(actionListener, l);\n newEventsOnly = true;\n }", "private void setupListeners() {\n\t\tfor (int i = 0; i < _controlPoints.length; i++) {\n\t\t\taddControlPointListener(_controlPoints[i][0], i);\n\t\t\taddControlPointListener(_controlPoints[i][1], i);\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < _selectionButtons.length; i++) {\n\t\t\taddPointSelectionButtonListener(i);\n\t\t}\n\t}", "private void installListeners() {\r\n\t\tcboText.addActionListener(this);\r\n\r\n\t\tComponent c = cboText.getEditor().getEditorComponent();\r\n\t\tif (c instanceof JTextComponent) {\r\n\t\t\t((JTextComponent) c).getDocument().addDocumentListener(this);\r\n\t\t}\r\n\r\n\t\tbtnFind.addActionListener(this);\r\n\t\tbtnReplace.addActionListener(this);\r\n\t\tbtnReplaceAll.addActionListener(this);\r\n\t\tbtnReplaceFind.addActionListener(this);\r\n\r\n\t\trbAll.addActionListener(this);\r\n\t\trbSelectedLines.addActionListener(this);\r\n\r\n\t\tcbUseRegex.addItemListener(this);\r\n\t}", "public void addActionListener(ActionListener listener) {\n\t\tthis.home.addActionListener(listener);\n\t}", "public synchronized void addActionListener(ActionListener l) {\n listenerList.add(ActionListener.class, l);\n }", "public JInputPanel() {\n initComponents();\n listeners = new Vector();\n blue =txtBlue.getValue();\n green =txtGreen.getValue();\n red =txtRed.getValue();\n \n// sldRe.addActionListener(new ActionListener() {\n// public void actionPerformed(ActionEvent e) {\n// \n// }});\n \n \n }", "private void addComponents() {\n\t\tthis.add(btn_pause);\n\t\tthis.add(btn_continue);\n\t\tthis.add(btn_restart);\n\t\tthis.add(btn_rank);\n\t\tif(Config.user.getUsername().equals(\"root\")) {\n\t\t\tthis.add(btn_admin);\n\t\t}\n\t\n\t\t\n\t}", "public void createEvents(){\r\n\t\tbtnCurrent.addActionListener((ActionEvent e) -> JLabelDialog.run());\r\n\t}", "public void addActionListener(ActionListener l) {\r\n applyButton.addActionListener(l);\r\n }", "private void adicionaListeners() {\r\n\t\t\taddFocusListener(this);\r\n\t\t\taddKeyListener(this);\r\n\t\t\taddMouseListener(this);\r\n\t\t}", "public void actionPerformed (ActionEvent e)\n \t\t{\n \t\t\tjP.add(textField);\n \t\t\tjP.add(label);\n \t\t\t\n \t\t\t// Set position of TExt Field\n \t \ttextField.setBounds(350, 463, 125, 25);\n \t \t\n \t \tlabel.setBounds(15, 450, 500, 50);\n \t \tlabel.setFont(arial);\n \t\t\t\n \t \t// Remove the 2 Buttons\n \t\t\tjP.remove(call);\n \t\t\tjP.remove(raise);\n \t\t\t\n \t\t\t// Add a 2nd raise Button\n \t\t\tjP.add(raise2);\n \t\t\traise2.setBounds(500, 460, 80, 30);\n \t\t\t\n \t\t\t// Repaint and update the J Panel\n \t\t\tjP.repaint();\n \t\t}", "protected void setupListeners() {\n\t\t\n\t\tloginBtn.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent click) {\n\t\t\t\tSession session = theController.validateUser(usernameField.getText(), passwordField.getText());\n\t\t\t\tif(session != null) {\n\t\t\t\t\ttheController.login();\n\t\t\t\t} else {\n\t\t\t\t\tlblInvalid.setVisible(true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tbtnRegister.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent click) {\n\t\t\t\ttheController.register();\n\t\t\t}\n\t\t});\n\t\t\n\t\tbtnGuide.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent click) {\n\t\t\t\ttheController.viewGuide();\n\t\t\t}\n\t\t});\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource()==addname) {\n\t\t\tAddName();\n\t\t}\n\t\tif(e.getSource()==viewnames) {\n\t\t\tViewNames();\n\t\t}\n\t}", "public void addActionListener(ActionListener al) {\n if (!actionListeners.contains(al)) {\n actionListeners.add(al);\n }\n }", "public void setActionListeners(ActionListener actionListener) {\n setRegisterButtonListener(actionListener);\n setMenuButtonListener(actionListener);\n }", "private void addListeners() {\n\t\t\n\t\tloadJokesOptionMenu.addActionListener((event) -> {\n\t\t\tJFileChooser openDialog = new JFileChooser();\n\t\t\t\n\t\t FileNameExtensionFilter filter = new FileNameExtensionFilter(\"text files\", \"txt\");\n\t\t openDialog.setFileFilter(filter);\n\t\t int returnVal = openDialog.showOpenDialog(null);\n\t\t if(returnVal == JFileChooser.APPROVE_OPTION) {\t \n\t\t jokeFile = openDialog.getSelectedFile().getAbsolutePath();\n\t\t }\n\t\t});\n\t\t\n\t\tstartServerFileMenu.addActionListener(event -> startServer());\n\t\tstopServerFileMenu.addActionListener(event -> stopServer());\n\t\t\n\t\texitFileMenu.addActionListener(event -> quitApp());\n\n\t\tsetupServerInfoOptionMenu.addActionListener(event -> setupServerInfo());\n\t\t\n\t\taboutHelpMenu.addActionListener(event -> {\n\t\t\tJOptionPane.showMessageDialog(null, \"Knock Knock Server v1.0 Copyright 2017 RLTech Inc\");\n\t\t});\n\t\t\n\t\tstartServerToolBarButton.addActionListener(event -> {\n\t\t\tstartServer();\n\t\t\tstartServerToolBarButton.setEnabled(false);\n\t\t\tstopServerToolBarButton.setEnabled(true);\n\t\t});\n\t\t\n\t\tstopServerToolBarButton.addActionListener(event -> {\n\t\t\tstopServer();\n\t\t\tstartServerToolBarButton.setEnabled(true);\n\t\t\tstopServerToolBarButton.setEnabled(false);\n\t\t});\n\n\t\tkkClientToolBarButton.addActionListener(event -> {\n\n\t\t\ttry {\n\t\t\t\tRuntime.getRuntime().exec(\"java -jar KKClient.jar\");\n\t\t\t} catch (IOException e1) {\n\t\t\t\t//e1.printStackTrace();\n\t\t\t\tUtility.displayErrorMessage(\"Fail to find or launch KKClient.jar client app. Make sure Java run time (JRE) is installed and KKClient.jar is stored in the same path as this server app.\");\n\t\t\t}\n\t\t});\n\t\t\n\t\taddWindowListener(new WindowAdapter() {\n\t\t public void windowClosing(WindowEvent e) {\n\t\t \tquitApp();\t\n\t\t }\n\t\t});\n\t}" ]
[ "0.7544628", "0.70504725", "0.70274967", "0.7007636", "0.69900686", "0.6946617", "0.69072986", "0.6870675", "0.6811738", "0.6727979", "0.67126465", "0.6658835", "0.66560894", "0.6621376", "0.6617824", "0.65839547", "0.65759295", "0.6573816", "0.653521", "0.65268123", "0.6512007", "0.6507396", "0.64713955", "0.6459756", "0.64584625", "0.6436659", "0.64360726", "0.64246374", "0.6419389", "0.63850415", "0.6341001", "0.630784", "0.62864023", "0.62710065", "0.62471074", "0.6228139", "0.622746", "0.6223528", "0.62228626", "0.62142104", "0.6206824", "0.6201929", "0.6160846", "0.6158737", "0.6139453", "0.61233735", "0.61084765", "0.6097044", "0.60948753", "0.6093701", "0.60936743", "0.60913664", "0.6077333", "0.6075056", "0.60668993", "0.6060675", "0.60574114", "0.6047204", "0.6040535", "0.6038996", "0.60377634", "0.60366446", "0.6034256", "0.60061604", "0.5997844", "0.5997087", "0.59958583", "0.5994204", "0.59828657", "0.59496367", "0.59487283", "0.5945624", "0.59390444", "0.59389", "0.59367406", "0.5931607", "0.59293795", "0.59268814", "0.59252137", "0.59093106", "0.59057146", "0.59012306", "0.58717614", "0.58704406", "0.5867292", "0.58640873", "0.5862958", "0.5859035", "0.58577895", "0.5849319", "0.58328384", "0.58298105", "0.5817464", "0.5809177", "0.580296", "0.58027315", "0.5801407", "0.580011", "0.57916427", "0.5787321" ]
0.60643977
55
========================================================================== Accessor Method(s) ========================================================================== get VIN field
public String getVinField() { return vinField.getText(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getVin() {\r\n return vin;\r\n }", "public String getVin() {\r\n return vin;\r\n }", "public String getVin() {\n\t\treturn vin;\n\t}", "@java.lang.SuppressWarnings(\"all\")\n\[email protected](\"lombok\")\n\tpublic Integer getVout() {\n\t\treturn this.vout;\n\t}", "public String getCsVin() {\n return csVin;\n }", "public int getRayonV(){\r\n\t\treturn rayonV;\r\n\t}", "public int getVx() { return vx; }", "public double getV() {\r\n\t\treturn v;\t\r\n\t\t}", "public IPV getPV(){\n return pvMap.get(IPVWidgetModel.PROP_PVNAME);\n }", "@Override\n\tpublic Integer getV() {\n\t\treturn this.v;\n\t}", "public java.lang.Integer getVaccinId () {\n\t\treturn vaccinId;\n\t}", "public int getPesoV() \r\n\t\t{\r\n\t\t\treturn PesoV;\r\n\t\t}", "public int getUlIdInvoInvoice()\r\n {\r\n return this._ulIdInvoInvoice;\r\n }", "int getVpotNum();", "int getVbNum();", "public long getV() {\n return v;\n }", "public final long getUIN() {\n\t return icqUIN;\n }", "public int getVoltage ()\n {\n return _voltage;\n }", "public IVA getIva() {\n return iva;\n }", "private int getVol() {\r\n\r\n\t\treturn dayVolume;\r\n\t}", "int getInverterCurrentRaw();", "public float getVolum() {\n return volum;\n }", "int getInputVoltageRaw();", "@Basic @Immutable\n\tpublic double getVxi() {\n\t\treturn this.vxi;\n\t}", "@Basic\n\tpublic double getVx() {\n\t\treturn this.vx;\n\t}", "public Byte getVipLevel() {\n return vipLevel;\n }", "public VectorN getV()\n\t{\n\t\tVectorN out = new VectorN(3);\n\t\tout.x[0] = this.rv.x[3];\n\t\tout.x[1] = this.rv.x[4];\n\t\tout.x[2] = this.rv.x[5];\n\t\treturn out;\n\t}", "public String getCvvNumber();", "public double getV() {\r\n return Math.sqrt(Math.pow(this.dx, 2) + Math.pow(this.dy, 2));\r\n }", "public int getVeinCount() {\n return veinCount;\n }", "String getV();", "public E getIn() {\n return in;\n }", "EDataType getVoltage();", "public float getVlValor() {\n return vlValor;\n }", "int getOutputVoltageRaw();", "public int mo23280V() {\n return ((Integer) this.f13965a.mo23249a(C7196pb.f13764V)).intValue();\n }", "public int getvID() {\n return vID;\n }", "public String getIsontv() {\r\n return isontv;\r\n }", "public java.math.BigDecimal getVat () {\n\t\treturn vat;\n\t}", "double getVx() { return vel[0]; }", "int getInputVoltage();", "public int getVideobitrate() {\n return videobitrate;\n }", "public String getvNumreg() {\n return vNumreg;\n }", "public Invima getInvima(){\n\t\treturn invima;\n\t}", "public void setVin(String vin) {\n\t\tthis.vin = vin == null ? null : vin.trim();\n\t}", "public void setVin(String vin) {\r\n this.vin = vin == null ? null : vin.trim();\r\n }", "public Vector2d getVve() {\n return vve;\n }", "public long getBytesIn()\n {\n return fBytesIn;\n }", "double getVz() { return vel[2]; }", "public int getP2ValueInInt() {\n\t\treturn P2ValueInInt;\n\t}", "int getInverterCurrent();", "public Integer getVid() {\n return vid;\n }", "public VrstaVezbe getVv() {\n return vv;\n }", "public Number getWashEmdPrintInv() {\n return (Number) getAttributeInternal(WASHEMDPRINTINV);\n }", "public double getHiZ() {\r\n\treturn fieldHiZ;\r\n}", "public int getInIp() {\n return instance.getInIp();\n }", "public int getInIp() {\n return instance.getInIp();\n }", "public BigDecimal getXNPV() {\r\n return XNPV;\r\n }", "public ProcessVertex getInVertex() {\n\t\treturn this.inVertex;\n\t}", "public String getvNumanoreg() {\n return vNumanoreg;\n }", "public int VolumeGet();", "public Integer getInsid() {\n return insid;\n }", "public String getVpdiCode() {\n return vpdiCode;\n }", "float getIva();", "@Basic\n\tpublic double getVy() {\n\t\treturn this.vy;\n\t}", "@Override\n\tpublic double mangeViande() {\n\t\treturn quantiteViande*this.getPoids();\n\t}", "public BigDecimal getValorInt() {\n\t\treturn valorInt;\n\t}", "public int getNmi(){\n return nmi;\n }", "int getOutputVoltage();", "public BigDecimal getVAT_CHARGE_INSUR_AMT() {\r\n return VAT_CHARGE_INSUR_AMT;\r\n }", "public int V() {\n \treturn V;\n }", "int getIndegree() {\n return indegree;\n }", "public int V() {\n return V;\n }", "public java.lang.Double getValorIof() {\n return valorIof;\n }", "public int getEvd() {\n return evd;\n }", "@Override\r\n\tpublic double getVET() {\r\n\t\treturn getTMB() * getFatorAtividadeFisica();\r\n\t}", "double getVy() { return vel[1]; }", "public static long getBytesIn() {\n return bytesIn;\n }", "public Vector2d getVvm() {\n return vvm;\n }", "public java.lang.String getIV_Local_currency() {\r\n return IV_Local_currency;\r\n }", "public double getVolga() {\r\n return volga;\r\n }", "public int getInvoiceNumber() {\n return invoiceNumber;\n }", "public int getInvoiceNumber() {\n return invoiceNumber;\n }", "public int getVy() { return vy; }", "public String getVatId()\n {\n return vatId;\n }", "public int getVATNumber() {\n\t\treturn vatNumber;\n\t}", "public String getViptype() {\n return viptype;\n }", "public int readVPOSR()\n {\n return longFrame | amiga.getAgnusID() << 8 | ( vpos & 0b111_0000_0000) >> 8;\n }", "public int getIndegree()\n\t{\n\t\treturn indegree ; \n\t}", "int getVida()\n\t{\n\t\treturn vida;\n\t}", "public float getMediaVoti() {\r\n\t\treturn mediaVoti;\r\n\t}", "public Vector2d getVte() {\n return vte;\n }", "int getVolume() {\n return this.volume;\n }", "public int getInIp() {\n return inIp_;\n }", "public int getInIp() {\n return inIp_;\n }", "public String getASIN() {\n return ASIN;\n }", "public int vol() {\r\n\t\treturn 3;\r\n\t}", "public short getVcode() {\n return vcode;\n }", "int getEvd();", "public Vediotape getVedio () {\n\t\treturn vedio;\n\t}" ]
[ "0.8019909", "0.8019909", "0.7904182", "0.6519607", "0.6426085", "0.6360435", "0.6318972", "0.63120234", "0.6292406", "0.62828076", "0.6263334", "0.6227649", "0.6151719", "0.6117357", "0.61125505", "0.60916674", "0.60594875", "0.59920293", "0.5984074", "0.5974455", "0.5945448", "0.5943367", "0.593461", "0.5926128", "0.58793336", "0.58555764", "0.58479327", "0.5820881", "0.58153456", "0.5803114", "0.5712086", "0.5705429", "0.5684913", "0.56766665", "0.5675049", "0.5673601", "0.5669943", "0.56607234", "0.5648371", "0.5644002", "0.5630994", "0.5625562", "0.56240106", "0.56090385", "0.5598602", "0.55972475", "0.5590076", "0.5584389", "0.5578844", "0.5571644", "0.55699736", "0.55694616", "0.5565918", "0.5547537", "0.552159", "0.5520921", "0.5520921", "0.5517645", "0.5515071", "0.5513981", "0.55076176", "0.55057955", "0.5502239", "0.5495125", "0.5488318", "0.54806656", "0.54666406", "0.546574", "0.54438484", "0.54406154", "0.54388165", "0.5428929", "0.5427184", "0.5426451", "0.5416207", "0.54066133", "0.54022604", "0.5400954", "0.53928745", "0.5390325", "0.53899145", "0.53799486", "0.53799486", "0.53752494", "0.53688914", "0.53671855", "0.5363338", "0.5362995", "0.5345772", "0.534563", "0.5342644", "0.5342295", "0.53413373", "0.5334836", "0.5334836", "0.5332296", "0.5331826", "0.53302205", "0.5329789", "0.5323274" ]
0.793292
2
Add a barge to the schedule. The schedule should be sorted on the latest starting time in order to construct waiting profiles. Because LinkedHashMap (in which schedule is stored) does not provide this functionality out of the box, we implemented that in this method as well.
public void addAppointment(Barge barge, int LAT, int LST, int PT) { // determine position where the appointment should be inserted. // the schedule should be sorted on the LST in order to create // a right waiting profile // to keep track of the position we use integer i. int i = 0; for (Barge b : this.appointments.keySet()) { // compare LAT of Barge b with the LAT of the new barge if (LST > this.appointments.get(b)[1]) { i++; } else { break; } } // create a new LinkedHashMap that replaces appointments at the end of // this method LinkedHashMap<Barge, int[]> newAppointments = new LinkedHashMap<Barge, int[]>(); for (int j = 0; j < appointments.size() + 1; j++) { if (j < i) { // add the appointment from appointments to newAppointments Barge key = (Barge) appointments.keySet().toArray()[j]; int[] value = appointments.get(key); newAppointments.put(key, value); } else if (j == i) { // add the new appointment at this position int PST = LST; int EDT = PST + PT; newAppointments .put(barge, new int[] { LAT, LST, PST, PT, EDT }); } else { // add the remaining appointment after the new appointment Barge key = (Barge) appointments.keySet().toArray()[j - 1]; int[] value = appointments.get(key); newAppointments.put(key, value); } } // replace appointments with newAppointments this.appointments = newAppointments; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void bargeArrives(Barge barge, int time) {\r\n\t\tthis.actualArrival.put(barge, time);\r\n\t\tthis.queue.add(barge);\r\n\t\t//System.out.println(barge+\" arrived to \"+this.name+\"// arraival list= \"+this.actualArrival);\r\n\r\n\t\tif (Port.terminalLogic.equals(\"Unreserved\")\r\n\t\t\t\t&& this.state == Terminal.IDLE) {\r\n\t\t\t// //////////////////////////////////the last two argument defined\r\n\t\t\t// by me////////////////////////////////////////////////////\r\n\t\t\tPort.schedule.schedule(ScheduleParameters.createOneTime(time,\r\n\t\t\t\t\tScheduleParameters.LAST_PRIORITY), this, \"handleBarge\",\r\n\t\t\t\t\tbarge, time);\r\n\t\t\t\r\n\t\t} else if (Port.terminalLogic.equals(\"Reserved\") && this.state == Terminal.IDLE) {\r\n\t\t\tboolean []c=checkIfHandleBarge(barge, time);\r\n\t\t\t//if could not handle the barge and it was late check && c[1] for next one\r\n\t\t\tif(!c[0] ){\r\n\t\t\t\tcheckNextPossibleBargeToHandle(time);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void buildSchedule() {\n class SimulationStep extends BasicAction {\n public void execute() {\n SimUtilities.shuffle(rabbitList);\n for (int i = 0; i < rabbitList.size(); i++) {\n RabbitsGrassSimulationAgent rabbit = rabbitList.get(i);\n rabbit.step();\n }\n\n reapDeadRabbits();\n\n displaySurf.updateDisplay();\n }\n }\n schedule.scheduleActionBeginning(0, new SimulationStep());\n\n class GrassGrowth extends BasicAction {\n public void execute() {\n space.spreadGrass(grassGrowthRate);\n }\n }\n schedule.scheduleActionBeginning(0, new GrassGrowth());\n\n class UpdatePopulationPlot extends BasicAction {\n public void execute() {\n populationPlot.step();\n }\n }\n schedule.scheduleActionAtInterval(5, new UpdatePopulationPlot());\n }", "private void buildSchedule() {\n\t\tclass RabbitsGrassSimulationStep extends BasicAction {\n\t\t\tpublic void execute() {\n\t\t\t\tSimUtilities.shuffle(rabbitList);\n\t\t\t\tfor (int i = 0; i < rabbitList.size(); i++) {\n\t\t\t\t\tRabbitsGrassSimulationAgent rabbit = rabbitList.get(i);\n\t\t\t\t\trabbit.step();\n\t\t\t\t}\n\n\t\t\t\treapDeadRabbits();\n\t\t\t\tgiveBirthToRabbits();\n\n\t\t\t\trabbitSpace.spreadGrass(growthRateGrass);\n\n\t\t\t\tdisplaySurf.updateDisplay();\n\t\t\t}\n\t\t}\n\n\t\tschedule.scheduleActionBeginning(0, new RabbitsGrassSimulationStep());\n\n\t\tclass UpdateNumberOfRabbitsInSpace extends BasicAction {\n\t\t\tpublic void execute() {\n\t\t\t\trabbitsAndGrassInSpace.step();\n\t\t\t}\n\t\t}\n\n\t\tschedule.scheduleActionAtInterval(1, new UpdateNumberOfRabbitsInSpace());\n\n\t}", "@Override\n\tpublic void add(ScheduleTask st) {\n\t\tsave(st);\n\n\t}", "private void giveBirthToRabbits() {\n\t\tfor (int i = (rabbitList.size() - 1); i >= 0; i--) {\n\t\t\tRabbitsGrassSimulationAgent rabbit = rabbitList.get(i);\n\t\t\tif (rabbit.isReproducing()) {\n\t\t\t\taddNewRabbit();\n\t\t\t}\n\t\t}\n\t}", "@Override\n protected void insertJobInQueueUponArrival (final J job, final double time)\n {\n addRealJobLocal (job);\n }", "public void add(int value) {\n expiryTime++;\n arrivalTime++;\n\n Bucket lastBucket = null;\n\n if (!buckets.isEmpty()) {\n // Check if timestamp of the last bucket indicates expiry\n lastBucket = buckets.get(buckets.size() - 1);\n if (lastBucket.isExpired(expiryTime)) {\n buckets.remove(lastBucket);\n // Update the counter LAST - containing size of the last bucket\n last = buckets.isEmpty() ? 0 : buckets.get(buckets.size() - 1).getSize();\n // Update TOTAL - size of all buckets\n total -= lastBucket.getSize();\n }\n }\n\n // 2\n // new element is 0 then ignore it\n if (value == 0) return;\n\n // if element is 1, create new bucket with size 1 and the current timestamp, increment TOTAL\n buckets.add(0, new Bucket(arrivalTime - 1));\n total++;\n\n // 3\n // traverse the list of buckets in order of increasing sizes\n int onesLimit = (int) k + 2;\n\n if (buckets.stream().filter(p -> p.getSize() == 1).count() >= onesLimit) {\n int otherLimit = (int) (k / 2) + 2;\n\n int limit = onesLimit;\n\n int mergeExponent = 0;\n int mergerBucketSize = (int) Math.pow(2, mergeExponent);\n\n ArrayList<Bucket> bucketsToMerge = new ArrayList<Bucket>();\n\n while (true) {\n\n for (Bucket bucket : buckets) {\n if (bucket.getSize() < mergerBucketSize) continue;\n\n if (bucket.getSize() > mergerBucketSize) break;\n\n if (bucket.getSize() == mergerBucketSize) {\n bucketsToMerge.add(bucket);\n } else {\n break;\n }\n }\n\n if (bucketsToMerge.size() != limit) {\n break;\n }\n\n // MERGE\n mergeExponent++;\n mergerBucketSize = (int) Math.pow(2, mergeExponent);\n limit = otherLimit;\n\n // Take two oldest buckets\n // we iterate from recent to oldest so take last 2 buckets from bucketsToMerge\n Bucket lastBucketToMerge = bucketsToMerge.get(bucketsToMerge.size() - 1);\n Bucket oneBeforeLastBucketToMerge = bucketsToMerge.get(bucketsToMerge.size() - 2);\n\n // If last bucket is being merged, update LAST counter\n if (oneBeforeLastBucketToMerge.getSize() == lastBucket.getSize()) {\n last = oneBeforeLastBucketToMerge.getSize() * 2;\n }\n\n // Update size of the most recent bucket with double size\n oneBeforeLastBucketToMerge.setSize(oneBeforeLastBucketToMerge.getSize() * 2);\n // remove last bucket\n buckets.remove(lastBucketToMerge);\n\n // Clear temp buckets\n bucketsToMerge = new ArrayList<Bucket>();\n }\n\n }\n }", "private void putJob(int a, int b){\n \n Integer[] job = new Integer[2];\n \n job[0] = a;\n job[1] = b;\n \n // put into priority queue\n this.prior.add(job);\n }", "public void add(Schedulorinator schedule) {\r\n if (!scheduleList.contains(schedule)) {\r\n scheduleList.add(schedule);\r\n schedule.addPerson(this);\r\n addObserver(schedule);\r\n notifyObservers(schedule);\r\n }\r\n }", "public void addBeam (Beam beam)\r\n {\r\n if (!beams.contains(beam)) {\r\n beams.add(beam);\r\n\r\n // Keep the sequence sorted\r\n Collections.sort(beams, byLevel);\r\n }\r\n }", "public void addPlaced(Block placed) {\n\t\tlastPlaced.put(placed, System.currentTimeMillis());\n\t}", "public void pushBottom(Runnable r) {\n tasks[bottom] = r; // store task\n bottom++; // advance bottom\n }", "public void addTask(final BTask t) {\n\t\tbloc.addLast(t);\n\t}", "public void generateSchedule(){\n\t\t\n\t}", "public void addFreezeFrame()\n{\n int index = Collections.binarySearch(_freezeFrames, getTime());\n if(index<0)\n _freezeFrames.add(-index - 1, getTime());\n}", "private void loadScheduleList() {\n\n if (listTbagendamentos != null && !listTbagendamentos.isEmpty()) {\n scheduleAgendamento.clear();\n\n for (Tbagendamento agendamento : listTbagendamentos) {\n DefaultScheduleEvent defaultScheduleEvent = new DefaultScheduleEvent();\n defaultScheduleEvent.setTitle(agendamento.getIdcliente().getNmcliente());\n\n Calendar dtDataInicial = new GregorianCalendar();\n dtDataInicial.setTime(agendamento.getTmdataagendamento());\n\n defaultScheduleEvent.setStartDate(dtDataInicial.getTime());\n\n Calendar dtDataFinal = new GregorianCalendar();\n dtDataFinal.setTime(agendamento.getTmdataagendamento());\n dtDataFinal.set(Calendar.MINUTE, dtDataFinal.get(Calendar.MINUTE) + 30);\n\n defaultScheduleEvent.setEndDate(dtDataFinal.getTime());\n defaultScheduleEvent.setData(agendamento.getIdagendamento());\n scheduleAgendamento.addEvent(defaultScheduleEvent);\n }\n }\n }", "public void add(int bib) {\n\t\tfor ( Run r : startQueue ) {\n\t\t\tif ( r.getBibNum() == bib ) {\n\t\t\t\tPrinter.print(\"Error: Bib number already in use\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tfor ( Run r : finishQueue ) {\n\t\t\tif ( r.getBibNum() == bib ) {\n\t\t\t\tPrinter.print(\"Error: Bib number already in use\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tfor ( Run r : completedRuns ) {\n\t\t\tif ( r.getBibNum() == bib ) {\n\t\t\t\tPrinter.print(\"Error: Bib number already in use\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tRun run = new Run(runNum, bib);\n\t\tstartQueue.add(run);\n\t}", "public WaitingProfile constructWaitingProfile(Barge barge, int currentTime) {\r\n\t\t /*if(Port.eventsToExcel.equals(\"Yes\")){\r\n\t\t\t Port.stats.addEvent(currentTime, barge.bargeNumber, (barge.toString()+ \" asked Terminal \" + this.toString()+\r\n\t\t\t\t\t \" for appoints \"+\r\n\t\t\t\t\t \" ||appointements= \" +this.appointmentsToString()));\r\n\t\t\t }*/\r\n\t\t \r\n\t\t \r\n\t\treturn new WaitingProfile(this, barge, currentTime);\r\n\t}", "public void addPopulationChange(Number time, Number val) {\n populationQueue.add(new Pair<>(time, val));\n }", "private void scheduleJob() {\n\n }", "public void addBreakTime(LocalTime startTime) {\n\t\tif(startTime == null) {\n\t\t\tthrow new IllegalArgumentException(\"the start time can't be null!\");\n\t\t}\n\t\tLocalTime startBreak = LocalTime.of(11, 0);\n\t\tLocalTime endBreak = LocalTime.of(13, 0);\n\t\tLocalTime endTime = startTime.plusHours(1);\n\t\tif(startTime.isBefore(startBreak) || endTime.isAfter(endBreak)) {\n\t\t\tthrow new IllegalArgumentException(\"The break time must be between 11:00 end 13:00\");\n\t\t}\n\t\tsetBreakTime(new AvailabilityPeriod(startTime, endTime));\n\t}", "@Override\n\tpublic void initializeScehduleWithOneEvent() {\n\t\tdouble time = getTimeOfNextBirth();\n\t\tEvent birthEvent = new Event(time, EventType.BIRTH, this);\n\t\tbirthEvent.setTag(true);\n\t\tschedule.add(birthEvent);\t\n\t}", "private void addCompletedJobStats(CascadingJob job, HadoopStepStats stats) {\n if (workflowVersion == null) {\n workflowVersion = currentFlowId;\n }\n\n job.setJobStats(stats);\n jobs.add(job);\n }", "@Override\n public void addTasksToRun() {\n //gets the tasks that are ready for execution from the list with new tasks\n List<Task> collect = tasks.stream().filter((task) -> (task.getDate() == TIME))\n .collect(Collectors.toList());\n //sort the tasks inserted. The sort is based in \"priority\" value for all the tasks.\n collect.sort(new Comparator<Task>() {\n @Override\n public int compare(Task o1, Task o2) {\n return o1.getPriority() - o2.getPriority();\n }\n });\n //Change the status of tasks for READY\n collect.stream().forEach((task) -> {\n task.setStatus(Task.STATUS_READY);\n });\n //Adds the tasks to the queue of execution\n tasksScheduler.addAll(collect);\n\n //Removes it from list of new tasks\n tasks.removeAll(collect);\n }", "public void addBomb(Bomb b){\r\n this.bombs.add(b);\r\n }", "@Override\n\tpublic void addScheduleTask(ScheduleTask st) {\n\t\tscheduleTaskDAO.add(st);\n\t}", "public void addNewborn(Object anObj) { _newBorns.add(anObj); }", "private void GenerateBomb(){\n\t\t\n\t\t//Update for the bomb powerup\n\t\tint randGen = rand.nextInt((int)((float)BOMB_FREQUENCY * RANDOM_DEVIATION));\n\t\trandGen = (rand.nextBoolean()) ?-randGen :randGen;\n\t\t\n\n\t\t\n\t\tif(timeSinceLastSpawns.get(CollectibleType.Bomb.ordinal()).intValue() > (BOMB_FREQUENCY + randGen)){\n\t\t\t\n\n\t\t\ttimeSinceLastSpawns.set(CollectibleType.Bomb.ordinal(), 0);\n\t\t\t\n\t\t\t//SPAWN BOMB COLLECTIBLE HERE\n\t\t}\n\t}", "public void addBreak(final String _break) {\n\t\tfinal SimpleDateFormat format = new SimpleDateFormat(\"HH:MM:SS\");\n\t\tDate date = null;\n\t\ttry {\n\t\t\tdate = format.parse(_break);\n\t\t} catch (ParseException e) {\n\t\t\tdate = null;\n\t\t} finally {\n\t\t\tif(date != null) {\n\t\t\t\tsynchronized(breaktimes) {\n\t\t\t\t\tbreaktimes.add(System.currentTimeMillis() + date.getTime());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void addToQueue(Unit unit) {\n if (units.size() < maxStock) {\n endTime = System.currentTimeMillis() + unit.getBuildTime();\n units.add(unit);\n }\n }", "@Test\n public void testCreateAllocationScraperWorkerJob() throws Exception {\n LocalDate currentDate = LocalDate.parse(\"2018-05-25\");\n LocalDate endDate = LocalDate.parse( \"2018-10-06\" );\n while ( currentDate.isBefore( endDate ) ) {\n CloudbedsAllocationScraperWorkerJob workerJob = new CloudbedsAllocationScraperWorkerJob();\n workerJob.setStatus( JobStatus.submitted );\n workerJob.setAllocationScraperJobId( 440052 ); // dbpurge job (no recs)\n workerJob.setStartDate( currentDate );\n workerJob.setEndDate( currentDate.plusDays( 7 ) );\n dao.insertJob( workerJob );\n currentDate = currentDate.plusDays( 7 ); // calendar page shows 2 weeks at a time\n }\n }", "public void addQueue(SensorData latest) {\r\n//\t\tMap<String,Integer> latestLog = latest.getSSIDs();\r\n//\t\tLog.v(LOG_TAG, latestLog.keySet().toString());\r\n// \tif( latestLog!=null && passedLog!=null ){\r\n// \tdouble nowRatio = OverlapRatio.between( latestLog, passedLog );\r\n// \tif( nowRatio!=-1 && nowRatio!=0 ){\r\n// \ttimeQueue.add( latest.getTime( MatchingConstants.PARAM_STRING[MatchingConstants.SN_WiFi] ) );\r\n// \toverlapRatioQueue.add( (float)nowRatio );\r\n// \tFloat f = overlapRatioQueue.getLast();\r\n// \tif( f!=null ){\r\n// \tLog.v( LOG_TAG, \"NowRatio=\" + f.toString() + \",Size=\" + overlapRatioQueue.size() );\r\n// \t}\r\n// \t}\r\n// \t}\r\n// \tpassedLog = latestLog;\r\n\t}", "void deschedule(ScheduledJob job);", "public void add(Ball b) {\r\n balls.add(b);\r\n }", "public void addBeatsPerMinute( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), BEATSPERMINUTE, value);\r\n\t}", "public void growthCycle() {\n\t\tboolean doMore = true;\n\t\tdo {\n\t\t\tdoMore = false;\n\t\t\tgrower = planter;\n\t\t\tCollections.shuffle(grower, random);\n\t\t\tplanter = new ArrayList<Room>();\n\t\t\tfor(Room room : grower) {\n\t\t\t\tif(rooms.size() >= size.maxRooms) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(room.plantChildren(this)) {\n\t\t\t\t\t//System.out.println(\"Added side room.\");\n\t\t\t\t\tdoMore = true;\n\t\t\t\t}\n\t\t\t} \n\t\t} while(doMore);\t\t\n\t\t//DoomlikeDungeons.profiler.endTask(\"Adding Rooms (growthCycle)\");\n\t}", "public void addToMazeGeneration(int[] wallToBreak) {\n mazeGeneration.add(wallToBreak);\n }", "public void setSchedule(Schedule newSchedule) {\n\n schedule = newSchedule;\n }", "public com.walgreens.rxit.ch.cda.POCDMT000040Birthplace addNewBirthplace()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.POCDMT000040Birthplace target = null;\n target = (com.walgreens.rxit.ch.cda.POCDMT000040Birthplace)get_store().add_element_user(BIRTHPLACE$24);\n return target;\n }\n }", "public void addJobToWaitingList(CommonCommand newJob) {\n \t\tif (null != localMonitor)\n \t\t\tlocalMonitor.newJobToWaitingList(newJob);\n \t}", "private static void initializeJob(IGoobiJob goobiJob, String configuredStartTimeProperty,Scheduler sched) throws SchedulerException{\n\t\tlogger.debug(goobiJob.getJobName());\n\t\tJobDetail jobDetail = new JobDetail(goobiJob.getJobName(), null, goobiJob.getClass());\n\t\t\n\t\t\n\t\tif (ConfigMain.getLongParameter(configuredStartTimeProperty, -1) != -1) {\n\t\t\tlong msOfToday = ConfigMain.getLongParameter(configuredStartTimeProperty, -1);\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tcal.set(1984, 8, 11, 0, 0);\n\t\t\tcal.set(Calendar.SECOND, 0);\n\t\t\tcal.set(Calendar.MILLISECOND, 0);\n\n\t\t\tcal.setTime(new Date(cal.getTimeInMillis() + msOfToday));\n\t\t\tint hour = cal.get(Calendar.HOUR_OF_DAY);\n\t\t\tint min = cal.get(Calendar.MINUTE);\n\n\t\t\tTrigger trigger = TriggerUtils.makeDailyTrigger(hour, min);\n\t\t\ttrigger.setStartTime(new Date());\n\t\t\ttrigger.setName(goobiJob.getJobName() + \"_trigger\");\n\n\t\t\tif(logger.isInfoEnabled()){\n\t\t\t\tlogger.info(\"daily Job \" + goobiJob.getJobName() + \" start time: \" + hour + \":\" + min);\n\t\t\t}\n\t\t\tsched.scheduleJob(jobDetail, trigger);\n\t\t}\n\t}", "@Override\n public void appendRecurringDate(TaskOccurrence componentToBeAdded) {\n assert !recurringType.equals(RecurringType.NONE) : \"You cannot append new dates to non recurring tasks\";\n recurringDates.add(componentToBeAdded);\n recurringDates.get(recurringDates.size() - INDEX_OFFSET).setTaskReferrence(this);\n }", "public abstract void schedule();", "@Override\n public ArrayList<ScheduleInterval> scheduleTaskSet(ArrayList<Task> taskSet, int scheduleEndTime) {\n ArrayList<ScheduleInterval> schedule = new ArrayList<ScheduleInterval>();\n\n // Pre-calculate all jobs released in the interval\n HashMap<Integer, ArrayList<Job>> jobReleases = this.calculateJobReleases(taskSet, scheduleEndTime);\n int scheduleTime = 0;\n for(int time = 0; time < scheduleEndTime ; time++) {\n \tif(jobReleases.get(time) != null){\n \t\tArrayList<Job> jobs = jobReleases.get(time);\n \tfor(int i = 0; i < jobs.size(); i++){\n \t\tschedule.add(new ScheduleInterval(jobs.get(i), scheduleTime, scheduleTime + jobs.get(i).getRemainingTime()));\n \t\tscheduleTime = scheduleTime + jobs.get(i).getRemainingTime();\n \t}\n \t}else if(scheduleTime <= time) {\n \t\t//Hacky solution to fixing scheduling before releases\n \t\tscheduleTime++;\n \t}\n \t\n }\n\n return schedule;\n }", "public static native int OpenMM_AmoebaStretchBendForce_addStretchBend(PointerByReference target, int particle1, int particle2, int particle3, double lengthAB, double lengthCB, double angle, double k1, double k2);", "public void addPlayer(HeroClass newJob){job.add(newJob);}", "public void addBallToBoard(Ball ball){\n\t\tballs.add(ball);\n\t\tinhabitants.add((BoardObject) ball);\n\t}", "private void addToHashmap(String key, Long timestamp){\r\n\t\tkeyHashMap.putIfAbsent(key, new PriorityQueue<Long>());\r\n\t\tsynchronized(keyHashMap.get(key)){\r\n\t\t\tSystem.out.println(\"Added Key: \" + key + \" Time: \" + timestamp);\r\n\t\t\tkeyHashMap.get(key).add(timestamp);\r\n\t\t}\r\n\t}", "public void addBuildToDB(Build b){\n for (int i = 0; i < buildHistory.size(); i++) {\n if(b.getBuildID() == buildHistory.get(i).getBuildID()){\n System.err.println(\"A build with this build id is already present in database\");\n return;\n }\n }\n //build id is unique\n buildHistory.add(b);\n }", "@Override\n public void updateAppearance(ArrayList<Individual> population, GeneticAlgorithm GA) {\n HashSet<Individual> a = new HashSet<>();\n a.addAll(population);\n ArrayList<Individual> toProcess = new ArrayList<>();\n toProcess.addAll(a);\n\n // All individuals in population are present in the previous population. The remaining, not.\n for (Individual ind : toProcess) {\n ArrayDeque<Boolean> values = appearance.get(ind);\n if (values != null) {\n // the indivual was previously added. Update the structure\n values.addFirst(Boolean.TRUE);\n if (values.size() > maxTime) {\n values.removeLast();\n }\n } else {\n // new Individual. Add it to the hashmap\n ArrayDeque<Boolean> toAdd = new ArrayDeque<>(maxTime);\n toAdd.add(Boolean.TRUE);\n appearance.put(ind, toAdd);\n }\n }\n\n // Now, the remaining individuals in the hashmap does not appear in this timestamp. Update it.\n Set<Individual> notPresent = appearance.keySet();\n //notPresent.removeAll(population);\n\n for (Individual ind : notPresent) {\n if (!population.contains(ind)) {\n ArrayDeque<Boolean> values = appearance.get(ind);\n values.addFirst(Boolean.FALSE);\n if (values.size() > maxTime) {\n values.removeLast();\n }\n }\n }\n }", "public void addBroken(Block broken) {\n\t\tlastBroken.put(broken, System.currentTimeMillis());\n\t}", "@Override\n public void addGraph (TimeFrame pTimeFrame, IStaticGraph<V,E> pIGraph) {\n hmpGraphsAtTimeframes.put(pTimeFrame, pIGraph);\n lstTimeFrameOrdering.add(pTimeFrame);\n icommunityColors.addTimeFrame(pTimeFrame);\n }", "synchronized void addBucket(RuleBaseBucket bucket) {\n\t\tif (holdingPen==null)\n\t\t\tholdingPen = makeBucketCollection();\n\t\tholdingPen.add(bucket);\n\t\tsomeOutdated |= bucket.isOutdated();\n\t}", "void schedule(ScheduledJob job);", "public void scheduleJobs();", "public void schedule(String id, String[] schedule) {\n\t}", "private void addTaskToServer() {\n\t\twriter.println();\n\t\tSystem.out.println();\n\t\tNumberFormat formatter = new DecimalFormat(\"#0.00000\");\n\t\tfor (Iterator<Task> iterator = this.generatedTasks.iterator(); iterator.hasNext();) {\n\t\t\tTask t = iterator.next();\n\t\t\twriter.println(\"current time=\" + currentTime + \" ,tasks not assigned \" + t.getArrivalTime() + \" \"\n\t\t\t\t\t+ t.getprocessingTime());\n\t\t\tSystem.out.println(\"current time=\" + currentTime + \" ,tasks not assigned \" + t.getArrivalTime() + \" \"\n\t\t\t\t\t+ t.getprocessingTime());\n\t\t\tif (t.getArrivalTime() == currentTime || t.isLateProcessing()) {\n\t\t\t\t// if it can be dispatched\n\t\t\t\tif (this.scheduler.dispatchTask(t) == true)\n\t\t\t\t\titerator.remove();\n\t\t\t\telse\n\t\t\t\t\tt.setLateProcessing(true);\n\t\t\t}\n\t\t}\n\t}", "public void addJob(Class<? extends Job> jobClass) {\n CronExp cronExp = (CronExp) jobClass.getAnnotation(CronExp.class);\n addJob(cronExp.value(), jobClass);\n }", "public void addBoat(Boat b){\r\n boats.add(b);\r\n }", "net.opengis.gml.x32.TimeInstantPropertyType addNewEnd();", "public void addAlarm(K key, @ElapsedRealtimeLong long alarmTimeElapsed) {\n synchronized (mLock) {\n final boolean removed = mAlarmPriorityQueue.removeKey(key);\n mAlarmPriorityQueue.offer(new Pair<>(key, alarmTimeElapsed));\n if (mTriggerTimeElapsed == NOT_SCHEDULED || removed\n || alarmTimeElapsed < mTriggerTimeElapsed) {\n setNextAlarmLocked();\n }\n }\n }", "public void setBuddeisSchedules(ArrayList<Schedule> newBuddies) {\n\n buddies = new ArrayList<Schedule>();\n\n buddies.addAll(newBuddies);\n }", "private void addNewRabbit() {\n\t\tRabbitsGrassSimulationAgent rabbit = new RabbitsGrassSimulationAgent(minInitEnergy, maxInitEnergy,\n\t\t\t\tlossRateEnergy, birthThreshold, lossReproductionEnergy, img);\n\t\tboolean isAdded = rabbitSpace.addRabbit(rabbit);\n\t\tif (isAdded) {\n\t\t\trabbitList.add(rabbit);\n\t\t}\n\t}", "private void scheduleJob(RemoteMessage remoteMessage) {\n Bundle myExtrasBundle = new Bundle();\n myExtrasBundle.putString(\"title\", remoteMessage.getData().get(\"title\"));\n myExtrasBundle.putString(\"message\", remoteMessage.getData().get(\"message\"));\n\n FirebaseJobDispatcher dispatcher =\n new FirebaseJobDispatcher(new GooglePlayDriver(this));\n Job myJob = dispatcher.newJobBuilder()\n .setService(MyJobService.class)\n .setTag(\"my-job-tag\")\n .setRecurring(false)\n .setLifetime(Lifetime.UNTIL_NEXT_BOOT)\n .setTrigger(Trigger.executionWindow(0, 30))\n .setReplaceCurrent(false)\n .setRetryStrategy(RetryStrategy.DEFAULT_EXPONENTIAL)\n .setConstraints(\n Constraint.ON_UNMETERED_NETWORK,\n Constraint.DEVICE_CHARGING\n )\n .setExtras(myExtrasBundle)\n .build();\n dispatcher.mustSchedule(myJob);\n }", "Process(int id, int a, int b) {\r\n\t\tthis.id = id;\r\n\t\tthis.arrivalTime = a;\r\n\t\tthis.burst = this.bt = b;\r\n\t}", "public void ActivitySplitter(Population population,Config config, String activityType,Double timeGapInSecond,boolean shouldAddearliestEndTimeAndLatestStartTime) {\r\n\t\tHashMap<String,Tuple<Double,Double>> activities=new HashMap<>();\r\n\t\tHashMap<String,Integer> activityCounter=new HashMap<>();\r\n\t\tHashMap<String,Double> activityDurationSum=new HashMap<>();\r\n\t\tHashMap<String,ArrayList<Double>> activityStartTime=new HashMap<>();\r\n\t\tHashMap<String,ArrayList<Double>> activityEndTime=new HashMap<>();\r\n\t\tdouble startTime=3*3600;\r\n\t\tdouble endTime=27*3600;\r\n\t\tfor(double d=startTime;d<endTime;d=d+timeGapInSecond) {\r\n\t\t\tactivities.put(activityType+\"_\"+d, new Tuple<>(d,d+timeGapInSecond));\r\n\t\t\tactivityCounter.put(activityType+\"_\"+d, 0);\r\n\t\t\tactivityDurationSum.put(activityType+\"_\"+d, 0.);\r\n\t\t\tactivityStartTime.put(activityType+\"_\"+d,new ArrayList<>());\r\n\t\t\tactivityEndTime.put(activityType+\"_\"+d, new ArrayList<>());\r\n\t\t}\r\n\r\n\t\tfor(Person p:population.getPersons().values()) {\r\n\t\t\tfor(PlanElement pe:p.getSelectedPlan().getPlanElements()) {\r\n\t\t\t\tif(pe instanceof Activity) {\r\n\t\t\t\t\tActivity a=(Activity)pe;\r\n\t\t\t\t\tif(a.getType().equals(activityType)) {\r\n\t\t\t\t\t\tfor(Tuple<Double,Double>t:activities.values()) {\r\n\t\t\t\t\t\t\tif(a.getStartTime()>=t.getFirst()&&a.getStartTime()<t.getSecond()&&a.getStartTime()!=Double.NEGATIVE_INFINITY) {\r\n\t\t\t\t\t\t\t\ta.setType(activityType+\"_\"+t.getFirst());\r\n\t\t\t\t\t\t\t\tactivityCounter.put(activityType+\"_\"+t.getFirst(),activityCounter.get(activityType+\"_\"+t.getFirst())+1);\r\n\t\t\t\t\t\t\t\tactivityDurationSum.put(activityType+\"_\"+t.getFirst(),activityDurationSum.get(activityType+\"_\"+t.getFirst())+(a.getEndTime()-a.getStartTime()));\r\n\t\t\t\t\t\t\t\tactivityStartTime.get(activityType+\"_\"+t.getFirst()).add(a.getStartTime());\r\n\t\t\t\t\t\t\t\tactivityEndTime.get(activityType+\"_\"+t.getFirst()).add(a.getEndTime());\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tActivityParams aParams=config.planCalcScore().getActivityParams(activityType);\r\n\t\tfor(String s:activityCounter.keySet()) {\r\n\t\t\tif(activityCounter.get(s)!=0) {\r\n\t\t\t\tActivityParams ap=new ActivityParams(s);\r\n\t\t\t\tif(activityDurationSum.get(s)/activityCounter.get(s)!=0) {\r\n\t\t\t\t\tap.setTypicalDuration(activityDurationSum.get(s)/activityCounter.get(s));\r\n\t\t\t\t}else {\r\n\t\t\t\t\tap.setTypicalDuration(activityDurationSum.get(s)/activityCounter.get(s)+300);\r\n\t\t\t\t}\r\n\t\t\t\tap.setClosingTime(Math.ceil((this.calcAverage(activityEndTime.get(s))+this.calcSD(activityEndTime.get(s)))/1800)*1800);\r\n\t\t\t\tif(shouldAddearliestEndTimeAndLatestStartTime) {\r\n\t\t\t\t\tap.setLatestStartTime(Math.floor(this.calcAverage(activityStartTime.get(s))/900)*900);\r\n\t\t\t\t\tap.setEarliestEndTime(Math.ceil(this.calcAverage(activityEndTime.get(s))/900)*900);\r\n\t\t\t\t}\r\n\t\t\t\tap.setOpeningTime(Math.floor((this.calcAverage(activityStartTime.get(s))-this.calcSD(activityStartTime.get(s)))/1800)*1800);\r\n\t\t\t\tconfig.planCalcScore().addActivityParams(ap);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void addBomb() {\n\t\tthis.nbSpiritBombs++;\n\t}", "public void addJob(Process p) \n {\n \tif(p != null)\n \t\tprocesses.add(p);\n }", "public void addBike (Bike bike) {\n if (this.bikes.size() <= 4) { // add limitation on number of parked bikes to 5\n this.bikes.add(bike);\n } else {\n System.err.printf(\"%nNo free space to park bike \" +\n \"with ID '%d' in station %d!%n\", bike.getBikeID(), this.stationID);\n }\n }", "void doIt() throws RBEConfigObjectException, IOException\n\t{\n\t\t// Create a schedules\n\t\tSchedules schedules = new Schedules();\n\n\t\t// add a schedule that include a period for 8:00am to 6:00pm every Monday\n\t\taddMondayOnly(schedules);\n\n\t\t// Save it to a file\n\t\tsave(schedules, SAMPLE_SCHEDULES_NAME+schedules.getFileExtension());\n\n\t\t// load the schedules from and check if it is equals to the original.\n\t\tSchedules schedulesLoaded = load(SAMPLE_SCHEDULES_NAME+schedules.getFileExtension());\n\t\tif (!schedules.equals(schedulesLoaded))\n\t\t\tprintln(\"Error saving schedules to file!\");\n\t}", "protected void optimizeBushes() {\r\n\t\tfor (int i = 0; i < execBushes.size(); i++) {\r\n\t\t\tLog.info(String.format(\r\n\t\t\t\t\t\"Performing POR Analysis on Bush Sequence %d of %d\", i + 1,\r\n\t\t\t\t\texecBushes.size()));\r\n\r\n\t\t\t// optimization only works for sequence lengths >= 3\r\n\t\t\tList<EventType> sequence = execBushes.get(i);\r\n\t\t\tif (sequence.size() < 3)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t// is bush already redundant?\r\n\t\t\tif (redundantExecBushes.contains(sequence)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// is bush PO-reducible?\r\n\t\t\tif (isPOReducible(sequence)) {\r\n\t\t\t\t// create redundant sequence (for later checking)\r\n\t\t\t\tList<EventType> redundantSequence = new ArrayList<EventType>();\r\n\t\t\t\tredundantSequence.add(sequence.get(1));\r\n\t\t\t\tredundantSequence.add(sequence.get(0));\r\n\t\t\t\tredundantSequence.add(sequence.get(2));\r\n\t\t\t\tredundantExecBushes.add(redundantSequence);\r\n\t\t\t}\r\n\r\n\t\t\trequiredExecBushes.add(sequence);\r\n\t\t}\r\n\t}", "private boolean[] checkIfHandleBarge(Barge barge, int time) {\r\n\t\tboolean [] result={false, false};\r\n\t\t// if there is no other barge in the appointment list start handling\r\n\t\t// directly\r\n\r\n\t\tif (this.appointments.size() == 1) {\r\n\t\t\tPort.schedule.schedule(ScheduleParameters.createOneTime(time,\r\n\t\t\t\t\tScheduleParameters.LAST_PRIORITY), this, \"handleBarge\",\r\n\t\t\t\t\tbarge, time);\r\n\t\t\tresult[0]=true;\r\n\t\t\treturn result;\r\n\t\t} else {\r\n\t\t\t// we need the following information to check whether or not the\r\n\t\t\t// barge can start handling\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/*Barge nextBargeInSchedule = (Barge) this.appointments.keySet().toArray()[0];\r\n\t\t\tBarge secondBargeInSchedule = (Barge) this.appointments.keySet().toArray()[1];*/\r\n\t\t\tint expectedEndTimeThisBarge = time+ barge.handlingTimes.get(barge.terminals.indexOf(this));\r\n\t\t\tint latThisBarge= this.appointments.get(barge)[0];\r\n\t\t\t//System.out.println(this.name+\" wants to check \"+barge+\" in this arrival list \"+this.actualArrival+\" and que= \"+this.queue);\r\n\t\t\tint actualArrive = this.actualArrival.get(barge);\r\n\t\t\t/*int lstNextAppointment = this.appointments.get(nextBargeInSchedule)[1];\r\n\t\t\tint lstSecondAppointment = this.appointments.get(secondBargeInSchedule)[1];*/\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//if next in schedule and it was not late\r\n\t\t\tif ((barge.equals(this.appointments.keySet().toArray()[0]) == true && latThisBarge >= actualArrive)) {\r\n\t\t\t\tthis.state=Terminal.HANDLING;\r\n\t\t\t\tPort.schedule.schedule(ScheduleParameters.createOneTime(\r\n\t\t\t\t\t\ttime, ScheduleParameters.LAST_PRIORITY), this,\r\n\t\t\t\t\t\t\"handleBarge\", barge, time);\r\n\t\t\t\tresult[0]=true;\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t\t//if next barge in schedule but it was late check to see if it is possible to handle it without interrupting other appointments\r\n\t\t\telse if ((barge.equals(this.appointments.keySet().toArray()[0]) == true && latThisBarge <= actualArrive)) {\r\n\t\t\t\tif (expectedEndTimeThisBarge <= this.appointments.get(this.appointments.keySet().toArray()[1])[1]){\r\n\t\t\t\t\tthis.state=Terminal.HANDLING;\r\n\t\t\t\t\tPort.schedule.schedule(ScheduleParameters.createOneTime(\r\n\t\t\t\t\t\t\ttime, ScheduleParameters.LAST_PRIORITY), this,\r\n\t\t\t\t\t\t\t\"handleBarge\", barge, time);\r\n\t\t\t\t\t\r\n\t\t\t\t\tresult[0]=true;\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.queue.remove(barge);\r\n\t\t\t\t\tthis.appointments.remove(barge);\r\n\t\t\t\t\t//System.out.println(barge+\" removed from \"+this.name);\r\n\t\t\t\t\t//System.out.println(barge+\" removed from the \"+ this.name);\r\n\t\t\t\t\tif (Port.eventsToExcel.equals(\"Yes\")) {\r\n\t\t\t\t\t\tPort.stats\r\n\t\t\t\t\t\t\t\t.addEvent(\r\n\t\t\t\t\t\t\t\t\t\ttime,\r\n\t\t\t\t\t\t\t\t\t\tbarge.bargeNumber,\r\n\t\t\t\t\t\t\t\t\t\t(\"rejected at Terminal \"\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ this.toString() + \"due to delay\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// notify barge to calculate rotation again\r\n\t\t\t\t\tbarge.recalculateRotation(time);\r\n\t\t\t\t\tresult[0]=false;\r\n\t\t\t\t\tresult[1]=true;\r\n\t\t\t\t\treturn result;\t\t\t\t\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// if it is not the next one see if it is possible to service it without interrupting others\r\n\t\t\t//also if the next barge is late start this one\r\n\t\t\telse if ((barge.equals(this.appointments.keySet().toArray()[0]) == false && expectedEndTimeThisBarge <= this.appointments.get(this.appointments.keySet().toArray()[0])[1])\r\n\t\t\t\t\t||(barge.equals(this.appointments.keySet().toArray()[0]) == false && time > this.appointments.get(this.appointments.keySet().toArray()[0])[1])){\r\n\t\t\t\tthis.state=Terminal.HANDLING;\r\n\t\t\t\tPort.schedule.schedule(ScheduleParameters.createOneTime(\r\n\t\t\t\t\t\ttime, ScheduleParameters.LAST_PRIORITY), this,\r\n\t\t\t\t\t\t\"handleBarge\", barge, time);\r\n\t\t\t\tresult[0]=true;\r\n\t\t\t\treturn result;\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public void addBlock(Block b) {\n String previousHash = \"\";\n if (blockChain.size() == 0) {\n previousHash = \"\";\n } else {\n previousHash = getLatestBlock().proofOfWork();\n }\n b.previousHash = previousHash;\n chainHash = b.proofOfWork();\n blockChain.add(b);\n }", "public void scheduleJob() {\n JobInfo.Builder builder = null;\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {\n builder = new JobInfo.Builder(mJobId++, mServiceComponent);\n builder.setMinimumLatency(1000);\n builder.setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY);\n // Extras, work duration.\n PersistableBundle extras = new PersistableBundle();\n extras.putLong(WORK_DURATION_KEY, Long.valueOf(1) * 1000);\n extras.putString(\"gsonData\", gsonDataa);\n extras.putInt(\"servicetype\", 1);\n builder.setExtras(extras);\n // Schedule job\n Log.d(TAG, \"Scheduling job\");\n JobScheduler tm = (JobScheduler) getSystemService(Context.JOB_SCHEDULER_SERVICE);\n tm.schedule(builder.build());\n\n }\n\n\n\n }", "public void addTime(Time t) {\n\t\tif (t.isStart()) {\n\t\t\tif (startTimes.isEmpty()) {\n\t\t\t\tfor (Time m : meanTimes) {\n\t\t\t\t\tif (Time.diff(m, t).getTimeAsInt() > stipulatedTime) {\n\t\t\t\t\t\tfinishTimes.add(m);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (Time f : finishTimes) {\n\t\t\t\t\tmeanTimes.remove(f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tstartTimes.add(t);\n\t\t} else {\n\t\t\tif (!startTimes.isEmpty() && Time.diff(t, startTimes.getFirst()).getTimeAsInt() > stipulatedTime) {\n\t\t\t\tfinishTimes.add(t);\n\t\t\t} else {\n\t\t\t\tmeanTimes.add(t);\n\t\t\t}\n\t\t}\n\t}", "abstract public void computeSchedule();", "public void addJob(Process p) {\n // Remove the next lines to start your implementation\n //throw new UnsupportedOperationException();\n \n // Fill in this method\n /*------------------------------------------------------------*/\n\n //Add the job to the unfinished process queue if it is not already present\n if(!this.unfinishedJobs.contains(p)){\n this.unfinishedJobs.add(p);\n }\n /*------------------------------------------------------------*/\n }", "void scheduleNextDestination(Passenger passenger, Floor currentFloor);", "private void beginSchedule(){\n\t\tDivaApp.getInstance().submitScheduledTask(new RandomUpdater(this), RandomUpdater.DELAY, RandomUpdater.PERIOD);\n\t}", "void addHasDeployedAirbag(Integer newHasDeployedAirbag);", "public void addScheduledTask(Node node, Processor processor, int startTime) {\n scheduledTasks.put(node, processor);\n processor.schedule(node, startTime);\n\n length = Math.max(length, startTime + node.getCost());\n }", "public void batchInsertByBkTime(Date bkTime) throws SnmpEventsProcessDaoException\n\t{\n\t\ttry {\n\t\t\t jdbcTemplate.update(\"INSERT INTO \" + getTableName() + \n\t\t\t\t\t \" ( MARK, MANUFACTURE, RESULTLIST, WARNMESSAGE, SUMMARY ) \"+\n\t\t\t\t\t \" select MARK, MANUFACTURE, RESULTLIST, WARNMESSAGE, SUMMARY \"+\n\t\t\t\t\t \" FROM DUAL, BK_SNMP_EVENTS_PROCESS where bk_time= ? \", bkTime);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new SnmpEventsProcessDaoException(\"batchInsert failed\", e);\n\t\t}\n\t\t\n\t}", "public void addBeatsPerMinute(java.lang.Integer value) {\r\n\t\tBase.add(this.model, this.getResource(), BEATSPERMINUTE, value);\r\n\t}", "private void placeBombs() {\n\t\tfor (int i = 0; i < NUM_BOMBS; i++) {\n\t\t\tplaceBomb();\n\t\t}\n\t}", "private void addCompletedJobStats(PigJob job, JobStats stats) {\n // put the job conf into a Properties object so we can serialize them\n Properties jobConfProperties = new Properties();\n if (stats.getInputs() != null && stats.getInputs().size() > 0 &&\n stats.getInputs().get(0).getConf() != null) {\n\n Configuration conf = stats.getInputs().get(0).getConf();\n for (Map.Entry<String, String> entry : conf) {\n jobConfProperties.setProperty(entry.getKey(), entry.getValue());\n }\n\n if (workflowVersion == null) {\n workflowVersion = conf.get(\"pig.logical.plan.signature\");\n }\n }\n\n job.setJobStats(stats);\n jobs.add(job);\n }", "@Override\n\tpublic void run() {\n\t\tlong starttime = System.currentTimeMillis();\n\n\t\tboolean started = statusMap.get(type);\n\t\tif (!started) {\n\n\t\t\tstatusMap.put(type, true);\n\t\t\tlogger.info(\n\t\t\t\t\t\"task of id add to queue of busType : {} started,current milestone : {}\",\n\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type), milestone);\n\t\t\ttry {\n\t\t\t\tIdGeneratorQueue queue = QueueUtil\n\t\t\t\t\t\t.getIdGeneratorQueue(AptConstants.BUS_NAME_MAP.get(type));\n\n\t\t\t\tif (null == queue) {\n\t\t\t\t\tlogger.error(\n\t\t\t\t\t\t\t\"task of add id to queue faile , no queue of name: {} finded\",\n\t\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlogger.info(\"queue : {} has {} id not uesed.\", queue.getSize());\n\t\t\t\tlong nextMilestone = generatorService.nextMilestone(type);\n\t\t\t\tlogger.info(\"task of add id to queue,nextMilestone is {}\", nextMilestone);\n\n\t\t\t\tif (nextMilestone <= milestone) {\n\t\t\t\t\tlogger.error(\n\t\t\t\t\t\t\t\"task of get next milestone error,nextMileStone is smaller, busType: {},miletone : {}\",\n\t\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type), milestone);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlong start = milestone + 1;\n\t\t\t\tlong end = nextMilestone + 1;\n\n\t\t\t\tlogger.info(\"start add id to queue : {},start : {},end : {}\",\n\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type), start, end);\n\t\t\t\tqueue.setMileStone(nextMilestone);\n\t\t\t\t//填充数据 满等待\n\t\t\t\tfor (long i = start; i <= end; i++) {\n\t\t\t\t\tqueue.putId(i);\n\t\t\t\t}\n\t\t\t\tlogger.info(\"success add id to queue! busType : {}\",\n\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type));\n\t\t\t\tstatusMap.put(type, false);\n\n\t\t\t} catch (Exception e) {\n\t\t\t\tlogger.error(\"task of id add to queue of busType : {} failed \",\n\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type));\n\t\t\t\tlogger.error(\"\", e);\n\t\t\t}\n\t\t}\n\t\tlong endtime = System.currentTimeMillis();\n\n\t\tlogger.info(\"task off add to queue ended,busType : {},usetime : {}\",\n\t\t\t\tAptConstants.BUS_NAME_MAP.get(type), endtime - starttime);\n\t}", "private static void addBoatToList(Boat b) {\n\t\tboats.add(b);\n\t}", "public void offer(Passenger passenger) \n\t{\n\t\tTask newTask = new Task(passenger, passenger.getPriority());\n\t\t\n\t\theap[++size] = newTask;\n\t\tint current = size;\n\t\twhile(current != 1 && passenger.getPriority() < heap[current / 2].getPriority())\n\t\t{\n\t\t\theap[current] = heap[current / 2];\n\t\t\tcurrent /= 2;\n\t\t}\n\t\theap[current] = newTask;\n\t\t\n\t}", "public static void main(String[] args) {\n FirstComeFirstServed FCFS = new FirstComeFirstServed();\n\n ShortestJobFirst SJF = new ShortestJobFirst();\n ShortestRemainingTime SRT = new ShortestRemainingTime();\n RoundRobin RR = new RoundRobin();\n NonpreemptiveHighestPriorityFirst NP_HPF = new NonpreemptiveHighestPriorityFirst();\n PreemptiveHighestPriorityFirst P_HPF = new PreemptiveHighestPriorityFirst();\n NonpreemptiveHighestPriorityFirstAging NP_HPF_AG = new NonpreemptiveHighestPriorityFirstAging();\n PreemptiveHighestPriorityFirstAging P_HPF_AG = new PreemptiveHighestPriorityFirstAging();\n\n\n PriorityQueue<Process>[] priorityQueues = new PriorityQueue[COUNT_ALGORITHM + 1];\n int [] SEEDS = new int[]{1234, 117777,33317,17111, 19191};\n\n for (int j = 0; j < ROUND; j++) {\n System.out.format(\"\\n### Start Running Round %d ###\\n\", j);\n // write your code here\n priorityQueues[0] = ProcessGenerator.generateJobs (SEEDS[j], 20);\n\n // make a copy for each algorithm\n for (int i = 1; i < COUNT_ALGORITHM + 1; i++) {\n priorityQueues[i] = new PriorityQueue<Process>(priorityQueues[0]);\n }\n\n // print the process list in ascending order\n while (!priorityQueues[COUNT_ALGORITHM].isEmpty()) {\n System.out.println(priorityQueues[COUNT_ALGORITHM].poll());\n }\n\n\n // Add different scheduling algorithms here\n System.out.println(\"\\nFisrt come first servered\");\n FCFS.schedule(priorityQueues[0]);\n\n System.out.println(\"\\nShortest Job First\");\n SJF.schedule(priorityQueues[1]);\n\n System.out.println(\"\\nShortest remaining time\");\n SRT.schedule(priorityQueues[2]);\n System.out.println(\"\\nRoundRobin\");\n RR.schedule(priorityQueues[4]);\n\n System.out.println(\"\\nNonpreemptive Highest Priority First\");\n NP_HPF.schedule(priorityQueues[5]);\n\n System.out.println(\"\\nNonpreemptive Highest Priority First (Aging)\");\n NP_HPF_AG.schedule(priorityQueues[6]);\n\n System.out.println(\"\\nPreemptive Highest Priority First\");\n P_HPF.schedule(priorityQueues[7]);\n\n System.out.println(\"\\nPreemptive Highest Priority First (Aging)\");\n P_HPF_AG.schedule(priorityQueues[8]);\n\n\n }\n\n\n System.out.println(\"\\n\");\n System.out.format(\"==================== 5 Round Average Statistics ====================\\n\");\n System.out.format(\"%10s %20s %20s %20s\\n\", \"Algorithm\", \"Turnaround\", \"Waiting\", \"Response\");\n System.out.format(\"%10s %20.3f %20.3f %20.3f\\n\", \"FCFS\",\n FCFS.getStats().getAvgTurnaroundTime(),\n FCFS.getStats().getAvgWaitingTime(),\n FCFS.getStats().getAvgResponseTime());\n\n\n System.out.format(\"%10s %20.3f %20.3f %20.3f\\n\", \"SJF\",\n SJF.getStats().getAvgTurnaroundTime(),\n SJF.getStats().getAvgWaitingTime(),\n SJF.getStats().getAvgResponseTime());\n\n System.out.format(\"%10s %20.3f %20.3f %20.3f\\n\", \"SRT\",\n SRT.getStats().getAvgTurnaroundTime(),\n SRT.getStats().getAvgWaitingTime(),\n SRT.getStats().getAvgResponseTime());\n\n System.out.format(\"%10s %20.3f %20.3f %20.3f\\n\", \"RR\",\n RR.getStats().getAvgTurnaroundTime(),\n RR.getStats().getAvgWaitingTime(),\n RR.getStats().getAvgResponseTime());\n\n System.out.format(\"%10s %20.3f %20.3f %20.3f\\n\", \"SJF\",\n SJF.getStats().getAvgTurnaroundTime(),\n SJF.getStats().getAvgWaitingTime(),\n SJF.getStats().getAvgResponseTime());\n\n\n System.out.format(\"%10s %20.3f %20.3f %20.3f\\n\", \"NP_HPF\",\n NP_HPF.getStats().getAvgTurnaroundTime(),\n NP_HPF.getStats().getAvgWaitingTime(),\n NP_HPF.getStats().getAvgResponseTime());\n\n System.out.format(\"%10s %20.3f %20.3f %20.3f\\n\", \"P_HPF\",\n P_HPF.getStats().getAvgTurnaroundTime(),\n P_HPF.getStats().getAvgWaitingTime(),\n P_HPF.getStats().getAvgResponseTime());\n\n System.out.format(\"%10s %20.3f %20.3f %20.3f\\n\", \"NP_HPF_AG\",\n NP_HPF_AG.getStats().getAvgTurnaroundTime(),\n NP_HPF_AG.getStats().getAvgWaitingTime(),\n NP_HPF_AG.getStats().getAvgResponseTime());\n\n System.out.format(\"%10s %20.3f %20.3f %20.3f\\n\", \"P_HPF_AG\",\n P_HPF_AG.getStats().getAvgTurnaroundTime(),\n P_HPF_AG.getStats().getAvgWaitingTime(),\n P_HPF_AG.getStats().getAvgResponseTime());\n\n }", "public void onBirth(Event ev, double timestamp){\n\t\tRequest request = new Request(timestamp);\n\t\tqueue.add(request);\n\t\t\n\t\t\n\t\t/**\n\t\t * if the queue is empty then start executing directly there is no waiting time.\n\t\t */\n\t\tif(queue.size() == 1){\n\t\t\t\n\t\t\trequest.setStartedProcessing(timestamp);\n\t\t\tEvent event = new Event(timestamp + getTimeOfNextDeath(), EventType.DEATH, this);\n\t\t\tschedule.add(event);\n\t\t}\n\t\t\n\t\tif(ev.getTag()){\n\t\t\t/**\n\t\t\t * schedule the next arrival\n\t\t\t */\n\t\t\tdouble time = getTimeOfNextBirth();\n\t\t\tEvent event = new Event(timestamp + time, EventType.BIRTH, this);\n\t\t\tevent.setTag(true);\n\t\t\tschedule.add(event);\n\t\t}\n\t}", "public void addQueuedPassenger(){\n this._queuedPassengers +=1;\n }", "private void insertFrameTask(TaskInfo pTaskInfo) {\n\t\t// inserted into list in time order\r\n\t\t//\r\n\t\tif (m_pFrameList == null) {\r\n\t\t\tpTaskInfo.pNext = null;\r\n\t\t\tm_pFrameList = pTaskInfo;\r\n\t\t} else if (m_pFrameList.time.next > pTaskInfo.time.next) {\r\n\t\t\tpTaskInfo.pNext = m_pFrameList;\r\n\t\t\tm_pFrameList = pTaskInfo;\r\n\t\t} else {\r\n\t\t\tTaskInfo pInfo = m_pFrameList;\r\n\t\t\twhile (pInfo != null) {\r\n\t\t\t\tif (pInfo.pNext == null) {\r\n\t\t\t\t\tpTaskInfo.pNext = null;\r\n\t\t\t\t\tpInfo.pNext = pTaskInfo;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else if (pInfo.pNext.time.next > pTaskInfo.time.next) {\r\n\t\t\t\t\tpTaskInfo.pNext = pInfo.pNext;\r\n\t\t\t\t\tpInfo.pNext = pTaskInfo;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tpInfo = pInfo.pNext;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void run() {\n\t\tprocesses.forEach( p -> pQueue.add(p));\n\t\t\n\t\twhile(!pQueue.isEmpty() || currentP != null) {\n\t\t\t\n\t\t\t/*My first options. Works fine but can be improved.*/\n\t\t\t/*while(!pQueue.isEmpty() && (currentP == null)) {\t\t\t\t\t\n\t\t\t\tif(counter >= pQueue.peek().getArrivalTime()) {\t\t\t\t\t\n\t\t\t\t\tcurrentP = pQueue.poll();\n\t\t\t\t\tcurrentBurst = currentP.getBurstTime();\n\t\t\t\t}\t\n\t\t\t\tbreak;\n\t\t\t}*/\n\t\t\t\n\t\t\t/*Improved code from above. If there is no current process running, and \n\t\t\t * the first in queue has hit counter time, then poll it from queue. \n\t\t\t * */\t\t\t\n\t\t\tif(currentP == null && counter >= pQueue.peek().getArrivalTime()) {\n\t\t\t\tcurrentP = pQueue.poll();\n\t\t\t\tcurrentBurst = currentP.getBurstTime();\n\t\t\t}\n\t\t\t\n\t\t\t/*If there was no process ready in queue, nor a process already running, \n\t\t\t * increment the counter and loop again.*/\n\t\t\tif(currentP == null) {\n\t\t\t\tcounter++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t/*If there is a process running: Add one to counter and decrease the \n\t\t\t * burst time. \n\t\t\t * If burst time reached 0, the process terminated. Set timers, release\n\t\t\t * current process and reset current process burst time counter. */\n\t\t\telse if(currentP != null) {\n\t\t\t\tcounter++;\n\t\t\t\tcurrentBurst--;\n\t\t\t\n\t\t\t\tif(currentBurst <= 0) {\n\t\t\t\t\t//Helper method to encapsulate arithmetic. \n\t\t\t\t\tthis.setTimers(currentP);\n\t\t\t\t\tcurrentP = null;\n\t\t\t\t\tcurrentBurst=0;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t\tprintGanttChart();\n\t\tprintTable();\n\t}", "@Override\n\tpublic synchronized boolean add(TracesMessage obj) {\n\t\tTracesMessage log = obj;\n\t\tlong ts =log.getTime();\n\t\tif (ts < startTime || startTime < 0)\n\t\t\tstartTime = ts;\n\t\treturn super.add(obj);\n\t}", "void reschedule(Group groupInfo, boolean miss);", "public void addSubproject(final Task subproject) {\n\t\t// remove sentinels \n\t\tTaskReference startSentinel = (TaskReference) list.removeFirst();\n\t\tTaskReference endSentinel = (TaskReference) list.removeLast();\n\n\t\t// mark tasks to be added as not yet treated\n\t\tboolean m = !getMarkerStatus();\n\t\tsubproject.setMarkerStatus(m);\n\t\tsubproject.markTaskAsNeedingRecalculation();\n\t\tIterator j = ((SubProj)subproject).getSubproject().getTasks().iterator();\n\t\twhile (j.hasNext()) {\n\t\t\tTask task = (Task)j.next();\n\t\t\ttask.setMarkerStatus(m);\n\t\t\ttask.markTaskAsNeedingRecalculation();\n\n\t\t}\n\t\t\n\t\tremoveTask(subproject); // remove existing one\n\t\tarrangeSingleTask(subproject); // add it back - it will become a parent\n\t\t// add child tasks\n\t\tIterator i = ((SubProj)subproject).getSubproject().getTasks().iterator();\n\t\twhile (i.hasNext())\n\t\t\tarrangeSingleTask((Task)i.next());\n\t\t\n\t\t// put back sentinels\n\t\tlist.addFirst(startSentinel);\n\t\tlist.addLast(endSentinel);\n\t}", "public void breakApart(final Asteroids asteroids)\n {\n Double2D location = asteroids.field.getObjectLocation(this);\n int[] sizes = breakMap[size][asteroids.random.nextInt(breakMap[size].length)];\n \n if (sizes.length > 0)\n {\n // break into asteroids\n int sum = 0;\n for(int i = 0; i < sizes.length; i++)\n sum += sizes[i];\n \n // compute velocities\n double explosionForce = asteroids.random.nextDouble() * (MAXIMUM_EXPLOSION_FORCE - MINIMUM_EXPLOSION_FORCE) + MINIMUM_EXPLOSION_FORCE;\n double sumForceX = 0;\n double sumForceY = 0;\n for(int i = 0; i < sizes.length; i++)\n {\n double angle = asteroids.random.nextDouble() * Math.PI * 2;\n double force = explosionForce / sizes.length;\n double forceX = force * Math.cos(angle);\n double forceY = force * Math.sin(angle);\n if (i == sizes.length - 1)\n { forceX = -sumForceX; forceY = -sumForceY; } // last one ought to balance out the others. It's best if it's the biggest one, hence why we list smaller asteroids first\n else { sumForceX += forceX; sumForceY += forceY; }\n // yes, this is a dead store\n Asteroid a = new Asteroid(asteroids, sizes[i], new MutableDouble2D(velocity.x + forceX, velocity.y + forceY), location);\n }\n }\n else\n {\n breakIntoShards(asteroids);\n }\n end(asteroids);\n asteroids.asteroidCount--;\n if (asteroids.asteroidCount <= 0)\n {\n asteroids.schedule.scheduleOnceIn(asteroids.WAIT_PERIOD, new Steppable()\n {\n public void step(SimState state)\n {\n asteroids.createAsteroids();\n }\n });\n }\n }", "private void enterToRunwayQueue() {\n\t\tqueue.insert(this);\n\t}", "@Override\n\tpublic void addToQueue() {\n\t}", "private void recursive(ScheduledTask[] schedule, int startIndex, int[] processorDurations)\n\t{\t\n\t\t// this is the base case. if the start index is at the size of schedule, aka all the tasks have\n\t\t// been assigned, then the method returns the complete schedule formed.\n\t\tif (startIndex == schedule.length)\n\t\t{\n\t\t\tSchedule temp = new Schedule(tasks, m, schedule);\n\t\t\tif (temp.getMakespan() < best.getMakespan())\n\t\t\t{\n\t\t\t\tbest = new Schedule(tasks, m, temp.getScheduledTasks());\n\t\t\t}\n\t\t}\n\t\tif (startIndex < schedule.length)\n\t\t{\n\t\t\t// this tries adding the task to each processor and finds the most optimal schedule formed\n\t\t\tfor (int i = 0; i < m; i++)\n\t\t\t{\n\t\t\t\t// this checks to see if adding a task would make the makespan greater than the optimum\n\t\t\t\t// if it does, then it's probably not the best solution\n\t\t\t\tif ((processorDurations[i] + tasks[startIndex]) > best.getMakespan())\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t// this assigns the task to the processor i\n\t\t\t\tschedule[startIndex] = new ScheduledTask(startIndex, i);\n\t\t\t\n\t\t\t\t// this increments the total duration of the processor that the task just got assigned to\n\t\t\t\tint [] processorDurationsTemp = processorDurations.clone();\n\t\t\t\tprocessorDurationsTemp[i] += tasks[startIndex];\n\t\t\t\t\n\t\t\t\t// this is where the recursion occurs\n\t\t\t\trecursive(schedule, startIndex + 1, processorDurationsTemp);\n\t\t\t}\n\t\t}\n\t\t\n\t}" ]
[ "0.5888798", "0.5256955", "0.52559215", "0.5074789", "0.49696532", "0.4933672", "0.47966903", "0.4784746", "0.47363544", "0.4670205", "0.46597457", "0.45890528", "0.45849794", "0.45724517", "0.45602462", "0.45258614", "0.4513077", "0.45021588", "0.44744876", "0.44405648", "0.44394332", "0.44343704", "0.44341674", "0.44339597", "0.44199905", "0.44131717", "0.4403355", "0.4397043", "0.4396192", "0.43787163", "0.43734184", "0.43652782", "0.43623936", "0.4361014", "0.4353915", "0.43531063", "0.43522987", "0.43456835", "0.43342426", "0.4329439", "0.4328909", "0.4325808", "0.4325476", "0.4320355", "0.43142962", "0.43092248", "0.4304126", "0.42965478", "0.42954117", "0.4294447", "0.42932466", "0.42926666", "0.42880666", "0.42871088", "0.4286864", "0.42822045", "0.42793885", "0.42776763", "0.4270935", "0.42643934", "0.4261675", "0.42547843", "0.42512247", "0.42442185", "0.4242538", "0.4234126", "0.42329672", "0.42266187", "0.42246294", "0.42217657", "0.42200473", "0.42198628", "0.42121986", "0.42074078", "0.4202682", "0.42003417", "0.41955543", "0.41928548", "0.4185598", "0.41750225", "0.41742647", "0.41741812", "0.41723296", "0.41659462", "0.41641095", "0.41570362", "0.41554052", "0.41511884", "0.41503045", "0.41481173", "0.41429916", "0.4131109", "0.4127448", "0.41200867", "0.41180807", "0.41154516", "0.41132686", "0.4112749", "0.41093397", "0.40918702" ]
0.64348143
0
Construct and send the waiting profile
public WaitingProfile constructWaitingProfile(Barge barge, int currentTime) { /*if(Port.eventsToExcel.equals("Yes")){ Port.stats.addEvent(currentTime, barge.bargeNumber, (barge.toString()+ " asked Terminal " + this.toString()+ " for appoints "+ " ||appointements= " +this.appointmentsToString())); }*/ return new WaitingProfile(this, barge, currentTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public WaitMessage() {\n super(\"Wait for other player...\\n\");\n }", "public WaitingScreen() {\r\n super(\"Please wait...\", new Item[0]);\r\n mWaitString = new StringItem(\"Network\", \"\\nServer contacting...\");\r\n append(mWaitString);\r\n }", "public void takeABus() {\n\t\tClientCom clientCom = new ClientCom(RunParameters.ArrivalQuayHostName, RunParameters.ArrivalQuayPort);\n\t\twhile (!clientCom.open()) {\n\t\t\tSystem.out.println(\"Arrival Quay not active yet, sleeping for 1 seccond\");\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t}\n\t\t}\n\t\t;\n\t\tPassenger passenger = (Passenger) Thread.currentThread();\n\t\tMessage pkt = new Message();\n\t\tpkt.setType(MessageType.PASSENGERS_WAITING);\n\t\tpkt.setId(passenger.getPassengerId());\n\n\t\tclientCom.writeObject(pkt);\n\t\tpkt = (Message) clientCom.readObject();\n\n\t\tpassenger.setCurrentState(pkt.getState());\n\t\tclientCom.close();\n\t}", "public void prepareTheBill(){\n Waiter w = (Waiter) Thread.currentThread();\n CommunicationChannel com = new CommunicationChannel(serverHostName, serverPortNumb);\n Object[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n state_fields[0] = w.getWaiterID();\n \tstate_fields[1] = w.getWaiterState();\n\n Message m_toServer = new Message(3, params, 0, state_fields, 2, null); \n Message m_fromServer;\n\n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n }\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n\n w.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "public void waitingForPartner();", "public void callTheWaiter(){\n Student s = (Student) Thread.currentThread();\n\n \tCommunicationChannel com = new CommunicationChannel (serverHostName, serverPortNumb);\n \tObject[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n \tstate_fields[0] = s.getID();\n \tstate_fields[1] = s.getStudentState();\n \t\n Message m_toServer = new Message(7, params, 0, state_fields, 2, null); \n Message m_fromServer; \n \n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n }\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n \n s.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "public abstract void onWait();", "protected int getWait() \t\t\t\t{\treturn wait;\t\t}", "private String waitPrint(){return \"waiting for other players...\";}", "public void run() {\n\t\t\t\t\tSystem.out.println(Thread.currentThread().getName()+\"准备。。。\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tp.await();//等待\n\t\t\t\t\t\tSystem.out.println(Thread.currentThread().getName()+\"已接受。。。\");\n\t\t\t\t\t\tThread.sleep((long)(Math.random()*10000));\n\t\t\t\t\t\tSystem.out.println(Thread.currentThread().getName()+\"完成。。。\");\n\t\t\t\t\t\ts.countDown();//三次后为0 释放主线程中的等待\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}", "@Override\r\n\t\tpublic void action() {\n\t\t\tswitch (state) {\r\n\t\t\tcase REGISTER:\r\n\t\t\t\tSystem.out.println(\"Philosopher Agent \"\r\n\t\t\t\t\t\t+ myAgent.getAID().getName()\r\n\t\t\t\t\t\t+ \" trying to register\");\r\n\t\t\t\t\r\n\t\t\t\t// searching for waiter agent\r\n\t\t\t\twhile(waiter == null) {\r\n\t\t\t\t\twaiter = searchWaiterAgent(\"waiter-service\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tACLMessage cfp = new ACLMessage(ACLMessage.CFP);\r\n\t\t\t\tcfp.addReceiver(waiter);\r\n\t\t\t\tcfp.setContent(\"philosopher-agent\");\r\n\t\t\t\tcfp.setConversationId(\"philosopher-waiter-fork\");\r\n\t\t\t\tcfp.setReplyWith(\"cfp\"+System.currentTimeMillis());\r\n\t\t\t\tSystem.out.println(\"Philosopher Agent \"\r\n\t\t\t\t\t\t+ myAgent.getAID().getName()\r\n\t\t\t\t\t\t+ \" send registration request \" + cfp);\r\n\t\t\t\tmyAgent.send(cfp);\r\n\t\t\t\t\r\n\t\t\t\t// Prepare template to get response\r\n\t\t\t\t//mt = MessageTemplate.and(MessageTemplate.MatchConversationId(\"philosopher-waiter-fork\"),\r\n\t\t\t\t//\t\tMessageTemplate.MatchInReplyTo(request.getReplyWith()));\r\n\t\t\t\tmt = MessageTemplate.MatchConversationId(\"philosopher-waiter-fork\");\r\n\t\t\t\tstate = State.REGISTERED;\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase REGISTERED:\r\n\t\t\t\tACLMessage response = myAgent.receive();\r\n\t\t\t\tif (response != null && response.getConversationId().equals(\"philosopher-waiter-fork\")) {\r\n\t\t\t\t\tif (response.getPerformative() == ACLMessage.SUBSCRIBE) {\r\n\t\t\t\t\t\t// behaviour can be finished\r\n\t\t\t\t\t\tregistered = true;\r\n\t\t\t\t\t\tSystem.out.println(\"Philosopher Agent \"\r\n\t\t\t\t\t\t\t\t+ myAgent.getAID().getName()\r\n\t\t\t\t\t\t\t\t+ \" registered Successfully\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tregistered = false;\r\n\t\t\t\t\t\tSystem.out.println(\"Philosopher Agent \"\r\n\t\t\t\t\t\t\t\t+ myAgent.getAID().getName()\r\n\t\t\t\t\t\t\t\t+ \" registration in progress\");\r\n\t\t\t\t\t\tstate = State.REGISTER;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tSystem.out.println(myAgent.getAID().getName() + \" blocked\");\r\n\t\t\t\t\tblock();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}", "@Override\n public String getName() {return \"Waiting For Turn Phase\";}", "public ProfileQueue() {\n this.arrProfiles = new RadarContent[0];\n this.length = 0;\n }", "public void run(){\n\t\tList<String> availableUUIDs = rfduinoConnection.getDiscoveredCharacteristics();\n\t\tif (availableUUIDs != null && availableUUIDs.contains(RFDuinoSystemCharacteristics.RFDUINO_PROFILE_SEND_UUID)){\n\t\t\t//Try to write the chosen color into this characteristic to send back:\n\t\t\tbyte[] sendOne = new byte[]{1};\n\t\t\trfduinoConnection.writeCharacteristic(RFDuinoSystemCharacteristics.RFDUINO_PROFILE_SEND_UUID, sendOne);\n\t\t}\n\t\t}", "public void run(){\n\t\tList<String> availableUUIDs = rfduinoConnection.getDiscoveredCharacteristics();\n\t\tif (availableUUIDs != null && availableUUIDs.contains(RFDuinoSystemCharacteristics.RFDUINO_PROFILE_SEND_UUID)){\n\t\t\t//Try to write the chosen color into this characteristic to send back:\n\t\t\tbyte[] sendZero = new byte[]{0};\n\t\t\trfduinoConnection.writeCharacteristic(RFDuinoSystemCharacteristics.RFDUINO_PROFILE_SEND_UUID, sendZero);\n\t\t}\n\t\t}", "public ProfileRequests() {\n }", "private synchronized void create_head(){\n\t\t// Take current time\n\t\thead_time = System.currentTimeMillis();\n\t\tdouble lcl_head_time = head_time/1000.0;\n\t\tString time = Double.toString(lcl_head_time);\n\t\t \n\t\theader.append(\"protocol: 1\\n\");\n\t\theader.append(\"experiment-id: \" + oml_exp_id + \"\\n\");\n\t\theader.append(\"start_time: \" + time + \"\\n\");\n\t\theader.append(\"sender-id: \" + oml_name + \"-sender\\n\");\n\t\theader.append(\"app-name: \" + oml_app_name + \"\\n\");\n\t}", "public void alertTheWaiter(){\n Chef c = (Chef) Thread.currentThread();\n CommunicationChannel com = new CommunicationChannel(serverHostName, serverPortNumb);\n Object[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n state_fields[0] = c.getChefID();\n \tstate_fields[1] = c.getChefState();\n\n Message m_toServer = new Message(1, params, 0, state_fields, 2, null); \n Message m_fromServer;\n\n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n \t}\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n\n c.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "@Override\n\t\tpublic void run() {\n\t\t\tsuper.run();\n\t\t\twhile (true) {\n\t\t\t\tLog.i(\"pt\", \"looping!\");\n\t\t\t\tif (receivedProfile == true) {\n\t\t\t\t\tString profile = \"Age: \" + op.getAge() + \" / Gender: \" + op.getGender() + \"\\nCountry: \" + op.getCountry() + \" \\nInterest: \" + op.getInterest();\n\t\t\t\t\t//al.add(new Chats(profile, 5));\n\t\t\t\t\tHM.MessageSender(mainHandler, chm.getSuccessMessage() + profile);\n\t\t\t\t\t//scrollToBottomHandler.sendEmptyMessage(1);\n\t\t\t\t\treceivedProfile = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public String cmdChanProfile(){\r\n\t\treturn \"get /unit-\" + this.getTbs().getSlot() + \"/port-\" + this.getTbs().getPortNumber() + \"/chan-1/cfgm/chanprofile\";\r\n\t}", "protected abstract void beforeWait();", "@Override\n\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\twait = new waittingDialog();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}", "public String getWaitType() {\r\n return waitType;\r\n }", "@Override\r\n\tprotected void processTakeout() {\n\r\n\t}", "@Override\r\n\tprotected void processTakeout() {\n\r\n\t}", "public void toWaitingTurn() {\n }", "public void returningToTheBar(){\n Waiter w = (Waiter) Thread.currentThread();\n CommunicationChannel com = new CommunicationChannel(serverHostName, serverPortNumb);\n Object[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n state_fields[0] = w.getWaiterID();\n \tstate_fields[1] = w.getWaiterState();\n\n Message m_toServer = new Message(2, params, 0, state_fields, 2, null); \n Message m_fromServer;\n\n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n }\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n\n w.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "protected void setWait(int _wait)\t\t{\twait = _wait;\t\t}", "private void status() {\n Thread blockTread = new Thread() {\n @Override\n public void run() {\n synchronizedMethod();\n }\n };\n blockTread.start();\n\n Thread blockTread2 = new Thread() {\n @Override\n public void run() {\n synchronizedMethod();\n waitWithTimeMethod();\n }\n };\n log.info(blockTread2.getState().name());\n blockTread2.start();\n log.info(blockTread2.getState().name());\n while (true) {\n State state = blockTread2.getState();\n if (state == State.BLOCKED) {\n log.info(state.name());\n break;\n }\n }\n while (true) {\n State state = blockTread2.getState();\n if (state == State.TIMED_WAITING) {\n log.info(state.name());\n notifyMethod();\n break;\n }\n }\n while (true) {\n State state = blockTread2.getState();\n if (state == State.WAITING) {\n log.info(state.name());\n notifyMethod();\n break;\n }\n }\n while (true) {\n State state = blockTread2.getState();\n if (state == State.TERMINATED) {\n log.info(state.name());\n break;\n }\n }\n }", "private ProfileMessage(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "void listWaitingList( String messager ) {\n int i;\n ChildBot bot;\n ListIterator<ChildBot> iterator;\n\n m_botAction.sendSmartPrivateMessage( messager, \"Waiting list:\" );\n\n for( iterator = m_spawnQueue.listIterator(), i = 1; iterator.hasNext(); i++ ) {\n bot = iterator.next();\n m_botAction.sendSmartPrivateMessage( messager, i + \": \" + bot.getBot().getBotName() + \", created by \" + bot.getCreator() + \".\" );\n }\n\n m_botAction.sendSmartPrivateMessage( messager, \"End of list\" );\n }", "private void waitOnFabric(int additional) {\n try {\n out(\"Wait %d milliseconds for peers to sync with each other\", gossipWaitTime + additional);\n TimeUnit.MILLISECONDS.sleep(gossipWaitTime + additional);\n } catch (InterruptedException e) {\n fail(\"should not have jumped out of sleep mode. No other threads should be running\");\n }\n }", "@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tpartnerConn.receive();\n\t\t\t\tString message = partnerConn.getConnBuffer();\n\t\t\t\tif (isCompleteMessage(message)) {\n\t\t\t\t\tsynchronized (completedProcs) {\n\t\t\t\t\t\tcompletedProcs.add(partnerPid);\n\t\t\t\t\t\tcompletedProcs.notifyAll();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsynchronized (completedProcs) {\n\t\t\t\t\twhile (completedProcs.size() != nProc)\n\t\t\t\t\t\tcompletedProcs.wait();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpartnerConn.send(\"SEND_STATS\");\n\t\t\t\tpartnerConn.receiveObject();\n\t\t\t\tProcStats partnerStats = (ProcStats)partnerConn.getConnObjBuffer();\n\t\t\t\tsynchronized (procStats) {\n\t\t\t\t\tprocStats.put(partnerPid, partnerStats);\n\t\t\t\t\tprocStats.notifyAll();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "private void composeProfile() {\n if(NetworkUtils.isConnectedToNetwork((ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE)) == false) {\n Toast.makeText(this.getApplicationContext(), \"Please check your network connection!\", Toast.LENGTH_LONG).show();\n return;\n }\n Intent i = new Intent(this, ProfileActivity.class);\n i.putExtra(\"screen_name\", (String) null);\n startActivity(i);\n }", "protected void processSleepObject(VObject inObject) {\n\t\tboolean doXmppStatus = true;\n\t\tfinal boolean isXmppObject = inObject.isXMPP();\n\n\t\t//Special case for xmpp object, we will check the resources\n\t\tString theRessource = null;\n\t\tif (isXmppObject) {\n\t\t\tfinal List<String> resources = inObject.getResources(); //IQResourcesQuery.getClientResources(inObject.getXmppAddress());\n\t\t\tif (resources.isEmpty()) {\n\t\t\t\tinObject.setState(VObject.STATUS_VEILLE);\n\t\t\t} else if (resources.contains(\"asleep\")) {\n\t\t\t\ttheRessource = resources.get(0);\n\t\t\t\tdoXmppStatus = false;\n\t\t\t}\n\t\t}\n\n\t\tfinal int inState = inObject.getObject_state();\n\t\tCrawlerCheckStatus.LOGGER.info(\"Processing sleep for \" + inObject.getObject_serial() + \" / \" + inState + \" / \" + theRessource);\n\n\t\t//all STATUS_WILLBE_* are used only for xmpp objects\n\t\tswitch (inState) {\n\t\tcase VObject.STATUS_VEILLE: // special case because cache notification is slow/missing so i override this value in db.\n\t\t\tinObject.overrideState(VObject.STATUS_VEILLE);\n\t\t\tsendXmppStatus(inObject, Message.MODE_VEILLE, JabberMessageFactory.IQ_STATUS_IDLE_MODE);\n\t\t\tbreak;\n\t\tcase VObject.STATUS_ACTIF:\n\t\tcase VObject.STATUS_FORCE_VEILLE:\n\t\tcase VObject.STATUS_WILLBE_ACTIF:\n\t\tcase VObject.STATUS_WILLBE_VEILLE:\n\t\tcase VObject.STATUS_WILLBE_FORCE_VEILLE:\n\t\t\tif (isXmppObject && doXmppStatus) {\n\t\t\t\tsendXmppStatus(inObject, Message.MODE_VEILLE, JabberMessageFactory.IQ_STATUS_IDLE_MODE);\n\t\t\t} else {\n\t\t\t\tinObject.setState(VObject.STATUS_VEILLE);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase VObject.STATUS_WILLBE_FORCE_ACTIF: //normally, object ping do not enter in this condition\n\t\t\tif (isXmppObject && !doXmppStatus) {\n\t\t\t\tsendXmppStatus(inObject, Message.MODE_FORCE_ACTIF, JabberMessageFactory.IQ_STATUS_ASLEEP_MODE);\n\t\t\t} else {\n\t\t\t\tinObject.setState(VObject.STATUS_FORCE_ACTIF);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "private void createGuestProfile() {\n saveData();\n signupDelegate.enableNextButton(Boolean.FALSE);\n SwingUtil.setCursor(this, java.awt.Cursor.WAIT_CURSOR);\n errorMessageJLabel.setText(getString(\"SigningUp\"));\n errorMessageJLabel.paintImmediately(0, 0, errorMessageJLabel.getWidth(),\n errorMessageJLabel.getHeight());\n try {\n getSignupHelper().createGuestProfile();\n } catch (final OfflineException ox) {\n logger.logError(ox, \"An offline error has occured.\");\n addInputError(getSharedString(\"ErrorOffline\"));\n } catch (final ReservationExpiredException rex) {\n logger.logWarning(rex, \"The username/e-mail reservation has expired.\");\n addInputError(getString(\"ErrorReservationExpired\"));\n } catch (final Throwable t) {\n logger.logFatal(t, \"An unexpected error has occured.\");\n addInputError(getSharedString(\"ErrorUnexpected\"));\n } finally {\n errorMessageJLabel.setText(\" \");\n }\n }", "public void msgReadyForParts()\n\t{\n\t\tprint(\"Gantry: Feeder ready for party\");\n\t\tgantry_events.add(GantryEvents.FeederReadyForBin);\n\t//\tlog.add(new LoggedEvent(\"msgReadyForParts received from Feeder\"));\n\t\tstateChanged();\n\t}", "public RequestResponseBehaviour(BoatCoordinator myAgent, MessageTemplate mt) {\n super(myAgent, mt);\n showMessage(\"Waiting REQUESTs from authorized agents\");\n this.receiver = receiver;\n }", "public DefaultWaitingScreen(String gameId, ParamObject parameter, String screenId, Long showUpTime) {\n\t\tsuper(gameId, parameter, screenId, showUpTime);\n\n\t\tthis.message = parameter.getMessage();\n\t\tsetLayout(new BorderLayout(0, 0));\n\t\tthis.labelWaitMessage = new JLabel(\"<html><body><h1>Please wait...</h1></body></html>\");\n\t\tlabelWaitMessage.setFont(new Font(\"Tahoma\", Font.BOLD, 17));\n\n\t\tsetBorder(new EmptyBorder(10, 10, 10, 10));\n\t\tsetBackground(Color.WHITE);\n\n\t\tsetLayout(new BorderLayout(0, 0));\n\n\t\tJPanel infoPanel = new JPanel();\n\t\tinfoPanel.setBorder(new EmptyBorder(5, 5, 5, 5));\n\t\tinfoPanel.setBackground(Color.WHITE);\n\t\tadd(infoPanel, BorderLayout.CENTER);\n\t\tinfoPanel.setLayout(new BorderLayout(0, 0));\n\t\tinfoPanel.add(labelWaitMessage);\n\t\tJLabel lblMessage;\n\n\t\tif (message != null) {\n\t\t\tlblMessage = new JLabel(message);\n\t\t} else {\n\t\t\tlblMessage = new JLabel();\n\t\t}\n\t\tlblMessage.setFont(new Font(\"Tahoma\", Font.BOLD, 14));\n\t\tinfoPanel.add(lblMessage, BorderLayout.SOUTH);\n\n\t\tJPanel panel = new JPanel();\n\t\tpanel.setBackground(Color.WHITE);\n\t\tadd(panel, BorderLayout.NORTH);\n\t\tpanel.setLayout(new BorderLayout(0, 0));\n\n\t\tJLabel lblLogo = new JLabel(\"\");\n\t\tlblLogo.setIcon(new ImageIcon(getClass().getResource(\"/edu/kit/exp/common/resources/kit_logo.png\")));\n\t\tpanel.add(lblLogo, BorderLayout.EAST);\n\t}", "public WaiterHelperContract() {}", "public WaitingStateDiagram() {\n\t\tsuper(\"/ThreadStatesWaiting.jpg\", true);\n\t\tcreateObjects();\n\t\troot.getChildren().addAll(displayText.getText(), circle, circle2);\n\t}", "private void waitForBuyersAction() throws InterruptedException\n {\n while(waiting)\n {\n Thread.sleep(100);\n }\n waiting = true;\n }", "void waitingForMyTurn();", "public void readyToReceive()\n { ua.printLog(\"WAITING FOR INCOMING CALL\");\n if (!ua.ua_profile.audio && !ua.ua_profile.video) ua.printLog(\"ONLY SIGNALING, NO MEDIA\"); \n //ua.listen();\n changeStatus(UA_IDLE);\n printOut(\"digit the callee's URL to make a call or press 'enter' to exit\");\n }", "private void setWaitState() {\r\n state = WAITFORBALL;\r\n game.waitingForBall.addFirst(this);\r\n }", "public com.google.protobuf2.Any getProfile() {\n if (profileBuilder_ == null) {\n return profile_ == null ? com.google.protobuf2.Any.getDefaultInstance() : profile_;\n } else {\n return profileBuilder_.getMessage();\n }\n }", "public ProfileSetupActivity() {\n }", "public static void waitForAI(){\n try {\n Thread.sleep(2000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public String creerMessage(){\n return profile.getMessage();\n }", "public Hangup() {}", "@Override public void run() {\n waitUntil(\"message\", new Condition() {\n @Override public boolean isMet() {\n return false;\n }\n }, 0);\n }", "public void notifyCreation() {\n Player targetPlayer = this.getTarget().getPlayerReference(Player.class),\n senderPlayer = this.getToTeleport().getPlayerReference(Player.class);\n\n if (targetPlayer == null || senderPlayer == null) {\n return;\n }\n\n MainData.getIns().getMessageManager().getMessage(\"TPA_SENT\").sendTo(senderPlayer);\n\n if (this.type == TeleportType.TPA) {\n MainData.getIns().getMessageManager().getMessage(\"TPA_REQUESTED\")\n .format(\"%player%\", getToTeleport().getNameWithPrefix()).sendTo(targetPlayer);\n } else if (this.type == TeleportType.TPHERE) {\n MainData.getIns().getMessageManager().getMessage(\"TPHERE_REQUESTED\")\n .format(\"%player%\", getToTeleport().getNameWithPrefix()).sendTo(targetPlayer);\n }\n\n }", "public void addNotify()\n { \n super.addNotify(); // creates the peer\n startGame(); // start the thread\n }", "public void requestAccountCreation(Secretary sec) {\n \n System.out.println(this.iD + \": Requesting account creation from secretary \" + sec.iD);\n sec.addToWaitingListForApproval(this);\n }", "public void startWaitTime(){\r\n\t\twaitTime.start();\r\n\t}", "public Wait(WaitTarget target)\r\n\t{\r\n\t\tthis.target = target;\r\n\t}", "protected abstract void afterWait();", "public void saluteTheClient(){\n Waiter w = (Waiter) Thread.currentThread();\n CommunicationChannel com = new CommunicationChannel(serverHostName, serverPortNumb);\n Object[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n state_fields[0] = w.getWaiterID();\n \tstate_fields[1] = w.getWaiterState();\n\n Message m_toServer = new Message(0, params, 0, state_fields, 2, null); \n Message m_fromServer;\n\n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n\t\t\t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n \t}\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n\n w.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//REPLY GUI\n\t\t\t\tgui.onEvent(className, XNode.NEW_USER_CREATED, null);\n\t\t\t}", "public WaitList(){\n\t}", "private void sleepForChannelJoin() {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tThread.sleep(config.getChannelJoinTimeout());\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public Profile() {}", "NetUser(String name, int totalGridlet, double baud_rate, double delay,\n int MTU, Broker broker) throws Exception\n {\n\t\tsuper( name, new SimpleLink(name+\"_link\",baud_rate,delay, MTU) );\n\n\t\tthis.receiveJobs = new GridletList();\n this.jobs = new GridletList();\n this.broker = broker;\n this.auctions = new LinkedList();\n\n // Gets an ID for this entity\n this.myId_ = super.getEntityId(name);\n\n // Creates a list of Gridlets or Tasks for this grid user\n this.createGridlet(myId_, totalGridlet);\n\n \tlong seed = 11L*13*17*19*23+1;\n\n Sim_uniform_obj genReservePrice = new Sim_uniform_obj(\"price\",1, 90, seed);\n\n \ttry{\n \t\tint choice = 1;\n \t\tfor(int i=0; i<jobs.size(); i++){\n \t\t\tif(choice == 1){\n \t\t\t// creates a FPSA with duration of 120.0\n\t \tReverseFirstPriceSealedBidAuction fpsa = new ReverseFirstPriceSealedBidAuction(\n\t\t\t\t\t super.get_name() + \"_FPSA_\" + i, 120.0);\n\n\t\t\t // To make sure that there will be offers to all jobs,\n\t\t\t // we set the reserve price to something up to 100\n\t\t\t // and offers at 10 maximum\n\t \tfpsa.setReservePrice((double)(10 + genReservePrice.sample()));\n\n\t\t\t // the auction has a referente to the job/gridlet\n\t \tfpsa.setAttribute(\"job\",(Gridlet)jobs.get(i));\n\n\t\t\t System.out.println(super.get_name() + \" \" +\n\t\t\t \t\t\"creating a FPSA to acquire resource to execute job \" +\n\t\t\t \t\t((Gridlet)jobs.get(i)).getGridletID() + \" from user \" + super.get_id());\n\n\t\t\t auctions.add(fpsa);\n \t\t\t}\n \t\t\telse if(choice == 2){\n\t\t\t // creates an English Auction with duration of 120.0 each round\n\t\t\t // and maximum of 10 rounds\n\t \tReverseEnglishAuction ea = new ReverseEnglishAuction(\n\t\t\t\t\t super.get_name() + \"_EA_\" + i, 120.0, 5);\n\n\t\t\t // To make sure that there will be offers to all jobs,\n\t\t\t // we set the reserve price to something up to 100\n\t\t\t // and offers at 10 maximum\n\t \tea.setReservePrice((double)(10 + genReservePrice.sample()));\n\t \tea.setMaxPrice(90);\n\t \tea.setMinPrice(0);\n\n\t\t\t // the auction has a referente to the job/gridlet\n\t \tea.setAttribute(\"job\",(Gridlet)jobs.get(i));\n\n\t\t\t System.out.println(super.get_name() + \" \" +\n\t\t\t \t\t\"creating an EA to acquire resource to execute job \" +\n\t\t\t \t\t((Gridlet)jobs.get(i)).getGridletID() + \" from user \" + super.get_id());\n\n\t\t\t auctions.add(ea);\n \t\t\t}\n \t\t\telse if(choice == 3){\n\t\t\t // creates a Dutch Auction with duration of 120.0 each round\n\t\t\t // and maximum of 10 rounds\n\t \tReverseDutchAuction da = new ReverseDutchAuction(\n\t\t\t\t\t super.get_name() + \"_DA_\" + i,120.0, 5);\n\n\t\t\t // To make sure that there will be offers to all jobs,\n\t\t\t // we set the reserve price to something up to 100\n\t\t\t // and offers at 10 maximum\n\t \tda.setReservePrice((double)(10 + genReservePrice.sample()));\n\t \tda.setMaxPrice(90);\n\t \tda.setMinPrice(0);\n\n\t\t\t // the auction has a referente to the job/gridlet\n\t \tda.setAttribute(\"job\",(Gridlet)jobs.get(i));\n\n\t\t\t System.out.println(super.get_name() + \" \" +\n\t\t\t \t\t\"creating a DA to acquire resource to execute job \" +\n\t\t\t \t\t((Gridlet)jobs.get(i)).getGridletID() + \" from user \" + super.get_id());\n\n\t\t\t auctions.add(da);\n\n\t\t\t choice = 0;\n \t\t\t}\n \t\t\tchoice++;\n \t\t}\n \t}\n \tcatch(Exception ex){\n\t\t\tex.printStackTrace();\n \t}\n }", "public void take(Profile profile){\n\t\t//aaaand something else\n\t\ttimesTaken++;\n\t\t//haha nope...\n\t}", "@Override\n public void run() {\n try {\n stringOrganizationIds.remove(defaultOrg);\n List<Integer> organizationIds = FluentIterable.from(stringOrganizationIds)\n .transform(Ints.stringConverter()).toList();\n\n newUser.setActive(false);\n UserProfileStruct savedUser = createAccountInternal(conn, newUser, password, resetQuestion,\n resetAnswer, givenName, surname, organizationId);\n for (Integer orgId : organizationIds) {\n Profile profile = new Profile();\n profile.setGivenName(givenName);\n profile.setSurname(surname);\n profile.setOrganizationId(orgId);\n profile.setUserId(savedUser.credentialedUser.getId());\n profile = profilePersister.createProfile(profile, conn);\n\n authService.grantAtLeast(profile.getId(), ROLE_READER, orgId);\n authService.grantAtLeast(orgId, ROLE_ADMIN, profile.getId());\n }\n\n User user = savedUser.credentialedUser.getUser();\n user.setActive(true);\n persistenceService.process(conn, new UserPersister.UpdateUserFunc(user));\n conn.commit();\n } catch (Exception e) {\n closeConnection(conn);\n }\n }", "private void realBootstrap() {\r\n\t\tString inputMsg = \"{\"\r\n\t\t\t\t+ \"'id': 0, \"\r\n\t\t\t\t+ \"'players': [\"\r\n\t\t\t\t+ \"{'id': 0, 'name': 'TestPlayer0'}, \"\r\n\t\t\t\t+ \"{'id': 1, 'name': 'TestPlayer1'},\"\r\n\t\t\t\t+ \"{'id': 2, 'name': 'TestPlayer2'},\"\r\n\t\t\t\t+ \"{'id': 3, 'name': 'TestPlayer3'},\"\r\n\t\t\t\t+ \"{'id': 4, 'name': 'TestPlayer4'},\"\r\n\t\t\t\t+ \"{'id': 5, 'name': 'TestPlayer5'},\"\r\n\t\t\t\t+ \"{'id': 6, 'name': 'TestPlayer6'},\"\r\n\t\t\t\t+ \"{'id': 7, 'name': 'TestPlayer7'},\"\r\n\t\t\t\t+ \"],\"\r\n\t\t\t\t+ \" 'playerId': 0\"\r\n\t\t\t\t+ \"}\";\r\n\t\tclient.processingMsg(new JSONObject(inputMsg));\r\n\t}", "public Sleep() {\n\n\t}", "private void awaitT(){\n try {\n game.getBarrier().await(20, TimeUnit.SECONDS);\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (BrokenBarrierException e) {\n e.printStackTrace();\n } catch (TimeoutException e) {\n trimBarrier();\n synchronized (lock){\n if(!botSignal){\n bot = new BotClient();\n new Thread(bot).start();\n botSignal = true;\n }\n\n }\n }\n }", "public String getWaiting_account() {\n return waiting_account;\n }", "private void sendLoadingMessage() {\n mUIHandler.removeMessages(MSG_GET_ACTIVE_USER);\n mUIHandler.sendMessageDelayed(Message.obtain(mUIHandler, MSG_GET_ACTIVE_USER), DELAY_SEND_MESSAGE_LOADING_MILLIS);\n }", "@Test\n public void waitNotifyTest() throws InterruptedException {\n EventStorage storage=new EventStorage();\n\n // Creates a Producer and a Thread to run it\n Producer producer=new Producer(storage);\n Thread thread1=new Thread(producer);\n\n // Creates a Consumer and a Thread to run it\n Consumer consumer=new Consumer(storage);\n Thread thread2=new Thread(consumer);\n\n // Starts the thread\n thread2.start();\n thread1.start();\n\n\n thread1.join();\n thread2.join();\n\n }", "public Status waitUntilFinished();", "void showCreatorWaitingRoom();", "public void scheduleStartProfiles() {\n FgThread.getHandler().post(new Runnable() {\n public final void run() {\n UserController.lambda$scheduleStartProfiles$5(UserController.this);\n }\n });\n }", "private void createAndRegisterActor(\n ActorProfile profile,\n ChatNetworkServicePluginRoot networkServicePluginRoot,\n int actorCounter){\n try{\n long threadId = Thread.currentThread().getId();\n profile.setIdentityPublicKey(UUID.randomUUID().toString());\n System.out.println(\"I will try to register an actor with pk \" + profile.getIdentityPublicKey());\n profile.setActorType(Actors.CHAT.getCode());\n profile.setName(\"Chat Actor \" + threadId +\"- \"+actorCounter);\n profile.setAlias(\"Bot \" + threadId + \"-\" + actorCounter);\n //This represents a valid image\n profile.setPhoto(IoPBytesArray.getIoPBytesArray());\n //profile.setNsIdentityPublicKey(networkServicePluginRoot.getPublicKey());\n profile.setExtraData(\"Test extra data\");\n //This is a test coordinate\n profile.setLocation(43.99309,110.92348);\n networkServicePluginRoot.registerActor(profile, 0, 0);\n List<ActorProfile> actorList = nsMap.get(networkServicePluginRoot);\n if(actorList ==null){\n actorList = new ArrayList<>();\n }\n actorList.add(profile);\n nsMap.put(networkServicePluginRoot, actorList);\n actorNesMap.put(profile.getIdentityPublicKey(), networkServicePluginRoot.getNetWorkServicePublicKey());\n } catch(Exception e){\n report(ReportType.EXCEPTION_DETECTED);\n System.out.println(\"Error when trying to create an actor \"+e);\n e.printStackTrace();\n }\n }", "ThreadWait(long timeTowakeUp, KThread threadS){\n wakeUp = timeTowakeUp;\n thread = threadS;\n }", "public Builder setProfile(com.google.protobuf2.Any value) {\n if (profileBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n profile_ = value;\n onChanged();\n } else {\n profileBuilder_.setMessage(value);\n }\n\n return this;\n }", "public com.google.protobuf2.AnyOrBuilder getProfileOrBuilder() {\n if (profileBuilder_ != null) {\n return profileBuilder_.getMessageOrBuilder();\n } else {\n return profile_ == null ?\n com.google.protobuf2.Any.getDefaultInstance() : profile_;\n }\n }", "private void buildWaitScene(){\n\t\t//Nothing to do\n\t}", "@Override\n protected void onProgressUpdate(String... values) {\n super.onProgressUpdate(values);\n String message = values[0];\n dialog.setMessage(waitMsg + message);\n displayProgress(message);\n }", "@Override\n public Duration getWait() {\n return duration;\n }", "@java.lang.Override\n public com.google.protobuf2.Any getProfile() {\n return profile_ == null ? com.google.protobuf2.Any.getDefaultInstance() : profile_;\n }", "public interface Waiter {\n void greetTo(String clientName);\n void serveTo(String clientName);\n}", "private void startGame(){\n try{\n Thread.sleep(500); \n }catch(Exception e){\n System.out.println(e);\n }\n\n this.gameThread = new Thread(new GameHandler());\n this.town.sendMessage(\"<s>\");\n this.town.sendMessage(\"t\");\n this.town.sendMessage(this.scp.getUsername());\n System.out.println(\"SCP: \" + this.scp.getUsername());\n this.town.sendMessage(\"\" + game.getMoney());\n this.town.sendMessage(\"\" + game.getFood());\n this.scp.sendMessage(\"<s>\");\n this.scp.sendMessage(\"s\");\n this.scp.sendMessage(this.town.getUsername());\n System.out.println(\"TOWN: \" + this.town.getUsername());\n this.scp.sendMessage(\"\" + game.getHume());\n this.gameThread.start();\n }", "public ConfigProfile buildProfileOne() {\n this.topics = \"kafka-data\";\n this.token = \"mytoken\";\n this.uri = \"https://dummy:8088\";\n this.raw = true;\n this.ack = false;\n this.indexes = \"index-1\";\n this.sourcetypes = \"kafka-data\";\n this.sources = \"kafka-connect\";\n this.httpKeepAlive = true;\n this.validateCertificates = true;\n this.hasTrustStorePath = true;\n this.trustStorePath = \"./src/test/resources/keystoretest.p12\";\n this.trustStoreType = \"PKCS12\";\n this.trustStorePassword = \"Notchangeme\";\n this.eventBatchTimeout = 1;\n this.ackPollInterval = 1;\n this.ackPollThreads = 1;\n this.maxHttpConnPerChannel = 1;\n this.totalHecChannels = 1;\n this.socketTimeout = 1;\n this.enrichements = \"hello=world\";\n this.enrichementMap = new HashMap<>();\n this.trackData = false;\n this.maxBatchSize = 1;\n this.numOfThreads = 1;\n return this;\n }", "public Communicator() {\n\n\t\tthis.isReady = false;\n\t\tthis.hold = 0;\n\t\tthis.speaker = 0;\n\t\tthis.listener = 0;\n\t\t//init values\n\n\t\tthis.newLock = new Lock();\n\t\t//new lock\n\t\tthis.speakerR = new Condition2(newLock);\n\t\t//condition variable for speakers\n\t\tthis.listenerR = new Condition2(newLock);\n\t\t//condition variable for listener\n\t\tthis.inProg = new Condition2(newLock);\n\t\t//condition variable for inprog message\n\n\t}", "@Before\n\tpublic void setup() {\n\t\tthis.messaging.receive(\"output\", 100, TimeUnit.MILLISECONDS);\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tGLProfile.initSingleton();\n\t\t\t\twhile (!GLProfile.isInitialized()) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}", "public ConfigProfile buildProfileDefault() {\n this.topics = \"mytopic\";\n this.token = \"mytoken\";\n this.uri = \"https://dummy:8088\";\n this.raw = false;\n this.ack = true;\n this.indexes = \"\";\n this.sourcetypes = \"\";\n this.sources = \"\";\n this.httpKeepAlive = true;\n this.validateCertificates = true;\n this.hasTrustStorePath = true;\n this.trustStorePath = \"./src/test/resources/keystoretest.jks\";\n this.trustStoreType = \"JKS\";\n this.trustStorePassword = \"Notchangeme\";\n this.eventBatchTimeout = 1;\n this.ackPollInterval = 1;\n this.ackPollThreads = 1;\n this.maxHttpConnPerChannel = 1;\n this.totalHecChannels = 1;\n this.socketTimeout = 1;\n this.enrichements = \"ni=hao,hello=world\";\n this.enrichementMap = new HashMap<>();\n this.trackData = true;\n this.maxBatchSize = 1;\n this.numOfThreads = 1;\n this.lineBreaker = \"\\n\";\n return this;\n }", "public interface Waiter {\n void greetTo(String name);\n void serverTo(String name);\n}", "public int lookAround(){\n Waiter w = (Waiter) Thread.currentThread();\n CommunicationChannel com = new CommunicationChannel(serverHostName, serverPortNumb);\n Object[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n state_fields[0] = w.getWaiterID();\n \tstate_fields[1] = w.getWaiterState();\n\n Message m_toServer = new Message(4, params, 0, state_fields, 2, null); \n Message m_fromServer;\n\n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n }\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n\n w.setState((int) m_fromServer.getStateFields()[1]);\n int result = (int) m_fromServer.getReturnValue();\n com.close ();\n\n return result;\n }", "void spawnBot( String className, String login, String password, String messager ) {\n CoreData cdata = m_botAction.getCoreData();\n long currentTime;\n\n String rawClassName = className.toLowerCase();\n BotSettings botInfo = cdata.getBotConfig( rawClassName );\n\n if( botInfo == null ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Invalid bot type or missing CFG file.\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Invalid bot type or missing CFG file.\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"That bot type does not exist, or the CFG file for it is missing.\" );\n return;\n }\n\n Integer maxBots = botInfo.getInteger( \"Max Bots\" );\n Integer currentBotCount = m_botTypes.get( rawClassName );\n\n if( maxBots == null ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Invalid settings file. (MaxBots improperly defined)\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Invalid settings file. (MaxBots improperly defined)\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"The CFG file for that bot type is invalid. (MaxBots improperly defined)\" );\n return;\n }\n\n if( login == null && maxBots.intValue() == 0 ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Spawning for this type is disabled on this hub.\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Spawning for this type is disabled on this hub.\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"Bots of this type are currently disabled on this hub. If you are running another hub, please try from it instead.\" );\n return;\n }\n\n if( currentBotCount == null ) {\n currentBotCount = new Integer( 0 );\n m_botTypes.put( rawClassName, currentBotCount );\n }\n\n if( login == null && currentBotCount.intValue() >= maxBots.intValue() ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn a new bot of type \" + className + \". Maximum number already reached (\" + maxBots + \")\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn a new bot of type \" + className + \". Maximum number already reached (\" + maxBots + \")\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"Maximum number of bots of this type (\" + maxBots + \") has been reached.\" );\n return;\n }\n\n String botName, botPassword;\n currentBotCount = new Integer( getFreeBotNumber( botInfo ) );\n\n if( login == null || password == null ) {\n botName = botInfo.getString( \"Name\" + currentBotCount );\n botPassword = botInfo.getString( \"Password\" + currentBotCount );\n } else {\n botName = login;\n botPassword = password;\n }\n\n Session childBot = null;\n\n try {\n // FIXME: KNOWN BUG - sometimes, even when it detects that a class is updated, the loader\n // will load the old copy/cached class. Perhaps Java itself is caching the class on occasion?\n if( m_loader.shouldReload() ) {\n System.out.println( \"Reinstantiating class loader; cached classes are not up to date.\" );\n resetRepository();\n m_loader = m_loader.reinstantiate();\n }\n\n Class<? extends SubspaceBot> roboClass = m_loader.loadClass( \"twcore.bots.\" + rawClassName + \".\" + rawClassName ).asSubclass(SubspaceBot.class);\n String altIP = botInfo.getString(\"AltIP\" + currentBotCount);\n int altPort = botInfo.getInt(\"AltPort\" + currentBotCount);\n String altSysop = botInfo.getString(\"AltSysop\" + currentBotCount);\n\n if(altIP != null && altSysop != null && altPort > 0)\n childBot = new Session( cdata, roboClass, botName, botPassword, currentBotCount.intValue(), m_group, altIP, altPort, altSysop, true);\n else\n childBot = new Session( cdata, roboClass, botName, botPassword, currentBotCount.intValue(), m_group, true);\n } catch( ClassNotFoundException cnfe ) {\n Tools.printLog( \"Class not found: \" + rawClassName + \".class. Reinstall this bot?\" );\n return;\n }\n\n currentTime = System.currentTimeMillis();\n\n if( m_lastSpawnTime + SPAWN_DELAY > currentTime ) {\n m_botAction.sendSmartPrivateMessage( messager, \"Subspace only allows a certain amount of logins in a short time frame. Please be patient while your bot waits to be spawned.\" );\n\n if( m_spawnQueue.isEmpty() == false ) {\n int size = m_spawnQueue.size();\n\n if( size > 1 ) {\n m_botAction.sendSmartPrivateMessage( messager, \"There are currently \" + m_spawnQueue.size() + \" bots in front of yours.\" );\n } else {\n m_botAction.sendSmartPrivateMessage( messager, \"There is only one bot in front of yours.\" );\n }\n } else {\n m_botAction.sendSmartPrivateMessage( messager, \"You are the only person waiting in line. Your bot will log in shortly.\" );\n }\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" in queue to spawn bot of type \" + className );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader in queue to spawn bot of type \" + className );\n }\n\n String creator;\n\n if(messager != null) creator = messager;\n else creator = \"AutoLoader\";\n\n ChildBot newChildBot = new ChildBot( rawClassName, creator, childBot );\n addToBotCount( rawClassName, 1 );\n m_botStable.put( botName, newChildBot );\n m_spawnQueue.add( newChildBot );\n }", "public static IBuildingJob createFallback() {\n\t\tSimpleBuildingJob wait = new SimpleBuildingJob(EBuildingJobType.WAIT, 1000);\n\t\tSimpleBuildingJob hide = new SimpleBuildingJob(EBuildingJobType.HIDE, 0);\n\t\twait.successJob = wait;\n\t\twait.failJob = wait;\n\t\thide.successJob = wait;\n\t\thide.failJob = wait;\n\t\treturn hide;\n\t}", "public void waitToFinish()\n {\n while(!this.finished)\n {\n try\n {\n Thread.sleep(1);\n }\n catch (InterruptedException e)\n {\n e.printStackTrace();\n return;\n }\n }\n }", "public interface SendProfileCallBack {\n\n void onFailure();\n void onSuccess(ProfileSendData profileSendData);\n\n\n\n}", "@SuppressWarnings(\"SleepWhileInLoop\")\n private StateChange profilingServerStatus() {\n LOGGER.log(Level.FINE,\n \"Profiling mode status hack for {0}\",\n new Object[]{instance.getName()});\n // Save process to be able to stop process waiting for profiler\n // to attach.\n support.setLocalStartProcess(instance.getProcess());\n // Try to sync the states after the profiler attaches.\n NODE_REFRESHER.post(new Runnable() {\n @Override\n public void run() {\n while (!PayaraState.isOnline(instance)) {\n try {\n Thread.sleep(200);\n } catch (InterruptedException ex) {\n }\n }\n SwingUtilities.invokeLater(new Runnable() {\n @Override\n public void run() {\n support.refresh();\n }\n });\n }\n });\n return new StateChange(this, TaskState.COMPLETED,\n TaskEvent.CMD_COMPLETED,\n \"MSG_SERVER_STARTED\", instanceName);\n }", "public void callForProfileData(){\n socket.emit(\"user\");\n }", "H getProfile();", "private static void sendProfilingPacket() throws IOException{\r\n ProfilingPacketType profilingPacket = new ProfilingPacketType();\r\n ProfilingPacketType.serializePacket(profilingPacket);\r\n\r\n System.out.println(\"Client - sending datagram!\");\r\n //printSendProfilingPacket(profilingPacket);\r\n clientObjectOutputStream.writeObject(new String(\"DATA\"));\r\n //clientObjectOutputStream.flush();\r\n\r\n try{\r\n Thread.sleep(PACKET_SEND_INTERVAL);\r\n }catch (InterruptedException interE){\r\n interE.printStackTrace();\r\n //TODO - log error etc.\r\n }\r\n }", "Message sendAndWait();" ]
[ "0.5978791", "0.593957", "0.57592046", "0.57502234", "0.5711542", "0.56396985", "0.54175526", "0.54088545", "0.53503424", "0.5343656", "0.5277495", "0.5212677", "0.51851505", "0.51746285", "0.51730317", "0.51724344", "0.5170638", "0.5169571", "0.5169422", "0.51569474", "0.514541", "0.51408577", "0.51348937", "0.5082433", "0.5082433", "0.50781995", "0.5072277", "0.50540966", "0.5052124", "0.5047591", "0.502954", "0.50223744", "0.50220394", "0.50192845", "0.501601", "0.5010916", "0.49979457", "0.49912852", "0.49814972", "0.49608696", "0.49476686", "0.49426872", "0.4938844", "0.49250674", "0.49247846", "0.49226853", "0.4900868", "0.48996526", "0.48960784", "0.48959306", "0.48869386", "0.48844343", "0.48776248", "0.48735756", "0.48689485", "0.48685426", "0.48675585", "0.48502564", "0.48446742", "0.48390785", "0.48388454", "0.4832557", "0.48325485", "0.48209125", "0.48187453", "0.48159817", "0.48101798", "0.48074642", "0.48056537", "0.4799513", "0.47895908", "0.47859526", "0.47851127", "0.4784899", "0.4777645", "0.47772524", "0.4775836", "0.47716337", "0.477", "0.47621807", "0.47573718", "0.47468865", "0.4746843", "0.47464857", "0.47461346", "0.47424203", "0.47339946", "0.47293714", "0.47227362", "0.47207624", "0.47199053", "0.47183627", "0.4715969", "0.4713892", "0.47105294", "0.4709023", "0.4706434", "0.470048", "0.46994126", "0.46988544" ]
0.6625135
0
[ISchedulableAction] Starts the handling of a barge
public void bargeArrives(Barge barge, int time) { this.actualArrival.put(barge, time); this.queue.add(barge); //System.out.println(barge+" arrived to "+this.name+"// arraival list= "+this.actualArrival); if (Port.terminalLogic.equals("Unreserved") && this.state == Terminal.IDLE) { // //////////////////////////////////the last two argument defined // by me//////////////////////////////////////////////////// Port.schedule.schedule(ScheduleParameters.createOneTime(time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", barge, time); } else if (Port.terminalLogic.equals("Reserved") && this.state == Terminal.IDLE) { boolean []c=checkIfHandleBarge(barge, time); //if could not handle the barge and it was late check && c[1] for next one if(!c[0] ){ checkNextPossibleBargeToHandle(time); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void startAction() {\n\t if (!balls.isEmpty() && firingBall == null) {\n\t gb.addToActiveList(this);\n\t //fire next ball\n\t firingBall = (Ball)balls.remove(0);\n\t firingBall.setAbsorbed(false);\n\t firingBall.setVy(-50*25);\n\t //align balls that are being held\n\t if (!balls.isEmpty()) setBalls();\n\t }\n\t}", "public void act() \n {\n moveAround(); \n addBomb(); \n touchGhost(); \n }", "public void startExecuting() {\n super.startExecuting();\n this.entity.setAggroed(true);\n }", "public void startExecuting()\n {\n super.startExecuting();\n this.breakingTime = 0;\n }", "public void act()\n\t{\n\t\tif(getFirstDriver().isAtPump())\n\t\t{\n\t\t\tif(!getFirstDriver().isDoneRefilling())\n\t\t\t{\n\t\t\t\tgetFirstDriver().act(priceOfFuel);\n\t\t\t}\n\t\t}\n\t\telse if(getFirstDriver().isDone())\n\t\t{\n\t\t\tremoveDriver();\n\t\t}\n\t}", "public abstract void start_block();", "public void startExecuting() {\n this.taskOwner.setAttackTarget(this.target);\n super.startExecuting();\n }", "public void action() {\r\n\t\tsuppressed = false;\r\n\t\tMotor.B.stop();\r\n\t\tMotor.C.stop();\r\n\t\tDelay.msDelay(1000);\r\n\t\tMotor.B.setSpeed(180);\r\n\t\tMotor.C.setSpeed(180);\r\n\t\tMotor.B.forward();\r\n\t\tMotor.C.forward();\r\n\t\tif((light.getLightValue()>46 && light.getLightValue()<49) || (light.getLightValue()>27 && light.getLightValue()<31)){\r\n\t\t\tMotor.B.stop();\r\n\t\t\tMotor.C.stop();\r\n\t\t\tDelay.msDelay(500);\r\n\t\t\tMotor.B.forward();\r\n\t\t\tMotor.C.forward();\r\n\t\t\tif(light.getLightValue()>44 && light.getLightValue()<45){//home base\r\n\t\t\t\tMotor.B.stop();\r\n\t\t\t\tMotor.C.stop();\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile(!suppressed){\r\n\t\t\tThread.yield();\r\n\t\t}\r\n\t}", "private void goOnBreak(){\n\tDo(\"Going on break\");\n\tstartedBreak = true;\n\tstateChanged();\n }", "public void startBike() {\n\t\tSystem.out.println(\"Self start the bike\");\n\t}", "public void initiateAction() {\r\n\t\t// TODO Auto-generated method stub\t\r\n\t}", "public void performAction() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void finishHandling(Barge barge, int time) {\r\n\r\n\t\t// remove the barge from appointments of terminal\r\n\t\tthis.appointments.remove(barge);\r\n\t\tthis.numHandling--;\r\n\t\t\r\n\t\t//this.state = Terminal.IDLE;\r\n\t\t\r\n\t\t// let the barge decide what to do after it finished handling\r\n\t\tbarge.afterFinish(time, this);\r\n\t\tif (Port.eventsToExcel.equals(\"Yes\")) {\r\n\t\t\tPort.stats.addEvent(time, barge.bargeNumber,\r\n\t\t\t\t\t(\"Finished handling at Terminal \" + this.toString()));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tif (this.queue.size() == 0) {\r\n\t\t\tthis.state = Terminal.IDLE;\r\n\t\t} else if (Port.terminalLogic.equals(\"Unreserved\") ) {\r\n\t\t\tBarge nextBarge = this.queue.peek();\r\n\t\t\tPort.schedule.schedule(ScheduleParameters.createOneTime(time,\r\n\t\t\t\t\tScheduleParameters.LAST_PRIORITY), this, \"handleBarge\",\r\n\t\t\t\t\tnextBarge, time);\r\n\r\n\t\t} else if (Port.terminalLogic.equals(\"Reserved\")) {\r\n//\t\t\tSystem.out.print(\"queue \"+this.queue);\r\n//\t\t\tSystem.out.print(\" appointments \"+this.appointments);\r\n//\t\t\tSystem.out.println(this.name);\r\n\r\n\t\t\tif (!checkNextPossibleBargeToHandle(time)){\r\n\t\t\t\tthis.state = Terminal.IDLE;\r\n\t\t\t}\r\n\r\n\t\t\t/*Barge nextBargeInSchedule = (Barge) this.appointments.keySet().toArray()[0];\r\n\t\t\tif (this.queue.contains(nextBargeInSchedule) == true) {\r\n\t\t\t\tPort.schedule.schedule(ScheduleParameters.createOneTime(time,\r\n\t\t\t\t\t\tScheduleParameters.LAST_PRIORITY), this, \"handleBarge\",\r\n\t\t\t\t\t\tnextBargeInSchedule, time);\r\n\t\t\t} else {\r\n\t\t\t\tint lstNextAppointment = this.appointments\r\n\t\t\t\t\t\t.get(nextBargeInSchedule)[1];\r\n\t\t\t\tboolean startNextBarge = false;\r\n\t\t\t\tfor (Barge nextBarge : this.queue) {\r\n\t\t\t\t\t//System.out.print(nextBarge);\r\n\t\t\t\t\t//System.out.print(nextBarge.terminals);\r\n\t\t\t\t\t//System.out.print(\" handeling times\"+ nextBarge.handlingTimes);\r\n\t\t\t\t\t//System.out.println(\" \"+this.name);\r\n\t\t\t\t\tint expectedEndTimeThisBarge = time + nextBarge.handlingTimes.get(nextBarge.terminals.indexOf(this));\r\n\t\t\t\t\tif (expectedEndTimeThisBarge <= lstNextAppointment) {\r\n\t\t\t\t\t\tPort.schedule.schedule(ScheduleParameters\r\n\t\t\t\t\t\t\t\t.createOneTime(time,\r\n\t\t\t\t\t\t\t\t\t\tScheduleParameters.LAST_PRIORITY),\r\n\t\t\t\t\t\t\t\tthis, \"handleBarge\", nextBarge, time);\r\n\t\t\t\t\t\tstartNextBarge = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (startNextBarge == false) {\r\n\t\t\t\t\tthis.state = Terminal.IDLE;\r\n\t\t\t\t}\r\n\t\t\t}*/\r\n\t\t}\r\n\r\n\r\n\r\n\t}", "@Override\n\tpublic void action() {\n\t\t_agj.addBehaviour(new RecibirDistritos(_agj));\n\t\t_agj.addBehaviour(new RecibirMonedas(_agj));\n\t}", "private void act() {\n\t\tmyAction.embodiment();\n\t}", "public void baocun() {\n\t\t\n\t}", "private void initiateBreak(){\n\tDo(\"Starting to go on break\");\n\thost.msgChangeWorkStatus(this, false);\n\tworking = false;\n\tstateChanged();\n }", "public void doStart() {\n if (this.mActive == null) {\n a();\n } else {\n com.alipay.mobile.common.task.Log.v(TAG, \"StandardPipeline.start(a task is running, so don't call scheduleNext())\");\n }\n }", "@Override\n public void act() {\n sleepCheck();\n if (!isAwake()) return;\n while (getActionTime() > 0f) {\n UAction action = nextAction();\n if (action == null) {\n this.setActionTime(0f);\n return;\n }\n if (area().closed) return;\n doAction(action);\n }\n }", "@Override\n protected void doAct() {\n }", "public void execute() {\n\t\tthis.badgeId = studentWorkerOperation.AddNewBadge(this.badgeName, this.badgeDescription);\n\t}", "public void perform() {\n\t\tlog.info(\"begin to play the drum\");\n\t\tthrow new RuntimeException();\n\t}", "public void action(EntityLivingBase target)\n {\n if (action != null)\n {\n action.execute(target);\n }\n }", "@Override\n public void doAction() {\n checkRep();\n if (!storedBalls.isEmpty()) {\n Ball ballToShootOut = storedBalls.remove();\n ballToShootOut.setVelocity(new Vect(0,STOREDBALLVELOCITY));\n ballToShootOut.setActive(true);\n }\n checkRep();\n }", "public void runBlocking() {\n if (!this.stopAction.isDone()) {\n this.tryPerformBeforeAction();\n this.tryCreateTaskAssignment();\n this.startLoadGeneration();\n }\n this.stopAction.join();\n this.stopLoadGeneration();\n this.stopFinished.complete(null);\n }", "abstract public void performAction();", "@Override\n\tpublic void runMBA() {\n\t\t\n\t}", "public void act() {\n\t\tfor (Manager manager : managers.values())\n\t\t\tmanager.act();\n\t\t\n\t\tif (hasPriority == Priority.ARMY && armyQueue.size() > 0) {\n\t\t\t//Tell ArmyManager to build top unit in queue\n\t\t}\n\t\telse if (hasPriority == Priority.BUILDINGS && buildingQueue.size() > 0) {\n\t\t\t//Tell BuildManager to build top building in queue\n\t\t}\n\t\telse if (hasPriority == Priority.WORKERS) {\n\t\t\t//ResourceManager has requested more workers\n\t\t}\n\t}", "protected abstract void kickStart() throws OptimizerException;", "@Override\n public void execute() {\n ballCount = conveyor.getBallCount();\n SmartDashboard.putNumber(\"Ball Count\", conveyor.getBallCount());\n if(ballCount == 4){\n complete = true;\n conveyor.setDone(complete);\n } else {\n complete = false;\n conveyor.setDone(complete);\n }\n SmartDashboard.putBoolean(\"Intake Complete?\", complete);\n \n //conveyor.rightWithSensor();\n if(ballCount == 0){ // right one\n conveyor.engageConveyor(false, 0.5);\n } else if(ballCount == 1) { // left one\n conveyor.engageConveyor(true, 0.5);\n stage2 = false;\n } else if(ballCount == 2 && !stage2){\n //System.out.println(\"Moving balls up\");\n conveyor.conveyorFeedTime();\n if(conveyor.doneBoolean()){\n //System.out.println(\"Ready for 3rd and 4th balls\");\n stage2 = true;\n }\n } else if(stage2 && ballCount == 2) {\n //System.out.println(\"3rd\");\n conveyor.engageConveyor(false, 0.375);\n } else if(ballCount == 3){\n conveyor.engageConveyor(true, 0.375);\n } else {\n conveyor.setConveyorMotors(0, 0, 0, 0);\n }\n \n }", "@Override\n\tpublic void onActionStart(int action) {\n\t\t\n\t}", "@Override\n\tpublic void start()\n\t{\n\t\tarena = \"scenarios/boxpushing/arena/pioneer.controller.arena.txt\"; \n\n\t\t\n\t\tschedule.reset();\n\n\t\tsuper.start();\n\n\t\tresetBehavior();\n\n\t}", "@Override\n\tpublic void action() {\n\t\tACLMessage msgRx = myAgent.receive();\n\t\tif (msgRx != null && msgRx.getPerformative() == ACLMessage.REQUEST) {\n\t\t\tContentManager contentManager = myAgent.getContentManager();\n\t\t\tSystem.out.println(\"RECEIVED = \" + msgRx.getContent());\n\t\t\tmsgRx.setLanguage(\"fipa-sl\");\n\t\t\tmsgRx.setOntology(\"blocks-ontology\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tContentElementList elementList = (ContentElementList) contentManager\n\t\t\t\t\t\t.extractContent(msgRx);\n\n\t\t\t\tIterator elementIterator = elementList.iterator();\n\n\t\t\t\twhile (elementIterator.hasNext()) {\n\t\t\t\t\tAction action = (Action) elementIterator.next();\n\t\t\t\t\t((Environment) myAgent).getWorld().getActionList().add((Executable) (action.getAction()));\n//\t\t\t\t\t((Executable) (action.getAction()))\n//\t\t\t\t\t\t\t.execute((Environment) myAgent);\n\t\t\t\t}\n\n\t\t\t} catch (UngroundedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (CodecException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (OntologyException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else {\n\t\t\tblock();\n\t\t}\n\t\t\n\t}", "protected void startBatch() {\n \n }", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tfor (Damage damage : actionAttack.damages) {\r\n\t\t\t\t\t\t\t\tBattlerSprite attacked = damage.target.getTag();\r\n\t\t\t\t\t\t\t\tattacked.takeHit(damage.damage);\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}", "@Override\n\tpublic void start() {\n\t\tSystem.out.println(\"BMW -- start\");\n\t}", "@Override\r\n\tpublic void act() {\n\t\tausgeben();\r\n\t}", "public void beginHostile()\r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void execute() {\n\t\tlog.info(\"running...\");\n\n\n\t\t/* example for finding the server agent */\n\t\tIAgentDescription serverAgent = thisAgent.searchAgent(new AgentDescription(null, \"ServerAgent\", null, null, null, null));\n\t\tif (serverAgent != null) {\n\t\t\tthis.server = serverAgent.getMessageBoxAddress();\n\n\t\t\t// TODO\n\t\t\tif (!hasGameStarted) {\n\t\t\t\tStartGameMessage startGameMessage = new StartGameMessage();\n\t\t\t\tstartGameMessage.brokerId = thisAgent.getAgentId();\n\t\t\t\tstartGameMessage.gridFile = \"/grids/h_01.grid\";\n\t\t\t\t// Send StartGameMessage(BrokerID)\n\t\t\t\tsendMessage(server, startGameMessage);\n\t\t\t\treward = 0;\n\t\t\t\tthis.hasGameStarted = true;\n\t\t\t}\n\n\t\t} else {\n\t\t\tSystem.out.println(\"SERVER NOT FOUND!\");\n\t\t}\n\n\n\t\t/* example of handling incoming messages without listener */\n\t\tfor (JiacMessage message : memory.removeAll(new JiacMessage())) {\n\t\t\tObject payload = message.getPayload();\n\n\t\t\tif (payload instanceof StartGameResponse) {\n\t\t\t\t/* do something */\n\n\t\t\t\t// TODO\n\t\t\t\tStartGameResponse startGameResponse = (StartGameResponse) message.getPayload();\n\n\t\t\t\tthis.maxNum = startGameResponse.initialWorkers.size();\n\t\t\t\tthis.agentDescriptions = getMyWorkerAgents(this.maxNum);\n\t\t\t\tthis.gameId = startGameResponse.gameId;\n\n\t\t\t\t/**\n\t\t\t\t *\n\t\t\t\t * DEBUGGING\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\tSystem.out.println(\"SERVER SENDING \" + startGameResponse.toString());\n\n\t\t\t\t// TODO handle movements and obstacles\n\t\t\t\tthis.gridworldGame = new GridworldGame();\n\t\t\t\tthis.gridworldGame.obstacles.addAll(startGameResponse.obstacles);\n\n\n\n\t\t\t\t// TODO nicht mehr worker verwenden als zur Verfügung stehen\n\n\t\t\t\t/**\n\t\t\t\t * Initialize the workerIdMap to get the agentDescription and especially the\n\t\t\t\t * MailBoxAdress of the workerAgent which we associated with a specific worker\n\t\t\t\t *\n\n\t\t\t\tfor (Worker worker: startGameResponse.initialWorkers) {\n\t\t\t\t\tworkerIdMap.put(worker.id, this.agentDescriptions.get(startGameResponse.initialWorkers.indexOf(worker)));\n\t\t\t\t\tworkerIdReverseAId.put(this.agentDescriptions.get(startGameResponse.initialWorkers.indexOf(worker)).getAid(), worker.id);\n\t\t\t\t} */\n\n\t\t\t\t/**\n\t\t\t\t * Send the Position messages to each Agent for a specific worker\n\t\t\t\t * PositionMessages are sent to inform the worker where it is located\n\t\t\t\t * additionally put the position of the worker in the positionMap\n\t\t\t\t */\n\t\t\t\tfor (Worker worker: startGameResponse.initialWorkers) {\n\t\t\t\t\tpositionMap.put(worker.id, worker.position);\n\n\t\t\t\t\tworkerIdMap.put(worker.id, this.agentDescriptions.get(startGameResponse.initialWorkers.indexOf(worker)));\n\t\t\t\t\tworkerIdReverseAID.put(this.agentDescriptions.get(startGameResponse.initialWorkers.indexOf(worker)).getAid(), worker.id);\n\n\t\t\t\t\tIAgentDescription agentDescription = workerIdMap.get(worker.id);\n\t\t\t\t\tICommunicationAddress workerAddress = agentDescription.getMessageBoxAddress();\n\n\t\t\t\t\t// Send each Agent their current position\n\t\t\t\t\tPositionMessage positionMessage = new PositionMessage();\n\t\t\t\t\tpositionMessage.workerId = agentDescription.getAid();\n\t\t\t\t\tpositionMessage.gameId = startGameResponse.gameId;\n\t\t\t\t\tpositionMessage.position = worker.position;\n\t\t\t\t\tpositionMessage.workerIdForServer = worker.id;\n\t\t\t\t\t//System.out.println(\"ADDRESS IS \" + workerAddress);\n\n\t\t\t\t\tsendMessage(workerAddress, positionMessage);\n\t\t\t\t\t//break;\n\t\t\t\t}\n\n\t\t\t\thasAgents = true;\n\n\t\t\t\tfor (Order order: savedOrders) {\n\t\t\t\t\t// 3 Runden anfangs zum Initialisieren\n\t\t\t\t\tICommunicationAddress workerAddress = decideOrderAssigment(order);\n\t\t\t\t\tPosition workerPosition = null;\n\t\t\t\t\tfor (IAgentDescription agentDescription: agentDescriptions) {\n\t\t\t\t\t\tif (agentDescription.getMessageBoxAddress().equals(workerAddress)) {\n\t\t\t\t\t\t\tString workerId = workerIdReverseAID.get(agentDescription.getAid());\n\t\t\t\t\t\t\tworkerPosition = positionMap.get(workerId);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tint steps = workerPosition.distance(order.position) + 2;\n\t\t\t\t\tint rewardMove = (steps > order.deadline)? 0 : order.value - steps * order.turnPenalty;\n\n\t\t\t\t\tSystem.out.println(\"REWARD: \" + rewardMove);\n\n\t\t\t\t\tif(rewardMove > 0) {\n\t\t\t\t\t\tTakeOrderMessage takeOrderMessage = new TakeOrderMessage();\n\t\t\t\t\t\ttakeOrderMessage.orderId = order.id;\n\t\t\t\t\t\ttakeOrderMessage.brokerId = thisAgent.getAgentId();\n\t\t\t\t\t\ttakeOrderMessage.gameId = gameId;\n\t\t\t\t\t\tsendMessage(server, takeOrderMessage);\n\n\t\t\t\t\t\t// Save order into orderMap\n\t\t\t\t\t\tthis.orderMap.put(order.id, order);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (payload instanceof PositionConfirm) {\n\t\t\t\tPositionConfirm positionConfirm = (PositionConfirm) message.getPayload();\n\t\t\t\tif(positionConfirm.state == Result.FAIL) {\n\t\t\t\t\tString workerId = workerIdReverseAID.get(positionConfirm.workerId);\n\t\t\t\t\tIAgentDescription agentDescription = workerIdMap.get(workerId);\n\t\t\t\t\tICommunicationAddress workerAddress = agentDescription.getMessageBoxAddress();\n\n\t\t\t\t\tPositionMessage positionMessage = new PositionMessage();\n\n\t\t\t\t\tpositionMessage.workerId = agentDescription.getAid();\n\t\t\t\t\tpositionMessage.gameId = positionConfirm.gameId;\n\t\t\t\t\tpositionMessage.position = positionMap.get(workerId);\n\t\t\t\t\tpositionMessage.workerIdForServer = workerId;\n\n\t\t\t\t\tsendMessage(workerAddress, positionMessage);\n\t\t\t\t} else {\n\t\t\t\t\tactiveWorkers.add(message.getSender());\n\t\t\t\t\tfor (String orderId: orderMessages) {\n\t\t\t\t\t\tICommunicationAddress workerAddress = decideOrderAssigment(this.orderMap.get(orderId));\n\t\t\t\t\t\tif(workerAddress.equals(message.getSender())){\n\t\t\t\t\t\t\tAssignOrderMessage assignOrderMessage = new AssignOrderMessage();\n\t\t\t\t\t\t\tassignOrderMessage.order = this.orderMap.get(orderId);\n\t\t\t\t\t\t\tassignOrderMessage.gameId = gameId;\n\t\t\t\t\t\t\tassignOrderMessage.server = this.server;\n\t\t\t\t\t\t\tif(activeWorkers.contains(workerAddress)){\n\t\t\t\t\t\t\t\tsendMessage(workerAddress, assignOrderMessage);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\tif (payload instanceof OrderMessage) {\n\n\t\t\t\t// TODO entscheide, ob wir die Order wirklich annehmen wollen / können\n\n\t\t\t\tOrderMessage orderMessage = (OrderMessage) message.getPayload();\n\n\t\t\t\tif (!hasAgents){\n\t\t\t\t\tsavedOrders.add(orderMessage.order);\n\t\t\t\t\tcontinue;\n\t\t\t\t}else {\n\t\t\t\t\tOrder thisOrder = orderMessage.order;\n\n\t\t\t\tICommunicationAddress workerAddress = decideOrderAssigment(thisOrder);\n\t\t\t\tPosition workerPosition = null;\n\t\t\t\tfor (IAgentDescription agentDescription: agentDescriptions) {\n\t\t\t\t\tif (agentDescription.getMessageBoxAddress().equals(workerAddress)) {\n\t\t\t\t\t\tString workerId = workerIdReverseAID.get(agentDescription.getAid());\n\t\t\t\t\t\tworkerPosition = positionMap.get(workerId);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// 3 Runden anfangs zum Initialisieren\n\t\t\t\t\tint steps = workerPosition.distance(thisOrder.position) + 1;\n\t\t\t\t\tint rewardMove = (steps > thisOrder.deadline)? 0 : thisOrder.value - steps * thisOrder.turnPenalty;\n\n\n\t\t\t\t\tSystem.out.println(\"REWARD: \" + rewardMove);\n\n\t\t\t\tif(rewardMove > 0) {\n\t\t\t\t\tTakeOrderMessage takeOrderMessage = new TakeOrderMessage();\n\t\t\t\t\ttakeOrderMessage.orderId = orderMessage.order.id;\n\t\t\t\t\ttakeOrderMessage.brokerId = thisAgent.getAgentId();\n\t\t\t\t\ttakeOrderMessage.gameId = orderMessage.gameId;\n\t\t\t\t\tsendMessage(server, takeOrderMessage);\n\n\t\t\t\t\t// Save order into orderMap\n\t\t\t\t\tOrder order = ((OrderMessage) message.getPayload()).order;\n\t\t\t\t\tthis.orderMap.put(order.id, order);\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 * DEBUGGING\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\tSystem.out.println(\"SERVER SENDING \" + orderMessage.toString());\n\n\t\t\t\t// Save order into orderMap\n\n\t\t\t}\n\n\t\t\tif (payload instanceof TakeOrderConfirm) {\n\n\t\t\t\t// TODO\n\t\t\t\t// Got Order ?!\n\t\t\t\tTakeOrderConfirm takeOrderConfirm = (TakeOrderConfirm) message.getPayload();\n\t\t\t\tResult result = takeOrderConfirm.state;\n\n\t\t\t\t/**\n\t\t\t\t *\n\t\t\t\t * DEBUGGING\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\tSystem.out.println(\"SERVER SENDING \" + takeOrderConfirm.toString());\n\n\t\t\t\tif (result == Result.FAIL) {\n\t\t\t\t\t// Handle failed confirmation\n\n\t\t\t\t\t// Remove order from orderMap as it was rejected by the server\n\t\t\t\t\tthis.orderMap.remove(takeOrderConfirm.orderId);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\n\t\t\t\t// TODO send serverAddress\n\t\t\t\t// Assign order to Worker(Bean)\n\t\t\t\t// Send the order to the first agent\n\t\t\t\tAssignOrderMessage assignOrderMessage = new AssignOrderMessage();\n\t\t\t\tassignOrderMessage.order = this.orderMap.get(takeOrderConfirm.orderId);\n\t\t\t\tassignOrderMessage.gameId = takeOrderConfirm.gameId;\n\t\t\t\tassignOrderMessage.server = this.server;\n\t\t\t\tICommunicationAddress workerAddress = decideOrderAssigment(assignOrderMessage.order);\n\t\t\t\tif(activeWorkers.contains(workerAddress)){\n\t\t\t\t\tsendMessage(workerAddress, assignOrderMessage);\n\t\t\t\t} else {\n\t\t\t\t\torderMessages.add(takeOrderConfirm.orderId);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (payload instanceof AssignOrderConfirm) {\n\n\t\t\t\t// TODO\n\t\t\t\tAssignOrderConfirm assignOrderConfirm = (AssignOrderConfirm) message.getPayload();\n\t\t\t\tResult result = assignOrderConfirm.state;\n\n\t\t\t\tif (result == Result.FAIL) {\n\t\t\t\t\t// Handle failed confirmation\n\t\t\t\t\t// TODO\n\t\t\t\t\tICommunicationAddress alternativeWorkerAddress = getAlternativeWorkerAddress(((AssignOrderConfirm) message.getPayload()).workerId);\n\t\t\t\t\treassignOrder(alternativeWorkerAddress, assignOrderConfirm);\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\torderMessages.remove(assignOrderConfirm.orderId);\n\n\t\t\t\t// TODO Inform other workers that this task is taken - notwendig??\n\n\t\t\t}\n\n\t\t\tif (payload instanceof OrderCompleted) {\n\n\t\t\t\tOrderCompleted orderCompleted = (OrderCompleted) message.getPayload();\n\t\t\t\tResult result = orderCompleted.state;\n\n\t\t\t\tif (result == Result.FAIL) {\n\t\t\t\t\t// TODO Handle failed order completion -> minus points for non handled rewards\n\t\t\t\t\treward += orderCompleted.reward;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\treward += orderCompleted.reward;\n\t\t\t\t// TODO remove order from the worker specific order queues\n\n\t\t\t}\n\n\t\t\tif (payload instanceof PositionUpdate) {\n\n\t\t\t\tPositionUpdate positionUpdate = (PositionUpdate) message.getPayload();\n\t\t\t\tupdateWorkerPosition(positionUpdate.position, positionUpdate.workerId);\n\n\t\t\t}\n\n\t\t\tif (payload instanceof EndGameMessage) {\n\n\t\t\t\tEndGameMessage endGameMessage = (EndGameMessage) message.getPayload();\n\t\t\t\t// TODO lernen lernen lernen lol\n\t\t\t\tSystem.out.println(\"Reward: \" + endGameMessage.totalReward);\n\t\t\t}\n\n\t\t}\n\t}", "@Override\n public void act() {\n }", "public void run() \n\t\t\t{\n\t\t\t\tif (Math.abs(player.getLocation().getX() - playerLoc.getX()) > 1\n\t\t\t\t\t\t|| Math.abs(player.getLocation().getY() - playerLoc.getY()) > 1\n\t\t\t\t\t\t|| Math.abs(player.getLocation().getZ() - playerLoc.getZ()) > 1)\n\t\t\t\t{\n\t\t\t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You cannot move while bandaging!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tString name = player.getCustomName();\n\t\t\t\tif (name == null)\n\t\t\t\t\tname = player.getName();\n\t\t\t\t\n\t\t\t\t//Check that the recipient is still in roughly the same location\n\t\t\t\t//Skip if self-heal\n\t\t\t\tif (!player.equals(recipient))\n\t\t\t\t\tif (Math.abs(recipient.getLocation().getX() - recipientLoc.getX()) > 1\n\t\t\t\t\t\t|| Math.abs(recipient.getLocation().getY() - recipientLoc.getY()) > 1\n\t\t\t\t\t\t|| Math.abs(recipient.getLocation().getZ() - recipientLoc.getZ()) > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You cannot bandage your patient while they are moving!\");\n\t\t\t\t\t\trecipient.sendMessage(ChatColor.YELLOW + name + \" cannot bandage you while you are moving!\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Remove item from player's inventory.\n\t \t\tplayer.getInventory().removeItem(new ItemStack(Material.getMaterial(item.toUpperCase()), 1));\n\t \t\tplayer.updateInventory();\n\t \t\t\t\n\t \t\t//Heal the other player.\n\t \t\trecipient.setHealth(recipient.getHealth() + amountToHeal);\n\n\t \t\t//Award experience.\n\t \t\tProfessionStats prof = new ProfessionStats(perms, data, config, player.getUniqueId());\n\t \t\t\n\t \t\tif (!prof.isPracticeFatigued(profession))\n\t \t\t\taddExperience(player, profession, config.getInt(\"healing.\" + item + \".exp\"));\n\t \t\t\t\n\t \t\t//Notify both parties.\n\t \t\tif (!player.equals(recipient))\n\t \t\t{\t \t\t\n\t \t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You bandaged \" + recipient.getName() + \"'s wounds.\");\n\t \t\t\trecipient.sendMessage(ChatColor.YELLOW + player.getName() + \" bandaged your wounds.\");\n\t \t\t}\n\t \t\telse\n\t \t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You bandaged your wounds.\");\n\t\t\t }", "public void act() \n {\n fall();\n }", "@Override\n\t\tpublic void start() {\n\t\t\tsuper.start();\n\t\t\tAbstractMinutemanEntity.this.setAggressive(true);\n\t\t}", "public void execute() {\n\t\tlaunch();\n\t}", "@Override\n public void execute() {\n if (shooter.getShooterVelocity() < THRESHOLD) {\n shooter.setShooter(accel);\n if (delivery.getBreakbeams()[3]) {\n delivery.setDeliveryBelt(backdrive);\n } else {\n delivery.stopDeliveryBelt();\n }\n } else if (shooter.getShooterVelocity() < TARGET) {\n shooter.setShooter(shoot);\n } else {\n shooter.setShooter(shoot);\n delivery.setDeliveryBelt(feed);\n }\n\n\n ShuffleboardHelpers.setWidgetValue(\"Shooter\", \"Shooter Velocity\", shooter.getShooterVelocity());\n\n boolean change = true;\n boolean[] breakbeams = delivery.getBreakbeams();\n for (boolean beam : breakbeams)\n if (beam)\n change = false;\n if (change) {\n counter++;\n } else {\n counter = 0;\n }\n }", "public void act() {\n\t}", "void start() \r\n {\r\n while (controller.clock <= controller.totalBurstTime) {\r\n this.clock();\r\n }\r\n }", "@Override\n public void execute() {\n // Shooter is up to speed and hasn't shot a ball since it sped up, then run\n // index to fire a ball\n inThreshold = Globals.flyWheelSpeed > shooterPID.flyWheelSpeedMinimum\n && Globals.flyWheelSpeed < shooterPID.flyWheelSpeedMinimum + 100;\n if (inThreshold && alreadyRun == false) {\n index.run(Constants.indexSpeed);\n timer.start();\n alreadyRun = true;\n ballsShot++;\n // Once the index has run for long enough to fire a ball, stop running the index\n } else if (inThreshold && alreadyRun == true && timer.get() > Constants.indexRunTime) {\n index.run(0);\n alreadyRun = false;\n // Once the shooter has lost speed due to shooting the ball, set alreadyRun to\n // false\n // so that the next time it gets up to speed, a ball can be fired again\n } else if (!inThreshold) {\n alreadyRun = false;\n index.run(0);\n // by default, set index to 0 speed.\n } else {\n index.run(0);\n }\n }", "private void scheduleJob() {\n\n }", "public void startExecuting() {\n this.attackTime = 20;\n ShulkerEntity.this.updateArmorModifier(100);\n }", "public void startExecuting() {}", "@Override\n protected boolean doTask()\n {\n if (!this.homePos.isEmpty()) return true;\n final Brain<?> brain = this.entity.getBrain();\n if (brain.hasMemoryValue(MemoryModules.GOING_HOME.get())) return true;\n if (BurrowTasks.shouldBeInside(this.world, this.burrow))\n {\n brain.setMemory(MemoryModules.GOING_HOME.get(), true);\n return true;\n }\n return false;\n }", "private void bid() {\n\t\t\t\n\t\t}", "public void run() {\n long startTime = 0;\n if (action.getClass().getName().contains(\"TooAction\")) {\n startTime = System.currentTimeMillis();\n LOG.log(Level.WARNING, \"Sending a ToO alert...\");\n }\n\n action.doTriggerAction(change, handback);\n\n // Record the end time and warn if it took too long.\n if (startTime != 0) {\n long curTime = System.currentTimeMillis();\n LOG.log(Level.WARNING, \"Sent ToO alert\");\n\n long elapsed = curTime - startTime;\n if (elapsed > 5000) {\n LOG.log(Level.WARNING, \"Long delay sending ToO alert: \" + elapsed);\n }\n }\n\n }", "@Override\r\n\tpublic void action() {\n\t\t\r\n\t}", "public void breath() {\n\t\tif (alive) {\n\t\t\t_age++;\n\t\t\t// Respiration process\n\t\t\tboolean canBreath = useEnergy(Math.min((_mass - _lowmaintenance) / Utils.SEGMENT_COST_DIVISOR, _energy));\n\t\t\tif ((_age >> 8) > _geneticCode.getMaxAge() || !canBreath) {\n\t\t\t\t// It's dead, but still may have energy\n\t\t\t\tdie(null);\n\t\t\t} else {\n\t\t\t\tif (_energy <= Utils.tol) {\n\t\t\t\t\talive = false;\n\t\t\t\t\t_world.decreasePopulation();\n\t\t\t\t\t_world.organismHasDied(this, null);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// The corpse slowly decays\n\t\t\tuseEnergy(Math.min(_energy, Utils.DECAY_ENERGY));\n\t\t}\n\t}", "public void act()\r\n\t{\r\n\t\tyVel += gravity;\r\n\t\t//Resets the jump delay to when greater than 0\r\n\t\tif (jDelay > 0)\r\n\t\t{\r\n\t\t\tjDelay--;\r\n\t\t}\r\n\t\t//Sets the vertical velocity and jump delay of the bird after a jump\r\n\t\tif (alive == true && (Menu.keyPress == KeyEvent.VK_SPACE) && jDelay <= 0) \r\n\t\t{\r\n\t\t\tMenu.keyPress = 0;\r\n\t\t\tyVel = -10;\r\n\t\t\tjDelay = 10;\r\n\t\t}\r\n\t\ty += (int)yVel;\r\n\t}", "@Override\n\tpublic void action() {\n\t\tSystem.out.println(\"action now!\");\n\t}", "@Override\n\tpublic void action(GameObject triggeredBy) {\n\t\tif(triggeredBy == Directory.profile.getPlayer()){\n\t\t\t//Push a battlestate to the stateStack\n\t\t\tDirectory.engine.pushState(new BattleState((Entity)triggeredBy, (Entity)attachedTo));\n\n\t\t\t// Create custom background as gameObject\n\t\t\tGameObject background = new GameObject(0, 0, Directory.screenManager.getPercentageWidth(100.0), Directory.screenManager.getPercentageHeight(100.0));\n\t\t\t// set background values\n\t\t\tbackground.setVisible(true);\n\t\t\t\n\t\t\t//Create sprite for background out of BackgroundForest 1 image\n\t\t\t//Set sprite of background\n\t\t\tbackground.setSprite(Directory.spriteLibrary.get(\"Background_Forest_1\"));\n\n\t\t\t\n\t\t\tDirectory.engine.getCurrentState().addObj(background);\n\t\t\t\n\t\t\t//Set stae of the attached obj\n\t\t\tattachedTo.pushState(battleState);\n\t\t\tattachedTo.removeTrigger(this);\n\t\t\tattachedTo.setTriggerable(false);\n\t\t\t\n\t\t\t//Set state of player\n\t\t\ttriggeredBy.pushState(new PlayerBattleState());\n\t\t\t\n\t\t\t//Add this obj to the next state\n\t\t\t//Not needed anymore since separation of competitors from projectiles (list of targetables) in battlestate\n\t\t\t//Directory.engine.getCurrentState().addObj(attachedTo);\n\t\t\t//Directory.engine.getCurrentState().addObj(triggeredBy);\n\t\t}\n\t}", "@Override\n public final boolean doIt() throws JobException {\n tasks = new LinkedHashMap<TaskKey,TaskJob>();\n prepareTasks();\n (new MergeJob()).startJob();\n return true;\n }", "public void start() {\n\t\tthis.obstacleController.start();\n\t}", "@Override\n public void run() {\n destination nextState = desembarque.whatShouldIDo(id,finalDest, nMalasTotal,log);\n bagCollect getBag = null;\n switch (nextState) {\n case WITH_BAGGAGE:\n \n // System.out.println(\"tenho bagagem -----------------\");\n do {\n if ( (getBag=recolha.goCollectABag(id,log) ) == bagCollect.MINE) {\n nMalasEmPosse++;\n }\n //System.out.println(\"ID: \" + id + \" posse: \" + nMalasEmPosse + \" total: \" + nMalasTotal);\n //System.out.println(getBag.toString());\n\n } while (nMalasEmPosse < nMalasTotal && getBag != bagCollect.NOMORE);\n if (nMalasEmPosse < nMalasTotal) {\n recolha.reportMissingBags(id, nMalasTotal - nMalasEmPosse,log);\n }\n transicao.goHome(id,log);\n break;\n case IN_TRANSIT:\n int ticket; //bilhete para entrar no autocarro.\n ticket = transferencia.takeABus(log,id);\n auto.enterTheBus( log,ticket,id);\n auto.leaveTheBus(id, log,ticket);\n transicao.prepareNextLeg(id,log);\n break;\n case WITHOUT_BAGGAGE:\n transicao.goHome(id,log);\n break;\n }\n }", "@Override\n\tpublic void start() {\n\t\t\tSystem.out.println(\"BMW --- strart\");\n\t}", "protected abstract void doStart();", "public void act()\n {\n // Make sure fish is alive and well in the environment -- fish\n // that have been removed from the environment shouldn't act.\n if ( isInEnv() ) \n move();\n }", "public void act() \n {\n gravity();\n animate();\n }", "public void ExecuteAction()\n {\n ActionTarget oTarget = mVecTargets.get( 0 );\n\n // Check if attack lands: compute chance of hitting the target\n if ( RandomGenerator.GetInstance().GetRandom( 1, 100 ) <=\n mSourceUnit.GetHitChance( oTarget.mCell.GetUnit() ) )\n {\n // Get the attack information from the attacking unit\n double dFinalDamage = Math.max(\n 1,\n mSourceUnit.GetUnit().GetResultingAttributes().GetStrength() -\n oTarget.mCell.GetUnit().GetUnit().GetResultingAttributes().GetPhysicalDef() );\n\n // Check critical chance\n if ( RandomGenerator.GetInstance().GetRandom( 1, 100 ) <=\n mSourceUnit.GetCritChance() )\n {\n dFinalDamage *= 1.5;\n oTarget.mActionStatus = ActionStatus.STATUS_CRITICAL;\n }\n else\n {\n oTarget.mActionStatus = ActionStatus.STATUS_SUCCESS;\n }\n\n // Add random portion to damage (10% of base damage)\n dFinalDamage = RandomGenerator.GetInstance().GetRandom(\n dFinalDamage - ( dFinalDamage / 10 ),\n dFinalDamage + ( dFinalDamage / 10 ) );\n mDamage = oTarget.mCell.GetUnit().ApplyDamage( dFinalDamage );\n\n // Add Slow status to target\n oTarget.mCell.GetUnit().SetStatus( new UnitStatusSlow(\n SLOW_TURN_DURATION,\n oTarget.mCell.GetUnit(),\n SLOW_PERCENTAGE ) );\n\n }\n else\n {\n mDamage = 0;\n oTarget.mActionStatus = ActionStatus.STATUS_MISS;\n }\n\n NotifyActionUpdate();\n ResetAttackArray();\n mSourceUnit.SetActionPerformed();\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "public void action() {\n action.action();\n }", "@Override\n\tprotected void compute() {\n\t\tSystem.out.println(\"This is an action\");\n\t}", "@Override\r\n\t\tpublic void action() {\n\t\t\t\r\n\t\t\tACLMessage request = new ACLMessage (ACLMessage.REQUEST);\r\n\t\t\trequest.setProtocol(FIPANames.InteractionProtocol.FIPA_REQUEST);\r\n\t\t\trequest.addReceiver(new AID(\"BOAgent\",AID.ISLOCALNAME));\r\n\t\t\trequest.setLanguage(new SLCodec().getName());\t\r\n\t\t\trequest.setOntology(RequestOntology.getInstance().getName());\r\n\t\t\tInformMessage imessage = new InformMessage();\r\n\t\t\timessage.setPrice(Integer.parseInt(price));\r\n\t\t\timessage.setVolume(Integer.parseInt(volume));\r\n\t\t\ttry {\r\n\t\t\t\tthis.agent.getContentManager().fillContent(request, imessage);\r\n\t\t\t} catch (CodecException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (OntologyException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tthis.agent.addBehaviour(new AchieveREInitiator(this.agent, request)\r\n\t\t\t{\t\t\t\r\n\t\t\t/**\r\n\t\t\t\t * \r\n\t\t\t\t */\r\n\t\t\t\tprivate static final long serialVersionUID = -8866775600403413061L;\r\n\r\n\t\t\t\tprotected void handleInform(ACLMessage inform)\r\n\t\t\t\t{\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "public void operationStart(BGMEvent e);", "protected void execute ()\n\t{\n\t\t//Take and process new image every .5 seconds\n\t\tif (System.currentTimeMillis() % 500 == 0)\n\t\t{\n\t\t\tSubsystems.goalVision.processNewImage();\n\t\t}\n\n\t\tif (Subsystems.goalVision.getProportionalGoalX() < X_OFFSET\n\t\t - DEADBAND)\n\t\t//the goal is to the left\n\t\t{\n\t\t\t//turn left\n\t\t\tSubsystems.transmission.drive(motorRatio, -motorRatio);\n\t\t}\n\t\t//the goal is to the right\n\t\telse if (Subsystems.goalVision.getProportionalGoalX() > X_OFFSET\n\t\t + DEADBAND)\n\t\t{\n\t\t\t//turn right\n\t\t\tSubsystems.transmission.drive(-motorRatio, motorRatio);\n\t\t}\n\t}", "@Override\n\t\t\t\t\tpublic void act(Board b) {\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void act(Board b) {\n\t\t\t\t\t}", "protected void callCarryAgent(ISpaceObject target)\r\n\t{\r\n\t\tAGRSpace agrs = (AGRSpace)((IApplicationExternalAccess)getScope().getParent()).getSpace(\"myagrspace\");\r\n\t\tGroup group = agrs.getGroup(\"mymarsteam\");\r\n\t\tIComponentIdentifier[]\tcarriers\t= group.getAgentsForRole(\"carrier\");\r\n\t\t\r\n\t\tif(carriers!=null && carriers.length>0)\r\n\t\t{\r\n\t\t\t//System.out.println(\"Carry Agent: Found Carry Agents: \"+carriers.length);\r\n\r\n\t\t\tRequestCarry rc = new RequestCarry();\r\n\t\t\trc.setTarget(target);\r\n\t\t\t//Action action = new Action();\r\n\t\t\t//action.setAction(rc);\r\n\t\t\t//action.setActor(new AID(\"dummy\", true)); // Hack!! What to do with more than one receiver?\r\n\t\t\tIMessageEvent mevent = createMessageEvent(\"request_carries\");\r\n\t\t\tmevent.getParameterSet(SFipa.RECEIVERS).addValues(carriers);\r\n\t\t\tmevent.getParameter(SFipa.CONTENT).setValue(rc);\r\n\t\t\tsendMessage(mevent);\r\n\t\t\t//System.out.println(\"Production Agent sent target to: \"+carriers.length);\r\n\t\t}\r\n\t}", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\r\n\tpublic void execute() {\n\t\tm_FlywheelSubsystem.shoot();\r\n\t}", "@Override\n\tpublic void breath() {\n\n\t}", "protected void execute() {\n \tclimber.setCLimberSpeed(0);\n }", "public void doInitialAction(){}", "public void start() {\n\t\tSystem.out.println(\"BMW start method\");\n\t}", "@Override\r\n\tpublic void doWork() {\n\t\tSystem.out.println(\"Barking Bow Bow\");\r\n\t}", "@Override\n protected void start() {\n System.out.println(\"Bike Specific Brake\");\n }", "@Override\n protected void compute() {\n\n if(this.workLoad > 16){\n System.out.println(\"Splitting Workload :: \"+this.workLoad);\n List<MyRecursiveAction> subTasks = new ArrayList<>();\n subTasks.addAll(createSubTasks());\n\n subTasks.forEach(tasks -> {\n tasks.fork();\n });\n }else{\n System.out.println(\"Doing Workload myself :: \"+this.workLoad);\n }\n }", "public void brake() {\n\t\tsetPower(Motor.STOP);\r\n\t}", "public void bark() {\n\t\tsuper.bark(bark1);\n\t}", "@Override\n public void doAction() {\n this.game.setComputerStartsFirst(false);\n }", "public void hang() {\n // WRITE CODE BETWEEN THESE LINES -------------------------------------------------------- //\n // TODO: run the intake motor to both extend and pull in hanger\n // Note: only enable running motor when the m_extended flag is true\n\n // ^^-----------------------------------------------------------------------------------^^ //\n }", "@Override\n\tpublic void action() {\n\n\t}", "public String buildingBlockAction() throws Exception {\n\t\t\t\t\n\t return \"success\";\n\t }", "abstract void doJob();", "@Override\n public void action() {\n System.out.println(\"Matchmaker Behaviour\");\n addBehaviour(new RequestToMatchMakerBehaviour());\n\n }", "@Override\n\t\t\tpublic void execute() {\n\t\t\t\tif (Math.abs(player.getPosition().getX() - x) > 25 || Math.abs(player.getPosition().getY() - y) > 25) {\n\t\t\t\t\tplayer.getMovementQueue().reset();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Get ground item..\n\t\t\t\tOptional<ItemOnGround> item = ItemOnGroundManager.getGroundItem(Optional.of(player.getUsername()), itemId, position);\n\t\t\t\tif(item.isPresent()) {\n\t\t\t\t\t//Handle it..\n\t\t\t\t\t\n\t\t\t\t\t/** FIREMAKING **/\n\t\t\t\t\tOptional<LightableLog> log = LightableLog.getForItem(item.get().getItem().getId());\n\t\t\t\t\tif(log.isPresent()) {\n\t\t\t\t\t\tplayer.getSkillManager().startSkillable(new Firemaking(log.get(), item.get()));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\n public void action() {\n MessageTemplate mt = MessageTemplate.MatchOntology(\"clones-update\");\n ACLMessage msg = myAgent.receive(mt);\n if (msg != null) {\n try {\n AuctionResult auctionResult = (AuctionResult) msg.getContentObject();\n ((ArtistManagerAgent) myAgent).addCloneAuctionResult(auctionResult, msg.getSender());\n } catch (UnreadableException e) {\n e.printStackTrace();\n }\n } else {\n block();\n }\n }", "@Override\n public void startExecuting()\n {\n // DEBUG\n System.out.println(\"AIPanic startExecute(), isRearing = \"+theEntity.isRearing()+\", client side = \"+theEntity.worldObj.isRemote);\n }", "public void hitBJ() {\n\t\tif (blackjack.isOkBet()) {\n\t\t\tif (blackjack.getCount(1, false, 21)) {\n\t\t\t\t((BlackjackView) manager.getPanel(Constants.BJ_VIEW_NAME)).addCard(blackjack.giveCard(1), 1);\n\t\t\t\tif (blackjack.getCount(1, true, 21)) {\n\t\t\t\t\tblackjack.playerLoses();\n\t\t\t\t\tJOptionPane.showMessageDialog(manager.getPanel(Constants.BJ_VIEW_NAME), \"You lose!\", \"BUSTED\",\n\t\t\t\t\t\t\tJOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\tresetBJTable();\n\t\t\t\t}\n\t\t\t}\n\t\t} else\n\t\t\tJOptionPane.showMessageDialog(manager.getPanel(Constants.BJ_VIEW_NAME), \"You must bet something\", \"ERROR\",\n\t\t\t\t\tJOptionPane.PLAIN_MESSAGE);\n\t}" ]
[ "0.60295343", "0.5606827", "0.5590184", "0.55576533", "0.5528375", "0.5524553", "0.5486794", "0.5465112", "0.54485816", "0.5447672", "0.54170245", "0.54109377", "0.54080003", "0.53897685", "0.53719693", "0.5360487", "0.5346576", "0.53193474", "0.5295799", "0.526556", "0.52616584", "0.5255338", "0.5250721", "0.524606", "0.5245046", "0.5238813", "0.5231097", "0.5227574", "0.5220947", "0.52081317", "0.52070254", "0.5205322", "0.5204393", "0.5198171", "0.51855224", "0.51815724", "0.5171556", "0.517085", "0.5156882", "0.5152748", "0.51523286", "0.5151416", "0.51495516", "0.51466423", "0.5146569", "0.5144911", "0.51402223", "0.5138404", "0.5137421", "0.5131294", "0.51265013", "0.5122286", "0.51141465", "0.5113275", "0.5107551", "0.5103825", "0.5099953", "0.509943", "0.5088877", "0.5083299", "0.5073733", "0.50716925", "0.5071478", "0.50696033", "0.5061659", "0.5054648", "0.50538075", "0.50440085", "0.50440085", "0.50440085", "0.5038367", "0.5033151", "0.5032884", "0.5028466", "0.5028305", "0.5027891", "0.5027891", "0.50273293", "0.50271136", "0.50271136", "0.5025904", "0.5025037", "0.5013764", "0.50119233", "0.5009787", "0.5009733", "0.50089645", "0.5003686", "0.5003118", "0.49964535", "0.4992646", "0.49889067", "0.49860734", "0.4981223", "0.49800333", "0.49770266", "0.4976793", "0.49763224", "0.4971945", "0.49703324" ]
0.5785605
1
/ returns a boolean array the cell 0 is if barge handled and cell 1 if rejected
private boolean[] checkIfHandleBarge(Barge barge, int time) { boolean [] result={false, false}; // if there is no other barge in the appointment list start handling // directly if (this.appointments.size() == 1) { Port.schedule.schedule(ScheduleParameters.createOneTime(time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", barge, time); result[0]=true; return result; } else { // we need the following information to check whether or not the // barge can start handling /*Barge nextBargeInSchedule = (Barge) this.appointments.keySet().toArray()[0]; Barge secondBargeInSchedule = (Barge) this.appointments.keySet().toArray()[1];*/ int expectedEndTimeThisBarge = time+ barge.handlingTimes.get(barge.terminals.indexOf(this)); int latThisBarge= this.appointments.get(barge)[0]; //System.out.println(this.name+" wants to check "+barge+" in this arrival list "+this.actualArrival+" and que= "+this.queue); int actualArrive = this.actualArrival.get(barge); /*int lstNextAppointment = this.appointments.get(nextBargeInSchedule)[1]; int lstSecondAppointment = this.appointments.get(secondBargeInSchedule)[1];*/ //if next in schedule and it was not late if ((barge.equals(this.appointments.keySet().toArray()[0]) == true && latThisBarge >= actualArrive)) { this.state=Terminal.HANDLING; Port.schedule.schedule(ScheduleParameters.createOneTime( time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", barge, time); result[0]=true; return result; } //if next barge in schedule but it was late check to see if it is possible to handle it without interrupting other appointments else if ((barge.equals(this.appointments.keySet().toArray()[0]) == true && latThisBarge <= actualArrive)) { if (expectedEndTimeThisBarge <= this.appointments.get(this.appointments.keySet().toArray()[1])[1]){ this.state=Terminal.HANDLING; Port.schedule.schedule(ScheduleParameters.createOneTime( time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", barge, time); result[0]=true; return result; } else { this.queue.remove(barge); this.appointments.remove(barge); //System.out.println(barge+" removed from "+this.name); //System.out.println(barge+" removed from the "+ this.name); if (Port.eventsToExcel.equals("Yes")) { Port.stats .addEvent( time, barge.bargeNumber, ("rejected at Terminal " + this.toString() + "due to delay")); } // notify barge to calculate rotation again barge.recalculateRotation(time); result[0]=false; result[1]=true; return result; } } // if it is not the next one see if it is possible to service it without interrupting others //also if the next barge is late start this one else if ((barge.equals(this.appointments.keySet().toArray()[0]) == false && expectedEndTimeThisBarge <= this.appointments.get(this.appointments.keySet().toArray()[0])[1]) ||(barge.equals(this.appointments.keySet().toArray()[0]) == false && time > this.appointments.get(this.appointments.keySet().toArray()[0])[1])){ this.state=Terminal.HANDLING; Port.schedule.schedule(ScheduleParameters.createOneTime( time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", barge, time); result[0]=true; return result; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean arrCompleted(Boolean[] boolarray) {\n for (int i=0; i < boolarray.length; i++) {\n if (boolarray[i] == false) {\n return false;\n }\n }\n return true;\n }", "public abstract boolean[] calculate();", "public boolean[] binaryRep() {\r\n\t\tint length = -1;\r\n\t\tfor (int i = 0; i < this.HeapTreesArray.length; i++) {\r\n\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\tlength = i;\r\n\t\t\t}\r\n\t\t}\r\n\t\tboolean[] arr = new boolean[length + 1];\r\n\t\tfor (int i = 0; i < arr.length; i++) {\r\n\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\tarr[i] = true;\r\n\t\t\t} else {\r\n\t\t\t\tarr[i] = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn arr;\r\n\t}", "public boolean[] getBooleans(){\n\t\tboolean[] b = new boolean[10];\n\t\tb[0] = isBoolean(answer0);\n\t\tb[1] = isBoolean(answer1);\n\t\tb[2] = isBoolean(answer2);\n\t\tb[3] = isBoolean(answer3);\n\t\tb[4] = isBoolean(answer4);\n\t\tb[5] = isBoolean(answer5);\n\t\tb[6] = isBoolean(answer6);\n\t\tb[7] = isBoolean(answer7);\n\t\tb[8] = isBoolean(answer8);\n\t\tb[9] = isBoolean(answer9);\n\t\treturn b;\n\t}", "private boolean isGoodState() {\n\t resetMask();\n\t checkHorizontal();\n\t checkVertical();\n\n\t for(int i = 0; i < maskArray.length; i++){\n\t for (int j = 0; j < maskArray[i].length; j++){\n\n\t if (maskArray[i][j] == 1){\n\t return false;\n\t }\n\n\t }\n\t }\n\n\t return true;\n }", "public boolean[][] supBooleana()\r\n\t{\r\n\t\tboolean [][]supBooleana = new boolean[this.casillas.getFila()][this.casillas.getCol()];\r\n\t\t\r\n\t\tfor(int i=0; i<this.casillas.getFila(); i++)\r\n\t\t{\r\n\t\t\tfor(int j=0; j<this.casillas.getCol(); j++)\r\n\t\t\t{\r\n\t\t\t\tif(this.checkCasillaVacia(new Casilla(i,j)))\r\n\t\t\t\t\tsupBooleana[i][j] = false;\r\n\t\t\t\telse\r\n\t\t\t\t\tsupBooleana[i][j] = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn supBooleana;\r\n\t}", "public static boolean[][] getMatrizBool(BufferedImage img){\n int largura = img.getWidth();\r\n int altura = img.getHeight();\r\n \r\n //Imagem de saida\r\n BufferedImage outImage = new BufferedImage(largura, altura, BufferedImage.TYPE_3BYTE_BGR);\r\n \r\n //matriz de saida\r\n boolean[][] output = new boolean[largura][altura];\r\n \r\n //calculando os valores do CIVE\r\n for (int x = 0; x < largura; x++) {\r\n for (int y = 0; y < altura; y++) {\r\n double red = Color.getColor(\"red\", img.getRGB(x, y)).getRed();\r\n double green = Color.getColor(\"green\", img.getRGB(x, y)).getGreen();\r\n \r\n if (green > red ) {\r\n output[x][y] = true;\r\n } else {\r\n output[x][y] = false;\r\n }\r\n \r\n }\r\n }\r\n\r\n return output;\r\n }", "public boolean[] asSetOfBool() {\n boolean[] rslt = new boolean[this.value.length];\n for (int i=0; i<this.value.length; i++) rslt[i] = this.value[i];\n return rslt;\n }", "public int[] checker() {\n\t\tif (!(trimCkBox.isSelected()) && !(refCkBox.isSelected()) ) { //&& !(alignCkBox.isSelected())) {\n\t\t\treturn null;\n\t\t}\n\t\t//System.out.println(\"CHECKER\");\n\t\tint[] temp = {0, 0, 0};\n\t\tif (trimCkBox.isSelected()) {\n\t\t\ttemp[0] = 1;\n\t\t}\n\t\tif (refCkBox.isSelected()) {\n\t\t\ttemp[1] = 1;\n\t\t}\n\t\t/*if (alignCkBox.isSelected()) {\n\t\t\tif (temp[0] == 0 && temp[1] == 0){\n\t\t\t\ttemp[2] = -1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttemp[2] = 1;\n\t\t\t}\n\t\t}*/\n\t\t\n\t\treturn temp;\n\t}", "static boolean[] arrBooleano(){\n\t\tint k=9;\n\t\tboolean[]a=new boolean[k];\n\t\t//agregar 1,4,7\n\t\ta[1]=true;\n\t\ta[4]=true;\n\t\ta[7]=true;\n\t\t//borrar\n\t\ta[4]=false;\n\t\t//buscar 7 acceso\n\t\t\n\t\tif(a[7]){\n\t\t\t//System.out.println(\"accedi en orden 1\");\n\t\t}\n\t\telse{\n\t\t\t//System.out.println(\"soy false\");\n\t\t}\n\t\timprimir(a);\n\t\treturn a;\n\t\t//imprimir(a);\n\t}", "private boolean done() {\n\n // If there is a false, then there are still gaps\n for (boolean[] row : board) {\n for (boolean item : row) {\n if (!item) return false;\n }\n }\n return true;\n }", "private static boolean[][] dataToBoolArray(StringBuilder chunk, int height, int width) {\n boolean[][] bools = new boolean[height][width];\n StringBuilder cleanedChunk = new StringBuilder();\n\n // cleaning chunk\n for (int i = 0; i < chunk.length(); i++) {\n if (chunk.charAt(i) == '0' || chunk.charAt(i) == '1')\n cleanedChunk.append(chunk.charAt(i));\n }\n\n for (int i = 0; i < height; i++) {\n for (int j = 0; j < width; j++)\n bools[i][j] = (cleanedChunk.charAt((i * width) + j) != '0');\n }\n\n return bools;\n }", "boolean getPossiblyBad();", "public static boolean[][] apply(BufferedImage img){\n int largura = img.getWidth();\r\n int altura = img.getHeight();\r\n \r\n //Imagem de saida\r\n BufferedImage outImage = new BufferedImage(largura, altura, BufferedImage.TYPE_3BYTE_BGR);\r\n \r\n //matriz de saida\r\n boolean[][] output = new boolean[largura][altura];\r\n \r\n //calculando os valores do CIVE\r\n for (int x = 0; x < largura; x++) {\r\n for (int y = 0; y < altura; y++) {\r\n double red = Color.getColor(\"red\", img.getRGB(x, y)).getRed();\r\n double green = Color.getColor(\"green\", img.getRGB(x, y)).getGreen();\r\n \r\n if (green > red ) {\r\n output[x][y] = true;\r\n } else {\r\n output[x][y] = false;\r\n }\r\n \r\n }\r\n }\r\n\r\n return output;\r\n }", "static boolean checkSplitsArray (double[][] splitsArray) { throw new RuntimeException(); }", "boolean getProbables();", "static boolean[][] getMatches(double[][] D, int safeiso5)\r\n {\r\n boolean[][] match = new boolean[D.length][safeiso5+1];\r\n for (int i = 0; i < D.length; i++)\r\n for (int j = 0; j < match[0].length; j++)\r\n match[i][j] = D[i][j] > 0 && D[i][j + safeiso5+1] > 0;\r\n return match;\r\n }", "public static boolean checkGenome(int[] code) {\n boolean[] numbers = new boolean[8];\n for (int c : code) { numbers[c] = true; }\n for (boolean b : numbers) { if (!b) return false; }\n return true;\n }", "org.apache.xmlbeans.XmlBoolean xgetProbables();", "public boolean hasArray()\r\n/* 122: */ {\r\n/* 123:151 */ return true;\r\n/* 124: */ }", "public boolean[] getOutput() {\n // PROGRAM 1: Student must complete this method\n // return value is a placeholder, student should replace with correct return\n boolean[] outputCopy = new boolean[output.length]; //array to hold copy of output.\n for (int i = 0; i < outputCopy.length; i++) {\n outputCopy[i] = output[i]; //place output data into outputCopy\n }\n return outputCopy; //return copy of output\n }", "private boolean isAppropriated(int[] arr) {\n boolean is_correct = false;\n for (int i : arr) {\n if (i > 9999) {\n is_correct = true;\n } else\n is_correct = false;\n }\n return is_correct;\n }", "boolean hasArray();", "private static boolean testGetAllowedValues(boolean a[]) {\r\n return a[0] && a[1] && a[2] && a[3] && !a[4] && a[5] && a[6] && a[7] && !a[8];\r\n }", "private boolean allCellsCorrect() {\n for (int i = 0;i < btArray.length;i++) {\n for (int j = 0;j < btArray[0].length;j++) {\n int cellState = mainField.getCellState(i,j);\n // if the cell has a mine\n if (mainField.getValue(i,j) == -1) {\n // tests to see if it isn't marked\n if (cellState != mainField.MARKED) {\n // returns false if it isn't, because it should be marked if the game is complete\n return false;\n }\n }\n // if it isn't a mine\n else {\n // tests to see if the cell is marked\n if (cellState == mainField.MARKED) {\n // returns false, because this nonmine cell should not be marked if the game is complete\n return false;\n }\n }\n }\n }\n return true;\n }", "private boolean checkBlueBox(int i , int j) {\n if ( Start.shemaArray[i][j].bomb == 1)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "private boolean isComplete() {\n for (boolean b : bitfield) {\n if (!b) {\n return false;\n }\n }\n return true;\n }", "Boolean getPartiallyCorrect();", "public boolean repOk()\n {\n boolean flag[] = new boolean[3];\n if(shipLength >0 )\n {\n flag[0] = true;\n }\n for(Point p: shipLocation)\n {\n if(p.x>0)\n {flag[1] = true;}\n if(p.y>0)\n {flag[2] = true;}\n }\n \n return (flag[0]&&flag[1]&&flag[2]);\n \n }", "public boolean[] getOutputMissingValues(){\r\n\t\treturn missingValues[1];\r\n\t}", "boolean[] bitwiseChangeList();", "public boolean[] enMapa(final Rectangle r) {\n\t\tboolean flag[] = new boolean[4]; // N,S,E,W\n\t\tif (r.y <= 0)\n\t\t\tflag[0] = true;\n\t\tif (r.y + r.height >= height)\n\t\t\tflag[1] = true;\n\t\tif (r.x + r.width >= width)\n\t\t\tflag[2] = true;\n\t\tif (r.x <= 0)\n\t\t\tflag[3] = true;\n\t\treturn flag;\n\t}", "boolean hasPossiblyBad();", "public static boolean fullSheep(boolean [] arr) {\n\t\tfor (int i = 0; i < arr.length; i ++) {\n\t\t\tif (arr[i] == false) \n\t\t\t\treturn false; \n\t\t}\n\t\treturn true;\n\t}", "public boolean canReduce() {\n\t\treturn marker == getRhs().length;\n\t}", "public boolean isManySolution() {\n\n boolean all_zero_brs = false;\n\n for(int i = 0; i < this.NBrsEff; i++){\n if(this.isAllZeroBrs(i)) {\n all_zero_brs = true;\n }\n }\n\n return all_zero_brs;\n }", "boolean getResult();", "boolean getResult();", "boolean getResult();", "boolean getResult();", "boolean complete() {\n\t\tint sizes = 1;\n\n\t\tfor (int i = 0; i <= matrix.length - 1; i++) {\n\t\t\tfor (int j = 4; j >= sizes; j--) {\n\t\t\t\tint cost = getCost(i,j);\n\t\t\t\tif (cost == 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsizes = sizes + 1;\n\t\t}\n\t\treturn true;\n\t}", "public Boolean checkHercules() {\r\n \tBoolean flag = true;\r\n \tfor(int i = 0; i < 44; i++) {\r\n \t\tif(hercules[i] == 0) {\r\n \t\t\tflag = false;\r\n \t\t}\r\n \t}\r\n \treturn flag;\r\n }", "public native boolean[] __booleanArrayMethod( long __swiftObject, boolean[] arg );", "public boolean interestedCheck(boolean[] bitfield){\n List<Integer> ones = new ArrayList<>();\n for(int x=0; x<bitfield.length; x++){\n if(bitfield[x]){\n return true;\n }\n }\n\n if(ones.size() == 0){\n return false;\n }\n else{\n return true;\n }\n }", "int[][][] generateChecker(int size);", "public int [] getResultArr() {\n return maskResultArray;\n }", "public boolean failedQC(){\n\t\treturn testBitwiseFlag(512);\n\t}", "protected String checkContradictionRaw(BoardState state)\r\n {\r\n \tString error = null;\r\n \tint height = state.getHeight();\r\n \tint width = state.getWidth();\r\n\r\n \tint[][] arrayacross = new int[height][width];\r\n \tint[][] arraydown = new int[height][width];\r\n \tint[][] cellRegions = (int[][])state.getExtraData().get(2);\r\n \tfor(int x = 0; x < width; ++x)\r\n \t{\r\n \t\tfor(int y = 0; y < height; ++y)\r\n \t\t{\r\n \t\t\tarrayacross[y][x] = arraydown[y][x] = 0;\r\n \t\t}\r\n \t}\r\n \t\r\n \tfor(int x = 0; x < width; ++x)\r\n \t{\r\n \t\tfor(int y = 0; y < height; ++y)\r\n \t\t{\r\n \t\t\tif(state.getCellContents(x,y) == 1)\r\n \t\t\t{\r\n \t\t\t\tif(x+1 < width)\r\n \t\t\t\t{\r\n \t\t\t\t\tif(state.getCellContents(x+1,y) == 1)\r\n \t\t\t\t\t{\r\n \t\t\t\t\t\tif( cellRegions[y][x] != cellRegions[y][x+1])\r\n \t\t\t\t\t\t\tarrayacross[y][x+1] = arrayacross[y][x] + 1;\r\n \t\t\t\t\t\telse\r\n \t\t\t\t\t\t\tarrayacross[y][x+1] = arrayacross[y][x];\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\tif(y+1 < height)\r\n \t\t\t\t{\r\n \t\t\t\t\tif(state.getCellContents(x,y+1) == 1)\r\n \t\t\t\t\t{\r\n \t\t\t\t\t\tif( cellRegions[y][x] != cellRegions[y+1][x])\r\n \t\t\t\t\t\t\tarraydown[y+1][x] = arraydown[y][x] + 1;\r\n \t\t\t\t\t\telse\r\n \t\t\t\t\t\t\tarraydown[y+1][x] = arraydown[y][x];\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}\r\n \t\r\n \tfor(int x = 0; x < width; ++x)\r\n \t{\r\n \t\tfor(int y = 0; y < height; ++y)\r\n \t\t{\r\n \t\t\tif(arrayacross[y][x] > 1 || arraydown[y][x] > 1)\r\n \t\t\t\treturn error;\r\n \t\t}\r\n \t}\r\n \t\r\n \terror = \"A line of white cells does not exceed two rooms.\";\r\n\r\n\t\treturn error;\r\n }", "public boolean[][] read2dBoolArray(boolean isJagged) throws IOException\n {\n boolean[][] array;\n if (isJagged)\n {\n int width = readInt();\n array = new boolean[width][];\n\n for (int ii = 0; ii < width; ii++)\n {\n array[ii] = readBoolArray();\n }\n }\n else\n {\n int width = readInt();\n int height = readInt();\n array = new boolean[width][];\n for (int ii = 0; ii < width; ii++)\n {\n array[ii] = readBoolArray(height);\n }\n }\n return array;\n }", "private static /* synthetic */ boolean[] m37842a() {\n boolean[] zArr = f35336a;\n if (zArr != null) {\n return zArr;\n }\n boolean[] probes = Offline.getProbes(398477284693703488L, \"com/mopub/mobileads/native_video/R$bool\", 1);\n f35336a = probes;\n return probes;\n }", "public int[][] getChecks(){return checks;}", "Boolean conditionResult();", "public boolean isGoal() {\n boolean result = false; \n for (int i = 0; i < this.N; i++) {\n for (int j = 0; j < this.N; j++) {\n int idx = (i * this.N) + (j + 1);\n if (idx != N * N - 1 && tiles[i][j] != idx) {\n return false;\n } \n if (idx == N * N - 1) {\n if (tiles[N - 1][N - 1] == 0) return true;\n return false;\n }\n }\n }\n return result;\n }", "private static boolean checkIsTrue() {\n\t\tfor(int i = 0 ; i < n ;i++){\r\n\t\t\tif(col[i]!=colTemp[i]){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0 ; i < n ;i++){\r\n\t\t\tif(row[i]!=rowTemp[i]){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean checkSolutions() {\n\t\tfor (int i = 0; i < population; ++i) {\n\t\t\tif (populationArray.get(i).getFitness() == 0) {\n\t\t\t\tsolution = populationArray.get(i);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean containsMixedBackingArrays(BlockConsistencyGroup cg) {\n // Get the active RP SOURCE VPLEX volumes for the consistency group.\n List<Volume> vplexVolumes = BlockConsistencyGroupUtils.getActiveVplexVolumesInCG(\n cg, _dbClient, PersonalityTypes.SOURCE);\n\n if (vplexVolumes.size() > 1) {\n // Get the first volume's source side backing array. Compare the backing arrays\n // from other source volume's in the CG to see if they are different.\n URI storageSystemToCompare = getSourceBackingVolumeStorageSystem(vplexVolumes.get(0));\n\n for (Volume volume : vplexVolumes) {\n URI storageSystem = getSourceBackingVolumeStorageSystem(volume);\n if (!storageSystem.equals(storageSystemToCompare)) {\n // The backing storage systems for the source side are different between\n // volumes in the CG.\n return true;\n }\n }\n }\n\n return false;\n }", "public boolean[][] fillMask(boolean arr[][]) {\r\n\t\tfor (int i = 0; i < arr.length; i++) {\r\n\t\t\tfor (int j = 0;j < arr[0].length; j++) {\r\n\t\t\t\tarr[i][j] = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn arr;\r\n\t}", "private boolean[] merge(List<boolean[]> arrList) {\n\t\tint size = 0;\r\n\t\tfor (boolean[] arr : arrList) {\r\n\t\t\tsize += arr.length;\r\n\t\t}\r\n\t\t\r\n\t\t// Copy it into that.\r\n\t\tint current = 0;\r\n\t\tboolean[] merged = new boolean[size];\r\n\t\tfor (boolean[] arr : arrList) {\r\n\t\t\tSystem.arraycopy(arr, 0, merged, current, arr.length);\r\n\t\t\tcurrent += arr.length;\r\n\t\t}\r\n\t\t\r\n\t\tassert current == size : \"current is supposed to point to the end of the array at the end of execution.\";\r\n\t\treturn merged;\r\n\t}", "public boolean[] getBooleanList();", "private boolean isMaxWeight(int[] V) {}", "public boolean percolates(){\n \tif(this.gridLength == 1){\n \t\treturn isOpen(1,1);\n \t}\n \treturn (this.bottom[unionTest.find(0)]);\n }", "private boolean checkFull() {\n\t\treturn this.array.length - 1 == this.lastNotNull();\n\t}", "public boolean finished(){\n for (int i = 0; i < dimensions[0]; i++){\n for (int j = 0; j<dimensions[0]; j++){\n if (grids[i][j].getValue() == 0)\n return false;\n }\n \n }\n return true;\n \n }", "public boolean[] feedback(int[] guess) {\n\n boolean[] feedback = new boolean[nSlots];\n\n for (int i = 0; i < this.nSlots; i++) {\n feedback[i] = (guess[i] == this.code[i]);\n }\n return feedback;\n }", "private boolean canReduceBins() {\n\t\tint oldBinCount = binCount;\n\t\tboolean canReduce = false;\n\t\tbinCount = binCount / 2;\n\t\tint[] chromosome = eliteChromosome.clone();\n\n\t\tif (getFitness(chromosome) <= binCount)\n\t\t\tcanReduce = true;\n\t\telse\n\t\t\tcanReduce = false;\n\t\tbinCount = oldBinCount; //no side effects\n\t\treturn canReduce;\n\t}", "public int[] check(int[] values)\n {\n swapAdjacentElements(values);\n return values;\n }", "public boolean[] readBoolArray(int length) throws IOException\n {\n boolean[] array = new boolean[length];\n byte lastRead;\n int total = 0;\n\n // While we have more than a byte left of bools coming, load whole bytes at a time and\n // do them nice and quick, like this.\n for (int ii = 0; ii <= length - 8; ii += 8) {\n lastRead = readByte();\n // Check each bit, and put the result in the array.\n array[ii] = ((lastRead & 0x1) != 0);\n array[ii+1] = ((lastRead & 0x2) != 0);\n array[ii+2] = ((lastRead & 0x4) != 0);\n array[ii+3] = ((lastRead & 0x8) != 0);\n array[ii+4] = ((lastRead & 0x10) != 0);\n array[ii+5] = ((lastRead & 0x20) != 0);\n array[ii+6] = ((lastRead & 0x40) != 0);\n array[ii+7] = ((lastRead & 0x80) != 0);\n\n // Remember the total so far - needed for the next loop\n total = ii + 8;\n }\n // There are 7 bits left that we want (max), so we read in bit by bit, and take only what we want.\n lastRead = readByte();\n for (int ii = total; ii < length; ii++)\n {\n array[ii] = ((lastRead & 0x1) != 0);\n lastRead = (byte) (lastRead >> 1);\n }\n return array;\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 }", "private static boolean check(int[] data) {\n int a[]=new int[8];\n a[0]=data[0]+data[1]+data[2];\n a[1]=data[3]+data[4]+data[5];\n a[2]=data[8]+data[7]+data[6];\n a[3]=data[0]+data[3]+data[6];\n a[4]=data[1]+data[4]+data[7];\n a[5]=data[2]+data[5]+data[8];\n a[6]=data[0]+data[4]+data[8];\n a[7]=data[2]+data[4]+data[6];\n for (int i = 0; i <a.length ; i++) {\n for (int j = i+1; j <a.length; j++) {\n if (a[i]==a[j]){\n return false;\n }\n }\n }\n return true;\n }", "static boolean isSafe(int i, int j, boolean visited[][], char boggle[][])\n {\n return (i >=0 && i < boggle.length && j >=0 &&\n j < boggle[0].length && !visited[i][j]);\n }", "@Override\n\tpublic boolean isCovered() {\n\t\treturn (falseCount > 0) && (trueCount > 0);\n\t}", "protected boolean isFlag(int x, int y) {\r\n \treturn flag[x][y];\r\n }", "static boolean isFilled (int[][] G){\n for(int i=1; i<G.length; i++){\n for (int j=1; j<G[i].length; j++){\n if (G[i][j]==0) {\n return false;\n }\n }\n }\n return true;\n }", "static void check(int arr[],int sum)\r\n {\r\n boolean binmap[] = new boolean[max]; /* by default this is array of false as {false,false,false,false,......,false} */\r\n for(int i=0;i<arr.length;i++)\r\n {\r\n int temp=sum-arr[i];\r\n if(temp>0 && binmap[temp]){ /* in condition , we can use binmap[temp] which means binmap[temp]==true */\r\n System.out.println(\"two numbers in given array whose sum is equal to given sum are :\"+temp+ \" and \" +arr[i]);\r\n }\r\n binmap[arr[i]]=true;\r\n }\r\n }", "public boolean percolates() {\n for (int i = 0; i < size; i++) {\r\n if (flowGrid[size * (size - 1) + i] < size) { // if any of the bottom row points at any of the index in the top row\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public boolean canJump(int[] nums) {\n boolean[] able = new boolean[nums.length];\n // last index is true because we're already there\n able[able.length - 1] = true;\n \n for (int i = able.length - 2; i >= 0; i--) {\n int maxJump = nums[i];\n boolean isAble = false;\n for (int j = i + 1; (j <= i + maxJump) && (j < able.length); j++) {\n if (able[j]) {\n isAble = true;\n break;\n }\n }\n able[i] = isAble;\n }\n return able[0];\n }", "public boolean isGoal() {\r\n\t\tint n = this.dimension();\r\n\t\tint k = 1;\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\tfor (int j = 0; j < n; j++) {\r\n\t\t\t\tif (this.blocks[i][j] != k) {\r\n\t\t\t\t\tif (!(i == n - 1 && j == n - 1 && this.blocks[i][j] == 0)) {\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\tk++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "org.apache.xmlbeans.XmlBoolean xgetMultiple();", "protected boolean getValidatedFlag() {\n createFlags();\n return flags[VALIDATED];\n }", "@Test\n\tprivate void checkPossibilityTest() {\n\t\tint[] input = new int[] {1,1,1};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {0,0,3};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {4,2,3};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {2,3,4,2,3};\n Assertions.assertThat(checkPossibility(input)).isFalse();\n\t}", "private static boolean rowAreInvalid(int[][] grid) {\n\t\tfor(int j = 0; j < BOUNDARY; j++) {\n\t\t\tList<Integer> row = new ArrayList<>();\n\t\t\tfor(int i = 0; i < BOUNDARY; i++) {\n\t\t\t\trow.add(grid[i][j]);\n\t\t\t}\n\t\t\tif(collectionHasRepeat(row)) return true;\n\t\t}\n\t\treturn false;\n\t}", "boolean bts(int array[], int index)\r\n {\r\n int d = index / 32;\r\n int mask = 1 << (index & 31);\r\n boolean b = (array[d] & mask) != 0;\r\n array[d] |= mask;\r\n return b;\r\n }", "boolean isSafe(int row, int col,boolean mat[][]) {\n\t\treturn (row >= 0) && (row < mat.length) && (col >= 0) && (col < mat.length) && (mat[row][col]);\r\n\t}", "public boolean[] getBooleanArray(String subExpression) {\n boolean[] result = null;\n String expression = contextNode + \"/\" + subExpression;\n try {\n NodeList nl = (NodeList)xp.evaluate(expression, source, XPathConstants.NODESET);\n int n = nl.getLength();\n if (n > 0) {\n result = new boolean[n];\n for (int i = 0; i < n; i++) result[i] = Boolean.parseBoolean(nl.item(i).getTextContent());\n }\n } catch(Exception e) {\n Util.log(\"XML error: can't read node \" + expression + \".\");\n Util.logException(e);\n }\n return result;\n }", "public boolean CheckBoom(int[] i,int[] j){\r\n try {\r\n if (((i[0] == i[1] - 1 && j[0] == j[1]) || (i[0] == i[1] + 1 && j[0] == j[1]) ||\r\n (i[0] == i[1] && j[0] == j[1] - 1) || (i[0] == i[1] && j[0] == j[1] + 1))) {\r\n return true;\r\n }\r\n }catch (ArrayIndexOutOfBoundsException e) {\r\n return false;\r\n }\r\n return false;\r\n }", "boolean bpm(boolean bpGraph[][], int u, boolean seen[],\n\t\t\t\tint matchR[])\n\t{\n\t\tfor (int v = 0; v < N; v++)\n\t\t{\n\t\t\tif (bpGraph[u][v] && !seen[v])\n\t\t\t{\n\t\t\t\tseen[v] = true;\n\t\t\t\tif (matchR[v] < 0 || bpm(bpGraph, matchR[v],\n\t\t\t\t\t\t\t\t\t\tseen, matchR))\n\t\t\t\t{\n\t\t\t\t\tmatchR[v] = u;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static boolean[] split2bools(String src, String sep) {\n String[] strs = split(src, sep);\n boolean[] booleans0 = new boolean[strs.length];\n int nn = 0;\n for (int i = 0, n = strs.length; i < n; i++) {\n if (!strs[i].equals(\"\")) {\n try {\n booleans0[nn] = new Boolean(strs[i]).booleanValue();\n } catch (Exception e) {\n booleans0[nn] = false;\n }\n nn++;\n }\n }\n boolean[] booleans1 = new boolean[nn];\n System.arraycopy(booleans0, 0, booleans1, 0, nn);\n return booleans1;\n }", "public int[] getColoursToConsider(boolean red, boolean green, boolean blue) {\n if (red && green && blue) {\n return new int[]{0, 1, 2};\n } else if (red && green) {\n return new int[]{0, 1};\n } else if (red && blue) {\n return new int[]{0, 2};\n } else if (blue && green) {\n return new int[]{1, 2};\n } else if (red) {\n return new int[]{0};\n } else if (green) {\n return new int[]{1};\n } else if (blue) {\n return new int[]{2};\n }\n return new int[]{0, 1, 2};\n }", "boolean isOverflow() {\r\n\r\n if (values.size() > branchingFactor - 1) {\r\n return true;\r\n }\r\n return false;\r\n }", "private boolean isExplode(int row, int col){\r\n if(map[row][col].getSafe() == true){\r\n return false;\r\n }\r\n else{\r\n return true;\r\n }\r\n }", "public boolean[] decode(boolean[] vector, int m) {\n int[] vectorSwitched = BooleanUtils.intArrayFromBoolArray(vector, 1, -1);\n\n Matrix previousW = new Matrix(new int[][]{vectorSwitched});\n for (int i = 1; i <= m; i++) {\n previousW = generateHadamardMatrix(i, m).multiply(previousW.transpose()).transpose();\n }\n\n int[] multipliedResult = previousW.getData()[0];\n\n int min = multipliedResult[0];\n int max = multipliedResult[0];\n for (int i : multipliedResult) {\n if(i > max) max = i;\n if(i < min) min = i;\n }\n\n int number = Math.abs(max) > Math.abs(min) ? max : min;\n int sign = number > 0 ? 1 : 0;\n int length = m + 1;\n int pos = findIndexOfElementInArray(multipliedResult, number);\n\n int[] binaryFormReversed = getBinaryFormReversed(pos, m);\n int[] result = new int[length];\n result[0] = sign;\n System.arraycopy(binaryFormReversed, 0, result, 1, binaryFormReversed.length);\n\n return BooleanUtils.boolArrayFromIntArray(result);\n }", "Boolean getCompletelyCorrect();", "public static boolean[][] findMessage(GImage source) {\n int[][] pixels = source.getPixelArray();\n boolean[][] result = new boolean[pixels.length][pixels[0].length];\n for (int rows = 0; rows < pixels.length; ++rows) {\n for (int cols = 0; cols < pixels[rows].length; ++cols) {\n int colorRed = GImage.getRed(pixels[rows][cols]);\n result[rows][cols] = (colorRed % 2 != 0) ? true : false;\n }\n }\n return result;\n }", "public boolean getPinValue() {\n boolean ret = false;\n for (Boolean val : sourceBlocks.values())\n ret = ret | val;\n \n return ret;\n }", "@Override\n public BooleanValue aggregate(EvaluationAccessor result, Value iter, EvaluationAccessor value, \n Map<Object, Object> data) throws ValueDoesNotMatchTypeException {\n return BooleanValue.FALSE;\n }", "public static boolean[] readAlerts(String path) {\n boolean[] stockArray = new boolean[5];\n\n try {\n File file = new File(sourcePath + path);\n BufferedReader br = new BufferedReader(new FileReader(file));\n\n String line;\n\n while ((line = br.readLine()) != null) {\n int tempLine = Integer.parseInt(line.trim());\n\n switch (tempLine) {\n case 5:\n stockArray[0] = true;\n break;\n case 10:\n stockArray[1] = true;\n break;\n case 20:\n stockArray[2] = true;\n break;\n case 50:\n stockArray[3] = true;\n break;\n case 100:\n stockArray[4] = true;\n break;\n default:\n break;\n }\n }\n\n if (file.delete())\n if (file.createNewFile())\n System.out.println(\"Successful file creation!\");\n else\n System.out.println(\"File already exists!\");\n else\n System.out.println(\"File not deleted!\");\n\n br.close();\n } catch (IOException e) {\n System.out.print(\"File not found!\");\n e.printStackTrace();\n }\n\n return stockArray;\n }", "public boolean isReturnVals() {\n return mReturnVals;\n }", "private boolean[] getState(){\n int [] ids = new int[]{\n R.id.box1, R.id.box2, R.id.box3, R.id.box4, R.id.box5, R.id.box6,\n R.id.box7, R.id.box8, R.id.box9\n };\n\n boolean[] enabled = new boolean[ids.length];\n\n for (int i = 0; i<ids.length; i++)\n {\n ImageButton btn = (ImageButton)findViewById(ids[i]);\n enabled[i] = btn.isEnabled();\n }\n\n return enabled;\n }", "public static boolean areAllFalse(boolean[] array)\n {\n for(boolean b : array)\n if(b)\n return false;\n return true;\n }", "public boolean isGoal(){\n\t\tboolean ok = true;\n\t\tfor (int i = 0; i < getRows() && ok; i++) {\n\t\t\tfor (int j = 0; j < getColumns() && ok; j++) {\n\t\t\t\tif (cells[i][j].getSand() != getK()) \n\t\t\t\t\tok = false;\n\t\t\t}\n\t\t} \n\t\treturn ok;\n\t}" ]
[ "0.6177478", "0.58768654", "0.5826917", "0.57497036", "0.57344043", "0.5653771", "0.55440766", "0.55113983", "0.5510413", "0.5458107", "0.5432543", "0.5430274", "0.54228544", "0.5409766", "0.5367916", "0.5297036", "0.52512187", "0.5243054", "0.5242889", "0.5239475", "0.5237831", "0.5231214", "0.5221508", "0.52142173", "0.518161", "0.51675165", "0.5157268", "0.51565003", "0.5147233", "0.5146095", "0.5130888", "0.512567", "0.5097372", "0.50911963", "0.50877976", "0.50854164", "0.5083339", "0.5083339", "0.5083339", "0.5083339", "0.5079829", "0.50652075", "0.5053734", "0.50373006", "0.5034119", "0.50325435", "0.5015341", "0.50039446", "0.49938563", "0.49908897", "0.4989296", "0.49888536", "0.49855933", "0.4974774", "0.4965227", "0.49628764", "0.49611458", "0.49544516", "0.49540213", "0.49517295", "0.49500027", "0.49439144", "0.49398428", "0.4928286", "0.49256426", "0.4920531", "0.4918772", "0.49155018", "0.49123448", "0.49094018", "0.49039719", "0.49010494", "0.48994994", "0.48972243", "0.4896928", "0.48891956", "0.4888431", "0.488106", "0.48782077", "0.48764545", "0.4874279", "0.48656702", "0.48616573", "0.48478344", "0.4839168", "0.4829886", "0.4824923", "0.48241985", "0.4815199", "0.48016572", "0.47921437", "0.47879836", "0.4777595", "0.4772341", "0.4772061", "0.47692424", "0.4769039", "0.47625852", "0.47605297", "0.4757659" ]
0.55202043
7
[ISchedulableAction] Finish handling of a barge
public void finishHandling(Barge barge, int time) { // remove the barge from appointments of terminal this.appointments.remove(barge); this.numHandling--; //this.state = Terminal.IDLE; // let the barge decide what to do after it finished handling barge.afterFinish(time, this); if (Port.eventsToExcel.equals("Yes")) { Port.stats.addEvent(time, barge.bargeNumber, ("Finished handling at Terminal " + this.toString())); } if (this.queue.size() == 0) { this.state = Terminal.IDLE; } else if (Port.terminalLogic.equals("Unreserved") ) { Barge nextBarge = this.queue.peek(); Port.schedule.schedule(ScheduleParameters.createOneTime(time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", nextBarge, time); } else if (Port.terminalLogic.equals("Reserved")) { // System.out.print("queue "+this.queue); // System.out.print(" appointments "+this.appointments); // System.out.println(this.name); if (!checkNextPossibleBargeToHandle(time)){ this.state = Terminal.IDLE; } /*Barge nextBargeInSchedule = (Barge) this.appointments.keySet().toArray()[0]; if (this.queue.contains(nextBargeInSchedule) == true) { Port.schedule.schedule(ScheduleParameters.createOneTime(time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", nextBargeInSchedule, time); } else { int lstNextAppointment = this.appointments .get(nextBargeInSchedule)[1]; boolean startNextBarge = false; for (Barge nextBarge : this.queue) { //System.out.print(nextBarge); //System.out.print(nextBarge.terminals); //System.out.print(" handeling times"+ nextBarge.handlingTimes); //System.out.println(" "+this.name); int expectedEndTimeThisBarge = time + nextBarge.handlingTimes.get(nextBarge.terminals.indexOf(this)); if (expectedEndTimeThisBarge <= lstNextAppointment) { Port.schedule.schedule(ScheduleParameters .createOneTime(time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", nextBarge, time); startNextBarge = true; break; } } if (startNextBarge == false) { this.state = Terminal.IDLE; } }*/ } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void finish() {\n if ( actor.hasActions() )\r\n actor.getActions().first().act(100000);\r\n // remove any remaining actions\r\n actor.clearActions();\r\n }", "public void bargeArrives(Barge barge, int time) {\r\n\t\tthis.actualArrival.put(barge, time);\r\n\t\tthis.queue.add(barge);\r\n\t\t//System.out.println(barge+\" arrived to \"+this.name+\"// arraival list= \"+this.actualArrival);\r\n\r\n\t\tif (Port.terminalLogic.equals(\"Unreserved\")\r\n\t\t\t\t&& this.state == Terminal.IDLE) {\r\n\t\t\t// //////////////////////////////////the last two argument defined\r\n\t\t\t// by me////////////////////////////////////////////////////\r\n\t\t\tPort.schedule.schedule(ScheduleParameters.createOneTime(time,\r\n\t\t\t\t\tScheduleParameters.LAST_PRIORITY), this, \"handleBarge\",\r\n\t\t\t\t\tbarge, time);\r\n\t\t\t\r\n\t\t} else if (Port.terminalLogic.equals(\"Reserved\") && this.state == Terminal.IDLE) {\r\n\t\t\tboolean []c=checkIfHandleBarge(barge, time);\r\n\t\t\t//if could not handle the barge and it was late check && c[1] for next one\r\n\t\t\tif(!c[0] ){\r\n\t\t\t\tcheckNextPossibleBargeToHandle(time);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void finish() {}", "protected void finished(){\n if (doFilterUpdate) {\n //runFilterUpdates();\n }\n \n double groupTotalTimeSecs = (System.currentTimeMillis() - (double) groupStartTime) / 1000;\n log.info(\"Job \"+id+\" finished \" /*+ parsedType*/ + \" after \"\n + groupTotalTimeSecs + \" seconds\");\n \n ((DistributedTileBreeder)breeder).jobDone(this);\n }", "void completeJob();", "@Override\n\tvoid finishWork() {\n\t\t\n\t}", "@Override\n\tvoid finishWork() {\n\t\t\n\t}", "protected abstract void finish();", "@Override\n\tpublic void finish() {\n\t\t\n\t}", "public void finish() { \n\t\t\n\t}", "@Override\n\tpublic void finish() {\n\n\t}", "@Override\n\tpublic void finish() {\n\n\t}", "@Override\n\tpublic void finish() {\n\n\t}", "protected void finish() {\n }", "@Override\n public void finish() throws CrawlerException {\n processor.finish();\n }", "public void finish() {\n\n\t}", "protected void endBatch() {\n \n }", "public abstract void finish();", "private void finish() {\n }", "public void finalizeJob() {\n // override to implement\n }", "@Override\r\n\t\t\t\tpublic void autEndProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void autEndProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "protected void finishExecution() {\r\n\r\n\t}", "public void finishTask() {\n\t\t\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t}", "@Override\n public void run() {\n destination nextState = desembarque.whatShouldIDo(id,finalDest, nMalasTotal,log);\n bagCollect getBag = null;\n switch (nextState) {\n case WITH_BAGGAGE:\n \n // System.out.println(\"tenho bagagem -----------------\");\n do {\n if ( (getBag=recolha.goCollectABag(id,log) ) == bagCollect.MINE) {\n nMalasEmPosse++;\n }\n //System.out.println(\"ID: \" + id + \" posse: \" + nMalasEmPosse + \" total: \" + nMalasTotal);\n //System.out.println(getBag.toString());\n\n } while (nMalasEmPosse < nMalasTotal && getBag != bagCollect.NOMORE);\n if (nMalasEmPosse < nMalasTotal) {\n recolha.reportMissingBags(id, nMalasTotal - nMalasEmPosse,log);\n }\n transicao.goHome(id,log);\n break;\n case IN_TRANSIT:\n int ticket; //bilhete para entrar no autocarro.\n ticket = transferencia.takeABus(log,id);\n auto.enterTheBus( log,ticket,id);\n auto.leaveTheBus(id, log,ticket);\n transicao.prepareNextLeg(id,log);\n break;\n case WITHOUT_BAGGAGE:\n transicao.goHome(id,log);\n break;\n }\n }", "@Override\r\n\tpublic void doAfterJob() {\n\r\n\t}", "private void complete(MasterProcedureEnv env, Throwable error) {\n if (isFinished()) {\n LOG.info(\"This procedure {} is already finished, skip the rest processes\", this.getProcId());\n return;\n }\n if (event == null) {\n LOG.warn(\"procedure event for {} is null, maybe the procedure is created when recovery\",\n getProcId());\n return;\n }\n if (error == null) {\n LOG.info(\"finish snapshot {} on region {}\", snapshot.getName(), region.getEncodedName());\n succ = true;\n }\n\n event.wake(env.getProcedureScheduler());\n event = null;\n }", "public void finishBlasOperation() {\n //destroy();\n }", "public void baocun() {\n\t\t\n\t}", "public boolean finishAndReleaseAll() {\n/* 475 */ return finish(true);\n/* */ }", "public synchronized void b() {\n if (!this.c && n.isFinished() && l.isFinished() && m.isFinished() && k.isFinished() && j.isFinished() && i.isFinished() && h.isFinished()) {\n this.c = true;\n }\n if (this.c && this.b) {\n LocalBroadcastManager.getInstance(AppApplication.getInstance()).sendBroadcast(new Intent().setAction(WxNotifyRefrshReceiver.b).putExtra(CleanSwitch.CLEAN_DATA, WxNotifyRefrshReceiver.c));\n }\n }", "private void handleGoLauncherFinish() {\n if (curState == 1) {\n curReclaimFailCount = 0;\n lastReclaimFailTime = -1;\n Trace.traceBegin(8, \"goLauncherFinish:openZswapd:\" + defaultSize);\n setBuffer(defaultSize, lowSize, highSize, swapReserve);\n targetBuffer = defaultSize;\n handler.removeMessages(5);\n curState = 0;\n Slog.i(TAG, \"handle launcher finish, reset failCount, targetBuffer:\" + defaultSize);\n Trace.traceEnd(8);\n return;\n }\n Slog.e(TAG, \"invalid go launcher finish msg\");\n }", "@Override\r\n\tpublic void DAGfinished() {\n\t\t\r\n\t}", "public abstract void finished();", "@Override\n\t\t\tpublic void onComplete(Bundle values) {\n\n\t\t\t\tfinish();\n\t\t\t}", "public void makeAbstractAggregatedJobConcrete(AggregatedJob job) {\n super.makeAbstractAggregatedJobConcrete(job);\n\n Job firstJob = (Job) job.getConstituentJob(0);\n StringBuffer message = new StringBuffer();\n message.append(\" POSTScript for merged job \").append(job.getName()).append(\" \");\n\n // should we tinker with the postscript for this job\n if (job.dagmanVariables.containsKey(Dagman.POST_SCRIPT_KEY)) {\n // no merged job has been set to have a specific post script\n // no tinkering\n } else {\n // we need to tinker\n // gridstart is always populated\n String gridstart = (String) firstJob.vdsNS.get(Pegasus.GRIDSTART_KEY);\n if (gridstart.equalsIgnoreCase(\n GridStartFactory.GRIDSTART_SHORT_NAMES[GridStartFactory.KICKSTART_INDEX])) {\n // ensure $PEGASUS_HOME/bin/exitpost is invoked\n // as the baby jobs are being invoked by kickstart\n job.dagmanVariables.construct(Dagman.POST_SCRIPT_KEY, PegasusExitCode.SHORT_NAME);\n }\n }\n message.append(job.dagmanVariables.get(Dagman.POST_SCRIPT_KEY));\n mLogger.log(message.toString(), LogManager.DEBUG_MESSAGE_LEVEL);\n\n return;\n }", "public FinishDeploy() {\n addSequential(new AbortAll());\n addSequential(new HatchEject());\n }", "public void finish() throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void endTask() {\n\t\tif (hasNapkin) {\n\t\t\tUnit containerUnit = person.getContainerUnit();\n\t\t\tif (person.isInside()) {//!(containerUnit instanceof MarsSurface)) {\n\t\t\t\tInventory inv = containerUnit.getInventory();\n\t\t\t\tif (NAPKIN_MASS > 0)\n\t\t\t\t\tStorage.storeAnResource(NAPKIN_MASS, ResourceUtil.solidWasteID, inv, sourceName + \"::endTask\");\n\t\t\t}\n\t\t}\n\t\tsuper.endTask();\n\t}", "@Override\r\n public void updateExit() {\r\n if (((CompositeGoal) compositeGoal).allOtherGoalsComplete()) {\r\n goalCompleted = true;\r\n compositeGoal.processGoal();\r\n } else {\r\n System.out.println(\"Need to complete other goals first\");\r\n }\r\n }", "WorkoutBatch end(boolean wasInVehicle);", "public void performComplete(BitmapHunter bitmapHunter) {\n if (MemoryPolicy.shouldWriteToMemoryCache(bitmapHunter.getMemoryPolicy())) {\n this.cache.set(bitmapHunter.getKey(), bitmapHunter.getResult());\n }\n this.hunterMap.remove(bitmapHunter.getKey());\n batch(bitmapHunter);\n if (bitmapHunter.getPicasso().loggingEnabled) {\n Utils.log(DISPATCHER_THREAD_NAME, \"batched\", Utils.getLogIdsForHunter(bitmapHunter), \"for completion\");\n }\n }", "public abstract void finished(Object result);", "public void handleFinish()\n {\n }", "public void finish() {\n\n }", "public void complete() {\n\t}", "void endBuild(Reachable reachable);", "protected void afterJobExecution() {\n\t}", "public void finish() {\n latch.countDown();\n }", "@Override\n public void handlePilotRunHasCompleted() {\n RecursionStore.publishTotalBranches();\n if (RecursionStore.getTaskQueueSize() < _argumentsParser.getBoostMultiplier() * _argumentsParser.getMaxThreads()) {\n generateOutputAndClose();\n return;\n }\n\n this._totalNumberOfStateTreeBranches = RecursionStore.getTaskQueueSize();\n while (RecursionStore.getTaskQueueSize() > 0) {\n _pool.submit(new RecursiveWorker(RecursionStore.pollStateTreeQueue(), this));\n }\n }", "@Override\n public void endBlock() {\n }", "public void finish() {\n if (!isFinishing) {\n performFnishWithRequest(true);\n }\n }", "public void finish(){\n\t\tnotfinish = false;\n\t}", "public void killAndFinish()\n\t{\n\t\tif (isKilled()) return;\n\t\tupdate(Float.MAX_VALUE);\n\t}", "public void operationEnd(BGMEvent e);", "protected void end() {\n \tif (waitForMovement) Robot.intake.setHopperTracker(deploy ? Status.deployed : Status.stowed);\n }", "@Override\n\tpublic void isFinish() {\n\n\t}", "public abstract void done();", "private void finishWork()\n\t{\n\t\ttry\n\t\t{\n\t\t\tswitch(currentWork.getType())\n\t\t\t{\n\t\t\tcase READ:\n\t\t\t\thandleRead();\n\t\t\t\tbreak;\n\t\t\tcase WRITE: \n\t\t\t\thandleWrite();\n\t\t\t\tbreak;\n\t\t\tcase HASH: \n\t\t\t\thandleHash();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Unknown work type\");\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tServer.getInstance().addWork(new DeregisterWork(currentWork.getSelectionKey()));\n\t\t\treturn;\n\t\t}\n\t}", "private void completeAbandonedJob(Integer id) {\r\n\t\tabandonedJobs++;\r\n\t\tBatchJobInstance batchJobInstance = batchJobInstanceManager.findById(id);\r\n\t\tif (batchJobInstance != null) {\r\n\t\t\tDate rightNow = new Date();\r\n\t\t\tbatchJobInstance.setStatus(BatchJobService.STATUS_ABANDONED);\r\n\t\t\tBatchJobEvent batchJobEvent = new BatchJobEvent();\r\n\t\t\tbatchJobEvent.setEvent(BatchJobService.STATUS_ABANDONED);\r\n\t\t\tbatchJobEvent.setDescription(\"Job marked as abandoned by PeriodicBatchJobReview\");\r\n\t\t\tbatchJobEvent.setCreationDate(rightNow);\r\n\t\t\tbatchJobEvent.setCreatedBy(\"PeriodicBatchJobReview\");\r\n\t\t\tbatchJobEvent.setLastUpdate(rightNow);\r\n\t\t\tbatchJobEvent.setLastUpdateBy(\"PeriodicBatchJobReview\");\r\n\t\t\tbatchJobInstance.addEvent(batchJobEvent);\r\n\t\t\tbatchJobInstance.setLastUpdate(rightNow);\r\n\t\t\tbatchJobInstance.setLastUpdateBy(\"PeriodicBatchJobReview\");\r\n\t\t\tbatchJobInstanceManager.save(batchJobInstance);\r\n\t\t\tupdatedJobs++;\r\n\t\t} else {\r\n\t\t\tlog.error(\"Unable to retrieve instance \" + id + \"; job will not be updated.\");\r\n\t\t\tfailedUpdates++;\r\n\t\t}\r\n\t}", "@Override\n\tpublic void comeBackToWork() {\n\t\t\n\t}", "public void done() {\n\t\t\tif (pool != null) {\n\t\t\t\tpool.offer(logTarget, this);\n\t\t\t}\n\t\t}", "@Override\n\t\tpublic void done() {\n\n\t\t}", "public void finish(boolean b) {\n\t\tisFinished = b;\n\t}", "@Override\n public void finish() {\n ((MotorController)master).stopMotor();\n }", "private void execEndAction(String action){\n\n if (action.length() == 0) { return; }\n\n if (endTask != null ){\n endTask.interrupt();\n endTask = null;\n }\n RunningTask rt = new RunningTask(this,action.split(\" \"),false);\n endTask = new Thread(rt);\n endTask.start();\n }", "@Override\r\n\tpublic void done() {\n\t\t\r\n\t}", "public void finish(){\n }", "public ResultMessage finish() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic void execute() \r\n\t\t{\n\t\tsourceArcs = parent.getSourceArcsFromID(child.getServerName());\r\n\t\ttargetArcs = parent.getTargetArcsFromID(child.getServerName());\r\n\t\tredo();\r\n\t\t}", "@Override\n\tpublic void finish() throws DPFTRuntimeException {\n\t\tDPFTLogger.info(this, \"Updating Outbound Control Records...\");\n\t\tDPFTOutboundDboSet rSet = (DPFTOutboundDboSet) this.getPreviousAction().getResultSet();\n\t\tDPFTOutboundControlDboSet ctrlSet = rSet.getControlTableRecords(\"process_status='\" + GlobalConstants.DPFT_OBND_STAT_RUN + \"'\");\n\t\tctrlSet.taskComplete();\n\t\tctrlSet.close();\n\t\t\n\t\t//send Notification\n\t\tString cmp_code = ctrlSet.getDbo(0).getString(\"camp_code\");\n\t\tfor(String sf: success_ftp_files){\n\t\t\tObject[] params = {sf, this.getOutFileRemoteDir()};\n\t\t\tDPFTUtil.pushNotification(\n\t\t\t\t\tDPFTUtil.getCampaignOwnerEmail(cmp_code), \n\t\t\t\t\tnew DPFTMessage(\"CUSTOM\", \"TFB00011I\", params)\n\t\t\t);\n\t\t}\n\t\tsuccess_ftp_files.clear();\n\t}", "@Override\n\tpublic void complete()\n\t{\n\t}", "@Override\n\tpublic void finishSuccess() {\n\t\tSystem.err.println(\"finishSuccess\");\n\n\t}", "@Override\n public void execute() {\n ballCount = conveyor.getBallCount();\n SmartDashboard.putNumber(\"Ball Count\", conveyor.getBallCount());\n if(ballCount == 4){\n complete = true;\n conveyor.setDone(complete);\n } else {\n complete = false;\n conveyor.setDone(complete);\n }\n SmartDashboard.putBoolean(\"Intake Complete?\", complete);\n \n //conveyor.rightWithSensor();\n if(ballCount == 0){ // right one\n conveyor.engageConveyor(false, 0.5);\n } else if(ballCount == 1) { // left one\n conveyor.engageConveyor(true, 0.5);\n stage2 = false;\n } else if(ballCount == 2 && !stage2){\n //System.out.println(\"Moving balls up\");\n conveyor.conveyorFeedTime();\n if(conveyor.doneBoolean()){\n //System.out.println(\"Ready for 3rd and 4th balls\");\n stage2 = true;\n }\n } else if(stage2 && ballCount == 2) {\n //System.out.println(\"3rd\");\n conveyor.engageConveyor(false, 0.375);\n } else if(ballCount == 3){\n conveyor.engageConveyor(true, 0.375);\n } else {\n conveyor.setConveyorMotors(0, 0, 0, 0);\n }\n \n }", "public void breath() {\n\t\tif (alive) {\n\t\t\t_age++;\n\t\t\t// Respiration process\n\t\t\tboolean canBreath = useEnergy(Math.min((_mass - _lowmaintenance) / Utils.SEGMENT_COST_DIVISOR, _energy));\n\t\t\tif ((_age >> 8) > _geneticCode.getMaxAge() || !canBreath) {\n\t\t\t\t// It's dead, but still may have energy\n\t\t\t\tdie(null);\n\t\t\t} else {\n\t\t\t\tif (_energy <= Utils.tol) {\n\t\t\t\t\talive = false;\n\t\t\t\t\t_world.decreasePopulation();\n\t\t\t\t\t_world.organismHasDied(this, null);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// The corpse slowly decays\n\t\t\tuseEnergy(Math.min(_energy, Utils.DECAY_ENERGY));\n\t\t}\n\t}", "public boolean finish() {\n/* 465 */ return finish(false);\n/* */ }", "protected void actionDone(iNamedObject node)\n\t{\n\t}", "void finish(Task task);", "@Override\n public void afterCompletion(boolean arg0) throws EJBException,\n \t\tRemoteException {\n \tSystem.out.println(\"taskerBean transaction done\");\n }", "protected void finishBuilding() throws Exception{\n for(int i =0 ; i < Constants.MAX_THREADS; i++){\n if(shortestThread[i]!=null){\n shortestThread[i].setFinishedProcessing(true);\n shortestThread[i].join();\n }\n }\n }", "public void finish();", "public void onComplete() {\n /*\n r3 = this;\n monitor-enter(r3)\n U r0 = r3.l // Catch:{ all -> 0x0022 }\n if (r0 != 0) goto L_0x0007\n monitor-exit(r3) // Catch:{ all -> 0x0022 }\n return\n L_0x0007:\n r1 = 0\n r3.l = r1 // Catch:{ all -> 0x0022 }\n monitor-exit(r3) // Catch:{ all -> 0x0022 }\n d.a.a0.c.e<U> r1 = r3.f13249d\n r1.offer(r0)\n r0 = 1\n r3.f13251f = r0\n boolean r0 = r3.f()\n if (r0 == 0) goto L_0x0021\n d.a.a0.c.e<U> r0 = r3.f13249d\n d.a.s<? super V> r1 = r3.f13248c\n r2 = 0\n d.a.a0.j.q.c(r0, r1, r2, r3, r3)\n L_0x0021:\n return\n L_0x0022:\n r0 = move-exception\n monitor-exit(r3) // Catch:{ all -> 0x0022 }\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: d.a.a0.e.d.o.b.onComplete():void\");\n }", "public void endBucket(ComputationContext context, int bucketSize) {\n updateStatusProcessed(context, command.getId(), bucketSize);\n }", "public void endCompute();", "@Override\n\t\t\t\t\tpublic void onComplete() {\n\t\t\t\t\t}", "void complete();", "void complete();", "@Override\r\n\t\t\tpublic void onComplete() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void onComplete() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tvoid endHandling() {\n\t}" ]
[ "0.6180914", "0.6005668", "0.59980047", "0.5964356", "0.59331924", "0.58989424", "0.58989424", "0.583515", "0.58235973", "0.5820916", "0.58036083", "0.58036083", "0.58036083", "0.5775158", "0.57534784", "0.5750173", "0.5719388", "0.5704176", "0.5671254", "0.56403315", "0.56078863", "0.56078863", "0.5593221", "0.5590108", "0.55856025", "0.55856025", "0.55856025", "0.5577374", "0.5577374", "0.5577374", "0.5577374", "0.5577374", "0.5553244", "0.5553244", "0.552098", "0.5513547", "0.54801714", "0.5469374", "0.54497904", "0.5434655", "0.54260975", "0.5422651", "0.5421707", "0.54211336", "0.5400091", "0.53967303", "0.5392831", "0.5391906", "0.5381644", "0.53753763", "0.5359267", "0.5356877", "0.5353819", "0.53535265", "0.5329845", "0.53168017", "0.53106445", "0.53076315", "0.53063595", "0.5293015", "0.5285437", "0.52843374", "0.52757055", "0.5273024", "0.52686894", "0.5268256", "0.52651566", "0.52600473", "0.5259772", "0.52481604", "0.52203256", "0.5217157", "0.5216889", "0.5192671", "0.51859754", "0.5184571", "0.51845586", "0.5179412", "0.51677424", "0.5167192", "0.5146041", "0.51383173", "0.5135341", "0.5131524", "0.5126968", "0.51263654", "0.51147753", "0.5097214", "0.50868946", "0.5083984", "0.5077092", "0.50741464", "0.5071719", "0.5070839", "0.5067085", "0.50605965", "0.50605965", "0.50415325", "0.50415325", "0.503825" ]
0.6209253
0
used to display the queue size in the chart in the GUI
public int getQueueSize() { return this.queue.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void refreshQueueCount(){\n queueCountLabel.setText(\"Count: \" + String.valueOf(builder.size()));\n }", "public static void setSizeOfQueue(Label sizeOfQueueValue) {\n \tsizeOfQueueValue.setText(String.valueOf(Capture.getInspectionQueue().size()));\n }", "private void updateQueueSize() {\n\t\tsims.minQS = state.queueSize < sims.minQS ? state.queueSize : sims.minQS;\n\t\tsims.maxQS = state.queueSize > sims.maxQS ? state.queueSize : sims.maxQS;\n\t}", "void updatePQ() {\n for (int i = 0; i < 1010; i++) {\n PQ_show[i].setVisible(false);\n queueVis[i] = false;\n }\n for (int i = 0; i < pq.size(); i++) {\n PQ_show[i].setText(String.format(\"%d --> %.1f\", pq.arr[i].node, pq.arr[i].dist));\n PQ_show[i].setVisible(true);\n queueVis[i] = true;\n }\n }", "int getQueueSize();", "public int getSetSize(){ return Integer.parseInt(setSize.getText()); }", "int getCurrentSize();", "public void size()\r\n\t{\r\n\t\tSystem.out.println(\"size = \"+top);\r\n\t}", "public double getSize() \n {\n return size;\n }", "public int getBarSize() { return _barSize; }", "public long getQueueSize(){\n return queue.size();\n }", "public int size() \r\n {\r\n if(measurementQueue==null) return 0;\r\n \r\n return measurementQueue.size();\r\n }", "public void display() {\n\t\tSystem.out.println(\"Queue display\");\n\t\tint maxi = (front < rear) ? rear : (rear + MAX_QUEUE_SIZE);\n\t\tfor (int i = front + 1; i <= maxi; i++) {\n\t\t\tSystem.out.println(data[i]);\n\t\t}\n\t}", "private void updateDimensions() {\r\n width = gui.getWidth();\r\n height = gui.getHeight();\r\n yLabelsMargin = (int) gui.getLabelWidth(Integer.toString(((int) maximumDB / 10) * 10), true) + 2;\r\n if (track != null)\r\n scaleXpx = ((float) width - yLabelsMargin) / track.getBufferCapacity();\r\n else\r\n scaleXpx = 1;\r\n scaleYpx = (float) ((height - 1) / (maximumDB - minimumDB));\r\n if (scaleYpx == 0)\r\n scaleYpx = 1;\r\n }", "public static int size() {\n System.out.println();\n System.out.println(\"The size of the queue is: \" + queue.size());\t \n return queue.size();\n }", "public double getSize()\n\t{\n\t\treturn size;\n\t}", "public int size() {\n return qSize;\n }", "public void actionPerformed(ActionEvent oEvent) {\n try {\n if (oEvent.getActionCommand().equals(\"UpdateSizeClasses\")) {\n\n //Make sure the values in the size classes are recognizable,\n //greater-than-zero numbers\n int iNumSizeClasses = 0;\n float fSizeClassSize = 0;\n try {\n JPanel jControls = (JPanel)DataGrapher.findNamedComponent(\n m_oChartFrame.getContentPane(), PANEL_NAME);\n JTextField jField = (JTextField)DataGrapher.findNamedComponent(\n jControls, NUMBER_SIZE_CLASS_NAME);\n Integer oNumSizeClasses = Integer.valueOf(jField.getText());\n jField = (JTextField)DataGrapher.findNamedComponent(jControls, \n SIZE_CLASS_SIZE_NAME);\n Float oSizeClassSize = Float.valueOf(jField.getText());\n iNumSizeClasses = oNumSizeClasses.intValue();\n fSizeClassSize = oSizeClassSize.floatValue();\n }\n catch (java.lang.NumberFormatException oErr) {\n JOptionPane.showMessageDialog(m_oChartFrame, \"The value for number \" +\n \t\t\"of size classes or size class size is not a recognized number.\");\n return;\n }\n\n if (iNumSizeClasses <= 0 || fSizeClassSize <= 0) {\n JOptionPane.showMessageDialog(m_oChartFrame, \"The values for number\" +\n \t\t\" of size classes or size class size must be greater than zero.\");\n return;\n }\n\n if (m_bFirstTime ||\n iNumSizeClasses != m_iNumSizeClasses ||\n fSizeClassSize != m_fSizeClassSize) {\n m_bFirstTime = false;\n m_iNumSizeClasses = iNumSizeClasses;\n m_fSizeClassSize = fSizeClassSize;\n\n //Make the size classes array\n mp_fSizeClasses = null;\n mp_fSizeClasses = new double [m_iNumSizeClasses];\n for (int i = 0; i < m_iNumSizeClasses; i++) {\n mp_fSizeClasses[i] = m_fSizeClassSize * (i + 1);\n }\n\n getDataAndMakeTables();\n }\n return;\n }\n else if (oEvent.getSource() instanceof JCheckBox) {\n JCheckBox jCheckBox = (JCheckBox)oEvent.getSource();\n if (jCheckBox.getName().equals(INCLUDE_LIVE_NAME))\n m_bIncludeLive = jCheckBox.isSelected();\n else if (jCheckBox.getName().equals(INCLUDE_SNAGS_NAME))\n m_bIncludeSnags = jCheckBox.isSelected();\n if (m_bFirstTime) return;\n JPanel jContentPanel = new JPanel(new BorderLayout());\n JComboBox<String> jComboBox = (JComboBox<String>)DataGrapher.findNamedComponent(\n m_oChartFrame.getContentPane(), SPECIES_COMBO_BOX_NAME);\n jContentPanel.add(makeSizeClassPanel(this, mp_sSpeciesNames, \n m_iNumSizeClasses, m_fSizeClassSize, jComboBox.getSelectedIndex(),\n m_bIncludeLive, m_bIncludeSnags), BorderLayout.NORTH); \n jContentPanel.add(makeTablePanel(jComboBox.getSelectedIndex()), \n BorderLayout.CENTER);\n m_oChartFrame.setContentPane(jContentPanel);\n //Create our menu\n m_oChartFrame = DataGrapher.addFileMenu(m_oChartFrame, this, m_bShowOneTimestep);\n m_oChartFrame.pack();\n return; \n }\n else if (oEvent.getActionCommand().equals(\"DisplayNewSpecies\")) {\n //Don't do anything if no tables have yet been created\n if (mp_iLiveTreeCounts == null) return;\n JPanel jContentPanel = new JPanel(new BorderLayout());\n JComboBox<String> jComboBox = (JComboBox<String>)DataGrapher.findNamedComponent(\n m_oChartFrame.getContentPane(), SPECIES_COMBO_BOX_NAME);\n jContentPanel.add(makeSizeClassPanel(this, mp_sSpeciesNames, \n m_iNumSizeClasses, m_fSizeClassSize, jComboBox.getSelectedIndex(),\n m_bIncludeLive, m_bIncludeSnags), BorderLayout.NORTH); \n jContentPanel.add(makeTablePanel(jComboBox.getSelectedIndex()), \n BorderLayout.CENTER);\n m_oChartFrame.setContentPane(jContentPanel);\n //Create our menu\n m_oChartFrame = DataGrapher.addFileMenu(m_oChartFrame, this, m_bShowOneTimestep);\n m_oChartFrame.pack();\n return;\n }\n super.actionPerformed(oEvent);\n }\n catch (sortie.data.simpletypes.ModelException oErr) {\n ErrorGUI oHandler = new ErrorGUI(m_oChartFrame);\n oHandler.writeErrorMessage(oErr);\n }\n }", "final int getQueueSize() {\n // suppress momentarily negative values\n return Math.max(0, sp - base);\n }", "@Override\n public int getCount() {\n return jArrayQty.length();\n }", "void DisplayDropPercentList(LinkedList<Tuple<Long,Long>> q, long time_window, String tag){\n\n System.out.println(tag+\"\\n\"+tag+\" Queue List, size \"+q.size());\n for(Tuple<Long,Long> e: q){\n System.out.println(tag+\" (\"+e.x +\",\" +e.y+\")\");\n }\n if(q.size()>0){\n System.out.println(tag+\" Length: \"+ (q.getLast().y-q.getFirst().x));\n }\n else{\n System.out.println(tag+\" Length: 0\");\n }\n System.out.println(tag+\" window: \"+time_window);\n System.out.println(tag+\" \\n\");\n }", "private void setStats()\r\n {\r\n solutionText.setText(\"Solution Length: \"\r\n + Integer.toString(problem.getSolutionLength())\r\n + \"\\n# Queue Ops: \" + Integer.toString(problem.getQueueOps())\r\n + \"\\nMaxQueueSize: \" + Integer.toString(problem.getMaxQueueSize())\r\n //+ \"\\nOpen Discoveries: \" + Integer.toString(problem.getOR())\r\n //+ \"\\nClosed Discoveries: \" + Integer.toString(problem.getCR())\r\n );\r\n\r\n // resize\r\n solutionText.setFont(new Font(Font.SANS_SERIF, Font.BOLD | Font.ITALIC, 12));\r\n solutionText.setPreferredSize(\r\n new Dimension(calculateTextWidth(solutionText.getText().split(\"\\\\n\"),\r\n solutionText.getFontMetrics(solutionText.getFont())) + 60,\r\n calculateTextHeight(solutionText.getText().split(\"\\\\n\"),\r\n solutionText.getFontMetrics(solutionText.getFont()))));\r\n solutionLabel.setPreferredSize(new Dimension(solutionText.getPreferredSize().width,\r\n solutionText.getPreferredSize().height + solutionLabel.getIconTextGap() * 2));\r\n }", "public void printBasinSizes(){\n PriorityQueue<Integer> BasinQueue = new PriorityQueue<Integer>(sinkCounter, Collections.reverseOrder());\n String toPrint = \"\";\n for(int x: sinkCounterMap.values()){\n BasinQueue.add(x);\n \n }\n \n for(int i=0; i<(sinkCounter); i++){\n toPrint = toPrint + BasinQueue.poll() + \" \";\n }\n \n System.out.println(toPrint);\n }", "public int getLabelSize()\n {\n return myLabelSize;\n }", "private void updateStatsCAE(){\n\t\tupdateQueueSize();\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n QueueManagerLabel = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n Table = new javax.swing.JTable();\n CancelButton = new javax.swing.JButton();\n ProgressBar = new javax.swing.JProgressBar();\n RefreshButton = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n jPanel1.setPreferredSize(new java.awt.Dimension(580, 40));\n\n jLabel1.setText(\"Queue manager : \");\n jLabel1.setPreferredSize(new java.awt.Dimension(150, 25));\n\n QueueManagerLabel.setPreferredSize(new java.awt.Dimension(150, 25));\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(QueueManagerLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(106, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(QueueManagerLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n Table.setAutoCreateRowSorter(true);\n Table.setModel(new javax.swing.table.DefaultTableModel(){\n\n @Override\n public boolean isCellEditable(int row, int column) {\n //all cells false\n return false;\n }\n\n });\n Table.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n jScrollPane1.setViewportView(Table);\n\n CancelButton.setText(\"Close\");\n CancelButton.setPreferredSize(new java.awt.Dimension(100, 25));\n CancelButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n CancelButtonActionPerformed(evt);\n }\n });\n\n ProgressBar.setPreferredSize(new java.awt.Dimension(150, 25));\n\n RefreshButton.setText(\"Refresh\");\n RefreshButton.setPreferredSize(new java.awt.Dimension(100, 25));\n RefreshButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n RefreshButtonActionPerformed(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 .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jScrollPane1)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(ProgressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(RefreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(CancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(CancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(RefreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(ProgressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\n );\n\n pack();\n }", "public double getFeederSize()\r\n\t{\r\n\t\treturn size;\r\n\t}", "public static void main(String[] args)throws Exception {\n\t\t IQueue queue=new Queue_using_LL();\n\t\t queue.enqueue(10);\n\t\t queue.enqueue(20);\n\t\t queue.enqueue(30);\n\t\t queue.display();\n\t\t queue.dequeue();\n\t\t queue.display();\n\tSystem.out.println( queue.size());\n\t\t\n\t}", "public float getSize()\n {\n return size;\n }", "public float getSize() {\n return size;\n }", "public int size(){\r\n\t\treturn queue.size();\r\n\t}", "double getSize();", "public int getQueueSize() {\n return queue.getQueueSize();\n }", "public void setTicksCount(int size) {\n\t\t\n\t}", "public int getSize(){return this.size;}", "public String getSize() {\r\n return size;\r\n }", "public double getSize() {\n return size_;\n }", "public int queueSize() {\n\t\treturn queue.size();\t\n\t}", "@Override\r\n\tpublic void Display() {\n\t\t System.out.print(\"\\nQueue = \");\r\n\t if (len == 0)\r\n\t {\r\n\t System.out.print(\"Empty\\n\");\r\n\t return ;\r\n\t }\r\n\t for (int i = front; i <= rear; i++)\r\n\t System.out.print(queue[i]+\" \");\r\n\t System.out.println(); \r\n\t\t\r\n\t}", "public int size(){\r\n return currentSize;\r\n }", "private int getSize() {\r\n\t\treturn this.size;\r\n\t}", "public float getSize() {\n\t\treturn size;\n\t}", "public int getSize() { \n return size;\n }", "public int getSize() { return size; }", "public void showMetrics() {\n }", "public static void display() {\n System.out.println();\t \n System.out.println(\"Contents of the queue are: \" + queue);\n }", "public String getSize() {\n return size;\n }", "public String getSize() {\n return size;\n }", "public abstract int getQueueLength();", "public int getSize(){\n\t\treturn this.size;\n\t}", "public int getSize()\n\t{\n\t\treturn setSize;\n\t}", "private JPanel getPackSizeLabel() {\n\t\tif (packSizePanel == null) {\n packSizeLabel = new JLabel();\n\t\t\tpackSizeLabel.setText(\"Размер колоды \");\n FlowLayout flowLayout = new FlowLayout();\n\t\t\tflowLayout.setAlignment(FlowLayout.LEFT);\n\t\t\tpackSizePanel = new JPanel();\n\t\t\tpackSizePanel.setLayout(flowLayout);\n\t\t\tpackSizePanel.add(packSizeLabel, null);\n\t\t\tpackSizePanel.add(getColoda(), null);\n\t\t}\n\t\treturn packSizePanel;\n\t}", "public double getSize() {\n return size_;\n }", "public int getSize(){\n return size;\n }", "public int getSize(){\n return size;\n }", "public int getSize(){\n return size;\n }", "public synchronized int getSize() {\r\n\t\treturn queueManagers.size();\r\n\t}", "public int getSize(){\n return size;\n }", "public int getSize() {\r\n return size;\r\n }", "double getOrderSize();", "double getStepSize();", "public void display(){\n for(int i = 0;i < n_items;++i){\n System.out.print(queue_array[(i + front) % max_size] + \" \");\n }\n System.out.println();\n }", "public int getSize() {\r\n return this.size;\r\n }", "public String getSizeLabel() {\n return (String)getAttributeInternal(SIZELABEL);\n }", "public int getSize()\n {\n return this.size;\n }", "private int getSize() {\n\t\t\treturn size;\n\t\t}", "public int getSize() {return size;}", "public int getSize() {\n return size;\n }", "public int getSize() {\n\treturn sizeNumber;\r\n}", "public int getSize() {\n return this.size;\n }", "public int getSize(){\n\t\treturn size;\n\t}", "public int getSize(){\n\t\treturn size;\n\t}", "public int getSize(){\n\t\treturn size;\n\t}", "public int getSize(){\n\t\treturn size;\n\t}", "public int getFront_label_size() {\n\t\treturn front_label_size;\n\t}", "public int getSize() {\r\n return size;\r\n }", "public int getSize() {\n\treturn size;\n }", "public int getSize() {\n return size;\n }", "public void incTotalOfQueueEntries() {\n totalOfQueueEntries++;\n }", "public static void main(String[] args) {\n CircleArrayQueue circleArrayQueue = new CircleArrayQueue(4);\n circleArrayQueue.addQueue(1);\n circleArrayQueue.addQueue(2);\n circleArrayQueue.addQueue(3);\n System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.showQueue();\n// System.out.println(circleArrayQueue.getQueue());\n// System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.addQueue(4);\n circleArrayQueue.showQueue();\n\n System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.showQueue();\n\n circleArrayQueue.addQueue(5);\n circleArrayQueue.showQueue();\n System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.showQueue();\n\n circleArrayQueue.addQueue(5);\n circleArrayQueue.showQueue();\n// System.out.println(circleArrayQueue.getQueue());\n }", "@Override\n\tpublic void showSize() {\n\t\tSystem.out.print(\"This pen is small.\");\n\t}", "@Override\r\n\tpublic int getSize() {\n\t\treturn gridSize;\r\n\t}", "private void updateStats()\r\n\t{\r\n\t\t//Get prime and cross size\r\n\t\tint primesGenerated = m_Primes.getPrimeList().size();\r\n\t\tint crossesGenerated = m_Primes.getHexagonCrossList().size();\r\n\t\tlblPrimesGenerated.setText(\"Primes generated: \" + primesGenerated);\r\n\t\tlblCrossesGenerated.setText(\"Crosses generated: \" + crossesGenerated);\r\n\t\t\r\n\t\t//Get largest prime digit\r\n\t\tif (m_Primes.getPrimeList().size() != 0) {\r\n\t\t\tBigInteger largestPrime = m_Primes.getPrimeList().get(m_Primes.getPrimeList().size() - 1);\r\n\t\t\tint lengthLargestPrime = String.valueOf(largestPrime).length();\r\n\t\t\tlblLengthLargestPrime.setText(\"The largest prime has \" + lengthLargestPrime + \" digits\");\r\n\t\t}\r\n\t\t\r\n\t\t//Get largest hexagon cross digit\r\n\t\tif (m_Primes.getHexagonCrossList().size() != 0) {\r\n\t\t\tPair<BigInteger> largestCrossPair = m_Primes.getHexagonCrossList().get(m_Primes.getHexagonCrossList().size() - 1);\r\n\t\t\tBigInteger largestCross1 = largestCrossPair.getPairVal1();\r\n\t\t\tBigInteger largestCross2 = largestCrossPair.getPairVal2();\r\n\t\t\tint lengthLargestCross1 = String.valueOf(largestCross1).length();\r\n\t\t\tint lengthLargestCross2 = String.valueOf(largestCross2).length();\r\n\t\t\tlblLengthLargestCrosses.setText(\"The largest hexagon cross has \" + lengthLargestCross1 + \" digits and \" + lengthLargestCross2 + \" digits\");\r\n\t\t}\r\n\t\t\r\n\t\tframe.revalidate();\r\n\t\tframe.repaint();\r\n\t\t\r\n \t}", "public Dimension getPreferredSize() {\n\t\treturn disp.getPreferredSize();\n\t}", "@Override\n\tpublic Map<String, Double> getTickSize() {\n\t\treturn null;\n\t}", "public int Size(){\n \treturn size;\n\t}", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize()\n {\n return size;\n }", "public int getSize()\n {\n return size;\n }", "public int getSize()\n {\n return size;\n }", "public int getSize() {\r\n \treturn size;\r\n }", "public int getSize()\r\n {\r\n return size;\r\n }", "public void updateChart() {\n\t\tdouble val_min = Double.MAX_VALUE;\n\t\tdouble val_max = -Double.MAX_VALUE;\n\t\tVector<CurveData> cdV = new Vector<CurveData>();\n\n\t\tint maxMarkLength = 1;\n\t\tint nClmns = barColumns.size();\n\t\tint nMaxLines = 0;\n\t\tfor ( final BarColumn bc : barColumns ) {\n\t\t\tif (bc.show()) {\n\t\t\t\tfor (int j = 0; j < bc.size(); j++) {\n\t\t\t\t\tif (val_min > bc.value(j)) {\n\t\t\t\t\t\tval_min = bc.value(j);\n\t\t\t\t\t}\n\t\t\t\t\tif (val_max < bc.value(j)) {\n\t\t\t\t\t\tval_max = bc.value(j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (nMaxLines < bc.size()) {\n\t\t\t\tnMaxLines = bc.size();\n\t\t\t}\n\t\t\tif (maxMarkLength < bc.marker().length()) {\n\t\t\t\tmaxMarkLength = bc.marker().length();\n\t\t\t}\n\t\t}\n\n\t\tString tmp_str = \"\";\n\t\tfor (int i = 0; i < maxMarkLength; i++) {\n\t\t\ttmp_str = tmp_str + \" \";\n\t\t}\n\t\temptyStr = tmp_str;\n\n\t\t//System.out.println(\"debug =========== val_min=\" + val_min + \" val_max=\" + val_max);\n\n\t\tif (val_min * val_max > 0.) {\n\t\t\tif (val_min > 0.) {\n\t\t\t\tval_min = 0.;\n\t\t\t} else {\n\t\t\t\tval_max = 0.;\n\t\t\t}\n\t\t}\n\n\t\tint iMin = GP.getScreenX(GP.getCurrentMinX());\n\t\tint iMax = GP.getScreenX(GP.getCurrentMaxX());\n\t\t//System.out.println(\"debug iMin=\" + iMin + \" iMax=\" + iMax);\n\t\twidth = (int) ((iMax - iMin) / (1.9 * nMaxLines * nClmns));\n\t\t//System.out.println(\"debug width=\" + width);\n\t\tif (width < 1) {\n\t\t\twidth = 1;\n\t\t}\n\n\t\t//make line from\n\t\tCurveData cd = cvV.get(0);\n\t\tif (nClmns > 0) {\n\t\t\tcd.clear();\n\t\t\tcd.addPoint(0., 0.);\n\t\t\tcd.addPoint(1.0 * (nClmns + 1), 0.);\n\t\t\tcd.setColor(Color.black);\n\t\t\tcd.setLineWidth(1);\n\t\t\tcd.findMinMax();\n\t\t\tcdV.add(cd);\n\t\t}\n\n\t\tint cvCount = 1;\n\t\tfor (int i = 1; i <= nClmns; i++) {\n\t\t\tBarColumn bc = barColumns.get(i - 1);\n\t\t\tif (bc.show()) {\n\t\t\t\tdouble d_min = i - 0.35;\n\t\t\t\tdouble d_max = i + 0.35;\n\t\t\t\tint nL = bc.size();\n\t\t\t\tdouble st = (d_max - d_min) / nL;\n\t\t\t\tfor (int j = 0; j < nL; j++) {\n\t\t\t\t\tif (bc.show(j)) {\n\t\t\t\t\t\tif(cvCount < cvV.size()){\n\t\t\t\t\t\t\tcd = cvV.get(cvCount);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tcd = new CurveData();\n\t\t\t\t\t\t\tcvV.add(cd);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcd.clear();\n\t\t\t\t\t\tcd.addPoint(d_min + (j + 0.5) * st, 0.);\n\t\t\t\t\t\tcd.addPoint(d_min + (j + 0.5) * st, bc.value(j));\n\t\t\t\t\t\tcd.setLineWidth(width);\n\t\t\t\t\t\tif (bc.getColor(j) == null) {\n\t\t\t\t\t\t\tcd.setColor(bcColor.getColor(j));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcd.setColor(bc.getColor(j));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcd.findMinMax();\n\t\t\t\t\t\tcdV.add(cd);\n\t\t\t\t\t\tcvCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//System.out.println(\"debug ===========start plotting=============== nClmns= \" + nClmns);\n\t\tif (val_min < val_max) {\n\t\t\tformatter.makeAnalysis(val_min, val_max);\n\t\t\tGP.setNumberFormatY(formatter.getFormat());\n\t\t\tGP.setLimitsAndTicksY(formatter.getMin(), formatter.getMax(), formatter.getStep());\n\t\t}\n\n\t\tif (barColumns.size() >= 10) {\n\t\t\tGP.getCurrentGL().setXminOn(false);\n\t\t\tGP.getCurrentGL().setXmaxOn(false);\n\t\t}\n\n\t\tif (cdV.size() > 0) {\n\t\t\tGP.setCurveData(cdV);\n\t\t} else {\n\t\t\tGP.removeAllCurveData();\n\t\t}\n\t}" ]
[ "0.7117305", "0.7057366", "0.63759696", "0.6305131", "0.6222833", "0.6218054", "0.61677057", "0.61127317", "0.6040652", "0.59914076", "0.59774333", "0.5955932", "0.59541416", "0.59411484", "0.59391844", "0.5908418", "0.58950377", "0.5893207", "0.5882426", "0.58606815", "0.58382666", "0.580931", "0.5806865", "0.5802053", "0.57905066", "0.5757065", "0.57532364", "0.57510585", "0.57439137", "0.57281476", "0.57259953", "0.5719115", "0.5716517", "0.57098603", "0.5709615", "0.56958526", "0.56946105", "0.5681016", "0.56774396", "0.56752694", "0.5665742", "0.56574625", "0.5652113", "0.5651261", "0.5649912", "0.56449616", "0.5643889", "0.5643889", "0.5641547", "0.5623423", "0.5623272", "0.5621442", "0.5619154", "0.5610644", "0.5610644", "0.5610644", "0.5610236", "0.56062925", "0.56055856", "0.5605055", "0.56019443", "0.5601596", "0.55938345", "0.55902624", "0.5587001", "0.5586457", "0.5586303", "0.5583302", "0.55742466", "0.557392", "0.5570519", "0.5570519", "0.5570519", "0.5570519", "0.5568691", "0.5563044", "0.55534184", "0.55527794", "0.55499065", "0.55491704", "0.55469394", "0.5545845", "0.5545436", "0.5539932", "0.553917", "0.5538843", "0.5533833", "0.5533833", "0.5533833", "0.5533833", "0.5533833", "0.5533833", "0.5533833", "0.5533833", "0.55308086", "0.55308086", "0.55308086", "0.5527938", "0.55259264", "0.55224776" ]
0.5706392
35
used to display the number of busy terminals in the GUI
public int getNumhandling() { return this.numHandling; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getNumIdle();", "protected void printNumberSelectedPicturesOnStatusLine( ) {\n\t\tSwingUtilities.invokeLater(new Runnable() {\n\t\t\t \n\t\t\tpublic void run() {\n\t\t\t\tString text;\n\t\t\t\tint count = indexData.pictureSelected.cardinality();\n\t\t\t\tif (count == 1) {\n\t\t\t\t\ttext = \"1 picture selected.\";\n\t\t\t\t} else if (count == 0) {\n\t\t\t\t\ttext = \"NO pictures selected\";\n\t\t\t\t} else {\n\t\t\t\t\ttext = String.valueOf(count) + \" pictures selected\";\n\t\t\t\t}\n\t\t\t\tselPictures.setText(text);\t\n\t\t\t}\n\t\t});\n\t}", "private void updateGUIStatus() {\r\n\r\n }", "private void cmdInfoProg() {\n long total = Runtime.getRuntime().totalMemory();\n long free = Runtime.getRuntime().freeMemory();\n NumberFormat nf = NumberFormat.getInstance();\n Log.println(\"(mem: \"\n + NumberFormat.getPercentInstance().format(\n (double) free / (double) total) + \" = \"\n + nf.format(free) + \" bytes free, \" + nf.format(total)\n + \" bytes total)\");\n }", "private void updateMemInfo() {\n\t\tproNum = getRunningNum();\r\n\r\n\t\ttv_pronum.setText(\"进程总数:\" + proNum);\r\n\r\n\t\ttv_mem.setText(\"剩余内存:\" + getRomAvailaleSize());\r\n\t}", "private void displayCount() {\n\t\tlabel.setText(String.format(\"%2d\", game.getCount()));\n\t}", "public int getRunningDevicesCount();", "public static void updateStatusBar(){\n\t\tstatus.setText(\"Sensors: \"+Sensor.idToSensor.size()+(TurnController.getInstance().getCurrentTurn()!=null?\", Turn: \"+TurnController.getInstance().getCurrentTurn().turn:\"\"));\n\t}", "public void showProcesses() {\n\t\tList<RunningAppProcessInfo> infos=am.getRunningAppProcesses();\n\t\tadapter.clear();\n\t\t\n\t\t\n\t\tProcessesListCellData data;\n\t\t\n\t\tfor (RunningAppProcessInfo info : infos) {\n\t\t\t\n\t\t\tdata=new ProcessesListCellData(this,info);\n\t\t\tif (data.appName!=null&&!data.appName.equals(\"\")) {\n\t\t\t\tadapter.addCellData(data);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tMemoryInfo memInfo=new MemoryInfo();\n\t\tam.getMemoryInfo(memInfo);\n\t\tsetTitle(\"进程管理器,可用内存:\"+memInfo.availMem/1024/1024+\"M\");\n\t}", "private String getProgressBar(){\n String output = \"\\u00A77[\";\n int total = 20;\n double unlocked = this.unlockedPercentage;\n output += \"\\u00A72\";\n //green bars for every 5% unlocked\n while(unlocked>=5){\n output += \"|\";\n unlocked-=5;\n total--;\n }\n //rest of them are red bars\n output += \"\\u00A7c\";\n while(total-->0){\n output += \"|\";\n }\n\n output += \"\\u00A77]\";\n return output;\n }", "private static void statusCommand() {\n String lineFormat = \"%-8s | %-15s | %s\\n\";\n\n List<Job> neededJobs = fetchNeededJobs();\n\n // table header\n if (neededJobs.size() < 2) {\n System.out.printf(lineFormat, \"STATE\", \"START TIME\", \"JOB DIRECTORY\");\n for (int i = 0; i < 78; i++) {\n System.out.print(((9 == i || 27 == i) ? \"+\" : \"-\"));\n }\n System.out.println();\n }\n\n // table rows\n ObjectCounter<JobState> counter = new ObjectCounter<JobState>();\n for (Job job : neededJobs) {\n Date startDate = job.getStartDate();\n JobState state = job.getState();\n counter.add(state);\n String startDateStr = (null == startDate) ? \"N/A\" : new SimpleDateFormat(\"yyyyMMdd HHmmss\").format(startDate);\n System.out.printf(lineFormat, state.toString(), startDateStr, job.getDir());\n }\n\n // table footer\n System.out.println();\n String sumFormat = \"%6d %s\\n\";\n System.out.printf(sumFormat, heritrix.getJobs().size(), \"TOTAL JOBS\");\n for (JobState state : JobState.values()) {\n if (counter.getMap().keySet().contains(state)) {\n System.out.printf(sumFormat, counter.get(state), state.toString());\n }\n }\n }", "int getSystemCount();", "public static void status(){\n System.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n System.out.flush();\n System.out.printf(\"\\nNOMBRE:\\t\\t\\t\"+nombrePersonaje);\n\tSystem.out.printf(\"\\nPuntos De Vida (HP):\\t\"+puntosDeVida);\n\tSystem.out.printf(\"\\nPuntos De mana (MP):\\t\"+puntosDeMana);\n System.out.printf(\"\\nNivel: \\t\\t\\t\"+nivel);\n\tSystem.out.printf(\"\\nExperiencia:\\t\\t\"+experiencia);\n\tSystem.out.printf(\"\\nOro: \\t\\t\"+oro);\n System.out.printf(\"\\nPotion:\\t\\t\\t\"+articulo1);\n System.out.printf(\"\\nHi-Potion:\\t\\t\"+articulo2);\n System.out.printf(\"\\nM-Potion:\\t\\t\"+articulo3);\n System.out.printf(\"\\n\\tEnemigos Vencidos:\\t\");\n\tSystem.out.printf(\"\\nNombre:\\t\\t\\tNo.Derrotas\");\n System.out.printf(\"\\nDark Wolf:\\t\\t\"+enemigoVencido1);\n\tSystem.out.printf(\"\\nDragon:\\t\\t\\t\"+enemigoVencido2);\n System.out.printf(\"\\nMighty Golem:\\t\\t\"+enemigoVencido3);\t\n }", "public int getCountOfFreeDevices() {\n int count = 0;\n for (TestDevice td : mDevices) {\n if (td.getStatus() == TestDevice.STATUS_IDLE) {\n count++;\n }\n }\n return count;\n }", "@Override\n public int getNumGuiBars() {\n return 1;\n }", "private void createUsageBarCheck (final Shell shell, final ProgressBar usage) {\n \tnew Thread(new Runnable() {\n \t\t\tpublic void run() {\n \t\t\t\twhile (!stop) {\n \t\t\t\t\ttry {\n \t\t\t\t\t\tThread.sleep(1000);\n \t\t\t\t\t} catch (Exception e) {\n \t\t\t\t\t\tlog.error(e.getMessage());\n \t\t\t\t\t}\n \t\t\t\t\tif (!shell.isDisposed()) {\n \t\t\t\t\t\ttoolbar.getDisplay().asyncExec(new Runnable() {\n \t\t\t\t\t\t\tpublic void run() {\n \t\t\t\t\t\t\t\tdouble max = (double) Runtime.getRuntime().maxMemory();\n \t\t\t\t\t\t\t\tdouble fraction = max - (double) Runtime.getRuntime().freeMemory();\n \t\t\t\t\t\t\t\tdouble selection = (fraction / max) * 100;\n \t\t\t\t\t\t\t\tRuntime.getRuntime().gc();\n \t\t\t\t\t\t\t\tint selection_int = (int) (selection);\n \t\t\t\t\t\t \tusage.setSelection(selection_int);\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}).start();\n }", "public int getNumActive();", "@Override\n\tpublic void run() {\n\t\twhile (isActive)\n\t\t\tdisplay.syncExec(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tuptimeLabel.setText(new StringBuilder(\"Uptime: \").append(\n\t\t\t\t\t\t\tgetPrettyDuration()).toString());\n\t\t\t\t\tuptimeLabel.setForeground(getUptimeColor());\n\t\t\t\t\tuptimeLabel.update();\n\t\t\t\t}\n\t\t\t});\n\t}", "public void Display() {\n\t\tSystem.out.println(Integer.toHexString(PID) + \"\\t\" + Integer.toString(CreationTime) + \"\\t\"+ Integer.toHexString(CommandCounter) + \"\\t\" + ProcessStatus.toString() \n\t\t+ \"\\t\" + Integer.toString(MemoryVolume) + \"\\t\" + Integer.toHexString(Priority) + \"\\t\" + ((MemorySegments != null)? MemorySegments.toString() : \"null\"));\n\t}", "int getCommandCount();", "int getNumActive();", "public void showStatus(){\n\t\tjlMoves.setText(\"\"+moves);\n\t\tjlCorrectMoves.setText(\"\"+correctMoves);\n\t\tjlWrongMoves.setText(\"\"+wrongMoves);\n\t\tjlOpenMoves.setText(\"\"+openMoves);\n\t\tjlNumberGames.setText(\"\"+numberGames);\n\t}", "private void startCounter() {\n\t\tThread t = new Thread(new Runnable(){\n\t\t\t//@Override\n\t\t\tpublic void run() {\n\t\t\t\tInteger counter = 0;\n\t\t\t\tint step = 1;\n\t\t\t\twhile (true) {\n\t\t\t\t\tjLabel3.setText(counter.toString());\n\t\t\t\t\ttry {\n\t\t\t\t\t\t/* Put thread to sleep for 1 sec */\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tcounter = counter + step;\n\t\t\t\t\tif (counter == 0 || counter == 9)\n\t\t\t\t\t\tstep = step * -1;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tt.start();\n\t}", "public void refreshQueueCount(){\n queueCountLabel.setText(\"Count: \" + String.valueOf(builder.size()));\n }", "private void showCardStats() {\n TextView unlockedNum = findViewById(R.id.UnlockedNum);\n unlockedNum.setText(\n \" \" + this.masterDeck.retrieveUnlockedCardNames().size() +\n \" / \" + this.masterDeck.deckSize()\n );\n }", "private void updateCounts() {\n // Update connected components count\n ((Labeled) ((HBox) statsBox.getChildren().get(1)).getChildren().get(1))\n .setText(String.valueOf(socialNetwork.getConnectedComponents().size()));\n // Update total users count\n ((Labeled) ((HBox) statsBox.getChildren().get(2)).getChildren().get(1))\n .setText(String.valueOf(socialNetwork.getTotalUsers()));\n // Update total friends count\n ((Labeled) ((HBox) statsBox.getChildren().get(3)).getChildren().get(1))\n .setText(String.valueOf(socialNetwork.getTotalFriends()));\n // Update active user's name and friend count\n if (activeUser == null) {\n ((Labeled) ((HBox) statsBox.getChildren().get(4)).getChildren().get(0))\n .setText(\"User's Total Friends: \");\n ((Labeled) ((HBox) statsBox.getChildren().get(4)).getChildren().get(1)).setText(\"\");\n } else {\n ((Labeled) ((HBox) statsBox.getChildren().get(4)).getChildren().get(0))\n .setText(activeUser.getName() + \"'s Total Friends: \");\n ((Labeled) ((HBox) statsBox.getChildren().get(4)).getChildren().get(1))\n .setText(String.valueOf(activeUser.getFriends().size()));\n }\n }", "public void setKillCount(){\n killCount = killCount + 1;\n System.out.println(\"Kill count: \"+ killCount);\n }", "public static int numWidgets() {\n return Widget.numWidgets;\n }", "public stat() {\n initComponents();\n \n jLabel4.setVisible(false);\n jLabel5.setVisible(false);\n jLabel14.setText(System.getProperty(\"user.name\" ));\n jLabel15.setText(System.getProperty(\"os.name\"));\n \n }", "public static void displaySta() {\n System.out.println(\"\\n\\n\");\n System.out.println(\"average service time: \" + doAvgProcessingTime() /100 + \" milliseconds\");\n System.out.println(\"max service time: \" + maxProcessingTime /100 + \" milliseconds\");\n System.out.println(\"average turn around time \" + doAvgTurnAroundTime()/100 + \" milliseconds\");\n System.out.println(\"max turn around time \" + maxTurnAroundTime/100 + \" milliseconds\");\n System.out.println(\"average wait time \" + doAvgWaitTime()/10000 + \" milliseconds\");\n System.out.println(\"max wait time \" + maxWaitTime/10000 + \" milliseconds\");\n System.out.println(\"end time \" + endProgramTime);\n System.out.println(\"start time \" + startProgramTime);\n System.out.println(\"processor utilization: \" + doCPU_usage() + \" %\");\n System.out.println(\"Throughput: \" + doThroughPut());\n System.out.println(\"---------------------------\");\n\n\n }", "private void updateStatus() {\n Response block = blockTableModel.getChainHead();\n int height = (block != null ? block.getInt(\"height\") : 0);\n nodeField.setText(String.format(\"<html><b>NRS node: [%s]:%d</b></html>\",\n Main.serverConnection.getHost(),\n Main.serverConnection.getPort()));\n chainHeightField.setText(String.format(\"<html><b>Chain height: %d</b></html>\",\n height));\n connectionsField.setText(String.format(\"<html><b>Peer connections: %d</b></html>\",\n connectionTableModel.getActiveCount()));\n }", "public void Times() \n {\n if(status.getStatus_NUM() == 1 || status.getStatus_NUM() == 2 || status.getStatus_NUM() == 3)\n { //Waiting Time\n startWaitingTime = System.nanoTime();\n if(status.getStatus_NUM() != 1 || status.getStatus_NUM() != 2 || status.getStatus_NUM() != 3)\n {\n endWaitingTime = System.nanoTime();\n }\n \n totalWaitingTime += endWaitingTime - startWaitingTime;\n }\n //When it is running status \n else if(status.getStatus_NUM() == 0)\n {\n //Running Time\n startRunningTime = System.nanoTime();\n //Add a process\n if(status.getStatus_NUM() != 0)\n {\n endRunningTime = System.nanoTime();\n }\n \n totalRunningTime += endRunningTime - startRunningTime;\n }\n //When it is terminated\n else\n {\n System.out.println(\"Terminated\");\n System.out.println(\"Total Running Time : \" + totalRunningTime);\n System.out.println(\"Total Waiting Time : \" + totalWaitingTime);\n }\n }", "public static int getTerminalWidth() {\n int w = out().getTerminalWidth();\n if (w <= 0) {\n w = err().getTerminalWidth();\n }\n return w;\n }", "@NlsContexts.ProgressText\n String getRootsScanningProgressText();", "int getGuestAcceleratorsCount();", "public static int display( int binlength){\r\n JOptionPane.showMessageDialog(null, \"\\n FOR DETAILED REPORT\\nPLEASE CHECK CONSOLE\");\r\n\r\n int summary = JOptionPane.showConfirmDialog(null, \r\n \"\\n-------------RESULTS----------------\\n\"+\r\n \"TOTAL BINS USED : \" + binlength + \" \\n\"+\r\n \"TIME TAKEN: \" + elapsedTime + \" (M/S) \\n\" +\r\n \"\\n\\n\" +\"Run NEW test? \\n\"+\r\n \" [CHOOSE ONE]\\n\" + \r\n \"[YES] - to RUN \\n\" +\r\n \"[NO] - to EXIT PROGRAM \\n\" , \"CONFIRMATION\" , JOptionPane.YES_NO_OPTION);\r\n if (summary != 0) {\r\n quit();\r\n }\r\n return summary;\r\n }", "int getMonitors();", "public shut(java.awt.Frame parent, boolean modal) {\n super(parent, modal);\n initComponents();\n setBackground(new Color(0,0,0,0));\nos = System.getProperty(\"os.name\");\nlb1.setText(os);\nnew Thread()\n{\npublic void run()\n{\nbyte c = 0;\nwhile(c==0)\n{\ntry\n{ \nThread.sleep(1000); \n}\ncatch(Exception e)\n{ \n}\n} \n}\n}.start();\n }", "private void createStatusBar() {\r\n\t\tJPanel panel = new JPanel();\r\n\t\tpanel.setLayout(new GridLayout(1, 4));\r\n\t\t\r\n\t\tlengthLab = new JLabel(\"Length: 0\");\r\n\t\tlengthLab.setForeground(Color.GRAY);\r\n\t\tlengthLab.setHorizontalAlignment(SwingConstants.LEFT);\r\n\t\tpanel.add(lengthLab);\r\n\t\t\r\n\t\tlnLab = new JLabel(\"Ln: 0\");\r\n\t\tlnLab.setForeground(Color.GRAY);\r\n\t\tlnLab.setHorizontalAlignment(SwingConstants.LEFT);\r\n\t\tpanel.add(lnLab);\r\n\t\t\r\n\t\tcolLab = new JLabel(\"Col: 1\");\r\n\t\tcolLab.setForeground(Color.GRAY);\r\n\t\tcolLab.setHorizontalAlignment(SwingConstants.LEFT);\r\n\t\tpanel.add(colLab);\r\n\t\t\r\n\t selLab = new JLabel(\"Sel: 0\");\r\n\t\tselLab.setForeground(Color.GRAY);\r\n\t\tselLab.setHorizontalAlignment(SwingConstants.LEFT);\r\n\t\tpanel.add(selLab);\r\n\t\t\r\n\t\tJLabel clock = new JLabel(new Date().toString());\r\n\t\tclock.setHorizontalAlignment(SwingConstants.RIGHT);\r\n\t\tpanel.add(clock, BorderLayout.PAGE_END);\r\n\t\ttimer = new Timer(100, (e) -> { \r\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\t\tclock.setText(sdf.format(new Date()));\r\n\t\t});\r\n\t\ttimer.start();\r\n\t\t\r\n\t\tgetContentPane().add(panel, BorderLayout.PAGE_END);\r\n\t}", "public static void showMemoryInfo()\r\n\t{ \r\n\t\tRuntime rt = Runtime.getRuntime(); \r\n\t\tpf(\"Maxx : \\t %d Kb\\n\", rt.maxMemory() / 1024); \r\n\t\tpf(\"Free : \\t %d Kb\\n\", rt.freeMemory() / 1024); \r\n\t\tpf(\"Totl : \\t %d Kb\\n\", rt.totalMemory() / 1024); \r\n\t\tpf(\"Used : \\t %d Kb\\n\", (rt.totalMemory()-rt.freeMemory()) / 1024); \r\n\t}", "private void displayStatus(final byte b) {\n\n\t\trunOnUiThread(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tbyte[] output = {b};\n Log.d(TAG, \"status: \" + Utils.bytesToHex2(output)); \n\t\t\t\tString currentTime = \"[\" + formater.format(new Date()) + \"] : \";\n\t\t\t\tif ((byte) (b & 0x01) == 0x01) {\n\t\t\t\t\tsynchronized (this) {\n\t\t\t\t\t\tisUsbDisconnected = false;\n\t\t\t\t\t}\n\t\t\t\t\tledUsb.setPressed(true);\n\t\t\t\t\tif ((byte) (mPreviousStatus & 0x01) == 0x00)\n\t\t\t\t\t\tlog(currentTime + \"usb connected\");\n\t\t\t\t} else {\n\t\t\t\t\tledUsb.setPressed(false);\n\t\t\t\t\tif ((byte) (mPreviousStatus & 0x01) == 0x01)\n\t\t\t\t\t\tlog(currentTime + \"usb disconnected\");\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif ((byte) (b & 0x02) == 0x02) {\n\t\t\t\t\tledWifi.setPressed(true);\n\t\t\t\t\tif ((byte) (mPreviousStatus & 0x02) == 0x00)\n\t\t\t\t\t log(currentTime + \"wifi connected\");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tledWifi.setPressed(false);\n\t\t\t\t\tif ((byte) (mPreviousStatus & 0x02) == 0x02)\n\t\t\t\t\tlog(currentTime + \"wifi disconnected\");\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tif ((byte) (b & 0x04) == 0x04) {\n\t\t\t\t\tledTelep.setPressed(true);\n\t\t\t\t\tif ((byte) (mPreviousStatus & 0x04) == 0x00)\n\t\t\t\t log(currentTime + \"telep. connected\");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tledTelep.setPressed(false);\n\t\t\t\t\tif ((byte) (mPreviousStatus & 0x04) == 0x04)\n\t\t\t\t\tlog(currentTime + \"telep. disconnected\");\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tmPreviousStatus = b;\n\n\t\t\t}\n\t\t});\n\n\t}", "@NbBundle.Messages(\"FileTypes.bgCounting.placeholder= (counting...)\")\n void updateDisplayName() {\n if (typesRoot.showCounts) {\n //only show \"(counting...)\" the first time, otherwise it is distracting.\n setDisplayName(getDisplayNameBase() + ((childCount < 0) ? Bundle.FileTypes_bgCounting_placeholder()\n : (\" (\" + childCount + \")\"))); //NON-NLS\n new SwingWorker<Long, Void>() {\n @Override\n protected Long doInBackground() throws Exception {\n return calculateChildCount();\n }\n\n @Override\n protected void done() {\n try {\n childCount = get();\n setDisplayName(getDisplayNameBase() + \" (\" + childCount + \")\"); //NON-NLS\n } catch (InterruptedException | ExecutionException ex) {\n setDisplayName(getDisplayNameBase());\n logger.log(Level.WARNING, \"Failed to get count of files for \" + getDisplayNameBase(), ex); //NON-NLS\n }\n }\n }.execute();\n } else {\n setDisplayName(getDisplayNameBase() + ((childCount < 0) ? \"\" : (\" (\" + childCount + \"+)\"))); //NON-NLS\n }\n }", "private HBox createNumOfThreadsSpinnerWrapper() {\n HBox numOfThreadsSpinnerWrapper = new HBox();\n\n numOfThreadsSpinnerWrapper.setSpacing(10);\n Label numOfThreadsSpinnerText = new Label(\"Change Number of Threads:\");\n numOfThreadsSpinnerText.setTextFill(Color.WHITE);\n numOfThreadsSpinnerWrapper.getChildren().addAll(numOfThreadsSpinnerText, createNumOfThreadsSpinner());\n\n return numOfThreadsSpinnerWrapper;\n }", "private static void updateCounters() {\n\t\tongoingProjectsLabel.setText(\"Ongoing Projects (\" + portfolio.getOngoingCount() + \")\");\n\t\tfinishedProjectsLabel.setText(\"Finished Projects (\" + portfolio.getFinishedCount() + \")\");\n\t}", "public JPanel_Terminal() {\n // initialize components\n initComponents();\n\n // initialize JTerm\n JTermInputProcessor termProcessor = (String command, JTerm console) -> {\n if (jShellTransport == null) {\n updateShellTransport();\n }\n if (jShellTransport != null) {\n try {\n console.remove(command.length());\n jShellTransport.write(command);\n } catch (IOException ex) {\n jShellTransport = null;\n Log.log(Level.SEVERE, \"ShellTransportWrite\", ex);\n }\n }\n };\n\n jTerm = new JTerm(jTextPane_Jterm, termProcessor, Color.BLACK, Color.GREEN, new Font(Font.MONOSPACED, Font.BOLD, 12));\n }", "public void listen() {\n DeviceManager cpuUsage = new CPUUsageManager();\n cpuUsage.printStatus();\n \n }", "public static int getScreenCount()\n\t{\n\t\treturn startScreens.length;\n\t}", "@Override\n public void updateBuzzerCount() {\n getProgramController().setSimpleOutputView(new SimpleOutputView(getProgramController()));\n getProgramController().getProgramView().repaint();\n getProgramPresentationView().updateBuzzerCount();\n }", "private void startOver(){\n result = 0;\n display.setText(\"0\");\n lastCommand = \"=\";\n start = true;\n }", "private void updateTaskActivityLabel()\r\n {\r\n setLabelValue(\"Tile Downloads \" + myActiveQueryCounter.intValue());\r\n setProgress(myDoneQueryCounter.doubleValue() / myTotalSinceLastAllDoneCounter.doubleValue());\r\n }", "private void updateStats()\r\n\t{\r\n\t\t//Get prime and cross size\r\n\t\tint primesGenerated = m_Primes.getPrimeList().size();\r\n\t\tint crossesGenerated = m_Primes.getHexagonCrossList().size();\r\n\t\tlblPrimesGenerated.setText(\"Primes generated: \" + primesGenerated);\r\n\t\tlblCrossesGenerated.setText(\"Crosses generated: \" + crossesGenerated);\r\n\t\t\r\n\t\t//Get largest prime digit\r\n\t\tif (m_Primes.getPrimeList().size() != 0) {\r\n\t\t\tBigInteger largestPrime = m_Primes.getPrimeList().get(m_Primes.getPrimeList().size() - 1);\r\n\t\t\tint lengthLargestPrime = String.valueOf(largestPrime).length();\r\n\t\t\tlblLengthLargestPrime.setText(\"The largest prime has \" + lengthLargestPrime + \" digits\");\r\n\t\t}\r\n\t\t\r\n\t\t//Get largest hexagon cross digit\r\n\t\tif (m_Primes.getHexagonCrossList().size() != 0) {\r\n\t\t\tPair<BigInteger> largestCrossPair = m_Primes.getHexagonCrossList().get(m_Primes.getHexagonCrossList().size() - 1);\r\n\t\t\tBigInteger largestCross1 = largestCrossPair.getPairVal1();\r\n\t\t\tBigInteger largestCross2 = largestCrossPair.getPairVal2();\r\n\t\t\tint lengthLargestCross1 = String.valueOf(largestCross1).length();\r\n\t\t\tint lengthLargestCross2 = String.valueOf(largestCross2).length();\r\n\t\t\tlblLengthLargestCrosses.setText(\"The largest hexagon cross has \" + lengthLargestCross1 + \" digits and \" + lengthLargestCross2 + \" digits\");\r\n\t\t}\r\n\t\t\r\n\t\tframe.revalidate();\r\n\t\tframe.repaint();\r\n\t\t\r\n \t}", "public void incrementProcess() {\n this.currProcessProgressValue++; \n this.pbarProcess.setValue(this.currProcessProgressValue); \n this.lblProgressCaption.setText(processCaption +\" \" +currProcessProgressValue+\n \" of \" + maximumchars+\" \"+processingCaption+\" \");\n //this.lblTimeCaption.setText(\"Time Remaining :\"+(maximumtime-this.currTimeProgressValue));\n decrementTime();\n }", "private Spinner<Integer> createNumOfThreadsSpinner() {\n Spinner<Integer> numOfThreadsSpinner = new Spinner<Integer> (\n new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 128) {\n @Override\n public void decrement(int i) {\n if(getValue() != null) {\n setValue(getValue() / 2);\n numOfThreads = getValue();\n }\n }\n\n @Override\n public void increment(int i) {\n if(getValue() != null) {\n setValue(getValue() * 2);\n numOfThreads = getValue();\n }\n }\n });\n\n return numOfThreadsSpinner;\n }", "@Override\n public int estado(){\n \n try {\n Process proceso;\n proceso = Runtime.getRuntime().exec(\"/etc/init.d/\"+nombreServicio+\" status\");\n InputStream is = proceso.getInputStream(); \n BufferedReader buffer = new BufferedReader (new InputStreamReader (is));\n \n //Se descartan las dos primeras lineas y se lee la tercera\n buffer.readLine();\n buffer.readLine();\n String resultado = buffer.readLine();\n \n if(resultado.contains(\"Active: active\")){\n return 1;\n }\n } \n catch (IOException ex) {\n Logger.getLogger(Servicio.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return 0;\n }", "public String numTasks() {\n return \"Now you have \" + USER_TASKS.size() + \" tasks in the list.\";\n }", "public void run() {\n updateSyncStats();\n\n double d = uploadCounter.calculateCurrentKBS();\n if (getController().getTransferManager().countActiveUploads() == 0)\n {\n // Hide KB/s when not active uploads\n d = 0;\n }\n if (Double.compare(d, 0) == 0) {\n uploadsLine.setNormalLabelText(Translation\n .getTranslation(\"status_tab.files_uploads\"));\n } else {\n String s = Format.formatDecimal(d);\n uploadsLine.setNormalLabelText(Translation.getTranslation(\n \"status_tab.files_uploads_active\", s));\n }\n d = downloadCounter.calculateCurrentKBS();\n if (getController().getTransferManager().countActiveDownloads() == 0)\n {\n // Hide KB/s when no active downloads\n d = 0;\n }\n if (Double.compare(d, 0) == 0) {\n downloadsLine.setNormalLabelText(Translation\n .getTranslation(\"status_tab.files_downloads\"));\n } else {\n String s = Format.formatDecimal(d);\n downloadsLine.setNormalLabelText(Translation.getTranslation(\n \"status_tab.files_downloads_active\", s));\n }\n }", "private void updateGUI() {\n\t\tsfrDlg.readSFRTableFromCPU();\n\t\tsourceCodeDlg.updateRowSelection(cpu.PC);\n\t\tsourceCodeDlg.getCyclesLabel().setText(\"Cycles count : \" + cpu.getCyclesCount());\n\t\tdataMemDlg.fillDataMemory();\n\t\t//ioPortsDlg.fillIOPorts();\t\t\n\t\tIterator iter = seg7DlgList.iterator();\n\t\twhile(iter.hasNext())\n\t\t\t((GUI_7SegDisplay)iter.next()).drawSeg();\n\t}", "int getExecutorActiveCount();", "public void initGui()\n {\n this.screenTitle = I18n.format(\"gui.stats\");\n this.doesGuiPauseGame = true;\n this.mc.getConnection().sendPacket(new CPacketClientStatus(CPacketClientStatus.State.REQUEST_STATS));\n }", "public void displayAll()\n {\n try\n {\n int i=0;\n for(HardwareDevice equip:equipment)\n {\n System.out.println(\"Equipment Number : \"+i);\n i++;\n equip.DisplayHardwareDevice();\n }\n }\n catch(NumberFormatException aE)\n {\n JOptionPane.showMessageDialog(frame, aE.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\n }\n }", "private int getRunningNum() {\n\t\treturn am.getRunningAppProcesses().size();\r\n\t}", "@Override\n public void run() {\n while (true) {\n try {\n numberOfUsers = fromServer.readInt(); //readInt will pause/block code underneath till read\n //write the number of users onto the JLabel\n labelShowNumberOfUsers.setText(\"\\tNumber of users who are currently on server: \" + numberOfUsers);\n } catch (IOException ex) {\n System.err.println(ex);\n }\n }\n }", "long getSpinCount();", "public int getNumActive() {\n return numActive;\n }", "@Override\n public void refreshGui() {\n int count = call(\"getCountAndReset\", int.class);\n long nextTime = System.currentTimeMillis();\n long elapsed = nextTime - lastTime; // ms\n double frequency = 1000 * count / elapsed;\n lastTime = nextTime;\n stats.addValue(frequency);\n\n outputLbl.setText(String.format(\"%3.1f Hz\", stats.getGeometricMean()));\n }", "public int showCounts() {\n return showCount;\n }", "private static void listCounters(String pid) {\n VmIdentifier vmId = null;\n try {\n vmId = new VmIdentifier(pid);\n } catch (URISyntaxException e) {\n System.err.println(\"Malformed VM Identifier: \" + pid);\n return;\n }\n try {\n MonitoredHost monitoredHost = MonitoredHost.getMonitoredHost(vmId);\n MonitoredVm monitoredVm = monitoredHost.getMonitoredVm(vmId, -1);\n JStatLogger logger = new JStatLogger(monitoredVm);\n logger.printSnapShot(\"\\\\w*\", // all names\n new AscendingMonitorComparator(), // comparator\n false, // not verbose\n true, // show unsupported\n System.out);\n monitoredHost.detach(monitoredVm);\n } catch (MonitorException ex) {\n ex.printStackTrace();\n }\n }", "public int howManyActivated() {\n int cont = 0;\n if(!baseProductionPanel.getProductionButton().isToken())\n cont++;\n for(int i = 0 ; i<3;i++){\n if (!productionButtons[i].isToken())\n cont++;\n }\n return cont;\n }", "public void count() {\n APIlib.getInstance().addJSLine(jsBase + \".count();\");\n }", "@Override\n public final synchronized TerminalSize getTerminalSize() throws IOException {\n TerminalSize size = findTerminalSize();\n onResized(size);\n return size;\n }", "private void updateUI() {\n handler_.post(new Runnable() {\n public void run() {\n bar_.setProgress(time_);\n String remTimeStr = \"\" + (maxTime_ - time_);\n timeRemaining_.setText(REM_STRING.replace(\"?\", remTimeStr));\n }\n });\n }", "public int fetchServerStatus (GUICalcProgressBar progress) {\n\n\t\t// Call the standard function in ServerCmd\n\n\t\tSystem.out.println ();\n\t\tint result = ServerCmd.gui_show_relay_status (progress);\n\n\t\treturn result;\n\t}", "public void printStatus() {\n\t\tSystem.out.println(\"Current : \"+current+\"\\n\"\n\t\t\t\t+ \"Tour restant : \"+nb_rounds+\"\\n\"\n\t\t\t\t\t\t+ \"Troupe restant : \"+nb_to_train);\n\t}", "private void updateProgressBar() {\n\t\tdouble current = model.scannedCounter;\n\t\tdouble total = model.fileCounter;\n\t\tdouble percentage = (double)(current/total);\n\t\t\n\t\t//Update Progress indicators\n\t\ttxtNumCompleted.setText((int) current + \" of \" + (int) total + \" Completed (\" + Math.round(percentage*100) + \"%)\");\n\t\tprogressBar.setProgress(percentage);\n\t}", "public float getExecFreq(){return 0.0f;}", "public void updateScreen() {\n/* 25 */ this.ipEdit.updateCursorCounter();\n/* */ }", "private void updateCountTV()\n {\n TextView countTextview = (TextView) findViewById(R.id.countTV);\n countTextview.setText(\"Counting Jelly Beans gives me \" + countJB);\n }", "private void feedback_output(){\r\n\t\tif(up){controller_computer.gui_computer.PressedBorderUp();}\r\n\t\tif(down){controller_computer.gui_computer.PressedBorderDown();}\r\n\t\tif(right){controller_computer.gui_computer.PressedBorderRight();}\r\n\t\tif(left){controller_computer.gui_computer.PressedBorderLeft();}\r\n\t}", "@Nullable\n @NlsContexts.ProgressText\n String getRootsScanningProgressText();", "public StatusBar() {\n super();\n super.setPreferredSize(new Dimension(100, 16));\n setMessage(\"Ready\");\n }", "int getProgressCount();", "int getProgressCount();", "int getProgressCount();", "public void updateTotalQuestions() {\n\t\ttotalQuestionsNum.setText(Integer.toString(noOfQuestions));\n\t}", "public static String getCpuInfo() {\n String result = \"\";\n ProcessBuilder cmd;\n try {\n String[] args = {COMMAND_LINE, PATH_CPU};\n cmd = new ProcessBuilder(args);\n Process process = cmd.start();\n InputStream in = process.getInputStream();\n byte[] re = new byte[24];\n while (in.read(re) != -1) {\n result = result + new String(re);\n }\n in.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n result = \"N/A\";\n }\n return result.trim();\n }", "public String getUiStatus() {\n\t\tif (switchInfo.getType().compareTo(\"thermostat\") == 0) {\r\n\t\t\ttry {\r\n\t\t\t\tDouble tmp = new Double((String) myISY.getCurrValue(myISY.getNodes().get(switchInfo.getSwitchAddress()),\r\n\t\t\t\t\t\tInsteonConstants.DEVICE_STATUS));\r\n\t\t\t\ttmp = tmp / 2;\r\n\t\t\t\treturn tmp.toString();\r\n\t\t\t} catch (NoDeviceException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (NullPointerException e) {\r\n\t\t\t}\r\n\t\t} else if ((switchInfo.getType().compareTo(\"light\") == 0)\r\n\t\t\t\t|| (switchInfo.getType().compareTo(\"circulator\") == 0)) {\r\n\t\t\ttry {\r\n\t\t\t\tDouble tmp = new Double((String) myISY.getCurrValue(myISY.getNodes().get(switchInfo.getSwitchAddress()),\r\n\t\t\t\t\t\tInsteonConstants.DEVICE_STATUS));\r\n\t\t\t\ttmp = tmp / 255 * 100;\r\n\t\t\t\tif (tmp == 0)\r\n\t\t\t\t\treturn \"OFF\";\r\n\t\t\t\telse if (tmp == 100)\r\n\t\t\t\t\treturn \"ON\";\r\n\t\t\t\treturn \"ON \" + tmp + \"%\";\r\n\t\t\t} catch (NoDeviceException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (NullPointerException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}", "public TrayHandler() {\n this.statusImages[0] = Toolkit.getDefaultToolkit().getImage(\"src/apache2tray/images/active.png\");\n this.statusImages[1] = Toolkit.getDefaultToolkit().getImage(\"src/apache2tray/images/inactive.png\");\n \n this.statusText[0] = \"Apache is running\";\n this.statusText[1] = \"Apache is not running\";\n \n this.systemtray = SystemTray.getSystemTray();\n }", "public int getAvailableCount();", "public void printStatus(){\n System.out.println(\"Nodes: \" + \n getVertexCount() + \" Edges: \" + \n getEdgeCount()); \n //and \" + getEdgeCount() + \" edges active.\");\n }", "public String getStatusIcon() {\r\n return (isDone ? \"\\u2718\" : \" \");\r\n }", "public UI() {\n boolean keepGoing = true;\n\n while (keepGoing) {\n try {\n System.out.println(\"Which digit position of pi do you want to retrieve (starting from position 0)?\");\n\n int next = scanner.nextInt();\n\n String digit = Pi.findNthPiDigit(next);\n System.out.println(\"The digit at position \" + next + \" is \" + digit);\n } catch (OutOfBoundsException e) {\n System.out.println(e.getMessage());\n } catch (Exception e) {\n System.out.println(\"Invalid entry.\");\n }\n }\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 int getKillCount(){\n return killCount;\n }", "private int getWindowsLoggedInUsers() throws IOException {\n String command = System.getenv(\"windir\") + \"\\\\system32\\\\\" + \"tasklist.exe\";\n int userCount = 0;\n ProcessBuilder builder = new ProcessBuilder();\n Process proc = null;\n proc = builder.command(command).start();\n \n StreamManager sm = new StreamManager();\n \n try {\n InputStream stdin = sm.handle(proc.getInputStream());\n Reader isr = sm.handle(new InputStreamReader(stdin));\n BufferedReader br = (BufferedReader) sm.handle(new BufferedReader(isr));\n String line = null;\n while ((line = br.readLine()) != null) {\n if (line.contains(\"explorer.exe\")) {\n userCount++;\n }\n }\n return userCount;\n } finally {\n sm.closeAll();\n }\n }", "public SimpleMonitor(Container container, Device device) throws IOException\r\n {\r\n this.container = container;\r\n this.device = device;\r\n \r\n this.container.setLayout(new BoxLayout(this.container, BoxLayout.Y_AXIS));\r\n \r\n this.icon = new JLabel(Utils.getIcon(\"cross_48.png\"));\r\n Box b1 = Box.createHorizontalBox();\r\n b1.add(this.icon);\r\n \r\n this.time = new JLabel(\"?\");\r\n this.time.setForeground(red);\r\n Box b2 = Box.createHorizontalBox();\r\n b2.add(this.time);\r\n \r\n this.time.setFont(font);\r\n this.time.setText(\"?\");\r\n this.time.setForeground(red);\r\n try {\r\n this.icon.setIcon(Utils.getIcon(\"cross_48.png\"));\r\n } catch (IOException ex) {\r\n Logger.getLogger(SimpleMonitor.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n this.container.add(b1);\r\n this.container.add(b2);\r\n \r\n \r\n \r\n JLabel stHeader = new JLabel (\"Statistics\");\r\n stHeader.setFont(new Font(\"sans-serif\", Font.BOLD, 16));\r\n Box b3 = Box.createHorizontalBox();\r\n b3.add(stHeader);\r\n this.container.add(b3);\r\n \r\n JLabel gL = new JLabel(\"< 100 ms : \");\r\n gL.setForeground(green);\r\n this.goodLabel = new JLabel();\r\n this.goodLabel.setForeground(green);\r\n Box b4 = Box.createHorizontalBox();\r\n b4.add(gL);\r\n b4.add(this.goodLabel);\r\n this.container.add(b4);\r\n \r\n JLabel rL = new JLabel(\">= 100 ms : \");\r\n rL.setForeground(yellow);\r\n this.reachableLabel = new JLabel();\r\n this.reachableLabel.setForeground(yellow);\r\n Box b5 = Box.createHorizontalBox();\r\n b5.add(rL);\r\n b5.add(this.reachableLabel);\r\n this.container.add(b5);\r\n \r\n JLabel uL = new JLabel(\"Unreachable : \");\r\n uL.setForeground(red);\r\n this.unreachableLabel = new JLabel();\r\n this.unreachableLabel.setForeground(red);\r\n Box b6 = Box.createHorizontalBox();\r\n b6.add(uL);\r\n b6.add(this.unreachableLabel);\r\n this.container.add(b6);\r\n \r\n \r\n }", "public void status(){\n lblStats.setText(\"\"+level+\"L\");\n }", "private void clearCommandPromptScreen() {\r\n //------------------------------------------------------------\r\n if(APP_INSTANCE.isWindows) {\r\n try {\r\n ProcessBuilder builder = new ProcessBuilder(\"cmd.exe\", \"/c\", \"@echo off & cls & color E\");\r\n Process process = builder.inheritIO().start();\r\n process.waitFor();\r\n } catch (IOException e) {\r\n //> If this fails, its no biggie...\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n }else {\r\n for (int ii = 0; ii < 50; ii++) {\r\n System.out.println(\"\");\r\n }\r\n }\r\n }", "public void startApp() {\n try {\n System.out.println(\" \");\n Thread.sleep(200);\n System.out.println(\" ▓█████▄ ▄▄▄ ██▀███ ▄▄▄█████▓\");\n Thread.sleep(220);\n System.out.println(\" ▒██▀ ██▌▒████▄ ▓██ ▒ ██▒▓ ██▒ ▓▒\");\n Thread.sleep(210);\n System.out.println(\" ░██ █▌▒██ ▀█▄ ▓██ ░▄█ ▒▒ ▓██░ ▒░\");\n Thread.sleep(200);\n System.out.println(\" ░▓█▄ ▌░██▄▄▄▄██ ▒██▀▀█▄ ░ ▓██▓ ░\");\n Thread.sleep(190);\n System.out.println(\" ░▒████▓ ▓█ ▓██▒░██▓ ▒██▒ ▒██▒ ░\");\n Thread.sleep(180);\n System.out.println(\" ▒▒▓ ▒ ▒▒ ▓▒█░░ ▒▓ ░▒▓░ ▒ ░░\");\n Thread.sleep(170);\n System.out.println(\" ░ ▒ ▒ ▒ ▒▒ ░ ░▒ ░ ▒░ ░\");\n Thread.sleep(160);\n System.out.println(\" ░ ░ ░ ░ ▒ ░░ ░ ░\");\n Thread.sleep(150);\n System.out.println(\" ░ ░ ░ ░\");\n Thread.sleep(150);\n System.out.println(\" ░\");\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n mainMenu();\n }\n mainMenu();\n }", "public static void clearScreen(int num) {\n for (int i = 0; i < num; i++) {\n System.out.println(); \n System.out.flush();\n } \n }", "public void print_dev() {\n\t\tSystem.out.println(\r\n\t\t\t\t\t\t\t\t\t\"[System] 펫 정보입니다.\\n 이름 : \"+TMGCSYS.tmgcName\r\n\t\t\t\t\t\t\t\t+\t\", 레벨 : \"+TMGCSYS.tmgcLV+\", 경험치 : \"+TMGCSYS.tmgcEXP+\"/\"+(100*TMGCSYS.tmgcLV)\r\n\t\t\t\t\t\t\t\t+\t\", 체력 : \"+TMGCSYS.tmgcHP+\", 스트레스 : \"+TMGCSYS.tmgcStress+\"\\n\\n\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Function Limit Count\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Eat : \"+TMGCSYS.tmgcLimitEat+\", Sleep : \"+TMGCSYS.tmgcLimitSleep\r\n\t\t\t\t\t\t\t\t+\t\", Walk : \"+TMGCSYS.tmgcLimitWalk+\", Study : \"+TMGCSYS.tmgcLimitStudy+\"\\n\\n\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Character Ability\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" STR : \"+TMGCSYS.tmgcSTR+\", INT : \"+TMGCSYS.tmgcINT\r\n\t\t\t\t\t\t\t\t+\t\", DEB : \"+TMGCSYS.tmgcDEB+\", HET : \"+TMGCSYS.tmgcHET+\"\\n\\n\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Character Job : \"+TMGCSYS.tmgc2ndJob\r\n\t\t\t\t\t\t\t\t);\r\n\t}", "private int getChatTabCount()\n {\n return (chatTabbedPane == null) ? 0 : chatTabbedPane.getTabCount();\n }" ]
[ "0.61746365", "0.594273", "0.5871741", "0.58549523", "0.58340186", "0.5815044", "0.58114344", "0.5793308", "0.5776639", "0.5737697", "0.57220066", "0.57064086", "0.5644291", "0.56392187", "0.56334", "0.56326735", "0.5588907", "0.55809414", "0.55712754", "0.5569568", "0.55227214", "0.5495876", "0.54550505", "0.5422558", "0.5404806", "0.53928214", "0.53521866", "0.5339395", "0.5301611", "0.5293277", "0.5285018", "0.52624816", "0.5257575", "0.52492523", "0.5233548", "0.5233015", "0.52189344", "0.52136844", "0.52048963", "0.52043253", "0.52017975", "0.51874167", "0.51779646", "0.5174932", "0.5167776", "0.5162767", "0.5156092", "0.51557416", "0.5134705", "0.5131909", "0.5123128", "0.5119434", "0.51179713", "0.5095405", "0.50874794", "0.50871897", "0.50816894", "0.5076639", "0.506539", "0.50637865", "0.5059585", "0.50579756", "0.50517094", "0.505154", "0.505105", "0.50495946", "0.50475734", "0.5042357", "0.50405926", "0.50392455", "0.5039232", "0.5029212", "0.5029043", "0.50267977", "0.5024851", "0.5024599", "0.5007957", "0.5000305", "0.50001425", "0.49969712", "0.49903", "0.49903", "0.49903", "0.49819866", "0.4979239", "0.4976644", "0.49700183", "0.49641782", "0.49550602", "0.49503398", "0.49469888", "0.49431333", "0.49383816", "0.4938002", "0.4937468", "0.4937187", "0.4937012", "0.4934267", "0.49288937", "0.49283355", "0.49261108" ]
0.0
-1
Initializes the controller class.
@Override public void initialize(URL url, ResourceBundle rb) { model=DomainController.getInstance(); addDataToChoiceBox(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initialize() {\n\t\tcontroller = Controller.getInstance();\n\t}", "public MainController() {\n\t\tcontroller = new Controller(this);\n\t}", "public abstract void initController();", "public Controller() {\n super();\n }", "public Controller() {\n super();\n }", "public Controller()\n\t{\n\n\t}", "private static CompanyController initializeController() {\n\n controller = new CompanyController();\n return controller;\n }", "public MainController() {\n initializeControllers();\n initializeGui();\n runGameLoop();\n }", "public Controller() {\n this.model = new ModelFacade();\n this.view = new ViewFacade();\n }", "public Controller()\r\n\t{\r\n\t\tview = new View();\r\n\t}", "public Controller() {\n\t\tthis(null);\n\t}", "public void init(){\n\t\t//Makes the view\n\t\tsetUpView();\n\n\t\t//Make the controller. Links the action listeners to the view\n\t\tnew Controller(this);\n\t\t\n\t\t//Initilize the array list\n\t\tgameInput = new ArrayList<Integer>();\n\t\tuserInput = new ArrayList<Integer>();\n\t\thighScore = new HighScoreArrayList();\n\t}", "private void initialize() {\n\t\tinitializeModel();\n\t\tinitializeBoundary();\n\t\tinitializeController();\n\t}", "public void init() {\n\t\tkontrolleri1 = new KolikkoController(this);\n\t}", "protected void initialize() {\n super.initialize(); // Enables \"drive straight\" controller\n }", "public Controller() {\n model = new Model();\n comboBox = new ChannelComboBox();\n initView();\n new ChannelWorker().execute();\n timer = new Timer();\n }", "protected CityController() {\r\n\t}", "public void initialize() {\n warpController = new WarpController(this);\n kitController = new KitController(this);\n crafting = new CraftingController(this);\n mobs = new MobController(this);\n items = new ItemController(this);\n enchanting = new EnchantingController(this);\n anvil = new AnvilController(this);\n blockController = new BlockController(this);\n hangingController = new HangingController(this);\n entityController = new EntityController(this);\n playerController = new PlayerController(this);\n inventoryController = new InventoryController(this);\n explosionController = new ExplosionController(this);\n requirementsController = new RequirementsController(this);\n worldController = new WorldController(this);\n arenaController = new ArenaController(this);\n arenaController.start();\n if (CompatibilityLib.hasStatistics() && !CompatibilityLib.hasJumpEvent()) {\n jumpController = new JumpController(this);\n }\n File examplesFolder = new File(getPlugin().getDataFolder(), \"examples\");\n examplesFolder.mkdirs();\n\n File urlMapFile = getDataFile(URL_MAPS_FILE);\n File imageCache = new File(dataFolder, \"imagemapcache\");\n imageCache.mkdirs();\n maps = new MapController(this, urlMapFile, imageCache);\n\n // Initialize EffectLib.\n if (com.elmakers.mine.bukkit.effect.EffectPlayer.initialize(plugin, getLogger())) {\n getLogger().info(\"EffectLib initialized\");\n } else {\n getLogger().warning(\"Failed to initialize EffectLib\");\n }\n\n // Pre-create schematic folder\n File magicSchematicFolder = new File(plugin.getDataFolder(), \"schematics\");\n magicSchematicFolder.mkdirs();\n\n // One-time migration of legacy configurations\n migrateConfig(\"enchanting\", \"paths\");\n migrateConfig(\"automata\", \"blocks\");\n migrateDataFile(\"automata\", \"blocks\");\n\n // Ready to load\n load();\n resourcePacks.startResourcePackChecks();\n }", "public ClientController() {\n }", "public Controller() {\n\t\tthis.nextID = 0;\n\t\tthis.data = new HashMap<Integer, T>();\n\t}", "public ListaSEController() {\n }", "boolean InitController();", "public MenuController() {\r\n\t \r\n\t }", "@Override\n\tprotected void initController() throws Exception {\n\t\tmgr = orderPickListManager;\n\t}", "public CustomerController() {\n\t\tsuper();\n\n\t}", "public End_User_0_Controller() {\r\n\t\t// primaryStage = Users_Page_Controller.primaryStage;\r\n\t\t// this.Storeinfo = primaryStage.getTitle();\r\n\t}", "public Controller(){\r\n\t\tthis.fabricaJogos = new JogoFactory();\r\n\t\tthis.loja = new Loja();\r\n\t\tthis.preco = 0;\r\n\t\tthis.desconto = 0;\r\n\t}", "private Controller() {\n\t\tthis.gui = GUI.getInstance();\n\t\tthis.gui.setController(this);\n\t}", "public GameController() {\r\n\t\tsuper();\r\n\t\tthis.model = Main.getModel();\r\n\t\tthis.player = this.model.getPlayer();\r\n\t\tthis.timeline = this.model.getIndefiniteTimeline();\r\n\t}", "public PlantillaController() {\n }", "public Controller() {\n\t\tplaylist = new ArrayList<>();\n\t\tshowingMore = false;\n\t\tstage = Main.getStage();\n\t}", "public IfController()\n\t{\n\n\t}", "public TournamentController()\n\t{\n\t\tinitMap();\n\t}", "public GeneralListVueController() {\n\n\t}", "private ClientController() {\n }", "public Controller()\n\t{\n\t\ttheParser = new Parser();\n\t\tstarList = theParser.getStars();\n\t\tmessierList = theParser.getMessierObjects();\n\t\tmoon = new Moon(\"moon\");\n\t\tsun = new Sun(\"sun\");\n\t\tconstellationList = theParser.getConstellations();\n\t\tplanetList = new ArrayList<Planet>();\n\t\ttheCalculator = new Calculator();\n\t\tepoch2000JD = 2451545.0;\n\t}", "private void initialiseController() \r\n {\r\n defaultVectors();\r\n if(grantsByPIForm == null) \r\n {\r\n grantsByPIForm = new GrantsByPIForm(); //(Component) parent,modal);\r\n }\r\n grantsByPIForm.descriptionLabel.setText(UnitName);\r\n grantsByPIForm.descriptionLabel.setFont(new Font(\"SansSerif\",Font.BOLD,14));\r\n queryEngine = QueryEngine.getInstance();\r\n coeusMessageResources = CoeusMessageResources.getInstance();\r\n registerComponents();\r\n try {\r\n setFormData(null);\r\n }\r\n catch(Exception e) {\r\n e.printStackTrace(System.out);\r\n }\r\n }", "public LogMessageController() {\n\t}", "public LoginPageController() {\n\t}", "public ControllerEnfermaria() {\n }", "public ProvisioningEngineerController() {\n super();\n }", "private StoreController(){}", "public GenericController() {\n }", "@Override\n\tpublic void initialize() {\n\t\tinitializeModel(getSeed());\n\t\tinitializeView();\n\t\tinitializeControllers();\n\t\t\n\t\tupdateScore(8);\n\t\tupdateNumberCardsLeft(86);\n\n\t}", "public Controller() {\n\t\tenabled = false;\n\t\tloop = new Notifier(new ControllerTask(this));\n\t\tloop.startPeriodic(DEFAULT_PERIOD);\n\t}", "public MapController() {\r\n\t}", "@Override\r\n\tpublic void initControllerBean() throws Exception {\n\t}", "private void setupController() {\n setupWriter();\n Controller controller1 = new Controller(writer);\n controller = controller1;\n }", "public WfController()\n {\n }", "public Controller() {\n\n lastSearches = new SearchHistory();\n\n }", "private ClientController(){\n\n }", "public LoginController() {\r\n }", "public PersonasController() {\r\n }", "private void initBefore() {\n // Crear Modelo\n model = new Model();\n\n // Crear Controlador\n control = new Controller(model, this);\n\n // Cargar Propiedades Vista\n prpView = UtilesApp.cargarPropiedades(FICHERO);\n\n // Restaurar Estado\n control.restaurarEstadoVista(this, prpView);\n\n // Otras inicializaciones\n }", "public StoreController() {\n }", "public ConsoleController() {\n\t\tcommandDispatch = new CommandDispatch();\n\t}", "public LoginController() {\r\n\r\n }", "public final void init(final MainController mainController) {\n this.mainController = mainController;\n }", "public SMPFXController() {\n\n }", "public Controller()\r\n {\r\n fillBombs();\r\n fillBoard();\r\n scoreBoard = new ScoreBoard();\r\n }", "public GUIController() {\n\n }", "public void init(){\n this.controller = new StudentController();\n SetSection.displayLevelList(grade_comp);\n new DesignSection().designForm(this, editStudentMainPanel, \"mini\");\n }", "public void init(final Controller controller){\n Gdx.app.debug(\"View\", \"Initializing\");\n \n this.controller = controller;\n \n //clear old stuff\n cameras.clear();\n \n //set up renderer\n hudCamera = new OrthographicCamera();\n hudCamera.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\n \n batch = new SpriteBatch();\n igShRenderer = new ShapeRenderer();\n shapeRenderer = new ShapeRenderer();\n \n //set up stage\n stage = new Stage();\n \n //laod cursor\n cursor = new Pixmap(Gdx.files.internal(\"com/BombingGames/WurfelEngine/Core/images/cursor.png\"));\n\n controller.getLoadMenu().viewInit(this);\n \n initalized = true;\n }", "@PostConstruct\n public void init() {\n WebsocketController.getInstance().setTemplate(this.template);\n try {\n\t\t\tthis.chatController = ChatController.getInstance();\n } catch (final Exception e){\n LOG.error(e.getMessage(), e);\n }\n }", "public ControllerTest()\r\n {\r\n }", "public SearchedRecipeController() {\n }", "public FilmOverviewController() {\n }", "public CreditPayuiController() {\n\t\tuserbl = new UserController();\n\t}", "private void initComponents() {\r\n\t\temulator = new Chip8();\r\n\t\tpanel = new DisplayPanel(emulator);\r\n\t\tregisterPanel = new EmulatorInfoPanel(emulator);\r\n\t\t\r\n\t\tcontroller = new Controller(this, emulator, panel, registerPanel);\r\n\t}", "public RootLayoutController() {\n }", "public MehController() {\n updateView(null);\n }", "public Controller(int host) {\r\n\t\tsuper(host);\r\n\t}", "public WorkerController(){\r\n\t}", "public TipoInformazioniController() {\n\n\t}", "private void initializeMealsControllers() {\n trNewPetMeal = MealsControllersFactory.createTrNewPetMeal();\n trObtainAllPetMeals = MealsControllersFactory.createTrObtainAllPetMeals();\n trDeleteMeal = MealsControllersFactory.createTrDeleteMeal();\n trUpdateMeal = MealsControllersFactory.createTrUpdateMeal();\n }", "public ProductOverviewController() {\n }", "public ProduktController() {\r\n }", "public Controller(ViewIF view) {\n\t\tthis.view = view;\n\t\tthis.dao = new DAO();\n\t\tthis.stats = new Statistics(this.dao);\n\t\tthis.gameStarted = false;\n\t}", "private void initializeMedicationControllers() {\n trNewPetMedication = MedicationControllersFactory.createTrNewPetMedication();\n trObtainAllPetMedications = MedicationControllersFactory.createTrObtainAllPetMedications();\n trDeleteMedication = MedicationControllersFactory.createTrDeleteMedication();\n trUpdateMedication = MedicationControllersFactory.createTrUpdateMedication();\n }", "public PersonLoginController() {\n }", "public PremiseController() {\n\t\tSystem.out.println(\"Class PremiseController()\");\n\t}", "public TaxiInformationController() {\n }", "public LoginController() {\n\t\treadFromFile();\n\t\t// TODO Auto-generated constructor stub\n\t}", "public Controller(){\n initControl();\n this.getStylesheets().addAll(\"/resource/style.css\");\n }", "public CreateDocumentController() {\n }", "public ControllerRol() {\n }", "Main ()\n\t{\n\t\tview = new View ();\t\t\n\t\tmodel = new Model(view);\n\t\tcontroller = new Controller(model, view);\n\t}", "public Controller () {\r\n puzzle = null;\r\n words = new ArrayList <String> ();\r\n fileManager = new FileIO ();\r\n }", "public void init() {\n \n }", "public Controller() {\n\t\tdoResidu = false;\n\t\tdoTime = false;\n\t\tdoReference = false;\n\t\tdoConstraint = false;\n\t\ttimeStarting = System.nanoTime();\n\t\t\n\t\tsetPath(Files.getWorkingDirectory());\n\t\tsetSystem(true);\n\t\tsetMultithreading(true);\n\t\tsetDisplayFinal(true);\n\t\tsetFFT(FFT.getFastestFFT().getDefaultFFT());\n\t\tsetNormalizationPSF(1);\n\t\tsetEpsilon(1e-6);\n\t\tsetPadding(new Padding());\n\t\tsetApodization(new Apodization());\n\n\t\tmonitors = new Monitors();\n\t\tmonitors.add(new ConsoleMonitor());\n\t\tmonitors.add(new TableMonitor(Constants.widthGUI, 240));\n\n\t\tsetVerbose(Verbose.Log);\n\t\tsetStats(new Stats(Stats.Mode.NO));\n\t\tsetConstraint(Constraint.Mode.NO);\n\t\tsetResiduMin(-1);\n\t\tsetTimeLimit(-1);\n\t\tsetReference(null);\n\t\tsetOuts(new ArrayList<Output>());\n\t}", "public OrderInfoViewuiController() {\n\t\tuserbl = new UserController();\n\t}", "public SessionController() {\n }", "@Override\n\tprotected void setController() {\n\t\t\n\t}", "public MainFrameController() {\n }", "public LicenciaController() {\n }", "public NearestParksController() {\n this.bn = new BicycleNetwork();\n this.pf = new LocationFacade();\n // this.bn.loadData();\n }", "public MotorController() {\n\t\tresetTachometers();\n\t}", "public AwTracingController() {\n mNativeAwTracingController = nativeInit();\n }", "public Controller(IView view) {\n\t\tengine = new Engine(this);\n\t\tclock = new Clock();\n\t\tsoundEmettor = new SoundEmettor();\n\t\tthis.view = view;\n\t}", "public HomeController() {\n }", "public HomeController() {\n }" ]
[ "0.8125658", "0.78537387", "0.78320265", "0.776199", "0.776199", "0.76010174", "0.74497247", "0.7437837", "0.7430714", "0.742303", "0.74057597", "0.7341963", "0.7327749", "0.72634363", "0.72230434", "0.7102504", "0.70575505", "0.69873077", "0.69721675", "0.6944077", "0.6912564", "0.688884", "0.6881247", "0.68776786", "0.68723065", "0.6868163", "0.68672407", "0.6851157", "0.6846883", "0.6840198", "0.68382674", "0.68338853", "0.6795918", "0.67823315", "0.6766882", "0.67650586", "0.6750353", "0.6749068", "0.6745654", "0.6743223", "0.67401046", "0.6727867", "0.6723379", "0.6695514", "0.6689967", "0.66892517", "0.66791916", "0.6677345", "0.66644365", "0.6664202", "0.66616154", "0.66532296", "0.66481894", "0.6644939", "0.6639398", "0.6633576", "0.66312426", "0.662608", "0.66258574", "0.66105217", "0.6606984", "0.66024727", "0.6597095", "0.6580141", "0.65786153", "0.65752715", "0.6574144", "0.6551536", "0.655142", "0.6547574", "0.6545647", "0.6541474", "0.6529243", "0.65284246", "0.6525593", "0.6523344", "0.6519832", "0.65134746", "0.65079254", "0.6497635", "0.64952356", "0.6493943", "0.6492926", "0.6483847", "0.6483173", "0.648183", "0.6479119", "0.64789915", "0.6476928", "0.64734083", "0.6465272", "0.64616114", "0.6444024", "0.64379543", "0.6431962", "0.64292705", "0.6425357", "0.6417148", "0.6416786", "0.64161026", "0.64161026" ]
0.0
-1
nastavenie komponentov ktore sa zobrazia v scene
public void setUpEditStage(){ solvableCircle = solvableCircleComponents(); Circle wCircle = whiteButtonComponents(); whiteCellButton = new Button("", wCircle); whiteCellButton.getStyleClass().add("edit-buttons"); whiteCellButton.setOnAction(e-> whiteCellButtonAction()); Circle bCircle = blackButtonComponents(); blackCellButton = new Button("", bCircle); blackCellButton.getStyleClass().add("edit-buttons"); blackCellButton.setOnAction(e-> blackCellButtonAction()); removeCellButton = new Button(""); removeCellButton.getStyleClass().add("edit-buttons"); removeCellButton.setOnAction(e-> removeCellButtonAction()); StackPane sp = plusButtonComponents(); plusButton = new Button("", sp); plusButton.getStyleClass().add("edit-buttons"); plusButton.setOnAction(e-> plusButtonAction()); Rectangle minusRect = minusButtonComponents(); minusButton = new Button("", minusRect); minusButton.getStyleClass().add("edit-buttons"); minusButton.setOnAction(e-> minusButtonAction()); leftButtons = new HBox(); leftButtons.setPrefHeight(25); leftButtons.setSpacing(10); leftButtons.getChildren().addAll(whiteCellButton, blackCellButton, removeCellButton); rightButtons = new HBox(); rightButtons.setPrefHeight(25); rightButtons.setSpacing(10); rightButtons.getChildren().addAll(plusButton, minusButton); topPane = new BorderPane(); topPane.setStyle("-fx-background-color: linear-gradient(to right, #2b5876, #4e4376);"); topPane.setRight(rightButtons); topPane.setCenter(solvableCircle); topPane.setLeft(leftButtons); getBack.getStyleClass().addAll("bottomButtonStyle", "bottomButtonStyle-edit"); getBack.setOnAction(e-> getBackButtonAction()); check.getStyleClass().addAll("bottomButtonStyle", "bottomButtonStyle-edit"); check.setOnAction(e-> checkButtonAction()); save.getStyleClass().addAll("bottomButtonStyle", "bottomButtonStyle-edit"); save.setOnAction(e-> saveButtonAction()); bottomPane = new BorderPane(); bottomPane.setPrefHeight(50); bottomPane.setLeft(getBack); bottomPane.setCenter(check); bottomPane.setRight(save); root = new BorderPane(); root.getStyleClass().add("edit-root"); root.setTop(topPane); root.setCenter(editPane); root.setBottom(bottomPane); Scene scene = new Scene(root , 700, 500); scene.getStylesheets().addAll("shirokuro/Main/Styles_Images/ButtonStyles.css", "shirokuro/Main/Styles_Images/Background.css", "shirokuro/Main/Styles_Images/PaneBG.css", "shirokuro/Main/Styles_Images/TextStyles.css", "shirokuro/Main/Styles_Images/CellStyles.css"); this.getIcons().add(new Image("shirokuro/Main/Styles_Images/Images/logo.png")); this.setTitle("Shirokuro - Level Edit"); this.setResizable(false); this.setScene(scene); editPane.paint(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void openGamePane() {\n\t\tParent root;\n\t\ttry {\n\t\t\tFXMLLoader loader = new FXMLLoader(getClass().getResource(GAMEPANELOCATION));\n\t\t\tloader.setController(this);\n\t\t\troot = loader.load();\n\t\t\tScene scene = new Scene(root);\n\t\t\tStage stage = new Stage();\n\t\t\tstage.setScene(scene);\n\t\t\tstage.show();\n\t\t} catch (IOException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tgamePane.setBackground(new Background(new BackgroundFill(new Color(195/256.0,222/256.0,250/256.0,1),CornerRadii.EMPTY, Insets.EMPTY)));\n\t\tgameObjects=new HashMap<Integer,GameObjectVisualComponent>();\n\t\tpodium=new ArrayList<Text>();\n\t\tpodium.add(new Text(gamePane.getWidth()-100,15,\"TOP\"));\n\t\tgamePane.getChildren().add(podium.get(0));\n\t}", "public PantallaMenuPrincipalJuego(DuelEmpire_CardGame juego) {\n super(juego);\n this.juego = juego;\n musica = juego.getManager().get(\"music/MenuMusic.mp3\");\n skin = new Skin(Gdx.files.internal(\"skin/uiskin.json\"));\n camera = new OrthographicCamera();\n ancho = Gdx.graphics.getWidth();\n alto = Gdx.graphics.getHeight();\n }", "public GameManager() {\n\t\tobjects.add(new Player(4, 4, ComponentManager.getComponent(ComponentManager.ComponentType.AABB), ProjectileManager.ProjectileType.Bullet, ComponentManager.ComponentType.AABB));\n\t\t\n\t\n\t\t\n\t\tobjects.add(new Platform(new AABBComponent()));\n\t\t\n\t\tloadLevel(\"/levelImage2_0.png\");\n\t\t\n\t\t//мусор\n\t\t\n\t\t//p1 = null;\n\t\t\n\t\t\n\t\tPBParticle p1 = null;\n\t\tPBParticle p2 = null;\n\t\t\n\t\tPLink l1 = null;\n\t\t\n\t\tnumOfPart = 48;\n\t\t\n\t\tint colNum = numOfPart / 3;\n\t\t\n\t\t\n\t\tfor(int i = 0; i < numOfPart; i ++)\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\tp2 = p1; \n\t\t\t\n\t\t\tp1 = new PBParticle( (float)((4 + i % colNum) * TS),(float) ((4 + i / colNum) * TS), (float)(Math.random()*5), (float)(Math.random()*5), 1, new CircleComponent());\n\t\t\t\n\t\t\t\n\t\t\t//связи диагональ левый верхний - правый нижний\n\t\t\t/*if(i / colNum > 0 && i % colNum < colNum - 1)//не первая строка и не последняя чатсица в строке\n\t\t\t{\n\t\t\t\tl1 = new PLink(p1, (PBParticle)objects.get(objects.size() - colNum + 1), 20, this.stiffness);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tsdlinks.add(l1);\n\t\t\t}\n\t\t\t\n\t\t\t//связи диагональ правый верхний - левый нижний\n\t\t\t\n\t\t\tif(i / colNum > 0 && i % colNum > 0) \n\t\t\t{\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tl1 = new PLink(p1, (PBParticle)objects.get(objects.size() - colNum - 1), 20, this.stiffness);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tmdlinks.add(l1);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//горизонтальные связи\n\t\t\t\n\t\t\t//первая итерация для создания связи не подходит\n\t\t\t\n\t\t\t//также для создания горизонтальной связи не подходит итерация\n\t\t\t//когда p1 на новой строке, а p2 а старой\n\t\t\t\n\t\t\t\n\t\t\tif(p2 != null && (p1.getPosY() - p2.getPosY()) == 0)\n\t\t\t{\n\t\t\t\tl1 = new PLink(p1, p2, 20, this.stiffness);\n\t\t\t\t\n\t\t\t\thlinks.add(l1);\n\t\t\t}\n\t\t\t\n\t\t\t//вертикальные связи\n\t\t\t\n\t\t\t//проверить не ноль ли при делении i на количество столбцов\n\t\t\t//если не ноль то я должен выбрать из массива ссылок элемент \n\t\t\t//порядковый номер которого \n\t\t\tif(i / colNum != 0) //не первая строка\n\t\t\t{\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tl1 = new PLink(p1, (PBParticle)objects.get(objects.size() - colNum ), 20, this.stiffness);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tvlinks.add(l1);\n\t\t\t}*/\n\t\t\t\n\t\t\t\n\t\t\tobjects.add(p1);\n\t\t}\n\t\t\n\n\t\t\n\t\t\n\t\t//p1 = new PBParticle( 12 * TS, 1 * TS, 0, 1, 1);\n\t\t//objects.add(p1);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcamera = new Camera(\"player\");\n\t}", "@Override\r\n public void start(Stage primaryStage) throws Exception{\n primaryStage.setTitle(\"Color switch\");\r\n Gameplay obj1 = new Gameplay();\r\n obj1.mainmenu(primaryStage);\r\n// pane.getChildren().add(new Polygon(10,20,30,10,20,30));\r\n\r\n }", "private void initializeGUIComponents() {\n\t\tmyScene = new Scene(myRoot);\n ButtonConditionManager.getInstance().beginListeningToScene(myScene);\n\t\tmyStage.setTitle(\"MY PLAYER VIEW\");\n\t\tmyStage.setScene(myScene);\n\t\tmyStage.show();\n\t\tmyCanvas = new GameCanvas();\n\t\tmyRoot.getChildren().add(myCanvas.getNode());\n\t\tmyCanvas.getNode().toBack();\n\t}", "@Override\n\tpublic void start(Stage stage) throws Exception \n\t{\n\n /* Game initialisation */\n Position.maxX = 520;\n \n\t\tGame game = new Game(new LinkedList<PlayerInterface>(), 600, 600);\n\n\n\t\t/* GUI initialisation */\n\t\t\n\t\t// Nom de la fenetre\n stage.setTitle(\"BalleAuPrisonnier\");\n\n Group root = new Group();\n Scene scene = new Scene(root);\n \n // On cree le terrain de jeu et on l'ajoute a la racine de la scene\n Field gameField = new Field(scene, game);\n root.getChildren().add(gameField);\n for(PlayerInterface p : gameField.game.getJoueurs()){\n \troot.getChildren().add(((GraphicPlayer)p).sprite);\n }\n\n // On ajoute la scene a la fenetre et on affiche\n stage.setScene(scene);\n stage.show();\n\t}", "@Override\n public void show() {\n\n skin = new Skin(Gdx.files.internal(\"menu/menu.json\"),new TextureAtlas(\"menu/menu.pack\"));\n\n Image background = new Image(skin, \"menuscreen\");\n background.setPosition(0,0);\n stage.addActor(background);\n\n Image gameOver = new Image(skin,\"gameOver\");\n gameOver.setPosition( ( 800 - 484)/2 , (480 - 345)/2 ) ;\n stage.addActor(gameOver);\n\n Button gameOverSim = new Button(skin,\"gameOverSim\");\n gameOverSim.setPosition(265,100);\n stage.addActor(gameOverSim);\n\n Button gameOverNao = new Button(skin,\"gameOverNao\");\n gameOverNao.setPosition(425,100);\n stage.addActor(gameOverNao);\n\n gameOverSim.addListener(new ClickListener() {\n @Override\n public void clicked(InputEvent event, float x, float y) {\n // TO DO passar o level como parametro no construtor\n selecionado.play();\n ((Game) Gdx.app.getApplicationListener()).setScreen(new PlayScreen(game, level));\n dispose();\n }\n });\n\n gameOverNao.addListener(new ClickListener() {\n @Override\n public void clicked(InputEvent event, float x, float y) {\n selecionado.play();\n ((Game) Gdx.app.getApplicationListener()).setScreen(new MenuScreen(game));\n dispose();\n }\n });\n\n }", "public void act() \n {\n String worldname = getWorld().getClass().getName();\n if (worldname == \"Level0\")\n setImage(new GreenfootImage(\"vibranium.png\"));\n else if (worldname == \"Level1\")\n setImage(rocket.getCurrentImage());\n setLocation(getX()-8, getY()); \n if (getX() == 0) \n {\n getWorld().removeObject(this);\n }\n \n }", "private void inizializzazione()\n {\n //Costruzione della Istanza display\n display = new Display(titolo,larghezza,altezza);\n \n /*Viene aggiunto il nostro gestore degli input da tastiera\n * alla nostra cornice.*/\n display.getCornice().addKeyListener(gestoreTasti);\n display.getCornice().addMouseListener(gestoreMouse);\n display.getCornice().addMouseMotionListener(gestoreMouse);\n display.getTelaGrafica().addMouseListener(gestoreMouse);\n display.getTelaGrafica().addMouseMotionListener(gestoreMouse);\n \n //Codice temporaneo per caricare la nostra immagine nel nostro programma\n /*testImmagine = CaricatoreImmagini.caricaImmagini(\"/Textures/Runner Stickman.png\");*/\n \n //Inizializzazione dell'attributo \"foglio\". Gli viene passato come parametro \n //\"testImmagine\" contenente l'immagine del nostro sprite sheet.\n /*foglio = new FoglioSprite(testImmagine);*/\n \n /*Inizializzazione della classe Risorse.*/\n Risorse.inizializzazione();\n \n maneggiatore = new Maneggiatore(this);\n /*Inizializzazione Camera di Gioco*/\n camera = new Camera(maneggiatore,0,0);\n \n /*Inizializzazione degli stati di gioco.*/\n statoMenu = new StatoMenù(maneggiatore);\n Stato.setStato(statoMenu);\n }", "private void init() {\n display = new Display(title, getWidth(), getHeight()); \n Assets.init();\n player = new Player(getWidth() / 2 - 50, getHeight() - 50, 100, 30, this);\n rayo = new Rayo(getWidth() / 2 - 10, player.y - player.height , 10, 30, 0, 0, this);\n borrego = new Borrego(-80, 60 , 50, 20, 0, 0, this);\n generateEnemies();\n generateFortalezas();\n bombas= new ArrayList<Bomba>();\n \n \n display.getJframe().addKeyListener(keyManager);\n }", "public Controller (Salle salle) {\n double marge = 30;\n this.salle = salle;\n \n cSalle = salle.afficher();\n cSalle.setTranslateX(marge);\n cSalle.setTranslateY(marge);\n cSalle.setController(this);\n\n cPanel = new ControllerPanel();\n cPanel.setTranslateY(salle.getHauteur() + (3 * marge));\n\n creerObstacle = new ArrayList<>();\n pointObstacle = new ArrayList<>();\n ligneObstacle = new ArrayList<>();\n suppressionObstacle = false;\n \n // Event utilisé pour ajouter des Personnes, Obstacles en lors d'un clique.\n // Seulement lorsque la simulation n'est pas lancée\n cSalle.getSalleGraphique().setOnMouseClicked(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n double rayon = new Personne().getRayon();\n double x = event.getX();\n double y = event.getY();\n if((x+marge > marge+rayon && x < salle.getLargeur()-rayon)){\n if(!salle.isRunning() && !creationObstacle && !suppressionObstacle){\n cSalle.afficherPersonne(cSalle.createPersonne(x,y));\n } else if(!salle.isRunning() && creationObstacle && !suppressionObstacle){\n Circle c = new Circle(x+marge, y+marge, 10);\n getChildren().add(c);\n pointObstacle.add(c);\n if(pointObstacle.size()>1){\n Line l = new Line(pointObstacle.get(pointObstacle.size()-2).getCenterX(),pointObstacle.get(pointObstacle.size()-2).getCenterY() , event.getX()+marge, event.getY()+marge);\n getChildren().add(l);\n ligneObstacle.add(l);\n }\n if(pointObstacle.size()>2){\n if(pointObstacle.size()>3) getChildren().remove(getChildren().get(getChildren().size()-3));\n Line l = new Line(event.getX()+marge, event.getY()+marge, pointObstacle.get(0).getCenterX(), pointObstacle.get(0).getCenterY());\n getChildren().add(l);\n ligneObstacle.add(l);\n }\n \n creerObstacle.add(new Point(event.getX(), event.getY()));\n }\n }\n }\n });\n\n // Event utilisé pour supprimer un obstacle en cliquant.\n // Seulement lorsque la simulation n'est pas lancée\n this.setOnMouseClicked(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n if(!salle.isRunning() && suppressionObstacle){\n for(ControllerObstacle o : cSalle.getListObstacles()){\n if(o.contains(event.getX()-marge, event.getY()-marge)){\n salle.removeObstacle(o.getObstacle()); \n suppressionObstacle = false;\n cPanel.visibility(true);\n cPanel.getGroupeGraphe().getSelectedToggle().setSelected(false);\n cPanel.getEnleverGrapheRB().setSelected(true);\n cSalle.cacherGraphe();\n }\n }\n }\n }\n });\n\n // Event qui lance la simulation lorsque l'utilisateur appuie sur le bouton play.\n // Prends en compte les différents paramètres (checkbox) de gestion des collisions.\n cPanel.getPlayButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n salle.setVitessePersonnes(cPanel.getVitesseValue());\n if(cPanel.getCollisionStatus()){\n salle.play(true);\n }\n else\n salle.play(false);\n if(salle.isRunning())\n cPanel.setLoopTimer(0);\n }\n });\n\n // Event qui met en pause la simulation lorsque l'utilisateur clique sur le bouton pause.\n cPanel.getPauseButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n salle.pause();\n cPanel.setLoopTimer(1);\n }\n });\n\n // Event qui supprime toutes les personnes de la salle et stoppe la simulation lorsque l'utilisateur clique sur clear.\n cPanel.getClearButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n salle.removeAllPersonne();\n cPanel.setLoopTimer(2);\n }\n });\n\n // Event qui affiche ou cache le graphe des chemins les plus courts lorsque l'utilisateur active ou désactive la checkbox correspondante.\n cPanel.getGrapheRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n salle.initialisationGrapheAvecAffichage(\"\");\n }\n });\n\n cPanel.getGrapheDiagonaleRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n salle.initialisationGrapheAvecAffichage(\"Diagonale\");\n }\n });\n\n cPanel.getGrapheCartesienRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n salle.initialisationGrapheAvecAffichage(\"Cartesien\");\n }\n });\n\n cPanel.getGraphePhysiqueRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n salle.initialisationGrapheAvecAffichage(\"Physique\");\n }\n });\n\n cPanel.getEnleverGrapheRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n }\n });\n\n // Event qui ouvre un popup pour ajouter un nombre de personnes définis lorsque l'utilisateur clique sur le bouton correspondant.\n cPanel.getAddPersonButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n if(!salle.isRunning())\n createPopup(\"Personne\");\n }\n });\n\n // Event qui permet d'activer l'option de creation d'obstacle lorsque l'utilisateur clique sur le bouton correspondant.\n cPanel.getAddObstacleButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n if(!salle.isRunning()){\n creationObstacle = true;\n cPanel.visibility(false);\n }\n }\n });\n\n // Event qui permet de valider la creation d'un obstacle lorsque l'utilisateur clique sur le bouton valider.\n cPanel.getValiderObstacleButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n boolean intersec = false;\n double rayon = new Personne().getRayon();\n for(int i=0;i<pointObstacle.size() && !intersec;i++){\n Point A = new Point(pointObstacle.get(i).getCenterX()-marge,pointObstacle.get(i).getCenterY()-marge);\n Point B;\n if(i==pointObstacle.size()-1) B = new Point(pointObstacle.get(0).getCenterX()-marge,pointObstacle.get(0).getCenterY()-marge);\n else B = new Point(pointObstacle.get(i+1).getCenterX()-marge,pointObstacle.get(i+1).getCenterY()-marge);\n if(salle.intersecObstacle(A, B)) {\n intersec = true;\n }\n }\n creationObstacle = false;\n cPanel.visibility(true);\n if(!intersec){\n if(!creerObstacle.isEmpty() && creerObstacle.size()>2){\n Obstacle obstacle = new ObstaclePolygone(creerObstacle);\n ControllerObstacle obstacleGraphique = obstacle.afficher();\n salle.addObstacle(obstacle);\n cSalle.afficherControllerObstacle(obstacleGraphique);\n List<ControllerObstacle> obstacles = cSalle.getListObstacles();\n for(ControllerObstacle o : obstacles){\n if(!obstacleGraphique.equals(o)){\n if(obstacleGraphique.contains(o.getObstacle().getListePointsGraphiques().get(0).getX(),o.getObstacle().getListePointsGraphiques().get(0).getY())) salle.removeObstacle(o.getObstacle());\n }\n }\n cPanel.getGroupeGraphe().getSelectedToggle().setSelected(false);\n cPanel.getEnleverGrapheRB().setSelected(true);\n cSalle.cacherGraphe();\n }\n }\n creerObstacle.clear();\n for(Circle c : pointObstacle) getChildren().remove(c);\n for(Line l : ligneObstacle) getChildren().remove(l);\n pointObstacle.clear();\n ligneObstacle.clear();\n }\n });\n // Event qui permet d'activer l'option pour supprimer un obstacle lorsque l'utilisateur clique sur le bouton correspondant.\n cPanel.getSupprimerObstacleButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n if(!salle.isRunning() && !salle.getListObstacles().isEmpty()){\n suppressionObstacle = true;\n cPanel.visibility(false);\n cPanel.getValiderObstacleButton().setVisible(false);\n }\n }\n });\n\n getChildren().addAll(cSalle, cPanel);\n }", "void setup() {\n size(2048, 2048); //sets size of canvas\n \n //names entities and their position\n player = new Sprite(tankURL, 100, 400, 100, 100);\n smbulletbase = new Sprite(tankbulletURL, 100, 400, 100, 100);\n enemyBase = new Sprite(enemytankURL, 100, 400, 100, 100);\n medkit = new Sprite(healthURL, 100, 400, 100, 100);\n kaboomBase = new Sprite(explosionURL, 100, 400, 100, 100);\n minigun = new Sprite(minigunURL, 100, 400, 100, 100);\n coilgun = new Sprite(coilgunURL, 100, 400, 100, 100);\n \n \n //sets size of some pictures\n smbulletbase.setSize(50, 50);\n minigun.setSize(150,150);\n coilgun.setSize(150,150);\n \n //initialization of scene switcher library\n scsw = new SceneSwitcher();\n scsw.addScene(\"Title\", new Scene(() -> drawTitle()));\n scsw.addScene(\"Game\", new Scene(() -> drawGame()));\n scsw.addScene(\"Death\", new Scene(() -> drawDeath()));\n \n \n //sets players front angle\n player.frontAngle(90);\n \n //sets up audio library\n ktAudio = new KTAudioController(this);\n clickEffect = new KTSound(this, gunshotURL);\n ktAudio.add(clickEffect);\n \n\n}", "public void lancementJeuClassique() {\n\t\ttry {\n\t\t\tstage = (Stage)buttonRetour.getScene().getWindow();\n\t\t\tsetDynamicPane(FXMLLoader.load(getClass().getResource(\"FenetreLancementJeu.fxml\")));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public Vencimientos() {\n initComponents();\n \n \n }", "@Override\npublic void populateScene() {\n\t\n}", "public VentanaJuego(ArrayList<Jugador> jugadores) {\n initComponents();\n //Esto hace que no se redimensione la pantalla\n this.setResizable(false);\n //Establece del titulo de la ventana\n this.setTitle(\"Picko Picko Mazorkitos\");\n //Coge el icono del jLabell principal\n this.jLabel11.setIcon(new ImageIcon(\"res/bgGame.jpg\"));\n //Coge la imagen logo\n this.logo.setIcon(new ImageIcon(\"res/logo.png\"));\n //Dimensiones de la pantalla\n this.jLabel11.setSize(1250, 700);\n //Localización de la pantalla\n this.jLabel11.setLocation(-110, 0);\n\n // Añade el ArrayList de los jugador al turno\n this.turno = new TurnoJugador(jugadores);\n \n // Añade el JTextArea a textarea\n this.textarea = new Mensajes(jTextArea1);\n textarea.hola();\n\n //Mostrar las imagenes de los dados gracias al Enum de CaraDado\n this.dado1.setIcon(CaraDado.CARA6.getImagen());\n this.dado2.setIcon(CaraDado.CARA1.getImagen());\n this.dado3.setIcon(CaraDado.CARA2.getImagen());\n this.dado4.setIcon(CaraDado.CARA3.getImagen());\n this.dado5.setIcon(CaraDado.CARA4.getImagen());\n this.dado6.setIcon(CaraDado.CARA5.getImagen());\n this.dado7.setIcon(CaraDado.CARA6.getImagen());\n this.dado8.setIcon(CaraDado.CARA6.getImagen());\n\n //Mostrar las imagenes de las raciones gracias al Enum de Racion\n this.ficha1.setIcon(Racion.RACION21.getImagen());\n this.ficha2.setIcon(Racion.RACION22.getImagen());\n this.ficha3.setIcon(Racion.RACION23.getImagen());\n this.ficha4.setIcon(Racion.RACION24.getImagen());\n this.ficha5.setIcon(Racion.RACION25.getImagen());\n this.ficha6.setIcon(Racion.RACION26.getImagen());\n this.ficha7.setIcon(Racion.RACION27.getImagen());\n this.ficha8.setIcon(Racion.RACION28.getImagen());\n this.ficha9.setIcon(Racion.RACION29.getImagen());\n this.ficha10.setIcon(Racion.RACION30.getImagen());\n this.ficha11.setIcon(Racion.RACION31.getImagen());\n this.ficha12.setIcon(Racion.RACION32.getImagen());\n this.ficha13.setIcon(Racion.RACION33.getImagen());\n this.ficha14.setIcon(Racion.RACION34.getImagen());\n this.ficha15.setIcon(Racion.RACION35.getImagen());\n // FALTA AÑADIR LA FICHA 36 A LA VENTANAJUEGO\n //this.ficha16.setIcon(Racion.RACION36.getImagen());\n\n // MODIFICAR\n switch (jugadores.size()) {\n case 2:\n this.gamePlayer1.setText(jugadores.get(0).getNombreJugador());\n this.gamePlayer2.setText(jugadores.get(1).getNombreJugador());\n this.gamePlayer3.setVisible(false);\n this.gamePlayer4.setVisible(false);\n break;\n case 3:\n this.gamePlayer1.setText(jugadores.get(0).getNombreJugador());\n this.gamePlayer2.setText(jugadores.get(1).getNombreJugador());\n this.gamePlayer3.setText(jugadores.get(2).getNombreJugador());\n this.gamePlayer4.setVisible(false);\n break;\n case 4:\n this.gamePlayer1.setText(jugadores.get(0).getNombreJugador());\n this.gamePlayer2.setText(jugadores.get(1).getNombreJugador());\n this.gamePlayer3.setText(jugadores.get(2).getNombreJugador());\n this.gamePlayer4.setText(jugadores.get(3).getNombreJugador());\n break;\n }\n\n }", "private BranchGroup getScene(){\n BranchGroup scene = new BranchGroup();\r\n\r\n // transformgroup zawierający robota oraz podłoże\r\n world = new TransformGroup();\r\n world.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\r\n world.setCapability(TransformGroup.ALLOW_CHILDREN_EXTEND);\r\n world.setCapability(TransformGroup.ALLOW_CHILDREN_READ);\r\n world.setCapability(TransformGroup.ALLOW_CHILDREN_WRITE);\r\n TransformGroup robotTg;\r\n\r\n // nasz robot pobrany z klasy Robot\r\n robotTg = robot.getGroup();\r\n robotTg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\r\n world.addChild(robotTg);\r\n\r\n // tworzenie scian\r\n float szerokoscScian = 10f;\r\n makeWalls(szerokoscScian);\r\n\r\n // tworzenie podłoża\r\n TransformGroup ground = new TransformGroup();\r\n Shape3D gr = new MyShapes().makeGround(new Point3f(szerokoscScian, 0f, szerokoscScian),\r\n new Point3f(szerokoscScian, 0f, -szerokoscScian), new Point3f(-szerokoscScian, 0f, -szerokoscScian),\r\n new Point3f(-szerokoscScian, 0f, szerokoscScian));\r\n gr.setUserData(new String(\"ground\"));\r\n Appearance appGround = new Appearance();\r\n appGround.setTexture(createTexture(\"grafika/floor.jpg\"));\r\n gr.setAppearance(appGround);\r\n\r\n // detekcja kolizji dla ziemi\r\n CollisionDetector collisionGround = new CollisionDetector(gr, new BoundingSphere(), this, robot);\r\n ground.addChild(gr);\r\n world.addChild(collisionGround);\r\n world.addChild(ground);\r\n\r\n // światła\r\n Color3f light1Color = new Color3f(1.0f, 1.0f, 1.0f);\r\n Vector3f light1Direction = new Vector3f(4.0f, -7.0f, -12.0f);\r\n BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 100.0);\r\n\r\n DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction);\r\n light1.setInfluencingBounds(bounds);\r\n scene.addChild(light1);\r\n\r\n // obiekt do podnoszenia\r\n object = new Sphere(0.15f, robot.createAppearance(new Color3f(Color.ORANGE)));\r\n object.getShape().setUserData(new String(\"object\"));\r\n objectTransform = new Transform3D();\r\n objectTransform.setTranslation(objPos);\r\n objectTg = new TransformGroup(objectTransform);\r\n objectTg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\r\n objectTg.addChild(object);\r\n objectGroup = new BranchGroup();\r\n objectGroup.setCapability(BranchGroup.ALLOW_DETACH);\r\n objectGroup.addChild(objectTg);\r\n world.addChild(objectGroup);\r\n\r\n // klasa behavior która służy do obsługiwania klawiatury\r\n Moving moving = new Moving(robot);\r\n moving.setSchedulingBounds(bounds);\r\n world.addChild(moving);\r\n\r\n // klasa behavior która odświeża się 60 razy na sekundę i odpowiada ona np. za nagrywanie, odtworzenie nagrania\r\n // symulowanie grawitacji\r\n loop = new GameLoop(this, robot);\r\n loop.setSchedulingBounds(bounds);\r\n world.addChild(loop);\r\n\r\n // detekcja kolizji dla obiektu\r\n CollisionDetector collisionObject = new CollisionDetector(object.getShape(), new BoundingSphere(new Point3d(), 0.15), this, robot);\r\n world.addChild(collisionObject);\r\n\r\n scene.addChild(world);\r\n\r\n scene.compile();\r\n return scene;\r\n }", "public void act() \r\n {\n if(getOneIntersectingObject(Player.class)!=null)\r\n {\r\n if(MenuWorld.gamemode == 1)\r\n //marcheaza regenerarea labirintului(trecere la nivelul urmator in Modul Contra Timp)\r\n TAworld.shouldRegen=true;\r\n else\r\n { \r\n //reseteaza variabilele care tin de modul de joc\r\n MenuWorld.gamemode=-1;\r\n MenuWorld.isPlaying=false;\r\n for(int i=0;i<4;i++)\r\n ItemCounter.gems_taken[i]=0;\r\n \r\n //arata fereastra de castig \r\n PMworld.shouldShowVictoryWindow=true;\r\n }\r\n \r\n }\r\n \r\n }", "private void initPlayModeController() {\n playMode.setOnMouseClicked(event -> {\n MasterMindMain mm = null;\n try { mm = new MasterMindMain(); }\n catch (Exception e) { e.printStackTrace(); }\n mm.start(SimulatorMain.stage);\n });\n playMode.setOnMouseEntered(event -> { playMode.setGraphic(new Circle(5)); });\n playMode.setOnMouseExited(event -> { playMode.setGraphic(null); });\n }", "@Override\n\tpublic void create() {\n\t\tGdx.gl20.glClearColor(1, 1, 1, 1);\n\n\t\t// instancia batch, asset manager e ambiente 3D\n\t\tmodelBatch = new ModelBatch();\n\t\tassets = new AssetManager();\n\t\tambiente = new Environment();\n\t\tambiente.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f));\n\t\tambiente.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));\n\n\t\t// configura a câmera\n\t\tfloat razaoAspecto = ((float) Gdx.graphics.getWidth()) / Gdx.graphics.getHeight();\n\t\tcamera = new PerspectiveCamera(67, 480f * razaoAspecto, 480f);\n\t\tcamera.position.set(1f, 1.75f, 3f);\n\t\tcamera.lookAt(0, 0.35f, 0);\n\t\tcamera.near = 1f;\n\t\tcamera.far = 300f;\n\t\tcamera.update();\n\t\tcameraController = new CameraInputController(camera);\n\t\tGdx.input.setInputProcessor(cameraController);\n\n\t\t// solicita carregamento dos 2 modelos 3D da cena\n\t\tassets.load(\"caldeirao.obj\", Model.class);\n\t\tassets.load(\"caldeirao-jogos.obj\", Model.class);\n\t\tassets.load(\"caldeirao-love.obj\", Model.class);\n\t\tassets.load(\"fogueira.obj\", Model.class);\n\n\t\t// instancia e configura 2 tipos de renderizadores de partículas:\n\t\t// 1. Billboards (para fogo)\n\t\t// 2. PointSprites (para bolhas)\n\t\tBillboardParticleBatch billboardBatch = new BillboardParticleBatch(ParticleShader.AlignMode.Screen, true, 500);\n\t\tPointSpriteParticleBatch pointSpriteBatch = new PointSpriteParticleBatch();\n\t\tsistemaParticulas = new ParticleSystem();\n\t\tbillboardBatch.setCamera(camera);\n\t\tpointSpriteBatch.setCamera(camera);\n\t\tsistemaParticulas.add(billboardBatch);\n\t\tsistemaParticulas.add(pointSpriteBatch);\n\n\t\t// solicita o carregamento dos efeitos de partículas\n\t\tParticleEffectLoader.ParticleEffectLoadParameter loadParam = new ParticleEffectLoader.ParticleEffectLoadParameter(\n\t\t\t\tsistemaParticulas.getBatches());\n\t\tassets.load(\"fogo.pfx\", ParticleEffect.class, loadParam);\n\t\tassets.load(\"fogo-jogos.pfx\", ParticleEffect.class, loadParam);\n\t\tassets.load(\"fogo-love.pfx\", ParticleEffect.class, loadParam);\n\t\tassets.load(\"bolhas.pfx\", ParticleEffect.class, loadParam);\n\t\tassets.load(\"bolhas-jogos.pfx\", ParticleEffect.class, loadParam);\n\t\tassets.load(\"bolhas-love.pfx\", ParticleEffect.class, loadParam);\n\n\t\t// solicita carregamento da música\n\t\tmusica = Gdx.audio.newMusic(Gdx.files.internal(\"zelda-potion-shop.mp3\"));\n\n\t\taindaEstaCarregando = true;\n\t}", "public void GameInit() {\n ufot = new ArrayList();\n kuti = new Kuti();\n pelaaja = new Pelaaja();\n ufokuti = new UfoKuti();\n ufokuti.setVisible(false);\n kuti.setVisible(false);\n grafiikka = new Grafiikka(this);\n grafiikka.asetaKuvaRajahdykselle();\n grafiikka.asetaKuvaPelaajalle(grafiikka.pelaajaIcon(pelaaja), pelaaja);\n asetaUfotRiveihin();\n ufokutiInit();\n }", "public void spustPosluchace() {\n newGameButton.addActionListener(new ActionListener() {\n\n @Override\n public void actionPerformed(ActionEvent arg0) {\n\n // posli komunikaci at zalozi hru\n if (zalozenaHra == false) {\n gameConnectButton.setEnabled(false);\n newGameButton.setText(\"Zrus zalozeni\");\n zalozenaHra = true;\n komunikace.CreateGame();\n } else {\n gameConnectButton.setEnabled(true);\n newGameButton.setText(\"Zaloz hru\");\n zalozenaHra = false;\n komunikace.cancelGame();\n }\n\n }\n });\n\n gameConnectButton.addActionListener(new ActionListener() {\n\n @Override\n public void actionPerformed(ActionEvent e) {\n int polozka = listHer.getSelectedIndex();\n if (polozka >= 0) {\n newGameButton.setEnabled(false);\n gameConnectButton.setEnabled(false);\n komunikace.connectToGame(polozka);\n }\n\n }\n });\n\n this.addWindowListener(new WindowAdapter() {\n public void windowClosing(WindowEvent e) {\n komunikace.disconnect(\"f\");\n zalogujSkonci();\n }\n });\n\n }", "private Scene createMainMenuScene() {\n VBox root = new VBox();\n root.setId(\"pane\");\n root.setAlignment(Pos.CENTER);\n root.setSpacing(BUTTON_DISTANCE);\n\n Label lTitle = new Label(\"2048 Fx\");\n lTitle.setId(\"title-label\");\n root.getChildren().add(lTitle);\n\n Button bNewGame = new Button(\"New game\");\n bNewGame.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n Game.board.init();\n }\n });\n bNewGame.setId(\"c16\");\n root.getChildren().add(bNewGame);\n\n Button bLoadGame = new Button(\"Load game\");\n bLoadGame.setId(\"c256\");\n bLoadGame.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Load saving\");\n File directory = new File(\"./savegames\");\n if (!directory.exists()) {\n directory = new File(\"./\");\n }\n fileChooser.setInitialDirectory(directory);\n FileChooser.ExtensionFilter extFilter =\n new FileChooser.ExtensionFilter(\"Saved 2048 games\", \"*.saving\");\n fileChooser.getExtensionFilters().add(extFilter);\n File file = fileChooser.showOpenDialog(Game.stage);\n if (file != null) {\n Game.board.replay(file);\n }\n }\n });\n root.getChildren().add(bLoadGame);\n\n Button bSettings = new Button(\"Settings\");\n bSettings.setId(\"c4096\");\n bSettings.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n settingsMenu();\n }\n });\n root.getChildren().add(bSettings);\n\n Button bGenerate = new Button(\"Also\");\n bGenerate.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n\tGame.statBoard.statMenu();\n }\n });\n bGenerate.setId(\"c1024\");\n root.getChildren().add(bGenerate);\n\n Button bQuit = new Button(\"Quit\");\n bQuit.setId(\"c65536\");\n bQuit.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n FileHandler.saveSettings(Game.settings);\n Game.stage.close();\n }\n });\n root.getChildren().add(bQuit);\n Scene menuScene = new Scene(root, Game.WINDOW_SIZE_X, Game.WINDOW_SIZE_Y);\n menuScene.getStylesheets().\n addAll(this.getClass().getResource(\"menu.css\").toExternalForm());\n return menuScene;\n }", "@Override\n public void loadGame() {\n\n }", "public void start(Mainwindow scene) {\n //绑定controller\n view = scene;\n\n //初始化Log文件和Logger\n File logFile = new File(logPath + System.currentTimeMillis() + \".log\");\n try {\n logFile.createNewFile();\n System.out.println(\"Game record is saved in \" + logFile.getAbsolutePath());\n }\n catch (IOException ioe) {\n System.err.println(\"Cannot create log file\");\n ioe.printStackTrace();\n }\n gameLogger.initialize(GameLogger.WRITE_LOG, logFile);\n\n //初始化葫芦娃\n CalabashBrother[] huluwa = {\n new CalabashBrother(this, background, 6),\n new CalabashBrother(this, background, 3),\n new CalabashBrother(this, background, 0),\n new CalabashBrother(this, background, 2),\n new CalabashBrother(this, background, 4),\n new CalabashBrother(this, background, 1),\n new CalabashBrother(this, background, 5),\n };\n SortController.sort(huluwa);\n for (int i = 0; i < huluwa.length; ++i) {\n huluwa[i].setCampId(Camp.GOOD);\n huluwa[i].setLife(120);\n huluwa[i].setAtk(30 + i);\n String iconPath = getClass().getResource(resourcesPath + Integer.toString(huluwa[i].getNum() + 1) + \".png\").toString();\n huluwa[i].setIcon(iconPath);\n }\n\n //初始化反派战斗人员\n Monster[] evils = {\n new Monster(this, background, \"蝎子精\"),\n new Monster(this, background, \"小喽啰1\"),\n new Monster(this, background, \"小喽啰2\"),\n new Monster(this, background, \"小喽啰3\"),\n new Monster(this, background, \"小喽啰4\"),\n new Monster(this, background, \"小喽啰5\"),\n new Monster(this, background, \"小喽啰6\"),\n };\n //单独设置蝎子精\n evils[0].setCampId(Camp.BAD);\n evils[0].setLife(150);\n evils[0].setAtk(40);\n evils[0].setIcon(getClass().getResource( resourcesPath + \"scorpion.png\").toString());\n //设置小喽啰\n for (int i = 1; i < evils.length; ++i) {\n evils[i].setCampId(Camp.BAD);\n evils[i].setLife(100);\n evils[i].setAtk(20);\n evils[i].setIcon(getClass().getResource(resourcesPath + \"monster.png\").toString());\n }\n\n //初始化爷爷:技能-加血\n Leader grandpa = Leader.getInstance(this, background, \"爷爷\");\n grandpa.setCampId(Camp.GOOD);\n grandpa.setLife(100);\n grandpa.setIcon(getClass().getResource( resourcesPath +\"grandpa.png\").toString());\n grandpa.setBuff(obj -> { obj.setLife(obj.getLife() + 20); });\n grandpa.setBuffSign(new Image(getClass().getResource(resourcesPath + \"lifeup.png\").toString()));\n\n //初始化蛇精:技能-加攻击力\n Leader snaker = Leader.getInstance(this, background, \"蛇精\");\n snaker.setCampId(Camp.BAD);\n snaker.setLife(120);\n snaker.setIcon(getClass().getResource(resourcesPath + \"snaker.png\").toString());\n snaker.setBuff(obj -> { obj.setAtk(obj.getAtk() + 20); });\n snaker.setBuffSign(new Image(getClass().getResource(resourcesPath + \"atkup.png\").toString()));\n\n numOfGood = huluwa.length + 1;\n numOfBad = evils.length + 1;\n\n initializeFormation(background, snaker, evils, grandpa, huluwa);\n updateView();\n\n //启动所有线程,开始战斗\n System.out.println(\"Game start!\");\n exec = Executors.newCachedThreadPool();\n exec.execute(grandpa);\n exec.execute(snaker);\n for (int i = 0; i < huluwa.length; ++i) {\n exec.execute(huluwa[i]);\n }\n for (int i = 0; i < evils.length; ++i) {\n exec.execute(evils[i]);\n }\n exec.shutdown();\n }", "public void Load() {\n\t\tsceneLoaded = false;\n\n\t\tfor (int i = 0 ; i < gameObjects.size();i++) {\n\t\t\tGameObject gO = gameObjects.get(i);\n\t\t\tEngine.Instance.AddObject(gO);\n\n\t\t}\n\t\tEngine.Instance.currentScenes.add(this);\n\t\tsceneLoaded = true;\n\t}", "public void act() \n {\n setImage(\"1up.png\");\n setImage(\"acrate.png\");\n setImage(\"Betacactus.png\");\n setImage(\"bullet1.png\");\n setImage(\"bullet2.png\");\n setImage(\"burst.png\");\n setImage(\"cowboy.png\");\n setImage(\"fOxen1.png\");\n setImage(\"fOxen2.png\");\n setImage(\"fOxen3.png\");\n setImage(\"fOxen4.png\");\n setImage(\"fOxenH.png\");\n setImage(\"fWagon1.png\");\n setImage(\"fWagon2.png\");\n setImage(\"fWagon3.png\");\n setImage(\"fWagon4.png\");\n setImage(\"fWagonH.png\");\n setImage(\"health.png\");\n setImage(\"indian.png\");\n setImage(\"normal.png\");\n setImage(\"oxen.png\");\n setImage(\"oxen2.png\");\n setImage(\"oxen3.png\");\n setImage(\"oxen4.png\");\n setImage(\"oxen-hit.png\");\n setImage(\"plasma.png\");\n setImage(\"rapid.png\");\n setImage(\"snake1.png\");\n setImage(\"snake2.png\");\n setImage(\"snake3.png\");\n setImage(\"snake4.png\");\n setImage(\"spread.png\");\n setImage(\"theif.png\");\n setImage(\"train1.png\");\n setImage(\"train-hit.png\");\n setImage(\"wagon.png\");\n setImage(\"wagonhit.png\");\n setImage(\"wave.png\");\n getWorld().removeObject(this);\n }", "public Levels()\r\n { \r\n super(1070, 570, 1);\r\n \r\n //Add the bottom platform in the menu screen\r\n platforms = new Platforms[7]; \r\n for (int i = 0; i < platforms.length; i++)\r\n {\r\n platforms[i] = new Platforms();\r\n }\r\n bottomPlatform();\r\n\r\n //Add the Potato (player)\r\n player = new Player();\r\n addObject (player, 100, 512); \r\n\r\n setBackground(\"menu.png\");\r\n }", "public static void create(){\n\t\tstage = new Stage(new StretchViewport(1680, 1050)); \n\t\tCamera camera = stage.getCamera();\n\t\tcamera.update();\n\n\t\t//Instantiate the Managers\n\t\tGdx.input.setInputProcessor(getStage());\t\n\t\tstage.getActors().clear();\n\t\t\n\t\tmapManager = new Game_Map_Manager();\n\t\tmapManager.create(getStage());\n\t\t\n\t\tGame_CardHand cardHand = new Game_CardHand();\n\t\tcardHand.create(getStage());\n\n\t\tGameScreenUI actorManager = new GameScreenUI();\n\t\tactorManager.create(getStage());\n\n\t\tTrainDepotUI trainDepot = new TrainDepotUI();\n\t\ttrainDepot.create(getStage());\n\n\t\tGoalMenu goalScreenManager = new GoalMenu();\n\t\tgoalScreenManager.create(getStage());\n\t\t\n\t\tPlayerGoals ticketManager = new PlayerGoals();\n\t\tticketManager.create(getStage());\t\n\t\t\n\t\tGame_StartingSequence startgameManager = new Game_StartingSequence(replayMode);\n\t\tstartgameManager.create(getStage());\n\t\t\n\t\tGame_Shop shop = new Game_Shop();\n\t\tshop.create(getStage());\n\t\t\n\t\tGame_PauseMenu pauseMenu= new Game_PauseMenu();\n\t\tpauseMenu.create(getStage());\n\t\t\n\t\tWarningMessage warningMessage = new WarningMessage();\n\t\twarningMessage.create(getStage());\n\t\t\n\t\tif (replayMode){\n\t\t\tReplayModeUI replayUI = new ReplayModeUI();\n\t\t\treplayUI.create(getStage());\n\t\t\t\n\t\t\tif (Game_StartingSequence.inProgress){\n\t\t\t\tWorldMap replayMap = WorldMap.getInstance();\n\t\t\t\tGame_StartingSequence.player1 = false;\n\t\t\t\t\n\t\t\t\tStation p1station = replayMap.stationsList.get(0);\n\t\t\t\tfor (Station station : replayMap.stationsList){\n\t\t\t\t\tif (station.getName().equals(LocomotionCommotion.getReplayTurn().getJSONObject(\"player1\").getJSONArray(\"stations\").getJSONObject(0).getString(\"stationName\"))){\n\t\t\t\t\t\tp1station = station;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tStation p2station = replayMap.stationsList.get(1);\n\t\t\t\tfor (Station station : replayMap.stationsList){\n\t\t\t\t\tif (station.getName().equals(LocomotionCommotion.getReplayTurn().getJSONObject(\"player2\").getJSONArray(\"stations\").getJSONObject(0).getString(\"stationName\"))){\n\t\t\t\t\t\tp2station = station;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcreateCoreGame(p1station, p2station);\n\t\t\t\tGame_StartingSequence.startGame();\n\t\t\t\tGameScreenUI.refreshResources();\n\t\t\t\tGame_StartingSequence.inProgress = false;\n\t\t\t}\n\t\t}\n\t}", "public gameScene_Model(Stage primaryStage){\n this.primaryStage = primaryStage;\n background = new MyStage();\n this.scene = new Scene(background,600,800);\n animal = new Animal(\"file:src/FroggerApp/Images_File/froggerUp.png\");\n }", "public GameView() {\n this.astronautaImage = new Image(getClass().getResourceAsStream(\"/res/astronauta.gif\"));\n this.ovniImage = new Image(getClass().getResourceAsStream(\"/res/ovni1.png\"));\n this.ovni2Image = new Image(getClass().getResourceAsStream(\"/res/ovni1.png\"));\n this.ovnidestructibleImage = new Image(getClass().getResourceAsStream(\"/res/ovnidestructible.png\"));\n this.wallImage = new Image(getClass().getResourceAsStream(\"/res/wall.png\"));\n this.pistolaImage = new Image(getClass().getResourceAsStream(\"/res/pistola.png\"));\n this.alienEggImage = new Image(getClass().getResourceAsStream(\"/res/alienEgg.png\"));\n }", "public void createScene();", "private void initialisiereKomponenten() {\r\n\t\tthis.southP = new Panel();\r\n\t\tthis.southP.setBackground(new Color(250, 240, 230));\r\n\r\n\t\tthis.centerP = new Panel();\r\n\t\tthis.centerP.setBackground(new Color(250, 240, 230));\r\n\r\n\t\tthis.northP = new Panel();\r\n\t\tthis.northP.setBackground(new Color(250, 240, 230));\r\n\r\n\t\tthis.farbe = new Color[] { Color.BLACK, Color.RED, Color.YELLOW, Color.BLUE, Color.WHITE, Color.GREEN };\r\n\r\n\t\tthis.eins = new JButton(\" \");\r\n\t\tthis.zwei = new JButton(\" \");\r\n\t\tthis.drei = new JButton(\" \");\r\n\t\tthis.vier = new JButton(\" \");\r\n\t\tthis.bestätigen = new JButton(\"Bestätigen\");\r\n\r\n\t\tthis.farbListener = new FarbListener();\r\n\t\tthis.bestätigenListener = new BestätigenListener();\r\n\r\n\t\tthis.sliderFarbe = this.erstelleSchieberegler(1, 6);\r\n\t\tthis.sliderButton = this.erstelleSchieberegler(1, 4);\r\n\r\n\t\tthis.buttonsammler = new JButton[] { eins, zwei, drei, vier };\r\n\r\n\t\tthis.aktivität = new String[] { \"Bitte gebe eine 1 in die Console ein.\",\r\n\t\t\t\t\"Bitte drücke den 'Vergleichen' Button.\", \"Codierer, bitte bestätige deine Farbfolge.\" };\r\n\t\tthis.rundeAnzeigeText = new String[] { \"Aktuelle Runde: 1\", \"Aktuelle Runde: 2\", \"Aktuelle Runde: 3\",\r\n\t\t\t\t\"Aktuelle Runde: 4\", \"Aktuelle Runde: 5\", \"Aktuelle Runde: 6\", \"Aktuelle Runde: 7\",\r\n\t\t\t\t\"Aktuelle Runde: 8\" };\r\n\r\n\t\tthis.rundeAnzeige = new JLabel(this.rundeAnzeigeText[0]);\r\n\t\tthis.labelAktivität = new JLabel(this.aktivität[2]);\r\n\t\tthis.labelSliderButton = new JLabel(\"Button-Slider\");\r\n\t\tthis.labelSliderFarbe = new JLabel(\"Farbe-Slider\");\r\n\r\n\t\tthis.counter = 0;\r\n\t}", "public void loadGameCanvasView()\n\t{\n\t\ttry {\n\t\t\tprimaryStage.setTitle(\"Onitama\");\n\t\t\tGridPane root = new GridPane();\n\t\t\tFXMLLoader loader = new FXMLLoader(getClass().getResource(\"/view/GameCanvas.fxml\"));\n\t\t\troot = loader.load();\n\t\t\tGameCanvasViewController viewController = (GameCanvasViewController) loader.getController();\n\t\t\tviewController.setOnitamaController(onitamaController);\n\t\t\tviewController.init();\n\n\t\t\tScene scene = new Scene(root);\n\t \t// this fixes java bug when change scnene after dialog\n\t\t\t// javafx bug https://bugs.openjdk.java.net/browse/JDK-8140491\n\t\t\tPlatform.runLater(() -> { \n\t\t\t\tLoadViewController.primaryStage.setScene(scene);\n\t\t\t});\n\t\t\t//LoadViewController.primaryStage.setScene(scene);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void setTheScene()\n {\n board.setLocalRotation(Quaternion.IDENTITY);\n board.rotate(-FastMath.HALF_PI, -FastMath.HALF_PI, 0);\n board.setLocalTranslation(0, 0, -3);\n\n cam.setLocation(new Vector3f(0, 0, 10));\n cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);\n }", "public Scene() {}", "public void buildInitialScene() {\n\t\t\n\t\t//Creation image background\n\t\tfinal String BACKGROUND_PATH = \"src/assets/img/temp_background.png\";\n\t\tthis.background = new GameImage(BACKGROUND_PATH);\n\n\t\t//Creation image Game Over\n\t\tfinal String GAME_OVER_PATH = \"src/assets/img/erro.png\";\n\t\tthis.errorScene = new Sprite(GAME_OVER_PATH);\n\n\t\t//Game over sprite center position\n\t\tthis.errorScene.x = spos.calculatePosition(WindowConstants.WIDTH, 2, this.errorScene, 2);\n\t\tthis.errorScene.y = spos.calculatePosition(WindowConstants.HEIGHT, 2, this.errorScene, 2);\n\t}", "public void loadGameView() {\n\t\ttry {\n\t\t\tprimaryStage.setTitle(\"Spiel Laden\");\n\t\t\tBorderPane root = new BorderPane();\n\t\t\tFXMLLoader loader = new FXMLLoader(getClass().getResource(\"/view/LoadGame.fxml\"));\n\t\t\troot = loader.load();\n\t\t\tLoadGameViewController loadGameViewController = (LoadGameViewController) loader.getController();\n\t\t\tloadGameViewController.setOnitamaController(onitamaController);\n\t\t\tloadGameViewController.init();\n\t\t\tScene scene = new Scene(root);\n\t\t\t//((Stage) outerPane.getScene().getWindow()).setScene(scene);\n\t\t\t//LoadViewController.primaryStage.setScene(scene);\n\t\t\tPlatform.runLater(() -> { LoadViewController.primaryStage.setScene(scene); });\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public TelaFimDeJogo() {\n initComponents();\n gerenciador.pegaJogadorDaRodada();\n mensagemBaixo.setForeground(gerenciador.pegaJogadorDaRodada().getColor());\n mensagemCima.setForeground(gerenciador.pegaJogadorDaRodada().getColor());\n mensagemCima.setText(\"PARABÉNS JOGADOR \" + gerenciador.pegaJogadorDaRodada().getNomeCor().toUpperCase() + \", VOCÊ VENCEU!!\");\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tEnvironmentVariables.addToTerrain(new GameObject (temp_terrain_object));\r\n\t\t\t\t//reset to default \r\n\t\t\t\ttemp_terrain_object.reset();\r\n\t\t\t\ttemp_terrain_object.setLock(true);\r\n\t\t\t\tresetUI();\r\n\t\t\t\ttemp_terrain_object.setMaterial(material_cb.getSelectedItem().toString());\r\n\t\t\t\tWindow.render();\r\n\t\t\t}", "@Override\n protected void initScene() {\n setupCamera(0xff888888);\n\n /*\n * Create a Cube and display next to the cube\n * */\n setupCube();\n\n\n /*\n * Create a Sphere and place it initially 4 meters next to the cube\n * */\n setupSphere();\n\n\n /*\n * Create a Plane and place it initially 2 meters next to the cube\n * */\n setupPlane();\n setupImage();\n setupText();\n\n }", "public MenuCreditos(Game world) {\n this.world=world;\n this.setVisible(true);\n teclas= new Sonido();\n onEnter();\n }", "public VistaGraficaQytetet() {\n ArrayList <String> nombres = obtenerNombreJugadores();\n modelo = Qytetet.getInstance();\n controlador = ControladorQytetet.getInstance(nombres);\n initComponents();\n creaMenuOperacion();\n creaMenuCasilla();\n update();\n }", "@Override\n public void show() {\n player = new Player(game.getAssetManager().get(\"player.png\", Texture.class), world, new Vector2(1, 2));\n floor = new Floor(game.getAssetManager().get(\"floor.png\", Texture.class), world, new Vector2(0, 0 + 0.5f), 20f, 1f);\n hud = new HUD();\n\n stage.addActor(floor);\n stage.addActor(player);\n\n //TODO: AUTOGENERATE when the player goes up.\n platforms.clear();\n int ax = (int) (Math.random() * 5 + 0);\n platforms.add(new Platform(game.getAssetManager().get(\"platform.png\", Texture.class), world, new Vector2(ax, 3), 1.2f, 0.3f));\n for (int i = 3; i <= 25; i++) {\n\n int x, y;\n x = (int) (Math.random() * 4.5 + 0.5);\n y = ((int) (Math.random() * 3 + 1)) + i;\n\n while ((x < ax && x > ax + 1f) && (x > ax && x < ax - 1f)) {\n x = (int) (Math.random() * 4.5 + 0.5);\n }\n Gdx.app.log(\"kk\",x+\"x\"+y);\n platforms.add(new Platform(game.getAssetManager().get(\"platform.png\", Texture.class), world, new Vector2(x, y), 1f, 0.3f));\n ax = x;\n }\n\n for (Platform platform : platforms) {\n stage.addActor(platform);\n }\n\n stage.getCamera().position.set(cameraInitialPosition);\n stage.getCamera().update();\n\n playing = false;\n jumps = 0;\n lastPlatformTouched = 0;\n\n song.play();\n\n }", "public SeletionScreen() {\r\n\t\theight = 600;\r\n\t\twidth = 800;\r\n\r\n\t\tposicao = new Point[9];\r\n\t\tenderecoImage = new String[8];\r\n\t\t\r\n\t\tenderecoImageSelecaoP1 = new String[8];\r\n\t\tenderecoImageSelecaoP2 = new String[8];\r\n\r\n\t\tsizeHeightImage = 147;\t\t\t\r\n\t\tsizeWidhtImage =114;\r\n\r\n\t\tsizeHeightImageSelecionado = 183;\r\n\t\tsizeWidhtImageSelecionado = 146;\r\n\t\t\r\n\t\tplayer1 = 0;\r\n\t\tplayer2 = 3;\r\n\r\n\r\n\t\t//personagem superior da tela\r\n\t\tposicao[0]= new Point(99,41);\r\n\t\tposicao[1]= new Point(264, 41);\r\n\t\tposicao[2]= new Point(429, 41);\r\n\t\tposicao[3]= new Point(594, 41);\r\n\t\t//personagem inferior da tela \r\n\t\tposicao[4]= new Point(175, 206);\r\n\t\tposicao[5]= new Point(340, 206);\r\n\t\tposicao[6]= new Point(505, 206);\t//posicao do randon\r\n\t\t//posicao do personagem escolhido\r\n\t\tposicao[7]= new Point(77, 374);\r\n\t\tposicao[8]= new Point(578, 374);\t\t\r\n\r\n\t\t/*\r\n\t\t * endereco das imagens que vao ser caregadas para mostrar os lutadores\r\n\t\t */\r\n\t\tenderecoImage[0]= \"/image/fireHead/fireHead_menu_0.png\";\r\n\t\tenderecoImage[1]= \"/image/madimbu/madimbu_menu_0.png\";\r\n\t\tenderecoImage[2]= \"/image/bigboss/bigBoss_Menu_0.png\";\r\n\t\tenderecoImage[3]= \"/image/monitora/monitora_menu_0.png\";\r\n\t\tenderecoImage[4]= \"/image/tche/tche_menu_0.png\";\r\n\t\tenderecoImage[5]= \"/image/random.png\";\r\n\t\tenderecoImage[6]= \"/image/mallock/mallock_menu_0.png\";\r\n\t\tenderecoImage[7]= \"/image/Screens/screenSelect.png\";//fundo\r\n\r\n//========================Carrega o endereco de imagem da animacao de selacao do Player 1 =================================\r\n\t\tenderecoImageSelecaoP1[0] = \"/image/fogo/fogo_0.png\";\r\n\t\tenderecoImageSelecaoP1[1] = \"/image/fogo/fogo_1.png\";\r\n\t\tenderecoImageSelecaoP1[2] = \"/image/fogo/fogo_2.png\";\r\n\t\tenderecoImageSelecaoP1[3] = \"/image/fogo/fogo_3.png\";\r\n\t\tenderecoImageSelecaoP1[4] = \"/image/fogo/fogo_4.png\";\r\n\t\tenderecoImageSelecaoP1[5] = \"/image/fogo/fogo_5.png\";\r\n\t\tenderecoImageSelecaoP1[6] = \"/image/fogo/fogo_6.png\";\r\n\t\tenderecoImageSelecaoP1[7] = \"/image/grade.png\";\r\n//======================================================================================================================\r\n\r\n//=================Carrega o endereco de imagem da animacao de selacao do Player 2=========================================\r\n\t\tenderecoImageSelecaoP2[0] = \"/image/fogo/fogo_azul_0.png\";\r\n\t\tenderecoImageSelecaoP2[1] = \"/image/fogo/fogo_azul_1.png\";\r\n\t\tenderecoImageSelecaoP2[2] = \"/image/fogo/fogo_azul_2.png\";\r\n\t\tenderecoImageSelecaoP2[3] = \"/image/fogo/fogo_azul_3.png\";\r\n\t\tenderecoImageSelecaoP2[4] = \"/image/fogo/fogo_azul_4.png\";\r\n\t\tenderecoImageSelecaoP2[5] = \"/image/fogo/fogo_azul_5.png\";\r\n\t\tenderecoImageSelecaoP2[6] = \"/image/fogo/fogo_azul_6.png\";\r\n\t\tenderecoImageSelecaoP2[7] = \"/image/grade.png\";\r\n//====================================================================================================================\r\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < 8; i++) {\r\n\t\t\t\tBufferedImage ani = ImageIO.read(Controller.getInstance().getClass().getResourceAsStream(enderecoImageSelecaoP1[i]));\r\n//\t\t\t\r\n\t\t\t\tanimacaoDeSelecaoP1.add(ani);\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < 8; i++) {\r\n\t\t\t\tBufferedImage ani2 = ImageIO.read(Controller.getInstance().getClass().getResourceAsStream(enderecoImageSelecaoP2[i]));\r\n//\t\t\t\t\r\n\t\t\t\tanimacaoDeSelecaoP2.add(ani2);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t}\t\t\r\n\t\t\r\n\t\t\r\n\t\ttry {\r\n\t\t\t/*\r\n\t\t\t * Carregar todas as imagem dos jogadores\r\n\t\t\t */\r\n//================================Carrega a imagem de Fundo ====================================================\t\t\t\r\n\r\n\t\t\tfundo = ImageIO.read(Controller.getInstance().getClass().getResourceAsStream(enderecoImage[7]));\r\n\r\n//===============================================================================================================\r\n//=============================Carrega as imagens dos lutadores =================================================\r\n\t\t\tfor(int i=0;i<7; i++)\r\n\t\t\t{\r\n\t\t\t\tlutadores.add(new Button(Utilities.loadImage(enderecoImage[i]),posicao[i].x,posicao[i].y){\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tpublic void onClick() {\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void draw(Graphics2D graphics) {\r\n\t\t\t\t\t\tgraphics.drawImage(getImage(), position.toPoint().x, position.toPoint().y, position.toPoint().x+sizeWidhtImage, position.toPoint().y+sizeHeightImage, 0,0,getImage().getWidth(), getImage().getHeight(), null);\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t});\r\n\t\t\t\r\n\t\t\t}\r\n//==========================================================================================================================================================\t\t\r\n\r\n//===============================Adiciona os lutadores para ser mostrado na tela===========================================================================================================================\t\t\t\r\n\t\t\tfor (int i = 0; i < lutadores.size(); i++) {\r\n\t\t\t\taddComponent(lutadores.get(i));\r\n\t\t\t}\r\n//==============================================================================================================================================================================\t\t\t\r\n\r\n\r\n//================================== Imagem do lutador selecionado do player 1 ==========================================================================================================\t\t\t\r\n\t\t\tlutadoresSelcionado.add(new Button(Utilities.loadImage(enderecoImage[0]),posicao[7].x,posicao[7].y){\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick() {\r\n\t\t\t\t\t// TODO Auto-generated method stub\r\n\r\n\t\t\t\t}\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void draw(Graphics2D graphics) {\r\n//==================selecao feita atraves do mouse o primeiro click ============================================================================================================\r\n//\t\t\t\t\tif(player1!=-1)\r\n//\t\t\t\t\t{\r\n//\t\t\t\t\t\tthis.setImage(lutadores.get(player1).getImage());\r\n//\t\t\t\t\t\tgraphics.setColor(Color.RED);\r\n//\t\t\t\t\t\tgraphics.fillRect( position.toPoint().x-2, position.toPoint().y-2, sizeWidhtImageSelecionado+4, sizeHeightImageSelecionado+4);\r\n//\t\t\t\t\t\tgraphics.drawImage(getImage(), position.toPoint().x, position.toPoint().y, position.toPoint().x+sizeWidhtImageSelecionado, position.toPoint().y+sizeHeightImageSelecionado, 0,0,getImage().getWidth(), getImage().getHeight(), null);\r\n//\t\t\t\t\t}\r\n//\t\t\t\t\telse\r\n//\t\t\t\t\t{\t\t\t\t\t\t\t\r\n//\t\t\t\t\t\tgraphics.setColor(Color.RED);\r\n//\t\t\t\t\t\tgraphics.fillRect( position.toPoint().x-2, position.toPoint().y-2, sizeWidhtImageSelecionado+4, sizeHeightImageSelecionado+4);\r\n//\t\t\t\t\t\tgraphics.drawImage(getImage(), position.toPoint().x, position.toPoint().y, position.toPoint().x+sizeWidhtImageSelecionado, position.toPoint().y+sizeHeightImageSelecionado, 0,0,getImage().getWidth(), getImage().getHeight(), null);\r\n//\t\t\t\t\t}\r\n//=============================================================================================================================================================================================================================================\t\t\t\t\t\r\n//============================Selecao do personagem atraves do teclado com as teclas A, D e E para confirmar selecao =================================================================================================================================================================================================================\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.setImage(lutadores.get(player1).getImage());\r\n\t\t\t\t\t\tgraphics.drawImage(getImage(), position.toPoint().x, position.toPoint().y, position.toPoint().x+sizeWidhtImageSelecionado, position.toPoint().y+sizeHeightImageSelecionado, 0,0,getImage().getWidth(), getImage().getHeight(), null);\r\n\t\t\t\t\t\tif(E){\r\n\t\t\t\t\t\t\tgraphics.drawImage(animacaoDeSelecaoP1.get(7),posicao[player1].x , posicao[player1].y, posicao[player1].x+sizeWidhtImage ,posicao[player1].y+sizeHeightImage, 0, 0, animacaoDeSelecaoP1.get(7).getWidth(), animacaoDeSelecaoP1.get(7).getHeight(), null);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\r\n//=============================================================================================================================================================================================================================================\t\t\t\t\t\r\n\r\n//================================== Imagem do lutador selecionado do player 2 ============================================================================\t\t\t\r\n\t\t\tlutadoresSelcionado.add(new Button(Utilities.loadImage(enderecoImage[3]),posicao[8].x,posicao[8].y){\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick() {\r\n\t\t\t\t\t// TODO Auto-generated method stub\r\n\r\n\t\t\t\t}\r\n\t\t\t\tpublic void draw(Graphics2D graphics) {\r\n\t\t\t\t\t\r\n//=============================Selecao do personagem Atraves do mouse, selecao feita por ordem ==================================\r\n//\t\t\t\t\tif(player2!=-1)\r\n//\t\t\t\t\t{\r\n//\t\t\t\t\t\tthis.setImage(lutadores.get(player2).getImage());\r\n//\t\t\t\t\t\tgraphics.setColor(Color.RED);\r\n//\t\t\t\t\t\tgraphics.fillRect( position.toPoint().x-2, position.toPoint().y-2, sizeWidhtImageSelecionado+4, sizeHeightImageSelecionado+4);\r\n//\t\t\t\t\t\tgraphics.drawImage(getImage(), position.toPoint().x, position.toPoint().y, position.toPoint().x+sizeWidhtImageSelecionado, position.toPoint().y+sizeHeightImageSelecionado, 0,0,getImage().getWidth(), getImage().getHeight(), null);\r\n//\t\t\t\t\t}\r\n//\t\t\t\t\telse\r\n//\t\t\t\t\t{\r\n//\t\t\t\t\t\tgraphics.setColor(Color.RED);\r\n//\t\t\t\t\t\tgraphics.fillRect( position.toPoint().x-2, position.toPoint().y-2, sizeWidhtImageSelecionado+4, sizeHeightImageSelecionado+4);\r\n//\t\t\t\t\t\tgraphics.drawImage(getImage(), position.toPoint().x, position.toPoint().y, position.toPoint().x+sizeWidhtImageSelecionado, position.toPoint().y+sizeHeightImageSelecionado, 0,0,getImage().getWidth(), getImage().getHeight(), null);\r\n//\t\t\t\t\t}\r\n//===========================================================================================================================================\r\n//================================Selecao do personagem feita atraves do teclado teclas LEFT , RIGHT e Confirmar selacao com ENTER \r\n\t\t\t\t\t\tthis.setImage(lutadores.get(player2).getImage());\r\n\t\t\t\t\t\tgraphics.drawImage(getImage(), position.toPoint().x, position.toPoint().y, position.toPoint().x+sizeWidhtImageSelecionado, position.toPoint().y+sizeHeightImageSelecionado, 0,0,getImage().getWidth(), getImage().getHeight(), null);\r\n\t\t\t\t\t\tif(ENTER){\r\n\t\t\t\t\t\t\tgraphics.drawImage(animacaoDeSelecaoP2.get(7),posicao[player2].x , posicao[player2].y, posicao[player2].x+sizeWidhtImage ,posicao[player2].y+sizeHeightImage, 0, 0, animacaoDeSelecaoP2.get(7).getWidth(), animacaoDeSelecaoP2.get(7).getHeight(), null);\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n//==============================================================================================================================================================================================================================================\r\n\r\n//===============================Adiciona os lutadores Selecionado para ser mostrado na tela===========================================================================================================================\t\t\t\r\n\t\t\tfor (int i = 0; i < lutadoresSelcionado.size(); i++) {\r\n\t\t\t\taddComponent(lutadoresSelcionado.get(i));\r\n\t\t\t}\r\n//======================================================================================================================================================================================================================================\t\t\t\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"erro\");\r\n\t\t}\r\n\r\n\t}", "public sosGame() {\n initComponents();\n }", "public void inici() {\n\t\n if (filename == null) {\n \t//System.err.println(Resources.getResource(\"./modelo/cube.obj\"));\n \t filename = Resources.getResource(\"./modelo/cube.obj\");\n if (filename == null) {\n System.err.println(\"modelo/cube.obj nots found\");\n System.exit(1);\n }\n\t}\n\t}", "View(Stage stage, Model model,Player player) {\n this.model = model;\n this.stage = stage;\n battleRoot = new BattleRoot(SCREEN_SIZE_X, SCREEN_SIZE_Y,player);\n playingScene = new Scene(battleRoot);\n this.stage.setScene(this.playingScene);\n// battleRoot.getChildren().addAll(textFieldRoot, enemysPlayFieldRoot, playFieldRoot, handCommand);\n }", "public RaceScene(){\n carOne = new Car();\n\n carTwo = new Car();\n\n carThree = new Car();\n\n txtWarning = new Text(\"Wait for all cars to finish moving\");\n txtWarning.setFont(Font.font(30));\n txtWarning.setFill(Color.WHITE);\n txtWarning.setVisible(false);\n\n btnStartRace = new Button(\"Start\");\n btnStartRace.setFont(Font.font(40));\n btnStartRace.setBackground(new Background(new BackgroundFill(Color.LIGHTBLUE, CornerRadii.EMPTY, Insets.EMPTY)));\n btnStartRace.setOnMouseEntered(E -> btnStartRace.setBackground(new Background(new BackgroundFill\n (Color.DODGERBLUE, CornerRadii.EMPTY, Insets.EMPTY))));\n btnStartRace.setOnMouseExited(E -> btnStartRace.setBackground(new Background(new BackgroundFill\n (Color.LIGHTBLUE, CornerRadii.EMPTY, Insets.EMPTY))));\n btnStartRace.setOnMouseClicked(this);\n\n btnEndRace = new Button(\"Finish\");\n btnEndRace.setVisible(false);\n btnEndRace.setFont(Font.font(40));\n btnEndRace.setTextFill(Color.WHITE);\n btnEndRace.setBackground(new Background(new BackgroundFill(Color.CRIMSON, CornerRadii.EMPTY, Insets.EMPTY)));\n btnEndRace.setOnMouseEntered(E -> btnEndRace.setBackground(new Background(new BackgroundFill\n (Color.DARKRED, CornerRadii.EMPTY, Insets.EMPTY))));\n btnEndRace.setOnMouseExited(E -> btnEndRace.setBackground(new Background(new BackgroundFill\n (Color.CRIMSON, CornerRadii.EMPTY, Insets.EMPTY))));\n btnEndRace.setOnMouseClicked(this);\n }", "public void mostrar() {\n\t\t\n\t\tdibujarFondo();\n\t\tdibujarMarcador();\n\t\t\n\t\tScene escena = new Scene(panel, panel.getPrefWidth(), panel.getPrefHeight());\n\n\t\tescenario.setScene(escena);\n\t\tescenario.setResizable(false);\n\t\tescenario.setTitle(Aplicacion.TITULO);\n\t\t\n\t\tdibujar();\n\n\t\tescenario.show();\n\t}", "public void setPlayer(Player p){\r\n playerModel=p; \r\n jEnemigoDatos.setText(p.getEnemy().getName());\r\n /*if(p.getBadConsequence()==null)\r\n jMalRolloDatos.setText(\"No\");\r\n else\r\n jMalRolloDatos.setText(\"Si\");*/\r\n if(p.isDead())\r\n jMuertoDatos.setText(\"Si\");\r\n else\r\n jMuertoDatos.setText(\"No\");\r\n \r\n jNivelDatos.setText(p.getLevels()+\"\");\r\n jCombatLevelDatos.setText(p.getCombatLevel()+\"\");\r\n jNombreDatos.setText(p.getName());\r\n if(p.canISteal())\r\n jRobarDatos.setText(\"Si\");\r\n else\r\n jRobarDatos.setText(\"No\");\r\n \r\n jNSectDatos.setText(Integer.toString(CultistPlayer.getTotalCultistPlayer()));\r\n \r\n if(playerModel.getClass() == CultistPlayer.class){\r\n jSectarioDatos.setText(\"Si\");\r\n //String text=(CultistPlayer)playerModel.getMyCultist().getGainedLevels()+\"\";\r\n //jSectarioDatos.setText(\"\"+(CultistPlayer)playerModel.getGainedLevels());\r\n \r\n }else\r\n jSectarioDatos.setText(\"No\");\r\n \r\n /*if(playerModel.getBadConsequence().isEmpty())\r\n pendingBadView1.setVisiblePending(false);\r\n else*/\r\n pendingBadView1.setVisiblePending(true);\r\n pendingBadView1.limpiar();\r\n \r\n // A continuación se actualizan sus tesoros \r\n fillTreasurePanel (jpVisibles, playerModel.getVisibleTreasures()); \r\n fillTreasurePanel (jpOcultos, playerModel.getHiddenTreasures()); \r\n btRobar.setEnabled(playerModel.canISteal());\r\n manejarBotones(true);\r\n repaint(); \r\n revalidate();\r\n }", "public void startGame() throws SlickException\n {\n //Add the object pickers to the screen. \n GameManager gameManager = GameManager.getInstance();\n ResourceManager resourceManager = ResourceManager.getInstance();\n \n this.horizontalPicker = resourceManager.getImage(UsableActorContainer.HORIZONTAL_PICKER_IMAGE_FILE_PATH);\n this.verticalPicker = resourceManager.getImage(UsableActorContainer.VERTICAL_PICKER_IMAGE_FILE_PATH);\n \n // Add the objects for every player.\n int playerCount = 0; \n \n for( Player player : gameManager.getPlayers() )\n {\n if( player instanceof MousePlayer || player instanceof TouchPlayer )\n {\n UsableActor actor;\n Point2D.Double locationInsideContainer;\n \n // Initialize cookie. \n if( UsableActorContainer.PICKER_DRAWN_HORIZONTAL[ playerCount ] )\n {\n locationInsideContainer = new Point2D.Double((UsableActorContainer.PICKER_START_PIXELS_X[playerCount]+UsableActorContainer.IMAGE_OFFSET), UsableActorContainer.PICKER_START_PIXELS_Y[playerCount] + UsableActorContainer.IMAGE_OFFSET);\n }\n else\n {\n locationInsideContainer = new Point2D.Double((UsableActorContainer.PICKER_START_PIXELS_X[playerCount]+UsableActorContainer.IMAGE_OFFSET), UsableActorContainer.PICKER_START_PIXELS_Y[playerCount] + UsableActorContainer.IMAGE_OFFSET);\n }\n \n /*\n actor = player.getObject( PlayerObject.COOKIE );\n actor.setIsOnMap( Boolean.FALSE );\n actor.setLocationInsideActorContainer( locationInsideContainer );\n gameManager.getMap().addUsableActor( actor );\n */\n \n Cookie cookie = new Cookie( player, Boolean.FALSE );\n cookie.init();\n cookie.setLocationInsideActorContainer( locationInsideContainer );\n this.cookies.add( cookie );\n \n // Initialize whistle.\n if(UsableActorContainer.PICKER_DRAWN_HORIZONTAL[playerCount])\n {\n locationInsideContainer = new Point2D.Double((UsableActorContainer.PICKER_START_PIXELS_X[playerCount]+UsableActorContainer.IMAGE_OFFSET + UsableActorContainer.HORIZONTAL_PICKER_PIXEL_DIFFERENCE_NEXT_OBJECT_X), UsableActorContainer.PICKER_START_PIXELS_Y[playerCount] + UsableActorContainer.IMAGE_OFFSET + UsableActorContainer.HORIZONTAL_PICKER_PIXEL_DIFFERENCE_NEXT_OBJECT_Y);\n }\n else\n {\n locationInsideContainer = new Point2D.Double((UsableActorContainer.PICKER_START_PIXELS_X[playerCount]+UsableActorContainer.IMAGE_OFFSET + UsableActorContainer.VERTICAL_PICKER_PIXEL_DIFFERENCE_NEXT_OBJECT_X), UsableActorContainer.PICKER_START_PIXELS_Y[playerCount] + UsableActorContainer.IMAGE_OFFSET + UsableActorContainer.VERTICAL_PICKER_PIXEL_DIFFERENCE_NEXT_OBJECT_Y);\n }\n \n /*\n actor = player.getObject( PlayerObject.WHISTLE );\n actor.setIsOnMap( Boolean.FALSE );\n actor.setLocationInsideActorContainer( locationInsideContainer );\n gameManager.getMap().addUsableActor( actor );\n */\n \n Whistle whistle = new Whistle( player, Boolean.FALSE );\n whistle.init();\n whistle.setLocationInsideActorContainer( locationInsideContainer );\n this.whistles.add( whistle );\n }\n \n playerCount++;\n } \n }", "public Juego()\n {\n // crea la ventana principal del juego\n generaVentana();\n \n // genera las naves y los disparos del juego\n generaNaves();\n \n // responde a los eventos de pulsar las teclas de movimiento y disparo\n addKeyListener(new Eventos());\n }", "public void reset() {\r\n\r\n\t\tassets.allocateMusic(\"audio/SomniTrack.mp3\");\r\n\t\tassets.allocateMusic(\"audio/PhobiaTrack.mp3\");\r\n\t\tassets.allocateMusic(\"audio/CombinedTrack.mp3\");\r\n//\t\tJsonValue sounds = assets.get(\"sounds\");\r\n//\t\tsomniTrackPath = sounds.get(\"somniTrack\").asString();\r\n//\t\tphobiaTrackPath = sounds.get(\"phobiaTrack\").asString();\r\n//\t\tcombinedTrackPath = sounds.get(\"combinedTrack\").asString();\r\n\r\n\t\tsomniTrackPath = \"audio/SomniTrack.mp3\";\r\n\t\tphobiaTrackPath = \"audio/PhobiaTrack.mp3\";\r\n\t\tcombinedTrackPath = \"audio/CombinedTrack.mp3\";\r\n\r\n\t\tgameScreenActive = true;\r\n\t\tVector2 gravity = new Vector2(world.getGravity() );\r\n\t\tfor(Obstacle obj : objects) {\r\n\t\t\tobj.deactivatePhysics(world);\r\n\t\t}\r\n\t\tfor(Obstacle obj : sharedObjects) {\r\n\t\t\tobj.deactivatePhysics(world);\r\n\t\t}\r\n\t\tfor(Obstacle obj : darkObjects) {\r\n\t\t\tobj.deactivatePhysics(world);\r\n\t\t}\r\n\t\tfor(Obstacle obj : lightObjects) {\r\n\t\t\tobj.deactivatePhysics(world);\r\n\t\t}\r\n\t\tobjects.clear();\r\n\t\tsharedObjects.clear();\r\n\t\tlightObjects.clear();\r\n\t\tdarkObjects.clear();\r\n\t\tmovingObjects.clear();\r\n\t\tplatformController.currRainingPlatforms.clear();\r\n\t\tplatformController.respawningPlatforms.clear();\r\n\t\taddQueue.clear();\r\n\t\tworld.dispose();\r\n\t\tdisposeStages();\r\n\r\n\t\tworld = new World(gravity,false);\r\n\t\tsetComplete(false);\r\n\t\tsetFailure(false);\r\n\t\tfirstTimeRendered=true;\r\n\t\tpopulateLevel();\r\n\r\n\t\tcamera = canvas.getCamera();\r\n\t\tpauseButtonStage = new Stage(new ScreenViewport(camera));\r\n\t\tpauseMenuStage = new Stage(new ScreenViewport(camera));\r\n\t\tstage = new Stage(new ScreenViewport(camera));\r\n\t\twinMenuStage = new Stage(new ScreenViewport(camera));\r\n\t\tfailMenuStage = new Stage(new ScreenViewport(camera));\r\n\r\n\t\tCamera camera = canvas.getCamera();\r\n\t\tVector2 leadPos = somni.getPosition();\r\n\t\tfloat newX = leadPos.x * canvas.PPM;\r\n\t\tnewX = Math.min(newX, widthUpperBound);\r\n\t\tnewX = Math.max(canvas.getWidth() / 2, newX );\r\n\t\tcamera.position.x = newX;\r\n\r\n\t\tfloat newY = leadPos.y * canvas.PPM;\r\n\t\tnewY = Math.min(newY, heightUpperBound);\r\n\t\tnewY = Math.max(canvas.getHeight() / 2, newY );\r\n\t\tcamera.position.y = newY;\r\n\r\n\t\tcamera.update();\r\n\r\n\t\tholdingHands = false;\r\n\r\n\t\tmovementController = new MovementController(somni, phobia, combined, goalDoor, objects, sharedObjects,\r\n\t\t\t\tlightObjects, darkObjects, this);\r\n\t\tmovementController.setCurrRainingPlatforms(currRainingPlatforms);\r\n\t\tworld.setContactListener(movementController);\r\n\r\n\t\tmovementController.setAvatar(somni);\r\n\t\tmovementController.setLead(somni);\r\n\r\n\t\tcreateModalWindow(camera.position.x, camera.position.y);\r\n\t\tcreatePauseButton();\r\n\t\tcreateSliders();\r\n\t\tcreateFailWindow(camera.position.x, camera.position.y);\r\n\t\tcreateWinWindow(camera.position.x, camera.position.y);\r\n\r\n\r\n\t\tplatformController.setMovingObjects(movingObjects);\r\n\t\tplatformController.setLightObjects(lightObjects);\r\n\t\tplatformController.setDarkObjects(darkObjects);\r\n\t\tplatformController.setSharedObjects(sharedObjects);\r\n\t\tplatformController.setCurrRainingPlatforms(currRainingPlatforms);\r\n\r\n\t\tmaskLeader = phobia;\r\n\t\tswitching = false;\r\n\t\tmaskWidth = MIN_MASK_DIMENSIONS.x;\r\n\t\tmaskHeight = MIN_MASK_DIMENSIONS.y;\r\n\t\talphaAmount = 0;\r\n\r\n\r\n\t\tif(!MusicController.getInstance().isActive(\"somniTrack\")) {\r\n\t\t\tMusicController.getInstance().stopAll();\r\n\t\t\tSoundController.getInstance().stop(\"failTrack\");\r\n\t\t\tSoundController.getInstance().stop(\"winTrack\");\r\n\t\t\tMusicController.getInstance().play(\"somniTrack\", somniTrackPath, volume, true);\r\n\t\t\tMusicController.getInstance().play(\"phobiaTrack\", phobiaTrackPath, 0, true);\r\n\t\t\tMusicController.getInstance().play(\"combinedTrack\", combinedTrackPath, 0, true);\r\n\r\n\t\t}\r\n\r\n\t\tif (movementController.isHoldingHands()){\r\n\t\t\tMusicController.getInstance().setVolume(volume, \"combinedTrack\");\r\n\t\t}\r\n\t\telse if (movementController.getAvatar()==somni){\r\n\t\t\tMusicController.getInstance().setVolume(volume, \"somniTrack\");\r\n\t\t}\r\n\t\telse if (movementController.getAvatar()==phobia){\r\n\t\t\tMusicController.getInstance().setVolume(volume, \"phobiaTrack\");\r\n\t\t}\r\n\r\n\r\n\t}", "public ProjectGame() {\n\n super(\"BulletHell\", 1200, 900);\n die = new Event();\n backgroundMusic = new SoundManagerClass();\n playButton.setPositionX(420);\n playButton.setPositionY(180);\n quitButton.setPositionX(623);\n quitButton.setPositionY(181);\n //x = 0;\n reduceLife = new Event();\n fadeOutEvent = new Event();\n PickedUpEvent = new Event();\n die.setEventType(\"playerDeath\");\n fadeOutEvent.setEventType(\"FadeOut\");\n reduceLife.setEventType(\"Collision\");\n collidedEvent = new Event();\n collidedEvent.setEventType(\"CollidedEvent\");\n throwKnife = new Event();\n throwKnife.setEventType(\"throwKnife\");\n\n\n keyIcon.setPositionX(200);\n keyIcon.setPositionY(40);\n\n knifeIcon.setPositionX(205);\n knifeIcon.setPositionY(95);\n\n currentLevel = 0;//0 = base , 3=brigham's level\n\n\n PickedUpEvent.setEventType(\"CoinPickedUp\");\n\n this.addEventListener(myQuestManager, collidedEvent.getEventType());\n\n\n background.setScaleX(5);\n background.setScaleY(5);\n\n background.setScaleX(5);\n background.setScaleY(5);\n\n\n player = new Player(\"player\", \"resources/player_sheet.png\", \"idle_right\");\n player.setSpriteSheetJson(\"resources/player_sheet.json\");\n player.setDelay(100);\n\n player.getLifeArray().get(0).setPositionX(390);\n player.getLifeArray().get(0).setPositionY(40);\n player.getLifeArray().get(1).setPositionX(420);\n player.getLifeArray().get(1).setPositionY(40);\n player.getLifeArray().get(2).setPositionX(450);\n player.getLifeArray().get(2).setPositionY(40);\n // player.setHasPhysics(true);\n keyCount = 0;\n knifeCount = 4;\n // player.setHasPhysics(true);\n\n // platform.setPositionX(50);\n // platform.setPositionY(550);\n\n\n // platform1.setPositionX(150);\n // platform1.setPositionY(150);\n\n\n player.setPositionX(550);\n player.setPositionY(700);\n\n pressE = new Sprite(\"pressE\", \"pressE.png\");\n player.addChild(pressE);\n pressE.setPositionY(-50);\n\n\n coin.setPositionY(250);\n coin.setPositionX(660);\n\n findKey.setPositionX(500);\n findKey.setPositionY(-20);\n\n getToRoom.setPositionX(500);\n getToRoom.setPositionY(-20);\n\n killTurtle.setPositionX(500);\n killTurtle.setPositionY(-20);\n\n\n //Rectangle2D rect = new Rectangle2D.Float(600,400,700,500);\n //coverList = new ArrayList<Rectangle2D>(); //list of cover sprites\n //coverList.add(rect);\n\n ///////////////////////////////////////LEVEL 0 ////////////////////////////////////////////////////////////////\n\n if (currentLevel == 0) {\n\n tutorial = new TutorialLevel1(\"Tutorial\");\n tutorial.run();\n addChild(tutorial);\n\n myLevel = new Level0(\"Room1\");\n myLevel.run();\n addChild(myLevel);\n\n\n myLevel1 = new Level1(\"Room2\");\n myLevel1.run();\n myLevel1.hide();\n addChild(myLevel1);\n\n myLevel2 = new ahmedslevel(\"Room3\", player);\n myLevel2.run();\n myLevel2.hide();\n addChild(myLevel2);\n\n myLevel3 = new BrighamLevel(\"Room4\");\n myLevel3.run();\n myLevel3.hide();\n addChild(myLevel3);\n\n level4 = new AlternatingSpikesLevel(\"Room6\");\n level4.run();\n level4.hide();\n addChild(level4);\n\n bossLevel = new BossLevel(\"Room5\", player);\n bossLevel.run();\n bossLevel.hide();\n addChild(bossLevel);\n\n\n\n tutorial.mapDoorToRoom(0,myLevel);\n myLevel.mapDoorToRoom(0, myLevel1);\n myLevel1.mapDoorToRoom(0, myLevel2);\n myLevel2.mapDoorToRoom(0, myLevel3);\n myLevel3.mapDoorToRoom(0, level4);\n level4.mapDoorToRoom(0, bossLevel);\n //myLevel3.mapDoorToRoom(0,bossLevel);\n\n\n currentRoom = tutorial;\n\n //myLevel1.mapDoorToRoom(0,myLevel2);\n\n //myLevel2.run();\n //myLevel2.hide();\n\n\n //myLevel2.mapDoorToRoom(0,myLevel3);\n //myLevel3.run();\n //myLevel3.hide();\n currentQuestObjective = 0;\n\n }\n\n if (currentLevel == 4) {\n\n\n bossLevel = new BossLevel(\"Room4\", player);\n bossLevel.run();\n currentRoom = bossLevel;\n\n\n }\n\n enemies = currentRoom.enemies;\n pickpocketEnemy = null;\n\n transitionY = 615;\n transitionYCurrent = 615;\n\n\n backgroundMusic.playSoundEffect(\"resources/oceanOperator.wav\", 100);\n\n }", "static void nowyKomponentRysowania()\n {\n jPanel2.rysowanyObrazek = null;\n jPanel2.repaint();\n }", "public Window() {\n // Creation de la fenetre\n super();\n\n // Creation du graphe de scene\n sceneGraph = new SceneGraph(\"Scene Graph\");\n origin = new int[2];\n\n // Proprietes generales de la fenetre\n // Titre de la fenetre\n this.setTitle(NOMFENETRE);\n /// Taille de la fenetre\n this.setSize(HTAILLE, VTAILLE);\n // Centre la fenetre a l'ecran\n this.setLocationRelativeTo(null);\n // Pour fermer la fenetre lorsqu'on clique sur la croix\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n // Creation des composants de la fenetre\n infoBar = new InfoBar();\n treeZone = new TreePanel();\n drawZone = new DrawPanel(infoBar, treeZone);\n optionZone = new OptionPanel(drawZone);\n menuBar = new MenuBar();\n toolBar = new ToolBar(optionZone);\n\n split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, treeZone, drawZone);\n split.setDividerLocation(200);\n\n treeZone.initializeListeners(drawZone);\n menuBar.initializeListeners(drawZone);\n\n // Ajout de la barre de menu a la fenetre\n this.setJMenuBar(menuBar);\n // Ajout des differents sous-conteneurs au conteneur principal\n this.getContentPane().setLayout(new BorderLayout());\n this.add(optionZone, BorderLayout.NORTH);\n this.add(toolBar, BorderLayout.WEST);\n this.add(split, BorderLayout.CENTER);\n this.add(infoBar, BorderLayout.SOUTH);\n\n // Affiche la fenetre a l'ecran\n this.setVisible(true);\n\n this.addComponentListener(new ComponentAdapter() {\n\n @Override\n public void componentResized(ComponentEvent e) {\n drawZone.calculateOrigin();\n }\n });\n\n }", "public static void populate() {\n HomeView homeView = new HomeView();\n homeView.setOnKeyPressed(keyEvent -> {\n WorldView worldView = WorldController.getWorld();\n worldView.getChildren().add(new Player(homeView.getNameText()));\n scene = new Scene(worldView,600,900);\n primaryStage.setTitle(\"Frogger Arcade\");\n primaryStage.setScene(scene);\n });\n primaryStage.setTitle(\"Frogger Home\");\n primaryStage.setScene(new Scene(homeView));\n primaryStage.show();\n }", "@Override\n protected void initGame() {\n\n// entityBuilder()\n// .view(new Rectangle(64, 64, Color.BLUE))\n// .buildAndAttach();\n//\n// entityBuilder()\n// .at(getAppWidth() - 64, getAppHeight() - 64)\n// .view(new Rectangle(64, 64, Color.BLUE))\n// .buildAndAttach();\n//\n// entityBuilder()\n// .at(0, getAppHeight() / 2 - 32)\n// .view(new Rectangle(64, 64, Color.BLUE))\n// .with(new ProjectileComponent(new Point2D(1, 0), 150))\n// .buildAndAttach();\n }", "public TelaJogos() {\n initComponents();\n setSize(1018,768);\n \n }", "public void setJBJScene(ActionEvent e) throws IOException {\n //System.out.println(\"Creating the scene for tic tac toe\");\n\n game = new JellyBeanJar(); // Create instance of JellyBeanJar\n //System.out.println(\"Class: \" + game.getClass().toString());\n\n // Get instance of the loader class\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"/FXML/JellyBeanJarFXML.fxml\"));\n Parent gameroot = loader.load(); // Load view into parent\n myctr = loader.getController();\n gameroot.getStylesheets().add(\"Styles/jelly-bean-jar.css\"); // Set style\n\n pScore = cScore = min = 0;\n max = 1000;\n\n myctr.setMinMaxLabel();\n\n root.getScene().setRoot(gameroot);\n }", "@Override\n\tpublic void show() {\n\t\tsuper.show();\n\t\t\n\t\tSkin skin = new Skin(Gdx.files.internal(\"Textos/uiskin.json\"));\n\t\tint miniheight= Gdx.graphics.getHeight()/8;\n\t\tint mitad= Gdx.graphics.getWidth()/2;\n\t\t//int miniwidth= Gdx.graphics.getWidth()/8;\n\t\t\n\t\t/*Botones*/\n\t\tbtnVolv = new TextButton(\"Back\", skin);\n\t\tbtnVolv.setPosition(0, 0);\n\t\tbtnVolv.setWidth(Gdx.graphics.getWidth()/2);\n\t\tbtnVolv.setHeight(miniheight);\n\t\tbtnVolv.addListener(QueHacemos(false));\n\t\tbtnGuardar = new TextButton(\"Save\", skin);\n\t\tbtnGuardar.setPosition(Gdx.graphics.getWidth()/2, 0);\n\t\tbtnGuardar.setWidth(Gdx.graphics.getWidth()/2);\n\t\tbtnGuardar.setHeight(miniheight);\n\t\tbtnGuardar.addListener(QueHacemos(true));\n\t\t\n\t\t/*Tabla */\n\t\t//Puntuacion\n\t\tLabel tapunt= new Label(\"\"+user.getPuntuacion(),skin);\n\t\ttapunt.setAlignment(Align.center);\n\t\ttapunt.setX(Gdx.graphics.getWidth()/2-tapunt.getWidth()/2);\n\t\ttapunt.setY(miniheight*7);\t\t\n\t\ttapunt.setFontScale(3);\n\t\ttapunt.setColor(0.9f,0.1f,0.1f,0.8f);\n\t\t\n\t\t//Definimos el label y el TextArea del nick\n\t\tLabel tlnick= new Label(\"NICK: \",skin);\n\t\ttlnick.setX(mitad-13-tlnick.getWidth());\n\t\ttlnick.setY(miniheight*5);\n\t\ttanick= new TextArea(user.getNick(), skin);\n\t\ttanick.setX(mitad+13);\n\t\ttanick.setY(miniheight*5-tanick.getHeight()/5);\t\t\n\t\ttanick.setAlignment(Align.bottom);\n\t\ttanick.setColor(1, 1, 1, -0.5f);\n\t\t\n\t\t//Checkbox\t\t\n\t\tchcksonido= new CheckBox(\"Sound\", skin);\n\t\tchcksonido.setX(mitad-chcksonido.getWidth()/2);\n\t\tchcksonido.setY(miniheight*3);\n\t\tchcksonido.left();\n\t\t//chcksonido.align(Align.right);\n\t\tchcksonido.setChecked(user.isSonido());\n\t\n\t\t//Escenario nuevo\n\t\tescenariopciones = new Stage(new ScreenViewport());\n\n\t\t//Le añadimos los distintos actores\n\t\tescenariopciones.addActor(tapunt);\n\t\tescenariopciones.addActor(tlnick);\n\t\tescenariopciones.addActor(tanick);\n\t\tescenariopciones.addActor(chcksonido);\n\t\t\t\n\t\t\t\n\t\tescenariopciones.addActor(btnVolv);\n\t\tescenariopciones.addActor(btnGuardar);\n\t\tGdx.input.setInputProcessor(escenariopciones);\n\t}", "public void act() \n {\n // Add your action code here.\n if (Greenfoot.mouseClicked(this)){\n World myWorld = getWorld();\n List<Crab> crabs = myWorld.getObjects(Crab.class);\n for(Crab c : crabs){\n // int y = Greenfoot.getRandomNumber(560);\n // int x = Greenfoot.getRandomNumber(560);\n //c.setLocation(x,y);\n // myWorld.removeObjects(crabs);\n }\n \n /*\n Crab c = new Crab();\n int y = Greenfoot.getRandomNumber(560);\n int x = Greenfoot.getRandomNumber(560);\n myWorld.addObject(c, x, y);\n */\n \n }\n}", "public void prepareEditor(){\n System.out.println(\"Prepare editor to be used !\");\r\n ((EditorScene)map.getScene()).initScene(20,20,map);\r\n ((EditorScene)map.getScene()).setController(this);\r\n builder.registerBasicEffect();\r\n ((EditorScene)map.getScene()).initListView(builder.getEffects(),selectEffects);\r\n\r\n\r\n\r\n }", "@Override\r\n public void act() \r\n {\n int posx = this.getX();\r\n int posy = this.getY();\r\n //calculamos las nuevas coordenadas\r\n int nuevox = posx + incx;\r\n int nuevoy = posy + incy;\r\n \r\n //accedemos al mundo para conocer su tamaño\r\n World mundo = this.getWorld();\r\n if(nuevox > mundo.getWidth())//rebota lado derecho\r\n {\r\n incx = -incx;\r\n }\r\n if(nuevoy > mundo.getHeight())//rebota en la parte de abajo\r\n {\r\n incy = -incy;\r\n }\r\n \r\n if(nuevoy < 0)//rebota arriba\r\n {\r\n incy = -incy;\r\n }\r\n if(nuevox < 0)//rebota izquierda\r\n {\r\n incx = -incx;\r\n }\r\n //cambiamos de posicion a la pelota\r\n this.setLocation(nuevox,nuevoy);\r\n }", "@Override\n public void vittoria() {\n Platform.runLater(() -> {\n /*Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Hai vinto\");\n alert.setHeaderText(\"Fine della partita\");\n alert.showAndWait();*/\n Parent root = null;\n Stage dialog = new Stage();\n try {\n root = FXMLLoader.load(Objects.requireNonNull(getClass().getClassLoader().getResource(\"winner.fxml\")));\n Scene s = new Scene(root);\n dialog.setScene(s);\n dialog.setTitle(\"Vittoria!\");\n dialog.getIcons().add(new Image(\"images/cm_boardgame.png\"));\n overlayedStage = dialog;\n overlayedStage.initOwner(thisStage);\n overlayedStage.initModality(Modality.APPLICATION_MODAL);\n overlayedStage.setResizable(false);\n overlayedStage.showAndWait();\n } catch (IOException e) {\n e.printStackTrace();\n }\n System.exit(0);\n });\n try {\n handlerClient.getServer().close();\n } catch (IOException e) {\n System.out.println();\n }\n }", "protected Scene buildScene() throws FileNotFoundException, NoSuchObjectException {\n SplitPane split = new SplitPane();\n Scene myGameScene = new Scene(split, 800, 600);\n split.setDividerPositions(0.35f, 0.6f);\n attachStyle(myGameScene, \"GameView\");\n\n Pane leftPane = getPane(myGameResourceBundle.getString(\"LeftPaneCss\"));\n buildLeftSplitPane(leftPane);\n SplitPane.setResizableWithParent(leftPane, Boolean.FALSE);\n Pane rightPane = getPane(myGameResourceBundle.getString(\"RightPaneCss\"));\n Entity player = getPlayerEntity();\n background = new ImageView(new Image(new FileInputStream(levelInfoParser.getBackgroundImage())));\n cameraView = new CameraView(player, myGameScene.heightProperty(), myGameScene.widthProperty());\n buildRightSplitPane(rightPane);\n cameraView.bindBackgroundImage(background);\n ImageView playerDisplay = cameraView.createPlayerDisplay(player);\n setUpGameOver(player);\n rightPane.getChildren().add(playerDisplay);\n split.getItems().addAll(leftPane, rightPane);\n SplitPane.setResizableWithParent(leftPane, Boolean.FALSE);\n myGameScene.setOnKeyPressed(e -> handleKeyPressed(e));\n cameraView.handleCamera(rightPane, playerDisplay,background);\n myGameScene.setOnKeyReleased(e->handleKeyReleased(e));\n rightPane.requestFocus();\n rightPane.setFocusTraversable(true);\n return myGameScene;\n }", "public void mainMenu(ActionEvent e) throws IOException {\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"/FXML/SelectGameFXML.fxml\"));\n Parent root = loader.load();\n gameroot.getScene().setRoot(root);\n }", "public VPacientes() {\n initComponents();\n inicializar();\n }", "@Override\n\tpublic void createScene()\n\t\n\t{\n\t loading = new Sprite (0,0,resourceManager.loadingRegion,vbo); // тупо ставим спрайт с картинкой\n\t\tattachChild(loading);\n\t}", "private void init(){\n stage = new Stage();\n inventory = Warrior.getInventory();\n\n Skin skin = new Skin(Gdx.files.internal(\"assets/skins/uiskin.json\"));\n\n dragAndDrop = new DragAndDrop();\n dragAndDrop.setDragActorPosition(-25,25); //offset of dragable item\n\n lootWindow = createView(skin);\n\n stage.addActor(lootWindow); // add window to stage\n }", "public RenderEngine() {\n\t\twindow = Window.getInstance();\n\t\t\n\t\ttestEntity = new Entity(\"skull/skull.obj\", \"./res/models/skull/skull.png\", new Vector3f(0,0,0), new Vector3f(0,0,0));\n\t\ttestEntity.getWorldTransform().setScaling(new Vector3f(0.01f,0.01f,0.01f));\n\t\t\n\t\ttestEntity2 = new Entity(\"dummy/dummy.obj\", \"./res/models/dummy/dummy.jpg\", new Vector3f(0,8,0), new Vector3f(0,0,0));\n\t\ttestEntity2.getWorldTransform().setScaling(new Vector3f(0.05f,0.05f,0.05f));\n\t\t\n\t\ttestLight = new Light(new Vector3f(-5,5,-5), new Vector3f(1,1,1));\n\t\ttestLight.getWorldTransform().setScaling(new Vector3f(0.1f,0.1f,0.1f));\n\t\t\n\t\tsky = new SkyDome();\n\t\t\n\t}", "public void loadNewGameView()\n\t{\n\t\ttry {\n\t\t\tprimaryStage.setTitle(\"Neues Spiel\");\n\t\t\tGridPane root = new GridPane();\n\t\t\tFXMLLoader loader = new FXMLLoader(getClass().getResource(\"/view/NewGame.fxml\"));\n\t\t\troot = loader.load();\n\t\t\tNewGameViewController viewController = (NewGameViewController) loader.getController();\n\t\t\tviewController.setOnitamaController(onitamaController);\n\t\t\tviewController.init();\n\n\t\t\tScene scene = new Scene(root);\n\t\t\t//((Stage) outerPane.getScene().getWindow()).setScene(scene);\n\t\t\tPlatform.runLater(() -> { LoadViewController.primaryStage.setScene(scene); });\n\t\t\t//LoadViewController.primaryStage.setScene(scene);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void loadGame() {\n game.loadGame();\n }", "public GameObject(String name, int x, int y) {\n this.image = GameObject.processing.loadImage(\"images\" + File.separator + name + \".png\");\n this.xPosition = x;\n this.yPosition = y;\n this.active = true;\n }", "public Parent createContent(){\n Pane root = new Pane();\n root.setPrefSize((dimension * tileSize)+(tileSize*4)+menuWidth, (dimension * tileSize)+(tileSize*4));\n root.getChildren().addAll(tileGroup);\n TopOfBoard top = new TopOfBoard();\n Parent controlsAndMovement = top.newScene();\n root.getChildren().addAll(controlsAndMovement);\n\n // setting main game board template\n for (int i = 0; i< dimension; i++){\n for (int j = 0; j< dimension; j++){\n if (i==0||i== dimension -1||j==0||j== dimension -1){\n if (i==0) {\n if (j==0){\n tileInit(i, j, tileGroup, tileSize * 2, tileSize * 2, j * tileSize, i * tileSize);\n }\n else if (j== dimension -1){\n tileInit(i, j, tileGroup, tileSize*2, tileSize*2, (j * tileSize)+tileSize, i * tileSize);\n }\n else {\n tileInit(i, j, tileGroup, tileSize*2, tileSize, (j * tileSize)+tileSize, i * tileSize);\n }\n }\n else if (i== dimension -1){\n if (j==0){\n tileInit(i, j, tileGroup, tileSize*2, tileSize*2, j * tileSize, (i * tileSize)+tileSize);\n }\n else if (j== dimension -1){\n tileInit(i, j, tileGroup, tileSize*2, tileSize*2, (j * tileSize)+tileSize, (i * tileSize)+tileSize);\n }\n else {\n tileInit(i, j, tileGroup, tileSize * 2, tileSize, (j * tileSize) + tileSize, (i * tileSize) + tileSize);\n }\n }\n else if (j==0){\n tileInit(i, j, tileGroup, tileSize, tileSize*2, j * tileSize, (i * tileSize)+(tileSize));\n\n }\n else if (j== dimension -1) {\n tileInit(i, j, tileGroup, tileSize, tileSize*2, (j * tileSize)+(tileSize), (i * tileSize)+tileSize);\n }\n\n }\n }\n\n // Setting player score board\n for (int q = 1; q <= numOfPlayers; q++){\n if (q == 1){\n Tile tile = new Tile((getTileSize()*2), (getTileSize()*4));\n tile.setTranslateX((getTileSize()* getDimension())+(getTileSize()*3));\n tile.setTranslateY(getTileSize()*3);\n Text text = new Text((getTileSize()* getDimension())+(getTileSize()*4), (getTileSize()*3.5), \"Player 1 score board:\");\n tileGroup.getChildren().addAll(tile, text);\n }\n else if (q == 2){\n Tile tile = new Tile((getTileSize()*2), (getTileSize()*4));\n tile.setTranslateX((getTileSize()* getDimension())+(getTileSize()*3));\n tile.setTranslateY(getTileSize()*5);\n Text text = new Text((getTileSize()* getDimension())+(getTileSize()*4), (getTileSize()*5.5), \"Player 2 score board:\");\n tileGroup.getChildren().addAll(tile, text);\n }\n else if (q == 3){\n Tile tile = new Tile((getTileSize()*2), (getTileSize()*4));\n tile.setTranslateX((getTileSize()* getDimension())+(getTileSize()*3));\n tile.setTranslateY(getTileSize()*7);\n Text text = new Text((getTileSize()* getDimension())+(getTileSize()*4), (getTileSize()*7.5), \"Player 3 score board:\");\n tileGroup.getChildren().addAll(tile, text);\n }\n else if (q == 4){\n Tile tile = new Tile((getTileSize()*2), (getTileSize()*4));\n tile.setTranslateX((getTileSize()* getDimension())+(getTileSize()*3));\n tile.setTranslateY(getTileSize()*9);\n Text text = new Text((getTileSize()* getDimension())+(getTileSize()*4), (getTileSize()*9.5), \"Player 4 score board:\");\n tileGroup.getChildren().addAll(tile, text);\n }\n\n }\n\n for (int r = 1; r <= numOfPlayers; r++) {\n if (r == 1) {\n Tile tile = new Tile((getTileSize() * 3), (getTileSize() * 4));\n tile.setTranslateX((getTileSize() * getDimension()) + (getTileSize() * 7));\n tile.setTranslateY(0);\n Text text = new Text((getTileSize() * getDimension()) + (getTileSize() * 8), (getTileSize() * 0.5), \"Player 1 owned cards:\");\n tileGroup.getChildren().addAll(tile, text);\n } else if (r == 2) {\n Tile tile = new Tile((getTileSize() * 3), (getTileSize() * 4));\n tile.setTranslateX((getTileSize() * getDimension()) + (getTileSize() * 7));\n tile.setTranslateY(getTileSize() * 3);\n Text text = new Text((getTileSize() * getDimension()) + (getTileSize() * 8), (getTileSize() * 3.5), \"Player 2 owned cards:\");\n tileGroup.getChildren().addAll(tile, text);\n } else if (r == 3) {\n Tile tile = new Tile((getTileSize() * 3), (getTileSize() * 4));\n tile.setTranslateX((getTileSize() * getDimension()) + (getTileSize() * 7));\n tile.setTranslateY(getTileSize() * 6);\n Text text = new Text((getTileSize() * getDimension()) + (getTileSize() * 8), (getTileSize() * 6.5), \"Player 3 owned cards:\");\n tileGroup.getChildren().addAll(tile, text);\n } else if (r == 4) {\n Tile tile = new Tile((getTileSize() * 3), (getTileSize() * 4));\n tile.setTranslateX((getTileSize() * getDimension()) + (getTileSize() * 7));\n tile.setTranslateY(getTileSize() * 9);\n Text text = new Text((getTileSize() * getDimension()) + (getTileSize() * 8), (getTileSize() * 9.5), \"Player 4 owned cards:\");\n tileGroup.getChildren().addAll(tile, text);\n\n }\n }\n addImg();\n }\n return root;\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 abstract void gameObjectAwakens();", "public VuePlateaux(JFrame frame,GameManager gm){\n super();\n this.frame = frame;\n frame.setPreferredSize(new Dimension(1200,500));\n gm.addObserver(this);\n this.shown = false;\n this.gm = gm;\n this.save = new JButton(\"sauvegarder\");\n this.contentIAdversaire = new JPanel();\n this.contentJoueur = new JPanel();\n this.plateaux = new JPanel();\n this.munitions = new JPanel();\n this.options = new JPanel();\n this.retourMenu = new JButton(\"Retourner au Menu\");\n setAffichage();\n }", "private void createButtons() {\n Texture playButtonIdle, playButtonPressed,settingsButtonIdle, settingsButtonPressed, creditsButtonIdle, creditsButtonPressed;\n\n if(game.getLocale().getCountry().equals(\"FI\")){\n playButtonIdle = game.getAssetManager().get(\"BUTTONS/button_startgame_FIN.png\");\n playButtonPressed = game.getAssetManager().get(\"BUTTONS/button_startgame_FIN_PRESSED.png\");\n\n settingsButtonIdle = game.getAssetManager().get(\"BUTTONS/button_startsettings_FIN.png\");\n settingsButtonPressed = game.getAssetManager().get(\"BUTTONS/button_startsettings_FIN_PRESSED.png\");\n\n creditsButtonIdle = game.getAssetManager().get(\"BUTTONS/button_credits_FIN.png\");\n creditsButtonPressed = game.getAssetManager().get(\"BUTTONS/button_credits_FIN_PRESSED.png\");\n }else{\n playButtonIdle = game.getAssetManager().get(\"BUTTONS/button_startgame_ENG.png\");\n playButtonPressed = game.getAssetManager().get(\"BUTTONS/button_startgame_ENG_PRESSED.png\");\n\n settingsButtonIdle = game.getAssetManager().get(\"BUTTONS/button_startsettings_ENG.png\");\n settingsButtonPressed = game.getAssetManager().get(\"BUTTONS/button_startsettings_ENG_PRESSED.png\");\n\n creditsButtonIdle = game.getAssetManager().get(\"BUTTONS/button_credits_ENG.png\");\n creditsButtonPressed = game.getAssetManager().get(\"BUTTONS/button_credits_ENG_PRESSED.png\");\n }\n\n ImageButton playButton = new ImageButton(new TextureRegionDrawable(new TextureRegion(playButtonIdle)), new TextureRegionDrawable(new TextureRegion(playButtonPressed)));\n\n playButton.setPosition(95, 12);\n stage.addActor(playButton);\n\n playButton.addListener(new ChangeListener() {\n // This method is called whenever the actor is clicked. We override its behavior here.\n @Override\n public void changed(ChangeEvent event, Actor actor) {\n game.setScreen(gameScreen);\n }\n });\n\n ImageButton settingsButton = new ImageButton(new TextureRegionDrawable(new TextureRegion(settingsButtonIdle)), new TextureRegionDrawable(new TextureRegion(settingsButtonPressed)));\n\n settingsButton.setPosition(175, 12);\n stage.addActor(settingsButton);\n\n settingsButton.addListener(new ChangeListener() {\n // This method is called whenever the actor is clicked. We override its behavior here.\n @Override\n public void changed(ChangeEvent event, Actor actor) {\n game.setScreen(new OptionsScreen(game));\n }\n });\n\n ImageButton creditsButton = new ImageButton(new TextureRegionDrawable(new TextureRegion(creditsButtonIdle)), new TextureRegionDrawable(new TextureRegion(creditsButtonPressed)));\n\n creditsButton.setPosition(15, 12);\n stage.addActor(creditsButton);\n\n creditsButton.addListener(new ChangeListener() {\n // This method is called whenever the actor is clicked. We override its behavior here.\n @Override\n public void changed(ChangeEvent event, Actor actor) {\n game.setScreen(new CreditsScreen(game));\n }\n });\n }", "public static void classInit(){\n //set up font\n //font = WurfelEngine.getInstance().manager.get(\"com/BombingGames/WurfelEngine/EngineCore/arial.fnt\"); //load font\n font = new BitmapFont(false);\n //font.scale(2);\n\n\n font.setColor(Color.GREEN);\n //font.scale(-0.5f);\n \n //load sprites\n Block.loadSheet();\n addInputProcessor(staticStage);\n skin = new Skin(Gdx.files.internal(\"com/BombingGames/WurfelEngine/Core/skin/uiskin.json\"));\n GameplayScreen.msgSystem().viewInit(skin,Gdx.graphics.getWidth()/2, Gdx.graphics.getHeight()/4);\n }", "@Override\n protected Scene onCreateScene() {\n this.getWindowManager().getDefaultDisplay().getMetrics(metrics);\n this.mEngine.registerUpdateHandler(new FPSLogger());\n inventoryEntity.attachChild(new Rectangle(0,0,125,780,new VertexBufferObjectManager()));\n viennaPracticeScene.attachChild(inventoryEntity);\n\n final Entity doorEntity = new Entity(50,270,100,100);\n Rectangle r = new Rectangle(0,0,120,300,new VertexBufferObjectManager());\n r.setSkewY(-20);\n r.setColor(Color.BLACK);\n doorEntity.attachChild(r);\n viennaPracticeScene.attachChild(doorEntity);\n\n final Entity beethovenEntity = new Entity(CAMERA_WIDTH/2,CAMERA_HEIGHT/2);\n beethovenEntity.attachChild(beethovenSprite);\n viennaPracticeScene.attachChild(beethovenEntity);\n\n final Text beethovenSpeech = new Text(0, 70, this.font, \"...Alas!\\nI, the great Beethoven, have broken my strings!\", this.getVertexBufferObjectManager());\n beethovenSpeech.setWidth(850);\n beethovenSpeech.setAutoWrap(AutoWrap.NONE);\n beethovenSpeech.setHorizontalAlign(HorizontalAlign.CENTER);\n\n guitarStringSprite.setColor(Color.WHITE);\n guitarStringSprite.setOnClickListener(new ButtonSprite.OnClickListener() {\n @Override\n public void onClick(ButtonSprite pButtonSprite, float pTouchAreaLocalX, float pTouchAreaLocalY) {\n toggleColor();\n ViennaPracticeActivity.this.game.handleItemClick(new GuitarStrings(player));\n }\n });\n viennaPracticeScene.registerTouchArea(guitarStringSprite);\n\n beethovenSprite.setOnClickListener(new ButtonSprite.OnClickListener() {\n @Override\n public void onClick(ButtonSprite pButtonSprite, float pTouchAreaLocalX, float pTouchAreaLocalY) {\n beethovenEntity.attachChild(beethovenSpeech);\n Timer timer = new Timer();\n Long delayTime = (long) (30 * 100);\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n beethovenEntity.detachChild(beethovenSpeech);\n }\n }, delayTime);\n }\n });\n viennaPracticeScene.registerTouchArea(beethovenSprite);\n\n viennaPracticeScene.setOnSceneTouchListener(new IOnSceneTouchListener() {\n @Override\n public boolean onSceneTouchEvent(Scene pScene, TouchEvent pSceneTouchEvent) {\n float xCoordinate = pSceneTouchEvent.getX();\n float yCoordinate = pSceneTouchEvent.getY();\n if (pSceneTouchEvent.isActionDown() && pSceneTouchEvent.getX() < 70) {\n Intent startIntent = new Intent(ViennaPracticeActivity.this.getApplication(), ViennaStreetActivity.class);\n startIntent.putExtra(\"game\", game);\n ViennaPracticeActivity.this.startActivity(startIntent);\n ViennaPracticeActivity.this.finish();\n ViennaPracticeActivity.this.game.switchToScene(jlstanford.bsu.edu.game.Scene.VIENNA_STREET);\n } else if (pSceneTouchEvent.isActionDown() && ((xCoordinate < 335 && xCoordinate > 263) && (yCoordinate < 284 && yCoordinate > 124))) {\n player = ViennaPracticeActivity.this.game.getPlayer();\n ViennaPracticeActivity.this.game.handleItemClick(new GuitarStrings(player));\n ViennaPracticeActivity.this.toastOnUiThread(\"Got Guitar Strings!\");\n loadInventoryItems();\n } else {\n }\n return false;\n }\n });\n\n loadInventoryItems();\n final Sprite spriteBG = new Sprite(405,240,CAMERA_WIDTH,CAMERA_HEIGHT,this.backgroundTiledTextureRegion,this.getVertexBufferObjectManager());\n SpriteBackground bg = new SpriteBackground(spriteBG);\n viennaPracticeScene.setBackground(bg);\n\n return viennaPracticeScene;\n }", "protected void inicializar(){\n kr = new CreadorHojas(wp);\n jPanel1.add(wp,0); // inserta el workspace en el panel principal\n wp.insertarHoja(\"Hoja 1\");\n //wp.insertarHoja(\"Hoja 2\");\n //wp.insertarHoja(\"Hoja 3\");\n }", "public OverworldScreen(Game game) {\n super(\"OverworldScreen\", game);\n\n mScreenViewport = new ScreenViewport(0, 0, mGame.getScreenWidth(),\n mGame.getScreenHeight());\n if (mScreenViewport.width > mScreenViewport.height)\n mLayerViewport = new LayerViewport(240.0f, 240.0f\n * mScreenViewport.height / mScreenViewport.width, 240,\n 240.0f * mScreenViewport.height / mScreenViewport.width);\n else\n mLayerViewport = new LayerViewport(240.0f * mScreenViewport.height\n / mScreenViewport.width, 240.0f, 240.0f\n * mScreenViewport.height / mScreenViewport.width, 240);\n\n // Load in the bitmaps used on the main menu screen\n AssetStore assetManager = mGame.getAssetManager();\n\n\n assetManager.loadAndAddBitmap(\"LocationArrow\", \"img/LocationArrow.png\");\n assetManager.loadAndAddBitmap(\"OverworldMap\", \"img/OverworldMap.png\");\n\n // Define the spacing that will be used to position the buttons\n int spacingX = game.getScreenWidth() / 5;\n int spacingY = game.getScreenHeight() / 3;\n\n mOverworldMap = new GameObject(LEVEL_WIDTH / 2.0f,\n LEVEL_HEIGHT / 2.0f, LEVEL_WIDTH, LEVEL_HEIGHT, getGame()\n .getAssetManager().getBitmap(\"OverworldMap\"), this);\n\n // Create the trigger buttons\n mLocationButton = new PushButton(\n spacingX * 1.0f, spacingY * 1.5f, spacingX*.16f, spacingY*0.1f, \"LocationArrow\", this);\n mLocationButton1 = new PushButton(\n spacingX * 2.0f, spacingY * 1.5f, spacingX*.16f, spacingY*0.1f, \"LocationArrow\", this);\n mLocationButton2 = new PushButton(\n spacingX * 3.0f, spacingY * 1.5f, spacingX*.16f, spacingY*0.1f, \"LocationArrow\", this);\n mLocationButton3 = new PushButton(\n spacingX * 4.0f, spacingY * 1.5f, spacingX*.16f, spacingY*0.1f, \"LocationArrow\", this);\n mLocationButton4 = new PushButton(\n spacingX * 5.0f, spacingY * 1.5f, spacingX*.16f, spacingY*0.1f, \"LocationArrow\", this);\n\n\n }", "void playGame(MarbleSolitaireModel model);", "public void setScene(Scene scene){\n this.scene = scene;\n }", "public PokeSceneWithBlastoiseCharizard() {\n BackgroundImage blastoise = new BackgroundImage(\"blastoise.png\", 350, 80, 300);\n BackgroundImage charizard = new BackgroundImage(\"charizard.png\", 400, 800, 300);\n\n sceneNodes.getChildren().add(blastoise);\n sceneNodes.getChildren().add(charizard);\n }", "private static void inicializarComponentes() {\n\t\tgaraje = new Garaje();\r\n\t\tgarajeController=new GarajeController();\r\n\t\tgarajeController.iniciarPlazas();\r\n\t\t\r\n\t\tmenuInicio = new StringBuilder();\r\n\t\tmenuInicio.append(\"¡Bienvenido al garaje!\\n\");\r\n\t\tmenuInicio.append(\"****************************************\\n\");\r\n\t\tmenuInicio.append(\"9: Guardar Plazas\\n\");\r\n\t\tmenuInicio.append(\"0: Listar Plazas\\n\");\r\n\t\tmenuInicio.append(\"1: Listar Plazas Coche\\n\");\r\n\t\tmenuInicio.append(\"2: Listar Plazas Moto\\n\");\r\n\t\tmenuInicio.append(\"3: Reservar Plaza\\n\");\r\n\t\tmenuInicio.append(\"4: Listar Plazas Libres\\n\");\r\n\t\tmenuInicio.append(\"5: Listar Clientes\\n\");\r\n\t\tmenuInicio.append(\"6: Listar Vehículos\\n\");\r\n//\t\tmenuInicio.append(\"7:\\n\");\r\n//\t\tmenuInicio.append(\"8:\\n\");\r\n\t}", "@FXML\n private void InterfaceAjoutCategorie(ActionEvent event) throws IOException {\n \n \n Stage stage = new Stage();\n Parent root1;\n \n root1 = FXMLLoader.load(getClass().getResource(\"/com/thinklance/pidev/GUI/AjoutCategorie.fxml\"));\n \n stage.setResizable(false);\n stage.centerOnScreen();\n Scene scene = new Scene(root1);\n stage.setScene(scene);\n stage.show();\n }", "public void VuforiaOrientator() {\n }", "private void prepare()\n {\n addObject(player,185,196);\n player.setLocation(71,271);\n Ground ground = new Ground();\n addObject(ground,300,360);\n invent invent = new invent();\n addObject(invent,300,375);\n }", "public WorldEditor() {\n \t\tthis.layers = new LinkedList<TextureLayer>();\n \t\tthis.setMinimumSize(new Dimension(1024, 768));\n \t\tContainer c = getContentPane();\n \t\tc.setLayout(new BorderLayout());\n \t\ttry {\n \t\t\tList<Tuple> ui = SADDL.parse(new InputStreamReader(getClass()\n \t\t\t\t\t.getResourceAsStream(\"res/menubar.sdl\")));\n \t\t\tfor (Tuple tuple : ui) {\n \t\t\t\tif (tuple.getKey().equalsIgnoreCase(\"MenuBar\")) {\n \t\t\t\t\tsetJMenuBar(new JKMenuBar((List<Tuple>) tuple.getValue()));\n \t\t\t\t}\n \t\t\t}\n \t\t\t// for the moment lets do it by hand, soemday well make it data\n \t\t\t// driven\n \t\t\tEnumButtonBar bar = new EnumButtonBar<ModeEnum>(ModeEnum.values());\n \t\t\tbar.addListener(new EnumButtonBarListener() {\n \n \t\t\t\t@Override\n \t\t\t\tpublic void enumSet(Enum actualEnum) {\n \t\t\t\t\tcurrentMode = (ModeEnum)actualEnum;\n \t\t\t\t\tif(currentMode == ModeEnum.Raise || currentMode == ModeEnum.Lower || currentMode == ModeEnum.Smooth\n \t\t\t\t\t\t\t|| currentMode == ModeEnum.Paint || currentMode == ModeEnum.Erase) {\n \t\t\t\t\t\tif(world == null || terrainView == null) return;\n \t\t\t\t\t\tif(brush.getParent() == null) world.attachChild(brush);\n \t\t\t\t\t} else {\n \t\t\t\t\t\tif(world == null || terrainView == null) return;\n \t\t\t\t\t\tworld.detachChild(brush);\n \t\t\t\t\t}\n \t\t\t\t\tif(currentMode == ModeEnum.Raise || currentMode == ModeEnum.Lower || currentMode == ModeEnum.Smooth) {\n \t\t\t\t\t\tbrush.setColor(ColorRGBA.red);\n \t\t\t\t\t} else if(currentMode == ModeEnum.Paint || currentMode == ModeEnum.Erase) {\n \t\t\t\t\t\tbrush.setColor(ColorRGBA.blue);\n \t\t\t\t\t}\n \t\t\t\t\tmouseListener.setMode(currentMode);\n \t\t\t\t\tbrush.updateRenderState();\n \t\t\t\t}\n \t\t\t});\n \t\t\tc.add(bar, BorderLayout.NORTH);\n \t\t\tviewPanel = new JPanel();\n \t\t\tviewPanel.setName(\"View\");\n \t\t\tviewPanel.setLayout(new BorderLayout());\n \t\t\tviewPanel.setBorder(new TitledBorder(new LineBorder(Color.BLACK),\n \t\t\t\"View\"));\n \t\t\tc.add(viewPanel, BorderLayout.CENTER);\n \t\t\tconsolePane = new JTabbedPane();\n \t\t\tconsolePane.setPreferredSize(new Dimension(800, 100));\n \t\t\tconsolePane.setName(\"Console Pane\");\n \t\t\tJPanel consolePanel = new JPanel();\n \t\t\tconsolePanel.setLayout(new BorderLayout());\n \t\t\tconsoleOutput = new JTextArea();\n \t\t\tconsolePanel.add(consoleOutput, BorderLayout.CENTER);\n \t\t\tconsolePane.addTab(\"Console\", new JScrollPane(consolePanel));\n \t\t\tc.add(consolePane, BorderLayout.SOUTH);\n \t\t\tprojectPane = new JTabbedPane();\n \t\t\ttreeScrollPane = new JPanel();\n \t\t\ttreeScrollPane.setLayout(new BorderLayout());\n \t\t\tprojectPane.addTab(\"Scene Graph\", treeScrollPane);\n \t\t\tJPanel texturePanel = new JPanel();\n \t\t\ttextures = new PopUpList(new DefaultListModel());\n \t\t\ttextures.addListSelectionListener(new ListSelectionListener(){\n \n \t\t\t\t@Override\n \t\t\t\tpublic void valueChanged(ListSelectionEvent e) {\n \t\t\t\t\tselectedLayer = (TextureLayer)textures.getSelectedValue();\n \t\t\t\t}});\n \n \t\t\ttexturePanel.add(new JScrollPane(textures));\n \t\t\t// add menu items to texture popup menu\n \t\t\tJMenuItem deleteTexture = new JMenuItem(\"Delete\");\n \t\t\tdeleteTexture.addActionListener(new ActionListener(){\n \n \t\t\t\t@Override\n \t\t\t\tpublic void actionPerformed(ActionEvent e) {\n \t\t\t\t\tTextureManager.releaseTexture(selectedLayer.getAlpha());\n \t\t\t\t\tTextureManager.releaseTexture(selectedLayer.getColor());\n \t\t\t\t\tterrainView.detachPass(selectedLayer.getPass());\n \t\t\t\t\tterrainView.updateRenderState();\n \t\t\t\t\tDefaultListModel model = (DefaultListModel) textures.getModel();\n \t\t\t\t\tmodel.remove(textures.getSelectedIndex());\n \t\t\t\t\ttextures.repaint();\n \t\t\t\t}});\n \t\t\ttextures.addToPopup(deleteTexture);\n \t\t\tprojectPane.addTab(\"Texture Layers\",textures);\n \t\t\tprojectPane.setPreferredSize(new Dimension(200, 400));\n \t\t\tc.add(projectPane, BorderLayout.WEST);\n \t\t\tJPanel eastPanel = new JPanel();\n \t\t\teastPanel.setLayout(new GridLayout(2, 1));\n \t\t\tobjectAttr = new JPanel();\n \t\t\tobjectAttr.setName(\"Object Attributes\");\n \t\t\tobjectAttr.setBorder(new TitledBorder(new LineBorder(Color.BLACK), \"Object Attributes\"));\n \t\t\tobjectAttr.setLayout(new BorderLayout());\n \t\t\tobjectAttrTable = new AttributeEditor();\n \t\t\tobjectAttr.add(new JScrollPane(objectAttrTable),\n \t\t\t\t\tBorderLayout.CENTER);\n \t\t\teastPanel.add(objectAttr);\n \t\t\ttoolAttr = new JPanel();\n \t\t\ttoolAttr.setBorder(new TitledBorder(new LineBorder(Color.BLACK),\n \t\t\t\"Tool Attributes\"));\n \t\t\ttoolAttr.setLayout(new BorderLayout());\n \t\t\ttoolAttrTable = new AttributeEditor();\n \t\t\ttoolAttrTable.addListener(new AttributeEditorListener(){\n \t\t\t\t@Override\n \t\t\t\tpublic void attributeChanged(String key, String value) {\n \t\t\t\t\tif(key.equalsIgnoreCase(\"radius\")) {\n \t\t\t\t\t\tbrush.setRadius(Float.valueOf(value));\n \t\t\t\t\t} else if(key.equalsIgnoreCase(\"intensity\")) {\n \t\t\t\t\t\tbrush.setIntensity(Float.valueOf(value));\n \t\t\t\t\t}\n \t\t\t\t}});\n \t\t\ttoolAttr.add(new JScrollPane(toolAttrTable), BorderLayout.CENTER);\n \t\t\teastPanel.add(toolAttr);\n \t\t\teastPanel.setPreferredSize(new Dimension(200, 400));\n \t\t\tc.add(eastPanel, BorderLayout.EAST);\n \t\t\tsetDefaultCloseOperation(this.DISPOSE_ON_CLOSE);\n \t\t\timpl = new WorldEditorCanvasImpl(800, 600);\n \t\t\tset3DCanvas(impl);\n \t\t\tinitProperties();\n \t\t\t((JKMenuBar) getJMenuBar())\n \t\t\t.addListener(new WorldEditorMenuListener() {\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doAttachTo() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateDirectionalLight() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateLineParticle() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreatePointLight() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateProjectedWater() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateQuadParticle() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateQuadWater() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateSpotLight() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateTextureLayer() {\n \t\t\t\t\tif(world == null || terrainView == null) return;\n \t\t\t\t\tJFileChooser chooser = new JFileChooser();\n \t\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\n \t\t\t\t\t\t\t\"Color Map Images\", \"jpg\",\"bmp\",\"tga\");\n \t\t\t\t\tchooser.setFileFilter(filter);\n \t\t\t\t\tint returnVal = chooser.showOpenDialog(WorldEditor.this);\n \t\t\t\t\tif (returnVal != JFileChooser.APPROVE_OPTION){\n \t\t\t\t\t\treturn;\n \t\t\t\t\t}\n \t\t\t\t\tFile colorMap = chooser.getSelectedFile();\n \t\t\t\t\tfilter = new FileNameExtensionFilter(\n \t\t\t\t\t\t\t\"AlphaMapImage\", \"tga\", \"png\");\n \t\t\t\t\tchooser.setFileFilter(filter);\n \t\t\t\t\treturnVal = chooser.showOpenDialog(WorldEditor.this);\n \t\t\t\t\tif (returnVal != JFileChooser.APPROVE_OPTION){\n \t\t\t\t\t\treturn;\n \t\t\t\t\t}\n \t\t\t\t\tFile alphaMap = chooser.getSelectedFile();\n \t\t\t\t\tDefaultListModel mdl = (DefaultListModel) textures.getModel();\n \t\t\t\t\tfloat xBound = ((BoundingBox)terrainView.getTerrainCluster().getWorldBound()).xExtent;\n \t\t\t\t\tfloat zBound = ((BoundingBox)terrainView.getTerrainCluster().getWorldBound()).zExtent;\n \t\t\t\t\tTextureLayer layer = new TextureLayer(colorMap,alphaMap, xBound, zBound);\n \t\t\t\t\tlayers.add(layer);\n \t\t\t\t\tmdl.add(mdl.size(),layer);\n \t\t\t\t\tterrainView.attachPass(layer.createPass(blend));\n \t\t\t\t\tterrainView.updateRenderState();\n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doCreateWorld() {\n \t\t\t\t\tString[] names = new String[EWorld.values().length];\n \t\t\t\t\tfor (int i = 0; i < names.length; i++) {\n \t\t\t\t\t\tnames[i] = EWorld.values()[i].name();\n \t\t\t\t\t}\n \t\t\t\t\tString selected = (String) JOptionPane\n \t\t\t\t\t.showInputDialog(WorldEditor.this,\n \t\t\t\t\t\t\t\"What kind of world\",\n \t\t\t\t\t\t\t\"Create World\",\n \t\t\t\t\t\t\tJOptionPane.PLAIN_MESSAGE, null,\n \t\t\t\t\t\t\tnames, names[0]);\n \t\t\t\t\tif (selected == null)\n \t\t\t\t\t\treturn;\n \t\t\t\t\tEWorld selectedEworld = EWorld.valueOf(selected);\n \t\t\t\t\tworld = new EditableWorld(selectedEworld);\n \t\t\t\t\ttreeModel.addChild(impl.getRootNode(), world);\n \t\t\t\t\tWorldEditor.this.repaint();\n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doDettachFromParent() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doExit() {\n \t\t\t\t\tdispose();\n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doExportWorld() {\n \t\t\t\t\tdlg = new ExportDialog(WorldEditor.this);\n \t\t\t\t\tif (dlg.showDialog()){\n \t\t\t\t\t\texportAction = new Callable() {\n \t\t\t\t\t\t\t@Override\n \t\t\t\t\t\t\tpublic Object call() throws Exception {\n \t\t\t\t\t\t\t\t\tif(dlg.hasFile()) {\n \t\t\t\t\t\t\t\t\t\tCloneImportExport cloner = new CloneImportExport();\n \t\t\t\t\t\t\t\t\t\tcloner.saveClone(world);\n \t\t\t\t\t\t\t\t\t\tEditableWorld cloneWorld = (EditableWorld)cloner.loadClone();\n \t\t\t\t\t\t\t\t\t\tWorld node = (World)cloneWorld.constructFinal();\n \t\t\t\t\t\t\t\t\t\tif(!dlg.exportTextures()) {\n \t\t\t\t\t\t\t\t\t\t\tthis.stripTexure(node);\n \t\t\t\t\t\t\t\t\t\t} else {\n \t\t\t\t\t\t\t\t\t\t\twhile(!layers.isEmpty()) {\n \t\t\t\t\t\t\t\t\t\t\t\tthis.exportAlpha(layers.pop());\n \t\t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\t\t\t\tBinaryExporter.getInstance().save(node, dlg.getFile());\n \t\t\t\t\t\t\t\t\t\t} catch (IOException e) {\n \t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\treturn null;\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\tprivate void stripTexure(Node node) {\n \t\t\t\t\t\t\t\tnode.clearRenderState(RenderState.RS_TEXTURE);\n \t\t\t\t\t\t\t\tfor(int i = 0; i < node.getQuantity(); i++) {\n \t\t\t\t\t\t\t\t\tSpatial child = node.getChild(i);\n \t\t\t\t\t\t\t\t\tif(child instanceof PassNode) ((PassNode)child).clearAll();\n \t\t\t\t\t\t\t\t\telse if(child instanceof Node) this.stripTexure((Node)child);\n \t\t\t\t\t\t\t\t\telse child.clearRenderState(RenderState.RS_TEXTURE);\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\tprivate void exportAlpha(TextureLayer layer) {\n \t\t\t\t\t\t\t\tString raw = dlg.getFile().getPath();\n \t\t\t\t\t\t\t\tString path = raw.substring(0, raw.lastIndexOf(\"\\\\\")+1) + layer.getAlphaName() + EDataType.Texture.getExtension();\n \t\t\t\t\t\t\t\tFile file = new File(path);\n \t\t\t\t\t\t\t\ttry {file.createNewFile();} catch (IOException e) {e.printStackTrace();}\n \t\t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\t\tBinaryExporter.getInstance().save(layer.getAlpha().getImage(), file);\n \t\t\t\t\t\t\t\t} catch (IOException e) {\n \t\t\t\t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t};\n \t\t\t\t\t}\n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doExportSelected() {\n \t\t\t\t\tExportDialog dlg = new ExportDialog(WorldEditor.this);\n \t\t\t\t\tif (dlg.showDialog()){\n \t\t\t\t\t\tString exportName = dlg.getName();\n \t\t\t\t\t\tboolean exportTextures = dlg.exportTextures();\n \t\t\t\t\t}\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doHelp() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doImportModel() {\n \t\t\t\t\t// TODO\n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doModelPerspective() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doMove() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doNew() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doOpen() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doRotateX() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doRotateY() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doRotateZ() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \n \t\t\t\t@Override\n \t\t\t\tpublic void doWorldPerspective() {\n \t\t\t\t\t// TODO Auto-generated method stub\n \n \t\t\t\t}\n \t\t\t});\n \n \t\t\tpack();\n \t\t\tsetSize(800, 600);\n \t\t\tsetVisible(true);\n \t\t\t// Note, this requires youi to refresh the canvas whenever a change\n \t\t\t// is\n \t\t\t// made to re-render it. If you want automatic refresh agt the cost\n \t\t\t// of\n \t\t\t// some performance, uncomment this line...\n \t\t\t// /startAutoRefresh(canvas);\n \t\t} catch (IOException ex) {\n \t\t\tLogger.getLogger(WorldEditor.class.getName()).log(Level.SEVERE,\n \t\t\t\t\tnull, ex);\n \t\t}\n \t}", "public static void main(String[] args) {\r\n\t\tJFrame miMarco = new JFrame(\"Ejemplo del Manejo del Teclado\");\r\n\t\t\r\n\t\t/* Se le otorga un tamaño a la ventana */\r\n\t\tmiMarco.setSize(512, 512);\r\n\t\t\r\n\t\t/* Nos aseguramos que al cerrar la ventana el programa finalice */\r\n\t\tmiMarco.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\r\n\t\t/* Se crea el objeto GLJPanel */\r\n\t\tmiLienzo = new GLJPanel();\r\n\r\n\t\t/* Se crea una instancia de la Clase */\r\n\t\tEjemploTeclado miPanel = new EjemploTeclado();\r\n\r\n\t\t/* Se adiciona los eventos del OpenGL al GLJPanel */\r\n\t\tmiLienzo.addGLEventListener(miPanel);\r\n\t\t\r\n\t\t/* Indicamos que el GLJPanel detecte los eventos del teclado */\r\n\t\tmiLienzo.addKeyListener((KeyListener) miPanel);\r\n\t\t\r\n\t\t/* Coloca miLienzo activo para que detecte los eventos del teclado */\r\n\t\tmiLienzo.setFocusable(true);\r\n\r\n\t\t/* Añadimos el GLJPanel al Componente del JFrame */\r\n\t\tmiMarco.getContentPane().add(miLienzo);\r\n\r\n\t\t/* Por ultimo hacemos visible el elemento de mayor nivel */\r\n\t\tmiMarco.setVisible(true);\r\n\t\t\r\n\t}", "public void set() {\n\n\t\tStage newWindow = new Stage();\n\t\tnewWindow.setScene(scene);\n\t\tnewWindow.initModality(Modality.WINDOW_MODAL);\n\t\tnewWindow.initOwner(primaryStage);\n\n\t\tnewWindow.show();\n\n\t\tCircle cir = new Circle(num*36.5+117.5, num*73+145, 70);\n\t\tcir.setFill(Color.ALICEBLUE);\n\t\troot.getChildren().add(cir);\n\n\t\tImage i = null;\n\t\ttry {\n\t\t\ti = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/Button - ?.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tCircle cirI = new Circle(50, num*73+105, 35); \n\t\tcirI.setFill(new ImagePattern(i)); \n\t\tcirI.setEffect(new DropShadow(+25d, 0d, +2d, Color.ALICEBLUE));\n\t\troot.getChildren().add(cirI);\n\t\tcirI.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tsetIns();\n\t\t\t}\n\t\t});\n\n\t\tImage u = null;\n\t\ttry {\n\t\t\tu = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/Button - Undo.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tCircle cirU = new Circle(num*73+185, num*73+105, 35); \n\t\tcirU.setFill(new ImagePattern(u)); \n\t\troot.getChildren().add(cirU);\n\t\tcirU.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tundo = true;\n\t\t\t}\n\t\t});\n\n\t\tText scoreLine = new Text(num*36.5+72.5, 34, \"Score: \"+score);\n\t\tscoreLine.setFont(Font.font(\"Verdana\", FontWeight.THIN, FontPosture.REGULAR, 20));\n\t\tscoreLine.setFill(Color.CADETBLUE);\n\t\troot.getChildren().add(scoreLine);\n\n\t\tupdateTiles(currentTiles);\n\t\tupdateBoard(arr);\n\t\ttiles.push(currentTiles);\n\n\t\tAnimationTimer timer = new AnimationTimer() {\n\t\t\t@Override\n\t\t\tpublic void handle(long arg0) {\n\t\t\t\tif(undo) {\n\t\t\t\t\tif(lastUndo>0 && field.size()>0 && tiles.size()>0) {\n\t\t\t\t\t\troot.getChildren().remove(a);\n\t\t\t\t\t\tif(currentTiles[0]!=0)\n\t\t\t\t\t\t\troot.getChildren().remove(b);\n\t\t\t\t\t\tSystem.out.println(field.size());\n\t\t\t\t\t\tarr = (int[][]) field.pop();\n\n\t\t\t\t\t\tcurrentTiles = (int[]) tiles.pop();\n\t\t\t\t\t\tisUpdatedT = false;\n\n\t\t\t\t\t\tisUpdatedB = false;\n\t\t\t\t\t\tupdateBoard(arr);\n\t\t\t\t\t\tisUpdatedB = true;\n\n\t\t\t\t\t\tscore = (int) sc.pop();\n\t\t\t\t\t\tlastUndo = 0;\n\t\t\t\t\t\tfield.clear();\n\t\t\t\t\t\ttiles.clear();\n\t\t\t\t\t\tsc.clear();\n\t\t\t\t\t}\n\t\t\t\t\tundo = false;\n\t\t\t\t}\n\n\t\t\t\tif(lastUndo>0) {\n\t\t\t\t\tcirU.setEffect(new DropShadow(+25d, 0d, +2d, Color.ALICEBLUE));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tcirU.setEffect(new DropShadow(0d, 0d, 0d, Color.ALICEBLUE));\n\n\t\t\t\ta.setOnDragDetected(new EventHandler<MouseEvent>() {\n\t\t\t\t\tpublic void handle(MouseEvent event) {\n\n\t\t\t\t\t\tDragboard db = a.startDragAndDrop(TransferMode.ANY);\n\n\t\t\t\t\t\tcaseTile = 1;\n\n\t\t\t\t\t\tClipboardContent content = new ClipboardContent();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcontent.putImage(clipboard.getImage(-1*currentTiles[1]));\n\t\t\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdb.setContent(content);\n\n\t\t\t\t\t\tevent.consume();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tb.setOnDragDetected(new EventHandler<MouseEvent>() {\n\t\t\t\t\tpublic void handle(MouseEvent event) {\n\n\t\t\t\t\t\tDragboard db = b.startDragAndDrop(TransferMode.ANY);\n\n\t\t\t\t\t\tcaseTile = 2;\n\n\t\t\t\t\t\tClipboardContent content = new ClipboardContent();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcontent.putImage(clipboard.getImage(-1*currentTiles[2]));\n\t\t\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdb.setContent(content);\n\n\t\t\t\t\t\tevent.consume();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif(isUpdatedT==false)\n\t\t\t\t\tupdateTiles(currentTiles);\n\t\t\t\tif(isUpdatedB==false)\n\t\t\t\t\tupdateBoard(arr);\n\t\t\t\tgameOver = isDead(arr, currentTiles);\n\t\t\t\tscoreLine.setText(\"Score: \"+score);\n\n\t\t\t\tif(gameOver) {\n\t\t\t\t\tthis.stop();\n\t\t\t\t\tdeadIns(num, newWindow, scoreLine, root, score);\n\t\t\t\t\tlastUndo = 0;\n\t\t\t\t\tfield.clear();\n\t\t\t\t\ttiles.clear();\n\t\t\t\t\tsc.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\troot.setOnDragOver(new EventHandler<DragEvent>() {\n\t\t\tpublic void handle(DragEvent event) {\n\n\t\t\t\tif (event.getGestureSource() != root && event.getDragboard().hasImage()) {\n\t\t\t\t\tevent.acceptTransferModes(TransferMode.MOVE);\n\t\t\t\t}\n\t\t\t\tevent.consume();\n\t\t\t}\n\t\t});\n\n\t\troot.setOnDragDropped(new EventHandler<DragEvent>() {\n\t\t\tpublic void handle(DragEvent event) {\n\n\t\t\t\tDragboard db = event.getDragboard();\n\t\t\t\tboolean success = false;\n\t\t\t\tif (db.hasImage()) {\n\n\t\t\t\t\tdouble xPos = event.getSceneX();\n\t\t\t\t\tdouble yPos = event.getSceneY();\n\n\t\t\t\t\tint xInd = (int)(xPos-119)/73;\n\t\t\t\t\tint yInd = (int)(yPos-58)/73;\n\n\t\t\t\t\tif(xInd>=0 && xInd<=num-1 && yInd>=0 && yInd<=num-1) {\n\t\t\t\t\t\tif(isValidMove(yInd, xInd, currentTiles, arr, caseTile)) {\n\n\t\t\t\t\t\t\tlastUndo++;\n\t\t\t\t\t\t\tint tempc[][] = new int[num][num];\n\t\t\t\t\t\t\tfor(int i=0; i<num; i++) {\n\t\t\t\t\t\t\t\tfor(int j=0; j<num; j++) {\n\t\t\t\t\t\t\t\t\ttempc[i][j] = arr[i][j];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfield.push(tempc);\n\t\t\t\t\t\t\tsc.push(score);\n\n\t\t\t\t\t\t\tarr = placeTiles(yInd, xInd, currentTiles, arr, caseTile);\n\t\t\t\t\t\t\troot.getChildren().remove(a);\n\t\t\t\t\t\t\tif(currentTiles[0]!=0)\n\t\t\t\t\t\t\t\troot.getChildren().remove(b);\n\n\t\t\t\t\t\t\tisUpdatedT = false;\n\t\t\t\t\t\t\tif(currentTiles[0]==0) {\n\t\t\t\t\t\t\t\tarr = play.merge1(arr, yInd, xInd, score);\n\t\t\t\t\t\t\t\tscore = play.getScore();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(caseTile==1) {\n\t\t\t\t\t\t\t\tif(currentTiles[0]==1) {\n\t\t\t\t\t\t\t\t\tarr = play.merge2(arr, yInd, xInd, yInd+1, xInd, score);\n\t\t\t\t\t\t\t\t\tscore = play.getScore();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(currentTiles[0]==2) {\n\t\t\t\t\t\t\t\t\tarr = play.merge2(arr, yInd, xInd, yInd, xInd+1, score);\n\t\t\t\t\t\t\t\t\tscore = play.getScore();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tif(currentTiles[0]==1) {\n\t\t\t\t\t\t\t\t\tarr = play.merge2(arr, yInd, xInd, yInd-1, xInd, score);\n\t\t\t\t\t\t\t\t\tscore = play.getScore();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(currentTiles[0]==2) {\n\t\t\t\t\t\t\t\t\tarr = play.merge2(arr, yInd, xInd, yInd, xInd-1, score);\n\t\t\t\t\t\t\t\t\tscore = play.getScore();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttiles.push(currentTiles);\n\t\t\t\t\t\t\tcurrentTiles = play.generateTiles();\n\t\t\t\t\t\t\tupdateTiles(currentTiles);\n\t\t\t\t\t\t\tisUpdatedB = false;\n\t\t\t\t\t\t\tupdateBoard(arr);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsuccess = true;\n\t\t\t\t}\n\t\t\t\tevent.setDropCompleted(success);\n\n\t\t\t\tevent.consume();\n\t\t\t}\n\t\t});\n\n\t\troot.setOnDragDone(new EventHandler<DragEvent>() {\n\t\t\tpublic void handle(DragEvent event) {\n\t\t\t\tevent.consume();\n\t\t\t}\n\t\t});\n\n\t\tscene.setOnKeyPressed(new EventHandler<KeyEvent>() {\n\n\t\t\t@Override\n\t\t\tpublic void handle(KeyEvent event) {\n\t\t\t\tif(currentTiles[0]!=0) {\n\t\t\t\t\tif (event.getCode() == KeyCode.RIGHT) {\n\t\t\t\t\t\tif(currentTiles[0] == 1) {\n\t\t\t\t\t\t\tcurrentTiles[0] = 2;\n\t\t\t\t\t\t\tint temp = currentTiles[1];\n\t\t\t\t\t\t\tcurrentTiles[1] = currentTiles[2];\n\t\t\t\t\t\t\tcurrentTiles[2] = temp;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcurrentTiles[0] = 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\troot.getChildren().remove(a);\n\t\t\t\t\t\troot.getChildren().remove(b);\n\t\t\t\t\t\tisUpdatedT = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif (event.getCode() == KeyCode.LEFT) {\n\t\t\t\t\t\tif(currentTiles[0] == 2) {\n\t\t\t\t\t\t\tcurrentTiles[0] = 1;\n\t\t\t\t\t\t\tint temp = currentTiles[1];\n\t\t\t\t\t\t\tcurrentTiles[1] = currentTiles[2];\n\t\t\t\t\t\t\tcurrentTiles[2] = temp;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcurrentTiles[0] = 2;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\troot.getChildren().remove(a);\n\t\t\t\t\t\troot.getChildren().remove(b);\n\t\t\t\t\t\tisUpdatedT = false;\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\ttimer.start();\n\t}", "@FXML\r\n void handleNuova(ActionEvent event) {\r\n \t\r\n \tmodel.newGame();\r\n \t\r\n \t\r\n \tbtnNuova.setDisable(true);\r\n \tboxGioco.setDisable(false);\r\n \t// txtCurr.setText(\"\"+this.model.getTentativi()); questo non mi serve più perche ho modificato (sotto sotto) che txtCurr è legato al IntegeProperty\r\n \ttxtMax.setText(String.format(\"%d\", this.model.getTMAX()));\r\n \ttxtProva.clear();\r\n \ttxtLog.clear();\r\n \ttxtLog.setText(\"Indovina un numero compreso tra 1 e \"+this.model.getNMAX()+\"\\n\");\r\n \t\r\n }", "public MainMenuScreen(final Pool gam) {\n game = gam;\n poolTable = new PoolTable();\n stage = new Stage();\n Gdx.input.setInputProcessor(stage);\n camera = new OrthographicCamera();\n background = new Texture(Gdx.files.internal(\"Background.png\"));\n camera.setToOrtho(false, 800, 480);\n FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal(\"MarkerFelt.ttc\"));\n FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();\n parameter.size = 70;\n parameter.color = Color.WHITE;\n font12 = generator.generateFont(parameter); // font size 12 pixels\n generator.dispose(); // don't forget to dispose to avoid memory leaks!\n atlas = new TextureAtlas(\"buttonpack2.txt\");\n skin = new Skin();\n skin.addRegions(atlas);\n float buttonScale = 0.7f;\n table = new Table();\n table.setDebug(true);\n table.setFillParent(true);\n table.setBackground(new TextureRegionDrawable(new TextureRegion(background)));\n table.add();\n table.row().width(Gdx.graphics.getWidth() / 3);\n\n\n table.add(createButton(\"play\", Color.BLACK)).height(Gdx.graphics.getWidth() / 3);\n// table.row();\n table.add(createButton((\"multi\"), Color.GREEN)).height(Gdx.graphics.getWidth() / 3);// Row 0, column 1.\n// table.row();\n table.add(createButton((\"settings\"), Color.GREEN)).height(Gdx.graphics.getWidth() / 3);\n\n stage.addActor(table);\n }", "@Override\n public void start(final Stage primaryStage) {\n primaryStage.setTitle(Config.GAME_TITLE);\n primaryStage.setResizable(true);\n\n final BorderPane root = new BorderPane();\n Scene scene = new Scene(root, Config.SCENE_WIDTH, Config.SCENE_HEIGHT, true);\n // Default background is black.\n scene.setFill(Color.BLACK);\n\n // Load CSS resources\n URL resource = getClass().getResource(Config.CSS_STYLES);\n if (resource != null) {\n scene.getStylesheets().add(resource.toExternalForm());\n } else {\n System.err.println(\"Resource file \" + Config.CSS_STYLES + \" not found!\");\n }\n\n // A board manages a grid of cells.\n board = new Board(new Player(), new Model());\n root.setCenter(board.getPane());\n\n // Add a button to the top left corner.\n Button newGameButton = createNewGameButton();\n root.setTop(newGameButton);\n\n primaryStage.setScene(scene);\n primaryStage.setResizable(false);\n primaryStage.show();\n\n // Listen to requests for a new game\n newGameButton.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent arg0) {\n startNewGame();\n }\n });\n\n String message = \"New game has started\";\n System.out.println(message);\n Text text = new Text(message);\n text.setId(\"fancytext\");\n root.setBottom(text);\n\n // Get a notification when the game has ended.\n board.getModel().subscribe(new ModelEventListener() {\n @Override\n public void eventOccurred(ModelEvent e) {\n if (e.getEventType() == GameOver) {\n String message = \" You won! Game over. \";\n System.out.println(message);\n Text text = new Text(message);\n text.setId(\"fancytext\");\n root.setBottom(text);\n }\n else if(e.getEventType() == NewGame){\n String message = \"New game has started\";\n System.out.println(message);\n Text text = new Text(message);\n text.setId(\"fancytext\");\n root.setBottom(text);\n }\n }\n });\n\n }", "public Echec() {\n initComponents();\n chargerImages();\n IAAbstraite ia = choixModeJeu();\n String config = chargerConfiguration();\n \n if(config == null)\n {\n this.partie = new Partie(ia);\n }\n else\n {\n try\n {\n this.partie = new Partie(config, ia);\n }\n catch(Exception e)\n {\n e.printStackTrace();\n JOptionPane.showMessageDialog(null, \"Impossible de charger la configuration : \" + e.getMessage(), \"Erreur de lecture de la configuration\", JOptionPane.ERROR_MESSAGE);\n this.partie = new Partie(ia);\n }\n }\n \n updatePlateau();\n }", "private void modeSelectionSwitchToMainMenu(){\n pause();\n Pane canvas = new Pane();\n Stage stage = new Stage();\n stage.setTitle(\"GameMode Selection\");\n Label label = new Label(\"GameMode Selection\");\n label.relocate(20, 50);\n label.setAlignment(Pos.CENTER);\n label.setPrefSize(180, 30);\n canvas.getChildren().add(label);\n Button buttonStandard = new Button(\"Standard Mode\");\n buttonStandard.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {\n public void handle(MouseEvent event) {\n world.setGameModeStandard();\n modeLabel.setText(\"Standard Mode\");\n stage.close();\n startTimer();\n }\n });\n buttonStandard.setOnMouseEntered(new EventHandler<MouseEvent>() {\n public void handle(MouseEvent event) {\n label.setText(\"Standard Experience\");\n }\n });\n buttonStandard.setOnMouseExited(new EventHandler<MouseEvent>() {\n public void handle(MouseEvent event) {\n label.setText(\"GameMode Selection\");\n }\n });\n buttonStandard.relocate(50, 100);\n buttonStandard.setPrefSize(120, 30);\n buttonStandard.alignmentProperty().set(Pos.CENTER);\n canvas.getChildren().add(buttonStandard);\n Button buttonBerserker = new Button(\"Berserker Mode\");\n buttonBerserker.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {\n public void handle(MouseEvent event) {\n world.setGameModeBerserker();\n modeLabel.setText(\"Berserker Mode\");\n stage.close();\n startTimer();\n }\n });\n buttonBerserker.setOnMouseEntered(new EventHandler<MouseEvent>() {\n public void handle(MouseEvent event) {\n label.setText(\"Not a fan of Defense\");\n }\n });\n buttonBerserker.setOnMouseExited(new EventHandler<MouseEvent>() {\n public void handle(MouseEvent event) {\n label.setText(\"GameMode Selection\");\n }\n });\n buttonBerserker.relocate(50, 150);\n buttonBerserker.setPrefSize(120, 30);\n buttonBerserker.alignmentProperty().set(Pos.CENTER);\n canvas.getChildren().add(buttonBerserker);\n Button buttonSurvival = new Button(\"Survival Mode\");\n buttonSurvival.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {\n public void handle(MouseEvent event) {\n world.setGameModeSurvival();\n modeLabel.setText(\"Survival Mode\");\n stage.close();\n startTimer();\n }\n });\n buttonSurvival.setOnMouseEntered(new EventHandler<MouseEvent>() {\n public void handle(MouseEvent event) {\n label.setText(\"Never enough potion\");\n }\n });\n buttonSurvival.setOnMouseExited(new EventHandler<MouseEvent>() {\n public void handle(MouseEvent event) {\n label.setText(\"GameMode Selection\");\n }\n });\n buttonSurvival.relocate(50, 200);\n buttonSurvival.setPrefSize(120, 30);\n buttonSurvival.alignmentProperty().set(Pos.CENTER);\n canvas.getChildren().add(buttonSurvival);\n canvas.setPrefSize(220, 300);\n stage.setScene(new Scene(canvas, 220, 300));\n stage.sizeToScene();\n stage.show();\n }", "public Control(CuerpoCeleste universe) {\n initComponents();\n // Atributos de referencia\n this.universe = universe;\n \n // Atributos de la ventana\n setTitle (\"Control Window\");\n setLocation (820, 100);\n \n // Se construye y se abre la ventana de visualizacion\n Visualization visualizationWindow = new Visualization (universe.getCanvas(), this, false);\n visualizationWindow.setVisible(true);\n \n \n // Cuando se cierra esta ventana se llama al método encargado del cierre\n addWindowListener(new WindowAdapter() {\n @Override\n public void windowClosing(WindowEvent e) {\n exit (0);\n }\n });\n \n repaint();\n }", "public void create() {\n\t\t// TODO Auto-generated method stub\n\t\tskin = new Skin(Gdx.files.internal(\"uiskin.json\"));\n\t\tstage = new Stage();\n\t\tfinal TextButton playButton = new TextButton(\"Play\", skin, \"default\"); // Creates button with label \"play\"\n\t\tfinal TextButton leaderboardButton = new TextButton(\"Leaderboards\", skin, \"default\"); // Creates button with\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// label \"leaderboards\"\n\t\tfinal TextButton optionsButton = new TextButton(\"Options\", skin, \"default\"); // Creates button with label\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"options\"\n\t\tfinal TextButton userInfoButton = new TextButton(\"User Info\", skin, \"default\");// Creates button with label\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"User Info\"\n\t\tfinal TextButton quitGameButton = new TextButton(\"Exit Game\", skin, \"default\");\n\n\t\t// Three lines below this set the widths of buttons using the constant widths\n\t\tplayButton.setWidth(Gdx.graphics.getWidth() / 3);\n\t\tleaderboardButton.setWidth(playButton.getWidth());\n\t\toptionsButton.setWidth(playButton.getWidth());\n\t\tuserInfoButton.setWidth(playButton.getWidth());\n\t\tquitGameButton.setWidth(playButton.getWidth());\n\n\t\t// Set the heights using constant height\n\t\tplayButton.setHeight(Gdx.graphics.getHeight() / 15);\n\t\tleaderboardButton.setHeight(playButton.getHeight());\n\t\toptionsButton.setHeight(playButton.getHeight());\n\t\tuserInfoButton.setHeight(playButton.getHeight());\n\t\tquitGameButton.setHeight(playButton.getHeight());\n\n\t\t// Sets positions for buttons\n\t\tplayButton.setPosition(Gdx.graphics.getWidth() / 20, Gdx.graphics.getHeight() / 3);\n\t\tleaderboardButton.setPosition(playButton.getX(), playButton.getY() - leaderboardButton.getHeight());\n\t\toptionsButton.setPosition(playButton.getX(), leaderboardButton.getY() - optionsButton.getHeight());\n\t\tuserInfoButton.setPosition(playButton.getX(), optionsButton.getY() - userInfoButton.getHeight());\n\t\tquitGameButton.setPosition(playButton.getX(), userInfoButton.getY() - quitGameButton.getHeight());\n\n\t\t// User Info Name and sign in/ sign out button at the top of the screen\n\t\tfinal Label userInfoLabel = new Label(\"HI GUYS: \" + Constants.user, skin, \"default\");\n\t\tfinal TextButton userSignButton = new TextButton(\"singin/out\", skin, \"default\");\n\t\tuserSignButton.setHeight(Gdx.graphics.getHeight() / 40);\n\t\tuserSignButton.setPosition(Gdx.graphics.getWidth() - userSignButton.getWidth(),\n\t\t\t\tGdx.graphics.getHeight() - userSignButton.getHeight());\n\t\tif (Constants.userID == 0)\n\t\t\tuserSignButton.setText(\"Sign In\");\n\t\telse\n\t\t\tuserSignButton.setText(\"Sign Out\");\n\t\tuserSignButton.addListener(new ClickListener() { // When Sign in/Sing out is pressed in the top right\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tif (Constants.userID == 0) { // If no one is signed in\n\t\t\t\t\tdispose();\n\t\t\t\t\tgame.setScreen(new UserInfoScreen(game));\n\t\t\t\t} else { // If a user is currently signed in\n\t\t\t\t\tConstants.userID = 0;\n\t\t\t\t\tConstants.user = \"Temporary User\";\n\t\t\t\t\tcreate();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tuserInfoLabel.setHeight(userSignButton.getHeight());\n\t\tuserInfoLabel.setPosition(Gdx.graphics.getWidth() - userInfoLabel.getWidth() - userSignButton.getWidth(),\n\t\t\t\tGdx.graphics.getHeight() - userInfoLabel.getHeight());\n\t\tstage.addActor(userInfoLabel);\n\t\tstage.addActor(userSignButton);\n\n\t\tplayButton.addListener(new ClickListener() { // This tells button what to do when clicked\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new LobbyScreen(game)); // Switch over to lobby screen\n\t\t\t}\n\t\t});\n\n\t\tleaderboardButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new LeaderboardScreen(game)); // Switch over to leaderboard screen\n\t\t\t}\n\t\t});\n\n\t\toptionsButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\t// Do some stuff when clicked\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new OptionsScreen(game));\n\n\t\t\t}\n\t\t});\n\n\t\tuserInfoButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new UserInfoScreen(game));\n\n\t\t\t}\n\t\t});\n\n\t\tquitGameButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tGdx.app.exit();\n\t\t\t}\n\t\t});\n\n\t\t// Adds all buttons to stage to be rendered\n\t\tstage.addActor(playButton);\n\t\tstage.addActor(leaderboardButton);\n\t\tstage.addActor(optionsButton);\n\t\tstage.addActor(userInfoButton);\n\t\tstage.addActor(quitGameButton);\n\n\t\tGdx.input.setInputProcessor(stage);\n\t}" ]
[ "0.6433536", "0.6386917", "0.63868225", "0.6306565", "0.62969285", "0.6271738", "0.62116677", "0.61733717", "0.6113407", "0.6103242", "0.60831636", "0.6067678", "0.60670996", "0.6039509", "0.60127896", "0.60028297", "0.6002209", "0.5993976", "0.5989704", "0.5987455", "0.59620374", "0.59570986", "0.59401524", "0.5930714", "0.59263563", "0.5893809", "0.58928347", "0.58916813", "0.58755404", "0.5867765", "0.5867281", "0.58609366", "0.5859528", "0.5856976", "0.5856095", "0.585584", "0.5847953", "0.584754", "0.584693", "0.5843375", "0.58431154", "0.5834039", "0.583279", "0.58230835", "0.58230036", "0.58183515", "0.5815534", "0.5813909", "0.58093476", "0.5794911", "0.5793418", "0.5790249", "0.578591", "0.5785693", "0.5776199", "0.5763745", "0.5762145", "0.5757246", "0.5756101", "0.5752089", "0.57421017", "0.5734777", "0.57333225", "0.573233", "0.57310474", "0.572903", "0.5726901", "0.572038", "0.57199234", "0.5716309", "0.57134455", "0.57071453", "0.5689379", "0.56873673", "0.56871355", "0.5685583", "0.5682784", "0.5678923", "0.5677533", "0.5675036", "0.5673938", "0.56691164", "0.5667208", "0.5665763", "0.5661759", "0.5654956", "0.5651988", "0.565056", "0.56448627", "0.5632962", "0.56325686", "0.56305766", "0.5627434", "0.5625139", "0.56197333", "0.5614322", "0.5614069", "0.56138337", "0.56126106", "0.56091124", "0.56084204" ]
0.0
-1
metoda nastavi tlacitko na clicked
public void setClickedStyle(Button button){ whiteCellButton.getStyleClass().clear(); blackCellButton.getStyleClass().clear(); removeCellButton.getStyleClass().clear(); if (button == whiteCellButton) { whiteCellButton.getStyleClass().add("edit-buttons-selected"); blackCellButton.getStyleClass().add("edit-buttons"); removeCellButton.getStyleClass().add("edit-buttons"); } else if (button == blackCellButton) { blackCellButton.getStyleClass().add("edit-buttons-selected"); whiteCellButton.getStyleClass().add("edit-buttons"); removeCellButton.getStyleClass().add("edit-buttons"); } else if (button == removeCellButton) { removeCellButton.getStyleClass().add("edit-buttons-selected"); whiteCellButton.getStyleClass().add("edit-buttons"); blackCellButton.getStyleClass().add("edit-buttons"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tSystem.out.println(\"vai ficar clikando ai a toa? PATETA\");\n\t\t\t\t\n\t\t\t}", "@Override\n public void mouseClicked(MouseEvent e) {\n System.out.println(\"MouseClicked\");\n //kwadrat.clicked();\n trojkat.clicked();\n //kolo.clicked();\n //square.clicked();\n }", "public void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\r\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\r\n\t\t\t\t\t\r\n\t\t\t\t}", "public void onClicked();", "@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void mouseClicked(MouseEvent e) \t{\n\t\t\t\t\r\n\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void mouseClicked(MouseEvent e) {\n clicked = true;\n }", "@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\n\t\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\n }", "public void mouseClicked(MouseEvent e) {\n\t\t\t\n\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\t\n\t\t}", "public void mouseClicked(MouseEvent e) {\n \t\t\r\n \t}", "@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\r\n\t\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\n\t\t\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\r\n\t\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\r\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\n\t}", "public void mouseClicked(MouseEvent e) {\n\n\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\n\t\t\t}", "@Override\n\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\n\t\t}", "public void mouseClicked(MouseEvent e) { \r\n }", "public void mouseClicked(MouseEvent e) {}", "public void mouseClicked(MouseEvent e) {}", "public void mouseClicked(MouseEvent e) {}", "public void mouseClicked(MouseEvent e) {}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\t\n\t\t\n\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\n\t}", "@Override\r\n\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\r\n\t\t\t\r\n\t\t}", "@Override\r\n public void mouseClicked(MouseEvent e) {\r\n \r\n }", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t}", "@Override\n\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\n\n\t\t}", "@Override\n\t\tpublic void mouseClicked(MouseEvent e) \n\t\t{\n\t\t\t\n\t\t}" ]
[ "0.7876019", "0.778278", "0.7736392", "0.7692161", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.7661894", "0.76599073", "0.7659045", "0.7659045", "0.76515555", "0.7647427", "0.764643", "0.764643", "0.764643", "0.76450354", "0.76450354", "0.76430225", "0.76430225", "0.76430225", "0.76411813", "0.7618778", "0.76033634", "0.76006365", "0.75999516", "0.7578255", "0.7578255", "0.75771356", "0.75739413", "0.7563856", "0.7563856", "0.7563856", "0.7558052", "0.7558052", "0.7558052", "0.7557067", "0.75499785", "0.75495684", "0.75372756", "0.75372756", "0.75372756", "0.75372756", "0.75372756", "0.75372756", "0.75372756", "0.7536603", "0.7536603", "0.7536603", "0.7536603", "0.7536603", "0.7536603", "0.7536603", "0.7536603", "0.75352454", "0.75334066", "0.75219613", "0.75219613", "0.75219613", "0.75219613", "0.75219613", "0.75219613", "0.75031656", "0.75031656", "0.74973464", "0.74973464", "0.74954885", "0.7491858", "0.7491858", "0.7491858", "0.7491858", "0.74884814", "0.74884814", "0.74884814", "0.74884814", "0.74884814", "0.74884814", "0.74884814", "0.74884814", "0.74884814", "0.74884814", "0.74884814", "0.74884814", "0.74884814", "0.74884814", "0.74821424", "0.74804395", "0.74804395", "0.74690413", "0.7466942", "0.7465627", "0.7458727", "0.7455693" ]
0.0
-1
zmenenie stredneho kruhu cervena = naeditovany level sa neda ulozit (neriesitelne/neskotrolovane) zelena = naeditovany level sa moze ulozit
public void setCenterCircleFill(){ if(solvable){ solvableCircle.setFill(Color.GREEN); } else{ solvableCircle.setFill(Color.RED); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String vylozZvieraZVozidla() {\r\n if (zoo.getPracovneVozidlo() == null) {\r\n return \"Pracovne vozidlo nie je pristavene\";\r\n }\r\n\r\n Integer pozicia = MojeMetody.vlozInt(\"Vloz index zvierata\");\r\n if (pozicia == null) return \"\";\r\n\r\n try {\r\n Zivocich ziv = zoo.vylozZivocicha(pozicia-1);\r\n if (ziv == null) {\r\n return \"Zviera c. \" + pozicia + \" nie je na vozidle\\n\\t\";\r\n }\r\n zoo.pridajZivocicha(ziv);\r\n return \"Zviera \" + ziv\r\n + \"\\n\\tbolo vylozene z prepravneho vozidla\";\r\n } catch (ClassCastException exCC) {\r\n return \"Zviera c. \" + pozicia + \" nie je na vozidle\\n\\t\";\r\n } catch (Exception ex) {\r\n return \"Neznama chyba:\\n\\t\" + ex;\r\n }\r\n }", "private String nalozZvieraNaVozidlo() {\r\n if (zoo.getPracovneVozidlo() == null) {\r\n return \"Pracovne vozidlo nie je pristavene\";\r\n }\r\n\r\n Integer pozicia = MojeMetody.vlozInt(\"Vloz cislo zvierata\");\r\n if (pozicia == null) return \"\";\r\n\r\n try {\r\n Prepravitelny z = (Prepravitelny) zoo.getZvierataZOO(pozicia - 1);\r\n zoo.nalozZivocicha(z);\r\n zoo.odstranZivocicha(pozicia - 1);\r\n return \"Zviera \" + z + \"\\n\\tbolo nalozene na prepravne vozidlo\";\r\n } catch (ClassCastException exCC) {\r\n return \"Zviera c. \" + pozicia + \" nemozno prepravit\\n\\t\";\r\n } catch (NullPointerException exNP) {\r\n return \"Zviera c. \" + pozicia + \" nie je v ZOO\";\r\n } catch (Exception ex) {\r\n return \"Neznama chyba:\\n\\t\" + ex;\r\n }\r\n }", "public void zapisUrok() {\r\n\r\n\t\taktualnyZostatok = getZostatok() * urokovaSadzba / 100;\r\n\t\tsetVklad(aktualnyZostatok);\r\n\r\n\t}", "private void setLevel(){\n\t\tif(getD(y) <= T)\n\t\t\tlevel = \"lower\";\n\t\telse\n\t\t\tlevel = \"higher\";\n\t}", "public void ucitajPotez(Potez potez) {\n\t\tint red = potez.vratiRed();\n\t\tint kolona = potez.vratiKolonu();\n\t\ttabla[red][kolona] = potez.vratiRezultat();\n\n\t\tif (potez.vratiRezultat() == Polje1.potopljen) {\n\t\t\tint gornjiRed, gornjaKolona;\n\t\t\tboolean cont1 = false;\n\t\t\tboolean cont2 = false;\n\t\t\tboolean redar = false;\n\t\t\tboolean kolonar = false;\n\t\t\twhile (redar == false) {\n\t\t\t\tif (red == 0) {\n\t\t\t\t\tgornjiRed = 0;\n\t\t\t\t\tcont1 = true;\n\t\t\t\t} else {\n\t\t\t\t\tgornjiRed = red - 1;\n\t\t\t\t}\n\t\t\t\tif (red == 9) {\n\t\t\t\t\tcont2 = true;\n\t\t\t\t}\n\t\t\t\tif (tabla[gornjiRed][kolona] == Polje1.pogodjen && cont1 == false) {\n\t\t\t\t\ttabla[gornjiRed][kolona] = Polje1.potopljen;\n\t\t\t\t\tred--;\n\t\t\t\t} else {\n\t\t\t\t\tcont1 = true;\n\t\t\t\t\tgornjiRed++;\n\t\t\t\t}\n\t\t\t\tif (cont1 == true) {\n\t\t\t\t\tif (tabla[gornjiRed][kolona] == Polje1.pogodjen || tabla[gornjiRed][kolona] == Polje1.potopljen) {\n\t\t\t\t\t\ttabla[gornjiRed][kolona] = Polje1.potopljen;\n\t\t\t\t\t\tred++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcont2 = true;\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (cont1 == true && cont2 == true)\n\t\t\t\t\tredar = true;\n\t\t\t}\n\t\t\tcont1 = false;\n\t\t\tcont2 = false;\n\t\t\tred = potez.vratiRed();\n\t\t\twhile (kolonar == false) {\n\t\t\t\tif (kolona == 0) {\n\t\t\t\t\tgornjaKolona = 0;\n\t\t\t\t\tcont1 = true;\n\t\t\t\t} else {\n\t\t\t\t\tgornjaKolona = kolona - 1;\n\t\t\t\t}\n\t\t\t\tif (kolona == 9) {\n\t\t\t\t\tcont2 = true;\n\t\t\t\t}\n\t\t\t\tif (tabla[red][gornjaKolona] == Polje1.pogodjen && cont1 == false) {\n\t\t\t\t\ttabla[red][gornjaKolona] = Polje1.potopljen;\n\t\t\t\t\tkolona--;\n\t\t\t\t} else {\n\t\t\t\t\tcont1 = true;\n\t\t\t\t\tgornjaKolona++;\n\t\t\t\t}\n\t\t\t\tif (cont1 == true) {\n\t\t\t\t\tif (tabla[red][gornjaKolona] == Polje1.pogodjen || tabla[red][gornjaKolona] == Polje1.potopljen) {\n\t\t\t\t\t\ttabla[red][gornjaKolona] = Polje1.potopljen;\n\t\t\t\t\t\tkolona++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcont2 = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (cont1 == true && cont2 == true)\n\t\t\t\t\tkolonar = true;\n\n\t\t\t}\n\n\t\t}\n\n\n\t}", "public void naplnVrcholy() {\r\n System.out.println(\"Zadajte pocet vrcholov: \");\r\n pocetVrcholov = skener.nextInt();\r\n for (int i=0; i < pocetVrcholov; i++) {\r\n nekonecno = (int)(Double.POSITIVE_INFINITY);\r\n if(i==0) { //pre prvy vrchol potrebujeme nastavit vzdialenost 0 \r\n String menoVrcholu = Character.toString((char)(i+65)); //pretipovanie int na String, z i=0 dostanem A\r\n Vrchol vrchol = new Vrchol(menoVrcholu, 0, \"\"); //vrcholu nastavim vzdialenost a vrcholPrichodu \r\n vrcholy.add(vrchol);\r\n } else { //ostatne budu mat nekonecno alebo v tomto pripade 9999 (lebo tuto hodnotu v mensich grafoch nepresiahnem)\r\n String menoVrcholu = Character.toString((char)(i+65)); //pretipovanie int na String, z i=0 dostanem A\r\n Vrchol vrchol = new Vrchol(menoVrcholu,nekonecno, \"\"); //vrcholu nastavim vzdialenost a vrcholPrichodu \r\n vrcholy.add(vrchol);\r\n }\r\n }\r\n }", "void levelanzeigen(){\n if(level==levelold){\n //TODO HARDWARE this.systeminterface.tab.setcolor(255,0,0);\n //TODO HARDWARE this.systeminterface.ledFeld.zahl(0,2,level);\n }else{\n //TODO HARDWARE this.systeminterface.ledFeld.setcolor(0,0,0);\n //TODO HARDWARE this.systeminterface.ledFeld.zahl(0,2,levelold);\n //TODO HARDWARE this.systeminterface.ledFeld.setcolor(255,0,0);\n //TODO HARDWARE this.systeminterface.ledFeld.zahl(0,2,level);\n levelold=level;\n }\n //TODO HARDWARE this.systeminterface.ledFeld.show();\n //TODO HARDWARE this.systeminterface.ledFeld.setRotation(1);\n }", "private Zivocich vytvorZivocicha() {\r\n final String[] zFarba = {\"cervena\", \"zelena\", \"modra\", \"zlta\", \"zlto-zelena\"};\r\n Zivocich zviera = null;\r\n double kolkoVazi = 0.0;\r\n\r\n //-- Vygenerujeme zviera\r\n int vygenerovane = 1 + generator.nextInt(4); //cislo <1,4>\r\n\r\n switch (vygenerovane) {\r\n case 1: //blcha \r\n double kolkoDoskoci=3 * generator.nextDouble() ; //cislo <0;2.99>\r\n double kolkoVyskoci=3 * generator.nextDouble() ; //cislo <0;2.99>\r\n zviera=new Blcha(6,kolkoDoskoci,kolkoVyskoci);\r\n break;\r\n case 2: //simpanz\r\n kolkoVazi=3 + (97 * generator.nextDouble()); //cislo <3;99.9>\r\n boolean cviceny;\r\n cviceny=generator.nextBoolean(); \r\n zviera=new Simpanz(kolkoVazi,cviceny);\r\n break;\r\n case 3: //papagaj\r\n kolkoVazi = 0.1 + (5*generator.nextDouble()); // cislo <0.1; 6>\r\n String farba = zFarba[generator.nextInt(5)]; // farba zo zoznamu\r\n zviera = new Papagaj(\"Ara\", 2, kolkoVazi, farba); \r\n break;\r\n case 4: //slon\r\n kolkoVazi=20 + (480*generator.nextDouble()); //cislo <20;500> \r\n int pocet=generator.nextInt(50); //pocet zubov bude <0,49>\r\n zviera=new Slon(kolkoVazi,pocet);\r\n break;\r\n } //------------------------------------------------------------- switch --\r\n return zviera;\r\n }", "float znajdzOstatecznaCene2()\n\t{\n\t\tArrayList<Float> cenyNaNajblizszySlot =znajdzOstatecznaCeneCenaNaNajblizszeSloty();\n\t\t\n\t\tfloat minimuCena =-1;\n\t\t\n\t\t//Stworzenie cen w raportowaniu\n\t\tint i=0;\n\t\twhile (i<cenyNaNajblizszySlot.size())\n\t\t{\n\t\t\trynekHistory.kontraktDodajCene(cenyNaNajblizszySlot.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t//wyznacz liste ktora ma najwieksza wartosc funkcji rynkowej\n\t\t\n\t\tArrayList<Float> cenyZNajwiekszaFunkcjaRynkowa = new ArrayList<>();\n\t\tfloat maximumFunkcjiRynkowej=-1;\n\t\t\n\t\ti=0;\n\t\twhile (i<cenyNaNajblizszySlot.size())\n\t\t{\n\t\t\tfloat cena =cenyNaNajblizszySlot.get(i);\n\t\t\tfloat value =funkcjaRynku2(cena, false,true);\t\t\t\n\n\t\t\trynekHistory.kontraktDodajWartoscFunkcjiRynku(value, cena);\n\n\t\t\t\n\t\t\tif (value>maximumFunkcjiRynkowej)\n\t\t\t{\n\t\t\t\tcenyZNajwiekszaFunkcjaRynkowa.clear();\n\t\t\t\tcenyZNajwiekszaFunkcjaRynkowa.add(cena);\n\t\t\t\tmaximumFunkcjiRynkowej = value;\n\t\t\t}\n\t\t\telse if (value==maximumFunkcjiRynkowej)\n\t\t\t{\n\t\t\t\tcenyZNajwiekszaFunkcjaRynkowa.add(cena);\n\t\t\t} \n\t\t\t\n\t\t\t\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tminimuCena = cenyZNajwiekszaFunkcjaRynkowa.get(cenyZNajwiekszaFunkcjaRynkowa.size()/2);\n\t\t\n\t\treturn minimuCena;\n\n\t}", "public void ustawPojazdNaPoczatek()\n\t{\n\t\tSciezka pierwszaSc = droga.get(0);\n\t\tfinal double y = 10;\n\t\tpojazd.zmienPozycje(pierwszaSc.getCenterDownX(), y);\n\t}", "protected int getLevel(){\r\n return this.level;\r\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tclass Ulamek{\r\n\t\t\tprivate int licznik, mianownik;\r\n\r\n\t\t\tpublic void ustawLicznik (int l){\r\n\t\t\t\tlicznik=l;\r\n\t\t\t}\r\n\t\t\tpublic void ustawMianownik (int m){\r\n\t\t\t\tmianownik=m;\r\n\t\t\t}\r\n\t\t\tpublic void ustawUlamek (int u1, int u2){\r\n\t\t\t\tlicznik=u1;\r\n\t\t\t\tmianownik=u2;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tpublic void wyswietl (){\r\n\t\t\t\t\r\n\t\t\t\tint przod, reszta, przod_dlugosc, mianownik_dlugosc, licznik_dlugosc;\r\n\t\t\t\tString przod_zamiana, mianownik_string, licznik_string;\r\n\t\t\t\tdouble wynik;\r\n\t\t\t\t\r\n\t\t\t\tif (mianownik!=0 && licznik !=0){\r\n\t\t\t\tprzod=licznik/mianownik;\r\n\t\t\t\treszta=licznik-(przod*mianownik);\r\n\t\t\t\tprzod_zamiana=\"\"+przod;\r\n\t\t\t\tprzod_dlugosc=przod_zamiana.length();\r\n\t\t\t\twynik=1.0*licznik/mianownik;\r\n\t\t\t\t\r\n\t\t\t\tif(reszta!=0){\r\n\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\tint licznik = 0;\r\n\t\t\t\t\tdo{\r\n\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t licznik++;\r\n\t\t\t\t\t}while (licznik!=przod_dlugosc);\r\n\t\t\t\tSystem.out.println(reszta);\r\n\t\t\t}\r\n\r\n\t\t\t\t//zamiana na stringa i liczenie\r\n\t\t\t\tmianownik_string=\"\"+mianownik;\r\n\t\t\t\tmianownik_dlugosc=mianownik_string.length();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//brak calości\r\n\t\t\t\tif(przod==0){\r\n\t\t\t\tSystem.out.print(\" \"+\" \"+\" \");\r\n\t\t\t\tint licznik3 = 0;\r\n\t\t\t\tdo{\r\n\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t licznik3++;\r\n\t\t\t\t}while (licznik3!=mianownik_dlugosc);\r\n\t\t\t System.out.print(\" = \"+wynik);\r\n\r\n\t\t\t System.out.println();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\tif(przod!=0){\r\n\t\t\t\tSystem.out.print(\" \"+przod+\" \");\r\n\t\t\t\tint licznik3 = 0;\r\n\t\t\t\tdo{\r\n\t\t\t\t\tif(reszta!=0){\r\n\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t}\r\n\t\t\t\t licznik3++;\r\n\t\t\t\t}while (licznik3!=mianownik_dlugosc);\r\n\t\t\t System.out.print(\" = \"+wynik);\r\n\r\n\t\t\t System.out.println();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(reszta!=0){\r\n\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\tint licznik2 = 0;\r\n\t\t\t\tdo{\r\n\t\t\t\t\tif(reszta!=0){\r\n\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t licznik2++;\r\n\t\t\t\t\t\r\n\t\t\t\t}while (licznik2!=przod_dlugosc);\r\n\t\t\t\tSystem.out.println(mianownik);\r\n\t\t\t System.out.println();\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t//jezeli blad \r\n\t\t\t\t\tmianownik_string=\"\"+mianownik;\r\n\t\t\t\t\tmianownik_dlugosc=mianownik_string.length();\r\n\t\t\t\t\tlicznik_string=\"\"+licznik;\r\n\t\t\t\t\tlicznik_dlugosc=licznik_string.length();\r\n\t\t\t\t\tif(licznik_dlugosc>mianownik_dlugosc){\r\n\t\t\t\t\t\tmianownik_dlugosc=licznik_dlugosc;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//gora\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t//if(licznik==0){\r\n\t\t\t\t\t//System.out.print(\" \");\r\n\t\t\t\t\t//}\r\n\r\n\t\t\t\t\tSystem.out.println(licznik);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//srodek\r\n\t\t\t\t\tSystem.out.print(\" \"+\" \"+\" \");\r\n\t\t\t\t\t\r\n\t\t\t\t\tint licznik3 = 0;\r\n\t\t\t\t\tdo{\r\n\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t licznik3++;\r\n\t\t\t\t\t}while (licznik3!=mianownik_dlugosc);\r\n\t\t\t\t System.out.print(\" = \"+\"ERR\");\r\n\r\n\t\t\t\t System.out.println();\r\n\t\t\t\t\t\r\n\t\t\t\t //dol\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t\t\tSystem.out.println(mianownik);\r\n\t\t\t\t\t System.out.println();\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t Ulamek u1=new Ulamek();\r\n\t\t Ulamek u2=new Ulamek();\r\n\r\n\t\t u1.ustawLicznik(3);\r\n\t\t u1.ustawMianownik(5);\r\n\r\n\t\t u2.ustawLicznik(142);\r\n\t\t u2.ustawMianownik(8);\r\n\r\n\t\t u1.wyswietl();\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t \r\n\t\t u2.wyswietl();\r\n\r\n\r\n\r\n\r\n\t\t u2.ustawUlamek(100,0);\r\n\r\n\r\n\t\t u2.wyswietl();\r\n\r\n\t}", "public void pobierzukladprzegladRZiSBO() {\r\n if (uklad.getUklad() == null) {\r\n uklad = ukladBRDAO.findukladBRPodatnikRokPodstawowy(wpisView.getPodatnikObiekt(), wpisView.getRokWpisuSt());\r\n }\r\n List<PozycjaRZiSBilans> pozycje = UkladBRBean.pobierzpozycje(pozycjaRZiSDAO, pozycjaBilansDAO, uklad, \"\", \"r\");\r\n UkladBRBean.czyscPozycje(pozycje);\r\n rootProjektRZiS.getChildren().clear();\r\n List<StronaWiersza> zapisy = StronaWierszaBean.pobraniezapisowwynikoweBO(stronaWierszaDAO, wpisView);\r\n try {\r\n PozycjaRZiSFKBean.ustawRoota(rootProjektRZiS, pozycje, zapisy);\r\n level = PozycjaRZiSFKBean.ustawLevel(rootProjektRZiS, pozycje);\r\n Msg.msg(\"i\", \"Pobrano układ \");\r\n } catch (Exception e) {\r\n E.e(e);\r\n rootProjektRZiS.getChildren().clear();\r\n Msg.msg(\"e\", e.getLocalizedMessage());\r\n }\r\n }", "public void statoIniziale()\n {\n int r, c;\n for (r=0; r<DIM_LATO; r++)\n for (c=0; c<DIM_LATO; c++)\n {\n if (eNera(r,c))\n {\n if (r<3) // le tre righe in alto\n contenutoCaselle[r][c] = PEDINA_NERA;\n else if (r>4) // le tre righe in basso\n contenutoCaselle[r][c] = PEDINA_BIANCA;\n else contenutoCaselle[r][c] = VUOTA; // le 2 righe centrali\n }\n else contenutoCaselle[r][c] = VUOTA; // caselle bianche\n }\n }", "double getLevel();", "double getLevel();", "public double Getlevel()\r\n {\r\n return level;\r\n }", "public int getLevel(){\n return this.level;\n }", "public int getLevel(){\n return this.level;\n }", "public String newSaveLevel() {\n\t\tactionStartTime = new Date();\n\t\tresetToken(result);\n\t\ttry {\n\t\t\tif (mappingId == null || mappingId == 0) {\n\t\t\t\tresult.put(\"errMsg\", ValidateUtil.getErrorMsg(ConstantManager.ERR_SYSTEM));\n\t\t\t\tresult.put(ERROR, true);\n\t\t\t\treturn SUCCESS;\n\t\t\t}\n\t\t\t/**\n\t\t\t * check Cac muc trong nhom phai co so luong/so tien khac nhau.\n\t\t\t * Khong the muc 1 la 1A, 2B muc 2 cung la 1A, 2B\n\t\t\t */\n\t\t\t//trung nguyen\n\t\t\tList<ExMapping> lstSubCheck = listSubLevelMua;\n\t\t\tInteger checkLevel = 0;\n\t\t\tProductGroup pg = promotionProgramMgr.getrecursive(groupMuaId);\n\t\t\tint recursive = pg.getRecursive();\n\t\t\tint sizeGroupLevel = promotionProgramMgr.getSize(groupMuaId).size();\n\t\t\tboolean isFlag = false;\n\t\t\tif (sizeGroupLevel > 0){\n\t\t\t\tfor (int i = 0; i< sizeGroupLevel; i++){\n\t\t\t\t\tInteger conditionGroupLevel = promotionProgramMgr.getSize(groupMuaId).get(i).getCondition();\n\t\t\t\t\tif (conditionGroupLevel != null){\n\t\t\t\t\t\tisFlag = true;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(\"ZV21\".equals(typeCode) || \"ZV20\".equals(typeCode)){\n\t\t\t\tif(recursive==1){\n\t\t\t\t\tif(listSubLevelGroupZV192021!=null){\n\t\t\t\t\t\tif (isFlag == false && sizeGroupLevel > 2){\n\t\t\t\t\t\t\tresult.put(\"errMsg\", Configuration.getResourceString(ConstantManager.VI_LANGUAGE, \"promotion.program.group.level.code.maping.net.same\"));\n\t\t\t\t\t\t\tresult.put(ERROR, true);\n\t\t\t\t\t\t\treturn SUCCESS;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlstSubCheck = listSubLevelGroupZV192021;\n\t\t\t\t\t\tcheckLevel = promotionProgramMgr.checkLevel(mappingId, lstSubCheck, listSubLevelKM);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif (sizeGroupLevel > 1 && isFlag){\n\t\t\t\t\t\tresult.put(\"errMsg\", Configuration.getResourceString(ConstantManager.VI_LANGUAGE, \"promotion.program.group.level.code.maping.net.same\"));\n\t\t\t\t\t\tresult.put(ERROR, true);\n\t\t\t\t\t\treturn SUCCESS;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif(listSubLevelGroupZV192021!=null){\n\t\t\t\t\t\tcheckLevel = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tcheckLevel = promotionProgramMgr.checkLevel(mappingId, lstSubCheck, listSubLevelKM);\n\t\t\t}\n\t\t\tif (checkLevel == 1) {\n\t\t\t\tresult.put(\"errMsg\", Configuration.getResourceString(ConstantManager.VI_LANGUAGE, \"promotion.program.group.level.code.maping.exist\"));\n\t\t\t\tresult.put(ERROR, true);\n\t\t\t\treturn SUCCESS;\n\t\t\t} else if (checkLevel == 2) {\n\t\t\t\tresult.put(\"errMsg\", Configuration.getResourceString(ConstantManager.VI_LANGUAGE, \"promotion.program.group.level.code.maping.net.same\"));\n\t\t\t\tresult.put(ERROR, true);\n\t\t\t\treturn SUCCESS;\n\t\t\t} else if (checkLevel == 3) {\n\t\t\t\tresult.put(\"errMsg\", Configuration.getResourceString(ConstantManager.VI_LANGUAGE, \"promotion.program.group.level.code.maping.value.not.same\"));\n\t\t\t\tresult.put(ERROR, true);\n\t\t\t\treturn SUCCESS;\n\t\t\t}\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tMap<String, Object> returnMap = promotionProgramMgr.newSaveSublevel(mappingId, stt, listSubLevelMua, listSubLevelKM, getLogInfoVO(), listSubLevelGroupZV192021);\n\t\t\t//Map<String, Object> returnMapGroupZv192021 = promotionProg\tramMgr.newSaveGroupZV192021(mappingId, stt, listSubLevelMua, listSubLevelKM, getLogInfoVO(), listSubLevelGroupZV192021);\n\t\t\t\n\t\t\tresult.put(ERROR, false);\n\t\t\tif (returnMap.get(\"listSubLevelMua\") != null) {\n\t\t\t\tresult.put(\"listSubLevelMua\", returnMap.get(\"listSubLevelMua\"));\n\t\t\t}\n\t\t\tif (returnMap.get(\"listSubLevelKM\") != null) {\n\t\t\t\tresult.put(\"listSubLevelKM\", returnMap.get(\"listSubLevelKM\"));\n\t\t\t}\n\t\t\tif (mappingId != null) {\n\t\t\t\tGroupMapping mapping = promotionProgramMgr.getGroupMappingById(mappingId);\n\t\t\t\tif (mapping != null && mapping.getPromotionGroup() != null && mapping.getPromotionGroup().getPromotionProgram() != null) {\n\t\t\t\t\tPromotionProgram program = mapping.getPromotionGroup().getPromotionProgram();\n\t\t\t\t\tpromotionProgramMgr.updateMD5ValidCode(program, getLogInfoVO());\n\t\t\t\t\tif (mapping.getSaleGroup() != null) {\n\t\t\t\t\t\tpromotionProgramMgr.updateGroupLevelOrderNumber(program.getId(), mapping.getSaleGroup().getId(), getLogInfoVO());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IllegalArgumentException ie) {\n\t\t\tString msg = ie.getMessage();\n\t\t\tif (msg != null) {\n\t\t\t\tif (msg.contains(PromotionProgramMgr.DUPLICATE_PRODUCT_IN_PRODUCT_GROUPS)) {\n\t\t\t\t\tint idx = msg.indexOf(PromotionProgramMgr.DUPLICATE_PRODUCT_IN_PRODUCT_GROUPS);\n\t\t\t\t\tif (idx > -1) {\n\t\t\t\t\t\tString err = msg.substring(idx);\n\t\t\t\t\t\terr = err.replace(PromotionProgramMgr.DUPLICATE_PRODUCT_IN_PRODUCT_GROUPS, \"\");\n\t\t\t\t\t\tresult.put(ERROR, true);\n\t\t\t\t\t\tresult.put(\"errMsg\", R.getResource(\"promotion.catalog.import.duplicate.product.in.product.groups\", err));\n\t\t\t\t\t\treturn SUCCESS;\n\t\t\t\t\t}\n\t\t\t\t} else if (msg.contains(PromotionProgramMgr.DUPLICATE_LEVELS)) {\n\t\t\t\t\tresult.put(ERROR, true);\n\t\t\t\t\tresult.put(\"errMsg\", R.getResource(\"promotion.catalog.import.duplicate.level\"));\n\t\t\t\t\treturn SUCCESS;\n\t\t\t\t}\n\t\t\t}\n\t\t\tLogUtility.logErrorStandard(ie, R.getResource(\"web.log.message.error\", \"vnm.web.action.program.PromotionCatalogAction.newSaveLevel\"), createLogErrorStandard(actionStartTime));\n\t\t\tresult.put(\"errMsg\", ValidateUtil.getErrorMsg(ConstantManager.ERR_SYSTEM));\n\t\t\tresult.put(ERROR, true);\n\t\t} catch (Exception e) {\n\t\t\tLogUtility.logErrorStandard(e, R.getResource(\"web.log.message.error\", \"vnm.web.action.program.PromotionCatalogAction.newSaveLevel\"), createLogErrorStandard(actionStartTime));\n\t\t\tresult.put(\"errMsg\", ValidateUtil.getErrorMsg(ConstantManager.ERR_SYSTEM));\n\t\t\tresult.put(ERROR, true);\n\t\t}\n\t\treturn SUCCESS;\n\t}", "public int getLevel()\n {\n return level; \n }", "int getLevel();", "int getLevel();", "int getLevel();", "int getLevel();", "int getLevel();", "public ArrayList<ArrayList<Float>> predykcjaCenNaRynkuLokalnym()\n\t{\n\t\tfloat cenaMinimalnaNaRynkuLokalnym= Stale.cenaMinimalnaNaRynkuLokalnym;\n\t\tfloat cenaMaksymalnaNaRynkuLokalnym = Stale.cenaDystrybutoraZewnetrznego;\n\t\t\n\t\t//tu siedzi to rozroznienie czy z generatora czy predykcja z poprzendiej symualcji\n\t\tArrayList<Float> normalnaPredykcja = pierwszaPredykcja();\n\t\tpriceVectorsList.add(normalnaPredykcja);\n\t\t\n\t\tArrayList<ArrayList<Float>> listaPredykcjiCen= new ArrayList<ArrayList<Float>>();\n\t\t\n\t\t\n\t\t//nizsza \n\t\tArrayList<Float> predykcjaZNizszaCena=new ArrayList<Float>(normalnaPredykcja);\t\t\n\t\tArrayList<Float> predykcjaZWyzszaCena=new ArrayList<Float>(normalnaPredykcja);\n\t\t\n\t\tfloat nizszaCena =(normalnaPredykcja.get(0)+cenaMinimalnaNaRynkuLokalnym)/2 ;\n\t\tfloat wyzszaCena=(normalnaPredykcja.get(0)+cenaMaksymalnaNaRynkuLokalnym)/2;\n\t\t\n\t\tpredykcjaZNizszaCena.set(0, nizszaCena);\n\t\tpredykcjaZWyzszaCena.set(0, wyzszaCena);\n\t\t\n\t\tlistaPredykcjiCen.add(predykcjaZNizszaCena);\n\t\tlistaPredykcjiCen.add(normalnaPredykcja);\n\t\tlistaPredykcjiCen.add(predykcjaZWyzszaCena);\n\t\t\n\t\t//reporting - zapisz zadeklarowan cene\n\t\trynekHistory.dodajZadeklarowanaCene(normalnaPredykcja.get(0));\n\t\t\n\t\t\n\t\treturn listaPredykcjiCen;\t\n\t}", "public int getLevel(){\n return level;\n }", "public int getLevel(){\n return level;\n }", "private void sonucYazdir() {\n\t\talinanPuan = (int)(((float)alinanPuan / (float)toplamPuan) * 100);\n\t\tSystem.out.println(\"\\nSınav Bitti..!\\n\" + soruSayisi + \" sorudan \" + dogruSayaci + \" tanesine\"\n\t\t\t\t\t\t+ \" doğru cevap verdiniz.\\nPuan: \" + alinanPuan + \"/\" + toplamPuan);\n\t}", "public int liczbaelnastosie() {\n\t\treturn 0;\n\t}", "public int getLevel()\r\n {\r\n return r_level;\r\n }", "public String getLevel ()\n {\n return level;\n }", "public int getLevel(){\n\t\treturn this.level;\n\t}", "public int level();", "float znajdzOstatecznaCene()\n\t{\n\t\t//getInput(\"znajdzOstatecznaCene\");\n\t\t//print (\"znajdzOstatecznaCene \"+iteracja);\n\t\t\n\t\t//debug\n\t\tBoolean debug = false;\n\t\tif (LokalneCentrum.getCurrentHour().equals(\"03:00\"))\n\t\t{\n\t\t\tprint(\"03:00 on the clock\",debug);\n\t\t\tdebug=false;\n\t\t}\n\t\t\n\t\t//wszystkie ceny jakie byly oglaszan ne na najblizszy slot w \n\t\tArrayList<Float> cenyNaNajblizszySlot =znajdzOstatecznaCeneCenaNaNajblizszeSloty();\n\t\t\n\t\t\n\t\t//Stworzenie cen w raportowaniu\n\t\tint i=0;\n\t\twhile (i<cenyNaNajblizszySlot.size())\n\t\t{\n\t\t\trynekHistory.kontraktDodajCene(cenyNaNajblizszySlot.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tprint(\"ceny na najblizszy slot \"+cenyNaNajblizszySlot.size());\n\n\t\t\n\t\t//do rpzerobienia problemu minimalizacji na maksymalizacje\n\t\tint inverter =-1;\n\t\t\n\t\ti=0;\n\t\tfloat cena =cenyNaNajblizszySlot.get(i);\n\t\tfloat minimuCena =cena;\t\t\n\t\tfloat minimumValue =inverter*funkcjaRynku2(cena, false,true);\n\t\ti++;\n\t\t\n\t\trynekHistory.kontraktDodajWartoscFunkcjiRynku(funkcjaRynku2(cena, false), minimuCena);\n\t\t\n\t\twhile (i<cenyNaNajblizszySlot.size())\n\t\t{\n\t\t\tcena =cenyNaNajblizszySlot.get(i);\n\t\t\tfloat value =inverter*funkcjaRynku2(cena, false,true);\t\t\t\n\n\t\t\trynekHistory.kontraktDodajWartoscFunkcjiRynku(funkcjaRynku2(cena, false), cena);\n\n\t\t\tif (value<minimumValue)\n\t\t\t{\n\t\t\t\tminimuCena =cena;\n\t\t\t\tminimumValue = value;\n\n\t\t\t}\n\t\t\t\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tif(debug)\n\t\t{\n\t\t\tgetInput(\"03:00 end\");\n\t\t}\n\t\t\n\t\t//getInput(\"znajdzOstatecznaCene - nto finished\");\n\t\treturn minimuCena;\n\t\t\n\t}", "public int getLevel()\r\n {\r\n return level;\r\n }", "public void setLevel (String newLevel)\n {\n this.level = newLevel; \n }", "@Override\n\tdouble updateLevel() {\n\t\treturn 0;\n\t}", "public void Zabojstwa() {\n\t\tSystem.out.println(\"Zabojstwa\");\n\t\tfor(int i=0;i<Plansza.getNiebezpieczenstwoNaPlanszy().size();i++) {\n\t\t\tfor(GenerujNiebezpieczenstwo niebez : Plansza.getNiebezpieczenstwoNaPlanszy()) {\n\n\t\t\t\tif(niebez.getZabojca() instanceof DzikieZwierzeta) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getNiewolnikNaPLanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getNiewolnikNaPLanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getNiewolnikNaPLanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getNiewolnikNaPLanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getUbrania() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getNiewolnikNaPLanszy().getJedzenie() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setUbrania(Plansza.getNiewolnikNaPLanszy().getUbrania() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setJedzenie(Plansza.getNiewolnikNaPLanszy().getJedzenie() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setLicznikNiebezpieczenstw(Plansza.getNiewolnikNaPLanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\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(niebez.getZabojca() instanceof Bandyci) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getRzemieslnikNaPlanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getRzemieslnikNaPlanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getRzemieslnikNaPlanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getRzemieslnikNaPlanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getMaterialy() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getRzemieslnikNaPlanszy().getNarzedzia() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tif(GeneratorRandom.RandomOd0(101) <= ZapisOdczyt.getRzemieslnicySzansa()) {\n\t\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\t\ti--;\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\tPlansza.getRzemieslnikNaPlanszy().setMaterialy(Plansza.getRzemieslnikNaPlanszy().getMaterialy() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setNarzedzia(Plansza.getRzemieslnikNaPlanszy().getNarzedzia() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setLicznikNiebezpieczenstw(Plansza.getRzemieslnikNaPlanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(niebez.getZabojca() instanceof Zlodzieje) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getArystokrataNaPlanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getArystokrataNaPlanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getArystokrataNaPlanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getArystokrataNaPlanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getTowary() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getArystokrataNaPlanszy().getZloto() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setTowary(Plansza.getArystokrataNaPlanszy().getTowary() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setZloto(Plansza.getArystokrataNaPlanszy().getZloto() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setLicznikNiebezpieczenstw(Plansza.getArystokrataNaPlanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\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}", "public int getLevel(){\n\t\treturn level;\n\t}", "public int getLevel() { \r\n\t\treturn level; \r\n\t}", "public void urciStupneVrcholu(){\n\t\tfor(int i = 0;i < vrchP.length; i++){\n\t\t\tstupenVrcholu(vrchP[i].klic);\n\t\t}\n\t}", "public int getLevel()\n {\n return level;\n }", "int getLevel()\n\t{\n\t\treturn this.level;\n\t}", "private void poczatkowe_zmienne()\n {\n konfiguracja.loadProperties();\n predkosc_wroga=Integer.parseInt(konfiguracja.properties.getProperty(\"predkosc_wroga\"));\n czas_watku=Integer.parseInt(konfiguracja.properties.getProperty(\"czas_watku\"));\n punkty_poziomu=Integer.parseInt(konfiguracja.properties.getProperty(\"punkty_poziomu\"));\n zmienne_poziomu(poziom);\n }", "public int getLevel() {\r\n return level;\r\n }", "@Override\n public String getLevel(){ //this is the toString() method!\n level = \"Platinum\";\n return level;\n }", "public int getLevel() {\n return this.level;\n }", "public Integer geteLevel() {\n return eLevel;\n }", "public int getLevel() {\n\t\treturn 0;\n\t}", "public int getLevel() {\n\t\treturn 0;\n\t}", "public void zpracujObjednavky()\n\t{\n\t\tint idtmp = 0;\n\t\tfloat delkaCesty = 0;\n\t\t\n\t\tif (this.objednavky.isEmpty())\n\t\t{\n\t\t\treturn ;\n\t\t}\n\t\t\n\t\tNakladak nakl = (Nakladak) getVolneAuto();\n\t\t\n\t\tnakl.poloha[0] = this.poloha[0];\n\t\tnakl.poloha[1] = this.poloha[1];\n\t\tObjednavka ob = this.objednavky.remove();\n\n\t\t/*System.out.println();\n\t\tSystem.out.println(\"Objednavka hospody:\" + ob.id + \" se zpracuje pres trasu: \");\n\t\t */\n\t\tdelkaCesty += vyberCestu(this.id, ob.id, nakl);\n\t\t\n\t\twhile(nakl.pridejObjednavku(ob))\n\t\t{\n\t\t\tidtmp = ob.id;\n\t\t\t\n\t\t\tob = vyberObjednavku(ob.id);\n\t\t\tif (ob == null)\n\t\t\t{\n\t\t\t\tob=nakl.objednavky.getLast();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tobjednavky.remove(ob);\n\t\t\t\n\t\t\tdelkaCesty += vyberCestu(idtmp, ob.id, nakl);\n\t\t\t\n\t\t\tif((nakl.objem > 24)||(13-Simulator.getCas().hodina)*(nakl.RYCHLOST) + 100 < delkaCesty){\n\t\t\t\t//System.out.println(\"Nakladak ma \"+nakl.objem);\n\t\t\t\tnakl.kDispozici = false;\n\t\t\t\t//System.out.println(\"Auto jede \" + delkaCesty + \"km\");\n\t\t\t\tbreak;\t\t\n\t\t\t}\n\t\t\t/*\n\t\t\tif((Simulator.getCas().hodina > 12) && (delkaCesty > 80) ){\n\t\t\t\t//System.out.println(\"Nakladak ma \"+nakl.objem);\n\t\t\t\tnakl.kDispozici = false;\n\t\t\t\t//System.out.println(\"Auto jede \" + delkaCesty + \"km\");\n\t\t\t\tbreak;\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif((Simulator.getCas().hodina > 9) && (delkaCesty > 130) ){\n\t\t\t\t//System.out.println(\"Nakladak ma \"+nakl.objem);\n\t\t\t\tnakl.kDispozici = false;\n\t\t\t\t//System.out.println(\"Auto jede \" + delkaCesty + \"km\");\n\t\t\t\tbreak;\t\t\n\t\t\t}*/\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//cesta zpatky\n\t\tvyberCestu(ob.id, this.id, nakl);\n\t\tif (nakl.objem >= 1)\n\t\t{\n\t\t\tnakl.kDispozici = false;\n\t\t\tnakl.jede = true;\n\t\t\t//vytvoreni nove polozky seznamu pro statistiku\n\t\t\tnakl.novaStatCesta();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnakl.resetCesta();\n\t\t}\n\t}", "public static void trazenjeVozila(Iznajmljivac o) {\n\t\tLocalDate pocetniDatum = UtillMethod.unosDatum(\"pocetni\");\n\t\tLocalDate krajnjiDatum = UtillMethod.unosDatum(\"krajnji\");\n\t\tSystem.out.println(\"------------------------------------\");\n\t\tSystem.out.println(\"Provera dostupnosti vozila u toku...\\n\");\n\t\tArrayList<Vozilo> dostupnaVoz = new ArrayList<Vozilo>();\n\t\tint i = 0;\n\t\tfor (Vozilo v : Main.getVozilaAll()) {\n\t\t\tif (!postojiLiRezervacija(v, pocetniDatum, krajnjiDatum) && !v.isVozObrisano()) {\n\t\t\t\tSystem.out.println(i + \"-\" + v.getVrstaVozila() + \"-\" + \"Registarski broj\" + \"-\" + v.getRegBR()\n\t\t\t\t\t\t+ \"-Potrosnja na 100km-\" + v.getPotrosnja100() + \"litara\");\n\t\t\t\ti++;\n\t\t\t\tdostupnaVoz.add(v);\n\t\t\t}\n\t\t}\n\t\tif (i > 0) {\n\t\t\tSystem.out.println(\"------------------------------------------------\");\n\t\t\tSystem.out.println(\"Ukucajte kilometrazu koju planirate da predjete:\");\n\t\t\tdouble km = UtillMethod.unesiteBroj();\n\t\t\tint km1 = (int) km;\n\t\t\tporedjenjeVozila d1 = new poredjenjeVozila(km1);\n\t\t\tCollections.sort(dostupnaVoz,d1);\n\t\t\tint e = 0;\n\t\t\tfor(Vozilo v : dostupnaVoz) {\n\t\t\t\tdouble temp = cenaTroskaVoz(v, km, v.getGorivaVozila().get(0));\n\t\t\t\tSystem.out.println(e + \" - \" + v.getVrstaVozila()+ \"-Registarski broj: \"+ v.getRegBR()+\" | \"+ \"Cena na dan:\"+v.getCenaDan() +\" | Broj sedista:\"+ v.getBrSedist()+ \" | Broj vrata:\"+ v.getBrVrata() + \"| Cena troskova puta:\" + temp + \" Dinara\");\n\t\t\t\te++;\n\t\t\t}\n\t\t\tSystem.out.println(\"---------------------------------------\");\n\t\t\tSystem.out.println(\"Unesite redni broj vozila kojeg zelite:\");\n\t\t\tint redniBroj = UtillMethod.unesiteInt();\n\t\t\tif (redniBroj < dostupnaVoz.size()) {\n\t\t\t\tDateTimeFormatter formatters = DateTimeFormatter.ofPattern(\"dd/MM/yyyy\");\n\t\t\t\tString pocetni = pocetniDatum.format(formatters);\n\t\t\t\tString krajnji = krajnjiDatum.format(formatters);\n\t\t\t\tdouble cena = UtillMethod.cenaIznaj(pocetniDatum, krajnjiDatum, dostupnaVoz.get(redniBroj));\n\t\t\t\tRezervacija novaRez = new Rezervacija(dostupnaVoz.get(redniBroj), o, cena, false, pocetni, krajnji);\n\t\t\t\tMain.getRezervacijeAll().add(novaRez);\n\t\t\t\tSystem.out.println(\"Uspesno ste napravili rezervaciju!\");\n\t\t\t\tSystem.out.println(\"---------------------------------\");\n\t\t\t\tSystem.out.println(novaRez);\n\t\t\t\tSystem.out.println(\"---------------------------------\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Uneli ste pogresan redni broj!\");\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Nema dostupnih vozila za rezervaaciju.\");\n\t\t}\n\t}", "public boolean Wygrana() {\n\t\tSystem.out.println(\"Wygrana\");\n\t\tif(SprawdzanieWygranej.WygranaNiewolnikow()) {\n\t\t\tZapisOdczyt.setWygranaKlasa(Plansza.getNiewolnikNaPLanszy());\n\t\t\tZapisOdczyt.setWygranaKlasaPopulacja(Plansza.getNiewolnikNaPLanszy().getPopulacja());\n\t\t\t\n\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getPopulacja() >= Plansza.getArystokrataNaPlanszy().getPopulacja()) {\n\t\t\t\tZapisOdczyt.setMiejsce2(Plansza.getRzemieslnikNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce2Populacja(Plansza.getRzemieslnikNaPlanszy().getPopulacja());\n\t\t\t\tZapisOdczyt.setMiejsce3(Plansza.getArystokrataNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce3Populacja(Plansza.getArystokrataNaPlanszy().getPopulacja());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tZapisOdczyt.setMiejsce2(Plansza.getArystokrataNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce2Populacja(Plansza.getArystokrataNaPlanszy().getPopulacja());\n\t\t\t\tZapisOdczyt.setMiejsce3(Plansza.getRzemieslnikNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce3Populacja(Plansza.getRzemieslnikNaPlanszy().getPopulacja());\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\tif(SprawdzanieWygranej.WygranaRzemieslnikow()) {\n\t\t\tZapisOdczyt.setWygranaKlasa(Plansza.getRzemieslnikNaPlanszy());\n\t\t\tZapisOdczyt.setWygranaKlasaPopulacja(Plansza.getRzemieslnikNaPlanszy().getPopulacja());\n\t\t\t\n\t\t\tif(Plansza.getNiewolnikNaPLanszy().getPopulacja() >= Plansza.getArystokrataNaPlanszy().getPopulacja()) {\n\t\t\t\tZapisOdczyt.setMiejsce2(Plansza.getNiewolnikNaPLanszy());\n\t\t\t\tZapisOdczyt.setMiejsce2Populacja(Plansza.getNiewolnikNaPLanszy().getPopulacja());\n\t\t\t\tZapisOdczyt.setMiejsce3(Plansza.getArystokrataNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce3Populacja(Plansza.getArystokrataNaPlanszy().getPopulacja());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tZapisOdczyt.setMiejsce2(Plansza.getArystokrataNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce2Populacja(Plansza.getArystokrataNaPlanszy().getPopulacja());\n\t\t\t\tZapisOdczyt.setMiejsce3(Plansza.getNiewolnikNaPLanszy());\n\t\t\t\tZapisOdczyt.setMiejsce3Populacja(Plansza.getNiewolnikNaPLanszy().getPopulacja());\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\tif(SprawdzanieWygranej.WygranaArystokracji()) {\n\t\t\tZapisOdczyt.setWygranaKlasa(Plansza.getArystokrataNaPlanszy());\n\t\t\tZapisOdczyt.setWygranaKlasaPopulacja(Plansza.getArystokrataNaPlanszy().getPopulacja());\n\t\t\t\n\t\t\tif(Plansza.getNiewolnikNaPLanszy().getPopulacja() >= Plansza.getRzemieslnikNaPlanszy().getPopulacja()) {\n\t\t\t\tZapisOdczyt.setMiejsce2(Plansza.getNiewolnikNaPLanszy());\n\t\t\t\tZapisOdczyt.setMiejsce2Populacja(Plansza.getNiewolnikNaPLanszy().getPopulacja());\n\t\t\t\tZapisOdczyt.setMiejsce3(Plansza.getRzemieslnikNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce3Populacja(Plansza.getRzemieslnikNaPlanszy().getPopulacja());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tZapisOdczyt.setMiejsce2(Plansza.getRzemieslnikNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce2Populacja(Plansza.getRzemieslnikNaPlanszy().getPopulacja());\n\t\t\t\tZapisOdczyt.setMiejsce3(Plansza.getNiewolnikNaPLanszy());\n\t\t\t\tZapisOdczyt.setMiejsce3Populacja(Plansza.getNiewolnikNaPLanszy().getPopulacja());\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public int getLevel(){\n \t\treturn (strength + intelligence + stamina + Math.abs(charm) + Math.abs(cuteness))/5;\n \t}", "public int getLevel() {\n \treturn this.level;\n }", "public int getLevel() {\n \t\treturn level;\n \t}", "@Override\n public void levelUp(){\n //System.out.println(\"Level: \" + getLevel());\n if (getLevel() > 5) return;\n\n /* System.out.println(\"\\n-------\");\n System.out.println(\"Level: \" + getLevel());\n System.out.println(\"Se va a aumentar: \" + getName() + \"Stacks actuales: Health\" + getHealth() + \" range: \" + range + \" stroke\" + strokePerTime+ \" speed: \" + getSeep());\n*/\n double percentage = growth(getLevel()) + growthRate;\n\n setHealth((int) (getHealth() + getHealth() * percentage));\n strokePerTime = (int) (strokePerTime + strokePerTime * percentage);\n\n // Aumenta el rango si el nivel es 3 o 5\n // Luego quedan muy rotos xD\n if (getLevel() % 2 != 0) range++;\n setLevel(getLevel() + 1);\n\n /* System.out.println(\"resultado: \" + getName() + \"Stacks actuales: Health\" + getHealth() + \" range: \" + range + \" stroke\" + strokePerTime+ \" speed: \" + getSeep());\n System.out.println(\"-------\\n\");*/\n }", "public int getLevel() {\n return level;\n }", "public int getLevel() {\n return level;\n }", "public int getLevel() {\n return level;\n }", "public int getLevel() {\n return level;\n }", "public int getLevel() {\n return level;\n }", "public int getLevel() {\n return level;\n }", "public int getLevel() {\n return level;\n }", "public int getLevel() {\n return level;\n }", "public int getLevel() {\n return level;\n }", "public int getLevel() {\n return level;\n }", "public void kurangIsi(){\n status();\n //kondisi jika air kurang atau sama dengan level 0\n if(level==0){Toast.makeText(this,\"Air Sedikit\",Toast.LENGTH_SHORT).show();return;}\n progress.setImageLevel(--level);\n }", "public int controlloRuote() {\n\n\t\t// restituisce:\n\t\t// 0 -> se tutto ok\n\t\t// 1 -> se vanno controllate le ruote\n\t\t// 2 -> se vanno gonfiate le ruote\n\t\t// 3 -> se vanno sia controllate che gonfiate\n\n\t\treturn ruote.controlloRuote();\n\n\t}", "public String getLevel(){\n\t\treturn level;\n\t}", "public Kabasuji(ArrayList<Level> level){\n\t\tthis.levels = level;\n\t\t@SuppressWarnings(\"unused\")\n\t\tLevelSelection levelSec = new LevelSelection(level);\n\t}", "public int getLevel()\n {\n return m_level;\n }", "public void newlevel() {\n\t\tblack = new Background(COURT_WIDTH, COURT_HEIGHT); // reset background\n\t\tcannon = new Cannon(COURT_WIDTH, COURT_HEIGHT); // reset cannon\n\t\tdeadcannon = null;\n\t\tbullet = null;\n\t\tshot1 = null;\n\t\tshot2 = null;\n\t\t// reset top row\n\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\talien1[i] = new Alien(COURT_WIDTH, COURT_HEIGHT);\n\t\t\talien1[i].pos_x = alien1[i].pos_x + 30*i;\n\t\t\talien1[i].v_x = level + alien1[i].v_x;\n\t\t}\n\t\t// reset second row\n\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\talien2[i] = new Alien2(COURT_WIDTH, COURT_HEIGHT);\n\t\t\talien2[i].pos_x = alien2[i].pos_x + 30*i;\n\t\t\talien2[i].v_x = level + alien2[i].v_x;\n\t\t}\n\t\t// reset third row\n\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\talien3[i] = new Alien3(COURT_WIDTH, COURT_HEIGHT);\n\t\t\talien3[i].pos_x = alien3[i].pos_x + 30*i;\n\t\t\talien3[i].v_x = level + alien3[i].v_x;\n\t\t}\n\t}", "public static void main(String [] agrs){\n\r\n\r\n Kaczka gumowa = new GumowaKaczka();\r\n gumowa.ustawKwakanieInterfejs(2);\r\n gumowa.ustawLatanieInterfejs(new SzybkieLatanie());\r\n gumowa.wyswietl();\r\n System.out.println(gumowa.kwacz());\r\n System.out.println(gumowa.lec());\r\n Kaczka dzika = new DzikaKaczka();\r\n // dzika.ustawLatanieInterfejs(1);\r\n dzika.wyswietl();\r\n System.out.println(dzika.lec());\r\n System.out.println(dzika.kwacz());\r\n\r\n\r\n// Polecenie[] polecenieWlacz;\r\n// Polecenie[] polecanieWylacz;\r\n// Polecenie polecenieWycofaj;\r\n//\r\n// polecanieWylacz = new Polecenie[7];\r\n// polecenieWlacz = new Polecenie[7];\r\n//\r\n// Swiatlo swiatlo = new Swiatlo();\r\n// polecanieWylacz[0] = new PolecenieWylaczSwiatlo(swiatlo);\r\n// polecenieWlacz[0] = new PolecenieWlaczSwiatlo(swiatlo);\r\n//\r\n//\r\n//\r\n//\r\n// polecenieWlacz[0].wykonaj();\r\n// polecanieWylacz[0].wykonaj();\r\n// polecenieWlacz[0].wykonaj();\r\n// polecenieWycofaj = polecanieWylacz[0];\r\n//// polecenieWycofaj = polecenieWlacz[0];\r\n// polecenieWycofaj.wykonaj();\r\n// polecenieWycofaj.wykonaj();\r\n//// polecenieWycofaj.wycofaj();\r\n//\r\n// WiezaStereo wiezaStereo = new WiezaStereo();\r\n//\r\n// polecenieWlacz[1] = new PolecenieWiezaStereoWlaczCD(wiezaStereo);\r\n//\r\n// polecenieWlacz[1].wykonaj();\r\n\r\n\r\n\r\n }", "public void setLevel(int newlevel)\n {\n level = newlevel; \n }", "public logicaEnemigos(){\n\t\t//le damos una velocidad inicial al enemigo\n\t\tsuVelocidad = 50;\n\t\tsuDireccionActual = 0.0;\n\t\tposX = 500 ;\n\t\tposY = 10;\n\t}", "public void setLevel(int v)\n {\n m_level = v;\n }", "public String getLevel() {\n return this.level;\n }", "public static int getLicznikTur() { return LicznikTur; }", "public void setLevel(String lev) {\n\t\tlevel = lev;\n\t}", "public int getLevelNo() {\n return levelNo;\n }", "private void applyLvlUpCost() {\n }", "private int obliczDowoz() {\n int x=this.klient.getX();\n int y=this.klient.getY();\n double odl=Math.sqrt((Math.pow((x-189),2))+(Math.pow((y-189),2)));\n int kilometry=(int)(odl*0.5); //50 gr za kilometr\n return kilometry;\n }", "public void setLevel(Level level) { this.currentLevel = level; }", "public void ZbierzTowaryKlas() {\n\t\tSystem.out.println(\"ZbierzTowaryKlas\");\n\t\tfor(int i=0;i<Plansza.getTowarNaPlanszy().size();i++) {\n\t\t\tfor(Towar towar : Plansza.getTowarNaPlanszy()) {\n\t\t\t\t\n\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getNiewolnikNaPLanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getNiewolnikNaPLanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\t//Szansa Niewolnika na zdobycie dwoch razy wiecej towarow\n\t\t\t\t\t\tif(GeneratorRandom.RandomOd0(101) <= ZapisOdczyt.getNiewolnicySzansa()) {\n\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setLicznikTowarow(Plansza.getNiewolnikNaPLanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getRzemieslnikNaPlanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getRzemieslnikNaPlanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setLicznikTowarow(Plansza.getRzemieslnikNaPlanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getArystokrataNaPlanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getArystokrataNaPlanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setLicznikTowarow(Plansza.getArystokrataNaPlanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "ArrayList<Float> pierwszaPredykcja()\n\t{\n\t\tif (Stale.scenariusz<100)\n\t\t{\n\t\t\treturn pierwszaPredykcjaNormal();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//dla scenariusza testowego cnea predykcji jest ustawiana na 0.30\n\t\t\tArrayList<Float> L1 = new ArrayList<>();\n\t\t\tL1.add(0.30f);\n\t\t\treturn L1;\n\t\t}\n\t}", "public int getLevel() {\n return level_;\n }", "public int getLevel() {\n return level_;\n }", "int getMaxLevel();", "int getOnLevel();", "private void zmienne_poziomu(int poziom)\n {\n liczba_zyc =Integer.parseInt(konfiguracja.properties.getProperty(poziom+\"_liczba_zyc\"));\n liczba_naboi=Integer.parseInt(konfiguracja.properties.getProperty(poziom+\"_liczba_naboi\"));\n liczba_zyc_wroga=Integer.parseInt(konfiguracja.properties.getProperty(poziom+\"_liczba_zyc_wroga\"));\n liczba_pilek=Integer.parseInt(konfiguracja.properties.getProperty(poziom+\"_liczba_pilek\"));\n predkosc_wroga=Integer.parseInt(konfiguracja.properties.getProperty(poziom+\"_predkosc_wroga\"));\n bonusy_poziomu=Integer.parseInt(konfiguracja.properties.getProperty(poziom+\"_bonusy_poziomu\"));\n rozmiar_pilki=Integer.parseInt(konfiguracja.properties.getProperty(poziom+\"_rozmiar_pilki\"));\n zmiana_ruchu_wroga=Integer.parseInt(konfiguracja.properties.getProperty(poziom+\"_zmiana_ruchu_wroga\"));\n czas_gry=Integer.parseInt(konfiguracja.properties.getProperty(poziom+\"_czas_gry\"));\n }", "public String getLevel()\n {\n return level;\n }", "public static int getLevel()\n {\n return level;\n }", "public int getLevel()\n {\n return m_nLevel;\n }", "public static int getLevel()\r\n\t{\r\n\t\treturn level;\r\n\t}", "private int getLevel() {\n return getStat(currentLevel);\n }", "protected void setLevel(int level){\r\n this.level = level;\r\n }", "public int getLevelValue() {\n return level_;\n }", "public static Pot oceni_moder(Igra igra) {\n\t\tTocka[][] plosca = igra.getPlosca();\n\t\tint N = Igra.N;\n\n\t\t\n\t\tSet<Vrednost> modra_pot = new HashSet<Vrednost>();\n\t\tVrednost[][] tabela_dolzin_modri = new Vrednost[N][N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tfor (int j = 0; j < N; j++) {\n\t\t\t\ttabela_dolzin_modri[i][j] = new Vrednost(new Koordinati(j, i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 1. vrstica\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tif (plosca[i][0].polje == Polje.Moder) tabela_dolzin_modri[i][0].vrednost = 0;\n\t\t\tif (plosca[i][0].polje == Polje.PRAZNO) tabela_dolzin_modri[i][0].vrednost = 1;\n\t\t}\n\t\t\n\t\t// ostalo\n\t\tfor (int j = 1; j < N; j++) {\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\n\t\t\t\tint gor_gor_lev;\n\t\t\t\tint gor_lev;\n\t\t\t\tint dol_lev;\n\t\t\t\tint dol_dol_lev;\n\t\t\t\tint levo;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif (plosca[i - 1][j].polje == Polje.PRAZNO && plosca[i][j - 1].polje == Polje.PRAZNO) {\n\t\t\t\t\t\tgor_gor_lev = tabela_dolzin_modri[i - 1][j - 1].vrednost;\n\t\t\t\t\t}\n\t\t\t\t\telse gor_gor_lev = POLNO;\n\t\t\t\t} catch (ArrayIndexOutOfBoundsException e) { gor_gor_lev = POLNO; }\n\t\t\t\t\n\t\t\t\ttry { gor_lev = tabela_dolzin_modri[i][j - 1].vrednost; } \n\t\t\t\tcatch (ArrayIndexOutOfBoundsException e) { gor_lev = POLNO; }\n\t\t\t\ttry { dol_lev = tabela_dolzin_modri[i + 1][j - 1].vrednost; } \n\t\t\t\tcatch (ArrayIndexOutOfBoundsException e) { dol_lev = POLNO; }\n\t\t\t\ttry {\n\t\t\t\t\tif (plosca[i + 1][j - 1].polje == Polje.PRAZNO && plosca[i + 1][j].polje == Polje.PRAZNO) {\n\t\t\t\t\t\tdol_dol_lev = tabela_dolzin_modri[i + 2][j - 1].vrednost;\n\t\t\t\t\t}\n\t\t\t\t\telse dol_dol_lev = POLNO;\n\t\t\t\t} catch (ArrayIndexOutOfBoundsException e) { dol_dol_lev = POLNO; }\n\t\t\t\ttry {\n\t\t\t\t\tif (plosca[i + 1][j - 1].polje == Polje.PRAZNO && plosca[i][j - 1].polje == Polje.PRAZNO) {\n\t\t\t\t\t\tlevo = tabela_dolzin_modri[i + 1][j - 2].vrednost;\n\t\t\t\t\t}\n\t\t\t\t\telse levo = POLNO;\n\t\t\t\t} catch (ArrayIndexOutOfBoundsException e) { levo = POLNO; }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tVrednost pointer = null;\n\t\t\t\tSkok skok = null;\n\t\t\t\tint vrednost_polja;\n\t\t\t\tvrednost_polja = Math.min(gor_gor_lev, Math.min(gor_lev, Math.min(dol_lev, Math.min(dol_dol_lev, levo))));\n\t\t\t\t\n\t\t\t\tif (vrednost_polja != POLNO) {\n\t\t\t\t\tif (vrednost_polja == gor_gor_lev) {\n\t\t\t\t\t\tpointer = tabela_dolzin_modri[i - 1][j - 1];\n\t\t\t\t\t\tskok = Skok.Skok1;\n\t\t\t\t\t}\n\t\t\t\t\tif (vrednost_polja == gor_lev) pointer = tabela_dolzin_modri[i][j - 1];\n\t\t\t\t\tif (vrednost_polja == dol_lev) pointer = tabela_dolzin_modri[i + 1][j - 1];\n\t\t\t\t\tif (vrednost_polja == dol_dol_lev) {\n\t\t\t\t\t\tpointer = tabela_dolzin_modri[i + 2][j - 1];\n\t\t\t\t\t\tskok = Skok.Skok3;\n\t\t\t\t\t}\n\t\t\t\t\tif (vrednost_polja == levo) {\n\t\t\t\t\t\tpointer = tabela_dolzin_modri[i + 1][j - 2];\n\t\t\t\t\t\tskok = Skok.Skok2;\n\t\t\t\t\t}\n\t\t\t\t\tif (plosca[i][j].polje == Polje.PRAZNO) vrednost_polja += 1;\n\t\t\t\t\tif (plosca[i][j].polje == Polje.Rdec) vrednost_polja = POLNO;\n\t\t\t\t}\n\t\t\t\ttabela_dolzin_modri[i][j].vrednost = vrednost_polja;\n\t\t\t\ttabela_dolzin_modri[i][j].pointer = pointer;\n\t\t\t\ttabela_dolzin_modri[i][j].skok = skok;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// Ponovni pregled\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tint gor;\n\t\t\t\tint dol;\n\t\t\t\tint vrednost_polja = tabela_dolzin_modri[i][j].vrednost;\n\t\t\t\tVrednost pointer = tabela_dolzin_modri[i][j].pointer;\n\t\t\t\tSkok skok = tabela_dolzin_modri[i][j].skok;\n\t\t\t\tVrednost nov_pointer = pointer;\n\t\t\t\t\n\t\t\t\ttry { gor = tabela_dolzin_modri[i - 1][j].vrednost; } \n\t\t\t\tcatch (ArrayIndexOutOfBoundsException e) { gor = POLNO; }\n\t\t\t\ttry { dol = tabela_dolzin_modri[i + 1][j].vrednost; } \n\t\t\t\tcatch (ArrayIndexOutOfBoundsException e) { dol = POLNO; }\n\t\t\t\t\n\t\t\t\tif (dol != POLNO && dol < vrednost_polja) {\n\t\t\t\t\tif (plosca[i][j].polje == Polje.Moder) vrednost_polja = dol;\n\t\t\t\t\tif (plosca[i][j].polje == Polje.PRAZNO) vrednost_polja = dol + 1;\n\t\t\t\t\tnov_pointer = tabela_dolzin_modri[i + 1][j];\n\t\t\t\t\tskok = null;\n\t\t\t\t}\n\t\t\t\tif (gor != POLNO && gor < vrednost_polja) {\n\t\t\t\t\tif (plosca[i][j].polje == Polje.Moder) vrednost_polja = gor;\n\t\t\t\t\tif (plosca[i][j].polje == Polje.PRAZNO) vrednost_polja = gor + 1;\n\t\t\t\t\tnov_pointer = tabela_dolzin_modri[i - 1][j];\n\t\t\t\t\tskok = null;\n\t\t\t\t}\n\t\t\t\ttabela_dolzin_modri[i][j].vrednost = vrednost_polja;\n\t\t\t\ttabela_dolzin_modri[i][j].pointer = nov_pointer;\n\t\t\t\ttabela_dolzin_modri[i][j].skok = skok;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Koncna vrednost\n\t\tint najmanjsa_modra = POLNO;\n\t\tVrednost pointer_modra = null;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tint vrednost = tabela_dolzin_modri[i][N - 1].vrednost;\n\t\t\tif (najmanjsa_modra > vrednost) {\n\t\t\t\tnajmanjsa_modra = vrednost;\n\t\t\t\tpointer_modra = tabela_dolzin_modri[i][N - 1];\n\t\t\t}\t\n\t\t}\n\t\t\n\t\n\t\t// Izracun poti\n\t\tVrednost spremenljivka = pointer_modra;\n\t\twhile (spremenljivka != null) {\n\t\t\tmodra_pot.add(spremenljivka);\n\t\t\tspremenljivka = spremenljivka.pointer;\n\t\t}\n\t\t\n\t\treturn new Pot(najmanjsa_modra, modra_pot);\n\t}" ]
[ "0.6767371", "0.6633183", "0.64145553", "0.62401587", "0.6121189", "0.61192626", "0.6100647", "0.60957485", "0.6095744", "0.60916644", "0.60828686", "0.60758895", "0.6063912", "0.60594857", "0.6058851", "0.6058851", "0.60219103", "0.6021792", "0.6021792", "0.60154843", "0.6006154", "0.6002457", "0.6002457", "0.6002457", "0.6002457", "0.6002457", "0.5944521", "0.5930738", "0.5930738", "0.5928768", "0.5917103", "0.59139115", "0.59073824", "0.59021974", "0.5899934", "0.5884051", "0.5875198", "0.58700776", "0.5864994", "0.5852469", "0.58455986", "0.5842357", "0.58319426", "0.5824447", "0.57905287", "0.57880056", "0.57844985", "0.5774493", "0.57732785", "0.5768138", "0.5767517", "0.5767517", "0.5756274", "0.5747696", "0.5737904", "0.57274157", "0.57247746", "0.572051", "0.5715963", "0.57092315", "0.57092315", "0.57092315", "0.57092315", "0.57092315", "0.57092315", "0.57092315", "0.57092315", "0.57092315", "0.57092315", "0.5707706", "0.5704815", "0.57046854", "0.57036704", "0.570214", "0.56986845", "0.56908935", "0.5690507", "0.56899226", "0.5670514", "0.56647944", "0.5663615", "0.56613326", "0.5661178", "0.56560034", "0.5652212", "0.56505144", "0.564606", "0.56400585", "0.5638766", "0.5638766", "0.5625118", "0.562113", "0.56201005", "0.5618481", "0.56043893", "0.5600964", "0.5599933", "0.5591844", "0.55914795", "0.55910987", "0.5590001" ]
0.0
-1
associate deeplinks with activity
public Intent parseAndGetIntent(Uri uri) { Log.d(TAG, uri.toString()); List<String> pathSegments = uri.getPathSegments(); Intent intent = null; String tagKey = pathSegments.get(0).toLowerCase(); Log.d(TAG, "tagKey:" + tagKey); if (AppIndexApplication.getInstance().cabSet.contains(tagKey)) { intent = new Intent(AppIndexApplication.getInstance(), BookCabActivity.class); } else if (AppIndexApplication.getInstance().restaurantSet.contains(tagKey)) { intent = new Intent(AppIndexApplication.getInstance(), RestaurantActivity.class); } else { intent = new Intent(AppIndexApplication.getInstance(), BookCabActivity.class); } return intent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void deepLinkingFlow() {\n\n if (getActivity().getIntent().hasExtra(\"deeplink\")) {\n destination = getActivity().getIntent().getParcelableExtra(\"deeplink\");\n hotelSearchPresenter.checkDeepLinking(destination, getActivity().getSupportFragmentManager().beginTransaction());\n }\n\n }", "public interface ActivityWithDeepLinking {\n}", "private void link(MainActivity pActivity) {\n\n\t\t}", "private void launchDeepLinkActivity(Intent intent) {\n LogUtils.LOGE(\"***> Here\", \"launchDeepLinkActivity:\" + intent);\n Intent newIntent = new Intent(intent).setClass(this, ParseDeepLinkActivity.class);\n startActivity(newIntent);\n }", "private void registerDeepLinkReceiver() {\n mDeepLinkReceiver = new BroadcastReceiver() {\n @Override\n public void onReceive(Context context, Intent intent) {\n if (AppInviteReferral.hasReferral(intent)) {\n launchDeepLinkActivity(intent);\n }\n }\n };\n\n IntentFilter intentFilter = new IntentFilter(Constants.ACTION_DEEP_LINK_JOIN_ACTIVITY);\n LocalBroadcastManager.getInstance(mActivity.getApplicationContext()).registerReceiver(mDeepLinkReceiver, intentFilter);\n }", "public void onLinksClick(View v){\n // Launch the Links activity\n onAnyClick(Links.class);\n }", "@Override\n public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {\n Uri deepLink = null;\n if (pendingDynamicLinkData != null) {\n deepLink = pendingDynamicLinkData.getLink();\n\n //String url = deepLink.toString();\n String url = method(deepLink.toString());\n Log.d(\"+++++\", \"++ url deep ++\" + url.charAt(12));\n Log.d(\"+++++\", \"++ url deep ++\" + url);\n //Toast.makeText(HomeActivity.this, \"\"+url.charAt(13), Toast.LENGTH_SHORT).show();\n if (url.charAt(12) == 'm') {\n if (url != null) {\n DescrptedFragment descrptedFragment = new DescrptedFragment();\n Bundle bundle = new Bundle();\n descrptedFragment.setArguments(bundle);\n bundle.putString(\"deeplink\", url.toString());\n FragmentTransaction transaction = fragmentManager.beginTransaction();\n transaction.replace(R.id.framelayout, descrptedFragment);\n transaction.addToBackStack(null);\n transaction.commit();\n }\n } else {\n\n if (url.charAt(11) == 'm') {\n if (url.contains(\"=\")) {\n String[] separated = url.split(\"=\");\n String[] separateditem = separated[1].split(\"&\");\n DetailsFragment descrptedFragment = new DetailsFragment();\n Bundle bundle = new Bundle();\n bundle.putString(\"deeplink\", url.toString());\n bundle.putString(\"ItemId\", separateditem[0]);\n descrptedFragment.setArguments(bundle);\n Log.d(\"+++++\", \"++ url deep ++\" + separateditem[0]);\n Log.d(\"+++++\", \"++ url deep ++\" + separated[2]);\n SharedToken sharedToken = new SharedToken(HomeActivity.this);\n sharedToken.setCatid(separated[2]);\n FragmentTransaction transaction = fragmentManager.beginTransaction();\n transaction.replace(R.id.framelayout, descrptedFragment);\n transaction.addToBackStack(null);\n transaction.commit();\n } else {\n SplashScreen.code = deepLink.toString().substring(deepLink.toString().lastIndexOf('/') + 1);\n Intent intent = new Intent(HomeActivity.this, SplashScreen.class);\n startActivity(intent);\n finish();\n }\n\n } else {\n\n SplashScreen.code = deepLink.toString().substring(deepLink.toString().lastIndexOf('/') + 1);\n Intent intent = new Intent(HomeActivity.this, SplashScreen.class);\n startActivity(intent);\n finish();\n }\n }\n\n //Log.d(\"deeplink\", \"\" + code);\n }\n // ...\n }", "void storeLinks();", "@Override\n public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {\n Uri deepLink = null;\n if (pendingDynamicLinkData != null) {\n deepLink = pendingDynamicLinkData.getLink();\n\n //String url = deepLink.toString(); https://www.m8s.world/1CV9P8\n String url = method(deepLink.toString());\n Log.d(\"+++++\", \"++ url deep ++\" + url.charAt(12));\n Log.d(\"+++++\", \"++ url deep ++\" + url);\n //Toast.makeText(HomeActivity.this, \"\"+url.charAt(13), Toast.LENGTH_SHORT).show();\n if (url.charAt(12) == 'm') {\n if (url != null) {\n if (dialog!=null)\n dialog.dismiss();\n DescrptedFragment descrptedFragment = new DescrptedFragment();\n Bundle bundle = new Bundle();\n descrptedFragment.setArguments(bundle);\n bundle.putString(\"deeplink\", url.toString());\n FragmentTransaction transaction = fragmentManager.beginTransaction();\n transaction.replace(R.id.framelayout, descrptedFragment);\n transaction.addToBackStack(null);\n transaction.commit();\n }\n } else {\n\n if (url.charAt(11) == 'm') {\n if (url.contains(\"=\"))\n {\n if (dialog!=null)\n dialog.dismiss();\n String[] separated = url.split(\"=\");\n String[] separateditem = separated[1].split(\"&\");\n DetailsFragment descrptedFragment = new DetailsFragment();\n Bundle bundle = new Bundle();\n bundle.putString(\"deeplink\", url.toString());\n bundle.putString(\"ItemId\", separateditem[0]);\n descrptedFragment.setArguments(bundle);\n Log.d(\"+++++\", \"++ url deep ++\" + separateditem[0]);\n Log.d(\"+++++\", \"++ url deep ++\" + separated[2]);\n SharedToken sharedToken = new SharedToken(HomeActivity.this);\n sharedToken.setCatid(separated[2]);\n FragmentTransaction transaction = fragmentManager.beginTransaction();\n transaction.replace(R.id.framelayout, descrptedFragment);\n transaction.addToBackStack(null);\n transaction.commit();\n }\n else\n {\n if (dialog!=null)\n dialog.dismiss();\n SplashScreen.code = deepLink.toString().substring(deepLink.toString().lastIndexOf('/') + 1);\n Intent intent = new Intent(HomeActivity.this, SplashScreen.class);\n startActivity(intent);\n\n finish();\n }\n\n }\n else {\n if (dialog!=null)\n dialog.dismiss();\n SplashScreen.code = deepLink.toString().substring(deepLink.toString().lastIndexOf('/') + 1);\n Intent intent = new Intent(HomeActivity.this, SplashScreen.class);\n startActivity(intent);\n\n finish();\n }\n }\n\n //Log.d(\"deeplink\", \"\" + code);\n }\n // ...\n }", "private void handleIntent() {\n // Get the intent set on this activity\n Intent intent = getIntent();\n\n // Get the uri from the intent\n Uri uri = intent.getData();\n\n // Do not continue if the uri does not exist\n if (uri == null) {\n return;\n }\n\n // Let the deep linker do its job\n Bundle data = mDeepLinker.buildBundle(uri);\n if (data == null) {\n return;\n }\n\n // See if we have a valid link\n DeepLinker.Link link = DeepLinker.getLinkFromBundle(data);\n if (link == null) {\n return;\n }\n\n // Do something with the link\n switch (link) {\n case HOME:\n break;\n case PROFILE:\n break;\n case PROFILE_OTHER:\n break;\n case SETTINGS:\n break;\n }\n\n String msg;\n long id = DeepLinker.getIdFromBundle(data);\n if (id == 0) {\n msg = String.format(\"Link: %s\", link);\n } else {\n msg = String.format(\"Link: %s, ID: %s\", link, id);\n }\n\n Toast.makeText(this, msg, Toast.LENGTH_LONG).show();\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(v.getContext(), WebViewActivity.class);\n //intent.setData(Uri.parse(listOfArticles.get(position).getLinkToArticle()));\n intent.putExtra(LINK_URL_KEY, listOfArticles.get(position).getLinkToArticle());\n v.getContext().startActivity(intent);\n }", "@Override // com.oculus.vrshell.panels.AndroidPanelApp\n public void onDeepLink(String str, String str2) {\n Log.d(TAG, String.format(\"Received deeplink; uri: %s.\", str2));\n LibraryView libraryView = this.mLibraryView;\n if (libraryView == null) {\n Log.e(TAG, \"Unable to handle deeplink; library view has not been initialized.\");\n } else {\n libraryView.onShow(str2);\n }\n }", "void attachActivityToEntity(ExoSocialActivity activity, ExoSocialActivity comment) throws Exception;", "protected void _initLinks() {\n\tpeopleLink = null;\n\tchangeLogDetailsesLink = null;\n}", "public void addlink(TparselinksEntity newlink);", "@Override\n public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {\n Uri deepLink = null;\n if (pendingDynamicLinkData != null) {\n deepLink = pendingDynamicLinkData.getLink();\n if (deepLink.toString().contains(URLFactory.EXP_SHARE)) {\n String expId = deepLink.getLastPathSegment();\n\n Bundle bundle = new Bundle();\n bundle.putString(\"expId\", expId);\n openIsloatedFullActivity().setPage(AppNavigator.Pages.EXPDETAILSLOCAL).addBundle(bundle).start();\n } else if (deepLink.toString().contains(URLFactory.LOCAL_SHARE)) {\n\n String localId = deepLink.getLastPathSegment();\n\n Bundle bundle = new Bundle();\n DashboardDetails dashboardDetails = new DashboardDetails();\n dashboardDetails.setId(localId);\n bundle.putString(\"localDetails\", new Gson().toJson(dashboardDetails));\n\n openIsloatedFullActivity().addBundle(bundle).setPage(AppNavigator.Pages.Dashboard).start();\n\n }\n }\n\n\n }", "@Override\n public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {\n Uri deepLink = null;\n if (pendingDynamicLinkData != null) {\n deepLink = pendingDynamicLinkData.getLink();\n }\n\n\n // Handle the deep link. For example, open the linked\n // content, or apply promotional credit to the user's\n // account.\n // ...\n\n // ...\n }", "void addHadithUrl(Object newHadithUrl);", "public void setLinks(List<Link> links)\n {\n this.links = links;\n }", "@Override\n public void onClick(View view) {\n final Intent intent = new Intent(context, ArticleViewActivity.class);\n intent.putExtra(\"link\", model.link);\n context.startActivity(intent);\n }", "@Override\n public void onItemClick(Photo photo) {\n Intent intent = new Intent(activity, FullScreenPhotoActivity.class);\n intent.putExtra(\"photoUrls\", urls);\n activity.startActivity(intent);\n }", "public void \t\t\t\t\t\t\t\t\tlink(RoomCreateActivity act) \n\t\t{\n\t\t\tthis.activity = new WeakReference<RoomCreateActivity>(act);\n\t\t}", "public void connect(Integer tagId, Integer linkId);", "@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\t\tparentActivity=activity;\n\t}", "@Override\n public void onClick(View v) {\n Uri uri = Uri.parse(url);\n //Se crea un intent implicito para visualizar los links en un navegador\n Intent intent = new Intent(Intent.ACTION_VIEW, uri);\n //Se inicia la actividad del navegador\n activityt.startActivity(intent);\n }", "public void setLinks(List<ALink> link) {\n this.link = link;\n }", "@Override\n public void onClick(View v) {\n String Url= currentNews.getWebUrl();\n //sent intent to the website\n Intent intent = new Intent();\n intent.setAction(Intent.ACTION_VIEW);\n intent.addCategory(Intent.CATEGORY_BROWSABLE);\n intent.setData(Uri.parse(Url));\n getContext().startActivity(intent);\n }", "public void connect(Set<String> tags, Integer linkId);", "@Override\n\tpublic void onAttach(Activity activity) {\n\t\tthis.activity = activity;\n\t\tsuper.onAttach(activity);\n\t}", "public boolean sendDeepLinkAction(Uri deeplinkUri) {\n boolean result = false;\n if (currentActivity != null) {\n Intent deeplinkIntent = new Intent(AppCMSPresenter.PRESENTER_DEEPLINK_ACTION);\n deeplinkIntent.setData(deeplinkUri);\n currentActivity.sendBroadcast(deeplinkIntent);\n result = true;\n }\n return result;\n }", "@Override\n public void RelationshipAdded(boolean ok) {\n final Intent i = new Intent(this,ELFStaff.class);\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(i);\n }", "public void onClick(View v) {\n\n Intent visitSite_intent = new Intent(MainActivity.this, DetailActivity.class);\n visitSite_intent.putExtra(\"url\",\"http://aanm-vvrsrpolytechnic.ac.in/\");\n startActivity(visitSite_intent);\n }", "private void pullLinks(String htmlPage) {\n\n Document doc = Jsoup.parse(htmlPage);\n Elements links = doc.select(\"a[href]\");\n\n for (Element link : links) {\n\n String possibleUrl = link.attr(\"abs:href\");\n\n if (!possibleUrl.equals(\"\")) {\n// Log.v(\"pullLinks\", \" will try to make URL from\" + possibleUrl);\n //if the link attr isn't empty, make a URL\n URL theUrl = NetworkUtils.makeURL(possibleUrl);\n\n if (RegexUtils.urlDomainNameMatch(firstLinkAsString, theUrl.toString())) {\n //if the string version of url is within the same domain as original query\n if (!visitedLinks.contains(theUrl.toString())) {\n// Log.v(\"DLAsyncTask.pullLinks\", \" thinks that \" + theUrl.toString() + \" wasn't visited, add into collected...\");\n collectedLinks.add(theUrl.toString());\n }\n }\n }\n\n }\n }", "LinkRelation createLinkRelation();", "@Override\r\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\r\n\t\tthis.mActivity = activity;\r\n\t}", "@Override\r\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\r\n\t\tmActivity = activity;\r\n\t\tstartAppAd = new StartAppAd(activity);\r\n\t}", "public void push(Object activity);", "@Override // io.reactivex.rxjava3.functions.Consumer\n public void accept(DeepLink deepLink) {\n DeepLink deepLink2 = deepLink;\n RatingPublishCheckPresenter.Router router = this.a.b;\n if (router != null) {\n Intrinsics.checkNotNullExpressionValue(deepLink2, \"it\");\n router.followDeepLink(deepLink2);\n }\n }", "private String setReferralzz(){\n String uid = mAuth.getCurrentUser().getUid();\n String link = INVITE_LINK+uid;\n FIRDynamicLinkComponents referalLink = new FIRDynamicLinkComponents(new NSURL(link) ,\"https://fingertipsandcompany.page.link\");\n\n FIRDynamicLinkIOSParameters iOSParameters = new FIRDynamicLinkIOSParameters(BUNDLE_ID);\n iOSParameters.setMinimumAppVersion(\"1.0.1\");\n iOSParameters.setAppStoreID(\"1496752335\");\n referalLink.setIOSParameters(iOSParameters);\n\n FIRDynamicLinkAndroidParameters androidParameters = new FIRDynamicLinkAndroidParameters(BUNDLE_ID);\n androidParameters.setMinimumVersion(125);\n referalLink.setAndroidParameters(androidParameters);\n\n\n referalLink.shorten(new VoidBlock3<NSURL, NSArray<NSString>, NSError>() {\n @Override\n public void invoke(NSURL shortURL, NSArray<NSString> nsStrings, NSError nsError) {\n if (nsError != null){\n System.out.println(\"Referal Link Shorter Error-------------------->\"+nsError);\n return;\n }\n mInvitationURL = shortURL.getAbsoluteString();\n System.out.println(\"Generated Referral Link \");\n\n }\n });\n\n return mInvitationURL;\n\n }", "public void onCreate(Bundle bundle) {\n super.onCreate(bundle);\n Intent intent = getIntent();\n if (intent != null) {\n this.Z = intent.getStringExtra(\"extra_deep_link_ots\");\n this.Y = intent.getStringExtra(\"extra_deep_link_email\");\n }\n }", "static final /* synthetic */ void m50994c(ane ane, Map map) {\n String str = (String) map.get(\"urls\");\n if (TextUtils.isEmpty(str)) {\n acd.m45783e(\"URLs missing in canOpenURLs GMSG.\");\n return;\n }\n String[] split = str.split(\",\");\n HashMap hashMap = new HashMap();\n PackageManager packageManager = ane.getContext().getPackageManager();\n for (String str2 : split) {\n String[] split2 = str2.split(\";\", 2);\n boolean z = true;\n if (packageManager.resolveActivity(new Intent(split2.length > 1 ? split2[1].trim() : \"android.intent.action.VIEW\", Uri.parse(split2[0].trim())), 65536) == null) {\n z = false;\n }\n hashMap.put(str2, Boolean.valueOf(z));\n }\n ((C15836lc) ane).mo39809a(\"openableURLs\", (Map<String, ?>) hashMap);\n }", "public void setLink(String link) {\r\n this.link = link;\r\n }", "public void setLink(String link)\n {\n this.link = link;\n }", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n if (callbackManager != null) callbackManager.setActivity(activity);\n }", "@Override\n public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {\n Uri deepLink = null;\n if (pendingDynamicLinkData != null) {\n deepLink = pendingDynamicLinkData.getLink();\n }\n //\n // If the user isn't signed in and the pending Dynamic Link is\n // an invitation, sign in the user anonymously, and record the\n // referrer's UID.\n //\n\n if (deepLink != null\n && deepLink.getBooleanQueryParameter(\"invitedby\", false)) {\n String referrerUid = deepLink.getQueryParameter(\"invitedby\");\n RNPruCommonModule.referrerUid = referrerUid;\n }\n\n if (deepLink != null\n && deepLink.getBooleanQueryParameter(\"campaign\", false)) {\n System.out.println(\"@@@@@@@@@@deeplink:campaign:\" + deepLink);\n String campaign = deepLink.getQueryParameter(\"campaign\");\n RNPruCommonModule.campaignId = campaign;\n }\n\n if (deepLink != null\n && deepLink.getBooleanQueryParameter(\"deepLinkID\", false)) {\n String deepLinkID = deepLink.getQueryParameter(\"deepLinkID\");\n RNPruCommonModule.deepLinkID = deepLinkID;\n }\n }", "public void createActivity(Activity activity) {\n\t\t\n\t}", "private void goThroughLinks() throws IOException {\n for (URL link :links) {\n pagesVisited++;\n Node node;\n if (link.toString().contains(\"?id=1\") && !books.contains(link)) {\n node = populateNode(link);\n depth = 2;\n books.add(node);\n } else if (link.toString().contains(\"?id=2\") && !movies.contains(link)) {\n node = populateNode(link);\n depth = 2;\n movies.add(node);\n } else if (link.toString().contains(\"?id=3\") && !music.contains(link)) {\n node = populateNode(link);\n depth = 2;\n music.add(node);\n }\n }\n }", "public LoadNetworkTask(RepositoryActivity activity) {\n attach(activity);\n }", "public void openLinkUrl(CampaignTrainingOutput selectedCampaignTrainingOutput) {\n\n //Opening to Link\n customTabsIntent.launchUrl(this, Uri.parse(selectedCampaignTrainingOutput.getLink()));\n }", "public void setActivity(Activity addnew) {\n\tthis.addActivity(addnew);\n\t\t\n\t}", "@Override\r\n public void onAttach(Activity activity) {\n super.onAttach(activity);\r\n\r\n }", "public Browser followRel(String rel);", "public void setLink(Unmarshaller linkTo)\r\n {\r\n _link = linkTo;\r\n }", "private void addLinkesToGraph()\n\t{\n\t\tString from,to;\n\t\tshort sourcePort,destPort;\n\t\tMap<Long, Set<Link>> mapswitch= linkDiscover.getSwitchLinks();\n\n\t\tfor(Long switchId:mapswitch.keySet())\n\t\t{\n\t\t\tfor(Link l: mapswitch.get(switchId))\n\t\t\t{\n\t\t\t\tfrom = Long.toString(l.getSrc());\n\t\t\t\tto = Long.toString(l.getDst());\n\t\t\t\tsourcePort = l.getSrcPort();\n\t\t\t\tdestPort = l.getDstPort();\n\t\t\t\tm_graph.addEdge(from, to, Capacity ,sourcePort,destPort);\n\t\t\t} \n\t\t}\n\t\tSystem.out.println(m_graph);\n\t}", "public void setLink(String link) {\r\n this.link = link;\r\n }", "public void onLoginActivityLinkClick(View view){\n //creates a new object of the Intent class\n Intent intentLogin = new Intent(RegistrationActivity.this, LoginActivity.class);\n startActivity(intentLogin); //starts the intent\n }", "public int getNumberOfNewerOnActivitiesOfConnections(Identity ownerIdentity, ExoSocialActivity baseActivity);", "public Item2Vector<ConceptActivity> getConceptActivities()\r\n\t{\r\n\t\treturn activity_links;\r\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tLog.e(\"debug\", \"url\");\n\t\t\t\tIntent i;\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\ti = new Intent(activity, InfoDetailActivity.class);\n\t\t\t\ti.putExtra(InfoDetailActivity.TITLE, \"企业文化\");\n\t\t\t\ti.putExtra(\n\t\t\t\t\t\tInfoDetailActivity.URL,\n\t\t\t\t\t\t\"http://cloud.yofoto.cn/index.php?gr=wapsite&mr=shwuczb&ar=showpageshtml&comid=12\");\n\t\t\t\ti.setAction(\"push\");\n\t\t\t\tbundle.putString(\"title\", \"企业文化\");\n\t\t\t\tbundle.putString(\n\t\t\t\t\t\t\"key\",\n\t\t\t\t\t\t\"http://cloud.yofoto.cn/index.php?gr=wapsite&mr=shwuczb&ar=showpageshtml&comid=12\");\n\t\t\t\tbundle.putString(\n\t\t\t\t\t\t\"url\",\n\t\t\t\t\t\t\"http://cloud.yofoto.cn/index.php?gr=wapsite&mr=shwuczb&ar=showpageshtml&comid=12\");\n\t\t\t\ti.putExtras(bundle);\n\n\t\t\t\tactivity.startActivity(i);\n\t\t\t}", "@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\n\t\tcontext = activity;\n\t}", "LINK createLINK();", "@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\t\tcontext = activity;\n\t}", "public static workflowexecution.proxies.LinkVisit initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject)\r\n\t{\r\n\t\treturn new workflowexecution.proxies.LinkVisit(context, mendixObject);\r\n\t}", "public void onClickAddLink(View v) {\n linkDefined = true;\n switch ((int) linkType.getSelectedItemId()) {\n case 0:\n linkTypeValue = \"link\";\n break;\n case 1:\n linkTypeValue = \"media\";\n break;\n default:\n break;\n }\n linkStringList += links.getText() + \"|\" + linkTypeValue + \";\";\n links.setText(\"\");\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\tIntent it = new Intent(getActivity(), DetailActivity.class);\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tbundle.putString(MangaInfoFrag.MANGA_LINK_STRING, getActivity()\n\t\t\t\t\t\t.getResources().getString(R.string.domain)\n\t\t\t\t\t\t+ results.get(position - 1).getLink());\n\t\t\t\tit.putExtras(bundle); \n\t\t\t\tstartActivity(it);\n\t\t\t\tToast.makeText(getActivity(),\n\t\t\t\t\t\tresults.get(position - 1).getLink(), Toast.LENGTH_SHORT)\n\t\t\t\t\t\t.show();\n\t\t\t}", "public List<ExoSocialActivity> getNewerOnActivitiesOfConnections(\n Identity ownerIdentity, ExoSocialActivity baseActivity, long limit);", "Link createLink();", "public Link add(Link link);", "private void addLinks(org.chromium.components.paint_preview.common.proto.PaintPreview.LinkDataProto value) {\n value.getClass();\n ensureLinksIsMutable();\n links_.add(value);\n }", "public void linkRoads() {\r\n\t\tfor (Road road : this.roads) {\r\n\t\t\tfor (Integer id : road.getLinkedIDs()) {\r\n\t\t\t\tfor (Road link : this.roads) {\r\n\t\t\t\t\tif (id == link.getID()) {\r\n\t\t\t\t\t\troad.linkRoad(link);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public String getLink();", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n this.context = activity;\n }", "public ConceptActivity addActivityLink(Activity _act, double _weight, \r\n\t\tint _direction)\r\n\t{\r\n\t\tConceptActivity ca = null;\r\n\t\tif(_act == null)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"[CBUM] Concept.addActivityLink ERROR! \" +\r\n\t\t\t\t\"Activity specified is NULL.\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tca = activity_links.findById(_act.getId());\r\n\t\tif(ca==null)\r\n\t\t{\r\n\t\t\tca = new ConceptActivity(_act.getId(), \r\n\t\t\t\t_act.getTitle(), this, _act, _weight, \r\n\t\t\t\t_direction/*, true*/);\r\n\t\t\tactivity_links.add(ca);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"[CBUM] Concept.addActivityLink ERROR! \" +\r\n\t\t\t\t\"ConceptActivity already Exists. C.Id:\" + this.getId() +\r\n\t\t\t\t\" A.Id:\" + _act.getId());\r\n\t\t\treturn null;\r\n\t\t}\r\n//\t\tswitch (_direction)\r\n//\t\t{\r\n//\t\t\tcase ConceptActivity.DIR_PREREQ: { prereq_w_sum += _weight;\t}\r\n//\t\t\tbreak;\r\n//\t\t\tcase ConceptActivity.DIR_OUTCOM: { outcome_w_sum += _weight; }\r\n//\t\t\tbreak;\r\n//\t\t}\r\n\t\treturn ca;\r\n\t}", "protected abstract Content getClassLink(LinkInfo linkInfo);", "private void transferLinks(LinkedHashMap_.Entry<K,V> src,\n LinkedHashMap_.Entry<K,V> dst) {\n LinkedHashMap_.Entry<K,V> b = dst.before = src.before;\n LinkedHashMap_.Entry<K,V> a = dst.after = src.after;\n if (b == null)\n head = dst;\n else\n b.after = dst;\n if (a == null)\n tail = dst;\n else\n a.before = dst;\n }", "private void createLinks(int numDevices) {\n List<Link> links = new ArrayList<>();\n\n for (int i = 1; i <= numDevices; i++) {\n ConnectPoint src = new ConnectPoint(\n getDeviceId(i),\n PortNumber.portNumber(2));\n ConnectPoint dst = new ConnectPoint(\n getDeviceId((i + 1 > numDevices) ? 1 : i + 1),\n PortNumber.portNumber(3));\n\n Link link = createMock(Link.class);\n expect(link.src()).andReturn(src).anyTimes();\n expect(link.dst()).andReturn(dst).anyTimes();\n replay(link);\n\n links.add(link);\n }\n\n expect(linkService.getLinks()).andReturn(links).anyTimes();\n replay(linkService);\n }", "public void setLink(String link) {\n this.link = link;\n }", "public void setLink(String link) {\n this.link = link;\n }", "public void setLink(String link) {\n this.link = link;\n }", "@Override\r\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\r\n\t}", "void openLink(Link target);", "SetupTask(KaldiActivity activity) {\n this.activityReference = new WeakReference<>(activity);\n }", "private void openActivity() {\n }", "public int getNumberOfNewerOnActivityFeed(Identity ownerIdentity, ExoSocialActivity baseActivity);", "protected void _initLinks() {\n\t\tleaseTaskStartsLink = null;\n\t\tleaseRulesLink = null;\n\t}", "protected void attachFlow(RouteResult result) {\r\n\t\tassert result.isSuccessful();\r\n\t\tFlow flow = result.getFlow();\r\n\t\tList<Link> links = result.getFlow().getLinks();\r\n\t\tfor (Link l : links) {\r\n\t\t\tl.attachFlow(flow);\r\n\t\t}\r\n\t}", "@Override\r\n public void onAttach(Activity activity) {\n super.onAttach(activity);\r\n act = (BaseActivity) activity;\r\n\r\n }", "private static void redirectActivity(Activity activity, Class aClass) {\n Intent intent = new Intent(activity, aClass);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n activity.startActivity(intent);\n }", "public interface LinkClickHandler { void onLinkClicked(GURL url); }", "private static GameDto addLinks(GameDto gameDto) {\n addSelfLink(gameDto);\n addGameJoinLink(gameDto);\n addPitMoveLink(gameDto);\n return gameDto;\n }", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n }", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n }", "public void addAllOnVisibleLinks() {\n // Check for a valid render context and create the new set\n RTGraphComponent.RenderContext myrc = (RTGraphComponent.RenderContext) getRTComponent().rc; if (myrc == null) return;\n Set<Bundle> set = new HashSet<Bundle>();\n // Go through visible links and find the related bundles\n Iterator<String> it = myrc.graphedgeref_to_link.keySet().iterator();\n while (it.hasNext()) {\n String graphedgeref = it.next();\n Iterator<Bundle> itb = digraph.linkRefIterator(graphedgeref);\n while (itb.hasNext()) set.add(itb.next());\n }\n // Add the no mapping set and push it to the RTParent\n set.addAll(getRTComponent().getNoMappingSet()); getRTParent().push(getRTParent().getRootBundles().subset(set));\n }", "@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\t}", "@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\t}", "@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\t}", "@Override\n\t\t\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t\t\tIntent i = new Intent(Intent.ACTION_VIEW, Uri\n\t\t\t\t\t\t\t\t\t\t.parse(fullsitelink));\n\t\t\t\t\t\t\t\tstartActivity(i);\n\n\t\t\t\t\t\t\t}", "MGLifecycleActivityConfig(AppCompatActivity activity) {\n this.activity = activity;\n }", "private void execURL(String link) {\n Uri webLink = Uri.parse(link);\n Intent openLink = new Intent(Intent.ACTION_VIEW, webLink);\n PackageManager pm = getPackageManager();\n List<ResolveInfo> handlers = pm.queryIntentActivities(openLink, 0);\n if (handlers.size() > 0)\n startActivity(openLink);\n }", "public void setLinkid(java.lang.String param){\r\n \r\n if (param != null){\r\n //update the setting tracker\r\n localLinkidTracker = true;\r\n } else {\r\n localLinkidTracker = false;\r\n \r\n }\r\n \r\n this.localLinkid=param;\r\n \r\n\r\n }", "@Override\n public void onClick(View view) {\n Intent detail = new Intent(getBaseContext(), DetailArticle.class);\n detail.putExtra(\"webURL\", webHotURL);\n startActivity(detail);\n }" ]
[ "0.72185796", "0.7126579", "0.6626288", "0.65022343", "0.6062156", "0.59453773", "0.5880377", "0.57237476", "0.57166815", "0.5701771", "0.55898273", "0.55171055", "0.5362321", "0.5286225", "0.52378446", "0.52260053", "0.51831055", "0.5182679", "0.51498914", "0.5131103", "0.51263416", "0.51224905", "0.5087216", "0.5082758", "0.5074002", "0.5073266", "0.5070521", "0.506195", "0.5059345", "0.5048728", "0.5035419", "0.50138766", "0.5004498", "0.4996216", "0.49906123", "0.49719614", "0.49666673", "0.49481642", "0.4945521", "0.49394304", "0.49314028", "0.49224895", "0.4911204", "0.49049756", "0.49023426", "0.4894772", "0.48930117", "0.4887774", "0.48838493", "0.4879339", "0.487104", "0.48555654", "0.48549503", "0.48529157", "0.4850083", "0.48480043", "0.48448688", "0.48392254", "0.48378375", "0.4832413", "0.4831297", "0.48305714", "0.48294201", "0.4826588", "0.4823662", "0.48208436", "0.4817238", "0.48150486", "0.48110995", "0.48089802", "0.48045224", "0.4800194", "0.47985232", "0.47931018", "0.47915313", "0.4790025", "0.47891128", "0.47891128", "0.47891128", "0.47883213", "0.47866508", "0.47855142", "0.4779266", "0.47781956", "0.47758564", "0.4774008", "0.47656843", "0.47643536", "0.4763139", "0.47584045", "0.4756621", "0.4756621", "0.4750246", "0.4748849", "0.4748849", "0.4748849", "0.47472996", "0.47459686", "0.4729097", "0.471963", "0.471203" ]
0.0
-1
end main Takes the input count and generates that number of random double precision floating point numbers. Counts how many times the first decimal place occurs in the sequence. Prints out each digit and the number of times it occurred in ascending order of the number of times it occurred.
public static void printEachInstance(int count) { List<RandGeneratedValue> list = new ArrayList<RandGeneratedValue>(); for(int i = 0; i < count; i++) { Double rand = Math.random(); RandGeneratedValue rdv = new RandGeneratedValue(); //Store the randomly generated value rdv.setRandValue(rand); //Determine the first decimal place value int firstDecimal = (int) (rand * 10); rdv.setFirstDecimal(firstDecimal); //Determine the number of instances of the first decimal place value String regexString = "[^"+ rdv.getFirstDecimal() + "]*"; String randStr = rdv.getRandValue().toString(); int instancesOfFirstDecimal = randStr.replaceAll(regexString, "").length(); rdv.setDigitCount(instancesOfFirstDecimal); list.add(rdv); } //Sort the list in ascending order of number of instances Collections.sort(list, new Comparator<RandGeneratedValue>() { @Override public int compare(RandGeneratedValue p1, RandGeneratedValue p2) { return p1.getDigitCount() - p2.getDigitCount(); // Ascending } }); //Output the list for (int j = 0; j < list.size(); j++) { //System.out.println("Random value generated = " + list.get(j).getRandValue()); System.out.println("First decimal = " + list.get(j).getFirstDecimal()); System.out.println("Number of instances of first decimal = " + list.get(j).getDigitCount()); System.out.println("=-=-=-=-=-=-=-=-=-=-="); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String args[])\n {\n Scanner sc=new Scanner(System.in);\n String s=sc.next();\n double n=0;\n int dcount=0;\n int pointer=0;\n for(int i=0;i<s.length();i++)\n {\n if(s.charAt(i)!='.')\n {\n n=n*10+(s.charAt(i)-'0');\n if(pointer==1)\n dcount++;\n }\n else\n pointer=1;\n }\n n=n/Math.pow(10,dcount);\n System.out.printf(\"%.6f\",n);\n }", "public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\r\n\t\t\tSystem.out.println(\"Enter the numbers \");\r\n\t\t\tint[] counts=new int[10];\r\n\t\t\tint num;\r\n\t\t\tfor(int i=0;i<10;i++) {\r\n\t\t\t\tcounts[(int)(Math.random()*10)]++;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Count for each number 0 and 9\");\r\n\t\t\tfor(int i=0;i<counts.length;i++) {\r\n\t\t\t\tSystem.out.println(i+ \"s: \"+counts[i]);\r\n\t\t\t}\r\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\tScanner in = new Scanner(System.in);\r\n int n = in.nextInt();\r\n int arr[] = new int[n];\r\n for(int arr_i=0; arr_i < n; arr_i++){\r\n arr[arr_i] = in.nextInt();\r\n }\r\n \r\n //判断正负数\r\n float counter_p=0,counter_n=0,counter_z=0;\r\n for(int i:arr)\r\n {\r\n \tif(i==0){\r\n \t\t//System.out.println(i+\" z+1\");\r\n \t\tcounter_z++;\r\n \t}\r\n \t\t\r\n \telse if(i>0){\r\n \t\t//System.out.println(i+\" p+1\");\r\n\r\n \t\tcounter_p++;\r\n \t}\r\n \telse {\r\n \t\t//System.out.println(i+\" p+1\");\r\n \t\tcounter_n++;\r\n \t}\r\n\t\t\t\t\r\n }\r\n \r\n float result_p = counter_p/n;\r\n float result_n = counter_n/n;\r\n float result_z = counter_z/n;\r\n \r\n // System.out.println(counter_p+\" \"+counter_n+\" \"+counter_z);\r\n \r\n DecimalFormat df = new DecimalFormat(\"0.000000\");\r\n //第一行 正数 第二行负数 第三行0\r\n System.out.println(df.format(result_p));\r\n System.out.println(df.format(result_n));\r\n System.out.println(df.format(result_z));\r\n\r\n\t}", "public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nint num=sc.nextInt();\r\nint count=0;\r\nwhile(num!=0)\r\n{\r\n\tint n1=num%10;\r\n\tcount++;\r\n\tnum/=10;\r\n}\r\nSystem.out.println(count);\r\n\t}", "public static void main(String[] args) {\n\t\tfloat f1 = 5.4f;\r\n\t\tfloat f2 = 5.5f;\r\n\t\tSystem.out.println(Math.round(f1));\r\n\t\tSystem.out.println(Math.round(f2));\r\n\t\tSystem.out.println(Math.random());\r\n\t\tSystem.out.println( (int)(Math.random()*10));\r\n\t\tSystem.out.println(Math.sqrt(64));\r\n\t\tSystem.out.println(Math.pow(2, 10));\r\n\t\tSystem.out.println(Math.PI);\r\n\t\tSystem.out.println(Math.E);\r\n\t\tint n = Integer.MAX_VALUE;\r\n\t\tSystem.out.println( Math.pow((1+1d/n), n));// 1f 不行\r\n\t\tint count = 0;\r\n\t\tfor(int i = 2; i <= 100; i++) {\r\n\t\t\tboolean prime = false;\r\n\t\t\tint c =0;\r\n\t\t\tfor(int j = i; j>=1; j--) {\r\n\t\t\t\tif((i%j) == 0)\r\n\t\t\t\t\tc ++;\r\n\t\t\t\tif (c > 2 )\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif (j == 1) {\r\n\t\t\t\t\tprime = true;\r\n\t\t\t\t\tSystem.out.println(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (prime == true )\r\n\t\t\t\tcount++;\r\n\t\t\telse\r\n\t\t\t\tcontinue;\r\n\t\t}\r\n\t\tSystem.out.println(\"prime count is : \"+ count);\r\n\t\t\r\n\t\tcountPrime(100);\r\n\t}", "public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tint N = scanner.nextInt();\n\t\tint[] arr = new int[N];\n\t\tint first = 0;\n\t\tint sec = 0;\n\t\tint thr = 0;\n\t\tdouble re = 0.0;\n\t\t\n\t\tString formate = \"\";\n\t\tString temp = \"0.\";\n\t\t\n\t\tfor(int i = 0;i< N;i++)\n\t\t\ttemp+=\"0\";\n\t\t\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tarr[i] = scanner.nextInt();\n\t\t\tif(arr[i] == 0)\n\t\t\t\tthr ++;\n\t\t\telse if(arr[i]>0)\n\t\t\t\tsec++;\n\t\t\telse\n\t\t\t\tfirst++;\n\t\t}\n\t\tDecimalFormat df=new DecimalFormat(temp);\n\t \n\t\tre = (double)sec/N;\n\t\tformate = df.format(re);\n\t\tSystem.out.println(formate);\n\t\tre = (double)first/N;\n\t\tformate = df.format(re);\n\t\tSystem.out.println(formate);\n\t\tre = (double)thr/N;\n\t\tformate = df.format(re);\n\t\tSystem.out.println(formate);\n\t}", "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}", "public static void main(String[] args)\n\t{\n\t\tdouble incrementee = Math.pow(2, 53) - 100000.0;;\n\n\t\t// Stop counting when we lose resolution of 1.0\n\t\twhile((incrementee + 1.0) - incrementee > 0.999999999) {\n\t\t\tincrementee += 1.0;\n\t\t}\n\n\t\tSystem.out.printf(\"%f\\n\", incrementee);\n\t}", "public static void main(String[] args) {\n\t\tint arr[] = {1,5,3,1,2,5,7};\r\n\t\t//all elements are in range 1 to N (7 here)\r\n\t\t//find frequency of each element in O(N) and space complexity 1.\r\n\t\tfor(int i = 0; i < arr.length; i++) {\r\n\t\t\t//add any random number (say 10, greater than length)\r\n\t\t\t//to index 1 less than arr[i]\r\n\t\t\t//%10 to prevent overflow in case value comes out to be greater than allowed length\r\n\t\t\tarr[arr[i]%10 - 1] += 10;\r\n\t\t}\r\n\t\tfor(int i = 0; i < arr.length; i++) {\r\n\t\t\tSystem.out.println(\"Frequency of \" +(i+1) +\" is \"+ (arr[i]/10));\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tint count = 0;\n\t\tfor (int i = 100;i <= 999;i++) {\n\t\t\tint a = i % 10;\n\t\t\tint b = i / 10 % 10;\n\t\t\tint c = i / 10 / 10 % 10;\n\t\t\tif (i == a*a*a + b*b*b + c*c*c) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(count);\n\t}", "public void daffodilNum(int digit) {\n int count = 0;\n for (int i = (int) Math.pow(10, digit-1); i < (int) Math.pow(10, digit); i++) {\n int sum = 0;\n for (int index = 0; index < digit; index++) {\n int curDigit = (i / ((index == 0) ? 1 : ((int) Math.pow(10, index)))) % 10;\n sum += Math.pow(curDigit, 3);\n }\n if (sum == i) {\n System.out.print(i);\n System.out.print(' ');\n count++;\n if (count == 2) {\n System.out.println();\n count = 0;\n }\n }\n }\n }", "public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint len=in.nextInt();\n\t\tint a1=0;\n\t\tint a2=0;\n\t\tint a3=0;\n\t\tdouble a4=0;\n\t\tint a5=0;\n\t\tint count=0;\n\t\tint count2=0;\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\tint num=in.nextInt();\n\t\t\tint ca=num%5;\n\t\t\tswitch (ca) {\n\t\t\tcase 0:\n\t\t\t\tif (num%2==0) a1+=num;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tif (count%2==0) a2+=num;\n\t\t\t\telse a2-=num;\n\t\t\t\tcount++;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\ta3++;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tcount2++;\n\t\t\t\ta4+=num;\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tif(num>a5) a5=num;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tin.close();\n\t\tSystem.out.print(a1==0?\"N\":a1);\n\t\tSystem.out.print(\" \"+String.valueOf(count==0?\"N\":a2));\n\t\tSystem.out.print(\" \"+String.valueOf(a3==0?\"N\":a3));\n\t\tSystem.out.print(\" \");\n\t\tSystem.out.print(a4==0?\"N\":String.format(\"%.1f\", a4/count2));\n\t\tSystem.out.print(\" \"+String.valueOf(a5==0?\"N\":a5));\n\t}", "public static void main (String [] args) throws IOException {\n\t\tScanner s = new Scanner(new FileReader(\"fact4.in\"));\n\t\tPrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"fact4.out\")));\n\t\tint n = s.nextInt();\n\t\tint numzeroes = n/5 + n/25 + n/125 + n/625 + n/3125;\n\t\tint result = 1;\n\t\tint counter1 =0;\n\t\twhile(n>0){\n\t\t\tif(n%5 ==0){\n\t\t\t\tint temp = n;\n\t\t\t\twhile(temp%5 ==0){\n\t\t\t\t\ttemp /=5;\n\t\t\t\t}\n\t\t\t\tresult = (result*temp)%10;\n\t\t\t}\n\t\t\telse if(n%2==0 && counter1 < numzeroes){\n\t\t\t\tresult = (result*(n/2))%10;\n\t\t\t\tcounter1++;\n\t\t\t}else{\n\t\t\t\tresult = (result*n)%10;\n\t\t\t}\n\t\t\tn--;\n\t\t}\n\t\tout.println(result);\n\t\tout.close(); \n\t}", "int main()\n{\n long int a;\n cin>>a;\n int count=0;\n int flag=0;\n if(a>=0){\n while(a>0)\n {\n if(a%10!=0)\n {\n flag=1;\n }\n a=a/10;\n count=count+1;\n }}\n else if(a<0)\n {\n while(a<0)\n {\n a=a/10;\n count=count+1;\n }\n }\n if(flag==0)\n {\n count++;\n }\n cout<<count;return 0;\n}", "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 static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n \n int t = in.nextInt();\n \n int count = 1;\n \n while(count<=t)\n {\n long n = in.nextLong();\n \n long backupN = n;\n \n int zeroes = (n+\"\").length()-1;\n \n // StringBuilder sb = new StringBuilder(\"1\");\n \n // for(int i = 0;i<zeroes;i++)\n // {\n // sb.append(\"0\");\n // }\n \n // System.out.println(sb.toString());\n \n long divisor = (long)Math.pow(10,zeroes);\n //Integer.parseInt(sb.toString());\n \n \n // System.out.println(\"divisor = \"+divisor);\n \n int counter = 0;\n while(n>0)\n {\n // System.out.println(\"value of n = \"+n);\n // System.out.println(\"value of divisor = \"+divisor);\n long q = n/divisor;\n \n if(q != 0 && backupN%q == 0)\n {\n \n counter++;\n }\n n = n%divisor;\n divisor = divisor/10;\n } \n \n System.out.println(counter);\n count++;\n }\n }", "public static void main(String[] args) {\n\t\t\n\t\tScanner scan=new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter a value \");\n\t\t\tint n=scan.nextInt();\n\t\tint count =0;\n\t\t\n\t\twhile(n!=0)\n\t\t{\n\t\t\tn=n/10;\n\t\t\t++count;\n\t\t}\n\t\tSystem.out.println(\"the value \"+ n +\" is \"+ count + \" digit no\");\n\n\t}", "private static void test1() {\n\n\tint n=10000;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint val=rand7();\n\t\t\tcount[val]++;\n\t\t}\n\t\t\n\t\tfor(int i:count)\n\t\t\tSystem.out.println(i);\n\t}", "static int count(int n)\r\n\t\t{\r\n\t\t\tint c = 0; //initially count of digits is 0\r\n\t\t\twhile(n != 0)\r\n\t\t\t{\r\n\t\t\t\tc++;\r\n\t\t\t\tn = n/10;\r\n\t\t\t}\r\n\t\t\treturn c;\r\n\t\t}", "public static void main(String[] args) {\n\t\tdouble random_num1 = Math.random()*10;\n\t\tdouble random_num2 = Math.random()*9+1;\n\t\tdouble random_num3 = Math.random()*(35-20+1)+20;\n\t\tdouble random_num4 = Math.random()*2;\n\t\tdouble some = (int)(Math.random()*10+1) ;\n\t\t\n\t\tSystem.out.println(\"0~9 까지의 랜덤 수 : \"+(int)random_num1);\n\t\tSystem.out.println(\"1~10 까지의 랜덤 수 : \"+(int)random_num2);\n\t\tSystem.out.println(\"20~35 까지의 랜덤 수 : \"+(int)random_num3);\n\t\tSystem.out.println(\"0 또는 1 : \"+(int)random_num4);\n\t\tSystem.out.println(some);\n\t\t\n\t}", "public static void main(String[] args) throws ParseException, CloneNotSupportedException, IOException\n\t{\n\t\t\n\t\tint N = 5;\n\t\tint k = 3;\n\t\tint [] numbers = {6,1,2,3,7};\n\t\tList<Integer> oneCounts = new ArrayList<Integer>(N);\n\t\tfor(int i =0 ; i<N ;i++){\n\t\t\t\n\t\t\toneCounts.add(i, countOne(numbers[i])); \n\t\t}\n\t\tCollections.sort(oneCounts,new Comparator<Integer>(){\n\n\t\t\t@Override\n\t\t\tpublic int compare(Integer o1, Integer o2)\n\t\t\t{\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn (o2-o1);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t} );\n\t\tint result =0;\n\t\tfor(int j =0 ;j < k ;j++){\n\t\t\t\n\t\t\tresult = result + oneCounts.get(j);\n\t\t}\n\t\t\n \n\t\tSystem.out.println(result);\n\t\tSystem.out.println(1^9);\n\t}", "public static void main(String[] args) {\n\t\tint N = 234;\n\t\tint times=N%10;\n\t\tN/=10;\n\t\tint temp=N/10,sum=0;\n\t\twhile(times>0)\n\t\t{\n\t\t\tint rem=N%10;\n\t\t\tsum=temp+rem;\n\t\t\ttemp=sum;\n\t\t\ttimes--;\n\t\t}\n\t\tSystem.out.println(temp);\n\t\n\t}", "public static void main(String[] args) {\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tint n = scan.nextInt();\r\n\t\tint[] nums = new int[n];\r\n\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\tnums[i] = scan.nextInt();\r\n\t\t}\r\n\r\n\t\tint pCount = 0, nCount = 0, zCount = 0;\r\n\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\tif (nums[i] > 0)\r\n\t\t\t\tpCount++;\r\n\t\t\telse if (nums[i] < 0)\r\n\t\t\t\tnCount++;\r\n\t\t\telse\r\n\t\t\t\tzCount++;\r\n\t\t}\r\n\r\n\t\tSystem.out.printf(\"%.6f \\n%.6f \\n%.6f\", pCount / (double) n, nCount / (double) n, zCount / (double) n);\r\n\r\n\t\tscan.close();\r\n\t}", "public static void main(String[] args) {\n\t final float N=3;\n\t int totalFlips = 0;\n\n\t for(int i=0; i<N; i++){\n\t String sequenceSoFar = \"\"; // empty string list\n\t sequenceSoFar += coinFlip(); // append to string\n\t sequenceSoFar += coinFlip();\n\t sequenceSoFar += coinFlip();\n\t int count = 3;\n\t totalFlips += 3; // add initial 3 flips to total.\n\t // if the first three aren't the sequence, then keep going until the sequence is met in the while loop\n\t if(!sequenceSoFar.equals(\"121\")) {\n\t while(!(sequenceSoFar.substring(sequenceSoFar.length() - 3).equals(\"121\"))) {\n\t sequenceSoFar += coinFlip();\n\t count++;\n\t totalFlips++;\n\t }\n\t }\n\t // to check my work with small numbers\n\t System.out.println(sequenceSoFar);\n\t System.out.println(count);\n\t }\n\t System.out.println(\"Sequence for HTH: \");\n\t System.out.println(\"Total Flips: \" + N);\n\t System.out.println(\"Total flips sum: \" + totalFlips);\n\t double average = (totalFlips * 1.0) /(double) N;\n\t System.out.println(\"Average flips: \" + average);\n\t}", "int main()\n{\n int n,count=0;\n float score=0.0;\n while(1)\n {\n cin>>n;\n if(n<0)\n {\n score-=1;\n break;\n }\n if(n%2==0)\n score-=0.5;\n else if(n%2==1)\n {\n count++;\n score+=1;\n if(count==3)\n break;\n }\n }\n\tprintf(\"%.1f\",score);\n}", "public static void main(String[] args) {\n\t\r\n\t\t for(int i=100;i<=999;i++){\r\n\t\t int number = i;\r\n\t\t int temp = number;\r\n\t\t int c=0,a;\r\n\t\t while(number>0){\r\n\t\t a = number%10;\r\n\t\t number = number/10;\r\n\t\t c = c +(a*a*a);\r\n\t\t }\r\n\t\t if (temp==c){\r\n\t\t System.out.println(temp);\r\n\t\t }\r\n\t\t }\r\n\t\t \r\n\t\t\r\n\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}", "public static void main(String[] Args){\n Scanner n = new Scanner(System.in);\n int N = n.nextInt();\n int j = 1;\n int count = 1;\n while (j <= N){\n if ((3*count + 2) % 4 == 0){\n count++;\n }\n else {\n System.out.print(3*count + 2);\n System.out.print(\" \");\n j++;\n count++;\n }\n }\n }", "int countConsecutive(long num) \r\n {\n int count = 0; \r\n for (int L = 1; L * (L + 1) < 2* num; L++) \r\n { \r\n \tfloat a = (float) ((1.0 * num-(L * (L + 1)) / 2) / (L + 1));\r\n if (a-(int)a == 0.0) \r\n count++; \r\n } \r\n return count; \r\n }", "public static void main(String[] args) {\n for(int i=0;i<10;i++){\n double d = Math.random()*100+100;\n System.out.println(Math.floor(d));\n }\n }", "public static void main(String[] args) {\n Scanner scanner = new Scanner (System.in);\n int n = scanner.nextInt();\n int[] counts = new int[100];\n for ( int i = 0; i < 100; ++i )\n counts[i] = 0;\n for ( int i = 0; i < n; ++i ) {\n int x = scanner.nextInt();\n ++counts[x];\n }\n scanner.close();\n for ( int i = 0; i < 100; ++i ) System.out.print( counts[i] + \" \" );\n System.out.println();\n }", "public static void main(String[] args) {\n int m, n;\n Scanner scan = new Scanner(System.in);\n m = scan.nextInt();\n n = scan.nextInt();\n int count = 0;\n if ((m>=0 && n>=0) || n>=0) {\n for (int i = m; i <= n; i++) {\n if(i>=0){\n int tmp=(int)Math.sqrt(i);\n if(tmp*tmp==i){\n System.out.printf(\"%5d\",i);\n count++;\n if(count%10==0){\n System.out.println();\n }\n }\n }\n }\n System.out.println();\n System.out.printf(\"Tong so chinh phuong doan MN: \" + count);\n } else {\n System.out.println(\"fails\");\n }\n\n }", "int main()\n{\n int a,count=0;\n cin>>a;\n cout<<a<<\"\\n\";\n while(a!=1)\n {\n if(a%2==0)\n {\n a=a/2;\n }\n else\n {\n a=3*a+1;\n }\n count++;\n cout<<a<<\"\\n\";\n }\n cout<<count;\n return 0;\n}", "public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\tint count=1;\n\t\tint n=1;\n\t\twhile(count!=a+1)\n\t\t{\n\t\t if((3*n+2)%4!=0)\n\t\t {\n\t\t System.out.print((3*n+2)+\" \");\n\t\t count+=1;\n\t\t \n\t\t }\n\t\t n+=1;\n\t\t}\n}", "public static void main(String args[]) {\n int a = 0;\r\n int b = 0;\r\n int u = 0;\r\n\r\n //Declaring scanner object\r\n Scanner capture = new Scanner(System.in);\r\n System.out.println(\"How many input values [MAX: 30]?\");\r\n\r\n //Taking input\r\n int x = capture.nextInt();\r\n ArrayList<Integer> Digits = new ArrayList<>();\r\n System.out.println(\"Enter \" + x + \" numbers.\");\r\n\r\n //Declaring and initializing HashMap object\r\n HashMap<Integer, Integer> Occur = new HashMap<>();\r\n\r\n // Initialize Hashmap\r\n for(int i=0;i<10;i++){\r\n Occur.put(i,0);\r\n }\r\n\r\n\r\n\r\n\r\n int tmp = x;\r\n // Initialize ArrayList\r\n while(tmp>0){\r\n Digits.add(capture.nextInt());\r\n tmp--;\r\n }\r\n\r\n\r\n\r\n // ----------------------------\r\n while (b < x) {\r\n if (Occur.get(Digits.get(b)) != null) {\r\n int cnt = Occur.get(Digits.get(b)) + 1;\r\n Occur.put(Digits.get(b), cnt);\r\n }\r\n else {\r\n Occur.put(Digits.get(b), 1);\r\n }\r\n b++;\r\n }\r\n\r\n int height = 0;\r\n System.out.println(\"\\nNumber Occurrence\");\r\n\r\n height = 0;\r\n for(Map.Entry<Integer,Integer> entry : Occur.entrySet()){\r\n if(entry.getValue()>0){\r\n System.out.println(entry.getKey() + \" \" + entry.getValue());\r\n }\r\n if(entry.getValue()>height){\r\n height = entry.getValue();\r\n }\r\n }\r\n\r\n System.out.println(\"================= Vertical bar =================\");\r\n\r\n //Printing histogram\r\n int h = height;\r\n while ( h > 0) {\r\n\r\n System.out.print(\"| \"+h+\" | \");\r\n\r\n int g = 0;\r\n while (g < 10) {\r\n if(Occur.get(g) != null) {\r\n int kallen = Occur.get(g);\r\n if(kallen >= h)\r\n {\r\n System.out.print(\"* \");\r\n }\r\n else\r\n {\r\n System.out.print(\" \");\r\n }\r\n }\r\n else\r\n {\r\n System.out.print(\" \");\r\n }\r\n g++;\r\n }\r\n System.out.print(\"\\n\");\r\n h--;\r\n }\r\n System.out.println(\"================================================\");\r\n System.out.print(\"| N |\");\r\n while ( u < 10 ) {\r\n System.out.print(\" \"+ u );\r\n u++;\r\n }\r\n System.out.println(\"\\n================================================\");\r\n }", "public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tSystem.out.println(\"Enter the number of times of toss\");\n\t\tint no;\n\t\tno=sc.nextInt();\n\t\tint tail = 0,head=0;\n\t\tdouble result;\n\t\tfor(int i=0;i<no;i++) {\n\t\t\tresult=Math.random();\n\t\t\tif(result<0.5)\n\t\t\t{\n\t\t\t\ttail++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\thead++;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"percentage of tail is :\"+((tail*100)/no));\n\t\tSystem.out.println(\"percentage of head is :\"+((head*100)/no));\t\t\n\n\t}", "public static int Main()\n\t{\n\t\tint[] num = new int[16];\n\t\tint i;\n\t\tint k;\n\t\tint j;\n\t\tint count;\n\t\tfor (;;) //????\n\t\t{\n\t\t\ti = -1; //?????i?count\n\t\t\tcount = 0;\n\t\t\tdo\n\t\t\t{\n\t\t\t\ti++;\n\t\t\t\tnum[i] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t\t\tif (num[0] == -1) //?????????-1???\n\t\t\t\t{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t} while (num[i] != 0); //????0??\n\t\t\tfor (j = 0 ; j <= i - 1 ; j++)\n\t\t\t{\n\t\t\t\tfor (k = j ; k <= i - 1 ; k++)\n\t\t\t\t{\n\t\t\t\t\tif ((num[j] == 2 * num[k]) || (num[j] * 2 == num[k])) //????\n\t\t\t\t\t{\n\t\t\t\t\t\tcount++; //??\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.print(count);\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t}", "static void increment() {\r\n\t\tfor (double i =2.4; i<=8.8; i=i+0.2) { \r\n\t\t\tSystem.out.format(\"%.1f %n \",i); //%.1f: to 1 decimal place. %n: print on a new line\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tint head=0,tail=0,counter=0;\r\n\t\tScanner sc=new Scanner(System.in);\r\n\t\tSystem.out.println(\"How many times You Want Flip Coin??\");\r\n\t\tint n=sc.nextInt();\r\n\t\t/*if(n>0) {\r\n\t\t\tfor(int i=0;i<n;i++) {\r\n\t\t\t\tif(Math.random() < 0.5) {\r\n\t\t\t\t\ttail+=1;\r\n\t\t\t\t}. \r\n\t\t\t\telse {\r\n\t\t\t\t\thead+=1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(head);\r\n\t\t\tSystem.out.println(tail);\r\n\t\t\tSystem.out.println(\"Percentage of Head \"+(double)head/n*100);\r\n\t\t\tSystem.out.println(\"Percentage of Tail \"+(double)tail/n*100);\r\n\t\t}*/\r\n\t\tif(n>0) \r\n\t\t{\r\n\t\t\twhile(counter < n) \r\n\t\t\t{\r\n\t\t\t\tif(Math.random() < 0.5) {\r\n\t\t\t\t\ttail+=1;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\thead+=1;\r\n\t\t\t\t}\r\n\t\t\tcounter++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(head);\r\n\t\t\tSystem.out.println(tail);\r\n\t\t\tSystem.out.println(\"Percentage of Head \"+(double)head/n*100);\r\n\t\t\tSystem.out.println(\"Percentage of Tail \"+(double)tail/n*100);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\nScanner Sc= new Scanner(System.in);\nSystem.out.printf(\"Nhap vao so N = \");\nint N = Sc.nextInt();\nint S=0,i;\nfor (i=1;i<=N;i++)\n S=S+(10*i+i);\nSystem.out.printf(\"\\n%d\",S);\n\n\t}", "public static void main(String[] args) {\n \t\n \tScanner scanner = new Scanner(System.in);\n \tint n = scanner.nextInt();\n \tint positiveCount = 0;\n \tint negativeCount = 0;\n \tint zeroCount = 0;\n \tfor (int i = 0; i < n; i++) {\n \t\tint num = scanner.nextInt();\n \t\tif(num == 0){\n \t\t\tzeroCount++;\n \t\t}\n \t\telse if(num > 0){\n \t\t\tpositiveCount++;\n \t\t}\n \t\telse if(num < 0){\n \t\t\tnegativeCount++;\n \t\t}\n\t\t}\n \tDecimalFormat df = new DecimalFormat(\"#.#####\");\n \tSystem.out.println(df.format((double)positiveCount / n));\n \tSystem.out.println(df.format((double)negativeCount / n));\n \tSystem.out.println(df.format((double)zeroCount / n));\n }", "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 }", "public static void main(String[] args) {\n int num;\n Random rd = new Random();\n num = 1+rd.nextInt(Integer.MAX_VALUE);\n System.out.println(\"原来的数为\"+num);\n while(num!=1) {\n \tSystem.out.println(\"产生的新数是\"+num);\n \tif(num%2==0) {\n \t\tnum = num/2;\n \t}else {\n \t\tnum=num*3+1;\n \t}\n }\n System.out.println(num);\n\t}", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint N= scan.nextInt(); // 숫자 입력 받음 \n\t\t int count = 0;\n\t\t \tint check = 0;\n\t\t\tint j ;\n\t\tfor(int i = 1 ; i <= N; i++) {\n\t\t\tString number = String.valueOf(i);\n\t\t\tif(number.length() < 3) count++;\n\t\t\telse {\n\t\t\t\tint []value = new int[number.length()];\n\t\t\t\tint a = i;\n\t\t\t\tfor(j = 0 ; j < value.length ; j++) {\n\t\t\t\t\tvalue[j] = a % 10;\n\t\t\t\t\ta /= 10;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor(j = 0 ; j < value.length-1; j++) {\n\t\t\t\t\t\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tcheck = value[j+1] - value[j];\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tint sub = value[j+1] - value[j];\n\t\t\t\t\tif(check != sub) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(j == value.length-1) {\n\t\t\t\t\tcount ++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(count);\n\t}", "public static void main(String[] args) {\r\n\r\n\t\tint n=439;\r\n\r\n\t\tint count = 1;\r\n\t\tint binary[] = new int[32];\r\n\t\tint i = 0;\r\n\t\twhile (n > 0) {\r\n\t\t\tbinary[i] = n % 2;\r\n\t\t\tn = n / 2;\r\n\t\t\ti++;\r\n\t\t}\r\n\r\n\t\tfor (int j = i - 1; j >= 0; j--) {\r\n\r\n\t\t\tString str = String.valueOf(i);\r\n\t\t\t\r\n\t\tString ar[]=str.split(\"0\");\r\n\t\t\t\r\n\t\tif(ar.length>1)\r\n\t\t{\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\t/*\t\r\n\t\t\tif (binary[j] == 1 && binary[j + 1] == 1) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.print(binary[j]);\r\n*/\r\n\t\t}\r\n\t\tSystem.out.print(count);\r\n\t\t/*scanner.close();*/\r\n\t}", "public static void main(String[] args) {\n\t\tint d;\n\t\tint index = -1;\n\t\tint count=0;\n\t\tint max=1;\n List <Integer>list=new ArrayList<Integer>();\n Scanner input = new Scanner(System.in);\n d=input.nextInt();\n while(d!=0)\n {\n \tlist.add(d);\n \td=input.nextInt();\n }\n System.out.println(list.get(index)+\"出现了\"+max+\"次\");\n //System.out.println(index);\n //求其他出现最多次数的字符。\n \n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tfor(int tc=1;tc<=10;tc++) {\r\n\t\t\tint N=sc.nextInt();\r\n\t\t\tLinkedList<Integer> list = new LinkedList<>();\r\n\t\t\tString a = sc.next();\r\n\t\t\tfor(int i=0;i<N;i++) {\r\n\t\t\t\tint d = a.charAt(i)-'0';\r\n\t\t\t\tlist.add(d);\r\n\t\t\t}\r\n\t\t\tfor(int i=0;i<N-1;i++) {\r\n\t\t\t\tif(list.get(i) == list.get(i+1)) {\r\n\t\t\t\t\tlist.remove(i);\r\n\t\t\t\t\tlist.remove(i);\r\n\t\t\t\t\tN-=2;\r\n\t\t\t\t\ti=-1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\"#\"+tc+\" \");\r\n\t\t\tfor(int i=0;i<N;i++) {\r\n\t\t\t\tSystem.out.print(list.get(i));\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n int count = 0;\n int sum = 0;\n final int supremum = 1000;\n\n while (count < supremum) {\n if ((count % 3) == 0 || (count % 5) == 0) {\n sum += count;\n }\n count += 1;\n }\n System.out.println(sum);\n }", "@Test\n public void computeDigits()\n {\n assertEquals(1, BinaryEncoder.computeDigits(0.0, 1.0));\n assertEquals(1, BinaryEncoder.computeDigits(1.0, 1.0));\n assertEquals(1, BinaryEncoder.computeDigits(2.0, 1.0));\n assertEquals(2, BinaryEncoder.computeDigits(3.0, 1.0));\n assertEquals(2, BinaryEncoder.computeDigits(4.0, 1.0));\n assertEquals(3, BinaryEncoder.computeDigits(4.5, 1.0));\n assertEquals(3, BinaryEncoder.computeDigits(5.0, 1.0));\n assertEquals(3, BinaryEncoder.computeDigits(6.0, 1.0));\n assertEquals(3, BinaryEncoder.computeDigits(7.0, 1.0));\n assertEquals(3, BinaryEncoder.computeDigits(8.0, 1.0));\n assertEquals(4, BinaryEncoder.computeDigits(9.0, 1.0));\n\n assertEquals(1, BinaryEncoder.computeDigits(0.0, 0.1));\n assertEquals(4, BinaryEncoder.computeDigits(1.0, 0.1));\n assertEquals(5, BinaryEncoder.computeDigits(2.0, 0.1));\n assertEquals(5, BinaryEncoder.computeDigits(3.0, 0.1));\n assertEquals(6, BinaryEncoder.computeDigits(4.0, 0.1));\n\n assertEquals(1, BinaryEncoder.computeDigits(0.0, 0.01));\n assertEquals(7, BinaryEncoder.computeDigits(1.0, 0.01));\n assertEquals(8, BinaryEncoder.computeDigits(2.0, 0.01));\n assertEquals(9, BinaryEncoder.computeDigits(3.0, 0.01));\n assertEquals(9, BinaryEncoder.computeDigits(4.0, 0.01));\n\n assertEquals(1, BinaryEncoder.computeDigits(0.0, 10.0));\n assertEquals(1, BinaryEncoder.computeDigits(1.0, 10.0));\n assertEquals(1, BinaryEncoder.computeDigits(2.0, 10.0));\n assertEquals(1, BinaryEncoder.computeDigits(3.0, 10.0));\n assertEquals(1, BinaryEncoder.computeDigits(4.0, 10.0));\n assertEquals(2, BinaryEncoder.computeDigits(30.0, 10.0));\n assertEquals(2, BinaryEncoder.computeDigits(40.0, 10.0));\n }", "public int countNumbersWithUniqueDigits(int n) {\n if(n==0) return 1;\n if(n==1) return 10;\n if(n>10) return 0;\n int current = 81;//for f(2) f(n)=f(n-1)*(11-n);depend on previous result, we have 11-n \n int total=91;\n for(int i=3;i<=n;i++){\n current*=(11-i);\n total+=current;\n }\n return total;\n }", "public static void main(String[] args) {\n\t\tint numeros = 0;\n\t\tint suma = 0;\n\t\tint contador = 0;\n\t\twhile(contador<11) {\n\t\t\t// Abajo se genera numeros aleatorios del 0 - 10\n\t\t\tnumeros = (int) (Math.random()*10);\n\t\t\tsuma = numeros + suma;\n\t\t\tSystem.out.print(numeros+\" \");\n\t\t\tcontador++;\n\t\t}\n\t\tSystem.out.println(\"\\nSuma:\"+ suma);\n\t\tSystem.out.println(\"Promedio:\"+( suma/10 ));\n\t}", "public static void main(String[] args) {\n\t\t\tint n = 0;\n\t\t\tfor(int i=0;i<10;i++){\n\t\t\t\tn = (int)(Math.random()*10+1);\n\t\t\t\tSystem.out.println(n);\n\t\t\t}\n\t}", "public static void main(String[] args) throws Exception {\n Scanner scn = new Scanner(System.in);\n\n int n = scn.nextInt();\n int[] arr = new int[n];\n\n for (int i = 0; i < n; i++)\n arr[i] = scn.nextInt();\n\n for (int i = 0; i < (int) Math.pow(2, n); i++) {\n int bin = dtb(i);\n int div = (int) Math.pow(10, n - 1);\n for (int j = 0; j < n; j++) {\n int q = bin / div;\n int r = bin % div;\n bin = r;\n if (q == 1) System.out.print(arr[j] + \"\\t\");\n else System.out.print(\"-\\t\");\n div /= 10;\n }\n System.out.println();\n }\n\n }", "public static void main(String[] args) {\n long number = 100;\n System.out.println(sumOfDigitsByLooping(Count.factorialOf(number)));\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}", "public static void main (String[] args) throws IOException, NumberFormatException {\n\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\t\tint t = Integer.parseInt(br.readLine());\n\t\t\t\t\n\t\t\t\twhile(t-->0) {\n\t\t\t\t\t//double x = scanner.nextDouble();\n\t\t\t\t\t//double n = scanner.nextDouble();\n\t\t\t\t\t\n\t\t\t\t\tString inputs[] = br.readLine().trim().split(\" \");\n\t\t\t\t\tdouble x = Double.parseDouble(inputs[0]);\n\t\t\t\t\tdouble n = Double.parseDouble(inputs[1]);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tdouble start = Math.pow(x, (1/n));\n\t\t\t\t\tSystem.out.println(getUniqueNumber(x, n, start));\n\t\t\t\t}\n\t}", "public static void main(String[] args) {\n\t\tint d = 6;\n\n\t\tint count = 0;\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tcount += count(1, i, i, d, i == d || i ==0);\n\t\t}\n\t\tSystem.out.println(count);\n\t}", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint[] arr = new int[10];\n\n\t\tfor(int i=0; i<arr.length; i++) {\n\t\t\tarr[i] = scan.nextInt();\n\t\t}\n\n\t\tint[] mod = new int[10];\n\t\tfor(int i=0; i<arr.length; i++) {\n\t\t\tmod[i] = arr[i]%42;\n\t\t}\n\n\t\tArrays.sort(mod);\n\n\t\tint count = 1;\n\t\tfor(int i=0; i<mod.length-1; i++) {\n\t\t\t\tif(mod[i] != mod[i+1])\n\t\t\t\t\tcount++;\n\t\t\t}\n\n\t\tSystem.out.println(count);\n\n\n\t}", "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 }", "public static void main(String[] args) {\n\t\tint n=345;\r\n\t\tint s=0;\r\n\t\twhile(n!=0)\r\n\t\t{\r\n\t\tint last=n%10;\r\n\t\ts =s+last;\r\n\t\tn= n/10;\t\r\n\t\t\t\r\n\t\t\t}\r\n\r\nSystem.out.println(s);\r\n\t}", "public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\r\n int m=sc.nextInt();\r\n int n=sc.nextInt();\r\n int l=sc.nextInt();\r\n int a[]=new int[(n-m+1)];\r\n int temp1=m;\r\n for(int i=0;i<n-m+1;i++){\r\n \ta[i]= temp1;\r\n \ttemp1++;\r\n }\r\n int b[]=new int[n-m+1];\r\n int temp=0;\r\n for(int i=0;i<n-m+1;i++)\r\n {\t\ttemp=a[i];\r\n \t while (temp != 0)\r\n \t {\r\n \t b[i] = b[i] * 10 + temp % 10;\r\n \t temp = temp / 10;\r\n \t }\r\n }\r\n \r\n long k=0,count=0;\r\n for(int i=0;i<n-m+1;i++){\r\n \tk=((Math.abs(a[i]-b[i]))%l);\r\n \tif(k==0){\r\n \t\tcount++;\r\n \t}\r\n \t\r\n\t}\r\nSystem.out.println(count);\r\n}", "public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n int n = Integer.parseInt(f.readLine());\n HashSet<Integer> next = new HashSet<>();\n StringTokenizer st = new StringTokenizer(f.readLine());\n int rounds = 0;\n for(int i = 0; i < n; i++) {\n int x = Integer.parseInt(st.nextToken());\n if(!next.contains(x)) {\n rounds++;\n }\n next.remove(x);\n next.add(x+1);\n }\n out.println(rounds);\n f.close();\n out.close();\n }", "public static void main (String[] args){\n Scanner input = new Scanner(System.in);\n System.out.println(\"Please enter a single digit integer:\");\n String a = input.nextLine();\n int b = Integer.parseInt(a);\n System.out.println(\"Please enter a file name:\");\n String filename = input.nextLine();\n //File readFile = new File(file);\n\n try {\n\n int[] nums = readMysteriousNumbers(filename);\n int[] tally = nthDigitTally(b, nums);\n for (int i = 0; i < 10; i++) {\n System.out.println(i + \"s: \\t\" + tally[i]);\n } //Finish - Write your main method to read a number n, from input\n //You can let a user enter a file name of a dataset or you can automatically use one.\n //The program should tally the nth digits of the number in the data set\n //and print out a table\n\n //int count = countDigits(12345678);\n //System.out.println(count);\n //System.out.println(nthDigitBack(0, 123));\n //System.out.println(nthDigit(0, 123));\n\n } catch (Exception e) {\n System.out.println(\"Oops. Something went wrong.\");\n e.printStackTrace();\n }\n\n }", "public static void main(String[] args) {\n\t\n\t\tScanner scanner=new Scanner(System.in);\n\t\tint noOftestCases = scanner.nextInt();\n\t\t\n\t\tfor (int p = 0; p < noOftestCases; p++) {\n\t\t\tint buffer[]=new int[100001];\n\t\t\tint size = scanner.nextInt();\n\t\t\t//int x[]=new int[size];\n\t\t\tfor (int i = 0; i < size; i++) {\n\t\t\t\tint temp=scanner.nextInt();\n\t\t\t\tbuffer[temp%100000]++;\n\t\t\t}\n\t\t\tint kSmallest = scanner.nextInt();\n\t\t\tint i=0;\n\t\t\twhile(kSmallest>0){\n\t\t\t\ti++;\n\t\t\t\tif(buffer[i]!=0)\n\t\t\t\t\tkSmallest-=buffer[i];\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(i);\n\t\t\t\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tint d = (int)(Math.random()*6)+1;\r\n\t\tSystem.out.println(\"random # = \"+d);\r\n\r\n\t\t//Use NumberFormat to format a double\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.print(\"Enter a price: \");\r\n\t\tdouble price = sc.nextDouble();\r\n\t\tSystem.out.println(\"price = \"+price);\r\n\t\t\r\n\t\tNumberFormat cf = NumberFormat.getCurrencyInstance();\r\n\t\tSystem.out.println(\"formatted price = \"+cf.format(price));\r\n\t\t\r\n\t\tSystem.out.print(\"Enter a percentage: \");\r\n\t\tdouble pct = sc.nextDouble();\r\n\t\tNumberFormat pf = NumberFormat.getPercentInstance();\r\n\t\tpf.setMinimumFractionDigits(3);\r\n\t\t\r\n\t\tSystem.out.println(\"pct = \"+pct);\r\n\t\tSystem.out.println(\"formatted pct = \"+pf.format(pct));\r\n\t}", "void writeRepetitionCount(int count);", "public static void main(String[] args) {\nint N,i,fac=1;\nScanner fn=new Scanner(System.in);\nN =fn.nextInt();\nif(N<=20) {\n\tfor(i=N;i>=1;i--) {\n\t\tfac=fac*i;\n\t}\n}\nSystem.out.println(fac);\n\t}", "public static void main(String[] args) throws Exception\r\n\t{\n\t\tScanner cin=new Scanner(new BufferedInputStream(System.in));\r\n\t\twhile(true)\r\n\t\t{\r\n\t\r\n\t\t\tint n1=cin.nextInt();\r\n\t\t\tint n2=cin.nextInt();\r\n\t\t\tint n=cin.nextInt();\r\n\t\t\tif(n1==0&&n2==0&&n==0)\r\n\t\t\t\tbreak;\r\n\t\t\tint divsor=n-n1-n2;\r\n\t\t\tHashMap<BigDecimal,Integer> bd=new HashMap< BigDecimal,Integer>();\r\n\t\t\tfor(int i=0;i<n;i++)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tBigDecimal td=new BigDecimal(cin.next());\r\n\t\t\t\tInteger ti=bd.get(td);\r\n\t\t\t\tif(ti!=null)\r\n\t\t\t\t\tti++;\r\n\t\t\t\telse ti=1;\r\n\t\t\t\tbd.put(td,ti);\r\n\t\t\t}\r\n\t\t\tBigDecimal [] p=new BigDecimal[bd.size()];\r\n\t\t\tbd.keySet().toArray(p);\r\n\t\t\tArrays.sort(p);\r\n\t\t\tBigDecimal re=new BigDecimal(\"0\");\r\n\t\t\tint findex=0;\r\n\t\t\tint fnum=0;\r\n\t\t\tint lindex=p.length-1;\r\n\t\t\tint lnum=0;\r\n\t\t\twhile(true)\r\n\t\t\t{\r\n\t\t\t\tint t=bd.get(p[findex]);\r\n\t\t\t\tif(n2>=t)\r\n\t\t\t\t{\r\n\t\t\t\t\tn2-=t;\r\n\t\t\t\t\tfindex++;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tfnum=t-n2;\r\n\t\t\t\t\tre=re.add(p[findex].multiply(new BigDecimal(\"\"+fnum)));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\twhile(true)\r\n\t\t\t{\r\n\t\t\t\tint t=bd.get(p[lindex]);\r\n\t\t\t\tif(n1>=t)\r\n\t\t\t\t{\r\n\t\t\t\t\tn1-=t;\r\n\t\t\t\t\tlindex--;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tlnum=t-n1;\r\n\t\t\t\t\tre=re.add(p[lindex].multiply(new BigDecimal(\"\"+lnum)));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t\tfor(int i=findex+1;i<lindex;i++)\r\n\t\t\t\tre=re.add(p[i].multiply(new BigDecimal(\"\"+bd.get(p[i]))));\r\n\t\t\tre=re.divide(new BigDecimal(\"\"+divsor),6,BigDecimal.ROUND_HALF_UP);\r\n\t\t\tSystem.out.println(re);\r\n\t\t\tbd=null;\r\n\t\t\tSystem.gc();\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n System.out.println(countDigitOne(11));\n }", "public static void main(String args[])\n {\n Scanner sc= new Scanner(System.in);\n double a=1,b,x=3,i,n,s=0;\n System.out.println(\"enter a number\");\n n=sc.nextInt();\n for(i=1;i<=n;i++)\n {\n a=a*x;\n b=1/a;\n s=s+b;\n x=x+2;\n }\n \n System.out.println(s);\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tScanner sc=new Scanner(System.in);\r\n\t\tint num=sc.nextInt();\r\n\t\tint count=0;\r\n\t\twhile(num>0)\r\n\t\t{\r\n\t\t\tif(num%2==0)\r\n\t\t\t{\r\n\t\t\t\tnum/=2;\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tnum-=1;\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(count);\r\n\r\n\t}", "public static double probabilityThreeSixes() {\n int count = 0;\n int amount = 0;\n for (int i = 0; i < 10000; i++) {\n amount = 0;\n for (int j = 0; j < 18; j++) {\n if ((int) (Math.random() * 6) + 1 == 6)\n amount++;\n if (amount == 3) {\n count++;\n break; }\n }\n }\n return ((double) count / (double) 10000) * 100;\n }", "public static void main(String[] args) {\n\t\tFastReader t = new FastReader();\n\t\tPrintWriter o = new PrintWriter(System.out);\n\t\tint test = t.nextInt();\n\n\t\twhile (test-- > 0) {\n\t\t\tlong n = t.nextLong();\n\t\t\tList<long[]> list = new ArrayList<>();\n\t\t\tlong count = 0;\n\t\t\tlong ok = n;\n\n\t\t\tif ((n & 1) == 0) {\n\t\t\t\twhile ((n & 1) == 0) {\n\t\t\t\t\tn = n >> 1;\n\t\t\t\t\t++count;\n\t\t\t\t}\n\n\t\t\t\tlist.add(new long[] { 2, count });\n\t\t\t}\n\n\t\t\tfor (long i = 3; i * i <= n; ++i) {\n\t\t\t\tlong cnt = 0;\n\n\t\t\t\tif (n % i == 0) {\n\t\t\t\t\tcount = 0;\n\n\t\t\t\t\twhile (n % i == 0) {\n\t\t\t\t\t\tn /= i;\n\t\t\t\t\t\t++count;\n\t\t\t\t\t}\n\n\t\t\t\t\tlist.add(new long[] { i, count });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (n > 1) {\n\t\t\t\tlist.add(new long[] { n, 1 });\n\t\t\t}\n\n\t\t\tlong max = 0;\n\t\t\tint idx = 0;\n\n\t\t\tfor (int i = 0; i < list.size(); ++i) {\n\t\t\t\tif (max < list.get(i)[1]) {\n\t\t\t\t\tidx = i;\n\t\t\t\t\tmax = list.get(i)[1];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcount = max - 1;\n\t\t\tlong val = 1;\n\n\t\t\to.println(max);\n\n\t\t\twhile (count-- > 0) {\n\t\t\t\to.print(list.get(idx)[0] + \" \");\n\n\t\t\t\tval *= list.get(idx)[0];\n\t\t\t}\n\n\t\t\to.println(ok / val);\n\n\t\t}\n\n\t\to.flush();\n\t\to.close();\n\t}", "public static void main(String [] args){\n\t\tArrayList<Integer> allNums = new ArrayList<>();\n\t\tfor(int i = 0; i < 10; i++){\n\t\t\tallNums.add(i);\n\t\t}\n\t\t//Make into one big number\n\t\t//Proceed to divide it to knock bits off the right hand side\n\t\tboolean miracleFound = false;\n\t\tString tempNum;\n\t\tlong miracleNum = 0;\n\t\twhile(!miracleFound){\n\t\t\t//Make A String from the List And analyse it\n\t\t\ttempNum = \"\";\n\t\t\tfor(int i = 0; i < allNums.size(); i++){\n\t\t\t\ttempNum = tempNum + allNums.get(i);\n\t\t\t\t//System.out.println(\"Tempnum is \" + tempNum + \" and i is \" + i);\n\t\t\t\tif(i > 0){\n\t\t\t\t\tmiracleNum = Long.valueOf(tempNum).longValue();\n\t\t\t\t\tif(miracleNum % (i+1) == 0){ //If it is divisible without remainders\n\t\t\t\t\t\tif((i+1) == 10){\n\t\t\t\t\t\t\tmiracleFound = true;\n\t\t\t\t\t\t\tSystem.out.println(\"Number \" + miracleNum + \" was a miracle number.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tSystem.out.println(miracleNum + \" % \" + (i+1) + \" is 0.\");\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\tCollections.shuffle(allNums);\n\t\t\t\t\t\ti = allNums.size();\n\t\t\t\t\t\tSystem.out.println(\"Number \" + miracleNum + \" was not a miracle number.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tdouble[] array = new double[10];\n\t\tRandom random = new Random();\n\t\tdouble aux;\n\t\t\n\t\tfor(int c = 0;c < 10;c++) {\n\t\t\tarray[c] = (random.nextDouble() * 100);\n\t\t\tSystem.out.println(array[c]);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Ordenar crescente:\");\n\t\tfor(int i = 0;i < array.length; i++) {\n\t\t\tfor(int j = 0;j < array.length - 1; j++) {\n\t\t\t\tif(array[j] > array[j + 1]) {\n\t\t\t\t\taux = array[j];\n\t\t\t\t\tarray[j] = array[j+1];\n\t\t\t\t\tarray[j+1] = aux;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(double d: array) {\n\t\t\tSystem.out.println(\n\t\t\t\t\tNumberFormat.getInstance().format(d));\n\t\t}\n\t}", "public String countAndSay(int n) {\n String input = \"1\";\n String immediate_str = \"\";\n\n \n for (int i = 1; i < n; i++) {\n //System.out.println(input);\n char [] nums = input.toCharArray();\n int count = 0;\n int prev = -1;\n for (int j = 0; j < nums.length; j++) {\n //System.out.println(j + \",\"+ nums[j]);\n if ((nums[j] - '0') == prev) {\n count ++;\n }\n else {\n if (prev != -1)\n immediate_str += Integer.toString(count) + Integer.toString(prev);\n count = 1;\n }\n prev = nums[j] - '0';\n }\n immediate_str += Integer.toString(count) + Integer.toString(prev);\n input = immediate_str;\n immediate_str = \"\";\n }\n return input; \n }", "public static void main(String[] args) {\n int a = 2; // starting number\n int r = 2; // Common ratio\n int n = 5; // N th term to be find\n\n int curr_term;\n for (int i = 0; i < n; i++) {\n curr_term = a * (int)Math.pow(r, i);\n System.out.print(curr_term + \" \");\n }\n\n }", "public static void main(String[] args) {\n\t\tint[] arr = { 4, 1, 1, 4, 2, 3, 4, 4, 1, 2, 4, 9, 3 };\n\t\tint number;\n\t\tint count = 1;\n\t\tint maxCount = 1;\n\t\tint index=0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tnumber = arr[i];\n\t\t\tfor (int j = i + 1; j < arr.length; j++) {\n\t\t\t\tif (number == arr[j]) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (maxCount < count) {\n\t\t\t\tmaxCount = count;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t\tcount=1;\n\t\t}\n\t\tSystem.out.println(arr[index]+\"->\"+maxCount+\" times\");\n\t}", "public static void main(String[] args) \n\t{\n\t\t\n\t\tint sum = 153;\n\t\tint num1 = 0;\n\t\t\n\t\twhile(sum>0)\n\t\t{\n\t\t\tint num = sum%10; //3\n\t\t\tnum1 = num1+num*num*num;\n\t\t\tsum = sum/10;\n\t\t}\n\t\t\n\t\tSystem.out.println(num1);\n\t\t\n\n\t}", "public int countDigitOne(int n) {\n int res = 0;\n for(long i = 1 ; i <= n; i *= 10){\n long k = n/i, r = n % i;\n res += (k + 8) / 10 * i + ((k%10 == 1)?(r+1):0);\n }\n return res;\n }", "public static void main(String[] args) {\n\t\tint count=0;\n\t\t\n\t\tfor(int i=1;i<=50;i++) {\n\t\t\tif(i%3==0) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"ΓΡ \"+count+\"°³\");\n\n\t}", "public static void main(String args[])\n {\n \n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int f = n/100;\n int s = ((n/10)%10);\n int t = n%10;\n int r = (t*100)+(s*10)+f;\n System.out.println(r);\n }", "public static void main(String[] args){\n for(int i = 1 ;i < 1000; i++){\n int x = i / 100;\n int y = (i % 100) / 10;\n int z = i % 10;\n int sum = x*x*x + y*y*y +z*z*z;\n if(i == sum || i < 10)\n System.out.println(i);\n }\n }", "public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\nint n=sc.nextInt();\nint temp=n;\nint sum=0;\nwhile(temp>0){\n\tint lastDigit=temp%10;\n\ttemp /= 10;\n\tsum += lastDigit;\n\tSystem.out.println(lastDigit+\" \"+temp+\" \"+sum);\n}\nSystem.out.println(\"Sum of the digits of \" + n +\" is \"+sum);\n//int numberofDigits=(int)Math.log10(n)+1;\n//System.out.println(numberofDigits);\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n Scanner cin = new Scanner(new File(\"A-large-practice.in\"));\n PrintStream cout = new PrintStream(\"A-large-practice.out\");\n// Scanner cin = new Scanner(System.in);\n// PrintStream cout = System.out;\n\n int _case = 0;\n\n for (int T = cin.nextInt(); T > 0; T--) {\n _case++;\n StringBuilder ans = new StringBuilder();\n\n final String[] digits = {\"ZERO\", \"ONE\", \"TWO\", \"THREE\", \"FOUR\", \"FIVE\", \"SIX\", \"SEVEN\", \"EIGHT\", \"NINE\"};\n double[][] a = new double[26][11];\n for (char ch : cin.next().toCharArray()) a[ch - 'A'][10]++;\n for (int i = 0; i < 10; i++)\n for (char ch : digits[i].toCharArray())\n a[ch - 'A'][i]++;\n\n// print(a);\n for (int i = 0; i < 10; i++) {\n int row = i;\n for (int j = i; j < 26; j++)\n if (Math.abs(a[j][i]) > Math.abs(a[row][i])) row = j;\n\n double[] tmp = a[row];\n a[row] = a[i];\n a[i] = tmp;\n\n for (int j = 10; j >= i; j--) a[i][j] /= a[i][i];\n for (int ii = i + 1; ii < 26; ii++)\n for (int j = 10; j >= i; j--)\n a[ii][j] -= a[i][j] * a[ii][i];\n\n// System.out.println();\n// print(a);\n }\n for (int ii = 8; ii >= 0; ii--) {\n for (int j = ii + 1; j < 10; j++)\n a[ii][10] -= a[ii][j] * a[j][10];\n }\n\n for (int i = 0; i < 10; i++)\n for (int j = 0; j < Math.round(a[i][10]); j++)\n ans.append(i);\n\n cout.printf(\"Case #%d: %s%n\", _case, ans);\n }\n\n cin.close();\n cout.close();\n }", "public static void main(String[] args) {\n\t\tint n=3;\n\t\tString s=\"1\";\n\t\tint count =1;\n\t\tint k=1;\n\t\twhile(k<n){\n\t\t\tStringBuilder t=new StringBuilder();\n\t\t\t//t.append(s.charAt(0));\n\t\t\tfor(int i=1;i<=s.length();i++){\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(i==s.length() || s.charAt(i-1)!=s.charAt(i)){\n\t\t\t\t\tt.append(count); t.append(s.charAt(i-1));\n\t\t\t\t\tcount=1;\n\t\t\t\t}\n\t\t\t\telse if(s.charAt(i-1)==s.charAt(i)){count=count+1;}\n\t\t\t }\t\n\t\t\t\ts=t.toString();\n\t\t\t\tk=k+1;\n\t\t\t\tSystem.out.println(\"k:\"+k);\n\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(s);\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static int numDimes(double money) {\n int dimes=0;\n while (money>0.10){\n dimes++;\n money=(money-0.10);}\n return dimes;}", "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}", "public static int digitCounter(int n){\r\n int counter=1;\r\n while(n>10){\r\n n=n/10;\r\n counter++;\r\n }\r\n System.out.println(\"conter : \" +counter);\r\n return counter;\r\n }", "public int countNumbersWithUniqueDigits(int n) {\n if (n == 0) return 1;\n int sAcc = 10;\n int mAcc = 9;\n int i = 1;\n n = Math.min(n, 10);\n while (i < n) {\n mAcc *= (10 - i);\n sAcc += mAcc;\n i++;\n }\n return sAcc;\n }", "public static void countSort(int arr[], int n, int exp)\n {\n int output[] = new int[n]; // output array\n int i;\n int count[] = new int[10];\n Arrays.fill(count, 0);\n\n // Store count of occurrences in count[]\n for (i = 0; i < n; i++)\n {\n count[(arr[i] / exp) % 10]++;\n }\n\n // Change count[i] so that count[i] now contains\n // actual position of this digit in output[]\n for (i = 1; i < 10; i++)\n {\n count[i] += count[i - 1];\n }\n\n // Build the output array\n for (i = n - 1; i >= 0; i--)\n {\n output[count[(arr[i] / exp) % 10] - 1] = arr[i];\n count[(arr[i] / exp) % 10]--;\n }\n\n // Copy the output array to arr[], so that arr[] now\n // contains sorted numbers according to curent digit\n for (i = 0; i < n; i++)\n {\n arr[i] = output[i];\n }\n }", "public static void main (String args[])\n {\n final int START;\n final int STOP = 500;\n final int NUMBER_PER_LINE = 10;\n int temp = 0;\n Scanner inputDevice = new Scanner(System.in);\n System.out.println(\"Enter value to count by: \");\n START = inputDevice.nextInt();\n for(int i = START; i <= STOP; i += START)\n {\n System.out.print(i + \" \");\n temp++;\n if(temp % NUMBER_PER_LINE == 0)\n System.out.println();\n }\n System.out.println();\n }", "public static void main(String[] args) {\n\r\n\t\tSystem.out.print(\"[\");\r\n\t\tfor(int i=1; i<=100; i++)\r\n\t\t{\r\n\t\t\tif(isPerfectNumber(i))\r\n\t\t\tSystem.out.print(i + \" \");\t\r\n\t\t}\r\n\t\tSystem.out.println(\"]\");\r\n\t}", "public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\t\t\n\t\tint number = (int)(Math.random()*100+1); // [0,1)\n\t\tint a=0;\n\t\tint count=0;\n\t\tdo\n\t\t{\n\t\t\ta = in.nextInt();\n\t\t\tcount += 1;\n\t\t\tif(a>number)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"你猜的数字偏大\");\n\t\t\t\t\n\t\t\t}else if (a<number)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"你猜的数字偏小\");\n\t\t\t}\n\t\t}while(a!=number);\n\t\tSystem.out.println(\"恭喜你猜对了!,你一共猜了\"+count+\"次\");\n\t}", "public static void main(String[] args) throws IOException {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint tc = sc.nextInt();\n\n\t\tfor (int num = 1; num <= tc; num++) {\n\t\t\tint n = sc.nextInt();\n\t\t\tString str = \"\";\n\t\t\tint arr[] = new int[n];\n\t\t\tboolean flag = false;\n\t\t\tboolean visit[]=new boolean[1001];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tarr[i] = sc.nextInt();\n\t\t\t\tif (!flag && arr[i] == 0)\n\t\t\t\t\tflag = true;\n\t\t\t\tstr += arr[i];\n\t\t\t}\n\t\t\tif (flag) {\n\t\t\t\tint ans = 0;\n\t\t\t\tboolean p=false;\n\t\t\t\tfor (int i = 1; i <= n; i++) {\n\t\t\t\t\tfor (int j = 0; j + i <= n; j++) {\n\t\t\t\t\t\t\tint tmp = Integer.parseInt(str.substring(j, j + i));\n\t\t\t\t\t\t\tvisit[tmp]=true;\n\t\t\t\t\t}\n\t\t\t\t\tint amount=(int)Math.pow(10, i);\n\t\t\t\t\tfor(int k=0;k<amount;k++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!visit[k])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tans=k;\n\t\t\t\t\t\t\tp=true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(p)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"#\" + num + \" \" + ans);\n\t\t\t} else\n\t\t\t\tSystem.out.println(\"#\" + num + \" \" + 0);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tRandom dice = new Random();\n\t\tint number = 0;\n\t\tfor (int i = 0; i <= 10; i++) {\n\t\t\tnumber = 1 + dice.nextInt(6);\n\t\t}\n\t\tSystem.out.println(number);\n\t}", "public static void main(String[] args) {\n\t\tArrays.fill(arr, 1);\n\t\tlong startTime = System.nanoTime();\n\t\t// Traverse till square root of MAX\n\t\t// Using logic similar to sieve of eratosthenes to\n\t\t// populate factor sum array\n\t\tint limit = (int)Math.sqrt(MAX);\n\t\tfor (int i = 2; i <= limit; ++i) {\n\t\t\tint j = i+i;\n\t\t\tint count = 2;\n\t\t\twhile (j <= MAX){\n\t\t\t\t// As we already add count (j/i) to the factor sum when adding i,\n\t\t\t\t// we don't add when i is equal to or greater than count\n\t\t\t\tif (i < count) {\n\t\t\t\t\t// Adding i and count (j/i) to the factor sum of j\n\t\t\t\t\tarr[j] += i;\n\t\t\t\t\tarr[j] += count;\n\t\t\t\t}\n\t\t\t\tj += i;\n\t\t\t\tcount++;\n\t\t\t} \n\t\t}\n\t\t\n\t\tint count = 0;\n\t\tSystem.out.println(\"The following are amicable numbers\");\n\t\tfor (int i = 2; i <= MAX; ++i) {\n\t\t\tint num = arr[i];\n\t\t\tif (num <= MAX && num > i) {\n\t\t\t\tif (arr[num] == i) {\n\t\t\t\t\tSystem.out.println(count+\": \"+i+\" and \"+num);\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong endTime = System.nanoTime();\n\t\tdouble duration = timeInSec(endTime,startTime) ;\n\t\tSystem.out.println(\"Run time \" + duration + \" : secs\");\t\t\n\t}", "public static void main(String[] args) {\n\t\tint[] counts = new int[100]; \r\n\t\t\r\n\t\t// Welcome the user.\r\n\t\t\r\n\t\tSystem.out.println(\"Welcome to the Occurrence Counter Program.\");\r\n\t\tSystem.out.println(\"This program counts the occurrences of the numbers you enter.\");\r\n\r\n\t\t// Prompt the user to enter integers between 1 and 100\r\n\t\tSystem.out.print(\"Please enter integers between 1 and 100 with 0 being your last entry: \");\r\n\r\n\t\t// Call count method.\r\n\t\tcount(counts);\r\n\r\n\t\t// Display results.\r\n\t\tfor (int i = 0; i < counts.length; i++) {\r\n\t\t\tif (counts[i] > 0)\r\n\t\t\t\tSystem.out.println((i + 1) + \"\\t\" + \" occurs \" + counts[i] +\r\n\t\t\t\t\t\" time\" + (counts[i] > 1 ? \"s\" : \"\"));\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\r\n\t\tint i;\r\n\t\tint [] mylist =new int[150];\r\n\t\tSystem.out.print(\"Enter the integers between 1 and 100: \");\r\n\t\tint number = input.nextInt();\r\n\t\twhile(number!=0) {\r\n\t\t\tif (number <= 100 && number >= 0) {\r\n\t\t\t\tmylist[number]=mylist[number]+1;\r\n\t\t\t}\r\n\t\t\tnumber = input.nextInt();\r\n\t\t}\r\n\t\tif(number==0) {\r\n\t\t\tfor(i=1;i<=100;i++) {\r\n\t\t\t\tif(mylist[i]==1) {\r\n\t\t\t\t\tSystem.out.println(i +\" occurs \" +mylist[i] +\" time\");\r\n\t\t\t\t}\r\n\t\t\t\tif(mylist[i]>1) {\r\n\t\t\t\t\tSystem.out.println(i +\" occurs \" +mylist[i] +\" times\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\n // Declaracao da variaveis;\n float media;\n int soma;\n\n // Declaracao das variveis que recebem os numeros aleatorios;\n double alea1 = Math.random();\n byte n1 = (byte)(0 + alea1 * (29-0));\n double alea2 = Math.random();\n byte n2 = (byte)(0 + alea2 * (29-0));\n double alea3 = Math.random();\n byte n3 = (byte)(0 + alea3 * (29-0));\n\n // Operacoes matematicas para calculo da media e soma;\n media = (n1 + n2 + n3)/3;\n soma = (n1 + n2 + n3);\n\n // Impressao dos resultdos\n System.out.println(\"Os tres numeros aleatorios escolhidos sao: \"+n1+\", \"+n2+\" e \"+n3);\n System.out.println(\"A media dos tres numeros e igual a: \"+media+\"\\nO somatorio dos tres numeros e igual a: \"+soma);\n }" ]
[ "0.6357716", "0.6274294", "0.6172699", "0.6132539", "0.6061748", "0.602409", "0.60066456", "0.5984489", "0.5982982", "0.5876075", "0.58709735", "0.5817232", "0.5802197", "0.57959926", "0.5793088", "0.5787493", "0.5783517", "0.5776166", "0.5747733", "0.57294", "0.5724716", "0.5716351", "0.57107884", "0.56997377", "0.56736094", "0.56653714", "0.5648555", "0.5639162", "0.56350857", "0.56163865", "0.56130356", "0.5606839", "0.5602269", "0.55937445", "0.5585025", "0.55846155", "0.55800796", "0.55791587", "0.5572075", "0.5568032", "0.55290556", "0.5515966", "0.55107754", "0.55022085", "0.5493518", "0.5478568", "0.5477785", "0.547571", "0.5474494", "0.5474151", "0.54597455", "0.54499036", "0.54491746", "0.5448325", "0.54419863", "0.5430737", "0.54301995", "0.54281175", "0.54269433", "0.5424573", "0.54243857", "0.54231906", "0.5415942", "0.5405166", "0.54031724", "0.5396388", "0.5392566", "0.538735", "0.5375643", "0.53755116", "0.5374781", "0.53719276", "0.5359517", "0.53513396", "0.53496516", "0.5348228", "0.5341058", "0.533784", "0.5335199", "0.5334996", "0.5333005", "0.53266925", "0.532289", "0.5316405", "0.53153217", "0.53130233", "0.5311781", "0.5311763", "0.5306417", "0.5306194", "0.5305301", "0.5304564", "0.53029853", "0.5296495", "0.5295308", "0.52931905", "0.5288461", "0.52862203", "0.5286094", "0.5284055" ]
0.6398065
0
Creates a new instance of AcuityTest
public AcuityTest() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ClimbingClubTest()\n {\n \n }", "public AuthorityFactoriesTest() {\n }", "public AllLaboTest() {\n }", "public PerezosoTest()\n {\n }", "public ActivitiTestCase() {\n }", "private AccuracyTestHelper() {\n // empty\n }", "public UnitTests()\n {\n }", "public GUITest() {\n }", "public Tests(){\n \n }", "public AcceptanceTestRun() {\n }", "public TestPrelab2()\n {\n }", "public BookcaseTest () {\n }", "public void createAuctionTest(){\n\t\tAuction auc = new Auction(new User(),\"Test Auction Description\",1000l);\n\n\t}", "public SwerveAutoTest() {\n // Initialize base classes.\n // All via self-construction.\n\n // Initialize class members.\n // All via self-construction.\n }", "public HockeyTeamTest()\n {\n }", "public HawthornWandBehaviorTest() {\n \n }", "public StrandUnitTest()\n {\n }", "public test() {\n\t\tsuper();\n\t}", "public BookingSystemTest()\n {\n }", "public GuidanceTest(String name) {\n\t\tsuper(name);\n\t}", "public BazaarTests() {\r\n\t\tsuper();\r\n\t}", "public RegistroTest()\n {\n }", "public EcriveurMetierTest() {\r\n\t\t\r\n\t\tsuper();\r\n\t\t\r\n\t}", "public FlightTest(){\n }", "public ControllerTest()\r\n {\r\n }", "public BirdFoodTest()\r\n {\r\n }", "public static Test suite() {\r\n\t\tHyadesTestSuite testTPBridgeClient = new HyadesTestSuite(\r\n\t\t\t\t\"TestTPBridgeClient\");\r\n\t\ttestTPBridgeClient.setArbiter(DefaultTestArbiter.INSTANCE).setId(\r\n\t\t\t\t\"F968DA8CBEFEFE1A799AE350F11611DB\");\r\n\t\r\n\t\ttestTPBridgeClient.addTest(new TestTPBridgeClient(\"testTPBridgeClient\")\r\n\t\t\t\t.setId(\"F968DA8CBEFEFE1AAC5A86B9F11611DB\").setTestInvocationId(\r\n\t\t\t\t\t\t\"F968DA8CBEFEFE1A34EBB2E0F11911DB\"));\r\n\t\treturn testTPBridgeClient;\r\n\t}", "public Test()\n {\n }", "public Test() {\n }", "public RookTest()\r\n {\r\n }", "public ApplicationTest() {\n\t\t/*\n\t\t * This constructor should not be modified. Any initialization code should be\n\t\t * placed in the setUp() method instead.\n\t\t */\n\n\t}", "public TestArithmetic()\n {\n }", "public RenderableTest()\n {\n }", "Testcase createTestcase();", "public Vending_MachineTest()\n {\n // initialise instance variables\n \n \n }", "@Test\n\tpublic void testConstructor() {\n double[] startPosition = {50, 30, 0};\n GroundVehicle gv = new GroundVehicle(startPosition, 0, 0);\n Simulator sim = new Simulator();\n\n UserController uc = new UserController(sim, gv);\n\n assertEquals(sim, uc.getSimulator());\n assertEquals(gv, uc.getUserVehicle());\n\t}", "@Test\r\n\tpublic void testConstructor() {\r\n\t\tnew ConstructorTestClass();\r\n\t}", "@Test\r\n\tpublic void testConstructor() {\r\n\t\tnew ConstructorTestClass();\r\n\t}", "@Test\n void constructorTest() {\n super.checkConstruction();\n }", "public EnvironmentPanelTest()\n {\n }", "@Test\n public void testAddACopy() {\n }", "public void test_ctor() {\n assertNotNull(\"instance should be created.\", instance);\n }", "public TestsAsset() {\n tests = new LinkedList<TestBean>();\n }", "@Test\n\tpublic void testConstructor() {\n\t\tnew ConstructorTestClass();\n\t}", "@Test\n\tpublic void testConstructor() {\n\t\tnew ConstructorTestClass();\n\t}", "@Test\n\tpublic void constructortest4() {\n\t\tMainDish dessertTest = new MainDish(\"quiche\");\n\t\tassertTrue(dessertTest.isVegetarian()==false);\n\t}", "public AppTest()\n {\n super(AppTest.class);\n }", "public ProjektTest()\n {\n }", "@Test\n public void ctor(){\n assertNotNull(CuT.templateEngine, \"The Template Engine is Null and should not be\");\n }", "@Test\n\tpublic void constructortest3() {\n\t\tMainDish dessertTest = new MainDish(\"quiche\");\n\t\tassertTrue(dessertTest.isGlutenFree()==false);\n\t}", "public ResultatTest() {\n\t\tthis.nbTests = 0;\n\t\tthis.echecs = new ArrayList<TestExecute>();\n\t\tthis.erreurs = new ArrayList<TestExecute>();\n\t}", "@Test\n public void testCarregarUex() {\n }", "public tester() {\r\n }", "private Test emptyTest() {\n return new TestSuite();\n }", "@Before\n public void setUp() {\n a = new Graph(5);\n \n }", "@Test\n\tpublic void constructorTest() {\n\t\tCTRNN testCtrnn = new CTRNN(layout1, phenotype1, false);\n\t\tAssert.assertEquals(1.0, testCtrnn.inputWeights[0], 0.001);\n\t\tAssert.assertEquals(2.0, testCtrnn.hiddenWeights[0][0], 0.001);\n\t\tAssert.assertArrayEquals(new double[] {3.0, 4.0}, testCtrnn.biasWeights, 0.001);\n\t\tAssert.assertArrayEquals(new double[] {5.0, 6.0}, testCtrnn.gains, 0.001);\n\t\tAssert.assertArrayEquals(new double[] {7.0, 8.0}, testCtrnn.timeConstants, 0.001);\n\t\t\n\t}", "public void testCreation() {\n // First the two standard constructors with meaningfull data.\n // Also test the different setters.\n final String title1 = \"Title1\";\n final String cleavage1 = \"ARNDCQ\";\n final String restrict1 = \"PG\";\n final char[] cv1 = cleavage1.toCharArray();\n final char[] rs1 = restrict1.toCharArray();\n final String pos1 = \"Cterm\";\n final String pos2 = \"nteRm\";\n final int miscleavage = 3;\n\n Enzyme e = new Enzyme(title1, cleavage1, restrict1, pos1);\n Assert.assertEquals(title1, e.getTitle());\n Assert.assertEquals(new String(cv1), new String(e.getCleavage()));\n Assert.assertEquals(new String(rs1), new String(e.getRestrict()));\n Assert.assertEquals(Enzyme.CTERM, e.getPosition());\n Assert.assertEquals(1, e.getMiscleavages());\n\n final String otherTitle = \"other\";\n final String otherCleavage = \"HIK\";\n final String otherRestrict = \"MN\";\n final char[] otherCv = otherCleavage.toCharArray();\n final char[] otherRs = otherRestrict.toCharArray();\n\n e.setTitle(otherTitle);\n e.setCleavage(otherCleavage);\n e.setRestrict(otherRestrict);\n e.setPosition(Enzyme.NTERM);\n e.setMiscleavages(miscleavage);\n\n Assert.assertEquals(otherTitle, e.getTitle());\n Assert.assertEquals(new String(otherCv), new String(e.getCleavage()));\n Assert.assertEquals(new String(otherRs), new String(e.getRestrict()));\n Assert.assertEquals(Enzyme.NTERM, e.getPosition());\n Assert.assertEquals(miscleavage, e.getMiscleavages());\n\n e.setCleavage(cleavage1);\n e.setRestrict(rs1);\n Assert.assertEquals(new String(cv1), new String(e.getCleavage()));\n Assert.assertEquals(new String(rs1), new String(e.getRestrict()));\n\n e = new Enzyme(null, cleavage1, null, pos2, 5);\n Assert.assertTrue(e.getTitle() == null);\n Assert.assertEquals(new String(cv1), new String(e.getCleavage()));\n Assert.assertTrue(e.getRestrict() == null);\n Assert.assertEquals(Enzyme.NTERM, e.getPosition());\n Assert.assertEquals(5, e.getMiscleavages());\n\n try {\n e = new Enzyme(title1, null, restrict1, null);\n fail(\"No NullPointerException thrown when Enzyme constructor was presented with a 'null' cleavage and position String!\");\n } catch(NullPointerException npe) {\n // Okay, this is what we wanted.\n }\n\n try {\n e = new Enzyme(title1, cleavage1, restrict1, null);\n fail(\"No NullPointerException thrown when Enzyme constructor was presented with a 'null' position String!\");\n } catch(NullPointerException npe) {\n // Okay, this is what we wanted.\n }\n }", "public AxiomTest(String name) {\n\t\tsuper(name);\n\t}", "public CustomerTest()\n {\n }", "@Before\r\n public void setUp() {\n articuloPrueba = new Articulo();\r\n \r\n \r\n }", "@Test\n public void onCreate() {\n }", "@Test\n public void onCreate() {\n }", "public void testConstructor() {\r\n assertNotNull(\"unable to create instance\", instance);\r\n }", "public RecognitionTest(String testName) {\n super(testName);\n }", "public AppTest(String testName) {\n super(testName);\n }", "public AppTest(String testName) {\n super(testName);\n }", "public AppTest(String testName) {\n super(testName);\n }", "public AppTest(String testName) {\n super(testName);\n }", "public MainActivityUserTest() {\r\n super(MainActivity.class);\r\n }", "@Test\n public void instanceTest() {\n // TODO: test instance\n }", "@Test\n\tpublic void constructortest2() {\n\t\tMainDish dessertTest = new MainDish(\"quiche\");\n\t\tassertTrue(dessertTest.getPrice()==0);\n\t}", "@Before\n\tpublic void setUp() {\n\t\tcompteTest = FactoryCompte.getCompteVide();\n\t\tcompteTest.setIdClient(3630);\n\t\tcompteTest.setBalance(89.8);\n\t\tcompteTest.setNegativeBalanceAllowed(false);\n\t\t\n\t\tinstance.createWithId(compteTest);\t\t\n\t}", "@Before\n public void setUp(){\n cmTest = new CoffeeMaker();\n\n }", "public ElfTest()\n {\n }", "public RemoteFilingTest() {\n }", "public static void main(String[] args) {\n AubAbstractTest aubAbstractTest = new AubAbstractTest(1);\n System.out.println(aubAbstractTest);\n }", "public SalesItemTest()\n {\n }", "public AssociationTest(String name) {\n\t\tsuper(name);\n\t}", "@Test\n public void test() {\n Solution solution = new Solution();\n\n }", "@Test\n public void test() {\n Solution solution = new Solution();\n\n }", "@Test\n public void testCarregarAno() {\n }", "public Compose4jTest(String testName) {\n super(testName);\n }", "public AppTest(String testName) {\r\n\t\tsuper(testName);\r\n\t}", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "public CacheTest() {\n }", "@Test\n\tpublic void constructortest() {\n\t\tMainDish dessertTest = new MainDish(\"quiche\");\n\t\tassertTrue(dessertTest.getName().equals(\"quiche\"));\n\t}", "public HotelBookingTest() {\r\n\t\tsuper();\r\n\t}", "TrainingTest createTrainingTest();", "public GameOfLifeTest()\n {\n }", "public AppTest(String testName) {\n\t\tsuper(testName);\n\t}", "public AppTest(String testName) {\n\t\tsuper(testName);\n\t}", "public AppTest(String testName) {\n\t\tsuper(testName);\n\t}", "public AppTest(String testName) {\n\t\tsuper(testName);\n\t}", "public AppTest(String testName) {\n\t\tsuper(testName);\n\t}", "public static Tester create() {\n\t\treturn new Tester();\n\t}", "public CountryTest()\n {\n }", "@Test\n public void testJatka() {\n System.out.println(\"jatka\");\n Peli peli = new Peli(new Alue(3, 1));\n peli.jatka();\n assertEquals(peli.isHavio(), false);\n assertEquals(peli.getMenetykset(), 1);\n\n }", "public TestSequence() {\n }" ]
[ "0.671001", "0.66987014", "0.65943927", "0.65567654", "0.6551962", "0.6513047", "0.64711994", "0.6424128", "0.6409134", "0.6346423", "0.6339013", "0.6308003", "0.6306722", "0.6261673", "0.6260099", "0.6229242", "0.61984223", "0.6176624", "0.6161638", "0.6157369", "0.6154755", "0.6151025", "0.6139509", "0.6130867", "0.61228997", "0.6107747", "0.61063373", "0.6105723", "0.6095627", "0.60639393", "0.6063034", "0.6059658", "0.60596365", "0.6058947", "0.60516924", "0.604742", "0.6046534", "0.6046534", "0.60460055", "0.6036845", "0.6035519", "0.6023292", "0.6013394", "0.59929204", "0.59929204", "0.59755325", "0.5971983", "0.5966601", "0.5956844", "0.59423876", "0.59408706", "0.5938211", "0.59287274", "0.5926819", "0.5915577", "0.5914385", "0.5910542", "0.5908748", "0.5908388", "0.59056014", "0.58994216", "0.58994216", "0.58934796", "0.58685297", "0.58620095", "0.58620095", "0.58620095", "0.58620095", "0.58588254", "0.5857489", "0.58498126", "0.5834", "0.58312476", "0.58278227", "0.58224", "0.5818484", "0.581583", "0.5805415", "0.5803034", "0.5803034", "0.57963294", "0.5793757", "0.5793219", "0.5788738", "0.5788738", "0.5788738", "0.57765186", "0.57743376", "0.5767383", "0.57620144", "0.5760512", "0.5756352", "0.5756352", "0.5756352", "0.5756352", "0.5756352", "0.57530993", "0.575291", "0.5745449", "0.5732154" ]
0.849121
0
add the patient answer to the answer list
public void saveAnswer(long answerTime, Element element, boolean patientAnswer, String patientAnswerStr){ getTestAnswers().add( new TestAnswer(answerTime, patientAnswer, element, patientAnswerStr) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void addQuestionAnswer(Answer answer);", "void addAnswer(Answer answer);", "@Override\r\n public void addAnswer(String answer) {\r\n this.answers.add(answer);\r\n }", "public void addAnswer(Answer ans) {\n // TODO implement here\n }", "public void addAnswer(Answer answer) {\n \t\tanswer.setId(answerIdCounter);\n \t\tanswers.add(answer);\n \t\tanswerIdCounter++;\n \t}", "@Override\n public void add(String question, String answer){\n questions.add(question);\n answers.add(answer);\n\n }", "public void addQuestionAndAnswer(String question, String answer){\n this.questionList.add(question);\n this.answerList.add(answer);\n }", "public void addAnswer(AnswerElement ans) {\r\n\t\tthis.ans.add(ans);\r\n\t}", "public void add( IAnswer possibleAnswer );", "public DnsMessage addAnswer(DnsResource answer) {\n if (answers == null) {\n answers = new LinkedList<DnsResource>();\n }\n answers.add(answer);\n return this;\n }", "@Override\n public void addResponses() {\n for(answerChoice a: this.userAnswers) {\n this.addResponseHelper(a.getAnswerText());\n //this.savedResponses. //add(a.getAnswerText());\n //try {\n\n //} catch(Exception e) {\n // e.printStackTrace();\n\n //}\n\n }\n }", "void addQuestions(String surveyId, List<Question> questions);", "public void addAnsweredQuestions (int index) {\n\n\t\t_answeredQuestions[index]=_answeredQuestions[index]+1;\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm data/answered_questions\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/answered_questions\");\n\t\tString answeredQuestions = \"\";\n\t\tfor (int i = 0;i<5;i++) {\n\t\t\tansweredQuestions = answeredQuestions + \" \" + String.valueOf(_answeredQuestions[i]);\n\t\t}\n\t\tBashCmdUtil.bashCmdNoOutput(String.format(\"echo \\\"%s\\\" >> data/answered_questions\", answeredQuestions));\n\n\n\n\t}", "public void saveAnswer(Element element, boolean patientAnswer, String patientAnswerStr){\n getTestAnswers().add( new TestAnswer(patientAnswer, element, patientAnswerStr) ); \r\n }", "public void addQuestion(Question question);", "void newAnswer (Integer q, Integer a) {\n\t\tif (results.get(q)==null) {\n\t\t\tArrayList<Integer> newEntry = new ArrayList<Integer>();\n\t\t\tnewEntry.add(a);\n\t\t\tresults.put(q, newEntry);\n\t\t} else {\n\t\t\t// append to existing list\n\t\t\tresults.get(q).add(a);\n\t\t}\n\t}", "public void addPatient()\n {\n Scanner sc=new Scanner(System.in);\n System.out.println(\"Enter name of patient\");\n String name=sc.nextLine();\n int pos,id;\n\n do\n {\n System.out.println(\"Enter doctor id to assign to\");\n id=sc.nextInt();\n pos=checkDoctor(id);\n if(pos==-1)\n System.out.println(\"Invalid doctor id\");\n }\n while(pos==-1);\n String docname=doc.get(pos).getName();\n Patient p=new Patient(name,id,docname);\n pt.add(p);\n\n }", "private void addQuestion() {\n if (modifiable()) {\n try {\n this.questions.add(Question.fromInput(gradeable()));\n } catch (UserInputException e) {\n System.err.println(e.getMessage());\n }\n } else {\n System.err.println(\"Can not modify this by add a question.\");\n }\n }", "public void setAnswer(int index, String answer){\n answerList.set(index, answer);\n }", "public void addQuestion()\r\n\t{\r\n\t\tScanner in = new Scanner (System.in);\r\n\t\tString question, a1, a2, a3, a4, correctAnswer;\r\n\r\n\t\tSystem.out.println(\"Please enter a question: \");\r\n\t\tquestion = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter answer choice #1: \");\r\n\t\ta1 = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter answer choice #2: \");\r\n\t\ta2 = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter answer choice #3: \");\r\n\t\ta3 = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter answer choice #4: \");\r\n\t\ta4 = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter the correct answer (number): \");\r\n\t\tcorrectAnswer = in.nextLine();\r\n\t\t\r\n\t\t//checks input\r\n\t\twhile( !( correctAnswer.equalsIgnoreCase(\"1\") || correctAnswer.equalsIgnoreCase(\"2\") || correctAnswer.equalsIgnoreCase(\"3\") || correctAnswer.equalsIgnoreCase(\"4\") ) )\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Invalid entry. Enter again:\");\r\n\t\t\tcorrectAnswer = in.nextLine();\r\n\t\t}\r\n\t\tQuestion q = new Question ( question, a1, a2, a3, a4, correctAnswer );\r\n\t\t\r\n\t\tquestions.add(q);\r\n\t}", "public void addQuestions() {\n\t\tboolean addNewQuestion = true;\n\t\tString text;\n\t\tQuestion q;\n\t\tString promptResponse;\n\t\t\n\t\twhile (addNewQuestion) {\n\t\t\tSystem.out.print(\"Enter question: \");\n\t\t\ttext = System.console().readLine();\n\t\t\tq = new QuestionImpl(questionId, text);\n\t\t\tthis.questionId++;\n\t\t\tq.addAnswers();\n\t\t\tthis.questions.add(q);\n\n\t\t\tSystem.out.print(\"Hit Return to add another question or q to quit: \");\n\t\t\tpromptResponse = System.console().readLine();\n\t\t\tif (promptResponse.equals(\"q\") ||\n\t\t\t\t\tpromptResponse.equals(\"Q\") ||\n\t\t\t\t\tpromptResponse.equals(\"quit\") ||\n\t\t\t\t\tpromptResponse.equals(\"Quit\")) {\n\t\t\t\taddNewQuestion = false;\n\t\t\t}\n\t\t}\n\t}", "public void addAnswer(Group group, Question question, Answer answer, LocalDateTime date) {\n \tGroup realGroup = answer.getQuestion().getGroup();\n \tif(realGroup != null)\n \t\tif(!realGroup.getTitle().equals(group.getTitle()))\n \t\t\treturn;\n \tMembership temp = memberships.get(group.getTitle());\n \tif(temp == null)\n \t\treturn;\n \tanswer.setMembership(temp);\n temp.addAnswer(answer);\n question.addAnswer(answer);\n group.addAnswer(answer);\n }", "private void addQuestion() {\n Question q = new Question(\n \"¿Quien propuso la prueba del camino básico ?\", \"Tom McCabe\", \"Tom Robert\", \"Tom Charlie\", \"Tom McCabe\");\n this.addQuestion(q);\n\n\n Question q1 = new Question(\"¿Qué es una prueba de Caja negra y que errores desean encontrar en las categorías?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \" determina la funcionalidad del sistema\", \" determina la funcionalidad del sistema\");\n this.addQuestion(q1);\n Question q2 = new Question(\"¿Qué es la complejidad ciclomática es una métrica de calidad software?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \"basada en el cálculo del número\", \"basada en el cálculo del número\");\n this.addQuestion(q2);\n //preguntas del quiz II\n Question q3=new Question(\"Las pruebas de caja blanca buscan revisar los caminos, condiciones, \" +\n \"particiones de control y datos, de las funciones o módulos del sistema; \" +\n \"para lo cual el grupo de diseño de pruebas debe:\",\n \"Conformar un grupo de personas para que use el sistema nuevo\",\n \"Ejecutar sistema nuevo con los datos usados en el sistema actual\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\");\n this.addQuestion(q3);\n Question q4=new Question(\"¿Las pruebas unitarias son llamadas?\",\n \"Pruebas del camino\", \"Pruebas modulares\",\n \"Pruebas de complejidad\", \"Pruebas modulares\");\n this.addQuestion(q4);\n Question q5=new Question(\"¿Qué es una prueba de camino básico?\",\n \"Hace una cobertura de declaraciones del código\",\n \"Permite determinar si un modulo esta listo\",\n \"Técnica de pueba de caja blanca\",\n \"Técnica de pueba de caja blanca\" );\n this.addQuestion(q5);\n Question q6=new Question(\"Prueba de camino es propuesta:\", \"Tom McCabe\", \"McCall \", \"Pressman\",\n \"Tom McCabe\");\n this.addQuestion(q6);\n Question q7=new Question(\"¿Qué es complejidad ciclomatica?\",\"Grafo de flujo\",\"Programming\",\n \"Metrica\",\"Metrica\");\n this.addQuestion(q7);\n //preguntas del quiz III\n Question q8 = new Question(\n \"¿Se le llama prueba de regresión?\", \"Se tienen que hacer nuevas pruebas donde se han probado antes\",\n \"Manten informes detallados de las pruebas\", \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\");\n this.addQuestion(q8);\n Question q9 = new Question(\"¿Cómo se realizan las pruebas de regresión?\",\n \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\", \"A través de herramientas de automatización de pruebas\", \"A través de herramientas de automatización de pruebas\");\n this.addQuestion(q9);\n Question q10 = new Question(\"¿Cuándo ya hay falta de tiempo para ejecutar casos de prueba ya ejecutadas se dejan?\",\n \"En primer plano\", \"En segundo plano\", \"En tercer plano\", \"En segundo plano\");\n this.addQuestion(q10);\n //preguntas del quiz IV\n Question q11 = new Question(\n \"¿En qué se enfocan las pruebas funcionales?\",\n \"Enfocarse en los requisitos funcionales\", \"Enfocarse en los requisitos no funcionales\",\n \"Verificar la apropiada aceptación de datos\", \"Enfocarse en los requisitos funcionales\");\n this.addQuestion(q11);\n Question q12 = new Question(\"Las metas de estas pruebas son:\", \"Verificar la apropiada aceptación de datos\",\n \"Verificar el procesamiento\", \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\",\n \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\");\n this.addQuestion(q12);\n Question q13 = new Question(\"¿En qué estan basadas este tipo de pruebas?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Técnicas de cajas negra\", \"Técnicas de cajas negra\");\n this.addQuestion(q13);\n //preguntas del quiz V\n Question q14 = new Question(\n \"¿Cúal es el objetivo de esta técnica?\", \"Identificar errores introducidos por la combinación de programas probados unitariamente\",\n \"Decide qué acciones tomar cuando se descubren problemas\",\n \"Verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Identificar errores introducidos por la combinación de programas probados unitariamente\");\n this.addQuestion(q14);\n Question q15 = new Question(\"¿Cúal es la descripción de la Prueba?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\");\n this.addQuestion(q15);\n Question q16 = new Question(\"Por cada caso de prueba ejecutado:\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Comparar el resultado esperado con el resultado obtenido\", \"Comparar el resultado esperado con el resultado obtenido\");\n this.addQuestion(q16);\n //preguntas del quiz VI\n Question q17 = new Question(\n \"Este tipo de pruebas sirven para garantizar que la calidad del código es realmente óptima:\",\n \"Pruebas Unitarias\", \"Pruebas de Calidad de Código\",\n \"Pruebas de Regresión\", \"Pruebas de Calidad de Código\");\n this.addQuestion(q17);\n Question q18 = new Question(\"Pruebas de Calidad de código sirven para: \",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Verificar que las especificaciones de diseño sean alcanzadas\",\n \"Garantizar la probabilidad de tener errores o bugs en la codificación\", \"Garantizar la probabilidad de tener errores o bugs en la codificación\");\n this.addQuestion(q18);\n Question q19 = new Question(\"Este análisis nos indica el porcentaje que nuestro código desarrollado ha sido probado por las pruebas unitarias\",\n \"Cobertura\", \"Focalización\", \"Regresión\", \"Cobertura\");\n this.addQuestion(q19);\n\n Question q20 = new Question( \"¿Qué significa V(G)?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Regiones\");\n this.addQuestion(q20);\n\n Question q21 = new Question( \"¿Qué significa A?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Aristas\");\n this.addQuestion(q21);\n\n Question q22 = new Question( \"¿Qué significa N?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Nodos\");\n this.addQuestion(q22);\n\n Question q23 = new Question( \"¿Qué significa P?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos Predicado\", \"Número de Nodos Predicado\");\n this.addQuestion(q23);\n Question q24 = new Question( \"De cuantás formas se puede calcular la complejidad ciclomatica V(G):\",\n \"3\", \"1\", \"2\", \"3\");\n this.addQuestion(q24);\n\n // END\n }", "public void setAnswerList(ArrayList<String> answerList){\n this.answerList = answerList;\n }", "public void checkDuplicate (ArrayList studentAnswer, int answer) {\r\n if (!studentAnswer.contains(answer)){\r\n studentAnswer.add(answer);\r\n }\r\n }", "public void answer(Properties answers) {\n/* 56 */ setAnswer(answers);\n/* 57 */ QuestionParser.parseManageAllianceQuestion(this);\n/* */ }", "void add(String question, long time, boolean correct);", "@Override\n public void add(Question q) {\n try {\n c = DBConncetion.getConnection();\n int type = q.getType() == MultipleChoice ? 1 : 2; // 1 = MC , 2 = FB\n System.out.println(type);\n String sql = \"Insert into mainquestion \\n\" +\n \"Values (?,?,?,?,0,0,0)\";\n PreparedStatement pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,q.getTitle());\n pstmt.setString(3,String.valueOf(q.getTime()));\n pstmt.setString(4,String.valueOf(type));\n pstmt.executeUpdate();\n if (type == 1) {\n sql = \"Insert into multiplechoice \\n\" +\n \"Values (?,?,?,?,?,?)\";\n MultipleChoice mc = (MultipleChoice) q;\n String[] answers = mc.getAnswers();\n pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,answers[0]);\n pstmt.setString(3,answers[1]);\n pstmt.setString(4,answers[2]);\n pstmt.setString(5,answers[3]);\n pstmt.setString(6,mc.getCorrectAnswers());\n pstmt.executeUpdate();\n } else {\n sql = \"Insert into fill_blank Values(?,?)\";\n FillBlank fb = (FillBlank) q;\n pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,fb.getCorrectAnswer());\n pstmt.executeUpdate();\n }\n } catch (Exception e) {\n throw new LoadSaveException(\"Error while adding\");\n }\n }", "private void enterAnswers() {\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Please enter numbers:\");\n\t\tfor(int i = 0; i < numberAmt; i++)\n\t\t\tanswers.add(input.next());\n\t}", "public void setAnswer(String answer) {\r\n this.answer = answer;\r\n }", "@Override\n\tpublic Questions addQuestions(long testId, Questions question) throws TestMSException {\n\t\treturn null;\n\t}", "public void setSingleChoices() {\r\n Random randomGenerator = new Random();\r\n int singleAnswer = randomGenerator.nextInt(4);\r\n studentAnswer.add(singleAnswer); }", "public void addPatientToList(Patient tempPatient)\r\n\t{\r\n\t\tarrayPatients[nextPatientLocation] = tempPatient;\r\n\t\tnextPatientLocation++;\r\n\t}", "void addQuest(Question quest){\r\n\t\t//if the test bank does not contain this topic, create a new one and add question\r\n\t\tif(!bank.containsKey(quest.getTopic())){\r\n\t\t\tquest.setID(0);\r\n\t\t\tbank.put(quest.getTopic(), new ArrayList<Question>());\r\n\t\t\tbank.get(quest.getTopic()).add(quest);\r\n\t\t}else{\r\n\t\t\tquest.setID(bank.get(quest.getTopic()).size());\r\n\t\t\tbank.get(quest.getTopic()).add(quest);\r\n\t\t}\r\n\t}", "public void addQuestion(Question question) {\n \t\tquestion.setId(questionIdCounter);\n \t\tquestions.add(question);\n \t\tquestionIdCounter++;\n \t}", "public void addQuestion(Question question) {\n\t\tquestions.add(question);\n\t}", "private void addQuestion(Questions question) {\n ContentValues cv = new ContentValues();\n cv.put(QuestionsTable.Column_Question, question.getQuestion());\n cv.put(QuestionsTable.Column_Option1, question.getOption1());\n cv.put(QuestionsTable.Column_Option2, question.getOption2());\n cv.put(QuestionsTable.Column_Option3, question.getOption3());\n cv.put(QuestionsTable.Column_Option4, question.getOption4());\n cv.put(QuestionsTable.Column_Answer_Nr, question.getAnswerNr());\n db.insert(QuestionsTable.Table_name, null, cv);\n }", "public void setAnswer(String newAnswer){\n this.answer = newAnswer; \n }", "public void answerQuestion(){\n for (int i = 0; i < questionList.size(); i++){\r\n if (questionList.get(i).question.startsWith(\"How\")){\r\n howQuestions.add(new Question(questionList.get(i).id, questionList.get(i).question, questionList.get(i).answer));\r\n }\r\n }\r\n\r\n // Print All When Questions\r\n System.out.println(\"How Questions\");\r\n for (int i = 0; i < howQuestions.size(); i++){\r\n System.out.println(howQuestions.get(i).question);\r\n }\r\n\r\n //==== Question Entities ====\r\n // Split All When Question to only questions that have the entities\r\n if (!howQuestions.isEmpty()){\r\n if (!questionEntities.isEmpty()){\r\n for (int c = 0; c < questionEntities.size(); c++){\r\n for (int i = 0; i < howQuestions.size(); i++){\r\n if (howQuestions.get(i).question.contains(questionEntities.get(c))){\r\n answers.add(new Question(howQuestions.get(i).id, howQuestions.get(i).question, howQuestions.get(i).answer));\r\n }\r\n }\r\n }\r\n }\r\n else{\r\n if (!questionTags.isEmpty()){\r\n for (int c = 0; c < questionTags.size(); c++){\r\n for (int i = 0; i < howQuestions.size(); i++){\r\n if (howQuestions.get(i).question.contains(questionTags.get(c))){\r\n answers.add(new Question(howQuestions.get(i).id, howQuestions.get(i).question, howQuestions.get(i).answer));\r\n }\r\n }\r\n }\r\n }\r\n else{\r\n System.out.println(\"There no answer for your question !\");\r\n System.exit(0);\r\n }\r\n }\r\n }\r\n\r\n // Print All Entities Questions\r\n System.out.println(\"Questions of 'How' that have entities and tags :\");\r\n for (int i = 0; i < answers.size(); i++){\r\n for (int j = 1; j < answers.size(); j++){\r\n if (answers.get(i).id == answers.get(j).id){\r\n answers.remove(j);\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < answers.size(); i++){\r\n System.out.println(answers.get(i).question);\r\n }\r\n\r\n\r\n //==== Question Tags ====\r\n for (int i = 0; i < questionTags.size(); i++){\r\n for (int k = 0; k < answers.size(); k++){\r\n if (answers.get(k).question.contains(questionTags.get(i))){\r\n continue;\r\n }\r\n else{\r\n answers.remove(k);\r\n }\r\n }\r\n }\r\n }", "public void submitAnswer(String question, ArrayList<Integer> choices) {\r\n Question currentQuestion = new Question(question, choices);\r\n\r\n // 6 options, multiple answers\r\n if (currentQuestion.getSize() == 6) {\r\n setMultChoices();\r\n System.out.println(studentID + \" : \" + studentAnswer);\r\n }\r\n // 4 options, only accept single answer\r\n else if (currentQuestion.getSize() == 4){\r\n setSingleChoices();\r\n System.out.println(studentID + \" : \" + studentAnswer);\r\n }\r\n // 2 options, either true or false answer\r\n else {\r\n setTFChoices();\r\n System.out.println(studentID + \" : \" + studentAnswer);\r\n }\r\n\r\n // jump to changeAnswers to check if student wants to change answer\r\n changeAnswers(question, choices);\r\n }", "public boolean addPaient(Patient patient) throws TooManyExceptions;", "public void question() {\n\t\tlead.answer(this);\n\t}", "public void addQuestion(Question a) {\n quesCollec.add(a);\n }", "@RequestMapping(value = \"/addQuestionToTestTeacher/{testId}\",method = RequestMethod.POST)\n\tpublic Test addQuestionToTest(@PathVariable(\"testId\") int testid ,@RequestBody List<Questions> questionList){\n\t\tTest test = testDao.gettestStatus(testid);\n\t\tif(test!=null) {\n\t\t\tList<Questions> availableQuestions = (List<Questions>) test.getQuestions();\n\t\t\tif(availableQuestions.size()>0) {\n\t\t\t\tavailableQuestions.addAll(questionList);\n\t\t\t}else {\n\t\t\t\ttest.setQuestions(questionList);\n\t\t\t}\n\t\t\ttest = testDao.updateTest(test);\n\t\t}\n\t\t\n\t\treturn test;\n\t}", "private List<String> answerType(Question currentQuestion) {\n List<String> answers = new ArrayList<String>();\n\n if (currentQuestion.getTypeOfQuestion() == QuestionTypes.ESSAY || currentQuestion.getTypeOfQuestion() == QuestionTypes.MULTI_CHOICE) {\n System.out.println(\"Single Answer :\" + singleAnswer);\n answers.add(singleAnswer);\n } else {\n System.out.println(\"Multi Answer :\" + multiAnswers);\n answers = multiAnswers;\n }\n return answers;\n }", "@Override\n\tpublic void addPatients(String name, int id, Long mobilenumber, int age) {\n\t\t\n\t}", "public void saveSurveyAnswer(HttpServletRequest request, Answers answers, long userId);", "public void addChoice(String _choice, boolean _correct)\n {\n m_choices.add(_choice);\n if (_correct) {\n // Convert choices.size() to string\n String choiceString = \"\" + m_choices.size();\n setAnswer(choiceString);\n }\n }", "private void addPatient(Patient patient) {\n Location location = mLocationTree.findByUuid(patient.locationUuid);\n if (location != null) { // shouldn't be null, but better to be safe\n if (!mPatientsByLocation.containsKey(location)) {\n mPatientsByLocation.put(location, new ArrayList<Patient>());\n }\n mPatientsByLocation.get(location).add(patient);\n }\n }", "public boolean add(Patient p) {\n\t\tif (currentTimeOccupied.plus(p.timeToHealth()).toMillis() <= timeLeftInDay.toMillis()) {\n\t\t\tpatients.add(p);\n\t\t\t//currentTimeOccupied = currentTimeOccupied.plus(p.timeToHealth());\n\t\t\ttimeLeftInDay = timeLeftInDay.minus(p.timeToHealth());\n\t\t\t\n\t\t\tif (patients.size() < MAX_PATIENTS) {\n\t\t\t\tSystem.out.println(\"Patient added to list! \" + p.timeToHealth().toMinutes() + \" minutes!\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"A patient has been booted to add this one!\");\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\telse {\n\t\t\tSystem.out.println(\"This doctor can't take this patient due to time constraints.\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\n\t}", "private void insertToSentList(Question question) {\r\n\t\tdListOfQuestions.append(new QuestionWithAns(question));\r\n\t\tbTreeOfQuestions.addNode(question.getQnNum(), question);\r\n\t}", "private void nextQuestion() {\n\n // increment current question index\n currentQuestionIndex++;\n\n // if the current question index is smaller than the size of the quiz list\n if (currentQuestionIndex < quizList.size()) {\n\n // clear the possible answers\n possibleAnswers.clear();\n\n // grab the definition of current question, assign the correct answer variable\n // and add it to the list of possible answers.\n definition = quizList.get(currentQuestionIndex)[0];\n correctAnswer = quizMap.get(definition);\n possibleAnswers.add(correctAnswer);\n\n // while there's less than 4 possible answers, get a random answer\n // and if it hasn't already been added, add it to the list.\n while (possibleAnswers.size() < 4) {\n String answer = quizList.get(new Random().nextInt(quizList.size() - 1))[1];\n if (!possibleAnswers.contains(answer)) {\n possibleAnswers.add(answer);\n }\n }\n\n // shuffle possible answers so they display in a random order\n Collections.shuffle(possibleAnswers);\n } else {\n // if the question index is out of bounds, set quiz as finished\n quizFinished = true;\n }\n }", "void addRecordToCache(DNSQuestion question, DNSRecord answer){\n cache.put(question, answer);\n System.out.println(\"Answer added to cache!\");\n }", "public Answer addAnswer(String description,String email, String password, String guest,String result) throws MeetingException{\n \tAnswer a = null;\n \t\n\t\tif(result.equals(\"no\")){\n\t\t\tSystem.out.println(\"Answer with Not attendance to Meeting to be added\");\n\t\t\ta = new Answer(false, Integer.parseInt(guest), AttendingResult.no, this.getMeeting(description), this.getUserFromUsersBy(email, password));\n\t\t}else{\n\t\t\tif(this.isUserInArrayLisyOfUsers(email, users)==false){\n\t \t\tthrow new UserNotFound();\n\t \t}else if(this.isMeetingInMeetingManager(description)==false){\n\t \t\tthrow new MeetingNotFound();\n\t \t}else if(this.isUserInMeetingGroup(email, description)==false){\n\t \t\tthrow new UserNotFoundInMG();\n\t \t}else if(this.thisAnswerExist(email, description)){\n\t \t\tthrow new AnswerAlreadyFoundForUserMeeting();\n\t \t}else if(Integer.parseInt(guest) > this.getMeeting(description).getGuestsPerMember()){\n\t \t\tthrow new AnswerExceedsGuestsPerMeeting();\n\t \t}\n\t \tif(this.getMeeting(description).isDraft()){\n\t \t\tSystem.out.println(\"This meeting is a draft. Please wait organizer confirmation\");\n\t \t}\n\t\t\tif(Integer.parseInt(guest) + 1 >= this.getMeeting(description).getAttendeeTotal()){\n\t\t\t\tif(this.getMeeting(description).getWaitList() == 0){\n\t\t\t\t\t\tthrow new MeetingIsFull();\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(\"The meeting is full but has waiting List. Wait in Waiting List\");\n\t\t\t\t\ta = new Answer(true, Integer.parseInt(guest), AttendingResult.WantASpot, this.getMeeting(description), this.getUserFromUsersBy(email, password));\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\ta = new Answer(true, Integer.parseInt(guest), AttendingResult.yes, this.getMeeting(description), this.getUserFromUsersBy(email, password));\n\t \t}\n\t\t}\n \tanswers.add(a);\n \treturn a;\n }", "public MultipleAnswerQuestion(String question ,boolean isSingleAnswered)\r\n {\r\n super(question,isSingleAnswered);\r\n this.answers = new ArrayList<>(); //Initializing the HashSet\r\n }", "public void addExercise(Exercise p) {\n exercises.add(p);\n }", "public void addQuestion(Question quest) {\n ContentValues values = new ContentValues();\n values.put(KEY_QUES, quest.getQUESTION());\n values.put(KEY_ANSWER, quest.getANSWER());\n values.put(KEY_OPTA, quest.getOPTA());\n values.put(KEY_OPTB, quest.getOPTB());\n values.put(KEY_OPTC, quest.getOPTC());\n // Inserting Row\n db.insert(TABLE_NAME_QUEST, null, values);\n }", "public void setQuestions(){\r\n question.setTestname(test.getText().toString());\r\n question.setQuestion(ques.getText().toString());\r\n question.setOption1(opt1.getText().toString());\r\n question.setOption2(opt2.getText().toString());\r\n question.setOption3(opt3.getText().toString());\r\n int num = Integer.parseInt(correct.getText().toString());\r\n question.setAnswerNumber(num);\r\n long check = db.addToDb(question);\r\n if(check == -1){\r\n Toast.makeText(getBaseContext(), \"Question already exists\", Toast.LENGTH_LONG).show();\r\n }else{\r\n Toast.makeText(getBaseContext(), \"Question added\", Toast.LENGTH_LONG).show();\r\n }\r\n }", "public void setAnswers(java.util.List<java.lang.CharSequence> value) {\n this.Answers = value;\n }", "private void creatingNewQuestion() {\r\n AbstractStatement<?> s;\r\n ListQuestions lq = new ListQuestions(ThemesController.getThemeSelected());\r\n switch ((String) typeQuestion.getValue()) {\r\n case \"TrueFalse\":\r\n // just to be sure the answer corresponds to the json file\r\n Boolean answer = CorrectAnswer.getText().equalsIgnoreCase(\"true\");\r\n s = new TrueFalse<>(Text.getText(), answer);\r\n break;\r\n\r\n case \"MCQ\":\r\n s = new MCQ<>(Text.getText(), TextAnswer1.getText(), TextAnswer2.getText(), TextAnswer3.getText(), CorrectAnswer.getText());\r\n break;\r\n\r\n default:\r\n s = new ShortAnswer<>(Text.getText(), CorrectAnswer.getText());\r\n break;\r\n }\r\n lq.addQuestion(new Question(s, ThemesController.getThemeSelected(), Difficulty.fromInteger((Integer) difficulty.getValue()) ));\r\n lq.writeJson(ThemesController.getThemeSelected());\r\n }", "public DnsMessage addQuestion(DnsQuestion question) {\n if (questions == null) {\n questions = new LinkedList<DnsQuestion>();\n }\n questions.add(question);\n return this;\n }", "@Override\n\tpublic void updataanswer(Integer id, AnswerCustom answerCustom) throws Exception {\n\t\t\n\t}", "public ArrayList<String> generateAnswers(){\r\n ArrayList<String> ans;\r\n if(qType==0){\r\n ans = new ArrayList(Arrays.asList(\"A\",\"B\",\"C\",\"D\",\"E\"));\r\n }\r\n else{\r\n ans = new ArrayList(Arrays.asList(\"Choice 1\",\"Choice 2\"));\r\n }\r\n return ans;\r\n }", "public static void updateList(Patient p) {\r\n \t\tpatientArray.add(p);\r\n \t\tlistModel.addElement(p.getFirstName());\r\n \t}", "public void setAnswerid(Integer answerid) {\n this.answerid = answerid;\n }", "public Respuesta addRespuesta(String resp, Pregunta p, Usuario autor);", "private void setAnswerForLastQuestion() {\n\n DbHelper dbhelper = new DbHelper(context);\n questionNo = questionNo + 1;\n QuizAnswer answer = new QuizAnswer();\n answer.setQuizId(quizId);\n answer.setQuestionId(questionId);\n int optionId = shareprefs.getInt(\"optionId\", 0);\n answer.setOptionId(optionId);\n int correctAns = shareprefs.getInt(\"correctAns\", 0);\n answer.setAnswer(correctAns);\n answer.setContentId(contentId);\n boolean flage = dbhelper.upsertQuizAnswerEntity(answer);\n if (flage) {\n shareprefs.edit().clear().commit();//clear select OptionPreferences\n Intent mIntent = new Intent(this, QuizResultActivity.class);\n mIntent.putExtra(\"quizId\", quizId);\n mIntent.putExtra(\"contentId\", contentId);\n mIntent.putExtra(\"totalQuestion\", questionList.size());\n startActivityForResult(mIntent,1);\n }\n }", "public void setAnswers(int answers) {\n this.answers = answers;\n }", "QuestionPick addPickDetail(Question question);", "public void add(Person p) {\r\n\t\tq.add(p);\r\n\t\tif(q.size() > maxQ)\r\n\t\t\tmaxQ = q.size();\r\n\t}", "public void createAnswerStatistics(int sid,int qid);", "public void create() {\n io.writeLine(\"Enter correct answer(T/F)\");\n String answer = io.readLine();\n while (!answer.equals(\"T\") && !answer.equals(\"F\")) {\n io.writeLine(\"Please put in T or F\");\n answer = io.readLine();\n }\n rightAnswers.add(answer);\n }", "public void setAnswersList(List<Answer> answersList) {\n this.answersList = answersList;\n }", "public ArrayList<AnswerElement> getAnswer() {\r\n\t\treturn ans;\r\n\t}", "public void addExamination(Examination examination){\n this.examinations.add(examination);\n }", "void addAnswers(AnswerDTO answerDTO) {\n\n\n sharedPreferences = getSharedPreferences(\"LoginData\", MODE_PRIVATE);\n String userId = sharedPreferences.getString(\"UserId\", \"\");\n answerDTO.setUserId(userId);\n\n qa_answerText = findViewById(R.id.qa_answerText);\n if(qa_answerText.getText().toString().trim().equals(\"\"))\n {\n Toast toast=Toast.makeText(getApplicationContext(),\"Please enter some text\",Toast.LENGTH_SHORT);\n toast.show();\n }\n else {\n answerDTO.setAnswerBody(qa_answerText.getText().toString());\n System.out.println(\"answer text:\" + qa_answerText.getText().toString());\n System.out.println(\"answer body:\" + answerDTO.getAnswerBody());\n\n quoraRetrofitService = RetrofitClientInstance.getRetrofitInstance().create(QuoraRetrofitService.class);\n System.out.println(\"Qid addAnswer: \" + answerDTO);\n\n Call<IdResponse> callAddAnswer = quoraRetrofitService.addAnswer(answerDTO);\n callAddAnswer.enqueue(new Callback<IdResponse>() {\n @Override\n public void onResponse(Call<IdResponse> call, Response<IdResponse> response) {\n if (response.body() != null) {\n System.out.println(\"OnResponse Add Answer\");\n final String message = response.body().getId();\n System.out.println(\"Message: \" + message);\n }\n }\n\n @Override\n public void onFailure(Call<IdResponse> call, Throwable t) {\n System.out.println(\"OnFailure Add Answer\" + t.getMessage());\n }\n });\n\n }\n\n }", "private void addSubquestionsWithCL(Question q, String oid, HashMap<String, String> ans, String t, boolean b, String qid_append)\n\t{\n\t\tList<String> sqids = getSqIds(q.getQid());\n\t\tfor (String sqid : sqids) {\n\t\t\tString question = q_l10ns_node.selectSingleNode(\"row[qid=\" + sqid + \"]/question\").getText();\n\t\t\tString sq_title = sq_node.selectSingleNode(\"row[qid=\" + sqid + \"]/title\").getText();\n\t\t\tQuestion sq = new Question(q.qid + sq_title + qid_append,\n\t\t\t\t\tq.gid,\n\t\t\t\t\t\"A\",\n\t\t\t\t\tq.question + \" \" + question,\n\t\t\t\t\tsqid,\n\t\t\t\t\tq.mandatory,\n\t\t\t\t\tq.language);\n\t\t\tsq.setHelp(q.help);\n\t\t\tsq.setAnswers(new AnswersList(oid, ans, t, b));\n\n\t\t\tsurvey.addQuestion(sq);\n\n\t\t\t// If the type is \"Multiple Choice with Comments\"\n\t\t\tif (q.getType().equals(\"P\")) {\n\t\t\t\t// Add comment question\n\t\t\t\taddComment(sq);\n\t\t\t}\n\t\t}\n\t}", "public void addQ (Question Q)\n {\n newQuestion = Q;\n \n enqueue();\n }", "public static com.jhu.cvrg.portal.survey.model.SurveyAnswer addSurveyAnswer(\n\t\tcom.jhu.cvrg.portal.survey.model.SurveyAnswer surveyAnswer)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getService().addSurveyAnswer(surveyAnswer);\n\t}", "public void storeDataTwo(String id, List<String> answers){\n JSONObject questionAnswers = new JSONObject();\n try\n {\n questionAnswers.put(\"usertestid\", id);\n SharedPreferences pref = this.getSharedPreferences(\"session_token\", Context.MODE_PRIVATE);\n String email = pref.getString(\"email\", null);\n questionAnswers.put(\"answered_by\", email);\n questionAnswers.put(\"answers\", answersArray);\n } catch (JSONException e){\n e.printStackTrace();\n }\n new AsyncPost().execute(\"http://webapp.bimorstad.tech/feedback/create\", questionAnswers.toString());\n }", "@Test\n void addAnswersToQuestionWhenQuestionIsGettingAdded(){\n quiz = new Quiz(69L, \"weeb quiz\", new ArrayList<>(), new User(),\"1\", new ArrayList<>());\n question = new Question(96L, new ArrayList<>(), new Quiz(), \"what's the monster inside of Yuji Itadori called?\");\n answer = new Answer(1L, \"Sukuna\", true, question);\n\n quizService.addQuiz(quiz, new User(42L, \"potato-san\", \"[email protected]\", \"iLovePotatoes420\", new ArrayList<>()));\n questionService.addQuestion(question, quiz);\n answerService.addAnswer(answer, question);\n\n String questionAnswer = \"Sukuna\";\n Optional<Question> questionNinetySix = questionService.getAllQuestions()\n .stream()\n .filter(q -> q.getQuestionId() == 96L)\n .findAny();\n\n if(questionNinetySix.isPresent()){\n String actualAnswer = questionNinetySix.get().getAnswers()\n .stream().findFirst().get().getAnswerContent();\n\n assertEquals(questionAnswer, actualAnswer);\n }\n }", "public void newApointment(Appointment ap){\n\n this.appointments.add(ap);\n }", "public static void insertAnswers(String username, int id, String answer) {\n\t\tString user = username;\n \ttry {\n \t\tint rs = Messages.connect().executeUpdate(\"INSERT INTO Answers (Q_id, B_Username, Answer)\" +\n \t \t\"VALUES ('\" + id + \"', '\" + user +\"', '\" + answer +\"')\");\n \t\tMessages.connect().close();\n \t} catch (Exception e) {\n \t\te.printStackTrace();\n \t}\n\t}", "public static void updateListAfterPatientEdit(int index, Patient p){\r\n \t\tpatientArray.remove(p);\r\n \t\tpatientArray.add(index, p);\r\n \t\t\r\n \t\tpatientList.clearSelection();\r\n \t\tpatientList.setSelectedIndex(index);\r\n \t\t\r\n \t\tlistModel.remove(index);\r\n \t\tlistModel.add(index, p.getFirstName());\r\n \t}", "int createSurvey(List<Question> questions, String userId);", "public void add(String patient, MedicalRecord m) {\n if (!database.containsKey(patient)) {\n database.put(patient, new ArrayList<MedicalRecord>());\n }\n database.get(patient).add(m);\n }", "private void patientSetBtnActionPerformed(java.awt.event.ActionEvent evt) {\n patientArr[patientI] = new patient(patientNameBox.getText(),\n Integer.parseInt(patientAgeBox.getText()),\n patientDiseaseBox.getText(),\n Integer.parseInt(patientIDBox.getText()));\n try {\n for (int i = 0; i < doc.length; i++) {\n if (patientDiseaseBox.getText().equalsIgnoreCase(doc[i].expertise)) {\n doc[i].newPatient(patientArr[patientI]);\n patientArr[patientI].docIndex = i;\n break;\n }\n }\n } catch (NullPointerException e) {\n for (int i = 0; i < doc.length; i++) {\n if (doc[i].expertise.equalsIgnoreCase(\"medicine\")) {\n doc[i].newPatient(patientArr[patientI]);\n\n }\n }\n }\n\n patientArr[patientI].due += 1000;\n\n patientI++;\n \n }", "@Override\n\tpublic Questions addQuestion(BigInteger testId, Questions question) throws UserException {\n\t\treturn null;\n\t}", "@Override\r\n public ArrayList<String> getAnswers() {\r\n return this.answers;\r\n }", "public ArrayList<String> getAnswerList(){\n if(answerList != null) {\n return answerList;\n }\n else{\n System.out.println(\"Answer list is undefined.\");\n return null;\n }\n }", "public void setAnswerId(int answerId) {\r\n this.answerId = answerId;\r\n }", "private void setAnswer() {\n DbHelper dbhelper = new DbHelper(context);\n questionNo = questionNo + 1;\n QuizAnswer answer = new QuizAnswer();\n answer.setQuizId(quizId);\n answer.setQuestionId(questionId);\n int optionId = shareprefs.getInt(\"optionId\", 0);\n answer.setOptionId(optionId);\n int correctAns = shareprefs.getInt(\"correctAns\", 0);\n answer.setAnswer(correctAns);\n answer.setContentId(contentId);\n boolean flage = dbhelper.upsertQuizAnswerEntity(answer);\n if (flage) {\n shareprefs.edit().clear().commit();//clear select OptionPreferences\n setValue();\n }\n }", "public void createQuestion(int sid,int qid,String qtype,String qtitle,String answer_a,String answer_b,String answer_c,String answer_d);", "public void printAnswerList(){\n if(answerList.isEmpty()){\n System.out.println(\"Answer list is empty.\");\n }\n else {\n for (int i = 1; i < answerList.size() + 1; i++) {\n System.out.println(i + \") \" + answerList.get(i - 1));\n }\n }\n }", "public void AddQuestionToBank(ActionEvent actionEvent) throws IOException {\n QuestionModel questionModel = new QuestionModel();\n ArrayList<QuestionModel> questionBank = DBObject.getInstance().getQuestionBank();\n if(questionName.getText() != null && question.getText() != null && subjects.getValue() != null){\n if(className.getValue() != null && answer.getText() != null){\n if (easy.isSelected() || medium.isSelected() || hard.isSelected()) {\n questionModel.setQuestionName(questionName.getText());\n questionModel.setPointsPossible(Integer.parseInt(points.getText()));\n questionModel.setClassNumber(className.getValue().toString());\n questionModel.setSubject(subjects.getValue().toString());\n questionModel.setQuestion(question.getText());\n questionModel.getQuestionHelper().setAnswer(answer.getText());\n questionModel.setHint(hint.getText());\n if(easy.isSelected()){\n questionModel.setDifficulty(1);\n }\n else if(medium.isSelected()){\n questionModel.setDifficulty(2);\n }\n else if(hard.isSelected()){\n questionModel.setDifficulty(3);\n }\n SetUpNewView(questionBank, questionModel);\n }\n }\n }\n }", "public static List<NewPatient> checkrepeatition(List<NewPatient> patientsList, NewPatient selectedPatient) {\n\n if (!isPatientExist(patientsList, selectedPatient)) {\n patientsList.add(selectedPatient);\n }\n\n return patientsList;\n }", "@SuppressWarnings(\"rawtypes\")\n\tpublic AddSurveyForApplicant() {\n\t\tif (getSession().getAttribute(\"isLogin\").equals(\"false\")) {\n\t\t\tsetResponsePage(Authentication.class);\n\t\t\treturn;\n\t\t}\n\t\tif (getSession().getAttribute(\"personTyp\").equals(\"a\")) {\n\t\t\tsetResponsePage(PersonTyp.class);\n\t\t\treturn;\n\t\t}\n\n\t\tLong id = Long.valueOf(getSession().getAttribute(\"id\").toString());\n\n\t\tp = ps.find(id);\n\n\t\tString url = RequestCycle.get().getRequest().getUrl().toString();\n\t\tString[] idFromUrl = url.split(\"/\");\n\t\tfinal Long receiverID = Long.valueOf(idFromUrl[3]);\n\t\tfinal IApplicant applicant = (IApplicant) ps.find(receiverID);\n\n\t\t// final IApplicant applicant\n\t\tList<ISurvey> surveys = new ArrayList<ISurvey>();\n\t\tsurveys = ss.loadAllServeyByEmployer(id);\n\t\tlogger.info(\"surveyes loaded, size: \" + surveys.size());\n\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tPageableListView surveyView = new PageableListView(\"surveys\", surveys,\n\t\t\t\t6) {\n\t\t\t/**\n\t\t\t * \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 53780096350876440L;\n\n\t\t\t@Override\n\t\t\tprotected void populateItem(ListItem item) {\n\t\t\t\tISurvey survey = (ISurvey) item.getModelObject();\n\t\t\t\titem.add(new Label(\"date\", \"Date: \" + survey.getDate()));\n\t\t\t\titem.add(new Label(\"name\", \"Survey: \" + survey.getName()));\n\t\t\t\titem.add(new Label(\"text\", \"Info: \" + survey.getText()));\n\t\t\t\tString fragmentId = null;\n\t\t\t\tif (ss.loadAppSurveyByApplicantAndSurvey(\n\t\t\t\t\t\t((IPerson) applicant).getId(), survey.getId()).size() == 0) {\n\t\t\t\t\tfragmentId = \"variant_add\";\n\t\t\t\t\titem.add(new FragmentForAddSurvey(\n\t\t\t\t\t\t\t\"placeholderForFragmente\", fragmentId, this,\n\t\t\t\t\t\t\tapplicant, survey));\n\t\t\t\t\tlogger.info(\"Varinat add, size = 0\");\n\t\t\t\t}\n\t\t\t\tif (ss.loadAppSurveyByApplicantAndSurvey(\n\t\t\t\t\t\t((IPerson) applicant).getId(), survey.getId()).size() > 0) {\n\t\t\t\t\tfragmentId = \"variant_has\";\n\t\t\t\t\tlogger.info(\"Varinat has, size > 0\");\n\t\t\t\t\titem.add(new FragmentAlreadySend(\"placeholderForFragmente\",\n\t\t\t\t\t\t\tfragmentId, this));\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tadd(new FeedbackPanel(\"feedback\"));\n\t\tadd(surveyView);\n\t\tadd(new PagingNavigator(\"navigator\", surveyView));\n\n\t}", "protected void constructNewQuestion(){\n arabicWordScoreItem = wordScoreTable.whatWordToLearn();\n arabicWord = arabicWordScoreItem.word;\n correctAnswer = dictionary.get(arabicWord);\n\n for (int i=0;i<wrongAnswers.length;i++){\n int wrongAnswerId;\n String randomArabicWord;\n String wrongAnswer;\n do {\n wrongAnswerId = constructQuestionRandom.nextInt(next_word_index);\n randomArabicWord = dictionary_key_list.get(wrongAnswerId);\n wrongAnswer = dictionary.get(randomArabicWord);\n } while (wrongAnswer.equals(correctAnswer));\n wrongAnswers[i] = wrongAnswer;\n }\n }", "public Results(ArrayList<String> list_Question_and_Answers, ArrayList<String> list_correct_answers){\n\t\t\tthis.list_Question_and_Answers = list_Question_and_Answers;\n\t\t\tthis.list_correct_answers = list_correct_answers;\n\t\t}", "public com.example.DNSLog.Builder setAnswers(java.util.List<java.lang.CharSequence> value) {\n validate(fields()[20], value);\n this.Answers = value;\n fieldSetFlags()[20] = true;\n return this;\n }" ]
[ "0.7742983", "0.7580539", "0.74334913", "0.74326485", "0.71915084", "0.6991407", "0.69699365", "0.6904292", "0.68483573", "0.6835915", "0.67260784", "0.6725295", "0.66842264", "0.65206254", "0.63380796", "0.6259477", "0.6219937", "0.6208152", "0.61172754", "0.6098837", "0.6079736", "0.60376596", "0.60130644", "0.60051674", "0.5996005", "0.5983917", "0.58854645", "0.58617604", "0.58595175", "0.58433145", "0.58113164", "0.5769697", "0.5766236", "0.5765624", "0.5744706", "0.57403237", "0.5736418", "0.5736182", "0.5729735", "0.5702835", "0.5700807", "0.56901217", "0.56864864", "0.56619513", "0.56305474", "0.5611604", "0.56100917", "0.5590916", "0.55820364", "0.55816334", "0.55750877", "0.5569085", "0.5565347", "0.5563796", "0.55421364", "0.5537461", "0.5536847", "0.55294675", "0.5519368", "0.54793185", "0.5476121", "0.54734194", "0.54567254", "0.5452999", "0.5451834", "0.5442215", "0.54395825", "0.543102", "0.5421472", "0.54158205", "0.5405059", "0.5404834", "0.53875023", "0.53853387", "0.5381185", "0.53793645", "0.53732073", "0.5369185", "0.5364015", "0.5352912", "0.53466696", "0.5345785", "0.5343891", "0.53428066", "0.53327113", "0.5332137", "0.5330954", "0.53288466", "0.53223836", "0.5310232", "0.5309477", "0.530445", "0.5298828", "0.52891004", "0.52851087", "0.5283478", "0.5280596", "0.5274118", "0.52725303", "0.5270652" ]
0.62877834
15
add the patient answer to the answer list
public void saveAnswer(Element element, boolean patientAnswer, String patientAnswerStr){ getTestAnswers().add( new TestAnswer(patientAnswer, element, patientAnswerStr) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void addQuestionAnswer(Answer answer);", "void addAnswer(Answer answer);", "@Override\r\n public void addAnswer(String answer) {\r\n this.answers.add(answer);\r\n }", "public void addAnswer(Answer ans) {\n // TODO implement here\n }", "public void addAnswer(Answer answer) {\n \t\tanswer.setId(answerIdCounter);\n \t\tanswers.add(answer);\n \t\tanswerIdCounter++;\n \t}", "@Override\n public void add(String question, String answer){\n questions.add(question);\n answers.add(answer);\n\n }", "public void addQuestionAndAnswer(String question, String answer){\n this.questionList.add(question);\n this.answerList.add(answer);\n }", "public void addAnswer(AnswerElement ans) {\r\n\t\tthis.ans.add(ans);\r\n\t}", "public void add( IAnswer possibleAnswer );", "public DnsMessage addAnswer(DnsResource answer) {\n if (answers == null) {\n answers = new LinkedList<DnsResource>();\n }\n answers.add(answer);\n return this;\n }", "@Override\n public void addResponses() {\n for(answerChoice a: this.userAnswers) {\n this.addResponseHelper(a.getAnswerText());\n //this.savedResponses. //add(a.getAnswerText());\n //try {\n\n //} catch(Exception e) {\n // e.printStackTrace();\n\n //}\n\n }\n }", "void addQuestions(String surveyId, List<Question> questions);", "public void addAnsweredQuestions (int index) {\n\n\t\t_answeredQuestions[index]=_answeredQuestions[index]+1;\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm data/answered_questions\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/answered_questions\");\n\t\tString answeredQuestions = \"\";\n\t\tfor (int i = 0;i<5;i++) {\n\t\t\tansweredQuestions = answeredQuestions + \" \" + String.valueOf(_answeredQuestions[i]);\n\t\t}\n\t\tBashCmdUtil.bashCmdNoOutput(String.format(\"echo \\\"%s\\\" >> data/answered_questions\", answeredQuestions));\n\n\n\n\t}", "public void addQuestion(Question question);", "public void saveAnswer(long answerTime, Element element, boolean patientAnswer, String patientAnswerStr){\n getTestAnswers().add( new TestAnswer(answerTime, patientAnswer, element, patientAnswerStr) ); \r\n }", "void newAnswer (Integer q, Integer a) {\n\t\tif (results.get(q)==null) {\n\t\t\tArrayList<Integer> newEntry = new ArrayList<Integer>();\n\t\t\tnewEntry.add(a);\n\t\t\tresults.put(q, newEntry);\n\t\t} else {\n\t\t\t// append to existing list\n\t\t\tresults.get(q).add(a);\n\t\t}\n\t}", "public void addPatient()\n {\n Scanner sc=new Scanner(System.in);\n System.out.println(\"Enter name of patient\");\n String name=sc.nextLine();\n int pos,id;\n\n do\n {\n System.out.println(\"Enter doctor id to assign to\");\n id=sc.nextInt();\n pos=checkDoctor(id);\n if(pos==-1)\n System.out.println(\"Invalid doctor id\");\n }\n while(pos==-1);\n String docname=doc.get(pos).getName();\n Patient p=new Patient(name,id,docname);\n pt.add(p);\n\n }", "private void addQuestion() {\n if (modifiable()) {\n try {\n this.questions.add(Question.fromInput(gradeable()));\n } catch (UserInputException e) {\n System.err.println(e.getMessage());\n }\n } else {\n System.err.println(\"Can not modify this by add a question.\");\n }\n }", "public void setAnswer(int index, String answer){\n answerList.set(index, answer);\n }", "public void addQuestion()\r\n\t{\r\n\t\tScanner in = new Scanner (System.in);\r\n\t\tString question, a1, a2, a3, a4, correctAnswer;\r\n\r\n\t\tSystem.out.println(\"Please enter a question: \");\r\n\t\tquestion = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter answer choice #1: \");\r\n\t\ta1 = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter answer choice #2: \");\r\n\t\ta2 = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter answer choice #3: \");\r\n\t\ta3 = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter answer choice #4: \");\r\n\t\ta4 = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter the correct answer (number): \");\r\n\t\tcorrectAnswer = in.nextLine();\r\n\t\t\r\n\t\t//checks input\r\n\t\twhile( !( correctAnswer.equalsIgnoreCase(\"1\") || correctAnswer.equalsIgnoreCase(\"2\") || correctAnswer.equalsIgnoreCase(\"3\") || correctAnswer.equalsIgnoreCase(\"4\") ) )\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Invalid entry. Enter again:\");\r\n\t\t\tcorrectAnswer = in.nextLine();\r\n\t\t}\r\n\t\tQuestion q = new Question ( question, a1, a2, a3, a4, correctAnswer );\r\n\t\t\r\n\t\tquestions.add(q);\r\n\t}", "public void addQuestions() {\n\t\tboolean addNewQuestion = true;\n\t\tString text;\n\t\tQuestion q;\n\t\tString promptResponse;\n\t\t\n\t\twhile (addNewQuestion) {\n\t\t\tSystem.out.print(\"Enter question: \");\n\t\t\ttext = System.console().readLine();\n\t\t\tq = new QuestionImpl(questionId, text);\n\t\t\tthis.questionId++;\n\t\t\tq.addAnswers();\n\t\t\tthis.questions.add(q);\n\n\t\t\tSystem.out.print(\"Hit Return to add another question or q to quit: \");\n\t\t\tpromptResponse = System.console().readLine();\n\t\t\tif (promptResponse.equals(\"q\") ||\n\t\t\t\t\tpromptResponse.equals(\"Q\") ||\n\t\t\t\t\tpromptResponse.equals(\"quit\") ||\n\t\t\t\t\tpromptResponse.equals(\"Quit\")) {\n\t\t\t\taddNewQuestion = false;\n\t\t\t}\n\t\t}\n\t}", "public void addAnswer(Group group, Question question, Answer answer, LocalDateTime date) {\n \tGroup realGroup = answer.getQuestion().getGroup();\n \tif(realGroup != null)\n \t\tif(!realGroup.getTitle().equals(group.getTitle()))\n \t\t\treturn;\n \tMembership temp = memberships.get(group.getTitle());\n \tif(temp == null)\n \t\treturn;\n \tanswer.setMembership(temp);\n temp.addAnswer(answer);\n question.addAnswer(answer);\n group.addAnswer(answer);\n }", "private void addQuestion() {\n Question q = new Question(\n \"¿Quien propuso la prueba del camino básico ?\", \"Tom McCabe\", \"Tom Robert\", \"Tom Charlie\", \"Tom McCabe\");\n this.addQuestion(q);\n\n\n Question q1 = new Question(\"¿Qué es una prueba de Caja negra y que errores desean encontrar en las categorías?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \" determina la funcionalidad del sistema\", \" determina la funcionalidad del sistema\");\n this.addQuestion(q1);\n Question q2 = new Question(\"¿Qué es la complejidad ciclomática es una métrica de calidad software?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \"basada en el cálculo del número\", \"basada en el cálculo del número\");\n this.addQuestion(q2);\n //preguntas del quiz II\n Question q3=new Question(\"Las pruebas de caja blanca buscan revisar los caminos, condiciones, \" +\n \"particiones de control y datos, de las funciones o módulos del sistema; \" +\n \"para lo cual el grupo de diseño de pruebas debe:\",\n \"Conformar un grupo de personas para que use el sistema nuevo\",\n \"Ejecutar sistema nuevo con los datos usados en el sistema actual\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\");\n this.addQuestion(q3);\n Question q4=new Question(\"¿Las pruebas unitarias son llamadas?\",\n \"Pruebas del camino\", \"Pruebas modulares\",\n \"Pruebas de complejidad\", \"Pruebas modulares\");\n this.addQuestion(q4);\n Question q5=new Question(\"¿Qué es una prueba de camino básico?\",\n \"Hace una cobertura de declaraciones del código\",\n \"Permite determinar si un modulo esta listo\",\n \"Técnica de pueba de caja blanca\",\n \"Técnica de pueba de caja blanca\" );\n this.addQuestion(q5);\n Question q6=new Question(\"Prueba de camino es propuesta:\", \"Tom McCabe\", \"McCall \", \"Pressman\",\n \"Tom McCabe\");\n this.addQuestion(q6);\n Question q7=new Question(\"¿Qué es complejidad ciclomatica?\",\"Grafo de flujo\",\"Programming\",\n \"Metrica\",\"Metrica\");\n this.addQuestion(q7);\n //preguntas del quiz III\n Question q8 = new Question(\n \"¿Se le llama prueba de regresión?\", \"Se tienen que hacer nuevas pruebas donde se han probado antes\",\n \"Manten informes detallados de las pruebas\", \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\");\n this.addQuestion(q8);\n Question q9 = new Question(\"¿Cómo se realizan las pruebas de regresión?\",\n \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\", \"A través de herramientas de automatización de pruebas\", \"A través de herramientas de automatización de pruebas\");\n this.addQuestion(q9);\n Question q10 = new Question(\"¿Cuándo ya hay falta de tiempo para ejecutar casos de prueba ya ejecutadas se dejan?\",\n \"En primer plano\", \"En segundo plano\", \"En tercer plano\", \"En segundo plano\");\n this.addQuestion(q10);\n //preguntas del quiz IV\n Question q11 = new Question(\n \"¿En qué se enfocan las pruebas funcionales?\",\n \"Enfocarse en los requisitos funcionales\", \"Enfocarse en los requisitos no funcionales\",\n \"Verificar la apropiada aceptación de datos\", \"Enfocarse en los requisitos funcionales\");\n this.addQuestion(q11);\n Question q12 = new Question(\"Las metas de estas pruebas son:\", \"Verificar la apropiada aceptación de datos\",\n \"Verificar el procesamiento\", \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\",\n \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\");\n this.addQuestion(q12);\n Question q13 = new Question(\"¿En qué estan basadas este tipo de pruebas?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Técnicas de cajas negra\", \"Técnicas de cajas negra\");\n this.addQuestion(q13);\n //preguntas del quiz V\n Question q14 = new Question(\n \"¿Cúal es el objetivo de esta técnica?\", \"Identificar errores introducidos por la combinación de programas probados unitariamente\",\n \"Decide qué acciones tomar cuando se descubren problemas\",\n \"Verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Identificar errores introducidos por la combinación de programas probados unitariamente\");\n this.addQuestion(q14);\n Question q15 = new Question(\"¿Cúal es la descripción de la Prueba?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\");\n this.addQuestion(q15);\n Question q16 = new Question(\"Por cada caso de prueba ejecutado:\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Comparar el resultado esperado con el resultado obtenido\", \"Comparar el resultado esperado con el resultado obtenido\");\n this.addQuestion(q16);\n //preguntas del quiz VI\n Question q17 = new Question(\n \"Este tipo de pruebas sirven para garantizar que la calidad del código es realmente óptima:\",\n \"Pruebas Unitarias\", \"Pruebas de Calidad de Código\",\n \"Pruebas de Regresión\", \"Pruebas de Calidad de Código\");\n this.addQuestion(q17);\n Question q18 = new Question(\"Pruebas de Calidad de código sirven para: \",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Verificar que las especificaciones de diseño sean alcanzadas\",\n \"Garantizar la probabilidad de tener errores o bugs en la codificación\", \"Garantizar la probabilidad de tener errores o bugs en la codificación\");\n this.addQuestion(q18);\n Question q19 = new Question(\"Este análisis nos indica el porcentaje que nuestro código desarrollado ha sido probado por las pruebas unitarias\",\n \"Cobertura\", \"Focalización\", \"Regresión\", \"Cobertura\");\n this.addQuestion(q19);\n\n Question q20 = new Question( \"¿Qué significa V(G)?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Regiones\");\n this.addQuestion(q20);\n\n Question q21 = new Question( \"¿Qué significa A?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Aristas\");\n this.addQuestion(q21);\n\n Question q22 = new Question( \"¿Qué significa N?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Nodos\");\n this.addQuestion(q22);\n\n Question q23 = new Question( \"¿Qué significa P?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos Predicado\", \"Número de Nodos Predicado\");\n this.addQuestion(q23);\n Question q24 = new Question( \"De cuantás formas se puede calcular la complejidad ciclomatica V(G):\",\n \"3\", \"1\", \"2\", \"3\");\n this.addQuestion(q24);\n\n // END\n }", "public void setAnswerList(ArrayList<String> answerList){\n this.answerList = answerList;\n }", "public void checkDuplicate (ArrayList studentAnswer, int answer) {\r\n if (!studentAnswer.contains(answer)){\r\n studentAnswer.add(answer);\r\n }\r\n }", "public void answer(Properties answers) {\n/* 56 */ setAnswer(answers);\n/* 57 */ QuestionParser.parseManageAllianceQuestion(this);\n/* */ }", "void add(String question, long time, boolean correct);", "@Override\n public void add(Question q) {\n try {\n c = DBConncetion.getConnection();\n int type = q.getType() == MultipleChoice ? 1 : 2; // 1 = MC , 2 = FB\n System.out.println(type);\n String sql = \"Insert into mainquestion \\n\" +\n \"Values (?,?,?,?,0,0,0)\";\n PreparedStatement pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,q.getTitle());\n pstmt.setString(3,String.valueOf(q.getTime()));\n pstmt.setString(4,String.valueOf(type));\n pstmt.executeUpdate();\n if (type == 1) {\n sql = \"Insert into multiplechoice \\n\" +\n \"Values (?,?,?,?,?,?)\";\n MultipleChoice mc = (MultipleChoice) q;\n String[] answers = mc.getAnswers();\n pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,answers[0]);\n pstmt.setString(3,answers[1]);\n pstmt.setString(4,answers[2]);\n pstmt.setString(5,answers[3]);\n pstmt.setString(6,mc.getCorrectAnswers());\n pstmt.executeUpdate();\n } else {\n sql = \"Insert into fill_blank Values(?,?)\";\n FillBlank fb = (FillBlank) q;\n pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,fb.getCorrectAnswer());\n pstmt.executeUpdate();\n }\n } catch (Exception e) {\n throw new LoadSaveException(\"Error while adding\");\n }\n }", "private void enterAnswers() {\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Please enter numbers:\");\n\t\tfor(int i = 0; i < numberAmt; i++)\n\t\t\tanswers.add(input.next());\n\t}", "public void setAnswer(String answer) {\r\n this.answer = answer;\r\n }", "@Override\n\tpublic Questions addQuestions(long testId, Questions question) throws TestMSException {\n\t\treturn null;\n\t}", "public void setSingleChoices() {\r\n Random randomGenerator = new Random();\r\n int singleAnswer = randomGenerator.nextInt(4);\r\n studentAnswer.add(singleAnswer); }", "public void addPatientToList(Patient tempPatient)\r\n\t{\r\n\t\tarrayPatients[nextPatientLocation] = tempPatient;\r\n\t\tnextPatientLocation++;\r\n\t}", "void addQuest(Question quest){\r\n\t\t//if the test bank does not contain this topic, create a new one and add question\r\n\t\tif(!bank.containsKey(quest.getTopic())){\r\n\t\t\tquest.setID(0);\r\n\t\t\tbank.put(quest.getTopic(), new ArrayList<Question>());\r\n\t\t\tbank.get(quest.getTopic()).add(quest);\r\n\t\t}else{\r\n\t\t\tquest.setID(bank.get(quest.getTopic()).size());\r\n\t\t\tbank.get(quest.getTopic()).add(quest);\r\n\t\t}\r\n\t}", "public void addQuestion(Question question) {\n \t\tquestion.setId(questionIdCounter);\n \t\tquestions.add(question);\n \t\tquestionIdCounter++;\n \t}", "public void addQuestion(Question question) {\n\t\tquestions.add(question);\n\t}", "private void addQuestion(Questions question) {\n ContentValues cv = new ContentValues();\n cv.put(QuestionsTable.Column_Question, question.getQuestion());\n cv.put(QuestionsTable.Column_Option1, question.getOption1());\n cv.put(QuestionsTable.Column_Option2, question.getOption2());\n cv.put(QuestionsTable.Column_Option3, question.getOption3());\n cv.put(QuestionsTable.Column_Option4, question.getOption4());\n cv.put(QuestionsTable.Column_Answer_Nr, question.getAnswerNr());\n db.insert(QuestionsTable.Table_name, null, cv);\n }", "public void setAnswer(String newAnswer){\n this.answer = newAnswer; \n }", "public void answerQuestion(){\n for (int i = 0; i < questionList.size(); i++){\r\n if (questionList.get(i).question.startsWith(\"How\")){\r\n howQuestions.add(new Question(questionList.get(i).id, questionList.get(i).question, questionList.get(i).answer));\r\n }\r\n }\r\n\r\n // Print All When Questions\r\n System.out.println(\"How Questions\");\r\n for (int i = 0; i < howQuestions.size(); i++){\r\n System.out.println(howQuestions.get(i).question);\r\n }\r\n\r\n //==== Question Entities ====\r\n // Split All When Question to only questions that have the entities\r\n if (!howQuestions.isEmpty()){\r\n if (!questionEntities.isEmpty()){\r\n for (int c = 0; c < questionEntities.size(); c++){\r\n for (int i = 0; i < howQuestions.size(); i++){\r\n if (howQuestions.get(i).question.contains(questionEntities.get(c))){\r\n answers.add(new Question(howQuestions.get(i).id, howQuestions.get(i).question, howQuestions.get(i).answer));\r\n }\r\n }\r\n }\r\n }\r\n else{\r\n if (!questionTags.isEmpty()){\r\n for (int c = 0; c < questionTags.size(); c++){\r\n for (int i = 0; i < howQuestions.size(); i++){\r\n if (howQuestions.get(i).question.contains(questionTags.get(c))){\r\n answers.add(new Question(howQuestions.get(i).id, howQuestions.get(i).question, howQuestions.get(i).answer));\r\n }\r\n }\r\n }\r\n }\r\n else{\r\n System.out.println(\"There no answer for your question !\");\r\n System.exit(0);\r\n }\r\n }\r\n }\r\n\r\n // Print All Entities Questions\r\n System.out.println(\"Questions of 'How' that have entities and tags :\");\r\n for (int i = 0; i < answers.size(); i++){\r\n for (int j = 1; j < answers.size(); j++){\r\n if (answers.get(i).id == answers.get(j).id){\r\n answers.remove(j);\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < answers.size(); i++){\r\n System.out.println(answers.get(i).question);\r\n }\r\n\r\n\r\n //==== Question Tags ====\r\n for (int i = 0; i < questionTags.size(); i++){\r\n for (int k = 0; k < answers.size(); k++){\r\n if (answers.get(k).question.contains(questionTags.get(i))){\r\n continue;\r\n }\r\n else{\r\n answers.remove(k);\r\n }\r\n }\r\n }\r\n }", "public void submitAnswer(String question, ArrayList<Integer> choices) {\r\n Question currentQuestion = new Question(question, choices);\r\n\r\n // 6 options, multiple answers\r\n if (currentQuestion.getSize() == 6) {\r\n setMultChoices();\r\n System.out.println(studentID + \" : \" + studentAnswer);\r\n }\r\n // 4 options, only accept single answer\r\n else if (currentQuestion.getSize() == 4){\r\n setSingleChoices();\r\n System.out.println(studentID + \" : \" + studentAnswer);\r\n }\r\n // 2 options, either true or false answer\r\n else {\r\n setTFChoices();\r\n System.out.println(studentID + \" : \" + studentAnswer);\r\n }\r\n\r\n // jump to changeAnswers to check if student wants to change answer\r\n changeAnswers(question, choices);\r\n }", "public boolean addPaient(Patient patient) throws TooManyExceptions;", "public void question() {\n\t\tlead.answer(this);\n\t}", "public void addQuestion(Question a) {\n quesCollec.add(a);\n }", "@RequestMapping(value = \"/addQuestionToTestTeacher/{testId}\",method = RequestMethod.POST)\n\tpublic Test addQuestionToTest(@PathVariable(\"testId\") int testid ,@RequestBody List<Questions> questionList){\n\t\tTest test = testDao.gettestStatus(testid);\n\t\tif(test!=null) {\n\t\t\tList<Questions> availableQuestions = (List<Questions>) test.getQuestions();\n\t\t\tif(availableQuestions.size()>0) {\n\t\t\t\tavailableQuestions.addAll(questionList);\n\t\t\t}else {\n\t\t\t\ttest.setQuestions(questionList);\n\t\t\t}\n\t\t\ttest = testDao.updateTest(test);\n\t\t}\n\t\t\n\t\treturn test;\n\t}", "private List<String> answerType(Question currentQuestion) {\n List<String> answers = new ArrayList<String>();\n\n if (currentQuestion.getTypeOfQuestion() == QuestionTypes.ESSAY || currentQuestion.getTypeOfQuestion() == QuestionTypes.MULTI_CHOICE) {\n System.out.println(\"Single Answer :\" + singleAnswer);\n answers.add(singleAnswer);\n } else {\n System.out.println(\"Multi Answer :\" + multiAnswers);\n answers = multiAnswers;\n }\n return answers;\n }", "@Override\n\tpublic void addPatients(String name, int id, Long mobilenumber, int age) {\n\t\t\n\t}", "public void saveSurveyAnswer(HttpServletRequest request, Answers answers, long userId);", "public void addChoice(String _choice, boolean _correct)\n {\n m_choices.add(_choice);\n if (_correct) {\n // Convert choices.size() to string\n String choiceString = \"\" + m_choices.size();\n setAnswer(choiceString);\n }\n }", "private void addPatient(Patient patient) {\n Location location = mLocationTree.findByUuid(patient.locationUuid);\n if (location != null) { // shouldn't be null, but better to be safe\n if (!mPatientsByLocation.containsKey(location)) {\n mPatientsByLocation.put(location, new ArrayList<Patient>());\n }\n mPatientsByLocation.get(location).add(patient);\n }\n }", "public boolean add(Patient p) {\n\t\tif (currentTimeOccupied.plus(p.timeToHealth()).toMillis() <= timeLeftInDay.toMillis()) {\n\t\t\tpatients.add(p);\n\t\t\t//currentTimeOccupied = currentTimeOccupied.plus(p.timeToHealth());\n\t\t\ttimeLeftInDay = timeLeftInDay.minus(p.timeToHealth());\n\t\t\t\n\t\t\tif (patients.size() < MAX_PATIENTS) {\n\t\t\t\tSystem.out.println(\"Patient added to list! \" + p.timeToHealth().toMinutes() + \" minutes!\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"A patient has been booted to add this one!\");\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\telse {\n\t\t\tSystem.out.println(\"This doctor can't take this patient due to time constraints.\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\n\t}", "private void insertToSentList(Question question) {\r\n\t\tdListOfQuestions.append(new QuestionWithAns(question));\r\n\t\tbTreeOfQuestions.addNode(question.getQnNum(), question);\r\n\t}", "private void nextQuestion() {\n\n // increment current question index\n currentQuestionIndex++;\n\n // if the current question index is smaller than the size of the quiz list\n if (currentQuestionIndex < quizList.size()) {\n\n // clear the possible answers\n possibleAnswers.clear();\n\n // grab the definition of current question, assign the correct answer variable\n // and add it to the list of possible answers.\n definition = quizList.get(currentQuestionIndex)[0];\n correctAnswer = quizMap.get(definition);\n possibleAnswers.add(correctAnswer);\n\n // while there's less than 4 possible answers, get a random answer\n // and if it hasn't already been added, add it to the list.\n while (possibleAnswers.size() < 4) {\n String answer = quizList.get(new Random().nextInt(quizList.size() - 1))[1];\n if (!possibleAnswers.contains(answer)) {\n possibleAnswers.add(answer);\n }\n }\n\n // shuffle possible answers so they display in a random order\n Collections.shuffle(possibleAnswers);\n } else {\n // if the question index is out of bounds, set quiz as finished\n quizFinished = true;\n }\n }", "void addRecordToCache(DNSQuestion question, DNSRecord answer){\n cache.put(question, answer);\n System.out.println(\"Answer added to cache!\");\n }", "public Answer addAnswer(String description,String email, String password, String guest,String result) throws MeetingException{\n \tAnswer a = null;\n \t\n\t\tif(result.equals(\"no\")){\n\t\t\tSystem.out.println(\"Answer with Not attendance to Meeting to be added\");\n\t\t\ta = new Answer(false, Integer.parseInt(guest), AttendingResult.no, this.getMeeting(description), this.getUserFromUsersBy(email, password));\n\t\t}else{\n\t\t\tif(this.isUserInArrayLisyOfUsers(email, users)==false){\n\t \t\tthrow new UserNotFound();\n\t \t}else if(this.isMeetingInMeetingManager(description)==false){\n\t \t\tthrow new MeetingNotFound();\n\t \t}else if(this.isUserInMeetingGroup(email, description)==false){\n\t \t\tthrow new UserNotFoundInMG();\n\t \t}else if(this.thisAnswerExist(email, description)){\n\t \t\tthrow new AnswerAlreadyFoundForUserMeeting();\n\t \t}else if(Integer.parseInt(guest) > this.getMeeting(description).getGuestsPerMember()){\n\t \t\tthrow new AnswerExceedsGuestsPerMeeting();\n\t \t}\n\t \tif(this.getMeeting(description).isDraft()){\n\t \t\tSystem.out.println(\"This meeting is a draft. Please wait organizer confirmation\");\n\t \t}\n\t\t\tif(Integer.parseInt(guest) + 1 >= this.getMeeting(description).getAttendeeTotal()){\n\t\t\t\tif(this.getMeeting(description).getWaitList() == 0){\n\t\t\t\t\t\tthrow new MeetingIsFull();\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(\"The meeting is full but has waiting List. Wait in Waiting List\");\n\t\t\t\t\ta = new Answer(true, Integer.parseInt(guest), AttendingResult.WantASpot, this.getMeeting(description), this.getUserFromUsersBy(email, password));\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\ta = new Answer(true, Integer.parseInt(guest), AttendingResult.yes, this.getMeeting(description), this.getUserFromUsersBy(email, password));\n\t \t}\n\t\t}\n \tanswers.add(a);\n \treturn a;\n }", "public MultipleAnswerQuestion(String question ,boolean isSingleAnswered)\r\n {\r\n super(question,isSingleAnswered);\r\n this.answers = new ArrayList<>(); //Initializing the HashSet\r\n }", "public void addExercise(Exercise p) {\n exercises.add(p);\n }", "public void addQuestion(Question quest) {\n ContentValues values = new ContentValues();\n values.put(KEY_QUES, quest.getQUESTION());\n values.put(KEY_ANSWER, quest.getANSWER());\n values.put(KEY_OPTA, quest.getOPTA());\n values.put(KEY_OPTB, quest.getOPTB());\n values.put(KEY_OPTC, quest.getOPTC());\n // Inserting Row\n db.insert(TABLE_NAME_QUEST, null, values);\n }", "public void setQuestions(){\r\n question.setTestname(test.getText().toString());\r\n question.setQuestion(ques.getText().toString());\r\n question.setOption1(opt1.getText().toString());\r\n question.setOption2(opt2.getText().toString());\r\n question.setOption3(opt3.getText().toString());\r\n int num = Integer.parseInt(correct.getText().toString());\r\n question.setAnswerNumber(num);\r\n long check = db.addToDb(question);\r\n if(check == -1){\r\n Toast.makeText(getBaseContext(), \"Question already exists\", Toast.LENGTH_LONG).show();\r\n }else{\r\n Toast.makeText(getBaseContext(), \"Question added\", Toast.LENGTH_LONG).show();\r\n }\r\n }", "public void setAnswers(java.util.List<java.lang.CharSequence> value) {\n this.Answers = value;\n }", "private void creatingNewQuestion() {\r\n AbstractStatement<?> s;\r\n ListQuestions lq = new ListQuestions(ThemesController.getThemeSelected());\r\n switch ((String) typeQuestion.getValue()) {\r\n case \"TrueFalse\":\r\n // just to be sure the answer corresponds to the json file\r\n Boolean answer = CorrectAnswer.getText().equalsIgnoreCase(\"true\");\r\n s = new TrueFalse<>(Text.getText(), answer);\r\n break;\r\n\r\n case \"MCQ\":\r\n s = new MCQ<>(Text.getText(), TextAnswer1.getText(), TextAnswer2.getText(), TextAnswer3.getText(), CorrectAnswer.getText());\r\n break;\r\n\r\n default:\r\n s = new ShortAnswer<>(Text.getText(), CorrectAnswer.getText());\r\n break;\r\n }\r\n lq.addQuestion(new Question(s, ThemesController.getThemeSelected(), Difficulty.fromInteger((Integer) difficulty.getValue()) ));\r\n lq.writeJson(ThemesController.getThemeSelected());\r\n }", "public DnsMessage addQuestion(DnsQuestion question) {\n if (questions == null) {\n questions = new LinkedList<DnsQuestion>();\n }\n questions.add(question);\n return this;\n }", "@Override\n\tpublic void updataanswer(Integer id, AnswerCustom answerCustom) throws Exception {\n\t\t\n\t}", "public ArrayList<String> generateAnswers(){\r\n ArrayList<String> ans;\r\n if(qType==0){\r\n ans = new ArrayList(Arrays.asList(\"A\",\"B\",\"C\",\"D\",\"E\"));\r\n }\r\n else{\r\n ans = new ArrayList(Arrays.asList(\"Choice 1\",\"Choice 2\"));\r\n }\r\n return ans;\r\n }", "public static void updateList(Patient p) {\r\n \t\tpatientArray.add(p);\r\n \t\tlistModel.addElement(p.getFirstName());\r\n \t}", "public void setAnswerid(Integer answerid) {\n this.answerid = answerid;\n }", "public Respuesta addRespuesta(String resp, Pregunta p, Usuario autor);", "private void setAnswerForLastQuestion() {\n\n DbHelper dbhelper = new DbHelper(context);\n questionNo = questionNo + 1;\n QuizAnswer answer = new QuizAnswer();\n answer.setQuizId(quizId);\n answer.setQuestionId(questionId);\n int optionId = shareprefs.getInt(\"optionId\", 0);\n answer.setOptionId(optionId);\n int correctAns = shareprefs.getInt(\"correctAns\", 0);\n answer.setAnswer(correctAns);\n answer.setContentId(contentId);\n boolean flage = dbhelper.upsertQuizAnswerEntity(answer);\n if (flage) {\n shareprefs.edit().clear().commit();//clear select OptionPreferences\n Intent mIntent = new Intent(this, QuizResultActivity.class);\n mIntent.putExtra(\"quizId\", quizId);\n mIntent.putExtra(\"contentId\", contentId);\n mIntent.putExtra(\"totalQuestion\", questionList.size());\n startActivityForResult(mIntent,1);\n }\n }", "public void setAnswers(int answers) {\n this.answers = answers;\n }", "QuestionPick addPickDetail(Question question);", "public void add(Person p) {\r\n\t\tq.add(p);\r\n\t\tif(q.size() > maxQ)\r\n\t\t\tmaxQ = q.size();\r\n\t}", "public void createAnswerStatistics(int sid,int qid);", "public void create() {\n io.writeLine(\"Enter correct answer(T/F)\");\n String answer = io.readLine();\n while (!answer.equals(\"T\") && !answer.equals(\"F\")) {\n io.writeLine(\"Please put in T or F\");\n answer = io.readLine();\n }\n rightAnswers.add(answer);\n }", "public void setAnswersList(List<Answer> answersList) {\n this.answersList = answersList;\n }", "public ArrayList<AnswerElement> getAnswer() {\r\n\t\treturn ans;\r\n\t}", "public void addExamination(Examination examination){\n this.examinations.add(examination);\n }", "void addAnswers(AnswerDTO answerDTO) {\n\n\n sharedPreferences = getSharedPreferences(\"LoginData\", MODE_PRIVATE);\n String userId = sharedPreferences.getString(\"UserId\", \"\");\n answerDTO.setUserId(userId);\n\n qa_answerText = findViewById(R.id.qa_answerText);\n if(qa_answerText.getText().toString().trim().equals(\"\"))\n {\n Toast toast=Toast.makeText(getApplicationContext(),\"Please enter some text\",Toast.LENGTH_SHORT);\n toast.show();\n }\n else {\n answerDTO.setAnswerBody(qa_answerText.getText().toString());\n System.out.println(\"answer text:\" + qa_answerText.getText().toString());\n System.out.println(\"answer body:\" + answerDTO.getAnswerBody());\n\n quoraRetrofitService = RetrofitClientInstance.getRetrofitInstance().create(QuoraRetrofitService.class);\n System.out.println(\"Qid addAnswer: \" + answerDTO);\n\n Call<IdResponse> callAddAnswer = quoraRetrofitService.addAnswer(answerDTO);\n callAddAnswer.enqueue(new Callback<IdResponse>() {\n @Override\n public void onResponse(Call<IdResponse> call, Response<IdResponse> response) {\n if (response.body() != null) {\n System.out.println(\"OnResponse Add Answer\");\n final String message = response.body().getId();\n System.out.println(\"Message: \" + message);\n }\n }\n\n @Override\n public void onFailure(Call<IdResponse> call, Throwable t) {\n System.out.println(\"OnFailure Add Answer\" + t.getMessage());\n }\n });\n\n }\n\n }", "private void addSubquestionsWithCL(Question q, String oid, HashMap<String, String> ans, String t, boolean b, String qid_append)\n\t{\n\t\tList<String> sqids = getSqIds(q.getQid());\n\t\tfor (String sqid : sqids) {\n\t\t\tString question = q_l10ns_node.selectSingleNode(\"row[qid=\" + sqid + \"]/question\").getText();\n\t\t\tString sq_title = sq_node.selectSingleNode(\"row[qid=\" + sqid + \"]/title\").getText();\n\t\t\tQuestion sq = new Question(q.qid + sq_title + qid_append,\n\t\t\t\t\tq.gid,\n\t\t\t\t\t\"A\",\n\t\t\t\t\tq.question + \" \" + question,\n\t\t\t\t\tsqid,\n\t\t\t\t\tq.mandatory,\n\t\t\t\t\tq.language);\n\t\t\tsq.setHelp(q.help);\n\t\t\tsq.setAnswers(new AnswersList(oid, ans, t, b));\n\n\t\t\tsurvey.addQuestion(sq);\n\n\t\t\t// If the type is \"Multiple Choice with Comments\"\n\t\t\tif (q.getType().equals(\"P\")) {\n\t\t\t\t// Add comment question\n\t\t\t\taddComment(sq);\n\t\t\t}\n\t\t}\n\t}", "public void addQ (Question Q)\n {\n newQuestion = Q;\n \n enqueue();\n }", "public static com.jhu.cvrg.portal.survey.model.SurveyAnswer addSurveyAnswer(\n\t\tcom.jhu.cvrg.portal.survey.model.SurveyAnswer surveyAnswer)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getService().addSurveyAnswer(surveyAnswer);\n\t}", "public void storeDataTwo(String id, List<String> answers){\n JSONObject questionAnswers = new JSONObject();\n try\n {\n questionAnswers.put(\"usertestid\", id);\n SharedPreferences pref = this.getSharedPreferences(\"session_token\", Context.MODE_PRIVATE);\n String email = pref.getString(\"email\", null);\n questionAnswers.put(\"answered_by\", email);\n questionAnswers.put(\"answers\", answersArray);\n } catch (JSONException e){\n e.printStackTrace();\n }\n new AsyncPost().execute(\"http://webapp.bimorstad.tech/feedback/create\", questionAnswers.toString());\n }", "@Test\n void addAnswersToQuestionWhenQuestionIsGettingAdded(){\n quiz = new Quiz(69L, \"weeb quiz\", new ArrayList<>(), new User(),\"1\", new ArrayList<>());\n question = new Question(96L, new ArrayList<>(), new Quiz(), \"what's the monster inside of Yuji Itadori called?\");\n answer = new Answer(1L, \"Sukuna\", true, question);\n\n quizService.addQuiz(quiz, new User(42L, \"potato-san\", \"[email protected]\", \"iLovePotatoes420\", new ArrayList<>()));\n questionService.addQuestion(question, quiz);\n answerService.addAnswer(answer, question);\n\n String questionAnswer = \"Sukuna\";\n Optional<Question> questionNinetySix = questionService.getAllQuestions()\n .stream()\n .filter(q -> q.getQuestionId() == 96L)\n .findAny();\n\n if(questionNinetySix.isPresent()){\n String actualAnswer = questionNinetySix.get().getAnswers()\n .stream().findFirst().get().getAnswerContent();\n\n assertEquals(questionAnswer, actualAnswer);\n }\n }", "public void newApointment(Appointment ap){\n\n this.appointments.add(ap);\n }", "public static void insertAnswers(String username, int id, String answer) {\n\t\tString user = username;\n \ttry {\n \t\tint rs = Messages.connect().executeUpdate(\"INSERT INTO Answers (Q_id, B_Username, Answer)\" +\n \t \t\"VALUES ('\" + id + \"', '\" + user +\"', '\" + answer +\"')\");\n \t\tMessages.connect().close();\n \t} catch (Exception e) {\n \t\te.printStackTrace();\n \t}\n\t}", "public static void updateListAfterPatientEdit(int index, Patient p){\r\n \t\tpatientArray.remove(p);\r\n \t\tpatientArray.add(index, p);\r\n \t\t\r\n \t\tpatientList.clearSelection();\r\n \t\tpatientList.setSelectedIndex(index);\r\n \t\t\r\n \t\tlistModel.remove(index);\r\n \t\tlistModel.add(index, p.getFirstName());\r\n \t}", "int createSurvey(List<Question> questions, String userId);", "public void add(String patient, MedicalRecord m) {\n if (!database.containsKey(patient)) {\n database.put(patient, new ArrayList<MedicalRecord>());\n }\n database.get(patient).add(m);\n }", "private void patientSetBtnActionPerformed(java.awt.event.ActionEvent evt) {\n patientArr[patientI] = new patient(patientNameBox.getText(),\n Integer.parseInt(patientAgeBox.getText()),\n patientDiseaseBox.getText(),\n Integer.parseInt(patientIDBox.getText()));\n try {\n for (int i = 0; i < doc.length; i++) {\n if (patientDiseaseBox.getText().equalsIgnoreCase(doc[i].expertise)) {\n doc[i].newPatient(patientArr[patientI]);\n patientArr[patientI].docIndex = i;\n break;\n }\n }\n } catch (NullPointerException e) {\n for (int i = 0; i < doc.length; i++) {\n if (doc[i].expertise.equalsIgnoreCase(\"medicine\")) {\n doc[i].newPatient(patientArr[patientI]);\n\n }\n }\n }\n\n patientArr[patientI].due += 1000;\n\n patientI++;\n \n }", "@Override\n\tpublic Questions addQuestion(BigInteger testId, Questions question) throws UserException {\n\t\treturn null;\n\t}", "@Override\r\n public ArrayList<String> getAnswers() {\r\n return this.answers;\r\n }", "public ArrayList<String> getAnswerList(){\n if(answerList != null) {\n return answerList;\n }\n else{\n System.out.println(\"Answer list is undefined.\");\n return null;\n }\n }", "public void setAnswerId(int answerId) {\r\n this.answerId = answerId;\r\n }", "private void setAnswer() {\n DbHelper dbhelper = new DbHelper(context);\n questionNo = questionNo + 1;\n QuizAnswer answer = new QuizAnswer();\n answer.setQuizId(quizId);\n answer.setQuestionId(questionId);\n int optionId = shareprefs.getInt(\"optionId\", 0);\n answer.setOptionId(optionId);\n int correctAns = shareprefs.getInt(\"correctAns\", 0);\n answer.setAnswer(correctAns);\n answer.setContentId(contentId);\n boolean flage = dbhelper.upsertQuizAnswerEntity(answer);\n if (flage) {\n shareprefs.edit().clear().commit();//clear select OptionPreferences\n setValue();\n }\n }", "public void createQuestion(int sid,int qid,String qtype,String qtitle,String answer_a,String answer_b,String answer_c,String answer_d);", "public void printAnswerList(){\n if(answerList.isEmpty()){\n System.out.println(\"Answer list is empty.\");\n }\n else {\n for (int i = 1; i < answerList.size() + 1; i++) {\n System.out.println(i + \") \" + answerList.get(i - 1));\n }\n }\n }", "public void AddQuestionToBank(ActionEvent actionEvent) throws IOException {\n QuestionModel questionModel = new QuestionModel();\n ArrayList<QuestionModel> questionBank = DBObject.getInstance().getQuestionBank();\n if(questionName.getText() != null && question.getText() != null && subjects.getValue() != null){\n if(className.getValue() != null && answer.getText() != null){\n if (easy.isSelected() || medium.isSelected() || hard.isSelected()) {\n questionModel.setQuestionName(questionName.getText());\n questionModel.setPointsPossible(Integer.parseInt(points.getText()));\n questionModel.setClassNumber(className.getValue().toString());\n questionModel.setSubject(subjects.getValue().toString());\n questionModel.setQuestion(question.getText());\n questionModel.getQuestionHelper().setAnswer(answer.getText());\n questionModel.setHint(hint.getText());\n if(easy.isSelected()){\n questionModel.setDifficulty(1);\n }\n else if(medium.isSelected()){\n questionModel.setDifficulty(2);\n }\n else if(hard.isSelected()){\n questionModel.setDifficulty(3);\n }\n SetUpNewView(questionBank, questionModel);\n }\n }\n }\n }", "public static List<NewPatient> checkrepeatition(List<NewPatient> patientsList, NewPatient selectedPatient) {\n\n if (!isPatientExist(patientsList, selectedPatient)) {\n patientsList.add(selectedPatient);\n }\n\n return patientsList;\n }", "@SuppressWarnings(\"rawtypes\")\n\tpublic AddSurveyForApplicant() {\n\t\tif (getSession().getAttribute(\"isLogin\").equals(\"false\")) {\n\t\t\tsetResponsePage(Authentication.class);\n\t\t\treturn;\n\t\t}\n\t\tif (getSession().getAttribute(\"personTyp\").equals(\"a\")) {\n\t\t\tsetResponsePage(PersonTyp.class);\n\t\t\treturn;\n\t\t}\n\n\t\tLong id = Long.valueOf(getSession().getAttribute(\"id\").toString());\n\n\t\tp = ps.find(id);\n\n\t\tString url = RequestCycle.get().getRequest().getUrl().toString();\n\t\tString[] idFromUrl = url.split(\"/\");\n\t\tfinal Long receiverID = Long.valueOf(idFromUrl[3]);\n\t\tfinal IApplicant applicant = (IApplicant) ps.find(receiverID);\n\n\t\t// final IApplicant applicant\n\t\tList<ISurvey> surveys = new ArrayList<ISurvey>();\n\t\tsurveys = ss.loadAllServeyByEmployer(id);\n\t\tlogger.info(\"surveyes loaded, size: \" + surveys.size());\n\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tPageableListView surveyView = new PageableListView(\"surveys\", surveys,\n\t\t\t\t6) {\n\t\t\t/**\n\t\t\t * \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 53780096350876440L;\n\n\t\t\t@Override\n\t\t\tprotected void populateItem(ListItem item) {\n\t\t\t\tISurvey survey = (ISurvey) item.getModelObject();\n\t\t\t\titem.add(new Label(\"date\", \"Date: \" + survey.getDate()));\n\t\t\t\titem.add(new Label(\"name\", \"Survey: \" + survey.getName()));\n\t\t\t\titem.add(new Label(\"text\", \"Info: \" + survey.getText()));\n\t\t\t\tString fragmentId = null;\n\t\t\t\tif (ss.loadAppSurveyByApplicantAndSurvey(\n\t\t\t\t\t\t((IPerson) applicant).getId(), survey.getId()).size() == 0) {\n\t\t\t\t\tfragmentId = \"variant_add\";\n\t\t\t\t\titem.add(new FragmentForAddSurvey(\n\t\t\t\t\t\t\t\"placeholderForFragmente\", fragmentId, this,\n\t\t\t\t\t\t\tapplicant, survey));\n\t\t\t\t\tlogger.info(\"Varinat add, size = 0\");\n\t\t\t\t}\n\t\t\t\tif (ss.loadAppSurveyByApplicantAndSurvey(\n\t\t\t\t\t\t((IPerson) applicant).getId(), survey.getId()).size() > 0) {\n\t\t\t\t\tfragmentId = \"variant_has\";\n\t\t\t\t\tlogger.info(\"Varinat has, size > 0\");\n\t\t\t\t\titem.add(new FragmentAlreadySend(\"placeholderForFragmente\",\n\t\t\t\t\t\t\tfragmentId, this));\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tadd(new FeedbackPanel(\"feedback\"));\n\t\tadd(surveyView);\n\t\tadd(new PagingNavigator(\"navigator\", surveyView));\n\n\t}", "protected void constructNewQuestion(){\n arabicWordScoreItem = wordScoreTable.whatWordToLearn();\n arabicWord = arabicWordScoreItem.word;\n correctAnswer = dictionary.get(arabicWord);\n\n for (int i=0;i<wrongAnswers.length;i++){\n int wrongAnswerId;\n String randomArabicWord;\n String wrongAnswer;\n do {\n wrongAnswerId = constructQuestionRandom.nextInt(next_word_index);\n randomArabicWord = dictionary_key_list.get(wrongAnswerId);\n wrongAnswer = dictionary.get(randomArabicWord);\n } while (wrongAnswer.equals(correctAnswer));\n wrongAnswers[i] = wrongAnswer;\n }\n }", "public Results(ArrayList<String> list_Question_and_Answers, ArrayList<String> list_correct_answers){\n\t\t\tthis.list_Question_and_Answers = list_Question_and_Answers;\n\t\t\tthis.list_correct_answers = list_correct_answers;\n\t\t}", "public com.example.DNSLog.Builder setAnswers(java.util.List<java.lang.CharSequence> value) {\n validate(fields()[20], value);\n this.Answers = value;\n fieldSetFlags()[20] = true;\n return this;\n }" ]
[ "0.7742983", "0.7580539", "0.74334913", "0.74326485", "0.71915084", "0.6991407", "0.69699365", "0.6904292", "0.68483573", "0.6835915", "0.67260784", "0.6725295", "0.66842264", "0.63380796", "0.62877834", "0.6259477", "0.6219937", "0.6208152", "0.61172754", "0.6098837", "0.6079736", "0.60376596", "0.60130644", "0.60051674", "0.5996005", "0.5983917", "0.58854645", "0.58617604", "0.58595175", "0.58433145", "0.58113164", "0.5769697", "0.5766236", "0.5765624", "0.5744706", "0.57403237", "0.5736418", "0.5736182", "0.5729735", "0.5702835", "0.5700807", "0.56901217", "0.56864864", "0.56619513", "0.56305474", "0.5611604", "0.56100917", "0.5590916", "0.55820364", "0.55816334", "0.55750877", "0.5569085", "0.5565347", "0.5563796", "0.55421364", "0.5537461", "0.5536847", "0.55294675", "0.5519368", "0.54793185", "0.5476121", "0.54734194", "0.54567254", "0.5452999", "0.5451834", "0.5442215", "0.54395825", "0.543102", "0.5421472", "0.54158205", "0.5405059", "0.5404834", "0.53875023", "0.53853387", "0.5381185", "0.53793645", "0.53732073", "0.5369185", "0.5364015", "0.5352912", "0.53466696", "0.5345785", "0.5343891", "0.53428066", "0.53327113", "0.5332137", "0.5330954", "0.53288466", "0.53223836", "0.5310232", "0.5309477", "0.530445", "0.5298828", "0.52891004", "0.52851087", "0.5283478", "0.5280596", "0.5274118", "0.52725303", "0.5270652" ]
0.65206254
13
You can call method from the class name with className.method if that method is defined with static
public static String placePostData() { String res="/maps/api/place/add/json"; return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "MethodName getMethod();", "public static void staticMethod() {\n Log.e(\"LOG_TAG\", \"Company: STATIC Instance method\");\n }", "static void method1() {\r\n\t\r\n}", "static void staticShow() {\n System.out.println(\"In a static class static method\");\n }", "static void method2(){\n StaticDemo staticDemo=new StaticDemo();\n System.out.println(staticDemo.name);\n staticDemo.method1();\n method3();\n\n }", "void add1() {\n\t\tStatic_Demo s=new Static_Demo();\r\n\t\ts.add();\r\n\t\t\r\n\t\t//calling static method of one class inside another non static of different class via classname\r\n\t\tStatic_Demo.sub();\r\n\t}", "String getMethodName();", "String getMethodName();", "public static void staticExample() {\n\t\tSystem.out.println(\"I am the static method from the child class\");\n\t}", "public static void staticMethodThree(){\n ClassOne.staticMethodOne();\n }", "static void method3(){\n\n }", "public static void staticMethod() {\r\n\t\tSystem.out.println(\"StaticMethod\");\r\n\t}", "public static Object invokeMethod(String classname,String funcName, Class paramTypes[],Object paramValues[]) throws Exception {\n\t\t\n\t\tClass myClass=Class.forName(classname);\n\t\tObject o=myClass.newInstance();\n\t\tMethod m=myClass.getDeclaredMethod(funcName, paramTypes);\n\t\t\n\t\tif(Modifier.isStatic(m.getModifiers()))\n\t\t\tSystem.out.println(\"Static\");\n\t\t\n\t\telse\n\t\t\t\n\t\t\tSystem.out.println(\"Not Static\");\n\t\t\n\t\treturn m.invoke(o, paramValues);\t\n\t\t\n\t}", "Method getMethod();", "Method getMethod();", "public static void display() {\n System.out.println(\"Static or class method from Base\");\n }", "public static void main(String[] args)\r\n {\n Type objectName = new Type();\r\n // call a method ON an object\r\n objectName.methodName();\r\n // call a static method OF a class\r\n ClassName.methodName();\r\n }", "public static void staticMethodThree(){\n ClassOne obj = new ClassOne();\n obj.nonStaticMethodOne();\n }", "public static void staticMethodFour(){\n ClassOne obj = new ClassOne();\n obj.nonStaticMethodOne();\n }", "String getMethod();", "String getMethod();", "static void method1()\r\n {\n }", "java.lang.String getMethodName();", "java.lang.String getMethodName();", "java.lang.String getMethodName();", "java.lang.String getMethodName();", "ClassType memberClassNamed(String name);", "abstract String getClassName();", "public Method getMethod();", "public static void main(String[] args) {\n\t\t\n\t\tStaticMethodOverLoading.getName();\n\t\tStaticMethodOverLoading.getName(4);\n\t\t\n\t\tStaticMethodOverLoading.main(7); //static methods can be called by using class name\n\t\t\n\t\tStaticMethodOverLoading.main(7,6);\n\t}", "String getClassName();", "String getClassName();", "String getClassName();", "public abstract String getClassName();", "public static JInvocation staticInvoke(AbstractJClass cls, String methodName, JVar param) {\n JInvocation invocation = cls.staticInvoke(methodName);\n withArgument(invocation, param);\n return invocation;\n }", "@Override\n protected String getMethodName() {\n return suitename() + \"-\" + super.getMethodName();\n }", "ClassMember getMethod () { return method; }", "private void method(String name) {\n app.method(name);\n }", "public void NonStaticMethodFour(){\n ClassOne obj = new ClassOne();\n obj.nonStaticMethodOne();\n\n //8) A non-static method calling a static method in another class\n ClassOne obj2 = new ClassOne();\n obj2.nonStaticMethodOne();\n }", "Object getClass_();", "Object getClass_();", "public void invokeStatic(String methodSignature) {\n\t\tlines.append(\"invokestatic \");\n\t\tlines.append(methodSignature);\n\t\tlines.append(\"\\n\");\n\t}", "public static void main(String[] args) {\n\t\tcallingstatic obj = new callingstatic(); //object to call nonstatic func or var. \n\t\t\n\tsum(); //Direct calling static method.\n\tcallingstatic.sum(); //indirect calling static method through class name.\n\t//obj.sum(); //nonstatic way to call static method. \n\t\n\tobj.divide(); //calling nonstatic func though obj\n\tSystem.out.println(obj.name); //calling nonstatic var though obj\n\t}", "public static void main(String[] args) {\n // call directly since we are in same class\n //sayHelloWorld7Times();\n // alternatively call using class name\n MethodPractice.sayHelloWorld7Times();\n\n // you can call static method of other class\n // using className.methodName(...)\n MethodIntro.sayHello();\n calculateMathProblem();\n\n }", "public static void display() {\n System.out.println(\"Static or class method from Derived\");\n }", "protected ForStaticMethod(Method method) {\n this.method = method;\n }", "public static void getInfo1() {\n \t//\tSystem.out.println(\"My name is \"+ name+ \"and my last name is \"+ lastName);\n \t\t//will get an error\n \tSystem.out.println(\"I am a static method \");\n \t// we can't access non static method within static \n \t}", "public void translateStaticPush( MethodTranslator method );", "public static Method getMethod(Class<?> paramClass, String paramString, Class<?>[] paramArrayOfClass) throws NoSuchMethodException {\n/* 90 */ ReflectUtil.checkPackageAccess(paramClass);\n/* 91 */ return paramClass.getMethod(paramString, paramArrayOfClass);\n/* */ }", "private String getName() {\n return method.getName();\n }", "public String getClassName();", "public String getMethodName(Class<?> type, String methodName, Class<?>... params);", "public static void thisMethod() {\n }", "Method createMethod();", "Method createMethod();", "private static void staticFun()\n {\n }", "public static void staticMethodTwo(){\n staticMethodOne();\n }", "public static void invokeStatic (\n MethodVisitor visitor, Class<?> klass, String method,\n Class<?>... parameterTypes) {\n\n visitor.visitMethodInsn(INVOKESTATIC, slashBinaryName(klass), method,\n methodDescriptor(klass, method, parameterTypes), false);\n }", "private String m56637b(Class cls) {\n return cls.getName();\n }", "public void nonStaticMethodTwo(){\n nonStaticMethodOne();\n\n //7) A non-static method calling a static method in the same class\n staticMethodOne();\n }", "public static void getInfo1() {\n\t\tSystem.out.println(\"I am a static Method\");\n\t\t\t\t\t\t\t\t\t\t\t\t // we can not access non static Members within static Method!!\n\t}", "java.lang.String getClassName();", "@Override\n public String getMethod() {\n return METHOD_NAME;\n }", "static void method1(){\n\t\tSystem.out.println(\"Method 1\");\n\t}", "public static void main(String[] args) {\n MyInterfaceStatic.methodStatic();\n }", "@Test\n public void testStaticMethodStaticClassNotKept() throws Exception {\n Class<?> mainClass = MainCallStaticMethod.class;\n runTest(\n mainClass,\n ImmutableList.of(mainClass, StaticMethod.class),\n keepMainProguardConfiguration(mainClass),\n this::checkOnlyMainPresent);\n }", "static Method getMethod(final Class < ? extends SimpleScriptable> clazz, final String name) {\n if (name == null) {\n return null;\n }\n for (final Method method : clazz.getMethods()) {\n if (method.getName().equals(name)) {\n return method;\n }\n }\n return null;\n }", "public static void main(String[] args) {\n aClass.aMethod();\n }", "@Test\n public void testStaticMethodStaticClassKept() throws Exception {\n Class<?> mainClass = MainCallStaticMethod.class;\n String proguardConfiguration = keepMainProguardConfiguration(\n mainClass,\n ImmutableList.of(\n \"-keep class \" + getJavacGeneratedClassName(StaticMethod.class) + \" {\",\n \"}\"));\n runTest(\n mainClass,\n ImmutableList.of(mainClass, StaticMethod.class),\n proguardConfiguration,\n this::checkAllClassesPresentWithDefaultConstructor);\n }", "public static void isStatic() {\n\n }", "protected Method getClassMethod(Class<?> cls, String methodName) {\n Method method = null;\n\n // Perhaps its better to use both \"getMethods\" & \"getDeclaredMethods\" methods?\n for (Method m : cls.getDeclaredMethods()) {\n if (m.getName().equals(methodName)) {\n if (Modifier.isPrivate(m.getModifiers())) {\n logger.warn(\"handler with private access modifier is not supported\");\n }\n else {\n method = m;\n\n break;\n }\n }\n }\n\n return method;\n }", "public void runit(String class_name)\n {\n runit(class_name, null);\n }", "private Method getMethod(String methodName, Class targetClass, Class[] argument) throws SecurityException, NoSuchMethodException\n \t{\n \t\tassert methodName != null;\n \t\tassert targetClass != null;\n \t\tassert argument != null;\n \t\t\n \t\treturn targetClass.getMethod( methodName, argument );\n \t}", "String getInstanceOfClass();", "public void getInfo() {\n\tSystem.out.println(\"My name is \"+ name+ \" my last name is \"+ lastName);\n\t // we can access static members within non static Method!!\n\t\n}", "java.lang.String getClass_();", "java.lang.String getClass_();", "public static void methodTwo(){\n System.out.println(\"mountain bike method two static\");\n }", "@Override\n\tpublic void randomMethod(String name) {\n\t\t\n\t}", "static Identifier makeClassMethod(final QualifiedName name) {\r\n if (name == null) {\r\n return null;\r\n } else {\r\n return new Identifier(Category.CLASS_METHOD, name);\r\n }\r\n }", "static void test(){\n\t }", "Class<H> getMethodClass();", "private static String getSimpleClassName(String className) {\n\n\n\t\tString[] names = className.split(\"\\\\.\");\n\n\t\tfor (int i = 0; i < names.length; i++) {\n\t\t\tLog.d(\"\", \"names =\" + names[i]);\n\t\t}\n\n\t\treturn names[names.length - 1];\n\t}", "private static void processClass(File file_name, final Histogram class_use, final Histogram method_use) {\n try {\n final InputStream object_stream=new FileInputStream(file_name);\n MethodCallEnumerator.analyzeClass(object_stream,class_use,method_use);\n object_stream.close();\n } catch (Exception e) {\n throw new IllegalStateException(\"while processing: \" + e);\n }\n }", "public static Method getMethodByName(final Class<?> cls, final String action) throws NoSuchMethodException {\r\n for (final Method m : cls.getMethods()) {\r\n if (m.getName().equals(action)) {\r\n return m;\r\n }\r\n }\r\n throw new NoSuchMethodException(action);\r\n }", "static void sm() {\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"-----Accessing Static Nested method from Diffrent Class---\");\n\t\t\n\t\tNested.Inner n=new Nested.Inner();\n\t\tn.m1(); \n\t\t//Inner.m1()\n\t\tNested n1=new Nested();\n\t\tn1.m2();\n\t\t\n\n\t}", "public static Object invokeMethod(Class clazz, Object instance, String methodName) throws ReflectionException {\n\t\treturn invokeMethod(clazz, instance, methodName, new Class[]{}, new Object[]{});\n\t}", "@SuppressWarnings(\"ConstantConditions\")\n public static MethodInvoker getMethod(Class<?> clazz, @Nullable String methodName, Class<?>... params)\n {\n return getSimpleMethod(clazz, methodName, null, true, params);\n }", "private static String p(Class n) {\n return n.getName().replace('.','/');\n }", "@Test\n public void testStaticMethodReference() {\n final Car car = Car.create(Car::new);\n final List<Car> cars = Collections.singletonList(car);\n cars.forEach(Car::collide);\n// cars.forEach(c -> c.collide()); // 写不成这种lambda表达式,因为它是静态方法\n }", "public void callMethod( String objectName, String methodName )\n throws MraldException\n {\n try\n {\n Class mraldObject = ( Class )Class.forName( objectName ).newInstance();\n Method method = mraldObject.getMethod( methodName );\n method.invoke( mraldObject );\n }\n catch ( NoSuchMethodException e )\n {\n throw new MraldException(e, messageObject);\n }\n catch ( ClassNotFoundException e )\n {\n throw new MraldException(e, messageObject);\n }\n catch ( IllegalAccessException e )\n {\n throw new MraldException(e, messageObject);\n }\n catch ( InstantiationException e )\n {\n throw new MraldException(e, messageObject);\n }\n catch ( InvocationTargetException e )\n {\n throw new MraldException(e, messageObject);\n }\n }", "public void method(){}", "static void f3() {\n\t\tSystem.out.println(\"I am from F3 instance method and is\"\n\t\t\t\t+ \"specific to this class, so you have to do \"\n\t\t\t\t+ \"classname.f3() to call me \\n\");\n\t}", "public String getClassName() {\n\t\tString tmp = methodBase();\n\t\treturn tmp.substring(0, 1).toUpperCase()+tmp.substring(1);\n\t}", "public static void loadClass(String name) {\n\n }", "private void mappingMethodGet() throws SecurityException, NoSuchMethodException{\n\t\tString aux = upFirstLetter();\n\t\tString methodGet = \"get\" + aux;\n\t\tthis.methodGet = this.classFather.getMethod(methodGet);\n\t}", "void methodNonStaticInner() {\r\n\t\t\tSystem.out.println(\"Non-Static Inner Method\");\r\n\t\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"--------Method reference of static methods-------\");\n//\t\tNo Arg static method reference\n\t\tNoArgMethodInterf mi = MethodRefereceDemo::method1;\n\t\tmi.m1();\n//\t\tSingle Arg static method reference\n\t\tSingleArgMethodInterf mi1 = MethodRefereceDemo::method1;\n\t\tmi1.m1(10);\n//\t\tMulti Arg static method reference\n\t\tMultiArgMethodInterf mi2 = MethodRefereceDemo::method1;\n\t\tmi2.m1(10, \"Kumar\");\n//\t\t--------Method reference of instance methods-------\n\t\tSystem.out.println(\"--------Method reference of instance methods-------\");\n//\t\tNo Arg method reference\n\t\tNoArgMethodInterf mii = new MethodRefereceDemo()::method2;\n\t\tmii.m1();\n//\t\tSingle Arg method reference\n\t\tSingleArgMethodInterf mii1 = new MethodRefereceDemo()::method2;\n\t\tmii1.m1(20);\n//\t\tMulti Arg method reference\n\t\tMultiArgMethodInterf mii2 = new MethodRefereceDemo()::method2;\n\t\tmii2.m1(20, \"Dharma\");\n\t}", "private Method getMethodFromClass(Class<?> clazz, Method subClassMethod) {\n if (clazz == null) {\n return null;\n }\n final String methodName = subClassMethod.getName();\n final Class<?>[] parameterTypes = subClassMethod.getParameterTypes();\n try {\n return clazz.getMethod(methodName, parameterTypes);\n } catch (final NoSuchMethodException e) {\n return null;\n }\n }", "public interface OurService {\n\n static public void provideService(){\n System.out.println(\"OurService Static provideService()\");\n }\n}" ]
[ "0.6563972", "0.6557888", "0.6542901", "0.64990366", "0.6412168", "0.63668305", "0.6343916", "0.6343916", "0.6322235", "0.6314092", "0.631077", "0.6288914", "0.6238323", "0.6209906", "0.6209906", "0.6204279", "0.6168336", "0.6167555", "0.61606055", "0.6139141", "0.6139141", "0.61349165", "0.61339456", "0.61339456", "0.61339456", "0.61339456", "0.60960704", "0.60520446", "0.59199136", "0.58897644", "0.587594", "0.587594", "0.587594", "0.5874574", "0.5868705", "0.58364385", "0.58071405", "0.5802769", "0.579649", "0.57916", "0.57916", "0.5791136", "0.57359344", "0.570665", "0.5706071", "0.5695338", "0.56942236", "0.5687223", "0.56850624", "0.5649991", "0.564462", "0.5613347", "0.5597571", "0.55969423", "0.55969423", "0.55797803", "0.55788034", "0.5550579", "0.55480874", "0.5514506", "0.5503371", "0.5501655", "0.55014807", "0.54963374", "0.5487046", "0.54839855", "0.5483857", "0.54668945", "0.54604644", "0.5459341", "0.5458674", "0.5450437", "0.54413813", "0.5435091", "0.54291296", "0.5405487", "0.5405487", "0.5403456", "0.54024345", "0.5402288", "0.54017067", "0.5387797", "0.5386016", "0.53852963", "0.5372284", "0.53636116", "0.53439134", "0.5343383", "0.5327938", "0.5323815", "0.5322295", "0.5315136", "0.5313167", "0.5292588", "0.5291993", "0.5291432", "0.52891487", "0.5282523", "0.52811766", "0.5270792", "0.5263042" ]
0.0
-1
get loan amount from the textView and convert it to double
@Override public void onClick(View view) { double loan = Double.parseDouble(binding.loanAmount.getText().toString()); // get tenure amount from the textView and convert it to double double tenure = Double.parseDouble(binding.loanTenure.getText().toString()); // get interest amount from the textView and convert it to double, then divide it by 12 to get the interest per month double interest = Double.parseDouble(binding.interestRate.getText().toString()) / 12.0; // variable to hold the (1-i)^n value double i = Math.pow((1.0 + interest / 100.0), (tenure * 12.0)); // equation to calculate EMI (equated monthly installments) double emi = loan * (interest/100.0) * i / ( i - 1 ); // after calculated EMI, set it to the textView in the interface binding.monthlyPayment.setText("$" + String.format("%.2f", emi)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void getMonthlyPayment(View view) {\n //Get all the EditText ids\n EditText principal = findViewById(R.id.principal);\n EditText interestRate = findViewById(R.id.interestRate);\n EditText loanTerm = findViewById(R.id.loanTerm);\n\n //Get the values for principal, MIR and the term of the loan\n double p = Double.parseDouble(principal.getText().toString());\n double r = Double.parseDouble(interestRate.getText().toString());\n double n = Double.parseDouble(loanTerm.getText().toString());\n\n\n //Calculate the monthly payment and round the number to 2 decimal points\n TextView display = findViewById(R.id.display);\n double monthlyPayment;\n DecimalFormat df = new DecimalFormat(\"#.##\");\n monthlyPayment = (p*r/1200.0)/(1-Math.pow((1.0+r/1200.0),(-12*n)));\n\n //Display the number in TextView\n display.setText(String.valueOf(df.format(monthlyPayment)));\n\n\n }", "public void convert(View v){\n EditText etUSD = findViewById(R.id.etUSD);\n EditText etLKR = findViewById(R.id.etLKR);\n\n //Get text From usd TextField\n String text= etUSD.getText().toString();\n //Convert Text To Double\n double usd = Double.parseDouble(text);\n\n // Convert to LKR\n double lkr = usd*195;\n //convert double to string\n String lkrText = String.valueOf(lkr);\n\n //Set lkrTest Value to Test Field\n etLKR.setText(lkrText);\n\n\n\n }", "public double getLoan()\r\n {\r\n return loan;\r\n }", "public double getloanAmount( double loanAmount) {\nreturn loanAmount;\n}", "public static void calculateLoanPayment() {\n\t\t//get values from text fields\n\t\tdouble interest = \n\t\t\t\tDouble.parseDouble(tfAnnualInterestRate.getText());\n\t\tint year = Integer.parseInt(tfNumberOfYears.getText());\n\t\tdouble loanAmount =\n\t\t\t\tDouble.parseDouble(tfLoanAmount.getText());\n\t\t\n\t\t//crate a loan object\n\t\t Loan loan = new Loan(interest, year, loanAmount);\n\t\t \n\t\t //Display monthly payment and total payment\n\t\t tfMonthlyPayment.setText(String.format(\"$%.2f\", loan.getMonthlyPayment()));\n\t\t tfTotalPayment.setText(String.format(\"$%.2f\", loan.getTotalPayment()));\n\t}", "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 }", "public double getLoanAmount() {\n return loanAmount;\n }", "public void calculateLoan(View view){\n Intent intent = new Intent(this, ResultActivity.class);\n\n //TODO: calculate monthly payment and determine\n double carPrice;\n double downPayment;\n double loadPeriod;\n double interestRate;\n\n \n\n //loan application status; approve or reject\n double monthlyPayment;\n String status;\n\n //Passing data using putExtra method\n //putExtra(TAG, value)\n intent.putExtra(MONTHLY_PAYMENT, monthlyPayment);\n intent.putExtra(LOAN_STATUS, status);\n startActivity(intent);\n }", "private String calculateDistancePerAmount() {\n double distance = parser(getTextFromEditText(R.id.distanceEdit));\n double fuel = parser(getTextFromEditText(R.id.fuelEdit));\n double value = distance / fuel;\n return rounder(value);\n }", "void calcAmount(double amountEntered, double costAmount){\n double changeAmount ;\n if(amountEntered >= costAmount){\n changeAmount = amountEntered - costAmount;\n myTextView.setText(\"Please take your change = R\"+ changeAmount + \"\\n\"+ \"Thank you!!\"+\"\\nTravel safe!!\");\n }else{\n changeAmount = amountEntered - costAmount;\n myTextView.setText(\"You still owe R\" + Math.abs(changeAmount)+ \" \\nplease pay now!!\");\n }\n }", "private void calculateLoanPayment() {\n double interest =\n Double.parseDouble(tfAnnualInterestRate.getText());\n int year = Integer.parseInt(tfNumberOfYears.getText());\n double loanAmount =\n Double.parseDouble(tfLoanAmount.getText());\n\n // Create a loan object. Loan defined in Listing 10.2\n loan lloan = new loan(interest, year, loanAmount);\n\n // Display monthly payment and total payment\n tfMonthlyPayment.setText(String.format(\"$%.2f\",\n lloan.getMonthlyPayment()));\n tfTotalPayment.setText(String.format(\"$%.2f\",\n lloan.getTotalPayment()));\n }", "public void getTip(View v)\n {\n EditText billEditText = (EditText) findViewById(R.id.billEditText);\n EditText percentEditText = (EditText) findViewById(R.id.percentEditText);\n TextView tipTextView = (TextView) findViewById(R.id.tipTextView);\n TextView totalTextView = (TextView) findViewById(R.id.totalTextView);\n\n //get the values from the EditText boxes and convert them to double data types\n double bill = Double.parseDouble(billEditText.getText().toString());\n double percent = Double.parseDouble(percentEditText.getText().toString());\n //double total = Double.parseDouble(totalTextView.getText().toString());\n\n //calculate tip\n percent = percent/100;\n double tip = bill*percent;\n double total = bill + tip;\n\n tipTextView.setText(\"Tip: \" + tip);\n totalTextView.setText(\"Total: \" + total);\n\n\n\n\n }", "public static Double getltd(){\n // Log.e(\"LAT\",sharedPreferences.getString(USER_LTD, String.valueOf(0.0)));\n return Double.parseDouble(sharedPreferences.getString(USER_LTD, String.valueOf(0.0)));\n }", "public double getAmount1() // getAmount1 method start\n\t\t{\n\t\t\treturn Double.parseDouble(amountField1.getText());\n\t\t}", "public double getAmount1() // getAmount1 method start\n\t\t{\n\t\t\treturn Double.parseDouble(amountField1.getText());\n\t\t}", "private void calcularResultado() {\r\n\tdouble dinero=0;\r\n\tdinero=Double.parseDouble(pantalla.getText());\r\n\tresultado=dinero/18.5;\r\n\t\tpantalla.setText(\"\" + resultado);\r\n\t\toperacion = \"\";\r\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tp = Float.parseFloat(InterestCalc.this.Principal.getText()\n\t\t\t\t\t\t.toString());\n\t\t\t\tr = Float.parseFloat(InterestCalc.this.Rate.getText()\n\t\t\t\t\t\t.toString());\n\t\t\t\tn = Float.parseFloat(InterestCalc.this.Years.getText()\n\t\t\t\t\t\t.toString());\n\t\t\t\tf = Float.parseFloat(InterestCalc.this.Freq.getText()\n\t\t\t\t\t\t.toString());\n\t\t\t\tr = (float) (r / (f * 100));\n\t\t\t\ta = (float) (p * Math.pow((1 + r), (f * n)));\n\t\t\t\ts = String.valueOf(a);\n\n\t\t\t\tans.setText(s);\n\t\t\t}", "public static Double getDouble(TextView view) {\n Double result;\n if (!isEmpty(view)) {\n try {\n result = Double.parseDouble(getString(view));\n } catch (Exception e) {\n result = null;\n }\n } else {\n result = null;\n }\n return result;\n }", "public void calcular(View view) {\n int quilos = Integer.valueOf(editTextQuantidade.getText().toString());\n int total = (quilos *1000)/500;\n \n String message = \"Com \" + quilos + \"kg de chocolate da para fazer \" + total + \" ovos de 500g.\";\n textViewTotal.setText(message);\n }", "public void onButtonClick(View v) {\n total += value;\n TextView myTextView = (TextView) //displays total\n findViewById(R.id.textView);\n myTextView.setText(Double.toString(round(total,2)));\n }", "public void calculateTip(View view) {\n\t\tTextView txtErrorMsg = (TextView) findViewById(R.id.txtErrorMsg);\n\t\ttxtErrorMsg.setVisibility(View.GONE);\n\t\tEditText edtBillAmount = (EditText) findViewById(R.id.edtBillAmount);\n\t\ttry{\n\t\t\tdouble amount = Double.parseDouble(edtBillAmount.getText().toString());\n\t\t\tCheckBox chkRound = (CheckBox) findViewById(R.id.chkRound);\n\t\t\tboolean round = chkRound.isChecked();\n\t\t\tTextView txtTipResult = (TextView) findViewById(R.id.txtTipResult);\n\t\t\tDecimalFormat df = new DecimalFormat(\"#.##\");\n\t\t\tString tipResult = round? Integer.toString((int)Math.round(amount*0.12)): df.format(amount*0.12);\n\t\t\ttxtTipResult.setText(\"Tip: \" + tipResult+\"$\");\n\t\t}\n\t\tcatch (Exception e){\n\t\t\ttxtErrorMsg.setVisibility(View.VISIBLE);\n\t\t\t}\n\t}", "public void onClick(View v)\r\n\t {\n\t \tDouble d1=Double.parseDouble(edt1.getText().toString());\r\n\t \tDouble d2=Double.parseDouble(edt2.getText().toString());\r\n\t \tDouble bmi= d1/((d2)*(d2));\r\n\t \r\n\t String s=Double.toString(bmi);\r\n\t tv.setText(s);\r\n\t \r\n\t Toast.makeText(Bmi.this,\"Your BMI is \"+bmi, Toast.LENGTH_LONG).show();\r\n\t }", "public BigDecimal getLoanAmont() {\n return loanAmount == null ? BigDecimal.ZERO : loanAmount;\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\n\t\t\t\tEditText getAmount = (EditText) findViewById(com.prageeth.con.R.id.editText3);\n\t\t\t\tgetAmount.setTypeface(tf);\n\t\t\t\tString aa = getAmount.getText().toString();\n\t\t\t\tif (getAmount.getText().toString().length() < 1) {\n\t\t\t\t\tToast.makeText(main, \"ドル量を入力してください\", Toast.LENGTH_LONG)\n\t\t\t\t\t\t\t.show();\n\t\t\t\t} else {\n\n\t\t\t\t\tTextView tsetRae = (TextView) findViewById(com.prageeth.con.R.id.textView3);\n\t\t\t\t\tString ss = tsetRae.getText().toString();\n\n\t\t\t\t\tTextView tsetRaed = (TextView) findViewById(com.prageeth.con.R.id.textView2);\n\t\t\t\t\tString sss = tsetRaed.getText().toString();\n\n\t\t\t\t\tdouble i = Double.parseDouble(aa);\n\t\t\t\t\tdouble rate = Double.parseDouble(ss);\n\t\t\t\t\tdouble totals = i * rate;\n\t\t\t\t\tDecimalFormat df = new DecimalFormat(\"#\");\n\t\t\t\t\tdf.setMaximumFractionDigits(2);\n\n\t\t\t\t\t// TextView c = (TextView)\n\t\t\t\t\t// findViewById(com.prageeth.con.R.id.textView5);\n\t\t\t\t\t// c.setText(String.valueOf(df.format(totals))+\" \"+sss);\n\t\t\t\t\t// c.setTypeface(tf);\n\n\t\t\t\t\tAlertDialog alertDialog = new AlertDialog.Builder(main)\n\t\t\t\t\t\t\t.create(); // Read Update\n\t\t\t\t\talertDialog.setTitle(\"USD:\" + aa + \"=\");\n\t\t\t\t\talertDialog.setMessage(df.format(totals) + \" \" + sss);\n\n\t\t\t\t\talertDialog.setButton(\"OK\",\n\t\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\t\t// here you can add functions\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\talertDialog.show();\n\n\t\t\t\t}\n\t\t\t}", "public void setAmount(double amount) {\nloanAmount = amount;\n}", "public void upgradeClick(View v) {\n if((total - value*1.3) >= 0) { //checks if you have enough money for upgrades\n total -= value*1.3;\n value++;\n TextView TextValue = (TextView) //displays value per click\n findViewById(R.id.TextValue);\n TextValue.setText(Integer.toString(value));\n\n\n TextView myTextView = (TextView)\n findViewById(R.id.textView);\n myTextView.setText(Double.toString(round(total,2)));\n }\n }", "@Override\n public void onClick(View v) {\n float calculate = Float.valueOf(et_cal.getText().toString().trim());\n Float mutiply = Float.parseFloat(sub);\n\n float x = (float) (calculate * mutiply);\n\n result.setText(calculate+\"\"+\" USD = \"+x+\"\" + \" MMK\");\n date.setText(\"Indicative Rate as on \"+date_time);\n btnOk.setVisibility(View.VISIBLE);\n\n // Toast.makeText(getActivity(),\"work\",Toast.LENGTH_SHORT).show();\n\n\n\n }", "private void trataDesconto(String x){\n \n Double sub;\n \n descontoField.setText(porcentagem.format((Double.parseDouble(x))/100));\n descontoField.setEnabled(true);\n sub = retornaSubTotal(this.getVlrTotalItem(), Double.parseDouble(x));\n subTotalField.setText(moeda.format(sub));\n lblTotalGeral.setText(subTotalField.getText());\n this.setVlrTotalItem(sub);\n}", "@Override\n public void onClick(View view) {\n double a = Double.parseDouble(sub1.getText().toString());\n double b = Double.parseDouble(sub2.getText().toString());\n\n MyFunctions obj = new MyFunctions();\n\n double obt_marks = obj.ObtainMarks(a,b);\n\n obtain_marks.setText(String.valueOf(obt_marks));\n\n double pe= obj.per(obt_marks);\n\n percentage.setText(String.valueOf(pe));\n\n\n String grad_e = obj.grade(pe);\n\n grade.setText(String.valueOf(grad_e));\n\n\n\n\n }", "protected void calculate(View view ){\n EditText input =(EditText) findViewById(R.id.editText );\n TextView output =(TextView) findViewById(R.id.textViewoutput);\n //process data..\n int base=Integer.valueOf(input.getText().toString());\n int result=base*base;\n String formatedResult=String.format(\"%d\",result);\n //output the result\n output.setText(\"Result:\"+ formatedResult);\n\n\n }", "public String usrLoanAmount_AftrLogin() {\n\t\treturn helper.getText(usrLoanAmnt);\n\t}", "private String calculateL100Km() {\n double distance = parser(getTextFromEditText(R.id.distanceEdit));\n double fuel = parser(getTextFromEditText(R.id.fuelEdit));\n double value = (fuel * 100) / distance;\n return rounder(value);\n }", "@Override\n public float getAmount() {\n return Float.parseFloat(inputAmount.getText());\n }", "@Override\n public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {\n Log.d(\"MainActivity\", \"inside onTextChanged method: charSequence= \"+charSequence);\n //surround risky calculations with try catch (what if billAmount is 0 ?\n //charSequence is converted to a String and parsed to a double for you\n billAmount = Double.parseDouble(charSequence.toString()) / 100.0;\n\n Log.d(\"MainActivity\", \"Bill Amount = \"+billAmount);\n //setText on the textView\n textViewBillAmount.setText(currencyFormat.format(billAmount));\n //perform tip and total calculation and update UI by calling calculate\n calculate();//uncomment this line\n }", "public double getAmount2() // getAmount2 method start\n\t\t{\n\t\t\treturn Double.parseDouble(amountField2.getText());\n\t\t}", "public double getAmount2() // getAmount2 method start\n\t\t{\n\t\t\treturn Double.parseDouble(amountField2.getText());\n\t\t}", "public void obtenertotales(double suma){\n double Total = suma;\n totalPagarVentaTB.setText(String.valueOf(Total));\n double iva = Total*0.19;\n ivaVentaTB.setText(String.valueOf(iva));\n double subtotal = Total-iva;\n subTotalVentaTB.setText(String.valueOf(subtotal)); \n \n }", "public void calculateAmount() {\n totalAmount = kurv.calculateTotalAmount() + \" DKK\";\n headerPrice.setText(totalAmount);\n }", "private double promptForDepositAmount() {\n\n // display the prompt\n depositView.PrintAmountInCent();\n int input = keypad.getInput(); // receive input of deposit amount\n \n // check whether the user canceled or entered a valid amount\n if (input == CANCELED) {\n return CANCELED;\n }\n else {\n return (double) input / 100; // return dollar amount\n }\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n try{\n currentBillTotal = Double.parseDouble(s.toString());\n }\n catch (NumberFormatException e){\n currentBillTotal = 0.0; // default if an sxception occurs\n }\n\n updateStandard();\n updateCustom();\n\n }", "@Override\n public void onClick(View v) {\n if (txu.getText().toString().equals(\"\")){\n txu.setText(\"0\");\n }\n\n TextView txu = (TextView) findViewById(R.id.total);\n TextView txtBolus = (TextView) findViewById(R.id.txtBC);\n TextView txtCarbos = (TextView) findViewById(R.id.txtCH);\n TextView textView = (TextView) findViewById(R.id.numcal);\n TextView bolusCorreccion = (TextView) findViewById(R.id.numBC);\n TextView bolusCarbos = (TextView) findViewById(R.id.numCH);\n TextView glucosa = (TextView) findViewById(R.id.input_nombre);\n TextView carbos = (TextView) findViewById(R.id.input_apellido2);\n TextView ratio = (TextView) findViewById(R.id.edit3);\n TextView sensibilidad = (TextView) findViewById(R.id.edit4);\n TextView rango = (TextView) findViewById(R.id.edit5);\n totalCarb = Float.parseFloat(txu.getText().toString());\n glucosaActual = Integer.parseInt(glucosa.getText().toString());\n carbosCons = Integer.parseInt(carbos.getText().toString());\n ratioS = Integer.parseInt(ratio.getText().toString());\n sensibilidadS = Integer.parseInt(sensibilidad.getText().toString());\n rangoS = Integer.parseInt(rango.getText().toString());\n correcion = ((glucosaActual - rangoS)/sensibilidadS);\n ch = (carbosCons +totalCarb) / ratioS;\n total = correcion + ch;\n bolusCorreccion.setText(String.format(\"%.2f\", correcion));\n bolusCarbos.setText(String.format(\"%.2f\", ch));\n textView.setText(String.format(\"%.2f\", total));\n textView.setVisibility(View.VISIBLE);\n bolusCorreccion.setVisibility(View.VISIBLE);\n bolusCarbos.setVisibility(View.VISIBLE);\n txtBolus.setVisibility(View.VISIBLE);\n txtCarbos.setVisibility(View.VISIBLE);\n\n }", "@Override\n\t\tpublic void onTextChanged(CharSequence s, int start, int before, int count) {\n\t\t\ttry{\n\t\t\t\tbillAmount = Double.parseDouble(s.toString()) / 100.0;\n\t\t\t}\n\t\t\tcatch(NumberFormatException e)\n\t\t\t{\n\t\t\t\tbillAmount = 0.0;\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tamountDisplayTextView.setText(currencyFormat.format(billAmount));\n\t\t\tupdateStandard();\n\t\t\tupdateCustom();\n\t\t}", "public void subtractNumbers (View view) {\n errorTrap();\n double difference = Double.parseDouble(num1.getText().toString()) + Double.parseDouble(num1.getText().toString());\n result.setText(\"DIFFERENCE: \"+difference);\n }", "public void calculateAndDisplay() {\n fromUnitString = fromUnitEditText.getText().toString();\r\n if (fromUnitString.equals(\"\")) {\r\n fromValue = 0;\r\n }\r\n else {\r\n fromValue = Float.parseFloat(fromUnitString);\r\n }\r\n\r\n // calculate the \"to\" value\r\n toValue = fromValue * ratio;\r\n\r\n // display the results with formatting\r\n NumberFormat number = NumberFormat.getNumberInstance();\r\n number.setMaximumFractionDigits(2);\r\n number.setMinimumFractionDigits(2);\r\n toUnitTextView.setText(number.format(toValue));\r\n }", "public static void extract_money(){\n TOTALCMONEY = TOTALCMONEY - BALANCERETRIEVE; //the total cashier money equals the total cashier money minus the retrieve request\r\n BALANCE = BALANCE - BALANCERETRIEVE; //the user balance equals the account minus the retrieve request\r\n }", "public void deposit(String str)\n {\n startingBalance += Double.parseDouble(str);\n }", "public void tpsTax() {\n TextView tpsView = findViewById(R.id.checkoutPage_TPStaxValue);\n tpsTaxTotal = beforeTaxTotal * 0.05;\n tpsView.setText(String.format(\"$%.2f\", tpsTaxTotal));\n }", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tdct2--;\r\n\t\t\t\tif(dct2<0){\r\n\t\t\t\t\tdct2 = 0;\r\n\t\t\t\t\tdttotal = dttotal - 0;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdct2 = dct2;\r\n\t\t\t\t\tdttotal = dttotal - 180;\r\n\t\t\t\t}\r\n\t\t\t\tdtAdd2.setText(\"\" + dct2);\r\n\t\t\t\tdtotal.setText(\"Bill Scratch Pad : To Pay tk. \" + dttotal);\r\n\t\t\t}", "public\n double getValue() {\n double d;\n\n try {\n d = Double.parseDouble(getText());\n } catch (NumberFormatException e) {\n return 0;\n }\n return d;\n }", "public double makeAPayment(double annualLeaseAmount){\n double paymentMade = 0.0;//\n return paymentMade;\n /*Now it's 0.0. There must be a place somewhere\n that has a 'make a payment'\n button or text field or whatever...\n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ \n }", "private void calculate() {\n Log.d(\"MainActivity\", \"inside calculate method\");\n\n try {\n if (billAmount == 0.0);\n throw new Exception(\"\");\n }\n catch (Exception e){\n Log.d(\"MainActivity\", \"bill amount cannot be zero\");\n }\n // format percent and display in percentTextView\n textViewPercent.setText(percentFormat.format(percent));\n\n if (roundOption == 2) {\n tip = Math.ceil(billAmount * percent);\n total = billAmount + tip;\n }\n else if (roundOption == 3){\n tip = billAmount * percent;\n total = Math.ceil(billAmount + tip);\n }\n else {\n // calculate the tip and total\n tip = billAmount * percent;\n\n //use the tip example to do the same for the Total\n total = billAmount + tip;\n }\n\n // display tip and total formatted as currency\n //user currencyFormat instead of percentFormat to set the textViewTip\n tipAmount.setText(currencyFormat.format(tip));\n\n //use the tip example to do the same for the Total\n totalAmount.setText(currencyFormat.format(total));\n\n double person = total/nPeople;\n perPerson.setText(currencyFormat.format(person));\n }", "public void tvqTax() {\n TextView tvqView = findViewById(R.id.checkoutPage_TVQtaxValue);\n tvqTaxTotal = beforeTaxTotal * 0.09975;\n tvqView.setText(String.format(\"$%.2f\", tvqTaxTotal));\n }", "public static double getLoanAmount()\r\n {\r\n // Your code goes here ... use cut and paste as much as possible!\r\n int i = 0;\r\n double amount = 0;\r\nwhile (i == 0) {\r\n Scanner s = new Scanner(System.in);\r\n System.out.print(\"Enter loan amount (Example 120000.95): \");\r\n amount = Double.parseDouble(s.nextLine());\r\n\r\n if (amount < 50000 || amount > 1000000) {\r\n i = 0;\r\n }\r\n else {\r\n i = 1;\r\n }\r\n } \r\n return amount;\r\n\r\n\r\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tfloat n1=Float.parseFloat(a.getText().toString());\n\t\t float n2=Float.parseFloat(b.getText().toString());\n\n\t\t\t\top.setText(String.valueOf(n1-n2));\n\t\t\t}", "public static Double getlng(){\n Log.e(\"LONG\",sharedPreferences.getString(USER_LNG, String.valueOf(0.0)));\n return Double.parseDouble(sharedPreferences.getString(USER_LNG, String.valueOf(0.0)));\n\n\n }", "private static Double grabPriceText(String s_input, String s_label) {\n Pattern dollabillsyall = Pattern.compile(\"[0-9]{1,4}[.][0-9]{0,4}\");\n Matcher matcher = dollabillsyall.matcher(s_input);\n\n if (matcher.find())\n System.out.println(\"=== \" + s_label + \": \" + matcher.group(0));\n else\n System.out.println(\"=== \" + s_label + \": \" + \"no match\");\n\n return Double.parseDouble(matcher.group(0));\n }", "@Override\n public void onClick(View v) {\n String textoPrecoAlcool = precoAlcool.getText().toString();\n String textoPrecoGasolina = precoGasolina.getText().toString();\n\n //Converter valores de string para numericos\n Double valorAlcool = Double.parseDouble(textoPrecoAlcool);\n Double valorGasolina = Double.parseDouble(textoPrecoGasolina);\n\n if( textoPrecoAlcool.isEmpty() || textoPrecoGasolina.isEmpty()){\n resultado.setText(\"Nenhum valor passado para conversão!!\");\n }else {\n Double resultadoConversao = valorAlcool/valorGasolina;\n\n if( resultadoConversao >=0.7){\n //Gasolina compensa mais\n resultado.setText(\"É melhor utilizar gasolina.\");\n }else{\n resultado.setText(\"É melhor utilizar àlcool.\");\n }\n }\n }", "double getMoney();", "public void loanAmount_Validation() {\n\t\thelper.assertString(usrLoanAmount_AftrLogin(), payOffOffer.usrLoanAmount_BfrLogin());\n\t\tSystem.out.print(\"The loan amount is: \" + usrLoanAmount_AftrLogin());\n\n\t}", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdouble temp;\r\n\t\t\t\tif(chkBonus.isChecked())\r\n\t\t\t\t{\r\n\t\t\t\t\ttemp = Double.parseDouble(entity.getF_Price()) + 150000;\r\n\t\t\t\t\ttxtTotal.setText(Helper.formatNumberExcel(String.valueOf(temp)));\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\ttxtTotal.setText(Helper.formatNumberExcel(entity.getF_Price()));\r\n\t\t\t\t}\r\n\t\t\t}", "public String getAmount() {\n\n return amount.getText();\n }", "@Override\n public void onClick(View v) {\n int soluong = 0;\n try {\n soluong = Integer.parseInt(edittext.getText().toString()\n .replace(\",\", StringConst.EMPTY));\n } catch (Exception e) {\n // TODO: handle exception\n }\n if (tradeplace != null) {\n switch (tradeplace) {\n case StockItem.HOSE:\n soluong -= 10;\n if (soluong >= 0) {\n edittext.setText(String.valueOf(soluong));\n }\n break;\n case StockItem.HNX:\n soluong -= 100;\n if (soluong >= 0) {\n edittext.setText(String.valueOf(soluong));\n }\n break;\n case StockItem.UPCOM:\n soluong -= 100;\n if (soluong >= 0) {\n edittext.setText(String.valueOf(soluong));\n }\n break;\n\n default:\n break;\n }\n }\n\n }", "public void tinhtoan() {\n\t\t/*so1= Double.parseDouble(txtInput.getText().toString());\n\t\tcurResult=\"\";*/\n\t\ttry {\n\t\t\t\n\t\t\tDouble inNum = Double.parseDouble(simple.ThayDoi_Phay(curResult));\n\t\t\tcurResult = \"0\";\n\t\t\tif (pheptoan == ' ') {\n\t\t\t\tresult = inNum; //nhan gia tri vao result\n\t\t\t} else if (pheptoan == '+') {\n\t\t\t\tresult += inNum;\n\t\t\t\t//tinhtoan();\n\t\t\t\t//pheptoan = '+';\n\t\t\t\t//curResult=\"\";\n\t\t\t} else if (pheptoan == '-') {\n\t\t\t\t\n\t\t\t\tresult -= inNum;\n\n\t\t\t} else if (pheptoan == '*') {\n\t\t\t\tresult *= inNum;\n\n\t\t\t} else if (pheptoan == '/') {\n\t\t\t\tif(result==0){\n\n\t\t\t\t}else{\n\t\t\t\t\tresult /= inNum;\n\t\t\t\t}\n\t\t\t} else if (pheptoan == '=') {\n\t\t\t//\tToast.makeText(this.getContext(), \"Press C to continue...\", Toast.LENGTH_SHORT).show();\n\t\t\t\t// Keep the result for the next operation\\\n\t\t\t}\n\t\t\ttxtInput.setText(simple.LamTronSoFloat(result));\n\t\t} catch (Exception e) {\n\t\t\tLog.e(\"TAG\",\"Loi o Calculator.class->tinhtoan\" + e.getMessage());\n\t\t}\n\t\t\n\n\t}", "double getUnpaidAmount();", "public double convert(double amount, Unit u);", "public void withdraw(String str)\n {\n startingBalance -= Double.parseDouble(str);\n }", "public void onClick(View view) {\n if (isEmpty(networthEdit.getText()) || Double.parseDouble(networthEdit.getText().toString()) > 9000000.0 || isEmpty(amountSavedPerYearEdit.getText()) || Double.parseDouble(amountSavedPerYearEdit.getText().toString()) > 9000000.0 || isEmpty(targetRetirementAmountEdit.getText())|| Double.parseDouble(targetRetirementAmountEdit.getText().toString()) > 9000000.0 || Double.parseDouble(spendAmountEdit.getText().toString()) > 9000000.0) {\n\n //System.out.println(\"This is empty\");\n alertDialog.show();\n return;\n }\n\n else\n\n {\n //hide keyboard\n\n InputMethodManager inputManager = (InputMethodManager)\n getSystemService(Context.INPUT_METHOD_SERVICE);\n\n inputManager.hideSoftInputFromWindow((null == getCurrentFocus()) ? null : getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n\n // currency formatter\n NumberFormat formatter = NumberFormat.getCurrencyInstance();\n Double networthDouble = Double.parseDouble(networthEdit.getText().toString());\n Double amountSavedPerYearDouble = Double.parseDouble(amountSavedPerYearEdit.getText().toString());\n Double targetRetirementAmountDouble = Double.parseDouble(targetRetirementAmountEdit.getText().toString());\n Double spendAmountDouble = Double.parseDouble(spendAmountEdit.getText().toString());\n\n yearsUntilRetirementDouble = yearsUntilRetirementFunc(networthDouble, returnForSP500 - inflation, targetRetirementAmountDouble, 12.0*amountSavedPerYearDouble);\n\n if (spinner2.getSelectedItemPosition() == 0) { //once\n\n Double newYearsUntilRetirement = yearsUntilRetirementFunc(networthDouble + spendAmountDouble, returnForSP500 - inflation, targetRetirementAmountDouble, 12.0*amountSavedPerYearDouble);\n yearsUntilRetirementDifference = yearsUntilRetirementDouble - newYearsUntilRetirement;\n\n } else { //per month\n Double newYearsUntilRetirement = yearsUntilRetirementFunc(networthDouble, returnForSP500 - inflation, targetRetirementAmountDouble, 12.0*(amountSavedPerYearDouble + spendAmountDouble));\n yearsUntilRetirementDifference = yearsUntilRetirementDouble - newYearsUntilRetirement;\n }\n\n yearsUntilRetirementText.setText(String.format(\"%.2f\", yearsUntilRetirementDouble));\n\n\n summaryText.setText(\"If you saved $\" + spendAmountDouble.toString() + \" instead of spending it, you would be able to retire \" + String.format(\"%.2f\", yearsUntilRetirementDifference) + \" years, or \" + String.format(\"%.2f\", yearsUntilRetirementDifference * 365) + \" days earlier!\");\n return;\n\n\n }\n\n }", "public static void amountPaid(){\n NewProject.tot_paid = Double.parseDouble(getInput(\"Please enter NEW amount paid to date: \"));\r\n\r\n UpdateData.updatePayment();\r\n updateMenu();\t//Return back to previous menu.\r\n\r\n }", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tdct1--;\r\n\t\t\t\tif(dct1<0){\r\n\t\t\t\t\tdct1 = 0;\r\n\t\t\t\t\tdttotal = dttotal - 0;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdct1 = dct1;\r\n\t\t\t\t\tdttotal = dttotal - 120;\r\n\t\t\t\t}\r\n\t\t\t\tdtAdd1.setText(\"\" + dct1);\r\n\t\t\t\tdtotal.setText(\"Bill Scratch Pad : To Pay tk. \" + dttotal);\r\n\t\t\t}", "private void getSum() {\n double sum = 0;\n for (int i = 0; i < remindersTable.getRowCount(); i++) {\n sum = sum + parseDouble(remindersTable.getValueAt(i, 3).toString());\n }\n String rounded = String.format(\"%.2f\", sum);\n ledgerTxtField.setText(rounded);\n }", "public double getPaymentAmount() {\n\t\tdouble amount = 0.0;\n\t\tString content = \"\";\n\t\t\n\t\tWebElement temp = (new WebDriverWait(driver, waitTime))\n\t\t\t\t.until(ExpectedConditions.presenceOfElementLocated(By.id(\"totalAmt\")));\t\t\n\t\tcontent = temp.findElement(By.xpath(\"span[2]\")).getAttribute(\"innerHTML\");\n\t\tamount = Double.parseDouble(content);\n\t\treturn amount;\n\t}", "public double payOffLoan(double value)\r\n {\r\n loan -= value;\r\n\r\n double remainder = 0;\r\n\r\n if (loan < 0)\r\n {\r\n remainder = loan * -1;\r\n loan = 0;\r\n }\r\n\r\n return remainder;\r\n\r\n }", "public int getLoan() {\n\t\treturn loan;\n\t}", "public void calcPrecioTotal() {\n try {\n float result = precioUnidad * Float.parseFloat(unidades.getText().toString());\n prTotal.setText(String.valueOf(result) + \"€\");\n }catch (Exception e){\n prTotal.setText(\"0.0€\");\n }\n }", "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 }", "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 setLoanAmount(double loanAmount) {\n this.loanAmount = loanAmount;\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tfloat n1=Float.parseFloat(a.getText().toString());\n\t\t float n2=Float.parseFloat(b.getText().toString());\n\n\t\t\t\top.setText(String.valueOf(n1+n2));\n\t\t\t}", "public void convertiButton(View view){\n\n //log per controllare il funzionamento del bottone\n Log.i(\"Stato Botone\",\"Premuto\");\n\n //creo una variabile che associo il numero inserito nella barra di text viev\n //cercando l'input tramite id.\n EditText valuta=(EditText) findViewById(R.id.numeroConvertire);\n\n //con questo log riesco a controllare il valore inserito dall'utente\n Log.i(\"Il valore inserito\",valuta.getText().toString());\n\n //Assrgno il valore della variabile valuta alla stringa ammountEuroString.\n String ammoutEuroStringa=valuta.getText().toString();\n\n //converto la stringa in un Double con il metodo parseDouble\n double ammoutnEuroDouble=Double.parseDouble(ammoutEuroStringa);\n\n //effettuo le varie conversioi utilizzando il valore convertito in double\n double ammoutDollari=ammoutnEuroDouble*1.3;\n\n double ammountYen=ammoutnEuroDouble*3.4;\n\n double ammountYuhan=ammoutnEuroDouble*10.4;\n\n //il Toast mi consente di restituire il valore convertito.\n Toast.makeText(this,\"il valore da\"+\" Euro a dollari é=\"+ammoutDollari,Toast.LENGTH_SHORT).show();\n\n Toast.makeText(this,\"il valore da\"+\" Euro a Yen é=\"+ammountYen,Toast.LENGTH_SHORT).show();\n\n Toast.makeText(this,\"il valore da\"+\" Euro a Yuhan é=\"+ammountYuhan,Toast.LENGTH_SHORT).show();\n\n }", "private double promptForDepositAmount() {\n Screen screen = getScreen(); // get reference to screen\n // display the prompt\n screen.displayMessage(\"[?] Please enter a deposit amount in\\n\" +\n \" CENTS (or 0 to cancel): \");\n int input = keypad.getInput(); // receive input of deposit amount\n // check whether the user canceled or entered a valid amount\n if (input == CANCELED) {\n return CANCELED;\n } else {\n return (double) input / 100; // return dollar amount\n }\n }", "double getSalario();", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tdct2++;\r\n\t\t\t\tdtAdd2.setText(\"\" + dct2);\r\n\t\t\t\tdttotal = dttotal + 180;\r\n\t\t\t\tdtotal.setText(\"Bill Scratch Pad : To Pay tk. \" + dttotal);\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tdct3--;\r\n\t\t\t\tif(dct3<0){\r\n\t\t\t\t\tdct3 = 0;\r\n\t\t\t\t\tdttotal = dttotal - 0;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdct3 = dct3;\r\n\t\t\t\t\tdttotal = dttotal - 200;\r\n\t\t\t\t}\r\n\t\t\t\tdtAdd3.setText(\"\" + dct3);\r\n\t\t\t\tdtotal.setText(\"Bill Scratch Pad : To Pay tk. \" + dttotal);\r\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tfloat n1=Float.parseFloat(a.getText().toString());\n\t\t float n2=Float.parseFloat(b.getText().toString());\n\t\t\n\t\t\t\top.setText(String.valueOf(n1/n2));\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\tString ITR = txtITR.getText().toString();\n\n\t\t\t\tif (ITR.equals(\"\")) {\n\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"Please enter number\",\n\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t} else {\n\t\t\t\t\tint ans = 365 / Integer.parseInt(ITR);\n\n\t\t\t\t\ttxtAnswer.setText(Integer.toString(ans));\n\t\t\t\t}\n\n\n\t\t\t}", "private void calculate () {\n try {\n char[] expression = expressionView.getText().toString().trim().toCharArray();\n String temp = expressionView.getText().toString().trim();\n for (int i = 0; i < expression.length; i++) {\n if (expression[i] == '\\u00D7')\n expression[i] = '*';\n if (expression[i] == '\\u00f7')\n expression[i] = '/';\n if (expression[i] == '√')\n expression[i] = '²';\n }\n if (expression.length > 0) {\n Balan balan = new Balan();\n double realResult = balan.valueMath(String.copyValueOf(expression));\n int naturalResult;\n String finalResult;\n if (realResult % 1 == 0) {\n naturalResult = (int) Math.round(realResult);\n finalResult = String.valueOf(naturalResult);\n } else\n finalResult = String.valueOf(realResult);\n String error = balan.getError();\n // check error\n if (error != null) {\n mIsError = true;\n resultView.setText(error);\n if (error == \"Error div 0\")\n resultView.setText(\"Math Error\");\n } else { // show result\n expressionView.setText(temp);\n resultView.setText(finalResult);\n }\n }\n } catch (Exception e) {\n Toast.makeText(this,e.toString(),Toast.LENGTH_LONG);\n }\n }", "float getAmount();", "public static double getAmount(String value) {\n\t\tvalue = value.substring(1);\n\t\tdouble valueDouble = Double.parseDouble(value);\n\t\treturn valueDouble;\n\t}", "@Override\n public void onClick(View v) {\n try {\n\n //try to parse EditText text into a float\n Double paymentAmount = Double.parseDouble(mEditPaymentAmount.getText().toString());\n\n //check if the value is greater than 0\n if (Double.parseDouble(mEditPaymentAmount.getText().toString()) <= 0.00) {\n\n //Notify user payment must be greater than 0\n Toast.makeText(SubmitPaymentActivity.this, \"Amount must be more than $0.00\", Toast.LENGTH_SHORT).show();\n } else if (Math.round(Double.parseDouble(mEditPaymentAmount.getText().toString())) > Math.round(currentInvoice.getPrice())) {\n Toast.makeText(SubmitPaymentActivity.this, \"Amount cannot be greater than \" + currentInvoice.getPrice(), Toast.LENGTH_SHORT).show();\n } else {\n\n //Notify user of the payment acceptance\n Toast.makeText(SubmitPaymentActivity.this, \"Payment of \" + paymentAmount.toString() + \" Processed\", Toast.LENGTH_SHORT).show();\n\n double newBalance = currentInvoice.getPrice() - paymentAmount;\n\n if (newBalance <= 0.00) {\n newBalance = 0.00F;\n currentInvoice.setPaymentStatus(\"paid\");\n }\n\n currentInvoice.setPrice(newBalance);\n invoiceDao.update(currentInvoice);\n\n mTextViewBalance.setText(\"$\" + decimalFormat.format(currentInvoice.getPrice()));\n\n Toast.makeText(SubmitPaymentActivity.this, \"$\" + paymentAmount + \" Paid\", Toast.LENGTH_SHORT).show();\n\n //define home activity intent\n Intent intent = new Intent(SubmitPaymentActivity.this, PatientHomeActivity.class);\n //start activity\n startActivity(intent);\n\n }\n\n } catch (NumberFormatException e) {\n // Notify user payment amount must be entered\n Toast.makeText(SubmitPaymentActivity.this, \"Enter a Payment Amount\", Toast.LENGTH_SHORT).show();\n }\n\n }", "public String getAmountCredited() {\n\t\twaitForControl(driver, LiveGuru99.WithdrawallPage.GET_AMOUNT_DEPOSIT, timeWait);\n\t\tString amount = getText(driver, LiveGuru99.WithdrawallPage.GET_AMOUNT_DEPOSIT);\n\t\treturn amount;\n\t}", "public void convert_right()\n {\n //If the box is empty then empty the other box\n if (box_right.getText().toString().equals(\"\")) {\n app_input = true;\n box_left.setText(\"\");\n return;\n }\n\n long left_id = spinnerl.getSelectedItemId();\n long right_id = spinnerr.getSelectedItemId();\n\n double amount = Double.parseDouble(box_right.getText().toString());\n if (left_id == right_id)\n {\n app_input = true;\n box_left.setText(Double.toString(amount));\n return;\n }\n\n\n double left_value = left_id == 0 ? 1.0 : rates.rates.get(spinnerl.getSelectedItem().toString());\n double right_value = right_id == 0 ? 1.0 : rates.rates.get(spinnerr.getSelectedItem().toString());\n\n double result = amount / right_value * left_value;\n app_input = true;\n box_left.setText(Double.toString(result));\n }", "private void onBasketTotalChanged(String total){\n binding.textViewTotalValue.setText(String.format(\"$%s\", total));\n }", "double getPaidAmount();", "public void takeOutLoan(double value)\r\n {\r\n loan += value;\r\n addCash(value);\r\n }", "@Override\n public void onClick(View v) {\n a[0] = a[0] - 1;\n if (a[0] == 1) {\n tru.setVisibility(View.INVISIBLE);\n }\n sl.setText(String.valueOf(a[0]));\n int tong = Integer.parseInt(sl.getText().toString()) * Integer.parseInt(temp_gia);\n temp_sl.setText(sl.getText());\n temp_price.setText(price.getText());\n temp_total.setText(tong + \".000 đ\");\n }", "private double getTextToDouble(JTextField text) {\n try {\n Double.parseDouble(text.getText());\n\n } catch (NumberFormatException e) {\n JOptionPane.showMessageDialog(null, \"Input format for : \" + text.getText() + \" is illegal! Input number!\"\n , \"Error message\", JOptionPane.ERROR_MESSAGE);\n }\n return Double.parseDouble(text.getText());\n\n }", "private void calculateTip()\n {\n\t\ttry\n {\n\t\t\tbillAmount = Double.parseDouble(billAmountEditText.getText().toString());\n\t\t\thideKeyboard();\n loadTipPercentage();\n\t\t}\n catch (NumberFormatException ex)\n {\n\t\t\tbillAmount = 0;\n\t\t}\n try\n {\n numberPeople = Integer.parseInt(nbOfPpleView.getText().toString());\n hideKeyboard();\n loadTipPercentage();\n }\n catch (NumberFormatException ex)\n {\n numberPeople = 1;\n nbOfPpleView.setText(String.format(\"%d\", 1));\n }\n\t\t\n\t\ttipAmount = billAmount * tipPercentage;\n\t\ttotalAmount = billAmount + tipAmount;\n if (numberPeople > 0)\n {\n totalAmountByPerson = totalAmount / numberPeople;\n totalAmountByPerson = Math.ceil(totalAmountByPerson);\n }\n else\n {\n totalAmountByPerson = totalAmount;\n totalAmountByPerson = Math.ceil(totalAmountByPerson);\n }\n\n tipAmtView.setText(String.format(\"$%.2f\", tipAmount));\n totalAmtView.setText(String.format(\"$%.2f\", totalAmount));\n totalAmtByPersonView.setText(String.format(\"$%.0f\", totalAmountByPerson));\n\t}", "public void calcularTotal() {\n double valor = 0;\n String servico = (String)consultaSelecionada.getSelectedItem().toString();\n switch(servico) {\n case \"Consulta\":\n valor += 100;\n break;\n case \"Limpeza\":\n valor += 130;\n break;\n case \"Clareamento\":\n valor += 450;\n break;\n case \"Aparelho\":\n valor += 100;\n break;\n case \"Raio-x\":\n valor += 80;\n break;\n case \"Cirurgia\":\n valor += 70;\n break;\n }\n Total.setText(String.valueOf(valor));\n }", "public void afterTax() {\n TextView afterView = findViewById(R.id.checkoutPage_afterTaxValue);\n afterTaxTotal = beforeTaxTotal + tpsTaxTotal + tvqTaxTotal;\n afterView.setText(String.format(\"$%.2f\", afterTaxTotal));\n }", "public abstract double fromBasicUnit(double valueJTextInsert);" ]
[ "0.68901944", "0.6743956", "0.6568079", "0.65575397", "0.6494578", "0.6481042", "0.6464636", "0.63911104", "0.6341193", "0.63255805", "0.631663", "0.62941325", "0.6275098", "0.6236251", "0.6236251", "0.6207866", "0.61204135", "0.611987", "0.6101559", "0.6098905", "0.6091936", "0.60775363", "0.60523015", "0.6052033", "0.5965804", "0.59623146", "0.5961714", "0.5949312", "0.593061", "0.59285355", "0.5915428", "0.59001213", "0.58965933", "0.5885191", "0.5874815", "0.5874815", "0.5860567", "0.5821672", "0.581522", "0.58031315", "0.5801129", "0.5787071", "0.57828635", "0.5775125", "0.57687753", "0.5752433", "0.5743821", "0.5734231", "0.5717701", "0.5716069", "0.571555", "0.57122874", "0.5644455", "0.56406087", "0.56363523", "0.563328", "0.5632771", "0.56306225", "0.56152433", "0.55964655", "0.5593029", "0.5590242", "0.5589999", "0.55784845", "0.55565435", "0.5554366", "0.55508816", "0.5534017", "0.5522897", "0.5522621", "0.5517291", "0.5516582", "0.55132264", "0.5504237", "0.54978913", "0.5487609", "0.54762644", "0.5464611", "0.5461398", "0.5460203", "0.5459711", "0.5454974", "0.5452583", "0.5452131", "0.5452083", "0.5450424", "0.5449273", "0.5441344", "0.54324555", "0.54276085", "0.5426771", "0.5426196", "0.5424798", "0.5419676", "0.5417604", "0.5417351", "0.540616", "0.54034144", "0.53993535", "0.53928286" ]
0.68577594
1
choose the video encoder by name.
@TargetApi(Build.VERSION_CODES.JELLY_BEAN) private static MediaCodecInfo chooseVideoEncoder(String name) { int nbCodecs = MediaCodecList.getCodecCount(); for (int i = 0; i < nbCodecs; i++) { MediaCodecInfo mci = MediaCodecList.getCodecInfoAt(i); if (!mci.isEncoder()) { continue; } String[] types = mci.getSupportedTypes(); for (int j = 0; j < types.length; j++) { if (types[j].equalsIgnoreCase(VCODEC)) { LogUtil.i(TAG, String.format("vencoder %s types: %s", mci.getName(), types[j])); if (name == null) { return mci; } if (mci.getName().contains(name)) { return mci; } } } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getVideoPreset();", "private void configureEncoder() throws IOException\n {\n encoder = MediaCodec.createByCodecName(encoderName);\n MediaFormat mediaFormat = MediaFormat.createVideoFormat(MIME_TYPE, width, height);\n mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, BITRATE);\n mediaFormat.setInteger(MediaFormat.KEY_FRAME_RATE, FRAMERATE);\n mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, encoderColorFormat);\n mediaFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 1);\n encoder.configure(mediaFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);\n encoder.start();\n }", "abstract public VideoDefinition createVideoDefinitionFromName(String name);", "Codec getCurrentCodec();", "public String getName() {\r\n\t\t\treturn \"MyCodec\";\r\n\t\t}", "private static MediaCodecInfo selectCodec(String mimeType) {\n int numCodecs = MediaCodecList.getCodecCount();\n for (int i = 0; i < numCodecs; i++) {\n MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);\n\n if (!codecInfo.isEncoder()) {\n continue;\n }\n\n String[] types = codecInfo.getSupportedTypes();\n for (int j = 0; j < types.length; j++) {\n if (types[j].equalsIgnoreCase(mimeType)) {\n return codecInfo;\n }\n }\n }\n return null;\n }", "public static CodecInfo getCodecForType(String mimeType, boolean isEncoder)\n {\n for(CodecInfo codec : codecs)\n {\n if( !codec.isBanned()\n && codec.mediaType.equals(mimeType)\n && codec.codecInfo.isEncoder() == isEncoder )\n {\n return codec;\n }\n }\n return null;\n }", "public void setVideoPreset(String preset);", "@SuppressWarnings(\"WeakerAccess\")\n protected MediaEncoder(@NonNull String name) {\n mName = name;\n }", "public String getName() {\n return CODEC_NAME;\n }", "public String getVideoCodec() {\n return videoCodec;\n }", "void addEncoder(final MediaEncoder encoder) {\n\t\tif (encoder instanceof MediaVideoEncoderBase) {\n\t\t\tif (mVideoEncoder != null)\n\t\t\t\tthrow new IllegalArgumentException(\"Video encoder already added.\");\n\t\t\tmVideoEncoder = encoder;\n\t\t} else if (encoder instanceof MediaAudioEncoder) {\n\t\t\tif (mAudioEncoder != null)\n\t\t\t\tthrow new IllegalArgumentException(\"Video encoder already added.\");\n\t\t\tmAudioEncoder = encoder;\n\t\t} else\n\t\t\tthrow new IllegalArgumentException(\"unsupported encoder\");\n\t\tmEncoderCount = (mVideoEncoder != null ? 1 : 0) + (mAudioEncoder != null ? 1 : 0);\n\t}", "private static CharsetEncoder getCoder(String charset) throws UnsupportedEncodingException\n\t{\n\t\tcharset = charset.toLowerCase();\t\t\n\t\tif (charset.equals(\"iso-8859-1\") || charset.equals(\"latin1\"))\t\t\t\n\t\t\treturn new Latin1Encoder();\n\t\tif (charset.equals(\"utf-8\") || charset.equals(\"utf8\"))\t\t\t\n\t\t\treturn new UTF8Encoder();\n\t\t\n\t\tthrow new UnsupportedEncodingException(\"unsupported encoding \"+charset);\n\t}", "void savePreset(String name);", "public String getName()\n {\n return codecInfo.getName();\n }", "private void configurarCodec(){\n\n\t\t// Necessario para utilizar o Processor como um Player.\n\t\tprocessor.setContentDescriptor(null);\n\n\n\t\tfor (int i = 0; i < processor.getTrackControls().length; i++) {\n\n\t\t\tif (processor.getTrackControls()[i].getFormat() instanceof VideoFormat) {\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// Instantiate and set the frame access codec to the data flow path.\n\t\t\t\t\tTrackControl videoTrack = processor.getTrackControls()[i];\n\t\t\t\t\tCodec codec[] = { new CodecVideo() };\n\t\t\t\t\tvideoTrack.setCodecChain(codec);\n\t\t\t\t\tbreak;\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\n\t\t\t}\n\t\t}\n\n\t\tprocessor.prefetch();\n\n\t}", "public MyEncodableUsingEncoderDecoderName() {}", "public VideoDefinition getPreferredVideoDefinition();", "public void setVideoDisplayFilter(String filtername);", "public Codec getCodec();", "private MediaCodecSelector buildMediaCodecSelector(Context context) {\n\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());\n\n final boolean enablePassthroughDecoder = sharedPreferences.getBoolean(\n Constants.KEY_AUDIO_PASSTHROUGH_DECODER_ENABLED,\n context.getResources().getBoolean(R.bool.pref_default_audio_passthrough_decodeder_enabled));\n\n return new MediaCodecSelector() {\n @Override\n public List<MediaCodecInfo> getDecoderInfos(String mimeType, boolean requiresSecureDecoder, boolean requiresTunnelingDecoder) throws MediaCodecUtil.DecoderQueryException {\n return MediaCodecUtil.getDecoderInfos(mimeType, requiresSecureDecoder, requiresTunnelingDecoder);\n }\n\n @Override\n public MediaCodecInfo getPassthroughDecoderInfo() throws MediaCodecUtil.DecoderQueryException {\n if (enablePassthroughDecoder) {\n return MediaCodecUtil.getPassthroughDecoderInfo();\n }\n return null;\n }\n };\n }", "@Override\n public MessageEncoder getEncoder(int id) {\n return composerMap.get(id);\n }", "public static CompressorType fromString(String name) {\n for (CompressorType v : values()) {\n if (v.name().equalsIgnoreCase(name)) {\n return v;\n }\n }\n\n // cannot get here\n assert false;\n return null;\n }", "public static EBackendType getBackendByName(String name) {\n\t\treturn availableBackends().filter(backend -> backend.cc_name.equalsIgnoreCase(name)).findFirst().orElse(EBackendType.DEFAULT);\n\t}", "public void setVideoCodec(String videoCodec) {\n this.videoCodec = videoCodec;\n }", "private void doExtractDecodeEncodeMux(MediaExtractor videoExtractor,\n MediaExtractor audioExtractor, MediaCodec videoDecoder,\n MediaCodec videoEncoder, MediaCodec audioDecoder,\n MediaCodec audioEncoder, MediaMuxer muxer) {\n ByteBuffer[] videoDecoderInputBuffers = null;\n ByteBuffer[] videoDecoderOutputBuffers = null;\n ByteBuffer[] videoEncoderInputBuffers = null;\n ByteBuffer[] videoEncoderOutputBuffers = null;\n MediaCodec.BufferInfo videoDecoderOutputBufferInfo = null;\n MediaCodec.BufferInfo videoEncoderOutputBufferInfo = null;\n if (mCopyVideo) {\n videoDecoderInputBuffers = videoDecoder.getInputBuffers();\n videoDecoderOutputBuffers = videoDecoder.getOutputBuffers();\n videoEncoderInputBuffers = videoEncoder.getInputBuffers();\n videoEncoderOutputBuffers = videoEncoder.getOutputBuffers();\n videoDecoderOutputBufferInfo = new MediaCodec.BufferInfo();\n videoEncoderOutputBufferInfo = new MediaCodec.BufferInfo();\n }\n ByteBuffer[] audioDecoderInputBuffers = null;\n ByteBuffer[] audioDecoderOutputBuffers = null;\n ByteBuffer[] audioEncoderInputBuffers = null;\n ByteBuffer[] audioEncoderOutputBuffers = null;\n MediaCodec.BufferInfo audioDecoderOutputBufferInfo = null;\n MediaCodec.BufferInfo audioEncoderOutputBufferInfo = null;\n if (mCopyAudio) {\n audioDecoderInputBuffers = audioDecoder.getInputBuffers();\n audioDecoderOutputBuffers = audioDecoder.getOutputBuffers();\n audioEncoderInputBuffers = audioEncoder.getInputBuffers();\n audioEncoderOutputBuffers = audioEncoder.getOutputBuffers();\n audioDecoderOutputBufferInfo = new MediaCodec.BufferInfo();\n audioEncoderOutputBufferInfo = new MediaCodec.BufferInfo();\n }\n // We will get these from the decoders when notified of a format change.\n MediaFormat decoderOutputVideoFormat = null;\n MediaFormat decoderOutputAudioFormat = null;\n // We will get these from the encoders when notified of a format change.\n MediaFormat encoderOutputVideoFormat = null;\n MediaFormat encoderOutputAudioFormat = null;\n // We will determine these once we have the output format.\n int outputVideoTrack = -1;\n int outputAudioTrack = -1;\n // Whether things are done on the video side.\n boolean videoExtractorDone = false;\n boolean videoDecoderDone = false;\n boolean videoEncoderDone = false;\n // Whether things are done on the audio side.\n boolean audioExtractorDone = false;\n boolean audioDecoderDone = false;\n boolean audioEncoderDone = false;\n // The video decoder output buffer to process, -1 if none.\n int pendingVideoDecoderOutputBufferIndex = -1;\n // The audio decoder output buffer to process, -1 if none.\n int pendingAudioDecoderOutputBufferIndex = -1;\n\n boolean muxing = false;\n\n int videoExtractedFrameCount = 0;\n int videoDecodedFrameCount = 0;\n int videoEncodedFrameCount = 0;\n\n int audioExtractedFrameCount = 0;\n int audioDecodedFrameCount = 0;\n int audioEncodedFrameCount = 0;\n boolean mVideoConfig = false;\n boolean mainVideoFrame = false;\n long mLastVideoSampleTime = 0;\n long mVideoSampleTime = 0;\n\n boolean mAudioConfig = false;\n boolean mainAudioFrame = false;\n long mLastAudioSampleTime = 0;\n long mAudioSampleTime = 0;\n while (!interrupted&& ((mCopyVideo && !videoEncoderDone) || (mCopyAudio && !audioEncoderDone))) {\n //###########################Video###################################\n // Extract video from file and feed to decoder.\n // Do not extract video if we have determined the output format but\n // we are not yet ready to mux the frames.\n while (mCopyVideo && !videoExtractorDone\n && (encoderOutputVideoFormat == null || muxing)) {\n int decoderInputBufferIndex = videoDecoder\n .dequeueInputBuffer(TIMEOUT_USEC);\n if (decoderInputBufferIndex <= MediaCodec.INFO_TRY_AGAIN_LATER) {\n Log.d(\"wanlijun\", \"no video decoder input buffer: \"\n + decoderInputBufferIndex);\n break;\n }\n Log.d(\"wanlijun\",\n \"video decoder dequeueInputBuffer: returned input buffer: \"\n + decoderInputBufferIndex);\n ByteBuffer decoderInputBuffer = videoDecoderInputBuffers[decoderInputBufferIndex];\n int size = videoExtractor.readSampleData(decoderInputBuffer, 0);\n if (videoExtractor.getSampleFlags() == MediaExtractor.SAMPLE_FLAG_SYNC) {\n Log.d(\"wanlijun\",\" video decoder SAMPLE_FLAG_SYNC \");\n }\n long presentationTime = videoExtractor.getSampleTime();\n Log.d(\"wanlijun\", \"video extractor: returned buffer of size \"\n + size);\n Log.d(\"wanlijun\", \"video extractor: returned buffer for time \"\n + presentationTime);\n if (size > 0) {\n videoDecoder.queueInputBuffer(decoderInputBufferIndex, 0,\n size, presentationTime,\n videoExtractor.getSampleFlags());\n }\n videoExtractorDone = !videoExtractor.advance();\n if (videoExtractorDone) {\n Log.d(\"wanlijun\", \"video extractor: EOS\");\n videoDecoder.queueInputBuffer(decoderInputBufferIndex, 0,\n 0, 0, MediaCodec.BUFFER_FLAG_END_OF_STREAM);\n }\n videoExtractedFrameCount++;\n // We extracted a frame, let's try something else next.\n break;\n }\n //###########################Audio###################################\n // Extract audio from file and feed to decoder.\n // Do not extract audio if we have determined the output format but\n // we are not yet ready to mux the frames.\n while (mCopyAudio && !audioExtractorDone\n && (encoderOutputAudioFormat == null || muxing)) {\n int decoderInputBufferIndex = audioDecoder.dequeueInputBuffer(TIMEOUT_USEC);\n if (decoderInputBufferIndex <= MediaCodec.INFO_TRY_AGAIN_LATER) {\n Log.d(\"wanlijun\", \"no audio decoder input buffer: \"+decoderInputBufferIndex);\n break;\n }\n Log.d(\"wanlijun\", \"audio decoder dequeueInputBuffer: returned input buffer: \"\n + decoderInputBufferIndex);\n ByteBuffer decoderInputBuffer = audioDecoderInputBuffers[decoderInputBufferIndex];\n int size = audioExtractor.readSampleData(decoderInputBuffer, 0);\n long presentationTime = audioExtractor.getSampleTime();\n Log.d(\"wanlijun\", \"audio extractor: returned buffer of size \"\n + size);\n Log.d(\"wanlijun\", \"audio extractor: returned buffer for time \"\n + presentationTime);\n if (size > 0) {\n audioDecoder.queueInputBuffer(decoderInputBufferIndex, 0,\n size, presentationTime,\n audioExtractor.getSampleFlags());\n }\n audioExtractorDone = !audioExtractor.advance();\n if (audioExtractorDone) {\n Log.d(\"wanlijun\", \"audio extractor: EOS\");\n audioDecoder.queueInputBuffer(decoderInputBufferIndex, 0,\n 0, 0, MediaCodec.BUFFER_FLAG_END_OF_STREAM);\n }\n audioExtractedFrameCount++;\n // We extracted a frame, let's try something else next.\n break;\n }\n\n // Poll output frames from the video decoder and feed the encoder.\n while (mCopyVideo && !videoDecoderDone\n && pendingVideoDecoderOutputBufferIndex == -1\n && (encoderOutputVideoFormat == null || muxing)) {\n int decoderOutputBufferIndex = videoDecoder.dequeueOutputBuffer(videoDecoderOutputBufferInfo,\n TIMEOUT_USEC);\n if (decoderOutputBufferIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {\n Log.d(\"wanlijun\", \"no video decoder output buffer\");\n break;\n }else if (decoderOutputBufferIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {\n //do what for this?\n decoderOutputVideoFormat = videoDecoder.getOutputFormat();\n Log.d(\"wanlijun\", \"video decoder: output format changed: \" + decoderOutputVideoFormat);\n break;\n }else if (decoderOutputBufferIndex == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {\n Log.d(\"wanlijun\", \"video decoder: output buffers changed\");\n videoDecoderOutputBuffers = videoDecoder.getOutputBuffers();\n break;\n }\n\n if ((videoDecoderOutputBufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0) {\n Log.d(\"wanlijun\", \"video decoder: codec config buffer\");\n videoDecoder.releaseOutputBuffer(decoderOutputBufferIndex,false);\n break;\n }\n Log.d(\"wanlijun\", \"video decoder: returned buffer for time \"\n + videoDecoderOutputBufferInfo.presentationTimeUs);\n\n pendingVideoDecoderOutputBufferIndex = decoderOutputBufferIndex;\n videoDecodedFrameCount++;\n // We extracted a pending frame, let's try something else next.\n break;\n }\n\n // Feed the pending decoded audio buffer to the video encoder.\n while (mCopyVideo && pendingVideoDecoderOutputBufferIndex != -1) {\n Log.d(\"wanlijun\",\"video decoder: attempting to process pending buffer: \"\n + pendingVideoDecoderOutputBufferIndex);\n int encoderInputBufferIndex = videoEncoder.dequeueInputBuffer(TIMEOUT_USEC);\n if (encoderInputBufferIndex <= MediaCodec.INFO_TRY_AGAIN_LATER) {\n Log.d(\"wanlijun\", \"no video encoder input buffer: \"\n +encoderInputBufferIndex);\n break;\n }\n Log.d(\"wanlijun\", \"video encoder: returned input buffer: \"\n + encoderInputBufferIndex);\n ByteBuffer encoderInputBuffer = videoEncoderInputBuffers[encoderInputBufferIndex];\n int size = videoDecoderOutputBufferInfo.size;\n long presentationTime = videoDecoderOutputBufferInfo.presentationTimeUs;\n Log.d(\"wanlijun\", \"video decoder: processing pending buffer: \"\n + pendingVideoDecoderOutputBufferIndex);\n Log.d(\"wanlijun\", \"video decoder: pending buffer of size \" + size);\n Log.d(\"wanlijun\", \"video decoder: pending buffer for time \"\n + presentationTime);\n if (size >= 0) {\n\n try {\n ByteBuffer decoderOutputBuffer = videoDecoderOutputBuffers[pendingVideoDecoderOutputBufferIndex]\n .duplicate();\n decoderOutputBuffer\n .position(videoDecoderOutputBufferInfo.offset);\n decoderOutputBuffer\n .limit(videoDecoderOutputBufferInfo.offset + size);\n encoderInputBuffer.position(0);\n encoderInputBuffer.put(decoderOutputBuffer);\n //size not enable\n videoEncoder.queueInputBuffer(encoderInputBufferIndex, 0,\n size, presentationTime,\n videoDecoderOutputBufferInfo.flags);\n } catch (Exception e) {\n // TODO: handle exception\n e.printStackTrace();\n }\n\n }\n videoDecoder.releaseOutputBuffer(\n pendingVideoDecoderOutputBufferIndex, false);\n pendingVideoDecoderOutputBufferIndex = -1;\n if ((videoDecoderOutputBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {\n Log.d(\"wanlijun\", \"video decoder: EOS\");\n videoDecoderDone = true;\n }\n // We enqueued a pending frame, let's try something else next.\n break;\n }\n // Poll frames from the video encoder and send them to the muxer.\n while (mCopyVideo && !videoEncoderDone\n && (encoderOutputVideoFormat == null || muxing)) {\n // can not get avilabel outputBuffers?\n int encoderOutputBufferIndex = videoEncoder.dequeueOutputBuffer(videoEncoderOutputBufferInfo,\n TIMEOUT_USEC);\n if (encoderOutputBufferIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {\n Log.d(\"wanlijun\", \"no video encoder output buffer\");\n break;\n }else if (encoderOutputBufferIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {\n Log.d(\"wanlijun\", \"video encoder: output format changed\");\n if (outputVideoTrack >= 0) {\n // fail(\"video encoder changed its output format again?\");\n Log.d(\"wanlijun\",\"video encoder changed its output format again?\");\n }\n encoderOutputVideoFormat = videoEncoder.getOutputFormat();\n break;\n }else if (encoderOutputBufferIndex == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {\n Log.d(\"wanlijun\", \"video encoder: output buffers changed\");\n videoEncoderOutputBuffers = videoEncoder.getOutputBuffers();\n break;\n }\n\n // assertTrue(\"should have added track before processing output\", muxing);\n Log.d(\"wanlijun\", \"video encoder: returned output buffer: \"\n + encoderOutputBufferIndex);\n Log.d(\"wanlijun\", \"video encoder: returned buffer of size \"\n + videoEncoderOutputBufferInfo.size);\n ByteBuffer encoderOutputBuffer = videoEncoderOutputBuffers[encoderOutputBufferIndex];\n if ((videoEncoderOutputBufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0) {\n Log.d(\"wanlijun\", \"video encoder: codec config buffer\");\n // Simply ignore codec config buffers.\n mVideoConfig = true;\n videoEncoder.releaseOutputBuffer(encoderOutputBufferIndex,false);\n break;\n }\n\n\n if(mVideoConfig){\n if(!mainVideoFrame){\n mLastVideoSampleTime = videoEncoderOutputBufferInfo.presentationTimeUs;\n mainVideoFrame = true;\n }else{\n if(mVideoSampleTime == 0){\n mVideoSampleTime = videoEncoderOutputBufferInfo.presentationTimeUs - mLastVideoSampleTime;\n }\n }\n }\n videoEncoderOutputBufferInfo.presentationTimeUs = mLastVideoSampleTime + mVideoSampleTime;\n if (videoEncoderOutputBufferInfo.size != 0) {\n muxer.writeSampleData(outputVideoTrack,\n encoderOutputBuffer, videoEncoderOutputBufferInfo);\n mLastVideoSampleTime = videoEncoderOutputBufferInfo.presentationTimeUs;\n }\n\n if ((videoEncoderOutputBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {\n Log.d(\"wanlijun\", \"video encoder: EOS\");\n videoEncoderDone = true;\n }\n videoEncoder.releaseOutputBuffer(encoderOutputBufferIndex,\n false);\n videoEncodedFrameCount++;\n // We enqueued an encoded frame, let's try something else next.\n break;\n }\n\n // Poll output frames from the audio decoder.\n // Do not poll if we already have a pending buffer to feed to the\n // encoder.\n while (mCopyAudio && !audioDecoderDone\n && pendingAudioDecoderOutputBufferIndex == -1\n && (encoderOutputAudioFormat == null || muxing)) {\n int decoderOutputBufferIndex = audioDecoder\n .dequeueOutputBuffer(audioDecoderOutputBufferInfo,TIMEOUT_USEC);\n if (decoderOutputBufferIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {\n Log.d(\"wanlijun\", \"no audio decoder output buffer\");\n break;\n }else if (decoderOutputBufferIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {\n decoderOutputAudioFormat = audioDecoder.getOutputFormat();\n Log.d(\"wanlijun\", \"audio decoder: output format changed: \" + decoderOutputAudioFormat);\n break;\n }else if (decoderOutputBufferIndex == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {\n Log.d(\"wanlijun\", \"audio decoder: output buffers changed\");\n audioDecoderOutputBuffers = audioDecoder.getOutputBuffers();\n break;\n }\n\n Log.d(\"wanlijun\", \"audio decoder: returned output buffer: \"\n + decoderOutputBufferIndex);\n Log.d(\"wanlijun\", \"audio decoder: returned buffer of size \"\n + audioDecoderOutputBufferInfo.size);\n Log.d(\"wanlijun\", \"audio decoder: returned buffer for time \"\n + audioDecoderOutputBufferInfo.presentationTimeUs);\n\n if ((audioDecoderOutputBufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0) {\n Log.d(\"wanlijun\", \"audio decoder: codec config buffer\");\n audioDecoder.releaseOutputBuffer(decoderOutputBufferIndex,false);\n break;\n }\n\n\n pendingAudioDecoderOutputBufferIndex = decoderOutputBufferIndex;\n audioDecodedFrameCount++;\n // We extracted a pending frame, let's try something else next.\n break;\n }\n\n // Feed the pending decoded audio buffer to the audio encoder.\n while (mCopyAudio && pendingAudioDecoderOutputBufferIndex != -1) {\n Log.d(\"wanlijun\",\"audio decoder: attempting to process pending buffer: \"+ pendingAudioDecoderOutputBufferIndex);\n int encoderInputBufferIndex = audioEncoder.dequeueInputBuffer(TIMEOUT_USEC);\n if (encoderInputBufferIndex <= MediaCodec.INFO_TRY_AGAIN_LATER) {\n Log.d(\"wanlijun\", \"no audio encoder input buffer: \"+encoderInputBufferIndex);\n break;\n }\n Log.d(\"wanlijun\", \"audio encoder: returned input buffer: \"+ encoderInputBufferIndex);\n ByteBuffer encoderInputBuffer = audioEncoderInputBuffers[encoderInputBufferIndex];\n int size = audioDecoderOutputBufferInfo.size;\n long presentationTime = audioDecoderOutputBufferInfo.presentationTimeUs;\n Log.d(\"wanlijun\", \"audio decoder: processing pending buffer: \"+ pendingAudioDecoderOutputBufferIndex);\n Log.d(\"wanlijun\", \"audio decoder: pending buffer of size \" + size);\n Log.d(\"wanlijun\", \"audio decoder: pending buffer for time \"+ presentationTime);\n if (size >= 0) {\n try {\n ByteBuffer decoderOutputBuffer = audioDecoderOutputBuffers[pendingAudioDecoderOutputBufferIndex]\n .duplicate();\n decoderOutputBuffer\n .position(audioDecoderOutputBufferInfo.offset);\n decoderOutputBuffer\n .limit(audioDecoderOutputBufferInfo.offset + size);\n encoderInputBuffer.position(0);\n encoderInputBuffer.put(decoderOutputBuffer);\n audioEncoder.queueInputBuffer(encoderInputBufferIndex, 0,\n audioDecoderOutputBufferInfo.offset + size, presentationTime,\n audioDecoderOutputBufferInfo.flags);\n\n } catch (Exception e) {\n // TODO: handle exception\n e.printStackTrace();\n }\n\n }\n audioDecoder.releaseOutputBuffer(pendingAudioDecoderOutputBufferIndex, false);\n pendingAudioDecoderOutputBufferIndex = -1;\n if ((audioDecoderOutputBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {\n Log.d(\"wanlijun\", \"audio decoder: EOS\");\n audioDecoderDone = true;\n }\n // We enqueued a pending frame, let's try something else next.\n break;\n }\n\n // Poll frames from the audio encoder and send them to the muxer.\n while (mCopyAudio && !audioEncoderDone\n && (encoderOutputAudioFormat == null || muxing)) {\n int encoderOutputBufferIndex = audioEncoder\n .dequeueOutputBuffer(audioEncoderOutputBufferInfo,TIMEOUT_USEC);\n if (encoderOutputBufferIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {\n Log.d(\"wanlijun\", \"no audio encoder output buffer\");\n break;\n }else if (encoderOutputBufferIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {\n Log.d(\"wanlijun\", \"audio encoder: output format changed\");\n if (outputAudioTrack >= 0) {\n // fail(\"audio encoder changed its output format again?\");\n Log.d(\"wanlijun\",\"audio encoder changed its output format again?\");\n }\n encoderOutputAudioFormat = audioEncoder.getOutputFormat();\n break;\n }else if (encoderOutputBufferIndex == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {\n Log.d(\"wanlijun\", \"audio encoder: output buffers changed\");\n audioEncoderOutputBuffers = audioEncoder.getOutputBuffers();\n break;\n }\n // assertTrue(\"should have added track before processing output\",muxing);\n Log.d(\"wanlijun\", \"audio encoder: returned output buffer: \"\n + encoderOutputBufferIndex);\n Log.d(\"wanlijun\", \"audio encoder: returned buffer of size \"\n + audioEncoderOutputBufferInfo.size);\n ByteBuffer encoderOutputBuffer = audioEncoderOutputBuffers[encoderOutputBufferIndex];\n if ((audioEncoderOutputBufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0) {\n Log.d(\"wanlijun\", \"audio encoder: codec config buffer\");\n // Simply ignore codec config buffers.\n mAudioConfig = true;\n audioEncoder.releaseOutputBuffer(encoderOutputBufferIndex,false);\n break;\n }\n Log.d(\"wanlijun\", \" audio encoder: returned buffer for time \"\n + audioEncoderOutputBufferInfo.presentationTimeUs);\n\n if(mAudioConfig){\n if(!mainAudioFrame){\n mLastAudioSampleTime = audioEncoderOutputBufferInfo.presentationTimeUs;\n mainAudioFrame = true;\n }else{\n if(mAudioSampleTime == 0){\n mAudioSampleTime = audioEncoderOutputBufferInfo.presentationTimeUs - mLastAudioSampleTime;\n }\n }\n }\n\n audioEncoderOutputBufferInfo.presentationTimeUs = mLastAudioSampleTime + mAudioSampleTime;\n if (audioEncoderOutputBufferInfo.size != 0) {\n muxer.writeSampleData(outputAudioTrack,\n encoderOutputBuffer, audioEncoderOutputBufferInfo);\n mLastAudioSampleTime = audioEncoderOutputBufferInfo.presentationTimeUs;\n }\n\n if ((audioEncoderOutputBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {\n Log.d(\"wanlijun\", \"audio encoder: EOS\");\n audioEncoderDone = true;\n }\n audioEncoder.releaseOutputBuffer(encoderOutputBufferIndex,false);\n audioEncodedFrameCount++;\n // We enqueued an encoded frame, let's try something else next.\n break;\n }\n\n if (!muxing && (!mCopyAudio || encoderOutputAudioFormat != null)\n && (!mCopyVideo || encoderOutputVideoFormat != null)) {\n if (mCopyVideo) {\n Log.d(\"wanlijun\", \"muxer: adding video track.\");\n outputVideoTrack = muxer.addTrack(encoderOutputVideoFormat);\n }\n if (mCopyAudio) {\n Log.d(\"wanlijun\", \"muxer: adding audio track.\");\n outputAudioTrack = muxer.addTrack(encoderOutputAudioFormat);\n }\n Log.d(\"wanlijun\", \"muxer: starting\");\n muxer.start();\n muxing = true;\n }\n }\n Log.d(\"wanlijun\", \"exit looper\");\n }", "public Video getVideoByName(String name) {\n\t\tSQLiteDatabase db = this.getReadableDatabase();\n\t\t/*\n\t\t * Cursor cursor = db.query(TABLE_CONTACTS, new String[] { KEY_ID,\n\t\t * KEY_NAME, KEY_PH_NO }, KEY_ID + \"=?\", new String[] {\n\t\t * String.valueOf(id) }, null, null, null, null);\n\t\t */\n\t\tCursor cursor = db.query(VivaFrame.TABLE_NAME, new String[] {\n\t\t\t\tVivaFrame.COLUMN_NAME_VI_ID, VivaFrame.COLUMN_NAME_VI_FOLDER,\n\t\t\t\tVivaFrame.COLUMN_NAME_VI_NAME, VivaFrame.COLUMN_NAME_VI_URL },\n\t\t\t\tVivaFrame.COLUMN_NAME_VI_NAME + \"=?\",\n\t\t\t\tnew String[] { String.valueOf(name) }, null, null, null, null);\n\t\tif (cursor != null)\n\t\t\tcursor.moveToFirst();\n\n\t\tVideo video = new Video(Integer.parseInt(cursor.getString(0)),\n\t\t\t\tInteger.parseInt(cursor.getString(1)), cursor.getString(2),\n\t\t\t\tcursor.getString(3));\n\t\t// return contact\n\t\treturn video;\n\t}", "public CsiAdaptorProtocol getAdaptorByDriverName(String driverName) {\n return csiAdaptorMap.get(driverName);\n }", "public AbstractVCFCodec getCodec();", "ICodecExecutor createCodecExecutor(Object identifier);", "@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)\n public MediaFormat getEncoderFormat() {\n return super.getEncoderVideoFormat(MIME_TYPE, mWidth, mHeight, mBitRate, FRAME_RATE, IFRAME_INTERVAL);\n }", "public void setCodec(Codec codec);", "public String getVideoDisplayFilter();", "private static Charset lookup(String enc) {\n try {\n if (enc != null && Charset.isSupported(enc)) {\n return Charset.forName(enc);\n }\n } catch (IllegalArgumentException ex) {\n // illegal charset name\n // unsupport charset\n }\n return null;\n }", "public static WebDriver getDriver(String browsername)\n\t{\n\t\t\n\t\tWebDriver dri;\n\t\t\n\t\t\n\t\tif(browsername.equalsIgnoreCase(\"chrome\")) {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Chrome_Driver\\\\chromedriver.exe\"); \n\t\tdri = new ChromeDriver();\n\t\t}\n\t\t\n\t\telse{\n\t\t\t\n\t\t\tSystem.setProperty(\"webdriver.edge.driver\",\"C:\\\\Edge_Driver\\\\msedgedriver.exe\"); \n\t\t\tdri = new ChromeDriver(); //replace else if loop with switch\n\t\t\t\n\t\t}\n\t\t\n//\t\telse{\n//\t\t\t\n//\t\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Chrome_Driver\\\\chromedriver.exe\"); \n//\t\t\tdri = new ChromeDriver();\n//\t\t\t\n//\t\t}\n\t\t\n\t\treturn dri;\n\t\t\n\t}", "@Override\n\tpublic void selectAlgorithm(String algorithmName) {\n\t\tproblem.setAlgorithm(algorithmName);\n\t}", "static public void registerWithVideoIO() { // add FFMPeg video types, if\n\t\t\t\t\t\t\t\t\t\t\t\t// available\n\t\ttry {\n\t\t\tVideoIO.addVideoEngine(new FFMPegVideoType());\n\t\t\t// register all supported audio/video types with ffmpeg\n\t\t\tav_register_all();\n\t\t\t// add common video types shared with QuickTime\n\t\t\tfor (String ext : VideoIO.VIDEO_EXTENSIONS) { // {\"mov\", \"avi\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"mp4\"}\n\t\t\t\tVideoFileFilter filter = new VideoFileFilter(ext,\n\t\t\t\t\t\tnew String[] { ext });\n\t\t\t\tFFMPegVideoType ffmpegType = new FFMPegVideoType(filter);\n\t\t\t\tVideoIO.addVideoType(ffmpegType);\n\t\t\t\tResourceLoader.addExtractExtension(ext);\n\t\t\t}\n\t\t\t// add additional ffmpeg types\n\t\t\t// FLV\n\t\t\tVideoFileFilter filter = new VideoFileFilter(\n\t\t\t\t\t\"flv\", new String[] { \"flv\" }); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\tVideoIO.addVideoType(new FFMPegVideoType(filter));\n\t\t\tResourceLoader.addExtractExtension(\"flv\"); //$NON-NLS-1$\n\t\t\t// 3GP\n\t\t\tfilter = new VideoFileFilter(\"3gp\", new String[] { \"3gp\" }); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\tFFMPegVideoType vidType = new FFMPegVideoType(filter);\n\t\t\tvidType.setRecordable(false);\n\t\t\tVideoIO.addVideoType(vidType);\n\t\t\tResourceLoader.addExtractExtension(\"3gp\"); //$NON-NLS-1$\n\t\t\t// WMV\n\t\t\tfilter = new VideoFileFilter(\"asf\", new String[] { \"wmv\" }); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\tVideoIO.addVideoType(new FFMPegVideoType(filter));\n\t\t\tResourceLoader.addExtractExtension(\"wmv\"); //$NON-NLS-1$\n\t\t\t// DV\n\t\t\tfilter = new VideoFileFilter(\"dv\", new String[] { \"dv\" }); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\tvidType = new FFMPegVideoType(filter);\n\t\t\tvidType.setRecordable(false);\n\t\t\tVideoIO.addVideoType(vidType);\n\t\t\tResourceLoader.addExtractExtension(\"dv\"); //$NON-NLS-1$\n\t\t\t// MTS\n\t\t\tfilter = new VideoFileFilter(\"mts\", new String[] { \"mts\" }); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\tvidType = new FFMPegVideoType(filter);\n\t\t\tvidType.setRecordable(false);\n\t\t\tVideoIO.addVideoType(vidType);\n\t\t\tResourceLoader.addExtractExtension(\"mts\"); //$NON-NLS-1$\n\t\t\t// M2TS\n\t\t\tfilter = new VideoFileFilter(\"m2ts\", new String[] { \"m2ts\" }); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\tvidType = new FFMPegVideoType(filter);\n\t\t\tvidType.setRecordable(false);\n\t\t\tVideoIO.addVideoType(vidType);\n\t\t\tResourceLoader.addExtractExtension(\"m2ts\"); //$NON-NLS-1$\n\t\t\t// MPG\n\t\t\tfilter = new VideoFileFilter(\"mpg\", new String[] { \"mpg\" }); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\tvidType = new FFMPegVideoType(filter);\n\t\t\tvidType.setRecordable(false);\n\t\t\tVideoIO.addVideoType(vidType);\n\t\t\tResourceLoader.addExtractExtension(\"mpg\"); //$NON-NLS-1$\n\t\t\t// MOD\n\t\t\tfilter = new VideoFileFilter(\"mod\", new String[] { \"mod\" }); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\tvidType = new FFMPegVideoType(filter);\n\t\t\tvidType.setRecordable(false);\n\t\t\tVideoIO.addVideoType(vidType);\n\t\t\tResourceLoader.addExtractExtension(\"mod\"); //$NON-NLS-1$\n\t\t\t// OGG\n\t\t\tfilter = new VideoFileFilter(\"ogg\", new String[] { \"ogg\", \"ogv\" }); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\tvidType = new FFMPegVideoType(filter);\n\t\t\tvidType.setRecordable(false);\n\t\t\tVideoIO.addVideoType(vidType);\n\t\t\tResourceLoader.addExtractExtension(\"mod\"); //$NON-NLS-1$\n\t\t\tfilter = new VideoFileFilter(\"webm\", new String[] {\"webm\"}); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\tvidType = new FFMPegVideoType(filter);\n\t\t\tvidType.setRecordable(false);\n\t\t\tVideoIO.addVideoType(vidType);\n\t\t\tResourceLoader.addExtractExtension(\"webm\"); //$NON-NLS-1$\n\t\t} catch (Exception ex) { // ffmpeg not working\n\t\t\tOSPLog.config(\"ffmpeg exception: \" + ex.toString()); //$NON-NLS-1$\n\t\t} catch (Error er) { // ffmpeg not working\n\t\t\tOSPLog.config(\"ffmpeg error: \" + er.toString()); //$NON-NLS-1$\n\t\t}\n\t}", "public void ConfigEncoder() {\n\t\tRobotMap.backLeft.setStatusFramePeriod(StatusFrameEnhanced.Status_2_Feedback0, 1, 1);\n\t\tRobotMap.backLeft.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, 0, 1);\n\t\tRobotMap.backLeft.setSelectedSensorPosition(0, 0, 1);\n\t\tRobotMap.backLeft.setSensorPhase(true);\n\t\tRobotMap.backLeft.setSafetyEnabled(false);\n\t\tRobotMap.frontLeft.setInverted(true);\n\t\tRobotMap.backLeft.setInverted(true);\n\n\t\tRobotMap.frontRight.setStatusFramePeriod(StatusFrameEnhanced.Status_2_Feedback0, 1, 1);\n\t\tRobotMap.frontRight.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, 0, 1);\n\t\tRobotMap.frontRight.setSelectedSensorPosition(0, 0, 1);\n\t\tRobotMap.frontRight.setSensorPhase(true);\n\t\tRobotMap.frontRight.setSafetyEnabled(false);\n\n\t\tRobotMap.frontLeft.setSafetyEnabled(false);\n\t\tRobotMap.backLeft.setSafetyEnabled(false);\n\n\t\tSystem.out.println(\"encoder initialize\");\n\t}", "private void launchComp(String name) {\n Intent comp = new Intent(homeActivity.this, cardsMenu.class);\n Bundle b = new Bundle();\n b.putString(\"key\",\"computer\"); //pass along that this will be a single player multigame\n b.putString(\"name\",name); //pass the player's name\n // b.putString(\"State\", State); //pass along the game type\n comp.putExtras(b);\n startActivity(comp);\n }", "public String getVideoDevice();", "public static CharsetDecoder getEncoding(String encode) throws IllegalArgumentException {\r\n\t\tCharsetDecoder charsetDecoder = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tcharsetDecoder = Charset.forName(encode).newDecoder();\r\n\t\t\tcharsetDecoder.onMalformedInput(CodingErrorAction.REPLACE);\r\n\t\t\tcharsetDecoder.onUnmappableCharacter(CodingErrorAction.REPLACE);\r\n\t\t}\r\n\t\tcatch(IllegalArgumentException e) {\r\n\t\t\t// Add a hint to error message\r\n\t\t\tthrow new IllegalArgumentException(\"Not a supported character set \\\"\" + encode + \"\\\". Try UTF-8. \" + e.getMessage());\r\n\t\t}\r\n\t\treturn charsetDecoder;\r\n\t}", "public static FilmExtractor getFilmExtractor(String name) {\n\t\t//uprising type objects\n\t\tFilmExtractor extractor = null;\n\t\tswitch(name){\n\t\tcase \"BtChina\":\n\t\t\textractor = new BtChinaExtractor();\n\t\t\tbreak;\n\t\tcase \"BtTianTang\":\n\t\t\textractor = new BtTianTangExtractor();\n\t\t\tbreak;\n\t\tcase \"DM1080p\":\n\t\t\textractor = new DM1080pExtractor();\n\t\t\tbreak;\n\t\tcase \"DMM\":\n\t\t\textractor = new DMMExtractor();\n\t\t\tbreak;\n\t\tcase \"DYTT\":\n\t\t\textractor = new DYTTExtractor();\n\t\t\tbreak;\n\t\tcase \"DYXZ\":\n\t\t\textractor = new DYXZExtractor();\n\t\t\tbreak;\n\t\tcase \"OurRelease\":\n\t\t\textractor = new OurReleaseExtractor();\n\t\t\tbreak;\n\t\tcase \"ThreeMu\":\n\t\t\textractor = new ThreeMuExtractor();\n\t\t\tbreak;\n\t\tcase \"TorrentBar\":\n\t\t\textractor = new TorrentbarExtractor();\n\t\t\tbreak;\n\t\tcase \"XiXiHD\":\n\t\t\textractor = new XiXiHDExtractor();\n\t\t\tbreak;\n\t\tcase \"XiXiZhan\":\n\t\t\textractor = new XiXiZhanExtractor();\n\t\t\tbreak;\n\t\tcase \"Yify\":\n\t\t\textractor = new YifyExtractor();\n\t\t\tbreak;\n\t\tcase \"Yify2\":\n\t\t\textractor = new Yify2Extractor();\n\t\t\tbreak;\n\t\tcase \"YifyM\":\n\t\t\textractor = new YifyMExtractor();\n\t\t\tbreak;\n\t\tcase \"YifyM2\":\n\t\t\textractor = new YifyM2Extractor();\n\t\t\tbreak;\n\t\tcase \"YS\":\n\t\t\textractor = new YSExtractor();\n\t\t\tbreak;\n\t\tcase \"ZeroDM\":\n\t\t\textractor = new ZerodmExtractor();\n\t\t\tbreak;\n\t\tcase \"ZiMuKu\":\n\t\t\textractor = new ZiMuKuExtractor();\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn extractor;\n\t}", "@Override\r\n\tprotected String getAlgorithmName() {\n\t\treturn \"capture\";\r\n\t}", "public static Codec getDefault() {\n return defaultCodec;\n }", "public static AudioDataEncoder getEncoder(int bitsPerSample) {\n switch(bitsPerSample) {\n case 8:\n return new Int8AudioDataEncoder();\n case 16:\n return new Int16AudioDataEncoder();\n case 24:\n return new Int24AudioDataEncoder();\n \n default:\n System.err.println(\"Unknown sample size: \"+bitsPerSample);\n return null;\n }\n }", "@Override\n\tpublic ProtocolEncoder getEncoder(IoSession arg0) throws Exception {\n\t\treturn encoder;\n\t}", "@Override\n public void resetDriveEncoders() {\n driverFR.resetEncoder();\n driverFL.resetEncoder();\n driverBR.resetEncoder();\n driverBL.resetEncoder();\n }", "String getCodec() {\n return codec;\n }", "public static InterfaceModeType getByName(String name) {\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\n\t\t\tInterfaceModeType result = VALUES_ARRAY[i];\n\t\t\tif (result.getName().equals(name)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public Archangel buscarName(String name){\n\tboolean val = false;\n Archangel angel = null;\n\tfor(int i =0;i<arch.length && !val;i++){\n\t\tif(arch[i]!=null){\n\t\tif(arch[i].getName().equalsIgnoreCase(name)){\n\t\t\tangel = arch[i];\n\t\t\tval = true;\n\t\t}\n\t}\n\t\telse{\n\t\t\tval=true;\n\t\t}\n\t\t}\n\t\nreturn angel;\n\n}", "public static BinaryMessageEncoder<VehicleInfoAvro> getEncoder() {\n return ENCODER;\n }", "public void selectDriver();", "public abstract void chooseMedia();", "public CommonAdapter findAdapterByName(final String name) {\n if (LOGGER.isDebugEnabled()) {\n LOGGER.debug(\"Find adapter : \" + name);\n }\n return ADAPTERS.get(name);\n }", "public String getEncoderId() {\n return this.mEncoderId;\n }", "public VideoEncoder(Data data) {\n try {\n startTime = LocalDateTime.now();\n String minute, hour, day, month, year;\n if (startTime.getMinute() < 10) {\n minute = \"0\" + Integer.toString(startTime.getMinute());\n } else {\n minute = Integer.toString(startTime.getMinute());\n }\n if (startTime.getHour() < 10) {\n hour = \"0\" + Integer.toString(startTime.getHour());\n } else {\n hour = Integer.toString(startTime.getHour());\n }\n if (startTime.getDayOfMonth() < 10) {\n day = \"0\" + Integer.toString(startTime.getDayOfMonth());\n } else {\n day = Integer.toString(startTime.getDayOfMonth());\n }\n if (startTime.getMonthValue() < 10) {\n month = \"0\" + Integer.toString(startTime.getMonthValue());\n } else {\n month = Integer.toString(startTime.getMonthValue());\n }\n year = Integer.toString(startTime.getYear());\n\n File dir = null;\n try {\n dir = new File(\"C:\\\\TowedROV\\\\ROV_Video\\\\\");\n if (!dir.exists() || !dir.isDirectory()) {\n System.out.println(\"No directory found, creating a new one at C://TowedROV/ROV_Video/\");\n dir.mkdir();\n }\n } catch (Exception e) {\n System.out.println(\"No directory found, creating a new one at C://TowedROV/ROV_Video/\");\n dir.mkdir();\n }\n\n String fileName = dir.getPath() + \"\\\\ROV Video\" + hour + minute + \" \" + day + \".\"\n + month + \".\" + year + \".mp4\";\n enc = AWTSequenceEncoder.create24Fps(new File(fileName));\n this.data = data;\n } catch (Exception ex) {\n System.out.println(\"Exception while starting video encoder: \" + ex.getMessage());\n }\n }", "public void setPreferredVideoDefinition(VideoDefinition vdef);", "Builder addVideo(String value);", "@Override\n public byte[] getVideo(String cameraName) {\n throw new IllegalStateException(\"Not implemented yet!\");\n }", "abstract public VideoActivationPolicy createVideoActivationPolicy();", "private CompressionCodec getCompressionCodec() throws Exception {\n try {\n Constructor<?> constructor = Class.forName(compressionCodec).getConstructor();\n return (CompressionCodec)constructor.newInstance();\n } catch (Exception e) {\n throw new Exception(e);\n }\n }", "public TypedXmlSerializer getNewEncoder(Object token) {\n TypedXmlSerializer result = new DefaultXmlSerializer();\n if (factories != null && factories.size() > 0) {\n ContentEncoder enc = (ContentEncoder) result.getProperty(XasUtil.PROPERTY_CONTENT_CODEC);\n for (Enumeration e = factories.elements(); e.hasMoreElements();) {\n ContentCodecFactory fac = (ContentCodecFactory) e.nextElement();\n enc = fac.getChainedEncoder(enc);\n }\n result.setProperty(XasUtil.PROPERTY_CONTENT_CODEC, enc);\n }\n return result;\n }", "public static final FileBrowserView fromName(String name) {\n FileBrowserView result = DEFAULT;\n if (name != null) {\n for (FileBrowserView view : FileBrowserView.values()) {\n if (name.equals(view.name)) {\n result = view;\n break;\n }\n }\n }\n return result;\n }", "public static String getVideoSource(){\r\n\r\n return pref.getString(\"VideoMode\", \"MP4\");\r\n }", "public void enableVideoAdaptiveJittcomp(boolean enable);", "public int getVideoJittcomp();", "public void setVideoName(java.lang.String videoName) {\n this.videoName = videoName;\n }", "public static IDatabaseAdapter get(String name) {\n HashMap<String,Object> config = ConfigManager.getInstance().getDatabaseAdapter(name);\n if (config==null || !config.containsKey(\"type\")) return null;\n IDatabaseAdapter result = null;\n switch (config.get(\"type\").toString()) {\n case \"mysql\":\n result = new MysqlDatabaseAdapter();\n break;\n case \"sqlite\":\n result = new SqliteDatabaseAdapter();\n break;\n case \"orientdb\":\n result = new OrientDBDatabaseAdapter();\n break;\n case \"mongodb\":\n result = new MongoDatabaseAdapter();\n }\n if (result != null) result.configure(config);\n return result;\n }", "public VideoActivationPolicy getVideoActivationPolicy();", "public static CloneType detectType(String name) {\n if (name.startsWith(\"vb-\"))\n return CloneType.VIRTUALBOX;\n else if (name.startsWith(\"amazon-\"))\n return CloneType.AMAZON;\n else if (name.startsWith(\"kvm-\"))\n return CloneType.KVM;\n else {\n// System.err.println(\"The type of this clone could not be determined\");\n// printInfoAboutCloneName();\n return CloneType.UNKNOWN;\n }\n }", "private CharsetDecoder getJavaEncoding(String encoding) {\n Charset charset = Charset.forName(encoding);\n return charset.newDecoder();\n }", "public static Mixer getPrimaryCaptureDriver() {\r\n\t\t//final String searchName = \"Microphone (Realtek High Defini\";\r\n\t\t//final String searchName = \"Primary Sound Capture Driver\";\r\n\t\tfinal String searchName = \"Stereo Mix (Realtek High Defini\";// this one for loopback\r\n\t\tMixer.Info infos[] = AudioSystem.getMixerInfo();\r\n\t\t\r\n\t\tfor(Mixer.Info i : infos) {\r\n\t\t\tif(i.getName().equals(searchName)) {\r\n\t\t\t\tif(DEBUG) {\r\n\t\t\t\t\tSystem.out.println(\"Found primary sound capture driver: \" + i);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn AudioSystem.getMixer(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(DEBUG) {\r\n\t\t\tSystem.out.println(\"Failed to find sound capture driver, name=\\\"\" + searchName + \"\\\".\");\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public String getSelectedAlgorithmName()\n {\n int selected = getSelectedAlgorithmNum();\n if (selected == -1)\n return null;\n return sortNames[selected];\n }", "public BitmapEncoder() {\n this((Bitmap.CompressFormat) null, 90);\n }", "VrsMediaType(String name) {\n\t\tthis.type= MediaType.valueOf(name);\n\t}", "public final Codec getCodec()\n\t{\n\t\treturn codec;\n\t}", "public VCodec(Surface surface, String path) {\n super();\n this.decoderSurface = surface;\n this.decoderInputPath= path;\n }", "public interface ImageEncoder {\n\t/** Encodes an AWT image into a byte array in a particular format.\n\t */\n\tpublic byte[] encode(RenderedImage image) throws java.io.IOException;\n\t/** Return the quality of the image encoding.\n\t */\n\tpublic float getQuality();\n\t/** Sets the quality of the image encoding.\n\t * Simply does nothing if the encoder does not support it.\n\t */\n\tpublic void setQuality(float quality);\n\t/** Returns whether to encode the alpha transparency.\n\t */\n\tpublic boolean isEncodingAlpha();\n\t/** Sets whether to encode the alpha transparency.\n\t * Simply does nothing if the encoder does not support it.\n\t */\n\tpublic void setEncodingAlpha(boolean encodeAlpha);\n}", "public void saveDriverId(String name) {\n editor.putString(KEY_DRIVERID, name);\n\n // Login Date\n //editor.putString(KEY_DATE, date);\n\n // commit changes\n editor.commit();\n }", "private Serde<Object> getSerdeFromName(String name, SerializerConfig serializerConfig) {\n String serdeClassName =\n serializerConfig.getSerdeFactoryClass(name).orElseGet(() -> SerializerConfig.getPredefinedSerdeFactoryName(name));\n return ReflectionUtil.getObj(serdeClassName, SerdeFactory.class).getSerde(name, serializerConfig);\n }", "void onVideoInputSelected(int type);", "public Extension loadExtension(String name, String path) {\n if (presetExtensions.containsKey(name)) {\n Extension extension = null;\n try {\n Class clazz = presetExtensions.get(name);\n Constructor<Extension> constructor = clazz.getConstructor(); \n extension = (Extension)constructor.newInstance();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return extension;\n }\n try {\n File file = new File(path);\n URL[] urls = { file.toURI().toURL() };\n URLClassLoader urlClassLoader = new URLClassLoader(urls);\n JarFile jar = new JarFile(file);\n Extension extension = null;\n for (Enumeration<JarEntry> entries = jar.entries(); entries.hasMoreElements();) {\n JarEntry entry = entries.nextElement();\n String entryName = entry.getName();\n if (!entryName.endsWith(\".class\")) continue;\n String className = entryName.replace(\"/\", \".\").substring(0, entryName.length() - 6);\n try {\n Class clazz = urlClassLoader.loadClass(className);\n if (!Extension.class.isAssignableFrom(clazz)) continue;\n Constructor<Extension> constructor = clazz.getConstructor(String.class, String.class);\n extension = (Extension)constructor.newInstance(name, path);\n } catch (ClassNotFoundException e1) {\n // e1.printStackTrace();\n }\n }\n jar.close();\n urlClassLoader.close();\n return extension;\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n }", "public KijiCellEncoder getEncoder(String family, String qualifier) throws IOException {\n final String column = (qualifier != null) ? (family + \":\" + qualifier) : family;\n final KijiCellEncoder encoder = mEncoderMap.get(column);\n if (encoder != null) {\n // There already exists a encoder for this column:\n return encoder;\n }\n\n if (qualifier != null) {\n // There is no encoder for the specified fully-qualified column.\n // Try the family (this will only work for map-type families):\n return getEncoder(family, null);\n }\n\n return null;\n }", "public Media findMediaByTitleAndGenre(String nameText, Genre g)\r\n {\r\n\t Genre g2;\r\n\t \r\n for (Media media : this.mediaCatalogueList)\r\n {\r\n if (media.getMediaName().equalsIgnoreCase(nameText))\r\n {\r\n \tswitch (media.getMedia_Type())\r\n \t{\r\n \tcase CD: return (CD)media; \r\n \tcase DVD: return (DVD)media;\r\n \tcase GAME: return (Game)media; \r\n \t}\r\n \r\n }\r\n }\r\n \r\n return null;\r\n }", "public ABLVideo Video() {\r\n \treturn new ABLVideo(BrickFinder.getDefault().getVideo());\r\n }", "public static RegistryMode getMode(String name) {\n\n\tCaselessStringKey key = new CaselessStringKey(name);\n\n\treturn (RegistryMode)registryModes.get(key);\n }", "public Video(String nombre) {\n super(nombre);\n }", "private GImage getSlotBox(String name) {\n\t\tif (name.equals(CHERRY)) {\n\t\t\treturn new GImage(\"cherry.png\");\n\t\t} else if (name.equals(LEMON)) {\n\t\t\treturn new GImage(\"lemon.png\");\n\t\t} else if (name.equals(ORANGE)) {\n\t\t\treturn new GImage(\"orange.png\");\n\t\t} else if (name.equals(PLUM)) {\n\t\t\treturn new GImage(\"plum.png\");\n\t\t} else if (name.equals(BELL)) {\n\t\t\treturn new GImage(\"bell.png\");\n\t\t} else if (name.equals(BAR)) {\n\t\t\treturn new GImage(\"bar.png\");\n\t\t} else {\n\t\t\treturn new GImage(\"empty.png\");\n\t\t}\n\t}", "Integer getAutoencoderFilter();", "public java.lang.String getVideoName() {\n return videoName;\n }", "public abstract String getDriver();", "@Deprecated\n public void setPreferredVideoSizeByName(String name);", "public boolean videoAdaptiveJittcompEnabled();", "private void onChooseCamClickEvent() {\n\t\tmBtnChooseCam.setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tavcom.venc.SetCamSrc(-1);\n\t\t\t}\n\t\t});\n\t}", "public tuna_Ep17(String name){ \t// Constructor added in Episode 17\r\n\t\tgirlName = name;\r\n\t}", "public String getAudioCodec() {\n return audioCodec;\n }", "Builder addEncoding(MediaObject value);", "public String getVideoCompressionType() {\n return videoCompressionType;\n }", "@SuppressWarnings(\"rawtypes\")\r\n\tpublic static Object getAsset(String name) {\t\t\r\n\t\treturn assetManager.loadAsset(name);\r\n\t}", "int getMotorEncoder( MotorName m ) {\n int enc = 0;\n if( motor_read_mode_==MotorBulkReadMode.BULK_READ_MANUAL && loop_cnt_!=last_motor_read_loop_id_ ) {\n // Important Step 4: If you are using MANUAL mode, you must clear the BulkCache once per control cycle\n for( LynxModule module : all_hubs_ ) {\n module.clearBulkCache();\n }\n }\n switch ( m ) {\n case MOTOR_LF:\n enc = motorLF_.getCurrentPosition();\n break;\n case MOTOR_LB:\n enc = motorLB_.getCurrentPosition();\n break;\n case MOTOR_RF:\n enc = motorRF_.getCurrentPosition();\n break;\n case MOTOR_RB:\n enc = motorRB_.getCurrentPosition();\n break;\n case MOTOR_LEFT_INTAKE:\n enc = motor_left_intake_.getCurrentPosition();\n break;\n case MOTOR_RIGHT_INTAKE:\n enc = motor_right_intake_.getCurrentPosition();\n break;\n case MOTOR_LIFT:\n enc = motor_lift_.getCurrentPosition();\n break;\n default:\n break;\n }\n last_motor_read_loop_id_ = loop_cnt_ ;\n return enc;\n }" ]
[ "0.60611564", "0.60441685", "0.5655714", "0.56289583", "0.5604947", "0.55679303", "0.5521886", "0.5517504", "0.5512166", "0.5490423", "0.5457824", "0.5401785", "0.53775036", "0.5355942", "0.5340001", "0.52557766", "0.52379006", "0.5225033", "0.51944387", "0.519398", "0.51310134", "0.5111519", "0.51099527", "0.5088204", "0.506344", "0.49975684", "0.4988802", "0.49835795", "0.49524385", "0.48919237", "0.48885024", "0.48369858", "0.48250782", "0.47581047", "0.4726724", "0.47116035", "0.4709591", "0.47009456", "0.46963385", "0.4692973", "0.46859053", "0.46852127", "0.4659093", "0.46519366", "0.4645035", "0.461663", "0.45956257", "0.45803925", "0.45668757", "0.45460272", "0.45412344", "0.4539663", "0.45283687", "0.45260328", "0.45116818", "0.45005363", "0.4495515", "0.44910634", "0.44696727", "0.44679677", "0.4465886", "0.44436955", "0.44325233", "0.4431582", "0.44204146", "0.44193438", "0.4417038", "0.4398085", "0.43979034", "0.4390109", "0.43845662", "0.4379344", "0.43785435", "0.4376569", "0.43686205", "0.4345538", "0.4337671", "0.43264967", "0.43253216", "0.43223575", "0.4311944", "0.43106225", "0.43009755", "0.4299611", "0.42986026", "0.42979696", "0.42960426", "0.42957452", "0.42902637", "0.42777863", "0.42666695", "0.42624724", "0.4255904", "0.42442176", "0.42398754", "0.4238273", "0.42375195", "0.42337152", "0.42238638", "0.42177784" ]
0.82752746
0
INDEXING MANAGEMENT [MODIFIED] Inserts new information provided by new occurence of token in docID at offset.
public void insert( String token, int docID, int offset ) { // Add to map of postingslist //if (docID % 100 == 0) //System.err.println("Trying to insert ''" + token + "'' found in doc "+docID); if (this.index.containsKey(token)){ //System.err.println(token+" already in memory"); this.index.get(token).insert(docID, offset); } else{ //System.err.println("new token: " +token+" stored"); PostingsList postingslist = new PostingsList(); postingslist.insert(docID, offset); this.index.put(token, postingslist); } // Add to matrix of tf if (!this.tfMap.containsKey(docID)){ HashMap<String, Integer> m = new HashMap<String, Integer>(); m.put(token, 1); this.tfMap.put(docID, m); if (this.idfMap.containsKey(token)) this.idfMap.put(token, this.idfMap.get(token)+1); else this.idfMap.put(token, 1); } else if (!this.tfMap.get(docID).containsKey(token)){ this.tfMap.get(docID).put(token, 1); if (this.idfMap.containsKey(token)) this.idfMap.put(token, this.idfMap.get(token)+1); else this.idfMap.put(token, 1); } else{ int v = this.tfMap.get(docID).get(token) + 1; this.tfMap.get(docID).put(token, v); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void insert( String token, int docID, int offset ) {\r\n PostingsList posting = this.getPostings(token);\r\n if(posting != null){\r\n posting.insertElement(docID, (double)0, offset);\r\n index.put(token, posting);\r\n }\r\n else{\r\n PostingsList newPosting = new PostingsList();\r\n newPosting.insertElement(docID, (double)0, offset);\r\n index.put(token, newPosting);\r\n }\r\n }", "private void updateIndex() throws IOException {\n // maintain the document store (corpus) - if there is one\n if (currentMemoryIndex.containsPart(\"corpus\")) {\n // get all corpora + shove into document store\n ArrayList<DocumentReader> readers = new ArrayList<>();\n readers.add((DocumentReader) currentMemoryIndex.getIndexPart(\"corpus\"));\n for (String path : geometricParts.getAllShards().getBinPaths()) {\n String corpus = path + File.separator + \"corpus\";\n readers.add(new CorpusReader(corpus));\n }\n }\n // finally write new checkpointing data (checkpoints the disk indexes)\n Parameters checkpoint = createCheckpoint();\n this.checkpointer.saveCheckpoint(checkpoint);\n }", "public void index(final Document doc) {\t\n\t\ttry {\n\t\t\t_reopenToken = _trackingIndexWriter.addDocument(doc);\n\t\t\tlog.debug(\"document indexed in lucene\");\n\t\t} catch(IOException ioEx) {\n\t\t\tlog.error(\"Error while in Lucene index operation: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t \t\t ioEx);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\t_indexWriter.commit();\n\t\t\t} catch (IOException ioEx) {\n\t\t\t\tlog.error(\"Error while commiting changes to Lucene index: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t \t\t\t\t\t ioEx);\n\t\t\t}\n\t\t}\n\t}", "public void addDocument(Document d) throws IndexerException {\n\t\t\n\t//if (!isvaliddir) {System.out.println(\"INVALID PATH/execution !\");return;}\n\t\n\t\n\t//Tokenizing\n\t//one thgread\n\tDocID did=new DocID(d.getField(FieldNames.FILEID),\n\t\t\td.getField(FieldNames.CATEGORY),\n\t\t\td.getField(FieldNames.AUTHOR));\n\t\n\tTokenStream stream=tokenize(FieldNames.CATEGORY,d);\n\tAnalyzer analyz=analyze(FieldNames.CATEGORY, stream);\n\tCategoryIndex.getInst().doIndexing(did.getdID(), stream);\n\t/*\t}catch(Exception e)\n\t{\n\t\tif (e instanceof NullPointerException ||e instanceof StringIndexOutOfBoundsException\n\t\t\t\t||e instanceof ArrayIndexOutOfBoundsException ||e instanceof IllegalArgumentException\n\t\t\t\t);\n\t}\n\ttry{*/TokenStream stream1=tokenize(FieldNames.AUTHOR,d);\n\tAnalyzer analyz1=analyze(FieldNames.AUTHOR, stream1);\n\tAuthorIndex.getInst().doIndexing(did.getdID(), stream1);\n\t/*}catch(Exception e)\n\t{\n\t\tif (e instanceof NullPointerException ||e instanceof StringIndexOutOfBoundsException\n\t\t\t\t||e instanceof ArrayIndexOutOfBoundsException ||e instanceof IllegalArgumentException\n\t\t\t\t);}\n\ttry{*/TokenStream stream2=tokenize(FieldNames.PLACE,d);\n\tAnalyzer analyz2=analyze(FieldNames.PLACE, stream2);\n\tPlaceIndex.getInst().doIndexing(did.getdID(), stream2);\n/*}catch(Exception e)\n\t{\n\tif (e instanceof NullPointerException ||e instanceof StringIndexOutOfBoundsException\n\t\t\t||e instanceof ArrayIndexOutOfBoundsException ||e instanceof IllegalArgumentException\n\t\t\t);}\n\ttry{*/tkizer = new Tokenizer();\n\tTokenStream stream3=tokenize(FieldNames.CONTENT,d);\n\tfactory = AnalyzerFactory.getInstance();\n\tAnalyzer analyz3=analyze(FieldNames.CONTENT, stream3);\n\tnew Indxr(IndexType.TERM).doIndexing(did, stream3);\n\t/*}\tcatch(Exception e)\n\t{\n\t\tif (e instanceof NullPointerException ||e instanceof StringIndexOutOfBoundsException\n\t\t\t\t||e instanceof ArrayIndexOutOfBoundsException ||e instanceof IllegalArgumentException\n\t\t\t\t);}\n\t*/\n\tdocs.add(did==null?\" \":did.toString());\n\t \n\t\na_indexrd= new IndexReader(System.getProperty(\"INDEX.DIR\"), IndexType.AUTHOR);\nc_indexrd= new IndexReader(System.getProperty(\"INDEX.DIR\"), IndexType.CATEGORY);\np_indexrd= new IndexReader(System.getProperty(\"INDEX.DIR\"), IndexType.PLACE);\nt_indexrd= new IndexReader(System.getProperty(\"INDEX.DIR\"), IndexType.TERM);\n\t\t}", "void index(IDocument document, IIndexerOutput output) throws java.io.IOException;", "private void indexItem(IndexDocument indexDoc) {\n if(bDebug) System.out.println(\"\\n*** document to index - \" + indexDoc);\n Indexer indexer=null;\n try {\n indexer=new Indexer(PetstoreConstants.PETSTORE_INDEX_DIRECTORY, false);\n PetstoreUtil.getLogger().log(Level.FINE, \"Adding document to index: \" + indexDoc.toString());\n indexer.addDocument(indexDoc);\n } catch (Exception e) {\n PetstoreUtil.getLogger().log(Level.WARNING, \"index.exception\", e);\n e.printStackTrace();\n } finally {\n try {\n // must close file or will not be able to reindex\n if(indexer != null) {\n indexer.close();\n }\n } catch (Exception ee) {\n ee.printStackTrace();\n }\n }\n }", "public abstract void updateIndex();", "public void indexDocument(String documentName, ArrayList<String> documentTokens) {\n for (String token : documentTokens) {\n if (!this.index.containsKey(token)) {\n // Create a key with that token\n this.index.put(token, new HashMap<>());\n }\n\n // Get the HashMap associated with that term\n HashMap<String, Integer> term = this.index.get(token);\n\n // Check if term has a posting for the document\n if (term.containsKey(documentName)) {\n // Increase its occurrence by 1\n int occurrences = term.get(documentName);\n term.put(documentName, ++occurrences);\n } else {\n // Create a new posting for the term\n term.put(documentName, 1);\n }\n }\n }", "public void IndexADocument(String docno, String content) throws IOException {\n\t\t\n\t\tdocIdx.append(docno + \"\\n\");\n\t\n\t\tString[] tokens = content.split(\" \");\n\t\t\n\t\tfor(String word: tokens) {\n\t\t\tif(token.containsKey(word)) {\t\t\n\t\t\t\tLinkedHashMap<Integer, Integer> cur = token.get(word);\n\t\t\t\tif(cur.containsKey(docid))\n\t\t\t\t\tcur.put(docid, cur.get(docid)+1);\n\t\t\t\telse \n\t\t\t\t\tcur.put(docid, 1);\n\t\t\t} else {\n\t\t\t\tLinkedHashMap<Integer, Integer> cur = new LinkedHashMap<>();\n\t\t\t\tcur.put(docid, 1);\n\t\t\t\ttoken.put(word, cur);\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t++docid;\n\t\t\n\t\tif(docid % BLOCK == 0) \n\t\t\tsaveBlock();\t\n\t}", "@Override\n public void postInserts() \n {\n for(IndexObject i: myIndex.values())\n {\n i.tfidf(documentData);\n }\n }", "private static Positional_inverted_index posindexCorpus(DocumentCorpus corpus) throws ClassNotFoundException, InstantiationException, IllegalAccessException, FileNotFoundException, IOException {\n\n NewTokenProcessor processor = new NewTokenProcessor();\n Iterable<Document> docs = corpus.getDocuments(); //call registerFileDocumentFactory first?\n\n List<Double> Doc_length = new ArrayList<>();\n Positional_inverted_index index = new Positional_inverted_index();\n\n double token_count = 0;\n\n // Iterate through the documents, and:\n for (Document d : docs) {\n //File f = new File(path + \"\\\\\" + d.getTitle());\n File f = new File(path + \"\\\\\" + d.getFileName().toString());\n double Filesize = f.length();\n //edited by bhavya\n double doc_weight = 0; //first entry in docweights.bin\n double doc_tokens = 0;\n double doc_length = 0;\n HashMap<String, Integer> tftd = new HashMap<>();\n // Tokenize the document's content by constructing an EnglishTokenStream around the document's content.\n Reader reader = d.getContent();\n EnglishTokenStream stream = new EnglishTokenStream(reader); //can access tokens through this stream\n N++;\n // Iterate through the tokens in the document, processing them using a BasicTokenProcessor,\n //\t\tand adding them to the HashSet vocabulary.\n Iterable<String> tokens = stream.getTokens();\n int i = 0;\n\n for (String token : tokens) {\n\n //adding token in index\n List<String> word = new ArrayList<String>();\n word = processor.processToken(token);\n //System.out.println(word.get(0));\n if (word.get(0).matches(\"\")) {\n continue;\n } else {\n\n index.addTerm(word.get(0), i, d.getId());\n\n }\n i = i + 1;\n\n //we check if token already exists in hashmap or not. \n //if it exists, increase its freq by 1 else make a new entry.\n if (tftd.containsKey(word.get(0))) {\n doc_tokens++;\n int count = tftd.get(word.get(0));\n tftd.replace(word.get(0), count + 1);\n } else {\n doc_tokens++;\n// token_count++; //gives total number of tokens.\n tftd.put(word.get(0), 1);\n }\n\n }\n double length = 0;\n double wdt = 0;\n\n double total_tftd = 0;\n for (Map.Entry<String, Integer> entry : tftd.entrySet()) {\n\n wdt = 1 + log(entry.getValue());\n\n length = length + pow(wdt, 2);\n total_tftd = total_tftd + entry.getValue();\n }\n token_count = token_count + doc_tokens;\n doc_weight = pow(length, 0.5);\n double avg_tftd = total_tftd / (double) tftd.size();\n\n Doc_length.add(doc_weight);\n Doc_length.add(avg_tftd);\n Doc_length.add(doc_tokens);\n Doc_length.add(Filesize);\n }\n Doc_length.add(token_count / N);\n\n DiskIndexWriter d = new DiskIndexWriter();\n d.write_doc(path, Doc_length);\n\n return index;\n }", "LuceneMemoryIndex createLuceneMemoryIndex();", "private Reindex() {}", "private Reindex() {}", "public void onIndexUpdate();", "public static void update(Transcription t) throws IOException, SQLException\r\n {\r\n IndexWriter writer = null;\r\n Analyzer analyser;\r\n Directory directory;\r\n /**@TODO parameterize this location*/\r\n String dest = \"/usr/indexTranscriptions\";\r\n\r\n directory = FSDirectory.getDirectory(dest, true);\r\n analyser = new StandardAnalyzer();\r\n writer = new IndexWriter(directory, analyser, true);\r\n Term j=new Term(\"id\",\"\"+t.getLineID());\r\n writer.deleteDocuments(j);\r\n Document doc=new Document();\r\n Field field;\r\n field = new Field(\"text\", t.getText(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"comment\", t.getComment(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"creator\", \"\" + t.UID, Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"security\", \"\" + \"private\", Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"line\", \"\" + t.getLine(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"page\", \"\" + t.getFolio(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"id\", \"\" + t.getLineID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"manuscript\", \"\" + new Manuscript(t.getFolio()).getID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"projectID\", \"\" + t.getProjectID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n writer.addDocument(doc);\r\n writer.commit();\r\n \twriter.close();\r\n\r\n }", "private void createTokenIndex(){\n\t\tLinkedList<String> tokens = new LinkedList<>(tokenDict.keySet());\n\t\tArrayList<ArrayList<Integer>> vals = new ArrayList<>(tokenDict.values());\n\t\tint k = 8;\n\n\t\tKFront kf = new KFront(true);\n\t\tkf.createKFront(k, tokens);\n\n\t\tTokensIndex tIdx = new TokensIndex(k, this.dir);\n\t\ttIdx.insertData(kf.getTable(), vals, kf.getConcatString());\n\n\t\tsaveToDir(TOKEN_INDEX_FILE, tIdx);\n\t}", "public static void update(String indexFileName, String listOfDoc) throws IOException{\n\t\tHashMap<String, String> sCurrentHashMap = null;\n\t\tboolean hasFile = true;\n\t\t\n\t\tif(globalHash.containsKey(indexFileName)){\n\t\t\t//ถ้ามีใน global แล้ว เอาออกมาแล้วเอามารวมกับที่เพิ่งอ่านไฟล์ได้เลย\n\t\t\tsCurrentHashMap = globalHash.get(indexFileName);\n\t\t\n\t\t}else{ \n\t\t\t//if no hashmap in globalHash, then check if there's this fileName.txt in directory\n\t\t\t\n\t\t\tif(!new File(indexFileName+\".txt\").isFile()){\n\t\t\t\t\tSystem.out.println(\"ERROR: The inverted file is not found.\");\n\t\t\t\t\thasFile = false;\n\t\t\t}else{\n\t \t sCurrentHashMap = genHashMapFromInvertedIndexFile(indexFileName);\n\t\t\t \n\t\t\t}\n\t\t}\n\t\t\n\t\tif(hasFile){\n\t\t\tArrayList<Term> newTermList = extractDoc(listOfDoc);\n\t\t\t//if the new term list has value (not doc not found)\n\t\t\tif(newTermList.size()>0){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tsCurrentHashMap = addListToHashMap(sCurrentHashMap, newTermList);\n\t\t\t\t\n\t\t\t\t/*เพิ่มเงื่อนไขกรณี ลบคำออกจากไฟล์ \n\t\t\t\t * 1.ทำ list เป็น hashMap อีกอันไว้เซิชไวไว\n\t\t\t\t * loop amount of doc\n\t\t\t\t * 2.ไล่ iterative ของ hashMap ว่ามี value อันไหน contain ชื่อไฟล์บ้าง ถ้าcontain ให้เช็คกลับว่า key นั้น มีในแฮชอีกอันหรือเปล่า\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t/* // Convert new word (from file) list to HashMap\n\t\t\t\tHashMap<String, String> newWordHashMap = new HashMap<String, String>();\n\t\t\t\tfor(Term i: newTermList){\n\t\t\t\t\tnewWordHashMap.put(i.getTerm(), i.getDocNumber()+\"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tIterator it = sCurrentHashMap.entrySet().iterator();\n\t\t\t\twhile(it.hasNext()){\n\t\t\t\t\tHashMap.Entry<String, String> entry = (HashMap.Entry<String, String>) it.next();\n\t\t\t\t\t//if its value contains the doc number, then check if its key is in the newTermHash or note\n\t\t\t\t\t// if not --> this term was removed --> remove this key out from sCurrentHashMap\n\t\t\t\t\tif(entry.getValue().contains(s)) {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\tglobalHash.put(indexFileName, sCurrentHashMap);\n\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public void indexCreate()\n {\n try{\n Directory dir = FSDirectory.open(Paths.get(\"indice/\"));\n Analyzer analyzer = new StandardAnalyzer();\n IndexWriterConfig iwc = new IndexWriterConfig(analyzer);\n iwc.setOpenMode(OpenMode.CREATE);\n IndexWriter writer = new IndexWriter(dir,iwc);\n MongoConnection mongo = MongoConnection.getMongo();\n mongo.OpenMongoClient();\n DBCursor cursor = mongo.getTweets();\n Document doc = null;\n\n while (cursor.hasNext()) {\n DBObject cur = cursor.next();\n if (cur.get(\"retweet\").toString().equals(\"false\")) {\n doc = new Document();\n doc.add(new StringField(\"id\", cur.get(\"_id\").toString(), Field.Store.YES));\n doc.add(new TextField(\"text\", cur.get(\"text\").toString(), Field.Store.YES));\n doc.add(new StringField(\"analysis\", cur.get(\"analysis\").toString(), Field.Store.YES));\n //doc.add(new StringField(\"finalCountry\",cur.get(\"finalCountry\").toString(),Field.Store.YES));\n doc.add(new StringField(\"userScreenName\", cur.get(\"userScreenName\").toString(), Field.Store.YES));\n doc.add(new StringField(\"userFollowersCount\", cur.get(\"userFollowersCount\").toString(), Field.Store.YES));\n doc.add(new StringField(\"favoriteCount\", cur.get(\"favoriteCount\").toString(), Field.Store.YES));\n\n if (writer.getConfig().getOpenMode() == OpenMode.CREATE) {\n System.out.println(\"Indexando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.addDocument(doc);\n System.out.println(doc);\n } else {\n System.out.println(\"Actualizando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.updateDocument(new Term(\"text\" + cur.get(\"text\")), doc);\n System.out.println(doc);\n }\n }\n }\n cursor.close();\n writer.close();\n }\n catch(IOException ioe){\n System.out.println(\" Error en \"+ ioe.getClass() + \"\\n mensaje: \" + ioe.getMessage());\n }\n }", "public void addIndex(){\n\t\tdbCol=mdb.getCollection(\"genericCollection\");\n\t\tstart=Calendar.getInstance().getTimeInMillis();\n\t\tdbCol.ensureIndex(new BasicDBObject(\"RandomGeo\", \"2d\"));\n\t\tstop = Calendar.getInstance().getTimeInMillis() - start;\n\t\tSystem.out.println(\"Mongo Index Timer \"+Long.toString(stop));\n\t}", "public void addDocument(TokenizedDocument document) {\n\t\t\n\t\ttry {\n\t\t\tindexWriter.addDocument(createDocument(document),myAnalyzer);\n\t\t} catch (CorruptIndexException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public void renewPreIndex(List<String> docs) {\r\n this.preIndex = new Index();\r\n IndexWriter iw = this.getIndexWriter(this.preIndex);\r\n this.logger.trace(\"Renewed preIndex\");\r\n docs.forEach(e -> iw.addDocument(new Document(e)));\r\n }", "@Test\r\n\tpublic void indexOneLater() throws Exception {\n\t\tSolrInputDocument sd = new SolrInputDocument();\r\n\t\tsd.addField(\"id\", \"addone\");\r\n\t\tsd.addField(\"channelid\", \"9999\");\r\n\t\tsd.addField(\"topictree\", \"tptree\");\r\n\t\tsd.addField(\"topicid\", \"tpid\");\r\n\t\tsd.addField(\"dkeys\", \"测试\");\r\n\t\tsd.addField(\"title\", \"junit 标题\");\r\n\t\tsd.addField(\"ptime\", new Date());\r\n\t\tsd.addField(\"url\", \"/junit/test/com\");\r\n//\t\t\tSystem.out.println(doc);\r\n//\t\tbuffer.add(sd);\r\n\t\tdocIndexer.addDocumentAndCommitLater(sd, 1);\r\n\t}", "public void testCreIdx(){\r\n\t \r\n\t String dataDir = \"C:\\\\study\\\\Lucene\\\\Data\";\r\n\t String idxDir = \"C:\\\\study\\\\Lucene\\\\Index\";\r\n\t \r\n\t LuceneUtils.delAll(idxDir);\r\n\t \r\n\t CreateIndex ci = new CreateIndex();\r\n\t \r\n\t ci.Indexer(new File(idxDir), new File(dataDir));\r\n\t \r\n\t\t\r\n\t}", "public void addDoc (DocFile newFile) {\n\n // Check if the file extension is valid\n if (!isValid(newFile) ) {\n return;\n }\n\n // Create the new document, add in DocID fields and UploaderID fields\n org.apache.lucene.document.Document newDocument = new Document();\n\n Field docIDField = new StringField(Constants.INDEX_KEY_ID, newFile.getId(), Store.YES);\n Field docPathField = new StringField(Constants.INDEX_KEY_PATH, newFile.getPath(), Store.YES);\n Field userIDField = new StringField(Constants.INDEX_KEY_OWNER, newFile.getOwner(), Store.YES);\n Field filenameField = new TextField(Constants.INDEX_KEY_FILENAME, newFile.getFilename(), Store.YES);\n Field isPublicField = new TextField(Constants.INDEX_KEY_STATUS, newFile.isPublic().toString(), Store.YES);\n Field titleField = new TextField(Constants.INDEX_KEY_TITLE, newFile.getTitle(), Store.YES);\n Field typeField = new TextField(Constants.INDEX_KEY_TYPE, newFile.getFileType(), Store.YES);\n Field permissionField = new TextField(Constants.INDEX_KEY_PERMISSION, Integer.toString(newFile.getPermission()), Store.YES);\n Field courseField = new TextField(Constants.INDEX_KEY_COURSE, newFile.getCourseCode(), Store.YES);\n \n \n newDocument.add(docIDField);\n newDocument.add(docPathField);\n newDocument.add(userIDField);\n newDocument.add(filenameField);\n newDocument.add(isPublicField);\n newDocument.add(titleField);\n newDocument.add(typeField);\n newDocument.add(permissionField);\n newDocument.add(courseField);\n \n //Call Content Generator to add in the ContentField\n ContentGenerator.generateContent(newDocument, newFile);\n\n // Add the Document to the Index\n try {\n writer.addDocument(newDocument);\n writer.commit();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void indexDocumentHelper(HashMap<String, StringBuilder> fm)\n\t\t\tthrows IOException {\n\n\t\tIndexWriter writer = getIndexWriter();\n\n\t\tDocument doc = new Document();\n\n\t\tfor (int i = 0; i < fieldNames.length; i++) {\n\n\t\t\tif (fieldNames[i].equals(\"DOCNO\")) {\n\n\t\t\t\tdoc.add(new StringField(fieldNames[i], fm.get(fieldNames[i])\n\t\t\t\t\t\t.toString(), Field.Store.YES));\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tdoc.add(new TextField(fieldNames[i], fm.get(fieldNames[i])\n\t\t\t\t\t\t.toString(), Field.Store.YES));\n\t\t\t}\n\t\t}\n\n\t\twriter.addDocument(doc);\n\n\t}", "public void IndexADocument(String docno, String content) throws IOException {\n\t\tdocid++;\n\t\tdoc2docid.put(docno, docid);\n\t\tdocid2doc.put(docid, docno);\n\n\t\t// Insert every term in this doc into docid2map\n\t\tString[] terms = content.trim().split(\" \");\n\t\tMap<Integer, Integer> docTerm = new HashMap<>();\n\t\tint thisTermid;\n\t\tfor(String term: terms){\n\t\t\t// get termid\n\t\t\tif(term2termid.get(term)!=null) thisTermid = term2termid.get(term);\n\t\t\telse{\n\t\t\t\tthisTermid = ++termid;\n\t\t\t\tterm2termid.put(term, thisTermid);\n\t\t\t}\n\t\t\tdocTerm.put(thisTermid, docTerm.getOrDefault(thisTermid, 0)+1);\n\t\t\t// Merge this term's information into termid2map\n\t\t\tMap<Integer, Integer> temp = termid2map.getOrDefault(thisTermid, new HashMap());\n\t\t\ttemp.put(docid, temp.getOrDefault(docid, 0)+1);\n\t\t\ttermid2map.put(thisTermid, temp);\n\t\t\ttermid2fre.put(thisTermid, termid2fre.getOrDefault(thisTermid, 0)+1);\n\t\t}\n\t\tdocid2map.put(docid, docTerm);\n\n//\t\t// Merge all the terms' information into termid2map\n//\t\tfor(Long tid: docTerm.keySet()){\n//\t\t\tMap<Long, Long> temp = termid2map.getOrDefault(tid, new HashMap());\n//\t\t\ttemp.put(docid,docTerm.get(tid));\n//\t\t\ttermid2map.put(tid, temp);\n//\t\t\t// update this term's frequency\n//\t\t\ttermid2fre.put(tid, termid2fre.getOrDefault(tid,0L)+docTerm.get(tid));\n//\t\t}\n\n\t\t// When termid2map and docid2map is big enough, put it into disk\n\t\tif(docid%blockSize==0){\n\t\t\tWritePostingFile();\n\t\t\tWriteDocFile();\n\t\t}\n\t}", "private void addIndexWrite(Object key, Object value, BitSet dirty, IndexMetadata idxMeta, long clock, Mutator<byte[]> mutator, EConsistencyLevel level)\n {\n List<Object> propVals = null;\n DynamicComposite colName = new DynamicComposite();\n boolean propertyNotSet = false;\n int ttl = -1;\n for(SimplePropertyMetadata pm : idxMeta.getIndexedProperties())\n {\n Object pval = invokeGetter(pm, value);\n if(pval != null)\n {\n if(propVals == null)\n propVals = new ArrayList<Object>(idxMeta.getIndexedProperties().size());\n\n if(pm.isTtlSet())\n {\n int colTtl = pm.ttl();\n if(ttl < 0 || colTtl < ttl) //min ttl of the indexed properties\n ttl = colTtl;\n }\n propVals.add(pval);\n colName.add(pval);\n }\n else if(!dirty.get(_entityMeta.getPropertyPosition(pm))) //prop value is null and not set\n propertyNotSet = true;\n }\n\n if(propVals == null) //no index property updated\n return;\n \n if(propertyNotSet) //must update none or all of a multi column index\n throw new IllegalArgumentException(\"cannot write a subset of columns to multi-column index: \" + idxMeta);\n \n if(propVals.size() < idxMeta.getIndexedProperties().size()) //some index properties set to null -> entry is removed from index\n return;\n \n colName.add(key);\n \n HColumn<DynamicComposite, byte[]> column = HFactory.createColumn(colName, IDX_COL_VAL, clock, SER_DYNAMIC_COMPOSITE, SER_BYTES);\n \n DynamicComposite rowKey = new DynamicComposite(idxMeta.id());\n \n List<List<Object>> allPartitions = idxMeta.getIndexPartitioner().partitionValue(propVals);\n if(allPartitions.size() != 1)\n throw new IllegalStateException(\"expected single partition but encountered \" + allPartitions.size());\n \n _logger.trace(\"writing to partition {}\", allPartitions.get(0));\n for(Object partitionVal : allPartitions.get(0))\n rowKey.add(partitionVal);\n \n if(ttl > 0)\n column.setTtl(ttl);\n \n mutator.addInsertion(SER_DYNAMIC_COMPOSITE.toBytes(rowKey), _entityMeta.getIndexFamilyName(), column);\n }", "@Override\n public void updateToNextDoc() {\n if(idx < postingList.size())\n idx += postingList.get(idx+1)+2;\n }", "@Test\n public void setFieldIndexFormat() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n builder.write(\"A\");\n builder.insertBreak(BreakType.LINE_BREAK);\n builder.insertField(\"XE \\\"A\\\"\");\n builder.write(\"B\");\n\n builder.insertField(\" INDEX \\\\e \\\" · \\\" \\\\h \\\"A\\\" \\\\c \\\"2\\\" \\\\z \\\"1033\\\"\", null);\n\n doc.getFieldOptions().setFieldIndexFormat(FieldIndexFormat.FANCY);\n doc.updateFields();\n\n doc.save(getArtifactsDir() + \"Field.SetFieldIndexFormat.docx\");\n //ExEnd\n }", "public interface FieldIndex<T> extends GenericIndex<T> \r\n{ \r\n /**\r\n * Put new object in the index. \r\n * @param obj object to be inserted in index. Object should contain indexed field. \r\n * Object can be not yet peristent, in this case\r\n * its forced to become persistent by assigning OID to it.\r\n * @return <code>true</code> if object is successfully inserted in the index, \r\n * <code>false</code> if index was declared as unique and there is already object with such value\r\n * of the key in the index. \r\n */\r\n public boolean put(T obj);\r\n\r\n /**\r\n * Associate new object with the key specified by object field value. \r\n * If there is already object with such key in the index, \r\n * then it will be removed from the index and new value associated with this key.\r\n * @param obj object to be inserted in index. Object should contain indexed field. \r\n * Object can be not yet peristent, in this case\r\n * its forced to become persistent by assigning OID to it.\r\n * @return object previously associated with this key, <code>null</code> if there was no such object\r\n */\r\n public T set(T obj);\r\n\r\n /**\r\n * Assign to the integer indexed field unique autoicremented value and \r\n * insert object in the index. \r\n * @param obj object to be inserted in index. Object should contain indexed field\r\n * of integer (<code>int</code> or <code>long</code>) type.\r\n * This field is assigned unique value (which will not be reused while \r\n * this index exists) and object is marked as modified.\r\n * Object can be not yet peristent, in this case\r\n * its forced to become persistent by assigning OID to it.\r\n * @exception StorageError(StorageError.INCOMPATIBLE_KEY_TYPE) when indexed field\r\n * has type other than <code>int</code> or <code>long</code>\r\n */\r\n public void append(T obj);\r\n\r\n /**\r\n * Remove object with specified key from the unique index\r\n * @param key value of removed key\r\n * @return removed object\r\n * @exception StorageError(StorageError.KEY_NOT_FOUND) exception if there is no such key in the index,\r\n * or StorageError(StorageError.KEY_NOT_UNIQUE) if index is not unique.\r\n */\r\n public T remove(Key key);\r\n\r\n /**\r\n * Remove object with specified key from the unique index\r\n * @param key value of removed key\r\n * @return removed object\r\n * @exception StorageError(StorageError.KEY_NOT_FOUND) exception if there is no such key in the index,\r\n * or StorageError(StorageError.KEY_NOT_UNIQUE) if index is not unique.\r\n */\r\n public T removeKey(Object key);\r\n\r\n /**\r\n * Check if index contains specified object instance.\r\n * @param obj object to be searched in the index. Object should contain indexed field. \r\n * @return <code>true</code> if object is present in the index, <code>false</code> otherwise\r\n */\r\n public boolean containsObject(T obj);\r\n\r\n /**\r\n * Locate objects with the same value of the key as specified object\r\n * @param obj object specifying search key value\r\n * @return selection iterator\r\n */\r\n public IterableIterator<T> queryByExample(T obj);\r\n\r\n /**\r\n * Get class obejct objects which can be inserted in this index\r\n * @return class specified in Storage.createFielIndex method\r\n */\r\n public Class getIndexedClass();\r\n\r\n /**\r\n * Get fields used as a key\r\n * @return array of index key fields\r\n */\r\n public Field[] getKeyFields();\r\n\r\n /**\r\n * Select members of the collection using search predicate\r\n * This iterator doesn't support remove() method.\r\n * To make it possible to update, remove or add members to the index \r\n * during iteration it is necessary to set \"perst.concurrent.iterator\"\r\n * property (by default it is not supported because it cause extra overhead during iteration)\r\n * @param predicate JSQL condition\r\n * @return iterator through members of the collection matching search condition\r\n */\r\n public IterableIterator<T> select(String predicate);\r\n\r\n /**\r\n * Check if field index is case insensitive\r\n * @return true if index ignore case of string keys\r\n */\r\n boolean isCaseInsensitive(); \r\n}", "private void indexUpdates(UpdateQueryResult updates) {\r\n Iterator<HashMap<String, String>> i = updates.getIterator();\r\n while (i.hasNext()) {\r\n HashMap<String, String> values = i.next();\r\n \r\n \t// during index default solr fields are indexed separately\r\n \tString articleId = values.get(\"KnowledgeArticleId\");\r\n \tString title = values.get(\"Title\");\r\n \tvalues.remove(\"Title\");\r\n \tString summary = values.get(\"Summary\");\r\n \tvalues.remove(\"Summary\");\r\n \t\r\n \ttry {\r\n \t\tif (UtilityLib.notEmpty(articleId) && UtilityLib.notEmpty(title)) {\r\n \t\t\t// index sObject\r\n \t\t\t// default fields every index must have\r\n \t\t\tStringBuilder sb = new StringBuilder();\r\n \t\t\tContent c = new Content();\r\n \t\t\tc.setKey(articleId);\r\n \t\t\tsb.setLength(0);\r\n \t\t\tsb.append(summary);\r\n \t\t\tc.setData(sb.toString().getBytes());\r\n \t\t\tc.addMetadata(\"Content-Type\", \"text/html\");\r\n \t\t\tc.addMetadata(\"title\", title);\r\n \t\t\t\r\n \t\t\tLOG.debug(\"Salesforce Crawler: Indexing articleId=\"+articleId+\" title=\"+title+\" summary=\"+summary);\r\n \t\t\t\r\n \t\t\t// index articleType specific fields\r\n \t\t\tfor (Entry<String, String> entry : values.entrySet()) {\r\n \t\t\t\tc.addMetadata(entry.getKey(), entry.getValue().toString());\r\n \t\t\t\tif (!entry.getKey().equals(\"Attachment__Body__s\")) {\r\n \t\t\t\t\tLOG.debug(\"Salesforce Crawler: Indexing field key=\"+entry.getKey()+\" value=\"+entry.getValue().toString());\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tstate.getProcessor().process(c);\r\n \t\t}\r\n } catch (Exception e) {\r\n \tUtilityLib.errorException(LOG, e);\r\n \tstate.getStatus().incrementCounter(Counter.Failed);\r\n }\r\n }\r\n }", "public void reIndex(final Term recordIdTerm,\n\t\t\t\t\t\tfinal Document doc) {\t\n\t\ttry {\n\t\t\t_reopenToken = _trackingIndexWriter.updateDocument(recordIdTerm, \n\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t doc);\n\t\t\tlog.debug(\"{} document re-indexed in lucene\",recordIdTerm.text());\n\t\t} catch(IOException ioEx) {\n\t\t\tlog.error(\"Error in lucene re-indexing operation: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t \t\t ioEx);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\t_indexWriter.commit();\n\t\t\t} catch (IOException ioEx) {\n\t\t\t\tlog.error(\"Error while commiting changes to Lucene index: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t \t\t\t\t\t ioEx);\n\t\t\t}\n\t\t}\n\t}", "private void updateIndexMap(String file) {\n\t\ttry (Scanner s = new Scanner(new File(file))) {\n\t\t\twhile (s.hasNext()) {\n\t\t\t\tString word = TextParserUtil.cleanWord(s.next());\n\t\t\t\tString partition = word.substring(0, 1);\n\t\t\t\tif (indexedDir.get(partition) == null) {\n\t\t\t\t\tinsertPartitionEntry(file, word, partition);\n\t\t\t\t} else if (indexedDir.get(partition).get(word) == null) {\n\t\t\t\t\tinsertWordEntry(file, word, partition);\n\t\t\t\t} else if (indexedDir.get(partition).get(word) != null) {\n\t\t\t\t\tupdateFileList(file, word, partition);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "public IndexInfo(IndexInfo other, MetaRelationship field) {\n\t\tString prefix = field.getName();\n\t\tthis.indexName = prefix + \".\" + other.indexName;\n\t\tthis.options = new HashSet<IndexOptionEnum>(other.options);\n\t\t// since the embed field might not have field, it must be spare for\n\t\t// unique index\n\t\tif (this.options.contains(IndexOptionEnum.unique)) {\n\t\t\tthis.options.add(IndexOptionEnum.sparse);\n\t\t}\n\t\tthis.keyList = new LinkedList<String>();\n\t\tfor (String key : other.keyList) {\n\t\t\tkeyList.add(prefix + \".\" + key);\n\t\t}\n\t\tthis.internal = true;\n\t}", "@Deprecated\r\n\tpublic synchronized void otimizarIndice() throws Exception {\r\n\t\tIndexWriter indexWriter = getWriterPadrao(false);\r\n\t\tindexWriter.forceMerge(50);\r\n\t\tindexWriter.close();\r\n\t}", "@Override\r\n\tprotected void indexDocument(PluginServiceCallbacks callbacks, JSONResponse jsonResults, HttpServletRequest request,\r\n\t\t\tIndexing indexing) throws Exception {\n\t\t\r\n\t}", "private static void peopleAndEventsCreate(File selectedFolder, File selectedFile, String nameOfLuceneIndex) throws Exception {\n\t\tStandardAnalyzer analyzer = new StandardAnalyzer();\n\n\t /* Where to store index */\n\t\tFile directoryOfIndex = new File(selectedFolder + nameOfLuceneIndex);\n\t\tdeleteDirectory(directoryOfIndex);\t\t\t\t\t\t\t\t\t\t\t\t\t\t// before creating new index, the old one is deleted\n\t Directory index = FSDirectory.open(directoryOfIndex);\n\n\t IndexWriterConfig config = new IndexWriterConfig(Version.LATEST, analyzer);\n\t IndexWriter w = new IndexWriter(index, config);\n\t \n\t\tBufferedReader in;\n\t\ttry {\n\t\t\tin = new BufferedReader(new InputStreamReader(new FileInputStream(selectedFile), \"UTF-8\"));\n\n\t\t\twhile (in.ready()) {\n\t\t\t\tString oneLine = in.readLine();\n\t\t\t\t\n\t\t\t\tString[] splittedString = oneLine.split(\";\");\n\t\t\t\t\n\t\t\t\tif(splittedString.length == 2) {\n\t\t\t\t\taddDoc(w, splittedString[0], splittedString[1], \"\");\n\t\t\t\t}\n\t\t\t\telse if(splittedString.length == 3) {\n\t\t\t\t\taddDoc(w, splittedString[0], splittedString[1], splittedString[2]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t \n\t w.close();\n\t}", "void itemAddedToIndex(Object key, Object o);", "@Test\n public void fieldIndexFilter() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Create an INDEX field which will display an entry for each XE field found in the document.\n // Each entry will display the XE field's Text property value on the left side\n // and the page containing the XE field on the right.\n // If the XE fields have the same value in their \"Text\" property,\n // the INDEX field will group them into one entry.\n FieldIndex index = (FieldIndex) builder.insertField(FieldType.FIELD_INDEX, true);\n\n // Configure the INDEX field only to display XE fields that are within the bounds\n // of a bookmark named \"MainBookmark\", and whose \"EntryType\" properties have a value of \"A\".\n // For both INDEX and XE fields, the \"EntryType\" property only uses the first character of its string value.\n index.setBookmarkName(\"MainBookmark\");\n index.setEntryType(\"A\");\n\n Assert.assertEquals(\" INDEX \\\\b MainBookmark \\\\f A\", index.getFieldCode());\n\n // On a new page, start the bookmark with a name that matches the value\n // of the INDEX field's \"BookmarkName\" property.\n builder.insertBreak(BreakType.PAGE_BREAK);\n builder.startBookmark(\"MainBookmark\");\n\n // The INDEX field will pick up this entry because it is inside the bookmark,\n // and its entry type also matches the INDEX field's entry type.\n FieldXE indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Index entry 1\");\n indexEntry.setEntryType(\"A\");\n\n Assert.assertEquals(\" XE \\\"Index entry 1\\\" \\\\f A\", indexEntry.getFieldCode());\n\n // Insert an XE field that will not appear in the INDEX because the entry types do not match.\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Index entry 2\");\n indexEntry.setEntryType(\"B\");\n\n // End the bookmark and insert an XE field afterwards.\n // It is of the same type as the INDEX field, but will not appear\n // since it is outside the bookmark's boundaries.\n builder.endBookmark(\"MainBookmark\");\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Index entry 3\");\n indexEntry.setEntryType(\"A\");\n\n doc.updatePageLayout();\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.INDEX.XE.Filtering.docx\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.INDEX.XE.Filtering.docx\");\n index = (FieldIndex) doc.getRange().getFields().get(0);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX, \" INDEX \\\\b MainBookmark \\\\f A\", \"Index entry 1, 2\\r\", index);\n Assert.assertEquals(\"MainBookmark\", index.getBookmarkName());\n Assert.assertEquals(\"A\", index.getEntryType());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(1);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE \\\"Index entry 1\\\" \\\\f A\", \"\", indexEntry);\n Assert.assertEquals(\"Index entry 1\", indexEntry.getText());\n Assert.assertEquals(\"A\", indexEntry.getEntryType());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(2);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE \\\"Index entry 2\\\" \\\\f B\", \"\", indexEntry);\n Assert.assertEquals(\"Index entry 2\", indexEntry.getText());\n Assert.assertEquals(\"B\", indexEntry.getEntryType());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(3);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE \\\"Index entry 3\\\" \\\\f A\", \"\", indexEntry);\n Assert.assertEquals(\"Index entry 3\", indexEntry.getText());\n Assert.assertEquals(\"A\", indexEntry.getEntryType());\n }", "@ManagedOperation(description = \"Starts rebuilding the index\", displayName = \"Rebuild index\")\n void start();", "public interface IndexBuilder {\n\n /**\n * Rebuilds the index only when the existing index is not populated.\n */\n void rebuildIfNecessary();\n\n}", "public interface BoostingIndexer {\r\n\t/**\r\n\t * Add a new {@link Document} to the Index or update an existing one.<br> \r\n\t * When adding a document, its dynamic boosts values must be set. Specifying the values is accomplished by\r\n\t * passing the dynamicBoosts parameter with a Map from the boost index (zero based) to the boost value (a <code>double</code>).\r\n\t * In this map, no index can be larger than the number of available boosts the {@link IndexEngine}'s {@link Scorer} has, minus one (since it is zero based).\r\n\t * The value for any available boost index not specified in the map is defaulted to zero. \r\n\t * \r\n\t * @param docId external (customer) identifier of the document to add\r\n\t * @param document the {@link Document} to add\r\n\t * @param timestampBoost a <code>float</code> representing the time of the document (the younger the document, the larger the boost should be)\r\n\t * @param dynamicBoosts a Map from the boost index (zero based) to the boost value (a <code>double</code>).\r\n\t * @throws {@link IllegalArgumentException} if an invalid index is passed for a boost \r\n\t */\r\n\tpublic void add(String docId, Document document, int timestampBoost, Map<Integer, Double> dynamicBoosts);\r\n\r\n\t/**\r\n\t * Remove a document from the index.\r\n\t * \r\n\t * @param docId external (customer) identifier of the document to remove\r\n\t */\r\n\tpublic void del(String docId);\r\n\t\r\n\t/**\r\n\t * Update the special boost for the timestamp\r\n\t * \r\n\t * @param docId external (customer) identifier of the document\r\n\t * @param timestampBoost a <code>float</code> representing the time of the document (the younger the document, the larger the boost should be)\r\n\t */\r\n\tpublic void updateTimestamp(String docId, int timestampBoost);\r\n\t\r\n\t/**\r\n\t * Update one or more of the dynamic boosts values.\r\n\t * \r\n\t * @param docId external (customer) identifier of the document\r\n\t * @param updatedBoosts a Map from the boost index (zero based) to the boost value (a <code>double</code>). No index can be larger than the available boosts the {@link IndexEngine}'s {@link Scorer} has, minus one (since it is zero based)\r\n\t * @throws {@link IllegalArgumentException} if an invalid index is passed for a boost \r\n\t */\r\n\tpublic void updateBoosts(String docId, Map<Integer, Double> updatedBoosts);\r\n\r\n public void updateCategories(String docId, Map<String, String> categories);\r\n\t/**\r\n\t * Promote a document to be the first result for a specific query.\r\n\t * \r\n\t * @param docId external (customer) identifier of the document\r\n\t * @param query the exact query the document must be promoted to the first result for\r\n\t */\r\n public void promoteResult(String docId, String query);\r\n\r\n /**\r\n * Dumps the current state to disk.\r\n */\r\n public void dump() throws IOException;\r\n\r\n public void addScoreFunction(int functionIndex, String definition) throws Exception;\r\n\r\n public void removeScoreFunction(int functionIndex);\r\n\r\n public Map<Integer,String> listScoreFunctions();\r\n \r\n public Map<String, String> getStats();\r\n\r\n}", "public generateIndex() {\n\n\t\tthis.analyzer = \"StandardAnalyzer\";\n\t}", "public interface ILuceneIndexDAO extends IStatefulIndexerSession {\n // ===================================================================\n // The domain of indexing creates a separation between\n // readers and writers. In lucene, these are searchers\n // and writers. This DAO creates the more familiar DAO-ish interface\n // for developers to use and attempts to hide the details of\n // the searcher and write.\n // Calls are stateless meaning calling a find after a save does\n // not guarantee data will be reflected for the instance of the DAO\n // ===================================================================\n\n /**\n * Updates a document by first deleting the document(s) containing a term and then adding the new document. A Term is created by termFieldName, termFieldValue.\n *\n * @param termFieldName - Field name of the index.\n * @param termFieldValue - Field value of the index.\n * @param document - Lucene document to be updated.\n * @return - True for successful addition.\n */\n boolean saveDocument(String termFieldName, String termFieldValue, Document document);\n\n /**\n * Generates a BooleanQuery from the given fields Map and uses it to delete the documents matching in the IndexWriter.\n *\n * @param fields - A Map data structure containing a field(Key) and text(value) pair.\n * @return - True for successful deletion.\n */\n boolean deleteDocuments(Map<String, String> fields);\n\n /**\n * Find the documents in the IndexSearcher matching the Terms generated from fields.\n *\n * @param fields - A Map data structure contains the field(Key) and text(value).\n * @return - Collection of Documents obtained from the search.\n */\n Set<Document> findDocuments(Map<String, String> fields);\n\n /**\n * Find the documents in the IndexSearcher matching the Terms generated from fields. Offset is the starting position for the search and numberOfResults\n * is the length from offset position.\n *\n * @param fields - A Map data structure containing a field(Key) and text(value) pair.\n * @param offset - Starting position of the search.\n * @param numberOfResults - Number of documents to be searched from an offset position.\n * @return - Collection of Documents obtained from the search.\n */\n Set<Document> findDocuments(Map<String, String> fields, int offset, int numberOfResults);\n\n /**\n * Return the count of the documents present in the IndexSearcher.\n *\n * @return - Integer representing the count of documents.\n */\n int getDocumentCount();\n\n}", "public interface OffsetWriter {\n\n /**\n * Update the offset in memory if the provided offset is greater than the existing offset.\n * @param sourceTable string in the format of <keyspace>.<table>.\n * @param sourceOffset string in the format of <file_name>:<file_position>\n * @param isSnapshot whether the offset is coming from a snapshot or commit log\n */\n void markOffset(String sourceTable, String sourceOffset, boolean isSnapshot);\n\n /**\n * Determine if an offset has been processed based on the table name, offset position, and whether\n * it is from snapshot or not.\n * @param sourceTable string in the format of <keyspace>.<table>.\n * @param sourceOffset string in the format of <file_name>:<file_position>\n * @param isSnapshot whether the offset is coming from a snapshot or commit log\n * @return true if the offset has been processed, false otherwise.\n */\n boolean isOffsetProcessed(String sourceTable, String sourceOffset, boolean isSnapshot);\n\n /**\n * Flush latest offsets to disk.\n */\n void flush();\n\n\n /**\n * Close all resources used by this class.\n */\n void close();\n}", "StorableIndexInfo getIndexInfo();", "InstAssignIndex createInstAssignIndex();", "public void addRef(char[] word) {\n if (indexedFile == null) {\n throw new IllegalStateException(); }\n index.addRef(indexedFile, word); }", "public void init() {\n File file=new File(\"D:\\\\lucene\\\\index\");\n if(file.isDirectory())\n { //否则如果它是一个目录\n File files[] = file.listFiles(); //声明目录下所有的文件 files[];\n for(int i=0;i<files.length;i++)\n { //遍历目录下所有的文件\n files[i].delete(); //把每个文件 用这个方法进行迭代\n }\n }\n String indexPath = \"D:\\\\lucene\\\\index\";\n //String docsPath = \"D:\\\\lucene\\\\data\";\n boolean create = true;\n try\n {\n Session session=factory.openSession();\n String hql = \"from Book\";\n org.hibernate.Query query = session.createQuery(hql);\n List<Book> list=query.list();\n Directory indexDir = FSDirectory.open(Paths.get(\"D:\\\\lucene\\\\index\"));\n Analyzer luceneAnalyzer = new StandardAnalyzer(); //新建一个分词器实例 \n IndexWriterConfig config = new IndexWriterConfig(luceneAnalyzer); \n IndexWriter indexWriter = new IndexWriter(indexDir,config);\n for(int i=0;i<list.size();i++)\n {\n Document document = new Document();\n Field field1 = new StringField(\"id\",list.get(i).getBookid().toString(),Field.Store.YES); \n Field field2 = new StringField(\"bookname\",list.get(i).getBookname(),Field.Store.YES); \n Field field3 = new StringField(\"author\",list.get(i).getAuthor(),Field.Store.YES); \n Field field4 = new StringField(\"category\",list.get(i).getCategory(),Field.Store.YES); \n Field field5 = new StringField(\"price\", Double.toString(list.get(i).getPrice()),Field.Store.YES); \n document.add(field1); \n document.add(field2); \n document.add(field3); \n document.add(field4);\n document.add(field5);\n indexWriter.addDocument(document);\n }\n indexWriter.close();\n }\n catch(IOException e)\n {\n System.out.println(\"error\");\n return;\n }\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodEntrySet() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"entries.value.getID\",\n SEPARATOR + \"portfolio.entrySet() entries\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForEntries(ri);\n }", "@Override\n @Secured(SecurityRoles.ADMINISTRATOR)\n public void reindex() {\n revisionDao.deleteAll();\n // OK, launches a new indexation\n indexFromLatest();\n }", "public int addPageIndex(URL url, String urlHash, Date urlModified, int size, plasmaParserDocument document, plasmaCondenser condenser, String language, char doctype, int outlinksSame, int outlinksOther) {\n Iterator i = condenser.words();\r\n Map.Entry wentry;\r\n String word;\r\n indexRWIEntry ientry;\r\n plasmaCondenser.wordStatProp wprop;\r\n String wordHash;\r\n int urlLength = url.toString().length();\r\n int urlComps = htmlFilterContentScraper.urlComps(url.toString()).length;\r\n \r\n while (i.hasNext()) {\r\n wentry = (Map.Entry) i.next();\r\n word = (String) wentry.getKey();\r\n wprop = (plasmaCondenser.wordStatProp) wentry.getValue();\r\n // if ((s.length() > 4) && (c > 1)) System.out.println(\"# \" + s + \":\" + c);\r\n wordHash = plasmaURL.word2hash(word);\r\n ientry = newRWIEntry(urlHash,\r\n urlLength, urlComps, (document == null) ? urlLength : document.getMainLongTitle().length(),\r\n wprop.count,\r\n condenser.RESULT_SIMI_WORDS,\r\n condenser.RESULT_SIMI_SENTENCES,\r\n wprop.posInText,\r\n wprop.posInPhrase,\r\n wprop.numOfPhrase,\r\n 0,\r\n size,\r\n urlModified.getTime(),\r\n System.currentTimeMillis(),\r\n condenser.RESULT_WORD_ENTROPHY,\r\n language,\r\n doctype,\r\n outlinksSame, outlinksOther,\r\n true);\r\n addEntry(wordHash, ientry, System.currentTimeMillis(), false);\r\n }\r\n // System.out.println(\"DEBUG: plasmaSearch.addPageIndex: added \" +\r\n // condenser.getWords().size() + \" words, flushed \" + c + \" entries\");\r\n return condenser.RESULT_SIMI_WORDS;\r\n }", "protected int addInfo(syntaxMap toAdd){\n if(index == 10){\n return 0;\n }\n else if(index < 5) {\n this.array1[index] = toAdd;\n }\n else{\n this.array2[index - 5] = toAdd;\n }\n ++index;\n return 1;\n }", "protected void soConsumerIndex(long newValue)\r\n/* 27: */ {\r\n/* 28:139 */ C_INDEX_UPDATER.lazySet(this, newValue);\r\n/* 29: */ }", "public void IndexADocument(String docno, String content) throws IOException {\n\t\tthis.idWriter.write(docID+\":\"+docno);\n\t\tthis.idWriter.newLine();\n\t\tthis.idWriter.flush();\n\t\tString[] words = content.split(\" \");\n\t\tHashMap<String,Integer> count = new HashMap<>();\n\t\tfor(String s:words){\n\t\t\tcount.put(s,count.getOrDefault(s,0)+1);\n\t\t}\n\t\tfor(String key: count.keySet()){\n\t\t\tif(this.map.containsKey(key)){\n\t\t\t\tthis.map.get(key).append(docID).append(\":\").append(count.get(key)).append(\",\");\n\t\t\t}else {\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\tthis.map.put(key, sb.append(docID).append(\":\").append(count.get(key)).append(\",\"));\n\t\t\t}\n\t\t}\n\t\tdocID++;\n\t}", "protected void addEntryToIndex(String key, RecordHeader newRecord, int currentNumRecords) throws IOException {\n DbByteArrayOutputStream temp = new DbByteArrayOutputStream(MAX_KEY_LENGTH);\n (new DataOutputStream(temp)).writeUTF(key);\n if (temp.size() > MAX_KEY_LENGTH) {\n throw new IOException(\"Key is larger than permitted size of \" + MAX_KEY_LENGTH + \" bytes\");\n }\n file.seek(indexPositionToKeyFp(currentNumRecords));\n temp.writeTo(file);\n file.seek(indexPositionToRecordHeaderFp(currentNumRecords));\n newRecord.write(file);\n newRecord.setIndexPosition(currentNumRecords);\n writeNumRecordsHeader(currentNumRecords+1);\n\n getMemIndex().put(key, newRecord);\n }", "public void addWordOffset(int offset) {\n\t\twordOffsets.add(new Integer(offset));\n\t}", "private void addContentToLuceneDoc() {\n\t\t// Finish storing the document in the document store (parts of it may already have been\n\t\t// written because we write in chunks to save memory), retrieve the content id, and store\n\t\t// that in Lucene.\n\t\tint contentId = storeCapturedContent();\n\t\tcurrentLuceneDoc.add(new NumericField(ComplexFieldUtil.fieldName(\"contents\", \"cid\"),\n\t\t\t\tStore.YES, false).setIntValue(contentId));\n\n\t\t// Store the different properties of the complex contents field that were gathered in\n\t\t// lists while parsing.\n\t\tcontentsField.addToLuceneDoc(currentLuceneDoc);\n\t}", "public void index(Map<Integer, Document> docs) {\r\n this.docs = docs;\r\n\r\n // index\r\n this.index.process(this.docs);\r\n\r\n // tf-idf model\r\n this.tfidf.inject(this.index, this.docs.size());\r\n this.tfidf.process();\r\n }", "public boolean shouldIndex(IDocument document);", "@Ignore \n @Test\n public void testPutMappingToIndex() {\n System.out.println(\"putMappingToIndex\");\n \n Util.commonServiceIPs=\"127.0.0.1\";\n \n EntityManager em=Util.getEntityManagerFactory(100).createEntityManager();\n EntityManager platformEm = Util.getPlatformEntityManagerFactory().createEntityManager();\n \n Client client = ESUtil.getClient(em,platformEm,1,false);\n \n String indexName = \"datastore_100_1_data_event_yearmonth_000000_1\";\n String indexType = \"AAA666_type\";\n \n try\n { \n ESUtil.createIndexWithoutType(client, indexName);\n \n DataobjectType dataobjectType = Util.getDataobjectTypeByIndexTypeName(platformEm, indexType);\n\n XContentBuilder typeMapping = ESUtil.createTypeMapping(platformEm, dataobjectType, true);\n \n ESUtil.putMappingToIndex(client, indexName, indexType, typeMapping);\n }\n catch(Exception e)\n {\n System.out.print(\" failed! e=\"+e);\n }\n }", "@Override\n public void insert(Sentence sntnc, Attributes atrbts) \n {\n for(Word w: sntnc.getWords())\n {\n int index = w.word.hashCode();\n if(myIndex.get(index) == null)\n {\n myIndex.put(index, new IndexObject(w, atrbts)); \n }\n else\n { \n myIndex.get(index).update(atrbts);\n }\n if(!documentData.containsKey(atrbts.document))\n {\n documentData.put(atrbts.document, 1);\n }\n else\n {\n documentData.put(atrbts.document, documentData.get(atrbts.document) + 1);\n }\n \n }\n }", "public void commit () throws IOException {\n log.info(\"Internal committing index ... \");\n this.writer().commit();\n commitCounter = 0;\n this.closeReader();\n }", "public static void add(Transcription t) throws IOException, SQLException\r\n {\r\n IndexWriter writer = null;\r\n Analyzer analyser;\r\n Directory directory;\r\n /**@TODO parameterize this location*/\r\n String dest = \"/usr/indexTranscriptions\";\r\n\r\n directory = FSDirectory.getDirectory(dest, true);\r\n analyser = new StandardAnalyzer();\r\n writer = new IndexWriter(directory, analyser, true);\r\n Document doc=new Document();\r\n Field field;\r\n field = new Field(\"text\", t.getText(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"comment\", t.getComment(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"creator\", \"\" + t.UID, Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"security\", \"\" + \"private\", Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"line\", \"\" + t.getLine(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"page\", \"\" + t.getFolio(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"id\", \"\" + t.getLineID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"manuscript\", \"\" + new Manuscript(t.getFolio()).getID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"projectID\", \"\" + t.getProjectID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n writer.addDocument(doc);\r\n writer.commit();\r\n \twriter.close();\r\n\r\n }", "public static synchronized void indexDocument(CodeIndexDocument codeIndexDocument) throws IOException {\n Queue<CodeIndexDocument> queue = new ConcurrentLinkedQueue<CodeIndexDocument>();\n queue.add(codeIndexDocument);\n indexDocuments(queue);\n queue = null;\n }", "public void addDocument(IDocument document) {\n if (indexedFile == null) {\n indexedFile= index.addDocument(document);\n } else {\n throw new IllegalStateException(); } }", "boolean isNewIndex();", "public void createIndex() throws IOException {\n\t\tindexWriter.commit();\n\t\ttaxoWriter.commit();\n\n\t\t// categories\n\t\tfor (Article.Facets f : Article.Facets.values()) {\n\t\t\ttaxoWriter.addCategory(new CategoryPath(f.toString()));\n\t\t}\n\t\ttaxoWriter.commit();\n\n\t\tfinal Iterable<Article> articles = articleRepository.findAll();\n\t\tint c = 0;\n\t\tfor (Article article : articles) {\n\t\t\taddArticle(indexWriter, taxoWriter, article);\n\t\t\tc++;\n\t\t}\n\t\t// commit\n\t\ttaxoWriter.commit();\n\t\tindexWriter.commit();\n\n\t\ttaxoWriter.close();\n\t\tindexWriter.close();\n\n\t\ttaxoDirectory.close();\n\t\tindexDirectory.close();\n\t\tLOGGER.debug(\"{} articles indexed\", c);\n\t}", "@Test\n public void mergedTest() {\n for (\n int i = 0;\n i < InvertedIndexManager.DEFAULT_FLUSH_THRESHOLD\n * InvertedIndexManager.DEFAULT_MERGE_THRESHOLD;\n i++\n ) {\n iim.addDocument(dummy);\n }\n\n for (int i = 0; i < InvertedIndexManager.DEFAULT_MERGE_THRESHOLD / 2; i++) {\n assertEquals(\n InvertedIndexManager.DEFAULT_FLUSH_THRESHOLD * 2,\n iim.getNumDocuments(i)\n );\n }\n }", "public void WriteIndex() throws Exception {\n CorpusReader corpus = new CorpusReader();\n // initiate the output object\n IndexWriter output = new IndexWriter();\n\n // Map to hold doc_id and doc content;\n Map<String, String> doc;\n\n // index the corpus, load the doc one by one\n while ((doc = corpus.NextDoc()) != null){\n // get the doc_id and content of the current doc.\n String doc_id = doc.get(\"DOC_ID\");\n String content = doc.get(\"CONTENT\");\n\n // index the doc\n output.IndexADoc(doc_id, content);\n }\n output.close_index_writer();\n }", "private void addEntry(String word, String file, int position, HashMap<String, ArrayList<Integer>> subIndex) {\n\t\tif (subIndex.containsKey(word)) {\r\n\t\t\t// checks if the file name is a key in the nested\r\n\t\t\t// hash map of the word\r\n\t\t\tsubIndex.get(word).add(position);\r\n\t\t\r\n\t\t/*\r\n\t\t * if the word is not yet a key, create a new entry in the hash map.\r\n\t\t * Create new hash map to hold the file the word is found and an array\r\n\t\t * to find the position Then put that in the wordMap hash map as value\r\n\t\t * and the word as a key.\r\n\t\t */\r\n\t\t}else {\r\n\t\t\tsubIndex.put(word, new ArrayList<Integer>());\r\n\t\t\tsubIndex.get(word).add(position);\r\n\t\t\r\n\t\t}\r\n\t\r\n\t}", "@Test\n public void testIndexMaintenanceOnPutAll() throws Exception {\n IndexManager.TEST_RANGEINDEX_ONLY = true;\n Cache cache = CacheUtils.getCache();\n qs = cache.getQueryService();\n region = CacheUtils.createRegion(\"portfolio1\", null);\n region.put(\"1\", new Portfolio(1));\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"posvals.secId\",\n SEPARATOR + \"portfolio1 pf, pf.positions.values posvals \");\n Map data = new HashMap();\n for (int i = 1; i < 11; ++i) {\n data.put(\"\" + i, new Portfolio(i + 2));\n }\n\n region.putAll(data);\n }", "public interface InvertedIndex extends Serializable {\n\n\n /**\n * Sampling for creating mini batches\n * @return the sampling for mini batches\n */\n double sample();\n\n /**\n * Iterates over mini batches\n * @return the mini batches created by this vectorizer\n */\n Iterator<List<VocabWord>> miniBatches();\n\n /**\n * Returns a list of words for a document\n * @param index\n * @return\n */\n List<VocabWord> document(int index);\n\n /**\n * Returns the list of documents a vocab word is in\n * @param vocabWord the vocab word to get documents for\n * @return the documents for a vocab word\n */\n int[] documents(VocabWord vocabWord);\n\n /**\n * Returns the number of documents\n * @return\n */\n int numDocuments();\n\n /**\n * Returns a list of all documents\n * @return the list of all documents\n */\n int[] allDocs();\n\n\n\n /**\n * Add word to a document\n * @param doc the document to add to\n * @param word the word to add\n */\n void addWordToDoc(int doc,VocabWord word);\n\n\n /**\n * Adds words to the given document\n * @param doc the document to add to\n * @param words the words to add\n */\n void addWordsToDoc(int doc,List<VocabWord> words);\n\n\n /**\n * Finishes saving data\n */\n void finish();\n\n /**\n * Total number of words in the index\n * @return the total number of words in the index\n */\n int totalWords();\n\n /**\n * For word vectors, this is the batch size for which to train on\n * @return the batch size for which to train on\n */\n int batchSize();\n\n /**\n * Iterate over each document\n * @param func the function to apply\n * @param exec exectuor service for execution\n */\n void eachDoc(Function<List<VocabWord>, Void> func, ExecutorService exec);\n}", "@Test\n public void fieldIndexFormatting() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Create an INDEX field which will display an entry for each XE field found in the document.\n // Each entry will display the XE field's Text property value on the left side,\n // and the number of the page that contains the XE field on the right.\n // If the XE fields have the same value in their \"Text\" property,\n // the INDEX field will group them into one entry.\n FieldIndex index = (FieldIndex) builder.insertField(FieldType.FIELD_INDEX, true);\n index.setLanguageId(\"1033\");\n\n // Setting this property's value to \"A\" will group all the entries by their first letter,\n // and place that letter in uppercase above each group.\n index.setHeading(\"A\");\n\n // Set the table created by the INDEX field to span over 2 columns.\n index.setNumberOfColumns(\"2\");\n\n // Set any entries with starting letters outside the \"a-c\" character range to be omitted.\n index.setLetterRange(\"a-c\");\n\n Assert.assertEquals(\" INDEX \\\\z 1033 \\\\h A \\\\c 2 \\\\p a-c\", index.getFieldCode());\n\n // These next two XE fields will show up under the \"A\" heading,\n // with their respective text stylings also applied to their page numbers.\n builder.insertBreak(BreakType.PAGE_BREAK);\n FieldXE indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Apple\");\n indexEntry.isItalic(true);\n\n Assert.assertEquals(\" XE Apple \\\\i\", indexEntry.getFieldCode());\n\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Apricot\");\n indexEntry.isBold(true);\n\n Assert.assertEquals(\" XE Apricot \\\\b\", indexEntry.getFieldCode());\n\n // Both the next two XE fields will be under a \"B\" and \"C\" heading in the INDEX fields table of contents.\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Banana\");\n\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Cherry\");\n\n // INDEX fields sort all entries alphabetically, so this entry will show up under \"A\" with the other two.\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Avocado\");\n\n // This entry will not appear because it starts with the letter \"D\",\n // which is outside the \"a-c\" character range that the INDEX field's LetterRange property defines.\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Durian\");\n\n doc.updatePageLayout();\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.INDEX.XE.Formatting.docx\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.INDEX.XE.Formatting.docx\");\n index = (FieldIndex) doc.getRange().getFields().get(0);\n\n Assert.assertEquals(\"1033\", index.getLanguageId());\n Assert.assertEquals(\"A\", index.getHeading());\n Assert.assertEquals(\"2\", index.getNumberOfColumns());\n Assert.assertEquals(\"a-c\", index.getLetterRange());\n Assert.assertEquals(\" INDEX \\\\z 1033 \\\\h A \\\\c 2 \\\\p a-c\", index.getFieldCode());\n Assert.assertEquals(\"\\fA\\r\" +\n \"Apple, 2\\r\" +\n \"Apricot, 3\\r\" +\n \"Avocado, 6\\r\" +\n \"B\\r\" +\n \"Banana, 4\\r\" +\n \"C\\r\" +\n \"Cherry, 5\\r\\f\", index.getResult());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(1);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Apple \\\\i\", \"\", indexEntry);\n Assert.assertEquals(\"Apple\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertTrue(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(2);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Apricot \\\\b\", \"\", indexEntry);\n Assert.assertEquals(\"Apricot\", indexEntry.getText());\n Assert.assertTrue(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(3);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Banana\", \"\", indexEntry);\n Assert.assertEquals(\"Banana\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(4);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Cherry\", \"\", indexEntry);\n Assert.assertEquals(\"Cherry\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(5);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Avocado\", \"\", indexEntry);\n Assert.assertEquals(\"Avocado\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(6);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Durian\", \"\", indexEntry);\n Assert.assertEquals(\"Durian\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n }", "public void updateDocument(Document arg0) throws ContestManagementException {\r\n }", "private IndexMetadata createUpdatedIndexMetadata(IndexMetadata indexMetadata) {\n return IndexMetadata.builder(indexMetadata)\n .putMapping(\n createUpdatedIndexMetadata(\n indexMetadata.mapping(),\n indexMetadata.getIndex().getName()\n ))\n .build();\n }", "int writerIndex();", "private void indexDocument(File f) throws IOException {\n\n\t\tHashMap<String, StringBuilder> fm;\n\t\tif (!f.getName().equals(\".DS_Store\")) {\n\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(f));\n\n\t\t\tString s = \"\";\n\t\t\twhile ((s = br.readLine()) != null) {\n\n\t\t\t\tString temp = \"\";\n\n\t\t\t\tif (s.contains(\"<DOC>\")) {\n\n\t\t\t\t\ts = br.readLine();\n\n\t\t\t\t\twhile (!s.contains(\"</DOC>\")) {\n\n\t\t\t\t\t\ttemp += s + \" \";\n\n\t\t\t\t\t\ts = br.readLine();\n\t\t\t\t\t}\n\n\t\t\t\t\tfm = parseTags(temp);\n\t\t\t\t\tindexDocumentHelper(fm);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tbr.close();\n\t\t}\n\n\t}", "@Test\n public void testIndexMaintenanceWithIndexOnMethodGetEntries() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"entries.value.getID\",\n SEPARATOR + \"portfolio.getEntries() entries\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForEntries(ri);\n }", "public void finishedDirectIndexBuild()\n\t{\n\t\tif(logger.isInfoEnabled()){\n\t\t\tlogger.info(\"flushing utf block lexicon to disk after the direct index completed\");\n\t\t}\n\t\t//only write a temporary lexicon if there are any items in it\n\t\tif (TempLex.getNumberOfNodes() > 0)\n\t\t\twriteTemporaryLexicon();\n\n\t\t//merges the temporary lexicons\n\t\tif (tempLexFiles.size() > 0)\n\t\t{\n\t\t\ttry{\n\t\t\t\tmerge(tempLexFiles);\n\t\n\t\t\t\t//creates the offsets file\n\t\t\t\tfinal String lexiconFilename = \n\t\t\t\t\tindexPath + ApplicationSetup.FILE_SEPARATOR + \n\t\t\t\t\tindexPrefix + ApplicationSetup.LEXICONSUFFIX;\n\t\t\t\tLexiconInputStream lis = getLexInputStream(lexiconFilename);\n\t\t\t\tcreateLexiconIndex(\n\t\t\t\t\tlis,\n\t\t\t\t\tlis.numberOfEntries(),\n\t\t\t\t\t/* after inverted index is built, the lexicon will be transformed into a\n\t\t\t\t\t * normal lexicon, without block frequency */\n\t\t\t\t\tUTFLexicon.lexiconEntryLength\n\t\t\t\t\t); \n\t\t\t\tTermCount = lis.numberOfEntries();\n\t\t\t\tif (index != null)\n\t\t\t\t{\n\t\t\t\t\tindex.addIndexStructure(\"lexicon\", \"uk.ac.gla.terrier.structures.UTFBlockLexicon\");\n\t\t\t\t\tindex.addIndexStructureInputStream(\"lexicon\", \"uk.ac.gla.terrier.structures.UTFBlockLexiconInputStream\");\n\t\t\t\t\tindex.setIndexProperty(\"num.Terms\", \"\"+lis.numberOfEntries());\n\t\t\t\t\tindex.setIndexProperty(\"num.Pointers\", \"\"+lis.getNumberOfPointersRead());\n\t\t\t\t}\n\t\t\t} catch(IOException ioe){\n\t\t\t\tlogger.error(\"Indexing failed to write a lexicon index file to disk\", ioe);\n\t\t\t}\t\n\t\t}\n\t\telse\n\t\t\tlogger.warn(\"No temporary lexicons to merge, skipping\");\n\t\t\n\t}", "private Document createMapping() {\n return getIndexOperations().createMapping();\n }", "void markOffset(String sourceTable, String sourceOffset, boolean isSnapshot);", "public void indexFileOrDirectory(String fileName) {\r\n\r\n addFiles(new File(fileName));\r\n\r\n int originalNumDocs = writer.numRamDocs();\r\n for (File f : queue) {\r\n try {\r\n Document doc = new Document();\r\n\r\n // Creation of a simpledateformatter in order to print the last-modified-date of our files.\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\");\r\n String date = sdf.format(f.lastModified());\r\n\r\n if (f.getName().endsWith(\".html\")) {\r\n\r\n // Creation of a jsoup document to help us with our html parsing.\r\n org.jsoup.nodes.Document htmlFile = Jsoup.parse(f, null);\r\n String body = htmlFile.body().text();\r\n String title = htmlFile.title();\r\n String summary = getSummary(htmlFile);\r\n\r\n\r\n doc.add(new TextField(\"contents\", body + \" \" + title + \" \" + date, Field.Store.YES));\r\n doc.add(new TextField(\"title\", title, Field.Store.YES));\r\n doc.add(new StringField(\"path\", f.getPath(), Field.Store.YES));\r\n doc.add(new TextField(\"modified-date\", date, Field.Store.YES));\r\n doc.add(new StringField(\"summary\", summary, Field.Store.YES));\r\n\r\n }\r\n else {\r\n String content = FileUtils.readFileToString(f, StandardCharsets.UTF_8);\r\n\r\n doc.add(new TextField(\"contents\", content + \" \" + date, Field.Store.YES));\r\n doc.add(new StringField(\"path\", f.getPath(), Field.Store.YES));\r\n doc.add(new TextField(\"modified-date\", date, Field.Store.YES));\r\n }\r\n doc.add(new StringField(\"filename\", f.getName(), Field.Store.YES));\r\n\r\n writer.addDocument(doc);\r\n System.out.println(\"Added: \" + f);\r\n } catch (Exception e) {\r\n System.out.println(\"Could not add: \" + f);\r\n }\r\n }\r\n\r\n int newNumDocs = writer.numDocs();\r\n System.out.println(\"\");\r\n System.out.println(\"************************\");\r\n System.out.println((newNumDocs - originalNumDocs) + \" documents added.\");\r\n System.out.println(\"************************\");\r\n\r\n queue.clear();\r\n }", "void addIndexForRepository(long repositoryId);", "@Test\n public void testIndexMaintenanceWithIndexOnMethodAsList() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID\",\n SEPARATOR + \"portfolio.asList() pf\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForValues(ri);\n }", "com.icare.eai.schema.om.evSORequest.EvSORequestDocument.EvSORequest.Key insertNewKey(int i);", "String createIndex() {\n\t\tboolean res = indexExists();\n\t\t@SuppressWarnings(\"unused\")\n\t\tint resCode;\n\t\tif (!res) {\n\t\t\tresCode = doHttpOperation(esIndexUrl, HTTP_PUT, null);\n\t\t}\n\t\treturn lastResponse;\n\t}", "public interface Index {\n\t\n\tvoid index(AddOnInfoAndVersions infoAndVersions) throws Exception;\n\t\n\tCollection<AddOnInfoSummary> search(AddOnType type, String query) throws Exception;\n\t\n\tCollection<AddOnInfoAndVersions> getAllByType(AddOnType type) throws Exception;\n\t\n\tCollection<AddOnInfoAndVersions> getByTag(String tag) throws Exception;\n\t\n\tAddOnInfoAndVersions getByUid(String uid) throws Exception;\n}", "@Test\n public void testCase4 () throws IOException {\n //\t\tlog.trace(\"Testcase4\");\n\n ki = new KrillIndex();\n ki.addDoc(createFieldDoc0());\n ki.commit();\n ki.addDoc(createFieldDoc1());\n ki.addDoc(createFieldDoc2());\n ki.commit();\n\n sq = new SpanSegmentQuery(new SpanElementQuery(\"base\", \"e\"),\n new SpanNextQuery(new SpanTermQuery(new Term(\"base\", \"s:a\")),\n new SpanTermQuery(new Term(\"base\", \"s:b\"))));\n\n kr = ki.search(sq, (short) 10);\n ki.close();\n\n assertEquals(\"totalResults\", kr.getTotalResults(), 2);\n // Match #0\n assertEquals(\"doc-number\", 0, kr.getMatch(0).getLocalDocID());\n assertEquals(\"StartPos\", 3, kr.getMatch(0).startPos);\n assertEquals(\"EndPos\", 5, kr.getMatch(0).endPos);\n // Match #1\n assertEquals(\"doc-number\", 0, kr.getMatch(1).getLocalDocID());\n assertEquals(\"StartPos\", 1, kr.getMatch(1).startPos);\n assertEquals(\"EndPos\", 3, kr.getMatch(1).endPos);\n }", "public interface Indexed {\n\n /**\n * index keyword and resource\n * @param resourceId keyword KAD id\n * @param entry published entry with keyword information\n * @param lastActivityTime current time from external system\n * @return percent of taken place in storage\n */\n int addKeyword(final KadId resourceId, final KadSearchEntry entry, long lastActivityTime);\n\n /**\n *\n * @param resourceId file KAD id\n * @param entry published entry with source information\n * @return true if source was indexed\n */\n int addSource(final KadId resourceId, final KadSearchEntry entry, long lastActivityTime);\n}", "void fill(int docID) throws IOException {\n final int docStoreOffset = docWriter.getDocStoreOffset();\n\n final int end = docID+docStoreOffset;\n while(lastDocID < end) {\n fieldsWriter.skipDocument();\n lastDocID++;\n }\n }", "@Test\n public void fieldIndexSequence() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Create an INDEX field which will display an entry for each XE field found in the document.\n // Each entry will display the XE field's Text property value on the left side,\n // and the number of the page that contains the XE field on the right.\n // If the XE fields have the same value in their \"Text\" property,\n // the INDEX field will group them into one entry.\n FieldIndex index = (FieldIndex) builder.insertField(FieldType.FIELD_INDEX, true);\n\n // In the SequenceName property, name a SEQ field sequence. Each entry of this INDEX field will now also display\n // the number that the sequence count is on at the XE field location that created this entry.\n index.setSequenceName(\"MySequence\");\n\n // Set text that will around the sequence and page numbers to explain their meaning to the user.\n // An entry created with this configuration will display something like \"MySequence at 1 on page 1\" at its page number.\n // PageNumberSeparator and SequenceSeparator cannot be longer than 15 characters.\n index.setPageNumberSeparator(\"\\tMySequence at \");\n index.setSequenceSeparator(\" on page \");\n Assert.assertTrue(index.hasSequenceName());\n\n Assert.assertEquals(\" INDEX \\\\s MySequence \\\\e \\\"\\tMySequence at \\\" \\\\d \\\" on page \\\"\", index.getFieldCode());\n\n // SEQ fields display a count that increments at each SEQ field.\n // These fields also maintain separate counts for each unique named sequence\n // identified by the SEQ field's \"SequenceIdentifier\" property.\n // Insert a SEQ field which moves the \"MySequence\" sequence to 1.\n // This field no different from normal document text. It will not appear on an INDEX field's table of contents.\n builder.insertBreak(BreakType.PAGE_BREAK);\n FieldSeq sequenceField = (FieldSeq) builder.insertField(FieldType.FIELD_SEQUENCE, true);\n sequenceField.setSequenceIdentifier(\"MySequence\");\n\n Assert.assertEquals(\" SEQ MySequence\", sequenceField.getFieldCode());\n\n // Insert an XE field which will create an entry in the INDEX field.\n // Since \"MySequence\" is at 1 and this XE field is on page 2, along with the custom separators we defined above,\n // this field's INDEX entry will display \"Cat\" on the left side, and \"MySequence at 1 on page 2\" on the right.\n FieldXE indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Cat\");\n\n Assert.assertEquals(\" XE Cat\", indexEntry.getFieldCode());\n\n // Insert a page break, and use SEQ fields to advance \"MySequence\" to 3.\n builder.insertBreak(BreakType.PAGE_BREAK);\n sequenceField = (FieldSeq) builder.insertField(FieldType.FIELD_SEQUENCE, true);\n sequenceField.setSequenceIdentifier(\"MySequence\");\n sequenceField = (FieldSeq) builder.insertField(FieldType.FIELD_SEQUENCE, true);\n sequenceField.setSequenceIdentifier(\"MySequence\");\n\n // Insert an XE field with the same Text property as the one above.\n // The INDEX entry will group XE fields with matching values in the \"Text\" property\n // into one entry as opposed to making an entry for each XE field.\n // Since we are on page 2 with \"MySequence\" at 3, \", 3 on page 3\" will be appended to the same INDEX entry as above.\n // The page number portion of that INDEX entry will now display \"MySequence at 1 on page 2, 3 on page 3\".\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Cat\");\n\n // Insert an XE field with a new and unique Text property value.\n // This will add a new entry, with MySequence at 3 on page 4.\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Dog\");\n\n doc.updatePageLayout();\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.INDEX.XE.Sequence.docx\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.INDEX.XE.Sequence.docx\");\n index = (FieldIndex) doc.getRange().getFields().get(0);\n\n Assert.assertEquals(\"MySequence\", index.getSequenceName());\n Assert.assertEquals(\"\\tMySequence at \", index.getPageNumberSeparator());\n Assert.assertEquals(\" on page \", index.getSequenceSeparator());\n Assert.assertTrue(index.hasSequenceName());\n Assert.assertEquals(\" INDEX \\\\s MySequence \\\\e \\\"\\tMySequence at \\\" \\\\d \\\" on page \\\"\", index.getFieldCode());\n Assert.assertEquals(\"Cat\\tMySequence at 1 on page 2, 3 on page 3\\r\" +\n \"Dog\\tMySequence at 3 on page 4\\r\", index.getResult());\n\n Assert.assertEquals(3, DocumentHelper.getFieldsCount(doc.getRange().getFields(), FieldType.FIELD_SEQUENCE));\n }", "@Override\n\t\tpublic void write(Writable key, SolrInputDocument doc)\n\t\t\t\tthrows IOException, InterruptedException {\n\t\t\ttry {\n\t\t\t\tdocs.add(doc);\n\t\t\t\tif (docs.size() >= batch) {\n\t\t\t\t\tserver.add(docs);\n\t\t\t\t\tdocs.clear();\n\t\t\t\t}\n\t\t\t} catch (SolrServerException e) {\n\t\t\t\tRuntimeException exc = new RuntimeException(e.toString(), e);\n\t\t\t\texc.setStackTrace(e.getStackTrace());\n\t\t\t\tthrow exc;\n\t\t\t}\n\t\t}", "public interface IndexMetadata extends Freezable<IndexMetadata> {\n\t\n\tAnnotatedFields annotatedFields();\n\t\n\tdefault AnnotatedField mainAnnotatedField() {\n\t return annotatedFields().main();\n\t}\n\t\n default AnnotatedField annotatedField(String name) {\n return annotatedFields().get(name);\n }\n \n\tMetadataFields metadataFields();\n\t\n\tdefault MetadataField metadataField(String name) {\n\t return metadataFields().get(name);\n\t}\n\n\t/**\n\t * Get the display name for the index.\n\t *\n\t * If no display name was specified, returns the name of the index directory.\n\t *\n\t * @return the display name\n\t */\n\tString displayName();\n\n\t/**\n\t * Get a description of the index, if specified\n\t * @return the description\n\t */\n\tString description();\n\n\t/**\n\t * Is the content freely viewable by all users, or is it restricted?\n\t * @return true if the full content may be retrieved by anyone\n\t */\n\tboolean contentViewable();\n\n /**\n * What's the text direction of this corpus?\n * @return text direction\n */\n\tTextDirection textDirection();\n\n\t/**\n\t * What format(s) is/are the documents in?\n\t *\n\t * This is in the form of a format identifier as understood\n\t * by the DocumentFormats class (either an abbreviation or a\n\t * (qualified) class name).\n\t *\n\t * @return the document format(s)\n\t */\n\tString documentFormat();\n\n\t/**\n\t * What version of the index format is this?\n\t * @return the index format version\n\t */\n\tString indexFormat();\n\n\t/**\n\t * When was this index created?\n\t * @return date/time\n\t */\n\tString timeCreated();\n\n\t/**\n\t * When was this index last modified?\n\t * @return date/time\n\t */\n\tString timeModified();\n\n\t/**\n\t * When was the BlackLab.jar used for indexing built?\n\t * @return date/time\n\t */\n\tString indexBlackLabBuildTime();\n\n\t/**\n\t * When was the BlackLab.jar used for indexing built?\n\t * @return date/time stamp\n\t */\n\tString indexBlackLabVersion();\n\n\t/**\n\t * How many tokens are in the index?\n\t * @return number of tokens\n\t */\n\tlong tokenCount();\n\n\t/**\n\t * Is this a new, empty index?\n\t *\n\t * An empty index is one that doesn't have a main contents field yet,\n\t * or has a main contents field but no indexed tokens yet.\n\t *\n\t * @return true if it is, false if not.\n\t */\n\tboolean isNewIndex();\n\n default boolean subannotationsStoredWithParent() {\n return false;\n }\n\t\n}", "private static void addDoc(IndexWriter w, String name, String birthDate, String deathDate) {\n\t\tDocument doc = new Document();\n\t\tdoc.add(new TextField(\"name\", name, Field.Store.YES));\n\t\tdoc.add(new StringField(\"birthStartDate\", birthDate, Field.Store.YES)); \t\t\t\t// use a string field for isbn because we don't want it tokenized\n\t\tdoc.add(new StringField(\"deathEndDate\", deathDate, Field.Store.YES));\n\t\t\n\t\ttry {\n\t\t\tw.addDocument(doc);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void index(List<ParsedDocument> pdocs,int qid) {\n\t\ttry {\n\t\t\tint count = iw.maxDoc()+1;\n\t\t\tDocument doc = null;\n\t\t\tIndexDocument iDoc=null;\n\t\t\tfor (ParsedDocument pdoc : pdocs) {\n\t\t\t\t\n\t\t\t\tiDoc=parseDocument(pdoc);\n\t\t\t\tif(iDoc==null){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tField queryField = new Field(\"qid\", qid+\"\", Store.YES,\n\t\t\t\t\t\tIndex.NOT_ANALYZED);\n\t\t\t\tField uniqueField = new Field(\"id\", count + \"\", Store.YES,\n\t\t\t\t\t\tIndex.NOT_ANALYZED);\n\t\t\t\tField titleField = new Field(\"title\", iDoc.getTitle(),\n\t\t\t\t\t\tStore.YES, Index.ANALYZED, TermVector.YES);\n\t\t\t\tField bodyField = new Field(\"body\", iDoc.getBody(), Store.YES,\n\t\t\t\t\t\tIndex.ANALYZED, TermVector.YES);\n\t\t\t\tField urlField = new Field(\"url\", iDoc.getUrl(), Store.YES,\n\t\t\t\t\t\tIndex.NOT_ANALYZED);\n\t\t\t\tField anchorField = new Field(\"anchor\", iDoc.getAnchor(), Store.YES,\n\t\t\t\t\t\tIndex.ANALYZED, TermVector.YES);\n\n\t\t\t\tdoc = new Document();\n\t\t\t\tdoc.add(uniqueField);//标示不同的document\n\t\t\t\tdoc.add(queryField);//标示不同的query\n\t\t\t\tdoc.add(titleField);\n\t\t\t\tdoc.add(bodyField);\n\t\t\t\tdoc.add(urlField);\n\t\t\t\tdoc.add(anchorField);\n\t\t\t\t\n\t\t\t\tiw.addDocument(doc);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tiw.commit();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "public void close() throws IOException{\n\t\tSystem.out.println(\"Indexed \" + writer.numDocs() + \" Docs!\");\n\t\twriter.commit();\n\t\twriter.close();\n\t}", "@Override\n\tpublic void commitOffsets() {\n\n\t}", "void setIndexed(boolean indexed);" ]
[ "0.6344753", "0.63235545", "0.60032284", "0.59595346", "0.59330505", "0.578764", "0.5781231", "0.5760061", "0.5738502", "0.5733359", "0.57019573", "0.569972", "0.5683141", "0.5683141", "0.5674248", "0.562783", "0.5595195", "0.55493456", "0.5527176", "0.55203867", "0.5482442", "0.5480567", "0.545798", "0.54191995", "0.53903997", "0.53739727", "0.5368537", "0.53615785", "0.5331426", "0.52868795", "0.5270785", "0.5269928", "0.52612084", "0.52510643", "0.5233032", "0.5225291", "0.5223216", "0.52219385", "0.5201201", "0.5185441", "0.5174229", "0.5170632", "0.51687056", "0.51672006", "0.51659644", "0.5147278", "0.5147111", "0.514608", "0.5139744", "0.51272476", "0.5114551", "0.5103201", "0.5095542", "0.5088959", "0.5087473", "0.5085033", "0.50724053", "0.50719166", "0.5064574", "0.50626296", "0.50621504", "0.50611585", "0.5054911", "0.50508523", "0.5049408", "0.5047959", "0.50435096", "0.50432134", "0.50369734", "0.5032719", "0.50230306", "0.50215244", "0.5013403", "0.5011249", "0.5009309", "0.50066155", "0.49969107", "0.49947256", "0.49945268", "0.49868673", "0.49750805", "0.49680385", "0.4965308", "0.49649614", "0.49606755", "0.49444345", "0.49407378", "0.49247465", "0.49217793", "0.4892926", "0.48898327", "0.4887425", "0.48844346", "0.48821086", "0.48815095", "0.4868055", "0.4865993", "0.48638478", "0.48621896", "0.48589516" ]
0.6843133
0
DISK/MEMORY MANAGEMENT [NEW] Recovers the essential files required to retrieve information in memory. This includes hashmap mapping tokens with respective terms and list of names of the retrieved documents.
public void load(){ // Recover docIDs try(Reader reader = new FileReader("postings/docIDs.json")){ this.docIDs = (new Gson()).fromJson(reader, new TypeToken<Map<String, String>>(){}.getType()); } catch (IOException e) { e.printStackTrace(); } try(Reader reader = new FileReader("postings/docLengths.json")){ this.docLengths = (new Gson()).fromJson(reader, new TypeToken<Map<String, Integer>>(){}.getType()); } catch (IOException e) { e.printStackTrace(); } try(Reader reader = new FileReader("postings/titleToNumber.json")){ this.titleToNumber = (new Gson()).fromJson(reader, new TypeToken<Map<String, Integer>>(){}.getType()); } catch (IOException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void scanDocuments()\n{\n document_counts = new HashMap<>();\n kgram_counts = new HashMap<>();\n for (File f : root_files) {\n addDocuments(f);\n }\n}", "public static void main(String[] args) throws IOException{\n\t\tint termIndex = 1;\n\t\t\n\t\t// startOffset holds the start offset for each term in\n\t\t// the corpus.\n\t\tlong startOffset = 0;\n\t\t\t\n\t\t// unique_terms is true if there are atleast one more\n\t\t// unique term in corpus.\n\t\tboolean unique_terms = true;\n\t\t\n\t\t\n\t\t//load the stopwords from the HDD\n\t\tString stopwords = getStopWords();\n\t\t\n\t\t// allTokenHash contains all the terms and its termid\n\t\tHashMap<String, Integer> allTermHash = new HashMap<String, Integer>();\n\t\t\n\t\t// catalogHash contains the term and its position in\n\t\t// the inverted list present in the HDD.\n\t\tHashMap<Integer, Multimap> catalogHash = new HashMap<Integer, Multimap>();\n\t\t\n\t\t// finalCatalogHash contains the catalogHash for the invertedIndexHash\n\t\t// present in the HDD.\n\t\tHashMap<Integer, String> finalCatalogHash = new HashMap<Integer, String>();\n\t\t\n\t\t// token1000Hash contains the term and Dblocks for the first 1000\n\t\tHashMap<Integer, Multimap> token1000DocHash = new HashMap<Integer, Multimap>();\n\t\t\n\t\t// documentHash contains the doclength of all the documents in the corpus\n\t\tHashMap<String, String> documentHash = new HashMap<String, String>();\t\n\t\t\n\t\t// id holds the document id corresponding to the docNumber.\n\t\tint id = 1;\n\t\t\n\t\t// until all unique terms are exhausted\n\t\t// pass through the documents and index the terms.\n\t\t//while(unique_terms){\n\t\t\t\n\t\t\tFile folder = new File(\"C:/Naveen/CCS/IR/AP89_DATA/AP_DATA/ap89_collection\");\n\t\t\t//File folder = new File(\"C:/Users/Naveen/Desktop/TestFolder\");\n\t\t\tFile[] listOfFiles = folder.listFiles();\n\t\t\t\n\t\t\t//for each file in the folder \n\t\t\tfor (File file : listOfFiles) {\n\t\t\t if (file.isFile()) {\n\t\t\t \t\n\t\t\t \tString str = file.getPath().replace(\"\\\\\",\"//\");\n\t\t\t \t\n\t\t\t \t\n\t\t\t\t\t//Document doc = new Document();\n\t\t\t //System.out.println(\"\"+str);\n\t\t\t\t\t//variables to keep parse document.\n\t\t\t\t\tint docCount = 0;\n\t\t\t\t\tint docNumber = 0;\n\t\t\t\t\tint endDoc = 0;\n\t\t\t\t\tint textCount = 0;\n\t\t\t\t\tint noText = 0;\n\t\t\t\t\tPath path = Paths.get(str);\n\t\t\t\t\t\n\t\t\t\t\t//Document id and text\n\t\t\t\t\tString docID = null;\n\t\t\t\t\tString docTEXT = null;\n\t\t\t\t\t\n\t\t\t\t\t//Stringbuffer to hold the text of each document\n\t\t\t\t\tStringBuffer text = new StringBuffer();\n\t\t\t\t\t\n\t\t\t\t\tScanner scanner = new Scanner(path);\n\t\t\t\t\twhile(scanner.hasNext()){\n\t\t\t\t\t\tString line = scanner.nextLine();\n\t\t\t\t\t\tif(line.contains(\"<DOC>\")){\n\t\t\t\t\t\t\t++docCount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(line.contains(\"</DOC>\")){\n\t\t\t\t\t\t\t++endDoc;\n\t\t\t\t\t\t\tdocTEXT = text.toString();\n\t\t\t\t\t\t\t//docTEXT = docTEXT.replaceAll(\"[\\\\n]\",\" \");\n\t\t\t\t\t\t\tSystem.out.println(\"ID: \"+id);\n\t\t\t\t\t\t\t//System.out.println(\"TEXT: \"+docTEXT);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// text with stop words removed\n\t\t\t\t\t\t\tPattern pattern1 = Pattern.compile(\"\\\\b(?:\"+stopwords+\")\\\\b\\\\s*\", Pattern.CASE_INSENSITIVE);\n\t\t\t\t\t\t\tMatcher matcher1 = pattern1.matcher(docTEXT);\n\t\t\t\t\t\t\tdocTEXT = matcher1.replaceAll(\"\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// text with stemming\n\t\t\t\t\t\t\t//docTEXT = stemmer(docTEXT);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint docLength = 1;\n\t\t\t\t\t\t\t// regex to build the tokens from the document text\n\t\t\t\t\t\t\tPattern pattern = Pattern.compile(\"\\\\w+(\\\\.?\\\\w+)*\");\n\t\t\t\t\t\t\tMatcher matcher = pattern.matcher(docTEXT.toLowerCase());\n\t\t\t\t\t\t\twhile (matcher.find()) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor (int i = 0; i < matcher.groupCount(); i++) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// alltermHash contains term and term id\n\t\t\t\t\t\t\t\t\t// if term is present in the alltermHash\n\t\t\t\t\t\t\t\t\tif(allTermHash.containsKey(matcher.group(i))){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tint termId = allTermHash.get(matcher.group(i));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//if term is present in the token1000Hash\n\t\t\t\t\t\t\t\t\t\t//then update the dblock of the term.\n\t\t\t\t\t\t\t\t\t\tif(token1000DocHash.containsKey(termId)){\n\t\t\t\t\t\t\t\t\t\t\tMultimap<String, String> dBlockUpdate = token1000DocHash.get(termId);\n\t\t\t\t\t\t\t\t\t\t\t//Multimap<Integer, Integer> dBlockUpdate = token1000DocHash.get(matcher.group(i));\n\t\t\t\t\t\t\t\t\t\t\tif(dBlockUpdate.containsKey(id)){\n\t\t\t\t\t\t\t\t\t\t\t\tdBlockUpdate.put(String.valueOf(id), String.valueOf(matcher.start()));\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\tdBlockUpdate.put(String.valueOf(id), String.valueOf(matcher.start()));\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//if term is not present in the token1000hash\n\t\t\t\t\t\t\t\t\t\t//then add the token with its dBlock\n\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\tMultimap<String, String> dBlockInsert = ArrayListMultimap.create();\n\t\t\t\t\t\t\t\t\t\t\tdBlockInsert.put(String.valueOf(id), String.valueOf(matcher.start()));\n\t\t\t\t\t\t\t\t\t\t\ttoken1000DocHash.put(termId, dBlockInsert);\t\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// if the term is not present I will put the term into allTermHash\n\t\t\t\t\t\t\t\t\t// put corresponding value into the token1000DocHash and increment\n\t\t\t\t\t\t\t\t\t// termIndex\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\tallTermHash.put(matcher.group(i),termIndex);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tMultimap<String, String> dBlockInsert = ArrayListMultimap.create();\n\t\t\t\t\t\t\t\t\t\tdBlockInsert.put(String.valueOf(id), String.valueOf(matcher.start()));\n\t\t\t\t\t\t\t\t\t\ttoken1000DocHash.put(termIndex, dBlockInsert);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\ttermIndex++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocLength++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(id%1000 == 0){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// then dump index file to HDD\n\t\t\t\t\t\t\t\t\twriteInvertedIndex(token1000DocHash,\"token1000DocHash\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// update catalog file\n\t\t\t\t\t\t\t\t\t// to populate catalogHash with the offset\n\t\t\t\t\t\t\t\t\tfor(Entry<Integer, Multimap> entry : token1000DocHash.entrySet()){\n\t\t\t\t\t\t\t\t\t\tif(catalogHash.containsKey(entry.getKey())){\n\t\t\t\t\t\t\t\t\t\t\tint len = (entry.getKey()+\":\"+entry.getValue()).length();\n\t\t\t\t\t\t\t\t\t\t\t//String offset = String.valueOf(startOffset)+\":\"+String.valueOf(len);\n\t\t\t\t\t\t\t\t\t\t\tMultimap<String, String> catUpdate = catalogHash.get(entry.getKey());\n\t\t\t\t\t\t\t\t\t\t\tcatUpdate.put(String.valueOf(startOffset), String.valueOf(len));\n\t\t\t\t\t\t\t\t\t\t\tcatalogHash.put(entry.getKey(), catUpdate);\n\t\t\t\t\t\t\t\t\t\t\tstartOffset += len+2;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\tint len = (entry.getKey()+\":\"+entry.getValue()).length();\n\t\t\t\t\t\t\t\t\t\t\t//String offset = String.valueOf(startOffset)+\":\"+String.valueOf(len);\n\t\t\t\t\t\t\t\t\t\t\tMultimap<String, String> catInsert = ArrayListMultimap.create();\n\t\t\t\t\t\t\t\t\t\t\tcatInsert.put(String.valueOf(startOffset), String.valueOf(len));\n\t\t\t\t\t\t\t\t\t\t\tcatalogHash.put(entry.getKey(), catInsert);//entry.getValue());\n\t\t\t\t\t\t\t\t\t\t\tstartOffset += len+2;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//clear the token1000DocHash\n\t\t\t\t\t\t\t\t\ttoken1000DocHash.clear();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdocumentHash.put(docID, \"\"+id+\":\"+docLength);\n\t\t\t\t\t\t\tid++;\n\t\t\t\t\t\t\ttext = new StringBuffer();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(line.contains(\"<DOCNO>\")){\n\t\t\t\t\t\t\t++docNumber;\n\t\t\t\t\t\t\tdocID = line.substring(8, 21);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(line.contains(\"<TEXT>\")){\n\t\t\t\t\t\t\t++textCount;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if((line.contains(\"<DOC>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</DOC>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<DOCNO>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<FILEID>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<FIRST>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<SECOND>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<HEAD>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</HEAD>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<BYLINE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</BYLINE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<UNK>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</UNK>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<DATELINE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<NOTE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</NOTE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</TEXT>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<TEXT>\"))){\n\t\t\t\t\t\t\t ++noText;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(endDoc == docCount - 1){\n\t\t\t\t\t\t\ttext.append(line);\n\t\t\t\t\t\t\ttext.append(\" \");\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 }//end of if - to check if this is a file and parse.\n\t\t\t \n\t\t\t}//end of for loop to load each file\n\t\t\t\n\t\t//}//end of while loop \n\t\t\n\t// write catalogfile to the hdd to check.\n\t\t\t\n\t\t\t// then dump index file to HDD\n\t\t\twriteInvertedIndex(token1000DocHash,\"token1000DocHash\");\n\t\t\t\n\t\t\t// update catalog file\n\t\t\t// to populate catalogHash with the offset\n\t\t\tfor(Entry<Integer, Multimap> entry : token1000DocHash.entrySet()){\n\t\t\t\tif(catalogHash.containsKey(entry.getKey())){\n\t\t\t\t\tint len = (entry.getKey()+\":\"+entry.getValue()).length();\n\t\t\t\t\t//String offset = String.valueOf(startOffset)+\":\"+String.valueOf(len);\n\t\t\t\t\tMultimap<String, String> catUpdate = catalogHash.get(entry.getKey());\n\t\t\t\t\tcatUpdate.put(String.valueOf(startOffset), String.valueOf(len));\n\t\t\t\t\tcatalogHash.put(entry.getKey(), catUpdate);\n\t\t\t\t\tstartOffset += len+2;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tint len = (entry.getKey()+\":\"+entry.getValue()).length();\n\t\t\t\t\t//String offset = String.valueOf(startOffset)+\":\"+String.valueOf(len);\n\t\t\t\t\tMultimap<String, String> catInsert = ArrayListMultimap.create();\n\t\t\t\t\tcatInsert.put(String.valueOf(startOffset), String.valueOf(len));\n\t\t\t\t\tcatalogHash.put(entry.getKey(), catInsert);//entry.getValue());\n\t\t\t\t\tstartOffset += len+2;\n\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\twriteInvertedIndex(catalogHash,\"catalogHash\");\n\t\t\tprintHashMapSI(allTermHash);\n\t\t\tprintHashMapSS(documentHash);\n\t\t\t\n\t\t\tlong InvIndstartOffset = 0;\n\t\t\t\n\t\t\t//write it to file\n \n\t\t\t//change the finalcatalogHash to the form termid:startoffset:length\n\t\t\tfor (Integer name: catalogHash.keySet()){\n\t String key = name.toString();\n\t String value = catalogHash.get(name).toString(); \n\t //System.out.println(key + \" \" + value); \n\t String finalTermIndex = genInvertedIndex(key, value);\n\t finalTermIndex = key+\":\"+finalTermIndex;\n\t int indexLength = finalTermIndex.length();\n\t \n\t \n\t PrintWriter writer = new PrintWriter(new BufferedWriter\n\t \t\t(new FileWriter(\"C:/Users/Naveen/Desktop/TestRuns/LastRun/InvertedIndex\", true)));\n\t writer.println(finalTermIndex);\n\t writer.close();\n\t \n\t //update the finalcatalogHash\n\t //Multimap<String, String> catInsert = ArrayListMultimap.create();\n\t\t\t\t//catInsert.put(String.valueOf(InvIndstartOffset), String.valueOf(indexLength));\n\t\t\t\tfinalCatalogHash.put(name, String.valueOf(InvIndstartOffset)+\":\"+String.valueOf(indexLength));//entry.getValue());\n\t\t\t\tInvIndstartOffset += indexLength+2;\n\t \n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tprintHashMapIS(finalCatalogHash);\n\t\t\t\n\t}", "public void buildWordFileMap(){\n hashWords.clear();\n DirectoryResource dr = new DirectoryResource();\n for (File f : dr.selectedFiles()){ //for all the files selected make the hashWords hashmap\n addWordsFromFile(f);\n }\n \n }", "private void loadMemory() {\n try {\n File varTmpDir = new File(\"data/\" + brainLocation + \".ser\");\n if (varTmpDir.exists()) {\n FileInputStream fileIn = new FileInputStream(varTmpDir);\n ObjectInputStream in = new ObjectInputStream(fileIn);\n longTermMemory = (HashMap<String, BoardRecord>) in.readObject();\n in.close();\n fileIn.close();\n }\n } catch (IOException i) {\n i.printStackTrace();\n return;\n } catch (ClassNotFoundException c) {\n System.out.println(\"File not found\");\n c.printStackTrace();\n return;\n }\n\n System.out.println(\"RECALLED LONG TERM MEMORIES FROM \" + brainLocation + \": \" + longTermMemory.toString());\n }", "public void read(String filename) throws IOException {\n // open the file\n BufferedReader r = new BufferedReader(new FileReader(filename));\n\n // load the number of terms\n int size = Integer.parseInt(r.readLine());\n\n // must divide by load factor (0.75) to not need to rehash\n index = new HashMap((int) (size / .75) + 1);\n\n // temporary variables\n String line;\n StringTokenizer tokens;\n String word;\n HashMap docList;\n String docid;\n int[] fArray;\n int lineNumber = 1;\n\n // while there are more lines in the document\n while ((line = r.readLine()) != null) {\n // increment the line number\n lineNumber++;\n\n // the word is the only thing on the line\n word = line;\n\n // load all documents containign this term\n docList = new HashMap();\n index.put(word, docList);\n\n line = r.readLine();\n while (line != null && !line.equals(\"\")) {\n fArray = new int[1];\n\n docid = line;\n fArray[0] = Integer.parseInt(r.readLine());\n\n docList.put(docid, fArray);\n line = r.readLine();\n }\n }\n\n // close the file\n r.close();\n }", "public static void readDatafiles() throws FileNotFoundException {\n int docNumber = 0;\n\n while(docNumber<totaldocument) { // loop will run until all 0 - 55 speech data is read\n String tempBuffer = \"\";\n\n Scanner sc_obj = new Scanner(new File(\"./inputFiles/speech_\"+docNumber+\".txt\"));\n sc_obj.nextLine(); //skip the first line of every document\n\n while(sc_obj.hasNext()) {\n tempBuffer = sc_obj.next();\n tempBuffer = tempBuffer.replaceAll(\"[^a-zA-Z]+\",\" \");\n\n String[] wordTerm = tempBuffer.split(\" |//.\"); // the read data will convert into single word from whole stream of characters\n // it will split according to white spaces . - , like special characters\n\n for (int i=0; i < wordTerm.length; i++) {\n\n String term = wordTerm[i].toLowerCase();\t\t//each splitted word will be converted into lower case\n term = RemoveSpecialCharacter(term);\t\t\t// it will remove all the characters apart from the english letters\n term = removeStopWords(term);\t\t\t\t\t// it will remove the stopWords and final version of the term in the form of tokens will form\n\n if(!term.equalsIgnoreCase(\"\") && term.length()>1) {\n term = Lemmatize(term);\t\t\t\t\t//all the words in the form of tokens will be lemmatized\n //increment frequency of word if it is already present in dictionary\n if(dictionary.containsKey(term)) {\t\t//all the lemmatized words will be placed in HashMap dictionary\n List<Integer> presentList = dictionary.get(term);\n int wordFrequency = presentList.get(docNumber);\n wordFrequency++;\n presentList.set(docNumber, wordFrequency);\t\t//frequency of all the lemmatized words in dictionary is maintained \t\t\t\t\t\t\t\t\t//i.e: Word <2.0,1.0,3.0,0.0 ...> here hashmap<String,List<Double> is used\n }\t\t\t\t\t\t\t\t\t\t//the 0th index shows the word appared 2 times in doc 0 and 1 times in doc 1 and so forth..\n else { // if word was not in the dictionary then it will be added\n // if word was found in 5 doc so from 0 to 4 index representing doc 0 to doc 4 (0.0) will be placed\n List<Integer>newList = new ArrayList<>();\n for(int j=0; j<57; j++) {\n if(j != docNumber)\n newList.add(0);\n else\n newList.add(1);\n }\n dictionary.put(term, newList);\n }\n }\n }\n\n }\n docNumber++;\n }\n }", "public static void main(String[] args) throws Exception \n\t{\n\t\tList<String> stopWords = new ArrayList<String>();\n\t\tstopWords = stopWordsCreation();\n\n\n\t\t\n\t\tHashMap<Integer, String> hmap = new HashMap<Integer, String>();\t//Used in tittle, all terms are unique, and any dups become \" \"\n\t\n\t\t\n\t\tList<String> uniqueTerms = new ArrayList<String>();\n\t\tList<String> allTerms = new ArrayList<String>();\n\t\t\t\t\n\t\t\n\t\tHashMap<Integer, String> hmap2 = new HashMap<Integer, String>();\n\t\tHashMap<Integer, String> allValues = new HashMap<Integer, String>();\n\t\tHashMap<Integer, Double> docNorms = new HashMap<Integer, Double>();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tMap<Integer, List<String>> postingsFileListAllWords = new HashMap<>();\t\t\n\t\tMap<Integer, List<String>> postingsFileList = new HashMap<>();\n\t\t\n\t\tMap<Integer, List<StringBuilder>> docAndTitles = new HashMap<>();\n\t\tMap<Integer, List<StringBuilder>> docAndAbstract = new HashMap<>();\n\t\tMap<Integer, List<StringBuilder>> docAndAuthors = new HashMap<>();\n\t\t\n\t\t\n\t\tMap<Integer, List<Double>> termWeights = new HashMap<>();\n\t\t\n\t\tList<Integer> docTermCountList = new ArrayList<Integer>();\n\t\t\n\t\tBufferedReader br = null;\n\t\tFileReader fr = null;\n\t\tString sCurrentLine;\n\n\t\tint documentCount = 0;\n\t\tint documentFound = 0;\n\t\tint articleNew = 0;\n\t\tint docTermCount = 0;\n\t\t\n\t\t\n\t\tboolean abstractReached = false;\n\n\t\ttry {\n\t\t\tfr = new FileReader(FILENAME);\n\t\t\tbr = new BufferedReader(fr);\n\n\t\t\t// Continues to get 1 line from document until it reaches the end of EVERY doc\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) \n\t\t\t{\n\t\t\t\t// sCurrentLine now contains the 1 line from the document\n\n\t\t\t\t// Take line and split each word and place them into array\n\t\t\t\tString[] arr = sCurrentLine.split(\" \");\n\n\n\t\t\t\t//Go through the entire array\n\t\t\t\tfor (String ss : arr) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t * This section takes the array and checks to see if it has reached a new\n\t\t\t\t\t * document or not. If the current line begins with an .I, then it knows that a\n\t\t\t\t\t * document has just started. If it incounters another .I, then it knows that a\n\t\t\t\t\t * new document has started.\n\t\t\t\t\t */\n\t\t\t\t\t//System.out.println(\"Before anything: \"+sCurrentLine);\n\t\t\t\t\tif (arr[0].equals(\".I\")) \n\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\tif (articleNew == 0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarticleNew = 1;\n\t\t\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\t\t\t\t\t\t} \n\t\t\t\t\t\telse if (articleNew == 1) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarticleNew = 0;\n\t\t\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t//System.out.println(documentFound);\n\t\t\t\t\t\t//count++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/* This section detects that after a document has entered,\n\t\t\t\t\t * it has to gather all the words contained in the title \n\t\t\t\t\t * section.\n\t\t\t\t\t */\n\t\t\t\t\tif (arr[0].equals(\".T\") ) \n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Go to line UNDER .T since that is where tittle is located\n\t\t\t\t\t\t//sCurrentLine = br.readLine();\n\t\t\t\t\t\tdocAndTitles.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\t\t\tStringBuilder title = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".B|.A|.N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\t\t/* In this section, there are 2 lists being made. One list\n\t\t\t\t\t\t\t * is for all the unique words in every title in the document (hmap).\n\t\t\t\t\t\t\t * Hmap contains all unique words, and anytime a duplicate word is \n\t\t\t\t\t\t\t * found, it is replaced with an empty space in the map.\n\t\t\t\t\t\t\t * All Values \n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//postingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\t\t\t//postingsFileList.get(documentFound - 1).add(term2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"current line: \"+sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] tittle = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (tittle[0].equals(\".W\") )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\tabstractReached = true;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttitle.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (String tittleWords : tittle)\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.toLowerCase();\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'{}*|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'*{}|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'{}*|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\t//System.out.println(tittleWords);\n\t\t\t\t\t\t\t\tif (hmap.containsValue(tittleWords)) \n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, \" \");\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\tallTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tallTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\tif (!(uniqueTerms.contains(tittleWords)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ((stopWordsSetting && !(stopWords.contains(tittleWords))))\n\t\t\t\t\t\t\t\t\t\t\tuniqueTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\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//docAndTitles.get(documentCount).add(\" \");\n\t\t\t\t\t\t\ttitle.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"Title: \"+title);\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\tdocAndTitles.get(documentFound).add(title);\n\t\t\t\t\t\t//System.out.println(\"Done!: \"+ docAndTitles);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (arr[0].equals(\".A\") ) \n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Go to line UNDER .T since that is where tittle is located\n\t\t\t\t\t\t//sCurrentLine = br.readLine();\n\t\t\t\t\t\tdocAndAuthors.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\t\t\tStringBuilder author = new StringBuilder();\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\twhile ( !(sCurrentLine = br.readLine()).matches(\".N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* In this section, there are 2 lists being made. One list\n\t\t\t\t\t\t\t * is for all the unique words in every title in the document (hmap).\n\t\t\t\t\t\t\t * Hmap contains all unique words, and anytime a duplicate word is \n\t\t\t\t\t\t\t * found, it is replaced with an empty space in the map.\n\t\t\t\t\t\t\t * All Values \n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//postingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\t\t\t//postingsFileList.get(documentFound - 1).add(term2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"current line: \"+sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] tittle = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (tittle[0].equals(\".W\") )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\tabstractReached = true;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tauthor.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//docAndTitles.get(documentCount).add(\" \");\n\t\t\t\t\t\t\tauthor.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"Title: \"+title);\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\tdocAndAuthors.get(documentFound).add(author);\n\t\t\t\t\t\t//System.out.println(\"Done!: \"+ docAndTitles);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/* Since there may or may not be an asbtract after\n\t\t\t\t\t * the title, we need to check what the next section\n\t\t\t\t\t * is. We know that every doc has a publication date,\n\t\t\t\t\t * so it can end there, but if there is no abstract,\n\t\t\t\t\t * then it will keep scanning until it reaches the publication\n\t\t\t\t\t * date. If abstract is empty (in tests), it will also finish instantly\n\t\t\t\t\t * since it's blank and goes straight to .B (the publishing date).\n\t\t\t\t\t * Works EXACTLY like Title \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 (abstractReached) \n\t\t\t\t\t{\t\n\t\t\t\t\t\t//System.out.println(\"\\n\");\n\t\t\t\t\t\t//System.out.println(\"REACHED ABSTRACT and current line is: \" +sCurrentLine);\n\t\t\t\t\t\tdocAndAbstract.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\tStringBuilder totalAbstract = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".T|.I|.A|.N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tString[] abstaract = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (abstaract[0].equals(\".B\") )\n\t\t\t\t\t\t\t{\t\t\t\n\t\t\t\t\t\t\t\tabstractReached = false;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttotalAbstract.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] misc = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tfor (String miscWords : misc) \n\t\t\t\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\tmiscWords = miscWords.toLowerCase(); \n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|?{}!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\t\t\n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\t\t\n\t\t\t\t\t\t\t\t//System.out.println(miscWords);\n\t\t\t\t\t\t\t\tif (hmap.containsValue(miscWords)) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, \" \");\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tallTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\n\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tallTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tif (!(uniqueTerms.contains(miscWords)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ((stopWordsSetting && !(stopWords.contains(miscWords))))\n\t\t\t\t\t\t\t\t\t\t\tuniqueTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\ttotalAbstract.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocAndAbstract.get(documentFound).add(totalAbstract);\n\t\t\t\t\t}\n\t\t\t\t\t\n\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\n\t\t\t\t//Once article is found, we enter all of of it's title and abstract terms \n\t\t\t\tif (articleNew == 0) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tdocumentFound = documentFound - 1;\n\t\t\t\t\t//System.out.println(\"Words found in Doc: \" + documentFound);\n\t\t\t\t\t//System.out.println(\"Map is\" +allValues);\n\t\t\t\t\tSet set = hmap.entrySet();\n\t\t\t\t\tIterator iterator = set.iterator();\n\n\t\t\t\t\tSet set2 = allValues.entrySet();\n\t\t\t\t\tIterator iterator2 = set2.iterator();\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tpostingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\tpostingsFileListAllWords.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\t\tMap.Entry mentry = (Map.Entry) iterator.next();\n\t\t\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// (\"Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// );\n\t\t\t\t\t\tString term = mentry.getValue().toString();\n\t\t\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\t\t\tpostingsFileList.get(documentFound - 1).add(term);\n\t\t\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t\t\tdocTermCount++;\n\t\t\t\t\t}\n\t\t\t\t\t// \"BEFORE its put in, this is what it looks like\" + hmap);\n\t\t\t\t\thmap2.putAll(hmap);\n\t\t\t\t\thmap.clear();\n\t\t\t\t\tarticleNew = 1;\n\n\t\t\t\t\tdocTermCountList.add(docTermCount);\n\t\t\t\t\tdocTermCount = 0;\n\n\t\t\t\t\twhile (iterator2.hasNext()) {\n\t\t\t\t\t\tMap.Entry mentry2 = (Map.Entry) iterator2.next();\n\t\t\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// (\"Value2 is: \" + mentry2.getValue());\n\t\t\t\t\t\t// );\n\t\t\t\t\t\tString term = mentry2.getValue().toString();\n\t\t\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\t\t\tpostingsFileListAllWords.get(documentFound - 1).add(term);\n\t\t\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t\t\t// docTermCount++;\n\t\t\t\t\t}\n\n\t\t\t\t\tallValues.clear();\t\t\t\t\t\n\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\n\t\t\t\t\t// \"MEANWHILE THESE ARE ALL VALUES\" + postingsFileListAllWords);\n\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Looking at final doc!\");\n\t\t\t//Final loop for last sets\n\t\t\tSet set = hmap.entrySet();\n\t\t\tIterator iterator = set.iterator();\n\n\t\t\tSet setA = allValues.entrySet();\n\t\t\tIterator iteratorA = setA.iterator();\n\t\t\tpostingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\tpostingsFileListAllWords.put(documentFound - 1, new ArrayList<String>());\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tMap.Entry mentry = (Map.Entry) iterator.next();\n\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t// (\"Value is: \" + mentry.getValue());\n\t\t\t\t// //);\n\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\tString term2 = mentry.getValue().toString();\n\t\t\t\tpostingsFileList.get(documentFound - 1).add(term2);\n\n\t\t\t\tdocTermCount++;\n\t\t\t}\n\t\t\t//System.out.println(\"Done looking at final doc!\");\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Sorting time!\");\n\t\t\twhile (iteratorA.hasNext()) {\n\t\t\t\tMap.Entry mentry2 = (Map.Entry) iteratorA.next();\n\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t// (\"Value2 is: \" + mentry2.getValue());\n\t\t\t\t// //);\n\t\t\t\tString term = mentry2.getValue().toString();\n\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\tpostingsFileListAllWords.get(documentFound - 1).add(term);\n\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t// docTermCount++;\n\t\t\t}\n\n\t\t\thmap2.putAll(hmap);\n\t\t\thmap.clear();\n\t\t\tdocTermCountList.add(docTermCount);\n\t\t\tdocTermCount = 0;\n\n\n\t\t\t\n\t\t\n\t\t\t// END OF LOOKING AT ALL DOCS\n\t\t\t\n\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\n\t\t\t//System.out.println(\"All terms\" +allTerms);\n\t\t\tString[] sortedArray = allTerms.toArray(new String[0]);\n\t\t\tString[] sortedArrayUnique = uniqueTerms.toArray(new String[0]);\n\t\t\t//System.out.println(Arrays.toString(sortedArray));\n\t\t\t\n\t\t\tArrays.sort(sortedArray);\n\t\t\tArrays.sort(sortedArrayUnique);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//Sortings \n\t\t\tSet set3 = hmap2.entrySet();\n\t\t\tIterator iterator3 = set3.iterator();\n\n\t\t\t// Sorting the map\n\t\t\t//System.out.println(\"Before sorting \" +hmap2);\t\t\t\n\t\t\tMap<Integer, String> map = sortByValues(hmap2);\n\t\t\t//System.out.println(\"after sorting \" +map);\n\t\t\t// //\"After Sorting:\");\n\t\t\tSet set2 = map.entrySet();\n\t\t\tIterator iterator2 = set2.iterator();\n\t\t\tint docCount = 1;\n\t\t\twhile (iterator2.hasNext()) {\n\t\t\t\tMap.Entry me2 = (Map.Entry) iterator2.next();\n\t\t\t\t// (me2.getKey() + \": \");\n\t\t\t\t// //me2.getValue());\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(\"Done sorting!\");\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Posting starts \");\n\t\t\t//\"THIS IS START OF DICTIONARTY\" \n\t\t\tBufferedWriter bw = null;\n\t\t\tFileWriter fw = null;\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Start making an array thats big as every doc total \");\n\t\t\tfor (int z = 1; z < documentFound+1; z++)\n\t\t\t{\n\t\t\t\ttermWeights.put(z, new ArrayList<Double>());\n\t\t\t}\n\t\t\t//System.out.println(\"Done making that large array Doc \");\n\t\t\t\n\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\n\t\t\t//System.out.println(\"All terms\" +allTerms)\n\t\t\t//System.out.println(Arrays.toString(sortedArray));\n\t\t\t//System.out.println(Arrays.toString(sortedArrayUnique));\n\t\t\t//System.out.println(uniqueTerms);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//\tSystem.out.println(\"Posting starts \");\n\t\t\t// \tPOSTING FILE STARTS \n\t\t\ttry {\n\t\t\t\t// Posting File\n\t\t\t\t//System.out.println(\"postingsFileListAllWords: \"+postingsFileListAllWords); //Contains every word including Dups, seperated per doc\n\t\t\t\t//System.out.println(\"postingsFileList: \"+postingsFileList); \t\t //Contains unique words, dups are \" \", seperated per doc\n\t\t\t\t//System.out.println(\"postingsFileListAllWords.size(): \" +postingsFileListAllWords.size()); //Total # of docs \n\t\t\t\t//System.out.println(\"Array size: \"+sortedArrayUnique.length);\n\n\t\t\t\tfw = new FileWriter(POSTING);\n\t\t\t\tbw = new BufferedWriter(fw);\n\t\t\t\tString temp = \" \";\n\t\t\t\tDouble termFreq = 0.0;\n\t\t\t\t// //postingsFileListAllWords);\n\t\t\t\tList<String> finalTermList = new ArrayList<String>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t// //postingsFileList.get(i).size());\n\t\t\t\t\tfor (int j = 0; j < sortedArrayUnique.length; ++j)\t\t\t\t\t // go thru each word, CURRENT TERM\n\t\t\t\t\t{\n\t\t\t\t\t\t//System.out.println(\"Term is: \" + sortedArrayUnique[j]);\n\t\t\t\t\t\ttemp = sortedArrayUnique[j];\t\t\t\t\t\n\t\t\t\t\t\tif ((stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!(finalTermList.contains(temp))) \n\t\t\t\t\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\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//PART TO FIND DOCUMENT FREQ\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint docCountIDF = 0;\n\t\t\t\t\t\t\t//Start here for dictionary \n\t\t\t\t\t\t\tfor (int totalWords = 0; totalWords < sortedArray.length; totalWords++) \t\t\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (temp.compareTo(\" \") == 0 || (stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//EITHER BLANK OR STOPWORD \n\t\t\t\t\t\t\t\t\t//System.out.println(\"fOUND STOP WORD\");\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tString temp2 = sortedArray[totalWords];\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Compare: \"+temp+ \" with \" +temp2);\n\t\t\t\t\t\t\t\t\tif (temp.compareTo(temp2) == 0) {\n\t\t\t\t\t\t\t\t\t\t// (temp2+\" \");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tdocCountIDF++;\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//System.out.println(\"Total Number: \" +docCountIDF);\n\t\t\t\t\t\t\t//System.out.println(\"documentFound: \" +documentFound);\n\t\t\t\t\t\t\t//System.out.println(\"So its \" + documentFound + \" dividied by \" +docCountIDF);\n\t\t\t\t\t\t\t//docCountIDF = 1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble idf = (Math.log10(((double)documentFound/(double)docCountIDF)));\n\t\t\t\t\t\t\t//System.out.println(\"Calculated IDF: \"+idf);\n\t\t\t\t\t\t\tif (idf < 0.0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tidf = 0.0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"IDF is: \" +idf);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"Size of doc words: \" + postingsFileListAllWords.size());\n\t\t\t\t\t\t\tfor (int k = 0; k < postingsFileListAllWords.size(); k++) \t\t//Go thru each doc. Since only looking at 1 term, it does it once per doc\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//System.out.println(\"Current Doc: \" +(k+1));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\ttermFreq = 1 + (Math.log10(Collections.frequency(postingsFileListAllWords.get(k), temp)));\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Freq is: \" +Collections.frequency(postingsFileListAllWords.get(k), temp));\n\t\t\t\t\t\t\t\t\t//System.out.println(termFreq + \": \" + termFreq.isInfinite());\n\t\t\t\t\t\t\t\t\tif (termFreq.isInfinite() || termFreq <= 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttermFreq = 0.0;\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(\"termFreq :\" +termFreq); \n\t\t\t\t\t\t\t\t\t//System.out.println(\"idf: \" +idf);\n\t\t\t\t\t\t\t\t\ttermWeights.get(k+1).add( (idf*termFreq) );\t\t\t\t\t\t\t\t\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\n\t\t\t\t\t\t\t//System.out.println(\"\");\n\t\t\t\t\t\t\tfinalTermList.add(temp);\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//FINALCOUNTER\n\t\t\t\t\t\t//System.out.println(\"Done looking at word: \" +j);\n\t\t\t\t\t\t//System.out.println(\"\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\twhile (true)\n\t\t\t\t {\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Enter a query: \");\n\t\t\t\t\t\n\t \tScanner scanner = new Scanner(System.in);\n\t \tString enterQuery = scanner.nextLine();\n\t \t\n\t \t\n\t\t\t\t\tList<Double> queryWeights = new ArrayList<Double>();\n\t\t\t\t\t\n\t\t\t\t\t// Query turn\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tenterQuery = enterQuery.toLowerCase();\t\t\n\t\t\t\t\tenterQuery = enterQuery.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"]\", \"\");\n\t\t\t\t\t//System.out.println(\"Query is: \" + enterQuery);\n\t\t\t\t\t\n\t\t\t\t\tif (enterQuery.equals(\"exit\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tString[] queryArray = enterQuery.split(\" \");\n\t\t\t\t\tArrays.sort(queryArray);\n\t\t\t\t\t\n\t\t\t\t\t//Find the query weights for each term in vocab\n\t\t\t\t\tfor (int j = 0; j < sortedArrayUnique.length; ++j)\t\t\t\t\t // go thru each word, CURRENT TERM\n\t\t\t\t\t{\n\t\t\t\t\t\t//System.out.println(\"Term is: \" + sortedArrayUnique[j]);\n\t\t\t\t\t\ttemp = sortedArrayUnique[j];\t\t\t\t\t\n\t\t\t\t\t\tif ((stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tint docCountDF = 0;\n\t\t\t\t\t\t//Start here for dictionary \n\t\t\t\t\t\tfor (int totalWords = 0; totalWords < queryArray.length; totalWords++) \t\t\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (temp.compareTo(\" \") == 0 || (stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//EITHER BLANK OR STOPWORD\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tString temp2 = queryArray[totalWords];\n\t\t\t\t\t\t\t\t//System.out.println(\"Compare: \"+temp+ \" with \" +temp2);\n\t\t\t\t\t\t\t\tif (temp.compareTo(temp2) == 0) {\n\t\t\t\t\t\t\t\t\t// (temp2+\" \");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocCountDF++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tDouble queryWeight = 1 + (Math.log10(docCountDF));\n\t\t\t\t\t\tif (queryWeight.isInfinite())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tqueryWeight = 0.0;\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tqueryWeights.add(queryWeight);\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Query WEights is: \"+queryWeights);\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\t// Finding the norms for DOCS\t\t\t\t\t\n\t\t\t\t\tfor (int norms = 1; norms < documentFound+1; norms++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble currentTotal = 0.0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (int weightsPerDoc = 0; weightsPerDoc < termWeights.get(norms).size(); weightsPerDoc++)\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble square = Math.pow(termWeights.get(norms).get(weightsPerDoc), 2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"Current square: \" + termWeights.get(norms).get(weightsPerDoc));\n\t\t\t\t\t\t\tcurrentTotal = currentTotal + square;\n\t\t\t\t\t\t\t//System.out.println(\"Current total: \" + currentTotal);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"About to square root this: \" +currentTotal);\n\t\t\t\t\t\tdouble root = Math.sqrt(currentTotal);\n\t\t\t\t\t\tdocNorms.put(norms, root);\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(\"All of the docs norms: \"+docNorms);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Finding the norm for the query\n\t\t\t\t\tdouble currentTotal = 0.0;\t\t\t\t\t\n\t\t\t\t\tfor (int weightsPerDoc = 0; weightsPerDoc < queryWeights.size(); weightsPerDoc++)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tdouble square = Math.pow(queryWeights.get(weightsPerDoc), 2);\n\t\t\t\t\t\tcurrentTotal = currentTotal + square;\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tdouble root = Math.sqrt(currentTotal);\n\t\t\t\t\tdouble queryNorm = root; \t\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Query norm \" + queryNorm);\n\t\t\t\t\t\n\t\t\t\t\t//Finding the cosine sim\n\t\t\t\t\t//System.out.println(\"Term Weights \" + termWeights);\n\t\t\t\t\tHashMap<Integer, Double> cosineScore = new HashMap<Integer, Double>();\n\t\t\t\t\tfor (int cosineSim = 1; cosineSim < documentFound+1; cosineSim++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble total = 0.0;\n\t\t\t\t\t\tfor (int docTerms = 0; docTerms < termWeights.get(cosineSim).size(); docTerms++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble docTermWeight = termWeights.get(cosineSim).get(docTerms);\n\t\t\t\t\t\t\tdouble queryTermWeight = queryWeights.get(docTerms);\n\t\t\t\t\t\t\t//System.out.println(\"queryTermWeight \" + queryTermWeight);\n\t\t\t\t\t\t\t//System.out.println(\"docTermWeight \" + docTermWeight);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttotal = total + (docTermWeight*queryTermWeight);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdouble cosineSimScore = 0.0;\n\t\t\t\t\t\tif (!(total == 0.0 || (docNorms.get(cosineSim) * queryNorm) == 0))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcosineSimScore = total / (docNorms.get(cosineSim) * queryNorm);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcosineSimScore = 0.0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcosineScore.put(cosineSim, cosineSimScore);\n\t\t\t\t\t}\n\t\t\t\t\tcosineScore = sortByValues2(cosineScore);\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"This is the cosineScores: \" +cosineScore);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"docAndTitles: \"+ docAndTitles);\n\t\t\t\t\tint topK = 0;\n\t\t\t\t\tint noValue = 0;\n\t\t\t\t\tfor (Integer name: cosineScore.keySet())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (topK < 50)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\n\t\t\t\t String key =name.toString();\n\t\t\t\t //String value = cosineScore.get(name).toString(); \n\t\t\t\t if (!(cosineScore.get(name) <= 0))\n\t\t\t\t {\n\t\t\t\t \tSystem.out.println(\"Doc: \"+key);\t\t\t\t \t\t\t\t\t \t\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \tStringBuilder builder = new StringBuilder();\n\t\t\t\t \tfor (StringBuilder value : docAndTitles.get(name)) {\n\t\t\t\t \t builder.append(value);\n\t\t\t\t \t}\n\t\t\t\t \tString text = builder.toString();\t\t\t\t \t\n\t\t\t\t \t//System.out.println(\"Title:\\n\" +docAndTitles.get(name));\n\t\t\t\t \tSystem.out.println(\"Title: \" +text);\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 \t\n\t\t\t\t \t//System.out.println(\"Authors:\\n\" +docAndAuthors.get(name));\n\t\t\t\t \t\n\t\t\t\t \tif (docAndAuthors.get(name) == null || docAndAuthors.get(name).toString().equals(\"\"))\n\t\t\t\t \t{\n\t\t\t\t \t\tSystem.out.println(\"Authors: N\\\\A\\n\");\n\t\t\t\t \t}\n\t\t\t\t \telse \n\t\t\t\t \t{\t\t\t\t \t\t\t\t\t\t \t\n\t\t\t\t\t \tStringBuilder builder2 = new StringBuilder();\n\t\t\t\t\t \tfor (StringBuilder value : docAndAuthors.get(name)) {\n\t\t\t\t\t \t builder2.append(value);\n\t\t\t\t\t \t}\n\t\t\t\t\t \tString text2 = builder2.toString();\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t\t\t\t \tSystem.out.println(\"Authors found: \" +text2);\n\t\t\t\t \t}\t\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t/* ABSTRACT \n\t\t\t\t \tif (docAndAbstract.get(name) == null)\n\t\t\t\t \t{\n\t\t\t\t \t\tSystem.out.println(\"Abstract: N\\\\A\\n\");\n\t\t\t\t \t}\n\t\t\t\t \telse \n\t\t\t\t \t{\t\t\t\t \t\t\t\t\t\t \t\n\t\t\t\t\t \tStringBuilder builder2 = new StringBuilder();\n\t\t\t\t\t \tfor (StringBuilder value : docAndAbstract.get(name)) {\n\t\t\t\t\t \t builder2.append(value);\n\t\t\t\t\t \t}\n\t\t\t\t\t \tString text2 = builder2.toString();\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t\t\t\t \tSystem.out.println(\"Abstract: \" +text2);\n\t\t\t\t \t}\t\n\t\t\t\t \t*/\n\t\t\t\t \t\n\t\t\t\t \tSystem.out.println(\"\");\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t \tnoValue++;\n\t\t\t\t }\n\t\t\t\t topK++;\n\t\t\t\t \n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (noValue == documentFound)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"No documents contain query!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\ttopK=0;\n\t\t\t\t\tnoValue = 0;\n\t\t\t\t }\n\t\t\t\t\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (bw != null)\n\t\t\t\t\t\tbw.close();\n\n\t\t\t\t\tif (fw != null)\n\t\t\t\t\t\tfw.close();\n\n\t\t\t\t} catch (IOException ex) {\n\n\t\t\t\t\tex.printStackTrace();\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null)\n\t\t\t\t\tbr.close();\n\n\t\t\t\tif (fr != null)\n\t\t\t\t\tfr.close();\n\n\t\t\t} catch (IOException ex) {\n\n\t\t\t\tex.printStackTrace();\n\n\t\t\t}\n\n\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\tint itemCount = uniqueTerms.size();\n\t\t\t//System.out.println(allValues);\n\t\t\tSystem.out.println(\"Total Terms BEFORE STEMING: \" +itemCount);\n\t\t\tSystem.out.println(\"Total Documents \" + documentFound);\n\t\t\t\t\t\t\n\t\t \n\t\t\t \n\t\t\t \n\t\t\t//END OF MAIN\n\t\t}", "private void updateIndex() throws IOException {\n // maintain the document store (corpus) - if there is one\n if (currentMemoryIndex.containsPart(\"corpus\")) {\n // get all corpora + shove into document store\n ArrayList<DocumentReader> readers = new ArrayList<>();\n readers.add((DocumentReader) currentMemoryIndex.getIndexPart(\"corpus\"));\n for (String path : geometricParts.getAllShards().getBinPaths()) {\n String corpus = path + File.separator + \"corpus\";\n readers.add(new CorpusReader(corpus));\n }\n }\n // finally write new checkpointing data (checkpoints the disk indexes)\n Parameters checkpoint = createCheckpoint();\n this.checkpointer.saveCheckpoint(checkpoint);\n }", "private void getCache(Context context) throws IOException {\n\t\t // Read file from distributed caches - each line is a item/itemset with its frequent\n\n \t// get caches files.\n\t\tfor (int i = 0; i < 10; i++)\n\t\t\tSystem.out.println(\"SETUP ------ MAPPER ----------- GET FREQUENT ITEMS--------------\");\n\t\t\n\t\t\n\t\t// URI to locate cachefile, ex URI a = new URI(\"http://www.foo.com\");\n\t\tList<URI> uris = Arrays.asList(context.getCacheFiles());\n\t\t\n\t\tSystem.out.println(\"Reading cached files\");\n\t\t// read cache files which contains candidates?\n\t\t\n\t\tnItems = 0;\n\t\t\n\t\tfor (URI uri : uris) {\n\t\t\tPath p = new Path(uri);\n\t\t\tSystem.out.println(\"Loading \" + uri.toString());\n\t\t\tFileSystem fs = FileSystem.get(context.getConfiguration());\n\t\t\tInputStreamReader ir = new InputStreamReader(fs.open(p));\n\t\t\tBufferedReader data = new BufferedReader(ir);\n\t \twhile (data.ready()) { \t\t\n\t \t\tString line=data.readLine();\n\t \t\tif (line.matches(\"\\\\s*\")) continue; // be friendly with empty lines\n\t \t\tString[] numberStrings = line.split(\"\\t\");\n\t \t\t\n \n\t \t\tint frequentItem = Integer.parseInt(numberStrings[0]);\n \t\t\tif (!hashItems.containsKey(frequentItem)) {\n\t \t\t\t\thashItems.put(frequentItem, nItems);\n\t \t\t\t\tnItems++;\n\t \t\t\t}\n\t \t\t}\n\t \t\t\n\t \t} \n\n }", "private void startParsing(){\r\n pondred = new ArrayList<>();\r\n //extract docs from corpus\r\n for (String xml:parseDocsFile(docs_file))\r\n {\r\n try {\r\n pondred.add(loadXMLFromString(xml));\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n System.out.println(\"Ending parsing\");\r\n for (Core pon:pondred){\r\n for (String string:pon.abstractTerm){\r\n Double tf = pon.getAbstractFerq(string)/pon.getAbstractSize();\r\n Double idf = Math.log10(Core.count/countingDuplicates(string));\r\n pon.abstractFrequence.put(string,tf*idf);\r\n }\r\n pon.finish();\r\n }\r\n }", "private void populateDictionary() throws IOException {\n populateDictionaryByLemmatizer();\n// populateDictionaryBySynonyms();\n }", "private void readDocQueriesRelevance(){\n File f = new File(\"cranfield.query.relevance.txt\");\n if(f.exists() && !f.isDirectory()){\n try {\n FileReader fileReader=null;\n try {\n fileReader = new FileReader(f);\n } catch (FileNotFoundException ex) {\n Logger.getLogger(EvaluationQueries.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n BufferedReader bufferedReader = new BufferedReader(fileReader);\n String line;\n String[] querieDocRel;\n List<QuerieDocRelevance> tempQueriesRelevance;\n while ((line = bufferedReader.readLine()) != null) {\n querieDocRel = line.split(\"\\\\s+\");\n int querieNumber = Integer.parseInt(querieDocRel[0]);\n if(queriesRelevanceMap.containsKey(querieNumber)){\n tempQueriesRelevance = queriesRelevanceMap.get(querieNumber);\n tempQueriesRelevance.add(new QuerieDocRelevance(Integer.parseInt(querieDocRel[1]),Integer.parseInt(querieDocRel[2])));\n queriesRelevanceMap.put(querieNumber,tempQueriesRelevance);\n \n }else{\n tempQueriesRelevance = new ArrayList<>();\n tempQueriesRelevance.add(new QuerieDocRelevance(Integer.parseInt(querieDocRel[1]),Integer.parseInt(querieDocRel[2])));\n queriesRelevanceMap.put(querieNumber,tempQueriesRelevance); \n }\n \n }\n \n } catch (IOException ex) {\n Logger.getLogger(EvaluationQueries.class.getName()).log(Level.SEVERE, null, ex);\n } \n } \n \n }", "public static void initializeMemory(){\n\t\tif(memory == null){\n\t\t\tmemory = new TreeMap<String,String>();\n\t\t\tfor(int i=0;i<2048;i++){\n\t\t\t\tmemory.put(Utility.decimalToHex(i, 3), null);\n\t\t\t}\n\t\t\tmemory_fmbv = new int[256];\n\t\t\tfor(int i:memory_fmbv){\n\t\t\t\tmemory_fmbv[i] = 0;\n\t\t\t}\n\t\t}\n\t\tif(diskJobStorage == null){\n\t\t\tdiskJobStorage = new TreeMap<String,DiskSMT>();\n\t\t}\n\t}", "private void handleDocument(String name,InputStream ins)\n{\n Map<String,Integer> words = new HashMap<>();\n Map<String,Integer> kgrams = new HashMap<>();\n \n try {\n String cnts = IvyFile.loadFile(ins);\n CompilationUnit cu = JcompAst.parseSourceFile(cnts);\n words = handleDocumentText(cnts);\n kgrams = buildKgramCounts(cnts,cu);\n }\n catch (IOException e) {\n IvyLog.logI(\"Problem reading document file \" + name + \": \" + e);\n }\n \n if (words.size() > 0) {\n ++total_documents;\n for (String s : words.keySet()) {\n Integer v = document_counts.get(s);\n if (v == null) document_counts.put(s,1);\n else document_counts.put(s,v+1);\n }\n }\n if (kgrams.size() > 0) {\n ++total_kdocuments;\n for (String s : kgrams.keySet()) {\n Integer v = kgram_counts.get(s);\n if (v == null) kgram_counts.put(s,1);\n else kgram_counts.put(s,v+1);\n }\n }\n}", "abstract public Shard<Set<File>> getFilesKnowledge();", "public void readFiles() {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t// Open BufferedReader to open connection to tipslocation URL and read file\n\t\t\tBufferedReader reader1 = new BufferedReader(new InputStreamReader(tipsLocation.openStream()));\n\t\t\t\n\t\t\t// Create local variable to parse through the file\n\t String tip;\n\t \n\t // While there are lines in the file to read, add lines to tips ArrayList\n\t while ((tip = reader1.readLine()) != null) {\n\t tips.add(tip);\n\t }\n\t \n\t // Close the BufferedReader\n\t reader1.close();\n\t \n\t \n\t // Open BufferedReader to open connection to factsLocation URL and read file\n\t BufferedReader reader2 = new BufferedReader(new InputStreamReader(factsLocation.openStream()));\n\t \n\t // Create local variable to parse through the file\n\t String fact;\n\t \n\t // While there are lines in the file to read: parses the int that represents\n\t // the t-cell count that is associated with the line, and add line and int to \n\t // tCellFacts hashmap\n\t while ((fact = reader2.readLine()) != null) {\n\t \t\n\t \tint tCellCount = Integer.parseInt(fact);\n\t \tfact = reader2.readLine();\n\t \t\n\t tCellFacts.put(tCellCount, fact);\n\t }\n\t \n\t // Close the second BufferedReader\n\t reader2.close();\n\t \n\t\t} catch (FileNotFoundException e) {\n\t\t\t\n\t\t\tSystem.out.println(\"Error loading files\"); e.printStackTrace();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private static void loadMemo() {\n\t\t\n\t}", "public static void pageRankmain() {\n\t\t\t\n\t\t\tstopWordStore();\n\t\t\t//File[] file_read= dir.listFiles();\n\t\t\t//textProcessor(file_read);// Will be called from LinkCrawler\n\t\t\t//queryProcess();\n\t\t\t//System.out.println(\"docsave \"+ docsave);\n\t\t\t/*for ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t List<String> values = entry.getValue();\n\t\t\t System.out.print(\"Key = \" + key);\n\t\t\t System.out.println(\" , Values = \"+ values);\n\t\t\t}*/\n\t\t\t//########## RESPOINSIBLE FOR CREATING INVERTED INDEX OF TERMS ##########\n\t\t\tfor(int i=0;i<vocabulary.size();i++) {\n\t\t\t\tint count=1;\n\t\t\t\tMap<String, Integer> nestMap = new HashMap<String, Integer>();\n\t\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t\t String keyMain = entry.getKey();\n\t\t\t\t List<String> values = entry.getValue();\n\t\t\t\t if(values.contains(vocabulary.get(i)))\n\t\t\t\t \t{\n\t\t\t\t \tentryDf.put(vocabulary.get(i), count);//entryDf stores documents frequency of vocabulary word \\\\it increase the count value for specific key\n\t\t\t\t \tcount++;\n\t\t\t\t \t}\n\t\t\t\t \n\t\t\t\t nestMap.put(keyMain, Collections.frequency(values,vocabulary.get(i)));\n\t\t\t \t\n\t\t\t \t//System.out.println(\"VOC \"+ vocabulary.get(i)+ \" KeyMain \" +keyMain+ \" \"+ Collections.frequency(values,vocabulary.get(i)));\n\t\t\t\t\t}\n\t\t\t\t\ttfList.put(vocabulary.get(i), nestMap);\n\t\t\t}\n\t\t\t//########## RESPOINSIBLE FOR CREATING A MAP \"storeIdf\" TO STORE IDF VALUES OF TERMS ##########\n\t\t\tfor ( Map.Entry<String, Integer> endf : entryDf.entrySet()) {\n\t\t\t\tString keydf = endf.getKey();\n\t\t\t\tint valdf = endf.getValue();\n\t\t\t\t//System.out.print(\"Key = \" + \"'\"+keydf+ \"'\");\n\t\t\t //System.out.print(\" , Values = \"+ valdf);\n\t\t\t double Hudai = (double) (docsave.size())/valdf;\n\t\t\t //System.out.println(\"docsave size \"+docsave.size()+ \" valdf \"+ valdf + \" Hudai \"+ Hudai+ \" log Value1 \"+ Math.log(Hudai)+ \" log Value2 \"+ Math.log(2));\n\t\t\t double idf= Math.log(Hudai)/Math.log(2);\n\t\t\t storeIdf.put(keydf, idf);\n\t\t\t //System.out.print(\" idf-> \"+ idf);\n\t\t\t //System.out.println();\n\t\t\t} \n\t\t\t\n\t\t\t//############ Just for Printing ##########NO WORK HERE########\n\t\t\tfor (Map.Entry<String, Map<String, Integer>> tokTf : tfList.entrySet()) {\n\t\t\t\tString keyTf = tokTf.getKey();\n\t\t\t\tMap<String, Integer> valTF = tokTf.getValue();\n\t\t\t\tSystem.out.println(\"Inverted Indexing by Key Word = \" + \"'\"+keyTf+ \"'\");\n\t\t\t\tfor (Map.Entry<String, Integer> nesTf : valTF.entrySet()) {\n\t\t\t\t\tString keyTF = nesTf.getKey();\n\t\t\t\t\tInteger valTf = nesTf.getValue();\n\t\t\t\t\tSystem.out.print(\" Document Consists This Key Word = \" + \"'\"+ keyTF+ \"'\");\n\t\t\t\t\tSystem.out.println(\" , Term Frequencies in This Doc = \"+ valTf);\n\t\t\t\t} \n\t\t\t}\n\t\t\t//########### FOR CALCULATING DOCUMENT LENTH #############//\n\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry_new : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t{\n\t\t\t\tString keyMain_new = entry_new.getKey();\n\t\t\t\t//int countStop=0;\n\t\t\t\tdouble sum=0;\n\t\t\t\t for(Map.Entry<String, Map<String, Integer>> tokTf_new : tfList.entrySet()) // Iterating through the vocabulary\n\t\t\t\t { \n\t\t\t\t\t Map<String, Integer> valTF_new = tokTf_new.getValue();\n\t\t\t\t\t for (Map.Entry<String, Integer> nesTf_new : valTF_new.entrySet()) // Iterating Through the Documents\n\t\t\t\t\t {\n\t\t\t\t\t\t if(keyMain_new.equals(nesTf_new.getKey())) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t double val = nesTf_new.getValue()* (Double) storeIdf.get(tokTf_new.getKey());\n\t\t\t\t\t\t\t sum = sum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t //countStop++;\n\t\t\t\t }\n\t\t\t\t docLength.put(keyMain_new, Math.sqrt(sum));\n\t\t\t\t sum=0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Document Length \"+ docLength);\n\t\t\t//System.out.println(\"tfList \"+tfList);\n\t\t\t\n\t\t\t //########### FOR CALCULATING QUERY LENTH #############///\n\t\t\t\tdouble qrySum=0;\n\t\t\t\t for(String qryTerm: queryList) // Iterating through the vocabulary\n\t\t\t\t {\n\t\t\t\t\t//entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));// VUl ase\n\t\t\t\t\t \n\t\t\t\t\t\t if(storeIdf.get(qryTerm) != null) \n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));\n\t\t\t\t\t\t\t double val = entryQf.get(qryTerm)* (Double) storeIdf.get(qryTerm);\n\t\t\t\t\t\t\t qrySum = qrySum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t System.out.println(qryTerm+\" \"+entryQf.get(qryTerm)+ \" \"+ (Double) storeIdf.get(qryTerm));\n\t\t\t\t }\n\t\t\t\t qrySum=Math.sqrt(qrySum);\n\t\t\t\t System.out.println(\"qrySum \" + qrySum);\n\t\t\t\t \n\t\t\t\t//########### FOR CALCULATING COSINE SIMILARITY #############///\n\t\t\t\t for ( Map.Entry<String, ArrayList<String>> entry_dotP : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble sumProduct=0;\n\t\t\t\t\t\tdouble productTfIdf=0;\n\t\t\t\t\t\tString keyMain_new = entry_dotP.getKey(); //Geting Doc Name\n\t\t\t\t\t\t for(Map.Entry<String, Integer> qryTermItr : entryQf.entrySet()) // Iterating through the vocabulary\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t Map<String, Integer> matchTerm = tfList.get(qryTermItr.getKey()); // Getting a map of doc Names by a Query Term as value of tfList\n\n\t\t\t\t\t\t\t\t if(matchTerm.containsKey(keyMain_new)) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t //System.out.println(\"Test \"+ matchTerm.get(keyMain_new) +\" keyMain_new \" + keyMain_new);\n\t\t\t\t\t\t\t\t\t double docTfIdf= matchTerm.get(keyMain_new) * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t double qryTfIdf= qryTermItr.getValue() * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t productTfIdf = docTfIdf * qryTfIdf;\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t sumProduct= sumProduct+productTfIdf;\n\t\t\t\t\t\t\t //System.out.println(\"productTfIdf \"+productTfIdf+\" sumProduct \"+ sumProduct);\n\t\t\t\t\t\t\t productTfIdf=0;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t cosineProd.put(entry_dotP.getKey(), sumProduct/(docLength.get(entry_dotP.getKey())*qrySum));\n\t\t\t\t\t\t sumProduct=0;\n\t\t\t\t\t\t //System.out.println(entry_dotP.getKey()+ \" \" + docLength.get(entry_dotP.getKey()));\n\t\t\t\t\t}\n\t\t\t\t System.out.println(\"cosineProd \"+ cosineProd);\n\t\t\t\t \n\t\t\t\t System.out.println(\"Number of Top Pages you want to see\");\n\t\t\t\t int topRank = Integer.parseInt(scan.nextLine());\n\t\t\t\t Map<String, Double> result = cosineProd.entrySet().stream()\n\t\t\t .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).limit(topRank)\n\t\t\t .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,\n\t\t\t (oldValue, newValue) -> oldValue, LinkedHashMap::new));\n\n\t\t\t\t scan.close();\n\t\t\t //Alternative way\n\t\t\t //Map<String, Double> result2 = new LinkedHashMap<>();\n\t\t\t //cosineProd.entrySet().stream().sorted(Map.Entry.<String, Double>comparingByValue().reversed()).limit(2).forEachOrdered(x -> result2.put(x.getKey(), x.getValue()));\n\n\t\t\t System.out.println(\"Sorted...\");\n\t\t\t System.out.println(result);\n\t\t\t //System.out.println(result2);\n\t}", "protected void loadKeys()\r\n {\r\n log.debug(\"{0}: Loading keys for {1}\", () -> logCacheName, () -> keyFile.toString());\r\n\r\n storageLock.writeLock().lock();\r\n\r\n try\r\n {\r\n // clear a key map to use.\r\n keyHash.clear();\r\n\r\n final HashMap<K, IndexedDiskElementDescriptor> keys = keyFile.readObject(\r\n new IndexedDiskElementDescriptor(0, (int) keyFile.length() - IndexedDisk.HEADER_SIZE_BYTES));\r\n\r\n if (keys != null)\r\n {\r\n log.debug(\"{0}: Found {1} in keys file.\", logCacheName, keys.size());\r\n\r\n keyHash.putAll(keys);\r\n\r\n log.info(\"{0}: Loaded keys from [{1}], key count: {2}; up to {3} will be available.\",\r\n () -> logCacheName, () -> fileName, keyHash::size, () -> maxKeySize);\r\n }\r\n\r\n if (log.isTraceEnabled())\r\n {\r\n dump(false);\r\n }\r\n }\r\n catch (final Exception e)\r\n {\r\n log.error(\"{0}: Problem loading keys for file {1}\", logCacheName, fileName, e);\r\n }\r\n finally\r\n {\r\n storageLock.writeLock().unlock();\r\n }\r\n }", "private void collect() {\n\n System.out.println(\"Getting IndexReader...\");\n final IndexReader reader = index.reader();\n\n System.out.println(\"Calling forEachDocument()...\");\n index.forEachDocument(new DocTask() {\n\n int docsDone = 0;\n\n final int totalDocs = reader.maxDoc() - reader.numDeletedDocs();\n\n @Override\n public void perform(BlackLabIndex index, int docId) {\n Map<String, String> metadata = new HashMap<>();\n Document luceneDoc = index.luceneDoc(docId);\n for (IndexableField f: luceneDoc.getFields()) {\n // If this is a regular metadata field, not a control field\n if (!f.name().contains(\"#\")) {\n fieldNames.add(f.name());\n if (f.stringValue() != null)\n metadata.put(f.name(), f.stringValue());\n else if (f.numericValue() != null)\n metadata.put(f.name(), f.numericValue().toString());\n }\n }\n values.add(metadata);\n docsDone++;\n if (docsDone % 100 == 0) {\n int perc = docsDone * 100 / totalDocs;\n System.out.println(docsDone + \" docs exported (\" + perc + \"%)...\");\n }\n }\n });\n }", "private void readFromInternalStorage() {\n ArrayList<GeofenceObjects> returnlist = new ArrayList<>();\n if (!isExternalStorageReadable()) {\n System.out.println(\"not readable\");\n } else {\n returnlist = new ArrayList<>();\n try {\n FileInputStream fis = openFileInput(\"GeoFences\");\n ObjectInputStream ois = new ObjectInputStream(fis);\n returnlist = (ArrayList<GeofenceObjects>) ois.readObject();\n ois.close();\n System.out.println(returnlist);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n currentList = returnlist;\n }", "private void getDriveContents() {\n Thread t = new Thread(new Runnable() {\n @Override\n public void run() {\n // get only the folders in the root directory of drive account\n List<File> files = getContents(TOP_LEVEL + \" and \" + NOT_TRASHED + \" and \" + FOLDER + \" and \" + NOT_SPREADSHEET);\n \n prune(targetDir, files);\n processLanguages(files);\n }\n });\n t.start();\n }", "public static void fetchWords() {\n wordList = new ArrayList<String>();\n try {\n //problems with reading into method\n WordFetcher.readInto(wordList); \n } catch(Exception e) {\n System.out.println(e);\n }\n }", "@Test\n public void test1() throws IOException {\n FileSystem fs = FileSystem.getLocal(new Configuration());\n Path termsFilePath = new Path(\"etc/trec-index-terms.dat\");\n Path termIDsFilePath = new Path(\"etc/trec-index-termids.dat\");\n Path idToTermFilePath = new Path(\"etc/trec-index-termid-mapping.dat\");\n\n DefaultFrequencySortedDictionary dictionary =\n new DefaultFrequencySortedDictionary(termsFilePath, termIDsFilePath, idToTermFilePath, fs);\n\n assertEquals(312232, dictionary.size());\n assertEquals(\"page\", dictionary.getTerm(1));\n assertEquals(\"time\", dictionary.getTerm(2));\n assertEquals(\"will\", dictionary.getTerm(3));\n assertEquals(\"year\", dictionary.getTerm(4));\n assertEquals(\"nikaan\", dictionary.getTerm(100000));\n\n assertEquals(1, dictionary.getId(\"page\"));\n assertEquals(2, dictionary.getId(\"time\"));\n assertEquals(3, dictionary.getId(\"will\"));\n assertEquals(4, dictionary.getId(\"year\"));\n assertEquals(100000, dictionary.getId(\"nikaan\"));\n \n assertEquals(null, dictionary.getTerm(312233));\n\n Iterator<String> iter = dictionary.iterator();\n assertTrue(iter.hasNext());\n assertEquals(\"page\", iter.next());\n assertTrue(iter.hasNext());\n assertEquals(\"time\", iter.next());\n assertTrue(iter.hasNext());\n assertEquals(\"will\", iter.next());\n assertTrue(iter.hasNext());\n assertEquals(\"year\", iter.next());\n assertTrue(iter.hasNext());\n\n int cnt = 0;\n for (@SuppressWarnings(\"unused\") String s : dictionary) {\n cnt++;\n }\n assertEquals(dictionary.size(), cnt);\n\n cnt = 0;\n iter = dictionary.iterator();\n while(iter.hasNext()) {\n cnt++;\n iter.next();\n }\n assertEquals(dictionary.size(), cnt);\n }", "public void ReadIndex(int K) throws IOException {\n IndexReader indexReader = new IndexReader();\n\n // get doc frequency, termFrequency in all docs\n// int df = indexReader.getDocFreq(token);\n// long collectionTf = indexReader.getCollectionFrequency(token);\n//// System.out.println(\" The token \\\"\" + token + \"\\\" appeared in \" + df + \" documents and \" + collectionTf\n//// + \" times in total\");\n// if (df > 0) {\n// int[][] posting = indexReader.getPostingList(token);\n// for (int i = 0; i < posting.length; i++) {\n// int doc_id = posting[i][0];\n//// int term_freq = posting[i][1];\n// String doc_no = indexReader.getDocNo(doc_id);\n//// System.out.println(\"doc_no: \" + doc_id);\n//\n//// System.out.printf(\"%10s %6d %6d\\n\", doc_no, doc_id, term_freq);\n//// System.out.printf(\"%10s 10%6d %6d\\n\", doc_no, doc_id, indexReader.getTF(token, doc_id));\n// System.out.println(\"tf_idf: \" + indexReader.getTF_IDF_weight(token, doc_id));\n//\n// }\n// }\n\n\n String doc_no = indexReader.getDocNo(FileConst.query_doc_id);\n // retreived top K relevant doc ids\n System.out.println(\"=== Top 20 Most Relevant Documents and its Cosine Similarity Score ===\");\n indexReader.retrieveRank(query_tokens, Integer.parseInt(doc_no), K);\n\n indexReader.close();\n }", "public void dictionaryAdvanced() {\n dictionaryManagement.insertFromFile();\n showAllWords();\n dictionaryManagement.dictionaryLookup();\n dictionaryManagement.removeWord(\"Before\");\n showAllWords();\n dictionaryManagement.dictionaryExportToFile();\n }", "public static void loadDocumentCollecion() throws IOException {\n\t\tSystem.out.println(\"Document Collection index: \" + DocumentCollection_location);\t\t\n\t\tDirectory DocsIndexDirectory = FSDirectory.open(new File(DocumentCollection_location));\t\t\n\t\tdocuments = new IndexSearcher((IndexReader.open(DocsIndexDirectory)));\t\n\t}", "private void initializeFileSystem() \r\n \t /*@ requires identityFile |-> _ &*& identityFileSignature |-> _ &*& addressFile |-> _ &*& addressFileSignature |-> _\r\n\t\t\t &*& caRoleIDFile |-> _ &*& preferencesFile |-> _ &*& idDirectory |-> _\r\n\t\t\t &*& certificateDirectoryFile |-> _ &*& privateKeyDirectoryFile |-> _ &*& authenticationObjectDirectoryFile |-> _ &*& objectDirectoryFile |-> _\r\n\t\t\t &*& tokenInfo |-> _ &*& belpicDirectory |-> _ &*& dirFile |-> _\r\n\t\t\t &*& masterFile |-> _ &*& selectedFile |-> _;\r\n\t @*/\r\n \t/*@ ensures dirFile |-> ?theDirFile &*& theDirFile.ElementaryFile(_, _, ?dirFileData, _, _, _) &*& theDirFile != null \r\n \t &*& dirFileData != null &*& dirFileData.length == 0x25\r\n\t &*& belpicDirectory |-> ?theBelpicDirectory &*& theBelpicDirectory.DedicatedFile(_, _, _, ?belpic_siblings, _) &*& theBelpicDirectory != null\r\n\t &*& tokenInfo |-> ?theTokenInfo &*& theTokenInfo.ElementaryFile(_, _, ?tokenInfoData, _, _, _) &*& theTokenInfo != null\r\n\t &*& tokenInfoData != null &*& tokenInfoData.length == 0x30\r\n\t &*& objectDirectoryFile |-> ?theObjectDirectoryFile &*& theObjectDirectoryFile.ElementaryFile(_, _, ?objectDirectoryFileData, _, _, _) &*& theObjectDirectoryFile != null\r\n\t &*& objectDirectoryFileData != null &*& objectDirectoryFileData.length == 40\r\n\t &*& authenticationObjectDirectoryFile |-> ?theAuthenticationObjectDirectoryFile &*& theAuthenticationObjectDirectoryFile.ElementaryFile(_, _, ?authenticationObjectDirectoryFileData, _, _, _) &*& theAuthenticationObjectDirectoryFile != null\r\n\t &*& authenticationObjectDirectoryFileData != null &*& authenticationObjectDirectoryFileData.length == 0x40\r\n\t &*& privateKeyDirectoryFile |-> ?thePrivateKeyDirectoryFile &*& thePrivateKeyDirectoryFile.ElementaryFile(_, _, ?privateKeyDirectoryFileData, _, _, _) &*& thePrivateKeyDirectoryFile != null\r\n\t &*& privateKeyDirectoryFileData != null &*& privateKeyDirectoryFileData.length == 0xB0\r\n\t &*& certificateDirectoryFile |-> ?theCertificateDirectoryFile &*& theCertificateDirectoryFile.ElementaryFile(_, _, ?certificateDirectoryFileData, _, _, _) &*& theCertificateDirectoryFile != null\r\n\t &*& certificateDirectoryFileData != null &*& certificateDirectoryFileData.length == 0xB0\r\n\t &*& idDirectory |-> ?theIdDirectory &*& theIdDirectory.DedicatedFile(_, _, _, ?idDirectory_siblings, _) &*& theIdDirectory != null\r\n\t &*& identityFile |-> ?theIdentityFile &*& theIdentityFile.ElementaryFile(_, _, ?identityData, _, _, _) &*& theIdentityFile != null\r\n\t &*& identityData != null &*& identityData.length == 0xD0\r\n\t &*& identityFileSignature |-> ?theIdentityFileSignature &*& theIdentityFileSignature.ElementaryFile(_, _, ?identitySignatureData, _, _, _) &*& theIdentityFileSignature != null\r\n\t &*& identitySignatureData != null &*& identitySignatureData.length == 0x80\r\n\t &*& addressFile |-> ?theAddressFile &*& theAddressFile.ElementaryFile(_, _, ?addressFileData, _, _, _) &*& theAddressFile != null\r\n\t &*& addressFileData != null &*& addressFileData.length == 117\r\n\t &*& addressFileSignature |-> ?theAddressFileSignature &*& theAddressFileSignature.ElementaryFile(_, _, ?addressFileSignatureData, _, _, _) &*& theAddressFileSignature != null\r\n\t &*& addressFileSignatureData != null &*& addressFileSignatureData.length == 128\r\n\t &*& caRoleIDFile |-> ?theCaRoleIDFile &*& theCaRoleIDFile.ElementaryFile(_, _, ?caRoldIDFileData, _, _, _) &*& theCaRoleIDFile != null\r\n\t &*& caRoldIDFileData != null &*& caRoldIDFileData.length == 0x20\r\n\t &*& preferencesFile |-> ?thePreferencesFile &*& thePreferencesFile.ElementaryFile(_, _, ?preferencesFileData, _, _, _) &*& thePreferencesFile != null\r\n\t &*& preferencesFileData != null &*& preferencesFileData.length == 100\r\n\t &*& masterFile |-> ?theMasterFile &*& theMasterFile.MasterFile(0x3F00, null, _, ?master_siblings, _) &*& theMasterFile != null\r\n\t &*& master_siblings == cons<File>(theDirFile, cons(theBelpicDirectory, cons(theIdDirectory, nil)))\r\n\t &*& belpic_siblings == cons<File>(theTokenInfo, cons(theObjectDirectoryFile, cons(theAuthenticationObjectDirectoryFile, cons(thePrivateKeyDirectoryFile, cons(theCertificateDirectoryFile,nil)))))\r\n\t &*& idDirectory_siblings == cons<File>(theIdentityFile, cons(theIdentityFileSignature, cons(theAddressFile, cons(theAddressFileSignature, cons(theCaRoleIDFile, cons(thePreferencesFile, nil))))))\r\n\t &*& selectedFile |-> theMasterFile &*& theBelpicDirectory.getClass() == DedicatedFile.class &*& theIdDirectory.getClass() == DedicatedFile.class;\r\n\t @*/\r\n\t{\r\n\t\tmasterFile = new MasterFile();\r\n\t\t/*\r\n\t\t * initialize PKCS#15 data structures see\r\n\t\t * \"5. PKCS#15 information details\" for more info\r\n\t\t */\r\n\t\t\r\n\t\t//@ masterFile.castMasterToDedicated();\r\n\t\t\r\n\t\tdirFile = new ElementaryFile(EF_DIR, masterFile, (short) 0x25);\r\n\t\tbelpicDirectory = new DedicatedFile(DF_BELPIC, masterFile);\r\n\t\ttokenInfo = new ElementaryFile(TOKENINFO, belpicDirectory, (short) 0x30);\r\n\t\tobjectDirectoryFile = new ElementaryFile(ODF, belpicDirectory, (short) 40);\r\n\t\tauthenticationObjectDirectoryFile = new ElementaryFile(AODF, belpicDirectory, (short) 0x40);\r\n\t\tprivateKeyDirectoryFile = new ElementaryFile(PRKDF, belpicDirectory, (short) 0xB0);\r\n\t\tcertificateDirectoryFile = new ElementaryFile(CDF, belpicDirectory, (short) 0xB0);\r\n\t\tidDirectory = new DedicatedFile(DF_ID, masterFile);\r\n\t\t/*\r\n\t\t * initialize all citizen data stored on the eID card copied from sample\r\n\t\t * eID card 000-0000861-85\r\n\t\t */\r\n\t\t// initialize ID#RN EF\r\n\t\tidentityFile = new ElementaryFile(IDENTITY, idDirectory, (short) 0xD0);\r\n\t\t// initialize SGN#RN EF\r\n\t\tidentityFileSignature = new ElementaryFile(SGN_IDENTITY, idDirectory, (short) 0x80);\r\n\t\t// initialize ID#Address EF\r\n\t\t// address is 117 bytes, and should be padded with zeros\r\n\t\taddressFile = new ElementaryFile(ADDRESS, idDirectory, (short) 117);\r\n\t\t// initialize SGN#Address EF\r\n\t\taddressFileSignature = new ElementaryFile(SGN_ADDRESS, idDirectory, (short) 128);\r\n\t\t// initialize PuK#7 ID (CA Role ID) EF\r\n\t\tcaRoleIDFile = new ElementaryFile(CA_ROLE_ID, idDirectory, (short) 0x20);\r\n\t\t// initialize Preferences EF to 100 zero bytes\r\n\t\tpreferencesFile = new ElementaryFile(PREFERENCES, idDirectory, (short) 100);\r\n\t\t\r\n\t\tselectedFile = masterFile;\r\n\t\t//@ masterFile.castDedicatedToMaster();\r\n\t}", "private void readIndex() throws IOException {\n\t\t\tif (this.keys != null)\n\t\t\t\treturn;\n\t\t\tkeys = new HashMap<K, Long>(1024);\n\t\t\ttry {\n\t\t\t\twhile (index.hasNext()) {\n\t\t\t\t\tPair<K, Long> pair;// = new Pair<K, Long>(index.getSchema());\n\t\t\t\t\tpair = index.next();\n\t\t\t\t\tkeys.put(pair.key(), pair.value());\n\t\t\t\t\tif (firstKey == null)\n\t\t\t\t\t\tfirstKey = pair.key();\n\t\t\t\t\tfinalKey = pair.key();\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\n\t\t\t}finally {\n\t\t\t\tindexClosed = true;\n\t\t\t\tindex.close();\n\t\t\t}\n\t\t}", "static void ReadQuery(String input) throws FileNotFoundException {\n input = input.replaceAll(\"[^A-Za-z]\",\" \");\n String[] arr = input.split(\" \"); // splitting the whole string into words by split on the basis of white spaces\n\n\n for(int i=0; i<arr.length; i++) {\n String termWord = arr[i].toLowerCase();\t//same pre-processing is applied to all the query word\n //termWord = RemoveSpecialCharacter(termWord);\n termWord = removeStopWords(termWord);\n\n if(!termWord.equalsIgnoreCase(\"\")) { // all the white spaces are removed as if not removed then lemmatization wont be successfully done\n\n termWord = Lemmatize(termWord);\n System.out.println(termWord);\n if(dictionary.containsKey(termWord)) {\n List<Integer> wordList = new ArrayList<>();\n wordList = dictionary.get(termWord);\n int queryWordFrequency = wordList.get(totaldocument);\n queryWordFrequency++;\n wordList.set(totaldocument, queryWordFrequency); // all the frequencies of the query words are stored at the 56th index of the List stored in the\n //hashmap associated with its word-terms\n dictionary.put(termWord, wordList);\n }\n else {\n //if any of the enterd query word not present in all the docs so list will have 0.0 value from 0th index to 55th and 56th index is reserver\n // for query word frequency\n List<Integer> wordList = new ArrayList<>();\n for(int j=0; j<totaldocument+1; j++) {\n wordList.add(0);\n }\n wordList.add(1);\n dictionary.put(termWord, wordList); //updating the dictionary hashmap now containing all the query words frequencies\n }\n }\n }\n save();\n }", "public static void readMemory() {\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"dd_MM_yyyy_hh_mm\");\n\n\t\t//getting the running container's id\n\t\tHashMap<String,String> hMap = ContainerUtil.getActiveContainers();\n\n\t\t//getting the process IDs for the running conteiners\n\t\tFile[] directories = new File(\"/proc\").listFiles(File::isDirectory);\n\n\t\tfor(Map.Entry<String,String> entry : hMap.entrySet()){\n\n\t\t\t//getting start time of mem copy\n\t\t\tDate startDate = new Date();\n\n\t\t\t//pausing the container to get its memory\n\t\t\tContainerUtil.pauseContainer( entry.getKey() );\n\n\t\t\tfor(File dir : directories) {\n\n\t\t\t\tif(NumberUtils.isNumber(dir.getName())){\n\t\t\t\t\n\t\t\t\t\tString filename = \"/proc/\" + dir.getName() + \"/cgroup\";\n\n\t\t\t\t\t//finding the cgroup file for the containerId\t\t\t\t\t\n\t\t\t\t\ttry(Stream<String> stream = Files.lines(Paths.get(filename))){\n\n\t\t\t\t\t\tif(stream.filter(line -> line.indexOf(entry.getKey()) > 0 ).findFirst().isPresent()){\n\t\t\t\t\t\t\t//change this point to save file to a mapped directory\n\t\t\t\t\t\t\tString outFile = \"./\" +\tentry.getKey() + \"-\" + \n\t\t\t\t\t\t\t\t\t\tentry.getValue() + \"-\" + \n\t\t\t\t\t\t\t\t\t\tdir.getName() + \"-\" + \n\t\t\t\t\t\t\t\t\t\tdateFormat.format(new Date()) + \".mem\";\n\n\t\t\t\t\t\t\tString fileSource = \"/proc/\" + dir.getName() + \"/numa_maps\";\n\n\t\t\t\t\t\t\t//writing memory to file\n\t\t\t\t\t\t\twriteMemToFile(outFile, fileSource);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} catch (IOException e){\n\t\t\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//unpausing the container after memory collection\n\t\t\tContainerUtil.unpauseContainer( entry.getKey() );\n\n\t\t\t//calculating total time for mem copy\n\t\t\tlong seconds = (new Date().getTime() - startDate.getTime());\n\t\t\tSystem.out.println(\" copy time: \" + seconds);\n\t\t}\n\t}", "public static void gc() {\n // Collecting RAM before collecting EEPROM means that only live objects\n // in RAM with pointers to EEPROM will be considered as roots while\n // marking EEPROM objects.\n Native.gc();\n\n int wordSize = Native.getPersistentMemorySize()/4;\n try {\n int[] bitVector = new int[(wordSize / 32) + 2];\n int[] markingStack = new int[GC_MARK_STACK_SIZE];\n Native.gcPersistentMemory(bitVector, markingStack);\n } catch (OutOfMemoryError oome) {\n throw new OutOfMemoryError(\"Cannot allocate auxillary data structures for persistent gc\");\n }\n }", "static void allDocumentAnalyzer() throws IOException {\n\t\tFile allFiles = new File(\".\"); // current directory\n\t\tFile[] files = allFiles.listFiles(); // file array\n\n\t\t// recurse through all documents\n\t\tfor (File doc : files) {\n\t\t\t// other files we don't need\n\t\t\tif (doc.getName().contains(\".java\") || doc.getName().contains(\"words\") || doc.getName().contains(\"names\")\n\t\t\t\t\t|| doc.getName().contains(\"phrases\") || doc.getName().contains(\".class\")\n\t\t\t\t\t|| doc.getName().contains(\"Data\") || doc.getName().contains(\".sh\") || doc.isDirectory()\n\t\t\t\t\t|| !doc.getName().contains(\".txt\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tString name = doc.getName();\n\t\t\tSystem.out.println(name);\n\t\t\tname = name.substring(0, name.length() - 11);\n\t\t\tSystem.out.println(name);\n\n\t\t\tif (!names.contains(name)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// make readers\n\t\t\tFileReader fr = new FileReader(doc);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\n\t\t\t// phrase list\n\t\t\tArrayList<String> words = new ArrayList<String>();\n\n\t\t\t// retrieve all text, trim, refine and add to phrase list\n\t\t\tString nextLine = br.readLine();\n\t\t\twhile (nextLine != null) {\n\t\t\t\tnextLine = nextLine.replace(\"\\n\", \" \");\n\t\t\t\tnextLine = nextLine.trim();\n\n\t\t\t\tif (nextLine.contains(\"no experience listed\")) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tString[] lineArray = nextLine.split(\"\\\\s+\");\n\n\t\t\t\t// recurse through every word to find phrases\n\t\t\t\tfor (int i = 0; i < lineArray.length - 1; i++) {\n\t\t\t\t\t// get the current word and refine\n\t\t\t\t\tString currentWord = lineArray[i];\n\n\t\t\t\t\tcurrentWord = currentWord.trim();\n\t\t\t\t\tcurrentWord = refineWord(currentWord);\n\n\t\t\t\t\tif (currentWord.equals(\"\") || currentWord.isEmpty()) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\twords.add(currentWord);\n\t\t\t\t}\n\t\t\t\tnextLine = br.readLine();\n\t\t\t}\n\n\t\t\tbr.close();\n\n\t\t\t// continue if empty\n\t\t\tif (words.size() == 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// otherwise, increment number of files in corpus\n\t\t\tsize++;\n\n\t\t\t// updating the phrase count map for tf\n\t\t\tString fileName = doc.getName();\n\t\t\tphraseCountMap.put(fileName, words.size());\n\n\t\t\t// recurse through every word\n\t\t\tfor (String word : words) {\n\t\t\t\t// get map from string to freq\n\t\t\t\tHashMap<String, Integer> textFreqMap = wordFreqMap.get(fileName);\n\n\t\t\t\t// if it's null, make one\n\t\t\t\tif (textFreqMap == null) {\n\t\t\t\t\ttextFreqMap = new HashMap<String, Integer>();\n\t\t\t\t\t// make freq as 1\n\t\t\t\t\ttextFreqMap.put(word, 1);\n\t\t\t\t\t// put that in wordFreq\n\t\t\t\t\twordFreqMap.put(fileName, textFreqMap);\n\t\t\t\t} else {\n\t\t\t\t\t// otherwise, get the current num\n\t\t\t\t\tInteger currentFreq = textFreqMap.get(word);\n\n\t\t\t\t\t// if it's null,\n\t\t\t\t\tif (currentFreq == null) {\n\t\t\t\t\t\t// the frequency is just 0\n\t\t\t\t\t\tcurrentFreq = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t// increment the frequency\n\t\t\t\t\tcurrentFreq++;\n\n\t\t\t\t\t// put it in the textFreqMap\n\t\t\t\t\ttextFreqMap.put(word, currentFreq);\n\n\t\t\t\t\t// put that in the wordFreqMap\n\t\t\t\t\twordFreqMap.put(fileName, textFreqMap);\n\t\t\t\t}\n\n\t\t\t\t// add this to record (map from phrases to docs with that\n\t\t\t\t// phrase)\n\t\t\t\tinvertedMap.addValue(word, doc);\n\t\t\t}\n\t\t}\n\t}", "public IndexDatabase(String index_path) {\n int k;\n long p;\n try {\n pre_file = new RandomAccessFile(index_path + \"/sorted.kmc_pre\", \"r\");\n pre_file.seek(pre_file.length() - 8);\n header_pos = read_int(pre_file);\n pre_file.seek(pre_file.length() - 8 - header_pos);\n // read the index properties \n K = read_int(pre_file);\n mode = read_int(pre_file);\n ctr_size = read_int(pre_file);\n pre_len = read_int(pre_file);\n min_count = read_int(pre_file);\n max_count = read_int(pre_file);\n kmers_num = read_long(pre_file);\n suf_len = K - pre_len;\n key = new kmer(K, pre_len, suf_len);\n System.out.println(\"Indexing \" + kmers_num + \" kmers... \");\n // load the prefix file into the memory \n pre_file.seek(4);\n int q, len = 1 << (2 * pre_len);\n prefix_ptr = new long[len];\n MappedByteBuffer pre_buff;\n for (q = 0, p = 0; p < 8; ++p) {\n pre_buff = pre_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + p * len, len);\n for (k = 0; k < len / 8; ++k, ++q) {\n prefix_ptr[q] = read_long(pre_buff);\n }\n pre_buff = null;\n }\n pre_file.close();\n // mapping suffix file into the memory\n suf_rec_size = ctr_size + suf_len / 4;\n MAX_BYTE_COUNT = MAX_BYTE_COUNT / suf_rec_size * suf_rec_size;\n suf_parts_num = (int) ((kmers_num * suf_rec_size) % MAX_BYTE_COUNT == 0 ? (kmers_num * suf_rec_size) / MAX_BYTE_COUNT : (kmers_num * suf_rec_size) / MAX_BYTE_COUNT + 1);\n suf_parts_size = new long[suf_parts_num];\n suf_file = new RandomAccessFile(index_path + \"/sorted.kmc_suf\", \"r\");\n suf_buff = new MappedByteBuffer[suf_parts_num];\n for (k = 0; k < suf_parts_num; ++k) {\n suf_parts_size[k] = (int) (k == suf_parts_num - 1 ? (kmers_num * suf_rec_size) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n suf_buff[k] = suf_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + k * suf_parts_size[0], suf_parts_size[k]);\n }\n // mapping pointers file into the memory\n MAX_BYTE_COUNT = MAX_BYTE_COUNT / POINTER_LENGTH * POINTER_LENGTH;\n ptr_parts_num = (int) ((kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT == 0 ? (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT : (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT + 1);\n ptr_parts_size = new long[ptr_parts_num];\n ptr_file = new RandomAccessFile(index_path + \"/pointers.db\", \"rw\");\n ptr_buff = new MappedByteBuffer[ptr_parts_num];\n for (k = 0; k < ptr_parts_num; ++k) {\n ptr_parts_size[k] = (int) (k == ptr_parts_num - 1 ? (kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n ptr_buff[k] = ptr_file.getChannel().map(FileChannel.MapMode.READ_WRITE, k * ptr_parts_size[0], ptr_parts_size[k]);\n }\n } catch (IOException e) {\n System.out.println(e.getMessage());\n System.exit(1);\n }\n }", "void loadFaidx() {\n\t\tString file = phastConsDir + \"/genome.fai\";\n\t\tif (!Gpr.exists(file)) { throw new RuntimeException(\"Cannot find fasta index file '\" + file + \"'\\n\\tYou can create one by running 'samtools faidx' command and copying the resulting index file to \" + file + \"\\n\\n\"); }\n\n\t\t// Read and parse file\n\t\tchromoSize = new HashMap<>();\n\t\tString txt = Gpr.readFile(file);\n\t\tfor (String line : txt.split(\"\\n\")) {\n\t\t\tString fields[] = line.split(\"\\\\s+\");\n\t\t\tString chrName = Chromosome.simpleName(fields[0]);\n\t\t\tint len = Gpr.parseIntSafe(fields[1]);\n\n\t\t\tchromoSize.put(chrName, len);\n\t\t}\n\t}", "private FileManager()\n {\n bookFile.open(\"bookdata.txt\");\n hisFile.open(\"history.txt\");\n idFile.open(\"idpassword.txt\");\n createIDMap();\n createHisMap(Customer.getInstance());\n }", "public static void readDictionary()\r\n\t{\r\n\t\t//It trys to read over the file using try-catch in case of an Exception\r\n\t\ttry {\r\n\t\t\tFile file = new File(\"english.0\");\r\n\t\t\tScanner scan = new Scanner(file);\r\n\t\t\t//It reads over the file as long as there are words to read and we insert them into the given storage\r\n\t\t\twhile(scan.hasNext()) {\r\n\t\t\t\tdata.insert(scan.next());\r\n\t\t\t}\r\n\t\t\tscan.close(); \r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"File not found\");\r\n\t\t}\r\n\t}", "public ProgramManager() {\n display = new DisplayManager();\n fileName = \"resources/aLargeFile\";\n try {\n fileReader = new BufferedReader(new FileReader(fileName));\n } catch (FileNotFoundException e) {\n logger.error(e.getMessage());\n }\n wordStorage = new WordStorage();\n }", "private void populateDictionary() {\n Scanner scanner = null;\n try {\n scanner = new Scanner(new FileInputStream(filePath));\n while(scanner.hasNextLine()) {\n String word = scanner.nextLine();\n rwDictionary.put(reducedWord(word), word);\n lcDictionary.put(word.toLowerCase(), word);\n }\n } catch(IOException e) {\n System.err.println(e.toString());\n e.printStackTrace();\n } finally {\n if(scanner != null) {\n scanner.close();\n }\n }\n }", "private void extractFile() {\n try (BufferedReader buffered_reader = new BufferedReader(new FileReader(source_file))) {\n String line;\n while((line = buffered_reader.readLine()) != null) {\n String spaceEscaped = line.replace(\" \", \"\");\n //file was read, each line is one of the elements of the file_read_lines list\n //line 0 is keyword \"TELL\"\n //line 1 is the knowledge base\n //line 2 is the keyword \"ASK\"\n //line 3 is the query\n file_read_lines.add(spaceEscaped);\n }\n\n //generate list of Horn clauses (raw) from the KB raw sentence\n //replace \\/ by |\n String kbLine = file_read_lines.get(1).replace(\"\\\\/\", \"|\");\n rawClauses = Arrays.asList(kbLine.split(\";\"));\n //query - a propositional symbol\n query = file_read_lines.get(3);\n } catch (IOException e) {\n //Return error if file cannot be opened\n error = true;\n System.out.println(source_file.toString() + \" is not found!\");\n }\n }", "public HotWordsAnalyzer (String hotWordsFileName, String docFileName){\r\n //Setting the filenames to the variables to make them easier to type\r\n doc = docFileName;\r\n hw = hotWordsFileName;\r\n \r\n //If opening of the file fails, an ioException will be thrown\r\n\t\ttry{\r\n hotword = new Scanner(Paths.get(hw));\r\n }\r\n catch (IOException ioException){\r\n System.err.println(\"Error opening file. Terminating.\");\r\n System.exit(1);\r\n }\r\n \r\n try{\r\n \r\n docs = new Scanner(Paths.get(doc));\r\n }\r\n catch (IOException ioException){\r\n System.err.println(\"Error opening file. Terminating.\");\r\n System.exit(1);\r\n }\r\n \r\n //Above opens both files\r\n \r\n //Goes through hotwords file and takes each word and pushes them to \r\n //the map words so they can be used to locate the hotwords in the document\r\n\t\ttry{\r\n while(hotword.hasNext()){\r\n String y;\r\n String x = hotword.next();\r\n y = x.toLowerCase();\r\n //sets hotword as key and 0 for the count of that hotword in the document\r\n words.put(y, 0);\r\n }\r\n }\r\n //The element doesn't exist- file must not be a file\r\n catch(NoSuchElementException elementException){\r\n System.err.println(\"Improper file. Terminating.\");\r\n System.exit(1);\r\n }\r\n //The file may not be readable or corrupt\r\n catch(IllegalStateException stateException){\r\n System.err.println(\"Error reading from file. Terminating.\");\r\n System.exit(1);\r\n }\r\n \r\n //Above gets words and puts them into the words map\r\n try{\r\n //reads the document and when it finds a hotword it increments the count in words\r\n while(docs.hasNext()){\r\n //gets next word\r\n String x = docs.next();\r\n String y = x.toLowerCase();\r\n //Gets rid of the commas and periods\r\n y = y.replace(\",\", \"\");\r\n y = y.replace(\".\", \"\");\r\n //If the word y is in the hotwords list\r\n if(words.containsKey(y)){\r\n //Adds to words map and increments count\r\n consec.add(y);\r\n int z;\r\n z = words.get(y);\r\n z++;\r\n words.put(y, z);\r\n }\r\n }\r\n }\r\n catch(NoSuchElementException elementException){\r\n System.err.println(\"Improper file. Terminating.\");\r\n System.exit(1);\r\n }\r\n catch(IllegalStateException stateException){\r\n System.err.println(\"Error reading from file. Terminating.\");\r\n System.exit(1);\r\n }\r\n \r\n \r\n\t\t\r\n\t}", "public void readInSearchTokens() {\n String propFile = properties.getProperty(\"classpath.search.tokens\");\n //Try with resources\n try (InputStream inputStream = this.getClass().getResourceAsStream(propFile);\n \n InputStreamReader inputStreamReader = new InputStreamReader(inputStream);\n BufferedReader searchTokensReader = new BufferedReader(inputStreamReader)) {\n //Tells the stream that it is ready to be read\n while (searchTokensReader.ready()) {\n String line = searchTokensReader.readLine();\n //eliminating leading and trailing spaces with trim and split\n //creating a string array of tokens\n String[] tokens = line.trim().split(\"\\\\s*,\\\\s\");\n List<Integer> lArray = new ArrayList<Integer>();\n // Notes: String is the type - element is the identifier. Tokens is the name\n for (String element : tokens) {\n if (element.isEmpty() == false) {\n //using containsKey to ensure the FoundLocations is in the tokens array\n if (getFoundLocations().containsKey(element) == false) {\n getFoundLocations().put(element, lArray);\n }\n }\n }\n }\n } catch (IOException inputOutputException) {\n inputOutputException.printStackTrace();\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n }", "public static void experiment2() {\n\t\tList<String> lines = FileUtil.loadFrom(\"docs/corpus-search-results-new-408.txt\");\n\t\tString cipher = Ciphers.cipher[1].cipher;\n\t\tString plain = Ciphers.cipher[1].solution;\n\t\tfor (String line : lines) {\n\t\t\tint pos = plain.indexOf(line.toLowerCase());\n\t\t\tif (pos < 0) System.out.println(\"Could not find \" + line + \" in plaintext\");\n\t\t\telse {\n\t\t\t\tString sub = cipher.substring(pos, pos+line.length());\n\t\t\t\tInfo info = new Info(sub, 0);\n\t\t\t\tSystem.out.println(line + \", \" + sub + \", \" + info.probability);\n\t\t\t}\n\t\t}\n\t}", "public void IndexADocument(String docno, String content) throws IOException {\n\t\tdocid++;\n\t\tdoc2docid.put(docno, docid);\n\t\tdocid2doc.put(docid, docno);\n\n\t\t// Insert every term in this doc into docid2map\n\t\tString[] terms = content.trim().split(\" \");\n\t\tMap<Integer, Integer> docTerm = new HashMap<>();\n\t\tint thisTermid;\n\t\tfor(String term: terms){\n\t\t\t// get termid\n\t\t\tif(term2termid.get(term)!=null) thisTermid = term2termid.get(term);\n\t\t\telse{\n\t\t\t\tthisTermid = ++termid;\n\t\t\t\tterm2termid.put(term, thisTermid);\n\t\t\t}\n\t\t\tdocTerm.put(thisTermid, docTerm.getOrDefault(thisTermid, 0)+1);\n\t\t\t// Merge this term's information into termid2map\n\t\t\tMap<Integer, Integer> temp = termid2map.getOrDefault(thisTermid, new HashMap());\n\t\t\ttemp.put(docid, temp.getOrDefault(docid, 0)+1);\n\t\t\ttermid2map.put(thisTermid, temp);\n\t\t\ttermid2fre.put(thisTermid, termid2fre.getOrDefault(thisTermid, 0)+1);\n\t\t}\n\t\tdocid2map.put(docid, docTerm);\n\n//\t\t// Merge all the terms' information into termid2map\n//\t\tfor(Long tid: docTerm.keySet()){\n//\t\t\tMap<Long, Long> temp = termid2map.getOrDefault(tid, new HashMap());\n//\t\t\ttemp.put(docid,docTerm.get(tid));\n//\t\t\ttermid2map.put(tid, temp);\n//\t\t\t// update this term's frequency\n//\t\t\ttermid2fre.put(tid, termid2fre.getOrDefault(tid,0L)+docTerm.get(tid));\n//\t\t}\n\n\t\t// When termid2map and docid2map is big enough, put it into disk\n\t\tif(docid%blockSize==0){\n\t\t\tWritePostingFile();\n\t\t\tWriteDocFile();\n\t\t}\n\t}", "public static synchronized void refresh() {\n homes = new HashMap();\n prvHomes = new HashMap();\n ejb30Cache = new HashMap();\n iniCtx = null;\n }", "public static void update(String indexFileName, String listOfDoc) throws IOException{\n\t\tHashMap<String, String> sCurrentHashMap = null;\n\t\tboolean hasFile = true;\n\t\t\n\t\tif(globalHash.containsKey(indexFileName)){\n\t\t\t//ถ้ามีใน global แล้ว เอาออกมาแล้วเอามารวมกับที่เพิ่งอ่านไฟล์ได้เลย\n\t\t\tsCurrentHashMap = globalHash.get(indexFileName);\n\t\t\n\t\t}else{ \n\t\t\t//if no hashmap in globalHash, then check if there's this fileName.txt in directory\n\t\t\t\n\t\t\tif(!new File(indexFileName+\".txt\").isFile()){\n\t\t\t\t\tSystem.out.println(\"ERROR: The inverted file is not found.\");\n\t\t\t\t\thasFile = false;\n\t\t\t}else{\n\t \t sCurrentHashMap = genHashMapFromInvertedIndexFile(indexFileName);\n\t\t\t \n\t\t\t}\n\t\t}\n\t\t\n\t\tif(hasFile){\n\t\t\tArrayList<Term> newTermList = extractDoc(listOfDoc);\n\t\t\t//if the new term list has value (not doc not found)\n\t\t\tif(newTermList.size()>0){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tsCurrentHashMap = addListToHashMap(sCurrentHashMap, newTermList);\n\t\t\t\t\n\t\t\t\t/*เพิ่มเงื่อนไขกรณี ลบคำออกจากไฟล์ \n\t\t\t\t * 1.ทำ list เป็น hashMap อีกอันไว้เซิชไวไว\n\t\t\t\t * loop amount of doc\n\t\t\t\t * 2.ไล่ iterative ของ hashMap ว่ามี value อันไหน contain ชื่อไฟล์บ้าง ถ้าcontain ให้เช็คกลับว่า key นั้น มีในแฮชอีกอันหรือเปล่า\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t/* // Convert new word (from file) list to HashMap\n\t\t\t\tHashMap<String, String> newWordHashMap = new HashMap<String, String>();\n\t\t\t\tfor(Term i: newTermList){\n\t\t\t\t\tnewWordHashMap.put(i.getTerm(), i.getDocNumber()+\"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tIterator it = sCurrentHashMap.entrySet().iterator();\n\t\t\t\twhile(it.hasNext()){\n\t\t\t\t\tHashMap.Entry<String, String> entry = (HashMap.Entry<String, String>) it.next();\n\t\t\t\t\t//if its value contains the doc number, then check if its key is in the newTermHash or note\n\t\t\t\t\t// if not --> this term was removed --> remove this key out from sCurrentHashMap\n\t\t\t\t\tif(entry.getValue().contains(s)) {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\tglobalHash.put(indexFileName, sCurrentHashMap);\n\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "void massiveModeLoading( File dataPath );", "private void getDemographicFiles(Uin uinObject, List<DocumentsDTO> documents) {\n\t\tuinObject.getDocuments().stream().forEach(demo -> {\n\t\t\ttry {\n\t\t\t\tString fileName = DEMOGRAPHICS + SLASH + demo.getDocId();\n\t\t\t\tLocalDateTime startTime = DateUtils.getUTCCurrentDateTime();\n\t\t\t\tbyte[] data = securityManager\n\t\t\t\t\t\t.decrypt(IOUtils.toByteArray(fsAdapter.getFile(uinObject.getUinHash(), fileName)));\n\t\t\t\tmosipLogger.debug(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES,\n\t\t\t\t\t\t\"time taken to get file in millis: \" + fileName + \" - \"\n\t\t\t\t\t\t\t\t+ Duration.between(startTime, DateUtils.getUTCCurrentDateTime()).toMillis() + \" \"\n\t\t\t\t\t\t\t\t+ \"Start time : \" + startTime + \" \" + \"end time : \"\n\t\t\t\t\t\t\t\t+ DateUtils.getUTCCurrentDateTime());\n\t\t\t\tif (demo.getDocHash().equals(securityManager.hash(data))) {\n\t\t\t\t\tdocuments.add(new DocumentsDTO(demo.getDoccatCode(), CryptoUtil.encodeBase64(data)));\n\t\t\t\t} else {\n\t\t\t\t\tmosipLogger.error(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES,\n\t\t\t\t\t\t\tIdRepoErrorConstants.DOCUMENT_HASH_MISMATCH.getErrorMessage());\n\t\t\t\t\tthrow new IdRepoAppException(IdRepoErrorConstants.DOCUMENT_HASH_MISMATCH);\n\t\t\t\t}\n\t\t\t} catch (IdRepoAppException e) {\n\t\t\t\tmosipLogger.error(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES, \"\\n\" + e.getMessage());\n\t\t\t\tthrow new IdRepoAppUncheckedException(e.getErrorCode(), e.getErrorText(), e);\n\t\t\t} catch (FSAdapterException e) {\n\t\t\t\tmosipLogger.error(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES, \"\\n\" + e.getMessage());\n\t\t\t\tthrow new IdRepoAppUncheckedException(\n\t\t\t\t\t\te.getErrorCode().equals(HDFSAdapterErrorCode.FILE_NOT_FOUND_EXCEPTION.getErrorCode())\n\t\t\t\t\t\t\t\t? IdRepoErrorConstants.FILE_NOT_FOUND\n\t\t\t\t\t\t\t\t: IdRepoErrorConstants.FILE_STORAGE_ACCESS_ERROR,\n\t\t\t\t\t\te);\n\t\t\t} catch (IOException e) {\n\t\t\t\tmosipLogger.error(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES, \"\\n\" + e.getMessage());\n\t\t\t\tthrow new IdRepoAppUncheckedException(IdRepoErrorConstants.FILE_STORAGE_ACCESS_ERROR, e);\n\t\t\t}\n\t\t});\n\t}", "public void secondScan(String path) throws Exception {\n\t\tSystem.out.println(\"=======secondScan==========\");\r\n\t\t\r\n\t\tindiv2con.openSearcher(path);\r\n\t\tBufferedReader root = new BufferedReader(new FileReader(path+resultFile)), br;\r\n\t\tnew File(path+GRAPHEDGEPOOL).mkdir();\r\n\t\tPrintWriter pw;\r\n\t\tindivSize = Integer.parseInt(root.readLine());\r\n\t\tpropSize = Integer.parseInt(root.readLine());\r\n\t\tObjectInputStream in = new ObjectInputStream(new FileInputStream(path+conceptCountObj));\r\n\t\tconceptCount = (TreeMap<String, Integer>)in.readObject(); \r\n\t\tin.close();\r\n\t\tcache = new TreeMap<String, Set<String>>();\r\n\t\tString predid;\r\n\t\tint count = 0, hits = 0;\r\n\t\twhile((predid = root.readLine())!=null)\r\n\t\t{\r\n\t\t\tString pred = predid.substring(0, predid.indexOf('\\t'));\r\n\t\t\tString id = predid.substring(predid.indexOf('\\t')+1);\r\n\t\t\tSystem.out.println((++count)+\" \"+pred+\"\\tcache:\"+cache.size()+\"\\thits:\"+hits);\r\n\t\t\t\r\n\t\t\tFile file = new File(path+OBJPROPPOOL+File.separator+id);\r\n\t\t\tif(file.length() > MAX_OBJPROP_FILESIZE) continue;\r\n\t\t\tbr = new BufferedReader(new FileReader(file));\r\n\t\t\t\r\n\t\t\tTreeMap<String, Integer> triples = new TreeMap<String, Integer>();\r\n\t\t\t\r\n\t\t\tString line;\r\n\t\t\twhile((line = br.readLine())!= null)\r\n\t\t\t{\r\n\t\t\t\tString subj = line.substring(0, line.indexOf('\\t'));\r\n\t\t\t\tString obj = line.substring(line.indexOf('\\t')+1);\r\n\t\t\t\tSet<String> subjParent = null, objParent = null;\r\n\t\t\t\tsubjParent = cache.get(subj);\r\n\t\t\t\ttry \r\n\t\t\t\t{\r\n\t\t\t\t\tif(subjParent == null || subjParent.size()==0)\r\n\t\t\t\t\t\tsubjParent = indiv2con.search(subj);\r\n\t\t\t\t\telse hits++;\r\n\t\t\t\t} catch (Exception e) { e.printStackTrace(); continue; }\r\n\t\t\t\t\r\n\t\t\t\tif(subjParent == null || subjParent.size()==0)\r\n\t\t\t\t{\r\n\t\t\t\t\tsubjParent = new TreeSet<String>();\r\n\t\t\t\t\tsubjParent.add(NamedConcept.TOP.getUri());\r\n\t\t\t\t}\r\n\t\t\t\tif(!cache.containsKey(subj))\r\n\t\t\t\t\tcache.put(subj, subjParent);\r\n//\t\t\t\tSystem.out.println(obj);\r\n\t\t\t\tobjParent = cache.get(obj);\r\n\t\t\t\ttry \r\n\t\t\t\t{\r\n\t\t\t\t\tif(objParent == null || objParent.size()==0)\r\n\t\t\t\t\t\tobjParent = indiv2con.search(obj);\r\n\t\t\t\t\telse hits++;\r\n\t\t\t\t} catch (Exception e) { e.printStackTrace(); continue; }\r\n\t\t\t\t\r\n\t\t\t\tif(objParent == null || objParent.size()==0)\r\n\t\t\t\t{\r\n\t\t\t\t\tobjParent = new TreeSet<String>();\r\n\t\t\t\t\tobjParent.add(NamedConcept.TOP.getUri());\r\n\t\t\t\t}\r\n\t\t\t\tif(!cache.containsKey(obj))\r\n\t\t\t\t\tcache.put(obj, objParent);\r\n\t\t\t\t\r\n\t\t\t\twhile(cache.size()>=MAX_CACHE_SIZE) cache.clear();\r\n\t\t\t\t\r\n\t\t\t\tfor(String str: subjParent)\r\n\t\t\t\t{\r\n\t\t\t\t\tfor(String otr: objParent)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tInteger i = triples.get(str+'\\t'+otr);\r\n\t\t\t\t\t\tif(i==null) i = 0;\r\n\t\t\t\t\t\ttriples.put(str+'\\t'+otr, i+1);\r\n\t\t\t\t\t}\t\t\r\n\t\t\t\t}\r\n\t\t\t\tsubjParent = null;\r\n\t\t\t\tobjParent = null;\r\n\t\t\t}\r\n\t\t\tbr.close();\r\n\t\t\tpw = new PrintWriter(new FileWriter(path+GRAPHEDGEPOOL+File.separator+id));\r\n\t\t\tSystem.out.println(\"search finished! size:\"+triples.size());\r\n\t\t\tint order = 0;\r\n\t\t\tfor(String so: triples.keySet())\r\n\t\t\t{\r\n\t\t\t\tString str = so.substring(0, so.indexOf('\\t'));\r\n\t\t\t\tString otr = so.substring(so.indexOf('\\t')+1);\r\n\t\t\t\tString ptr = pred+\"(\"+order+\")\";\r\n\t\t\t\tdouble sscore, oscore, pscore;\r\n\t\t\t\tif(str.equals(NamedConcept.TOP.getUri()))\r\n\t\t\t\t\tsscore = TOP_ELEMENT_SCORE;\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tInteger j = conceptCount.get(str);\r\n\t\t\t\t\tif(j==null) sscore = Double.MAX_VALUE;\r\n\t\t\t\t\telse sscore = j.doubleValue()/indivSize;\r\n\t\t\t\t}\r\n\t\t\t\tif(otr.equals(NamedConcept.TOP.getUri()))\r\n\t\t\t\t\toscore = TOP_ELEMENT_SCORE;\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tInteger j = conceptCount.get(otr);\r\n\t\t\t\t\tif(j==null) oscore = Double.MAX_VALUE;\r\n\t\t\t\t\telse oscore = j.doubleValue()/indivSize;\r\n\t\t\t\t}\r\n\t\t\t\tInteger i = triples.get(so);\r\n\t\t\t\tif(i==null) pscore = Double.MAX_VALUE;\r\n\t\t\t\telse pscore = i.doubleValue()/propSize;\r\n\t\t\t\tpw.println(str+\"\\t\"+sscore+\"\\t\"+ptr+\"\\t\"+pscore+\"\\t\"+otr+\"\\t\"+oscore);\r\n\t\t\t\torder++;\r\n\t\t\t}\r\n\t\t\tpw.close();\r\n\t\t\ttriples.clear();\r\n\t\t\ttriples = null;\r\n\t\t\t\r\n\t\t}\r\n\t\troot.close();\r\n\t\tindiv2con.closeSearcher();\r\n\t}", "public abstract void loadKnowledge(String path) throws LoadKnowledgeException;", "private Map<String, C0148k> m472d() throws Exception {\n HashMap hashMap = new HashMap();\n ZipFile b = mo305b();\n Enumeration entries = b.entries();\n while (entries.hasMoreElements()) {\n ZipEntry zipEntry = (ZipEntry) entries.nextElement();\n if (zipEntry.getName().startsWith(\"fabric/\") && zipEntry.getName().length() > \"fabric/\".length()) {\n C0148k a = m470a(zipEntry, b);\n if (a != null) {\n hashMap.put(a.mo326a(), a);\n C0135c.m449h().mo273b(\"Fabric\", String.format(\"Found kit:[%s] version:[%s]\", new Object[]{a.mo326a(), a.mo327b()}));\n }\n }\n }\n if (b != null) {\n try {\n b.close();\n } catch (IOException unused) {\n }\n }\n return hashMap;\n }", "public void finish()\n {\n // Save space in the document and score lists.\n docs.compact();\n docScores.compact();\n \n // Figure out a group for each document.\n docGroups = new IntList(maxDoc+1);\n docGroups.fill(-1);\n for (int i = 0; i < docs.size(); i++) \n {\n int doc = docs.get(i);\n \n // Skip docs that already have a group assigned.\n if (docGroups.get(doc) >= 0)\n continue;\n \n // Go looking...\n findGroup(doc);\n } // for i\n \n // Form the group -> doc mapping\n groupDocs = new IntMultiMap(nGroups);\n for (int i = 0; i < docs.size(); i++ ) {\n int doc = docs.get(i);\n int group = docGroups.get(doc);\n assert group >= 0 : \"group should have been assigned\";\n groupDocs.add(group, doc);\n }\n \n debugGroups(0);\n \n }", "public static void DocumentFrequencies() throws FileNotFoundException {\n for (Entry<String, List<Integer>> entry : dictionary.entrySet()) {\n List<Integer> termfrequency = new ArrayList<>();\n\n termfrequency = entry.getValue();\t// getting each word's termfrequency list\n int i = 0;\n termfrequency.add(0); \t\t\t//maintaining documentfrequency at the 57th index\n Integer documentFrequency = termfrequency.get(totaldocument+1);\n while(i<56) { //iterate 0 to 55 all speeches term frequency\n if(termfrequency.get(i)>0) {\t\t//increment document frequency of that word if termfrequency is greater than 0.0\n documentFrequency++;\t\t\t//increment document frequency\n }\n i++;\t\t//increment index\n }\n termfrequency.set(57, documentFrequency);\t//re-set the documentfrequency and save the current maintained document frequency from 0 to calculated value\n dictionary.put(entry.getKey(), termfrequency);\t\t// place the incremented final value of that word back to the same list in dictionary hashmap\n }\n //save();\n }", "void read() {\n try {\n pre_list = new ArrayList<>();\n suf_list = new ArrayList<>();\n p_name = new ArrayList<>();\n stem_word = new ArrayList<>();\n\n //reading place and town name\n for (File places : place_name.listFiles()) {\n fin = new FileInputStream(places);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n place.add(temp);\n }\n\n }\n\n //reading month name\n for (File mont : month_name.listFiles()) {\n fin = new FileInputStream(mont);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n month.add(temp);\n }\n }\n\n //reading compound words first\n for (File comp_word : com_word_first.listFiles()) {\n fin = new FileInputStream(comp_word);\n scan = new Scanner(fin);\n while (scan.hasNextLine()) {\n temp = scan.nextLine();\n temp = Normalization(temp);\n comp_first.add(temp);\n }\n }\n //reading next word of the compound\n for (File comp_word_next : com_word_next.listFiles()) {\n fin = new FileInputStream(comp_word_next);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n comp_next.add(temp);\n }\n }\n //reading chi square feature\n for (File entry : chifile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n chiunion.add(temp);\n }\n newunions.clear();\n newunions.addAll(chiunion);\n chiunion.clear();\n chiunion.addAll(newunions);\n chiunion.removeAll(stop_word_list);\n chiunion.removeAll(p_name);\n chiunion.removeAll(month);\n chiunion.removeAll(place);\n }\n //reading short form from abbrivation \n for (File short_list : abbrivation_short.listFiles()) {\n fin = new FileInputStream(short_list);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n shortform.add(temp);\n }\n }\n //reading long form from the abrivation \n for (File long_list : abbrivation_long.listFiles()) {\n fin = new FileInputStream(long_list);\n scan = new Scanner(fin);\n while (scan.hasNextLine()) {\n temp = scan.nextLine();\n temp = Normalization(temp);\n longform.add(temp);\n }\n }\n //reading file from stop word\n for (File stoplist : stop_word.listFiles()) {\n fin = new FileInputStream(stoplist);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n stop_word_list.add(temp);\n }\n }\n\n //reading person name list\n for (File per_name : person_name.listFiles()) {\n fin = new FileInputStream(per_name);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n p_name.add(temp);\n }\n }\n\n //reading intersection union\n for (File entry : interfile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n interunion.add(temp);\n }\n }\n newunions.clear();\n newunions.addAll(interunion);\n interunion.clear();\n interunion.addAll(newunions);\n interunion.removeAll(stop_word_list);\n interunion.removeAll(p_name);\n interunion.removeAll(month);\n interunion.removeAll(place);\n }\n // reading ig union\n for (File entry : igfile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n igunion.add(temp);\n }\n }\n for (String str : igunion) {\n int index = igunion.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n igunion.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(igunion);\n igunion.clear();\n igunion.addAll(newunions);\n igunion.removeAll(stop_word_list);\n igunion.removeAll(p_name);\n igunion.removeAll(month);\n igunion.removeAll(place);\n }\n //read df uinfion\n for (File entry : dffile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n dfunion.add(temp);\n }\n }\n for (String str : dfunion) {\n int index = dfunion.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n dfunion.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(dfunion);\n dfunion.clear();\n dfunion.addAll(newunions);\n dfunion.removeAll(stop_word_list);\n dfunion.removeAll(p_name);\n dfunion.removeAll(month);\n dfunion.removeAll(place);\n }\n //reading unified model\n for (File entry : unionall_3.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n union_3.add(temp);\n }\n }\n for (String str : union_3) {\n int index = union_3.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n union_3.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(union_3);\n union_3.clear();\n union_3.addAll(newunions);\n union_3.removeAll(stop_word_list);\n union_3.removeAll(p_name);\n union_3.removeAll(month);\n union_3.removeAll(place);\n }\n //unified feature for the new model\n for (File entry : unified.listFiles()) {\n\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n newunion.add(temp);\n\n }\n for (String str : newunion) {\n int index = newunion.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n newunion.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(newunion);\n newunion.clear();\n newunion.addAll(newunions);\n newunion.removeAll(stop_word_list);\n newunion.removeAll(p_name);\n newunion.removeAll(month);\n newunion.removeAll(place);\n\n // newunion.addAll(newunions);\n }\n // reading test file and predict the class\n for (File entry : test_doc.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n file_test.add(temp);\n\n }\n newunions.clear();\n newunions.addAll(file_test);\n file_test.clear();\n file_test.addAll(newunions);\n file_test.removeAll(stop_word_list);\n file_test.removeAll(p_name);\n file_test.removeAll(month);\n file_test.removeAll(place);\n }\n //reading the whole document under economy class\n for (File entry : economy.listFiles()) {\n fill = new File(economy + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n economydocument[count1] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n economydocument[count1].add(temp);\n if (temp.length() < 2) {\n economydocument[count1].remove(temp);\n }\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n economydocument[count1].remove(temp);\n }\n }\n for (String str : economydocument[count1]) {\n int index = economydocument[count1].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n economydocument[count1].set(index, stem_word.get(i));\n }\n }\n }\n }\n economydocument[count1].removeAll(stop_word_list);\n economydocument[count1].removeAll(p_name);\n economydocument[count1].removeAll(month);\n economydocument[count1].removeAll(place);\n allecofeature.addAll(economydocument[count1]);\n ecofeature.addAll(economydocument[count1]);\n allfeature.addAll(ecofeature);\n all.addAll(allecofeature);\n count1++;\n\n }\n //reading the whole documents under education category \n for (File entry : education.listFiles()) {\n fill = new File(education + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n educationdocument[count2] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n educationdocument[count2].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n educationdocument[count2].remove(temp);\n }\n }\n }\n\n for (String str : educationdocument[count2]) {\n int index = educationdocument[count2].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n educationdocument[count2].set(index, stem_word.get(i));\n }\n }\n }\n educationdocument[count2].removeAll(stop_word_list);\n educationdocument[count2].removeAll(p_name);\n educationdocument[count2].removeAll(month);\n educationdocument[count2].removeAll(place);\n alledufeature.addAll(educationdocument[count2]);\n edufeature.addAll(educationdocument[count2]);\n allfeature.addAll(edufeature);\n all.addAll(alledufeature);\n count2++;\n }\n// //reading all the documents under sport category\n for (File entry : sport.listFiles()) {\n fill = new File(sport + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n sportdocument[count3] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n sportdocument[count3].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n sportdocument[count3].remove(temp);\n }\n }\n }\n\n for (String str : sportdocument[count3]) {\n int index = sportdocument[count3].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n sportdocument[count3].set(index, stem_word.get(i));\n }\n }\n }\n sportdocument[count3].removeAll(stop_word_list);\n sportdocument[count3].removeAll(p_name);\n sportdocument[count3].removeAll(month);\n sportdocument[count3].removeAll(place);\n allspofeature.addAll(sportdocument[count3]);\n spofeature.addAll(sportdocument[count3]);\n allfeature.addAll(spofeature);\n all.addAll(allspofeature);\n count3++;\n }\n\n// //reading all the documents under culture category\n for (File entry : culture.listFiles()) {\n fill = new File(culture + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n culturedocument[count4] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n\n culturedocument[count4].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n culturedocument[count4].remove(temp);\n }\n }\n\n }\n for (String str : culturedocument[count4]) {\n int index = culturedocument[count4].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n culturedocument[count4].set(index, stem_word.get(i));\n }\n }\n }\n culturedocument[count4].removeAll(stop_word_list);\n culturedocument[count4].removeAll(p_name);\n culturedocument[count4].removeAll(month);\n culturedocument[count4].removeAll(place);\n allculfeature.addAll(culturedocument[count4]);\n culfeature.addAll(culturedocument[count4]);\n allfeature.addAll(culfeature);\n all.addAll(allculfeature);\n count4++;\n\n }\n\n// //reading all the documents under accident category\n for (File entry : accident.listFiles()) {\n fill = new File(accident + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n accedentdocument[count5] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n accedentdocument[count5].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n accedentdocument[count5].remove(temp);\n }\n }\n\n }\n\n for (String str : accedentdocument[count5]) {\n int index = accedentdocument[count5].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n accedentdocument[count5].set(index, stem_word.get(i));\n }\n }\n }\n accedentdocument[count5].removeAll(stop_word_list);\n accedentdocument[count5].removeAll(p_name);\n accedentdocument[count5].removeAll(month);\n accedentdocument[count5].removeAll(place);\n allaccfeature.addAll(accedentdocument[count5]);\n accfeature.addAll(accedentdocument[count5]);\n allfeature.addAll(accfeature);\n all.addAll(allaccfeature);\n count5++;\n }\n\n// //reading all the documents under environmental category\n for (File entry : environmntal.listFiles()) {\n fill = new File(environmntal + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n environmntaldocument[count6] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n environmntaldocument[count6].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n environmntaldocument[count6].remove(temp);\n }\n }\n }\n\n for (String str : environmntaldocument[count6]) {\n int index = environmntaldocument[count6].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n environmntaldocument[count6].set(index, stem_word.get(i));\n }\n }\n }\n environmntaldocument[count6].removeAll(stop_word_list);\n environmntaldocument[count6].removeAll(p_name);\n environmntaldocument[count6].removeAll(month);\n environmntaldocument[count6].removeAll(place);\n allenvfeature.addAll(environmntaldocument[count6]);\n envfeature.addAll(environmntaldocument[count6]);\n allfeature.addAll(envfeature);\n all.addAll(allenvfeature);\n count6++;\n }\n\n// //reading all the documents under foreign affairs category\n for (File entry : foreign_affair.listFiles()) {\n fill = new File(foreign_affair + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n foreign_affairdocument[count7] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n foreign_affairdocument[count7].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n foreign_affairdocument[count7].remove(temp);\n }\n }\n\n }\n for (String str : foreign_affairdocument[count7]) {\n int index = foreign_affairdocument[count7].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n foreign_affairdocument[count7].set(index, stem_word.get(i));\n }\n }\n }\n foreign_affairdocument[count7].removeAll(stop_word_list);\n foreign_affairdocument[count7].removeAll(p_name);\n foreign_affairdocument[count7].removeAll(month);\n foreign_affairdocument[count7].removeAll(place);\n alldepfeature.addAll(foreign_affairdocument[count7]);\n depfeature.addAll(foreign_affairdocument[count7]);\n allfeature.addAll(depfeature);\n all.addAll(alldepfeature);\n count7++;\n }\n\n// //reading all the documents under law and justices category\n for (File entry : law_justice.listFiles()) {\n fill = new File(law_justice + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n law_justicedocument[count8] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n law_justicedocument[count8].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n law_justicedocument[count8].remove(temp);\n }\n }\n\n }\n for (String str : law_justicedocument[count8]) {\n int index = law_justicedocument[count8].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n law_justicedocument[count8].set(index, stem_word.get(i));\n }\n }\n }\n law_justicedocument[count8].removeAll(stop_word_list);\n law_justicedocument[count8].removeAll(p_name);\n law_justicedocument[count8].removeAll(month);\n law_justicedocument[count8].removeAll(month);\n alllawfeature.addAll(law_justicedocument[count8]);\n lawfeature.addAll(law_justicedocument[count8]);\n allfeature.addAll(lawfeature);\n all.addAll(alllawfeature);\n count8++;\n }\n\n// //reading all the documents under other category\n for (File entry : agri.listFiles()) {\n fill = new File(agri + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n agriculture[count9] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n agriculture[count9].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n agriculture[count9].remove(temp);\n }\n }\n\n }\n for (String str : agriculture[count9]) {\n int index = agriculture[count9].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n agriculture[count9].set(index, stem_word.get(i));\n }\n }\n }\n agriculture[count9].removeAll(stop_word_list);\n agriculture[count9].removeAll(p_name);\n agriculture[count9].removeAll(month);\n agriculture[count9].removeAll(place);\n allagrifeature.addAll(agriculture[count9]);\n agrifeature.addAll(agriculture[count9]);\n allfeature.addAll(agrifeature);\n all.addAll(allagrifeature);\n count9++;\n }\n //reading all the documents under politics category\n for (File entry : politics.listFiles()) {\n fill = new File(politics + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n politicsdocument[count10] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n politicsdocument[count10].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n politicsdocument[count10].remove(temp);\n }\n }\n }\n for (String str : politicsdocument[count10]) {\n int index = politicsdocument[count10].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n politicsdocument[count10].set(index, stem_word.get(i));\n }\n }\n }\n politicsdocument[count10].removeAll(stop_word_list);\n politicsdocument[count10].removeAll(p_name);\n politicsdocument[count10].removeAll(month);\n politicsdocument[count10].removeAll(place);\n allpolfeature.addAll(politicsdocument[count10]);\n polfeature.addAll(politicsdocument[count10]);\n allfeature.addAll(polfeature);\n all.addAll(allpolfeature);\n count10++;\n }\n //reading all the documents under science and technology category\n for (File entry : science_technology.listFiles()) {\n fill = new File(science_technology + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n science_technologydocument[count12] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n science_technologydocument[count12].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n science_technologydocument[count12].remove(temp);\n }\n }\n\n }\n for (String str : science_technologydocument[count12]) {\n int index = science_technologydocument[count12].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n science_technologydocument[count12].set(index, stem_word.get(i));\n }\n }\n }\n science_technologydocument[count12].removeAll(stop_word_list);\n science_technologydocument[count12].removeAll(p_name);\n science_technologydocument[count12].removeAll(month);\n science_technologydocument[count12].removeAll(place);\n allscifeature.addAll(science_technologydocument[count12]);\n scifeature.addAll(science_technologydocument[count12]);\n allfeature.addAll(scifeature);\n all.addAll(allscifeature);\n count12++;\n\n }\n\n //reading all the documents under health category\n for (File entry : health.listFiles()) {\n fill = new File(health + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n healthdocument[count13] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n healthdocument[count13].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n healthdocument[count13].remove(temp);\n }\n }\n }\n for (String str : healthdocument[count13]) {\n int index = healthdocument[count13].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n healthdocument[count13].set(index, stem_word.get(i));\n }\n }\n }\n healthdocument[count13].removeAll(stop_word_list);\n healthdocument[count13].removeAll(p_name);\n healthdocument[count13].removeAll(month);\n healthdocument[count13].removeAll(place);\n allhelfeature.addAll(healthdocument[count13]);\n helfeature.addAll(healthdocument[count13]);\n allfeature.addAll(helfeature);\n all.addAll(allhelfeature);\n count13++;\n }\n\n //reading all the file of relgion categories \n for (File entry : army_file.listFiles()) {\n fill = new File(army_file + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n army[count14] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n army[count14].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n army[count14].remove(temp);\n }\n }\n\n }\n for (String str : army[count14]) {\n int index = army[count14].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n army[count14].set(index, stem_word.get(i));\n }\n }\n }\n army[count14].removeAll(stop_word_list);\n army[count14].removeAll(p_name);\n army[count14].removeAll(month);\n army[count14].removeAll(place);\n allarmfeature.addAll(army[count14]);\n armfeature.addAll(army[count14]);\n allfeature.addAll(armfeature);\n all.addAll(allarmfeature);\n count14++;\n }\n } catch (Exception ex) {\n System.out.println(\"here\");\n }\n }", "public void getVector() throws IOException {\n\t\tint i=1;\r\n\t\tfor(String key:keyword){\r\n\t\t\tWord w=new Word();\r\n\t\t\tdouble tf=calTF(key);\r\n\t\t\tdouble idf=calIDF(key);\r\n\t\t\tdouble tfidf=tf*idf;\r\n\t\t\tw.setId(i);\r\n\t\t\ti++;\r\n\t\t\tw.setName(key);\r\n\t\t\tw.setTfidf(tfidf);\r\n\t\t\tif(word.containsKey(key)){\r\n\t\t\t\tw.setCount((Integer) word.get(key));\r\n\t\t\t}\r\n\t\t\tkeymap.add(w);\r\n\t\t}\r\n\t\tFileHelper.writeTrainFile(keymap);\r\n\t\tFileHelper.writeTestFile(keymap);\r\n\t}", "public Map<String, Object> nextDocument() throws IOException {\n // 1. When called, this API processes one document from corpus, and returns its\n // doc number and content.\n // 2. When no document left, return null, and close the file.\n // 3. the HTML tags should be removed in document content.\n if (fileList.size() > 0) {\n Map<String, Object> r = new HashMap<>();\n File dataFile = fileList.pop();\n\n FileInputStream document = new FileInputStream(dataFile);\n byte[] context = new byte[(int) dataFile.length()];\n document.read(context);\n document.close();\n String text = new String(context, \"UTF-8\");\n char[] valueText = text.replaceAll(\"\\\\p{Cc}\", \"\")\n .replaceAll(\"<[^>]*>\", \" \").trim().toCharArray();\n r.put(dataFile.getPath(), valueText);\n return r;\n }\n\n return null;\n\n }", "private void getDictionary(){\r\n // TODO: read Dictionary\r\n try{\r\n lstDictionary.clear();\r\n for(int i = 0; i < IConfig.LABEL_COUNT; i++){\r\n lstDictionary.add(new HashMap<>());\r\n DictionaryReader dictionaryReader = new DictionaryReader(lstDictionary.get(i), IConfig.DICTIONARY_URL[i]);\r\n dictionaryReader.read();\r\n }\r\n }catch (Exception e){\r\n e.printStackTrace();\r\n }\r\n }", "public void recover(Iterator<String> uuids) throws IndexException\n {\n IndexReader reader = indexStorage.getIndexReader();\n try\n {\n final HashMap<String, Document> addedDocuments = new HashMap<String, Document>();\n final HashSet<String> removedDocuments = new HashSet<String>();\n while (uuids.hasNext())\n {\n String nodeUuid = uuids.next();\n\n GetContentEntryCommand getCommand = new GetContentEntryCommand(nodeUuid);\n final ContentEntry contentEntry = (ContentEntry)indexStorage.invokeNextInterceptor(null, getCommand);\n if (contentEntry == null)\n {\n if (indexStorage.getDocument(nodeUuid, reader) != null)\n {\n // item exist in index storage but doesn't exist in\n // persistence storage\n removedDocuments.add(nodeUuid);\n }\n }\n else\n {\n\n Document doc = nodeIndexer.createDocument(contentEntry);\n\n if (indexStorage.getDocument(nodeUuid, reader) != null)\n {\n // out dated content\n addedDocuments.put(nodeUuid, doc);\n removedDocuments.add(nodeUuid);\n }\n else\n {\n // content desn't exist\n addedDocuments.put(nodeUuid, doc);\n }\n }\n //flash if changes more when BUFFER_MAX_SIZE \n if (checkFlush(addedDocuments, removedDocuments))\n {\n flash(addedDocuments, removedDocuments);\n }\n }\n //if some changes left\n if (addedDocuments.size() + removedDocuments.size() >= 0)\n {\n indexStorage.save(new LuceneIndexTransaction(addedDocuments, removedDocuments));\n }\n }\n catch (Throwable e)\n {\n throw new IndexException(e.getLocalizedMessage(), e);\n }\n }", "static void loadDictionary() throws IOException {\r\n URL oracle = new URL(urlEndPoint);\r\n BufferedReader br = new BufferedReader(new InputStreamReader(oracle.openStream()));\r\n\r\n String st;\r\n while ((st = br.readLine()) != null) {\r\n localDictionary.add(st);\r\n }\r\n }", "public List<Section> processDocument(String path) throws FileNotFoundException {\n\t\tList<Section> finalSections = new ArrayList<Section>();\r\n\t\t// Load file to process...\r\n\t\tInputStream input = new FileInputStream(\r\n\t\t\t\tpath.replace(\"\\\\\", \"/\").substring(1, path.replace(\"\\\\\", \"/\").length() - 1));\r\n\t\tFile file = new File(path);\r\n\t\ttry {\r\n\t\t\t// Use PdfBox library to load PDF Stream with their geometric descriptors...\r\n\t\t\tPDDocument doc = PDDocument.load(input);\r\n\t\t\tDocument resultDoc = new Document();\r\n\t\t\t// Create maps to hold fonts used in the processed document .\r\n\t\t\tfinal Map<Object, Integer> fonts = new HashMap<Object, Integer>();\r\n\t\t\tfinal Map<Integer, Font> idToFont = new HashMap<Integer, Font>();\r\n\t\t\t// If the document have multiple pages, manages the segmentation page by page...\r\n\t\t\tfor (int i = 0; i < doc.getNumberOfPages(); i++) {\r\n\t\t\t\tPDPage page = (PDPage) doc.getDocumentCatalog().getAllPages().get(i);\r\n\t\t\t\t// Set up pdf page object.\r\n\t\t\t\tPage pdfPage = new Page();\r\n\t\t\t\tpdfPage.setPageRotation(page.findRotation());\r\n\t\t\t\tpdfPage.setPageWidth(page.findMediaBox().getWidth());\r\n\t\t\t\tpdfPage.setPageHeight(page.findMediaBox().getHeight());\r\n\t\t\t\tpdfPage.setOffsetUpperRightX(\r\n\t\t\t\t\t\tpage.findMediaBox().getUpperRightX() - page.findCropBox().getUpperRightX());\r\n\t\t\t\tpdfPage.setOffsetUpperRightY(\r\n\t\t\t\t\t\tpage.findMediaBox().getUpperRightY() - page.findCropBox().getUpperRightY());\r\n\t\t\t\tpdfPage.setNumber(i);\r\n\t\t\t\t// Extracting textual content of each page.\r\n\t\t\t\tPDStream contents = page.getContents();\r\n\t\t\t\tif (contents != null) {\r\n\t\t\t\t\tif (true) {\r\n\t\t\t\t\t\tTextExtractor extractor = new TextExtractor(pdfPage, idToFont, fonts);\r\n\t\t\t\t\t\textractor.processStream(page, page.findResources(), contents.getStream());\r\n\t\t\t\t\t\tpdfPage.setLines(extractor.getLines());\r\n\t\t\t\t\t\textractor.getTextMatrix();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Add pages decorated by geometric descriptors to the doc to segment ...\r\n\t\t\t\tresultDoc.getPages().add(pdfPage);\r\n\t\t\t\tfor (Entry<Integer, Font> e : idToFont.entrySet()) {\r\n\t\t\t\t\tresultDoc.getFonts().add(e.getValue());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Process extracting document Sections...\r\n\t\t\tPdfBlockExtractor pdfExtractor = new PdfBlockExtractor();\r\n\t\t\tList<Block> extractedBlocks = pdfExtractor.extractBlocks(resultDoc,\r\n\t\t\t\t\tpath.split(File.separator + File.separator)[1]);\r\n\r\n\t\t\t// Generating final result....\r\n\t\t\tgenerateFinalSegmentationResults(finalSections, extractedBlocks);\r\n\r\n\t\t\tdoc.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn finalSections;\r\n\t}", "public void readEntries() throws FileAccessException;", "static TarReader open(Map<Character, File> files, boolean memoryMapping)\n throws IOException {\n SortedMap<Character, File> sorted = newTreeMap();\n sorted.putAll(files);\n\n List<File> list = newArrayList(sorted.values());\n Collections.reverse(list);\n\n TarReader reader = openFirstFileWithValidIndex(list, memoryMapping);\n if (reader != null) {\n return reader;\n }\n\n // no generation has a valid index, so recover as much as we can\n log.warn(\"Could not find a valid tar index in {}, recovering...\", list);\n LinkedHashMap<UUID, byte[]> entries = newLinkedHashMap();\n for (File file : sorted.values()) {\n log.info(\"Recovering segments from tar file {}\", file);\n try {\n RandomAccessFile access = new RandomAccessFile(file, \"r\");\n try {\n recoverEntries(file, access, entries);\n } finally {\n access.close();\n }\n } catch (IOException e) {\n log.warn(\"Could not read tar file \" + file + \", skipping...\", e);\n }\n\n backupSafely(file);\n }\n\n // regenerate the first generation based on the recovered data\n File file = sorted.values().iterator().next();\n log.info(\"Regenerating tar file \" + file);\n TarWriter writer = new TarWriter(file);\n for (Map.Entry<UUID, byte[]> entry : entries.entrySet()) {\n UUID uuid = entry.getKey();\n byte[] data = entry.getValue();\n writer.writeEntry(\n uuid.getMostSignificantBits(),\n uuid.getLeastSignificantBits(),\n data, 0, data.length);\n }\n writer.close();\n\n reader = openFirstFileWithValidIndex(singletonList(file), memoryMapping);\n if (reader != null) {\n return reader;\n } else {\n throw new IOException(\"Failed to open recoved tar file \" + file);\n }\n }", "private void loadNonDictionaryTerms(String filePathNonDictionaryAuto) throws IOException {\n File fileAnnotation = new File(filePathNonDictionaryAuto);\n if (!fileAnnotation.exists()) {\n fileAnnotation.createNewFile();\n }\n FileReader fr;\n fr = new FileReader(fileAnnotation);\n BufferedReader br = new BufferedReader(fr);\n String line;\n while ((line = br.readLine()) != null) {\n\n nonDictionaryTerms.add(line.trim().toLowerCase());\n System.out.println(\"Loading Non Dictionary Terms: \" + line);\n }\n br.close();\n fr.close();\n System.out.println(\"Non Dictionary Terms Loaded\");\n }", "private void loadDocStatFromFile(String path) {\n docStat = new HashMap<String, Integer>();\n List<String> stats = fu.textFileToList(path);\n int totLength = 0;\n for (String stat : stats) {\n String docID = stat.split(\" \")[0];\n int docLen = Integer.parseInt(stat.split(\" \")[1]);\n totLength += docLen;\n docStat.put(docID, docLen);\n }\n avdl = totLength / N;\n }", "public void fetchAllTermsAndCalculateMinHash()\r\n\t{\r\n\t\tint a,b,prime,termGUI;\r\n\t\tRandom random = new Random();\r\n\t\ttermGUI = unionAll.size();\r\n\t\tminHash = new int[numPermutations][docarray.length];\r\n\t\tint[] minHashSignatureArray;\r\n\t\tfor (int j = 0; j < docarray.length; j++)\r\n\t\t{\r\n\t\t\tHashSet<String> terms = buildsetofterms(folderName + File.separator + docarray[j]);\r\n\t\t\tArrayList<Integer> indexList = new ArrayList<Integer>();\r\n\t\t\tfor (String term : terms) \r\n\t\t\t{\r\n\t\t\t\tif (unionAll.containsKey(term))\r\n\t\t\t\t{\r\n\t\t\t\t\tint indexVal = (int) unionAll.get(term);\r\n\t\t\t\t\tindexList.add(indexVal);\r\n\r\n\t\t\t\t} \r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\tunionAll.put(term, termGUI);\r\n\t\t\t\t\tindexList.add(termGUI);\r\n\t\t\t\t\ttermGUI++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tint[] termMappingArray = new int[indexList.size()];\r\n\t\t\tfor (int i = 0; i < indexList.size(); i++) {\r\n\t\t\t\ttermMappingArray[i] = indexList.get(i);\r\n\t\t\t}\r\n\t\t\tthis.fileTermsIntegerMapping.put(docarray[j], termMappingArray);\r\n\t\t}\r\n\r\n//Applying Permutation and finding value permutation values for terms in all the documents\r\n\t\tprime = Prime.prime(unionAll.size());\r\n\t\thashFunctions = new int[numPermutations][unionAll.size()];\r\n\t\tfor (int i = 0; i < numPermutations; i++) \r\n\t\t{\r\n\t\t\ta = random.nextInt(prime)+0;\r\n\t\t\tb = random.nextInt(prime)+0;\r\n\t\t\tfor (int j = 0; j < unionAll.size(); j++) \r\n\t\t\t{\r\n\t\t\t\thashFunctions[i][j] = ((a * j) + b) % prime;\r\n\t\t\t}\r\n\t\t}\r\n// Calling MinHashSig method to calculate Min hash values for all the permutations on all the documents \t\t\r\n\t\tfor (int j = 0; j < docarray.length; j++) {\r\n\t\t\tString fileName = docarray[j];\r\n\t\t\tminHashSignatureArray = minHashSig(fileName);\r\n\t\t\tfor (int i = 0; i < numPermutations; i++) {\r\n\t\t\t\tminHash[i][j] = minHashSignatureArray[i];\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void recoverINodes()\n {\n Map<String, DFSNode.SerializedDFSNode> serInodeMap = new HashMap<>();\n try (BufferedReader reader = new BufferedReader(new FileReader(dfsNodeFile)))\n {\n String line;\n while((line=reader.readLine())!=null)\n {\n DFSNode.SerializedDFSNode serializedINode = (DFSNode.SerializedDFSNode) JSONUtil.fromJSON(line, DFSNode.SerializedDFSNode.class);\n DFSNode inode = new DFSNode();\n inode.fqpn = serializedINode.fqpn;\n inode.dataBlockMetas = serializedINode.dataBlockMeta;\n inode.dirOrFile= serializedINode.dirOrFile;\n inodeMap.put(inode.fqpn,inode);\n\n\n serInodeMap.put(serializedINode.fqpn,serializedINode);\n if (NumberUtils.isCreatable(inode.fqpn))\n fileNodeCounter = Math.max(fileNodeCounter,Integer.valueOf(inode.fqpn));\n\n /* if (inode.dataBlockMetas!=null) {\n\n DFSDataBlockMeta meta = inode.dataBlockMetas.get(inode.dataBlockMetas.size()-1);\n\n meta.fileSystem = resolve(meta.fileSystemName);\n\n }*/\n\n\n }\n } catch (Exception ex) {\n ex.printStackTrace();}\n\n\n inodeMap.values().stream().forEach(inode->{\n\n DFSNode.SerializedDFSNode serializedINode = serInodeMap.get(inode.fqpn);\n\n // inode.next = inodeMap.get(serializedINode.nextNodeName);\n\n if (serializedINode.getNodeNames()!=null) {\n List<DFSNode> nodes = serializedINode.getNodeNames().stream().map(name -> {\n return inodeMap.get(name) ;\n }).collect(Collectors.toList());\n\n inode.setNodes(nodes);\n }\n });\n\n }", "LuceneMemoryIndex createLuceneMemoryIndex();", "@Override\n public HashMap initFileSet()\n {\n return null;\n }", "private void fetchPart(int i,int start, int step){\n //Commented for Server compile \n String currentFile = this.XmlFolderPath + \"\\\\\" + db + (fileCount++) + \".\" + this.retFormat;\n //Uncommented for Server compile \n // String currentFile = this.XmlFolderPath + \"/\" + db + (fileCount++) + \".xml\";\n\n // Log printing\n if(debugMode) {\n System.out.println(\" \" + new Date().toString() + \" \" + db + \" Fetch > Fetching articles \" \n + start + \" to \" + ( start + step )\n + \" \\n\\t writing to : \" + currentFile);\n }\n try {\n //write here response from Pubmed\n writer = new BufferedWriter(new FileWriter(currentFile));\n \n //assemble the esearch URL\n String base = \"https://eutils.ncbi.nlm.nih.gov/entrez/eutils/\";\n\n String url = base + \"efetch.fcgi?db=\"+db+\"&query_key=\" + queryKeys.get(i)\n + \"&WebEnv=\" + webEnvs.get(i) + \"&usehistory=y&rettype=\" + retFormat + \"&retmode=\" + retFormat\n + \"&retstart=\" + start + \"&retmax=\" + step;\n // Log printing\n if(debugMode) {\n System.out.println(\" \" + db + \" Search > Fetch url : \" + url);\n }\n \n // send GET request\n RequestConfig globalConfig = RequestConfig.custom().setCookieSpec(CookieSpecs.IGNORE_COOKIES).build();\n CloseableHttpClient client = HttpClients.custom().setDefaultRequestConfig(globalConfig).build();\n\n HttpGet request = new HttpGet(url);\n request.addHeader(base, base);\n\n HttpResponse response;\n response = client.execute(request);\n BufferedReader rd = new BufferedReader( new InputStreamReader(response.getEntity().getContent()));\n StringBuffer result = new StringBuffer();\n String line = \"\";\n\n while ((line = rd.readLine()) != null) {\n writer.append(line);\n writer.newLine();\n }\n \n writer.flush();\n writer.close(); \n } catch (IOException ex) {\n // Log printing\n if(debugMode) {\n System.out.println(\" \" + new Date().toString() + \" \" + db + \" Fetch > IO Exception \" + ex.getMessage());\n }\n } \n }", "private void initializeKeysAndData(final IndexedDiskCacheAttributes cattr) throws IOException\r\n {\r\n this.dataFile = new IndexedDisk(new File(rafDir, fileName + \".data\"), getElementSerializer());\r\n this.keyFile = new IndexedDisk(new File(rafDir, fileName + \".key\"), getElementSerializer());\r\n\r\n if (cattr.isClearDiskOnStartup())\r\n {\r\n log.info(\"{0}: ClearDiskOnStartup is set to true. Ignoring any persisted data.\",\r\n logCacheName);\r\n initializeEmptyStore();\r\n }\r\n else if (!keyFile.isEmpty())\r\n {\r\n // If the key file has contents, try to initialize the keys\r\n // from it. In no keys are loaded reset the data file.\r\n initializeStoreFromPersistedData();\r\n }\r\n else\r\n {\r\n // Otherwise start with a new empty map for the keys, and reset\r\n // the data file if it has contents.\r\n initializeEmptyStore();\r\n }\r\n }", "private void computeLocalKB(){\n\t\tfor (String s : contextsSet) {\n\t\t\t//System.out.println(s);\n\t\t\t\n\t\t\tOWLOntology contextOntology = null;\n\t\t\ttry {\n\t\t\t\tcontextOntology = manager.createOntology();\n\t\t\t\t\n\t\t\t\tfor(String[] a : hasModuleAssociations){\n\t\t\t\t\tif(a[0].equals(s)){\n\t\t\t\t\t\t//System.out.println(\" -> \" + a[1]);\n\t\t\t\t\t\n\t\t\t\t\t\t//Check that to each module name a local ontology exists!\n\t\t\t\t\t\t//int moduleIndex = inputCKR.getLocalOntologyName().indexOf(a[1]);\n\t\t\t\t\t\tCKRModule mod = inputCKR.getLocalModule(a[1]);\n\t\t\t\t\t\n\t\t\t\t\t\tif (mod == null) {\n\t\t\t\t\t\t\tSystem.err.println(\"[!] Warning: no ontology associated to module \" + a[1]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmanager.addAxioms(contextOntology, \n\t\t\t\t\t\t\t\t\t//inputCKR.getLocalOntology().get(moduleIndex).getAxioms()\n\t\t\t\t\t\t\t\t\tmod.getModuleOntology().getAxioms());\n\t\t\t\t\t\t\t//System.out.println(\"Module \" + a[1] + \" added to \" + a[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//***DO NOT*** Add axioms from global ontology.\n\t\t\t\t//manager.addAxioms(contextOntology, inputCKR.getGlobalOntology().getAxioms());\n\t\t\t} catch (OWLOntologyCreationException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} \n\t\t\t//if ((contextOntology == null) || (contextOntology.isEmpty()))\n\t\t\t//System.out.println(\"Warning: ontology for \" + s + \" is empty.\");\n\t\t\t\n\t\t\tcontextsOntologies.put(s, contextOntology);\n\t\t}\n\t}", "public void convert() throws Exception\r\n\t{\n\t\tString query = \"SELECT r_object_id FROM m_mrcs_efs_central_document WHERE r_current_state = 4 OR r_current_state = 6\"; \r\n\t\t\r\n\t\tIDfSession session = null;\r\n\t\tIDfSessionManager sMgr = null;\r\n\t\ttry {\r\n\t IDfClientX clientx = new DfClientX();\r\n\r\n\t \tIDfClient client = clientx.getLocalClient();\r\n\r\n\t \tsMgr = client.newSessionManager();\r\n\r\n\t \tIDfLoginInfo loginInfoObj = clientx.getLoginInfo();\r\n\t loginInfoObj.setUser(\"mradmin\");\r\n\t loginInfoObj.setPassword(\"mr2006\");\r\n\t loginInfoObj.setDomain(null);\r\n\r\n\t sMgr.setIdentity(\"MRCS_Dev\", loginInfoObj);\r\n }\r\n catch (DfException dfe){\r\n \tdfe.printStackTrace();\r\n }\t\t\r\n /*-DEBUG-*/if (DfLogger.isDebugEnabled(this))DfLogger.debug(this, \" \", null, null);\r\n\t\t\r\n\t\t// get list of objects that are pdfs...\r\n\t\t\r\n IDfQuery qry = new DfQuery();\r\n qry.setDQL(query);\r\n\r\n IDfCollection myObj1 = (IDfCollection) qry.execute(session, IDfQuery.DF_READ_QUERY);\r\n \r\n IDfTypedObject serverConfig = session.getServerConfig();\r\n String aclDomain = serverConfig.getString(\"operator_name\");\r\n\t\tIDfACL obsoleteacl = session.getACL(aclDomain,\"mrcs_central_archived\");\r\n\t\tIDfACL retiredacl = session.getACL(aclDomain,\"mrcs_central_retired_doc\");\r\n\r\n\r\n while (myObj1.next()) \r\n {\r\n \tString curid = myObj1.getString(\"r_object_id\");\r\n \t\t// look up object\r\n \t\tIDfDocument doc = (IDfDocument)session.getObject(new DfId(curid));\r\n \t\t\r\n \t\t// check that it's not a popped off copy (i_folder_id[0] != 'Approved') seems to be the only indicator of this...\r\n \t\tIDfFolder folder = (IDfFolder)session.getObject(doc.getFolderId(0));\r\n \t\tString foldername = folder.getObjectName();\r\n \t\t\r\n \t\t// don't do this for approved copies...\r\n \t\tif (!\"Approved\".equals(foldername))\r\n \t\t{\r\n\t \t\t\r\n\t \t\t// check it's state\r\n\t \t\tString statename = doc.getCurrentStateName();\r\n\t \t\tString chronicleid = doc.getChronicleId().getId();\r\n\t \t\t// if In-Progress: simply switch the content type\r\n\t \t\tif (\"Obsolete\".equals(statename))\r\n\t \t\t{\r\n\t \t\t\tString previousquery = \"SELECT r_object_id FROM dm_document(all) where i_chronicle_id = '\"+chronicleid+\"'\";\r\n\t \t IDfQuery prevqry = new DfQuery();\r\n\t \t prevqry.setDQL(query);\r\n\t \t IDfCollection previousversions = (IDfCollection) qry.execute(session, IDfQuery.DF_READ_QUERY);\r\n\t \t while (previousversions.next()) \r\n\t \t {\r\n\t \t \t\r\n\t \t \tString previd = previousversions.getString(\"r_object_id\");\r\n\t \t \t\t// look up object\r\n\t \t \t\tIDfDocument prevdoc = (IDfDocument)session.getObject(new DfId(previd));\r\n\t \t \t\t//unlock \r\n\t \t \t\tsMgr.beginTransaction();\r\n\t \t \t\ttry { \r\n\t\t \t prevdoc.setString(\"r_immutable_flag\", \"FALSE\");\r\n\t\t \t prevdoc.save();\r\n\t\t \t \r\n\t\t \t prevdoc.fetch(prevdoc.getTypeName()); // necessary?\t \t \t\t\r\n\t\t\t \t\t\t// set flags obsolete = true,retired = false\r\n\t\t \t \t\tprevdoc.setBoolean(\"retired\",false);\r\n\t\t \t \t\tprevdoc.setBoolean(\"obsolete\",true);\r\n\t\t\t \t\t\t// set acl\r\n\t\t \t \t\tprevdoc.setACL(obsoleteacl);\r\n\t\t \t prevdoc.setString(\"r_immutable_flag\", \"TRUE\");\r\n\t\t \t \t\tprevdoc.save();\r\n\t \t \t\t} catch (Exception e) {\r\n\t \t \t\t\tsMgr.abortTransaction();\r\n\t \t \t\t\tthrow e;\r\n\t \t \t\t}\r\n\t \t \t\tsMgr.commitTransaction();\r\n\t \t }\r\n\t \t previousversions.close();\r\n\t \t\t}\r\n\t \t\t\r\n\t \t\tif (\"Effective\".equals(statename))\r\n\t \t\t{\r\n\t \t\t\tString previousquery = \"SELECT r_object_id FROM dm_document(all) where i_chronicle_id = '\"+chronicleid+\"'\";\r\n\t \t IDfQuery prevqry = new DfQuery();\r\n\t \t prevqry.setDQL(query);\r\n\t \t IDfCollection previousversions = (IDfCollection) qry.execute(session, IDfQuery.DF_READ_QUERY);\r\n\t \t while (previousversions.next()) \r\n\t \t {\r\n\t \t \t\r\n\t \t \tString previd = previousversions.getString(\"r_object_id\");\r\n\t \t \t\t// look up object\r\n\t \t \t\tIDfDocument prevdoc = (IDfDocument)session.getObject(new DfId(previd));\r\n\t \t \t\t//unlock \r\n\t \t \t\tString currentstate = prevdoc.getCurrentStateName();\r\n\t \t \t\tif (\"Retired\".equals(currentstate))\r\n\t \t \t\t{\r\n\t\t \t \t\tsMgr.beginTransaction();\r\n\t\t \t \t\ttry { \t \t \t\t\t\r\n\t\t\t \t prevdoc.setString(\"r_immutable_flag\", \"FALSE\");\r\n\t\t\t \t prevdoc.save();\r\n\t\t\t \t prevdoc.fetch(prevdoc.getTypeName()); // necessary?\t \t \t\t\r\n\t\t\t\t \t\t\t// set flags obsolete = true,retired = false\r\n\t\t\t \t \t\tprevdoc.setBoolean(\"retired\",true);\r\n\t\t\t \t \t\tprevdoc.setBoolean(\"obsolete\",false);\r\n\t\t\t\t \t\t\t// set acl\r\n\t\t\t \t \t\tprevdoc.setACL(retiredacl);\r\n\t\t\t \t prevdoc.setString(\"r_immutable_flag\", \"TRUE\");\r\n\t\t\t \t \t\tprevdoc.save();\r\n\t\t \t \t\t} catch (Exception e) {\r\n\t\t \t \t\t\tsMgr.abortTransaction();\r\n\t\t \t \t\t\tthrow e;\r\n\t\t \t \t\t}\r\n\t\t \t \t\tsMgr.commitTransaction();\r\n\t \t \t\t}\r\n\t \t }\r\n\t \t previousversions.close();\r\n\t \t\t}\r\n\t \t\t\r\n \t\t}\r\n }\r\n myObj1.close();\r\n \r\n sMgr.release(session);\r\n\t}", "protected void loadFeatureValues(String reposFilename){\n\t\trepos = new THashMap<String, TIntObjectHashMap<TIntDoubleHashMap>>();\n\t\tqidFeatureSpaceSizeMap = new TObjectIntHashMap<String>();\n\t\ttry{\n\t\t\tBufferedReader br = Files.openFileReader(reposFilename);\n\t\t\tString line = null;\n\t\t\twhile ((line=br.readLine())!=null){\n\t\t\t\tString[] segments = line.split(\":\");\n\t\t\t\tif (segments.length<2)\n\t\t\t\t\tcontinue;\n\t\t\t\tString[] tokens = segments[0].trim().split(\" \");\n\t\t\t\tif (tokens.length>2)\n\t\t\t\t\tcontinue;\n\t\t\t\tString qid = tokens[0]; int docid = Integer.parseInt(tokens[1]);\n\t\t\t\tif (!repos.containsKey(qid))\n\t\t\t\t\trepos.put(qid, new TIntObjectHashMap<TIntDoubleHashMap>());\n\t\t\t\tTIntObjectHashMap<TIntDoubleHashMap> qFeatures = repos.get(qid);\n\t\t\t\tif (!qFeatures.containsKey(docid))\n\t\t\t\t\tqFeatures.put(docid, new TIntDoubleHashMap());\n\t\t\t\tTIntDoubleHashMap map = qFeatures.get(docid);\n\t\t\t\tTObjectDoubleHashMap<String> termWeightMap = null;\n\t\t\t\ttry{\n\t\t\t\t\ttermWeightMap = SingleLineTRECQuery.parseQueryStringWithWeights(segments[1]);\n\t\t\t\t}catch(ArrayIndexOutOfBoundsException e){\n\t\t\t\t\tlogger.debug(line);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tSystem.exit(1);\n\t\t\t\t}\n\t\t\t\tString[] terms = termWeightMap.keys(new String[termWeightMap.size()]);\n\t\t\t\tfor (String term : terms){\n\t\t\t\t\tmap.put(Integer.parseInt(term), termWeightMap.get(term));\n\t\t\t\t}\n\t\t\t\tterms = null; termWeightMap.clear(); termWeightMap=null;\n\t\t\t}\n\t\t\tbr.close();\n\t\t}catch(IOException ioe){\n\t\t\tioe.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tString[] qids = (String[])repos.keySet().toArray(new String[repos.keySet().size()]);\n\t\tfor (String qid : qids){\n\t\t\tthis.termFeatureMapping(qid, repos.get(qid));\n\t\t}\n\t}", "public Map<String, String> NextDocument() throws IOException {\n\t\tMap<String, String> oneDoc = new HashMap<String, String>();\n\t\tString docId = \"\";\n\t\tString docTxt = \"\";\n\t\tif ((docId = bf_Reader.readLine())!=null){\n\t\t\tdocTxt = bf_Reader.readLine();\n\t\t\toneDoc.put(docId,docTxt); //put docNo-content pairs into map\n\t\t\treturn oneDoc;\n\t\t}\n\n\t\tbf_Reader.close();\n\n\t\treturn null;\n\t}", "private void invertedToDatabase(){\r\n cleFreq = new HashMap<>();\r\n System.out.println(\"Strat collecting\");\r\n Map<String,List<Invertedindex>> collects = collecting();\r\n System.out.println(\"Ending collecting\");\r\n Database.getInstance().invertedIndex(collects);\r\n Database.getInstance().addPoids(cleFreq);\r\n }", "private int setDocMaps() throws IOException {\n final int numReaders = mergeState.readers.size();\n\n // Remap docIDs\n mergeState.docMaps = new MergeState.DocMap[numReaders];\n mergeState.docBase = new int[numReaders];\n\n int docBase = 0;\n\n int i = 0;\n while (i < mergeState.readers.size()) {\n\n final AtomicReader reader = mergeState.readers.get(i);\n\n mergeState.docBase[i] = docBase;\n final MergeState.DocMap docMap = MergeState.DocMap.build(reader);\n mergeState.docMaps[i] = docMap;\n docBase += docMap.numDocs();\n\n i++;\n }\n\n return docBase;\n }", "private void loadWords(Future<Void> future) {\n if (wordsLocation == null || ! wordsLocation.exists() ) {\n future.fail(\"wordsLocation[\" + wordsLocation + \"] does not exist\");\n return;\n }\n\n try (InputStream wis = wordsLocation.getInputStream();\n InputStreamReader isr = new InputStreamReader(wis);\n BufferedReader br = new BufferedReader(isr)) {\n\n String word;\n int wc = 0;\n while ((word = br.readLine()) != null) {\n LOG.debug(\"adding \" + word + \"to WordFinder\");\n wordFinder.add(word);\n wc++;\n }\n\n LOG.info(\"Loaded \" + wc + \" words into WordFinder\");\n\n future.complete();\n } catch (IOException e) {\n String msg = \"an error occurred while trying to read the words\";\n LOG.warn(msg, e);\n future.fail(e);\n }\n }", "public Facts() {\n\t\t\n\t\t// Allocate memory for tips and tCellFacts variables\n\t\ttips = new ArrayList<String>();\n\t\ttCellFacts = new HashMap<Integer,String>();\n\t\t\n\t\t// Calls the method that locates the resource locations for\n\t\t// tips.txt and facts.txt\n\t\tlocateResources();\n\t\t\t\n\t\t// Calls the method that reads the files\n\t\treadFiles();\n\t\t\n\t}", "private void retrieveNewMetadata() {\n\n Runnable loadProviders = new Runnable() {\n @Override\n public void run() {\n getAvailableDataProviders();\n }\n };\n\n Runnable loadDataSets = new Runnable() {\n @Override\n public void run() {\n getAvailableDataSets();\n }\n };\n\n Runnable loadParameters = new Runnable() {\n @Override\n public void run() {\n getAvailableParameters();\n }\n };\n\n Runnable loadLevels = new Runnable() {\n @Override\n public void run() {\n getAvailableLevels();\n }\n };\n\n Runnable[] runnables = new Runnable[] { loadProviders, loadDataSets,\n loadParameters, loadLevels };\n FutureTask<?>[] tasks = new FutureTask[runnables.length];\n ExecutorService executor = Executors\n .newFixedThreadPool(runnables.length);\n for (int i = 0; i < runnables.length; i++) {\n FutureTask<Void> task = new FutureTask<Void>(runnables[i], null);\n tasks[i] = task;\n executor.submit(task);\n }\n\n for (FutureTask<?> task : tasks) {\n try {\n task.get();\n } catch (Exception e) {\n statusHandler.handle(Priority.WARN, \"Unable to load metadata\",\n e);\n }\n }\n }", "public void finishedDirectIndexBuild()\n\t{\n\t\tif(logger.isInfoEnabled()){\n\t\t\tlogger.info(\"flushing utf block lexicon to disk after the direct index completed\");\n\t\t}\n\t\t//only write a temporary lexicon if there are any items in it\n\t\tif (TempLex.getNumberOfNodes() > 0)\n\t\t\twriteTemporaryLexicon();\n\n\t\t//merges the temporary lexicons\n\t\tif (tempLexFiles.size() > 0)\n\t\t{\n\t\t\ttry{\n\t\t\t\tmerge(tempLexFiles);\n\t\n\t\t\t\t//creates the offsets file\n\t\t\t\tfinal String lexiconFilename = \n\t\t\t\t\tindexPath + ApplicationSetup.FILE_SEPARATOR + \n\t\t\t\t\tindexPrefix + ApplicationSetup.LEXICONSUFFIX;\n\t\t\t\tLexiconInputStream lis = getLexInputStream(lexiconFilename);\n\t\t\t\tcreateLexiconIndex(\n\t\t\t\t\tlis,\n\t\t\t\t\tlis.numberOfEntries(),\n\t\t\t\t\t/* after inverted index is built, the lexicon will be transformed into a\n\t\t\t\t\t * normal lexicon, without block frequency */\n\t\t\t\t\tUTFLexicon.lexiconEntryLength\n\t\t\t\t\t); \n\t\t\t\tTermCount = lis.numberOfEntries();\n\t\t\t\tif (index != null)\n\t\t\t\t{\n\t\t\t\t\tindex.addIndexStructure(\"lexicon\", \"uk.ac.gla.terrier.structures.UTFBlockLexicon\");\n\t\t\t\t\tindex.addIndexStructureInputStream(\"lexicon\", \"uk.ac.gla.terrier.structures.UTFBlockLexiconInputStream\");\n\t\t\t\t\tindex.setIndexProperty(\"num.Terms\", \"\"+lis.numberOfEntries());\n\t\t\t\t\tindex.setIndexProperty(\"num.Pointers\", \"\"+lis.getNumberOfPointersRead());\n\t\t\t\t}\n\t\t\t} catch(IOException ioe){\n\t\t\t\tlogger.error(\"Indexing failed to write a lexicon index file to disk\", ioe);\n\t\t\t}\t\n\t\t}\n\t\telse\n\t\t\tlogger.warn(\"No temporary lexicons to merge, skipping\");\n\t\t\n\t}", "private static byte[] m2539e(Context context) {\n Throwable th;\n int i = 0;\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n byte[] bArr = new byte[0];\n String a = Log.m2547a(context, Log.f1857e);\n DiskLruCache diskLruCache = null;\n try {\n diskLruCache = DiskLruCache.m2767a(new File(a), 1, 1, 10240);\n File file = new File(a);\n if (file != null && file.exists()) {\n String[] list = file.list();\n int length = list.length;\n while (i < length) {\n String str = list[i];\n if (str.contains(\".0\")) {\n byteArrayOutputStream.write(StatisticsManager.m2535a(diskLruCache, str.split(\"\\\\.\")[0]));\n }\n i++;\n }\n }\n bArr = byteArrayOutputStream.toByteArray();\n if (byteArrayOutputStream != null) {\n try {\n byteArrayOutputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if (diskLruCache != null) {\n try {\n diskLruCache.close();\n } catch (Throwable th2) {\n th = th2;\n }\n }\n } catch (IOException th3) {\n BasicLogHandler.m2542a(th3, \"StatisticsManager\", \"getContent\");\n if (byteArrayOutputStream != null) {\n try {\n byteArrayOutputStream.close();\n } catch (IOException e2) {\n e2.printStackTrace();\n }\n }\n if (diskLruCache != null) {\n diskLruCache.close();\n }\n } catch (Throwable th4) {\n th3 = th4;\n }\n return bArr;\n th3.printStackTrace();\n return bArr;\n }", "private final void loadDictionary(String path, long startOffset, long length) {\n \tLog.e(TAG, \"loadDictionary: path=\" + path);\n mNativeDict = openNative(path, startOffset, length, TYPED_LETTER_MULTIPLIER,\n FULL_WORD_SCORE_MULTIPLIER, MAX_WORD_LENGTH, MAX_WORDS, MAX_PREDICTIONS);\n }", "abstract public TermDocs termDocs(Term t) throws IOException;", "public SharedMemory infos();", "@Override\n protected void cleanup(Context context) throws IOException, InterruptedException {\n logger.info(\"Cleanup\");\n super.cleanup(context);\n for (java.util.Map.Entry<String, FullImageMetadata> entry : indexer.getEntries().entrySet()) {\n String surt = entry.getKey();\n context.write(new Text(surt), entry.getValue());\n }\n }", "public List<String> getFileLines() {\n\t\tspeciesByExperiment = new TIntObjectHashMap<List<String>>();\n\t\ttissuesByExperiment = new TIntObjectHashMap<List<String>>();\n\t\tcellTypesByExperiment = new TIntObjectHashMap<List<String>>();\n\t\tdiseaseByExperiment = new TIntObjectHashMap<List<String>>();\n\t\tquantificationByExperiment = new TIntObjectHashMap<List<String>>();\n\t\tinstrumentByExperiment = new TIntObjectHashMap<List<String>>();\n\t\tmodificationByExperiment = new TIntObjectHashMap<List<String>>();\n\t\texperimental_factorByExperiment = new TIntObjectHashMap<List<String>>();\n\n\t\tfinal List<String> ret = new ArrayList<String>();\n\t\tfinal Map<String, PexFileMapping> fileLocationsMapping = new THashMap<String, PexFileMapping>();\n\t\tfinal List<PexFileMapping> totalFileList = new ArrayList<PexFileMapping>();\n\t\tint fileCounter = 1;\n\t\t// organize the files by experiments\n\t\tfor (final Experiment experiment : experimentList.getExperiments()) {\n\n\t\t\tfinal File prideXmlFile = experiment.getPrideXMLFile();\n\t\t\tif (prideXmlFile != null) {\n\t\t\t\t// FILEMAPPINGS\n\t\t\t\t// PRIDE XML\n\t\t\t\tfinal int resultNum = fileCounter;\n\t\t\t\tfinal PexFileMapping prideXMLFileMapping = new PexFileMapping(\"result\", fileCounter++,\n\t\t\t\t\t\tprideXmlFile.getAbsolutePath(), null);\n\n\t\t\t\ttotalFileList.add(prideXMLFileMapping);\n\t\t\t\tfileLocationsMapping.put(prideXMLFileMapping.getPath(), prideXMLFileMapping);\n\n\t\t\t\t// Iterate over replicates\n\t\t\t\tfinal List<Replicate> replicates = experiment.getReplicates();\n\t\t\t\tfor (final Replicate replicate : replicates) {\n\t\t\t\t\t// sample metadatas\n\t\t\t\t\taddSampleMetadatas(resultNum, replicate);\n\n\t\t\t\t\t// PEak lists\n\t\t\t\t\tfinal List<PexFileMapping> peakListFileMappings = new ArrayList<PexFileMapping>();\n\t\t\t\t\t// raw files\n\t\t\t\t\tfinal List<PexFileMapping> rawFileMappings = new ArrayList<PexFileMapping>();\n\t\t\t\t\t// search engine output lists\n\t\t\t\t\tfinal List<PexFileMapping> outputSearchEngineFileMappings = new ArrayList<PexFileMapping>();\n\t\t\t\t\t// MIAPE MS and MSI reports\n\t\t\t\t\tfinal List<PexFileMapping> miapeReportFileMappings = new ArrayList<PexFileMapping>();\n\t\t\t\t\t// RAW FILES\n\t\t\t\t\tfinal List<PexFile> rawFiles = getReplicateRawFiles(replicate);\n\n\t\t\t\t\tif (rawFiles != null) {\n\t\t\t\t\t\tfor (final PexFile rawFile : rawFiles) {\n\t\t\t\t\t\t\tif (!fileLocationsMapping.containsKey(rawFile.getFileLocation())) {\n\t\t\t\t\t\t\t\tfinal PexFileMapping rawFileMapping = new PexFileMapping(\"raw\", fileCounter++,\n\t\t\t\t\t\t\t\t\t\trawFile.getFileLocation(), null);\n\t\t\t\t\t\t\t\trawFileMappings.add(rawFileMapping);\n\t\t\t\t\t\t\t\tfileLocationsMapping.put(rawFile.getFileLocation(), rawFileMapping);\n\n\t\t\t\t\t\t\t\t// PRIDE XML -> RAW file\n\t\t\t\t\t\t\t\tprideXMLFileMapping.addRelationship(rawFileMapping.getId());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// PEAK LISTS\n\t\t\t\t\tfinal List<PexFile> peakListFiles = getPeakListFiles(replicate);\n\t\t\t\t\tfinal List<PexFileMapping> replicatePeakListFileMappings = new ArrayList<PexFileMapping>();\n\t\t\t\t\tif (peakListFiles != null) {\n\t\t\t\t\t\tfor (final PexFile peakList : peakListFiles) {\n\t\t\t\t\t\t\tif (!fileLocationsMapping.containsKey(peakList.getFileLocation())) {\n\t\t\t\t\t\t\t\tfinal PexFileMapping peakListFileMapping = new PexFileMapping(\"peak\", fileCounter++,\n\t\t\t\t\t\t\t\t\t\tpeakList.getFileLocation(), null);\n\t\t\t\t\t\t\t\tpeakListFileMappings.add(peakListFileMapping);\n\t\t\t\t\t\t\t\treplicatePeakListFileMappings.add(peakListFileMapping);\n\t\t\t\t\t\t\t\tfileLocationsMapping.put(peakList.getFileLocation(), peakListFileMapping);\n\n\t\t\t\t\t\t\t\t// PRIDE XML -> PEAK LIST file\n\t\t\t\t\t\t\t\tprideXMLFileMapping.addRelationship(peakListFileMapping.getId());\n\t\t\t\t\t\t\t\t// RAW file -> PEAK LIST file\n\t\t\t\t\t\t\t\tfor (final PexFileMapping rawFileMapping : rawFileMappings) {\n\t\t\t\t\t\t\t\t\trawFileMapping.addRelationship(peakListFileMapping.getId());\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// prideXMLFileMapping\n\t\t\t\t\t\t\t\t// .addRelationship(peakListFileMapping\n\t\t\t\t\t\t\t\t// .getId());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// MIAPE MS REPORTS\n\t\t\t\t\tfinal List<PexFile> miapeMSReportFiles = getMiapeMSReportFiles(replicate);\n\t\t\t\t\tif (miapeMSReportFiles != null)\n\t\t\t\t\t\tfor (final PexFile miapeMSReportFile : miapeMSReportFiles) {\n\t\t\t\t\t\t\tif (!fileLocationsMapping.containsKey(miapeMSReportFile.getFileLocation())) {\n\t\t\t\t\t\t\t\tfinal PexFileMapping miapeReportFileMapping = new PexFileMapping(\"other\", fileCounter++,\n\t\t\t\t\t\t\t\t\t\tmiapeMSReportFile.getFileLocation(), null);\n\t\t\t\t\t\t\t\tmiapeReportFileMappings.add(miapeReportFileMapping);\n\t\t\t\t\t\t\t\tfileLocationsMapping.put(miapeMSReportFile.getFileLocation(), miapeReportFileMapping);\n\n\t\t\t\t\t\t\t\t// PRIDE XML -> MIAPE MS report\n\t\t\t\t\t\t\t\tprideXMLFileMapping.addRelationship(miapeReportFileMapping.getId());\n\t\t\t\t\t\t\t\t// RAW file -> MIAPE MS report\n\t\t\t\t\t\t\t\tfor (final PexFileMapping rawFileMapping : rawFileMappings) {\n\t\t\t\t\t\t\t\t\trawFileMapping.addRelationship(miapeReportFileMapping.getId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// PEAK LIST file -> MIAPE MS report\n\t\t\t\t\t\t\t\tfor (final PexFileMapping peakListFileMapping : replicatePeakListFileMappings) {\n\t\t\t\t\t\t\t\t\tpeakListFileMapping.addRelationship(miapeReportFileMapping.getId());\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\n\t\t\t\t\t// SEARCH ENGINE OUTPUT FILES\n\t\t\t\t\tfinal List<PexFile> searchEngineOutputFiles = getSearchEngineOutputFiles(replicate);\n\t\t\t\t\tfinal List<PexFileMapping> replicatesearchEngineOutputFilesMappings = new ArrayList<PexFileMapping>();\n\t\t\t\t\tif (searchEngineOutputFiles != null) {\n\t\t\t\t\t\tfor (final PexFile peakList : searchEngineOutputFiles) {\n\t\t\t\t\t\t\tif (!fileLocationsMapping.containsKey(peakList.getFileLocation())) {\n\t\t\t\t\t\t\t\tfinal PexFileMapping searchEngineOutputFileMapping = new PexFileMapping(\"search\",\n\t\t\t\t\t\t\t\t\t\tfileCounter++, peakList.getFileLocation(), null);\n\t\t\t\t\t\t\t\toutputSearchEngineFileMappings.add(searchEngineOutputFileMapping);\n\t\t\t\t\t\t\t\treplicatesearchEngineOutputFilesMappings.add(searchEngineOutputFileMapping);\n\t\t\t\t\t\t\t\tfileLocationsMapping.put(peakList.getFileLocation(), searchEngineOutputFileMapping);\n\t\t\t\t\t\t\t\t// PRIDE XML -> SEARCH ENGINE OUTPUT file\n\t\t\t\t\t\t\t\tprideXMLFileMapping.addRelationship(searchEngineOutputFileMapping.getId());\n\t\t\t\t\t\t\t\t// RAW file -> SEARCH ENGINE OUTPUT file\n\t\t\t\t\t\t\t\tfor (final PexFileMapping rawFileMapping : rawFileMappings) {\n\t\t\t\t\t\t\t\t\trawFileMapping.addRelationship(searchEngineOutputFileMapping.getId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// PEAK LIST FILE -> SEARCH ENGINE OUTPUT file\n\t\t\t\t\t\t\t\tfor (final PexFileMapping peakListFileMapping : replicatePeakListFileMappings) {\n\t\t\t\t\t\t\t\t\tpeakListFileMapping.addRelationship(searchEngineOutputFileMapping.getId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// MIAPE MSI REPORTS\n\t\t\t\t\tfinal List<PexFile> miapeMSIReportFiles = getMiapeMSIReportFiles(replicate);\n\t\t\t\t\tif (miapeMSIReportFiles != null)\n\t\t\t\t\t\tfor (final PexFile miapeMSIReportFile : miapeMSIReportFiles) {\n\t\t\t\t\t\t\tif (!fileLocationsMapping.containsKey(miapeMSIReportFile.getFileLocation())) {\n\t\t\t\t\t\t\t\tfinal PexFileMapping miapeReportFileMapping = new PexFileMapping(\"other\", fileCounter++,\n\t\t\t\t\t\t\t\t\t\tmiapeMSIReportFile.getFileLocation(), null);\n\t\t\t\t\t\t\t\tmiapeReportFileMappings.add(miapeReportFileMapping);\n\t\t\t\t\t\t\t\tfileLocationsMapping.put(miapeMSIReportFile.getFileLocation(), miapeReportFileMapping);\n\n\t\t\t\t\t\t\t\t// PRIDE XML -> MIAPE MSI report\n\t\t\t\t\t\t\t\tprideXMLFileMapping.addRelationship(miapeReportFileMapping.getId());\n\t\t\t\t\t\t\t\t// RAW file -> MIAPE MSI report\n\t\t\t\t\t\t\t\tfor (final PexFileMapping rawFileMapping : rawFileMappings) {\n\t\t\t\t\t\t\t\t\trawFileMapping.addRelationship(miapeReportFileMapping.getId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// PEAK LIST FILE -> MIAPE MSI report\n\t\t\t\t\t\t\t\tfor (final PexFileMapping peakListFileMapping : replicatePeakListFileMappings) {\n\t\t\t\t\t\t\t\t\tpeakListFileMapping.addRelationship(miapeReportFileMapping.getId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// SEARCH ENGINE OUTPUT file -> MIAPE MSI report\n\t\t\t\t\t\t\t\tfor (final PexFileMapping searchEngineOutputFileMapping : replicatesearchEngineOutputFilesMappings) {\n\t\t\t\t\t\t\t\t\tsearchEngineOutputFileMapping.addRelationship(miapeReportFileMapping.getId());\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t// Add all to the same list and then sort by id\n\t\t\t\t\ttotalFileList.addAll(outputSearchEngineFileMappings);\n\t\t\t\t\ttotalFileList.addAll(miapeReportFileMappings);\n\t\t\t\t\ttotalFileList.addAll(peakListFileMappings);\n\t\t\t\t\ttotalFileList.addAll(rawFileMappings);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Sort the list of files\n\t\tCollections.sort(totalFileList, new Comparator<PexFileMapping>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(PexFileMapping o1, PexFileMapping o2) {\n\n\t\t\t\treturn Integer.valueOf(o1.getId()).compareTo(Integer.valueOf(o2.getId()));\n\n\t\t\t}\n\n\t\t});\n\t\tfor (final PexFileMapping pexFileMapping : totalFileList) {\n\t\t\tret.add(pexFileMapping.toString());\n\t\t}\n\t\treturn ret;\n\t}", "public void readDocument() throws FileNotFoundException{\r\n\t\t// Initialize 2 empty read document collections, one without duplicate words.\r\n\t\treadDocument = new LinkedBag<String>();\r\n\t\treadDocumentNoDuplicates = new LinkedSet<String>();\r\n\t\t\r\n\t\t// Prompt user for name of read document file.\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tSystem.out.print(\"Enter the file you would like checked with extension: \");\r\n\t\tString readDocFileName = input.nextLine();\r\n\t\t\r\n\t\t// If exists, open file specified by user. Then add words to both collections.\r\n\t\ttry {\r\n\t\t\tFile file = new File(readDocFileName);\r\n\t\t\tScanner scanner = new Scanner(file);\r\n\t\t\twhile (scanner.hasNextLine()) {\r\n\t\t\t\tString word = scanner.next();\r\n\t\t\t\treadDocument.add(word.replaceFirst(\"^[^a-zA-Z]+\",\"\").replaceAll(\"[^a-zA-Z]+$\", \"\"));\r\n\t\t\t\treadDocumentNoDuplicates.add(word.replaceFirst(\"^[^a-zA-Z]+\",\"\").replaceAll(\"[^a-zA-Z]+$\", \"\"));\r\n\t\t\t}\r\n\t\t\tscanner.close();\r\n\t\t\tSystem.out.println(\"Document read\");\r\n\r\n\t\t\t// Get initial list of incorrect words.\r\n\t\t\tincorrectWords = readDocumentNoDuplicates.difference(dictionary);\r\n\t\t\t\r\n\t\t\t// Display message showing how many words were in the read document.\r\n\t\t\tSystem.out.println(\"This document contains \" + readDocument.size() + \" words.\");\r\n\t\t}\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\treadDocument = null;\r\n\t\t\treadDocumentNoDuplicates = null;\r\n\t\t\tSystem.out.println(\"Error: File '\" + readDocFileName + \"' not found. Please try again.\");\r\n\t\t}\r\n\t}", "private static void loadFiles(String[] files) throws IOException {\n\t\tfor(String file : files){\n\n\t\t\t//Create reader for the file\n\t\t\tBufferedReader fileReader = new BufferedReader(new FileReader(file));\n\n\t\t\t//Create HashMap to store words and counts\n\t\t\tHashMap<String,WordCount> fileWordCounts = new HashMap<String,WordCount>();\n\t\t\tArrayList<String> sentences = new ArrayList<String>();\n\n\t\t\t//While the file still has more lines to be read from\n\t\t\twhile(fileReader.ready()){\n\n\t\t\t\t//Read a line from the file\n\t\t\t\tString fileLine = fileReader.readLine();\n\t\t\t\t//Add the line to file sentences\n\t\t\t\tsentences.add(fileLine);\n\t\t\t\t//Split the file and remove punctuation from words\n\t\t\t\tString[] fileWords = fileLine.replaceAll(\"[^a-zA-Z ]\", \"\").toLowerCase().split(\"\\\\s+\");\n\n\t\t\t\t//iterate through all words in each line\n\t\t\t\tfor (String word : fileWords)\n\t\t\t\t{\n\t\t\t\t\tWordCount count = fileWordCounts.get(word);\n\t\t\t\t\t//If word is not in file, add it \n\t\t\t\t\tif (count == null) {\n\t\t\t\t\t\tfileWordCounts.put(word,new WordCount(word));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcount.inc(); //If not, increment it\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\n\t\t\t//Add file to fileDatabase \n\t\t\tfileDatabase.map.put(file, new FileObject(file, fileWordCounts, sentences));\n\n\t\t\tfileReader.close(); // Close File\n\n\t\t}//End of For Loop reading from all files\n\t}", "public Map<String, String> NextDocument() throws IOException {\n\t\tMap<String, String> map = new HashMap<>();\n\t\tStringBuffer content = new StringBuffer();\n\t\tString line = inputStream.readLine();\n\t\tif(line==null) {\n\t\t\tinputStream.close();\n\t\t\treturn null;\n\t\t} else {\n\t\t\tmap.put(\"DOCNO\", line);\n\t\t\tmap.put(\"CONTENT\", inputStream.readLine());\n\t\t\treturn map;\n\t\t}\n\t}", "private void processMetadataFromLoader() {\n\n int recordCount = mdi.readInt();\n\n long currentTime = System.currentTimeMillis();\n synchronized (entities) {\n clearOldTempIndexes(currentTime);\n\n for (int i = 0; i < recordCount; i++) {\n int tempIndex = mdi.readInt();\n assert DirectProtocol.isValidTempIndex(tempIndex);\n String symbol = mdi.readCharSequence().toString().intern();\n\n ConstantIdentityKey key;\n int entityIndex = entities.get(symbol, NOT_FOUND_VALUE);\n if (entityIndex == NOT_FOUND_VALUE) {\n entityIndex = entities.size();\n key = new ConstantIdentityKey(symbol);\n entities.put(key, entityIndex);\n } else {\n key = entities.getKeyObject(symbol);\n }\n\n // Note: key is guarantied to be same object as in \"entities\" field\n tempIndexes.put(tempIndex, key);\n\n sendMetadata(symbol, entityIndex);\n }\n if (recordCount > 0) {\n lastTempIndexAdded = currentTime;\n }\n }\n }", "@android.annotation.SuppressLint({\"NewApi\"})\n private void listRoots() {\n /*\n r23 = this;\n r21 = 0;\n r0 = r21;\n r1 = r23;\n r1.currentDir = r0;\n r0 = r23;\n r0 = r0.items;\n r21 = r0;\n r21.clear();\n r17 = new java.util.HashSet;\n r17.<init>();\n r21 = android.os.Environment.getExternalStorageDirectory();\n r5 = r21.getPath();\n r12 = android.os.Environment.isExternalStorageRemovable();\n r6 = android.os.Environment.getExternalStorageState();\n r21 = \"mounted\";\n r0 = r21;\n r21 = r6.equals(r0);\n if (r21 != 0) goto L_0x003c;\n L_0x0031:\n r21 = \"mounted_ro\";\n r0 = r21;\n r21 = r6.equals(r0);\n if (r21 == 0) goto L_0x0084;\n L_0x003c:\n r8 = new org.telegram.ui.DocumentSelectActivity$ListItem;\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r8.<init>();\n r21 = android.os.Environment.isExternalStorageRemovable();\n if (r21 == 0) goto L_0x02ae;\n L_0x004d:\n r21 = \"SdCard\";\n r22 = 2131494825; // 0x7f0c07a9 float:1.861317E38 double:1.0530983673E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r8.title = r0;\n r21 = 2131165433; // 0x7f0700f9 float:1.7945083E38 double:1.052935626E-314;\n r0 = r21;\n r8.icon = r0;\n L_0x0062:\n r0 = r23;\n r21 = r0.getRootSubtitle(r5);\n r0 = r21;\n r8.subtitle = r0;\n r21 = android.os.Environment.getExternalStorageDirectory();\n r0 = r21;\n r8.file = r0;\n r0 = r23;\n r0 = r0.items;\n r21 = r0;\n r0 = r21;\n r0.add(r8);\n r0 = r17;\n r0.add(r5);\n L_0x0084:\n r3 = 0;\n r4 = new java.io.BufferedReader;\t Catch:{ Exception -> 0x0302 }\n r21 = new java.io.FileReader;\t Catch:{ Exception -> 0x0302 }\n r22 = \"/proc/mounts\";\n r21.<init>(r22);\t Catch:{ Exception -> 0x0302 }\n r0 = r21;\n r4.<init>(r0);\t Catch:{ Exception -> 0x0302 }\n L_0x0094:\n r14 = r4.readLine();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r14 == 0) goto L_0x02dd;\n L_0x009a:\n r21 = \"vfat\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x00b0;\n L_0x00a5:\n r21 = \"/mnt\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 == 0) goto L_0x0094;\n L_0x00b0:\n r21 = org.telegram.messenger.BuildVars.LOGS_ENABLED;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 == 0) goto L_0x00b7;\n L_0x00b4:\n org.telegram.messenger.FileLog.d(r14);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n L_0x00b7:\n r19 = new java.util.StringTokenizer;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = \" \";\n r0 = r19;\n r1 = r21;\n r0.<init>(r14, r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r20 = r19.nextToken();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r16 = r19.nextToken();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r0 = r17;\n r1 = r16;\n r21 = r0.contains(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x00d5:\n r21 = \"/dev/block/vold\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 == 0) goto L_0x0094;\n L_0x00e0:\n r21 = \"/mnt/secure\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x00eb:\n r21 = \"/mnt/asec\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x00f6:\n r21 = \"/mnt/obb\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x0101:\n r21 = \"/dev/mapper\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x010c:\n r21 = \"tmpfs\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x0117:\n r21 = new java.io.File;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r0 = r21;\n r1 = r16;\n r0.<init>(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = r21.isDirectory();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0163;\n L_0x0126:\n r21 = 47;\n r0 = r16;\n r1 = r21;\n r11 = r0.lastIndexOf(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = -1;\n r0 = r21;\n if (r11 == r0) goto L_0x0163;\n L_0x0136:\n r21 = new java.lang.StringBuilder;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21.<init>();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r22 = \"/storage/\";\n r21 = r21.append(r22);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r22 = r11 + 1;\n r0 = r16;\n r1 = r22;\n r22 = r0.substring(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = r21.append(r22);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r15 = r21.toString();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = new java.io.File;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r0 = r21;\n r0.<init>(r15);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = r21.isDirectory();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 == 0) goto L_0x0163;\n L_0x0161:\n r16 = r15;\n L_0x0163:\n r0 = r17;\n r1 = r16;\n r0.add(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r13 = new org.telegram.ui.DocumentSelectActivity$ListItem;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r13.<init>();\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r21 = r16.toLowerCase();\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r22 = \"sd\";\n r21 = r21.contains(r22);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n if (r21 == 0) goto L_0x02c5;\n L_0x0182:\n r21 = \"SdCard\";\n r22 = 2131494825; // 0x7f0c07a9 float:1.861317E38 double:1.0530983673E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r13.title = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n L_0x0190:\n r21 = 2131165433; // 0x7f0700f9 float:1.7945083E38 double:1.052935626E-314;\n r0 = r21;\n r13.icon = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r23;\n r1 = r16;\n r21 = r0.getRootSubtitle(r1);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r13.subtitle = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r21 = new java.io.File;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r1 = r16;\n r0.<init>(r1);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r13.file = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r23;\n r0 = r0.items;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r21 = r0;\n r0 = r21;\n r0.add(r13);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n goto L_0x0094;\n L_0x01bd:\n r7 = move-exception;\n org.telegram.messenger.FileLog.e(r7);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n goto L_0x0094;\n L_0x01c3:\n r7 = move-exception;\n r3 = r4;\n L_0x01c5:\n org.telegram.messenger.FileLog.e(r7);\t Catch:{ all -> 0x0300 }\n if (r3 == 0) goto L_0x01cd;\n L_0x01ca:\n r3.close();\t Catch:{ Exception -> 0x02ec }\n L_0x01cd:\n r9 = new org.telegram.ui.DocumentSelectActivity$ListItem;\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r9.<init>();\n r21 = \"/\";\n r0 = r21;\n r9.title = r0;\n r21 = \"SystemRoot\";\n r22 = 2131495071; // 0x7f0c089f float:1.8613668E38 double:1.053098489E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r9.subtitle = r0;\n r21 = 2131165426; // 0x7f0700f2 float:1.7945069E38 double:1.0529356226E-314;\n r0 = r21;\n r9.icon = r0;\n r21 = new java.io.File;\n r22 = \"/\";\n r21.<init>(r22);\n r0 = r21;\n r9.file = r0;\n r0 = r23;\n r0 = r0.items;\n r21 = r0;\n r0 = r21;\n r0.add(r9);\n r18 = new java.io.File;\t Catch:{ Exception -> 0x02f7 }\n r21 = android.os.Environment.getExternalStorageDirectory();\t Catch:{ Exception -> 0x02f7 }\n r22 = \"Telegram\";\n r0 = r18;\n r1 = r21;\n r2 = r22;\n r0.<init>(r1, r2);\t Catch:{ Exception -> 0x02f7 }\n r21 = r18.exists();\t Catch:{ Exception -> 0x02f7 }\n if (r21 == 0) goto L_0x0254;\n L_0x0223:\n r10 = new org.telegram.ui.DocumentSelectActivity$ListItem;\t Catch:{ Exception -> 0x02f7 }\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r10.<init>();\t Catch:{ Exception -> 0x02f7 }\n r21 = \"Telegram\";\n r0 = r21;\n r10.title = r0;\t Catch:{ Exception -> 0x02fd }\n r21 = r18.toString();\t Catch:{ Exception -> 0x02fd }\n r0 = r21;\n r10.subtitle = r0;\t Catch:{ Exception -> 0x02fd }\n r21 = 2131165426; // 0x7f0700f2 float:1.7945069E38 double:1.0529356226E-314;\n r0 = r21;\n r10.icon = r0;\t Catch:{ Exception -> 0x02fd }\n r0 = r18;\n r10.file = r0;\t Catch:{ Exception -> 0x02fd }\n r0 = r23;\n r0 = r0.items;\t Catch:{ Exception -> 0x02fd }\n r21 = r0;\n r0 = r21;\n r0.add(r10);\t Catch:{ Exception -> 0x02fd }\n r9 = r10;\n L_0x0254:\n r9 = new org.telegram.ui.DocumentSelectActivity$ListItem;\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r9.<init>();\n r21 = \"Gallery\";\n r22 = 2131493847; // 0x7f0c03d7 float:1.8611186E38 double:1.053097884E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r9.title = r0;\n r21 = \"GalleryInfo\";\n r22 = 2131493848; // 0x7f0c03d8 float:1.8611188E38 double:1.0530978846E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r9.subtitle = r0;\n r21 = 2131165529; // 0x7f070159 float:1.7945278E38 double:1.0529356735E-314;\n r0 = r21;\n r9.icon = r0;\n r21 = 0;\n r0 = r21;\n r9.file = r0;\n r0 = r23;\n r0 = r0.items;\n r21 = r0;\n r0 = r21;\n r0.add(r9);\n r0 = r23;\n r0 = r0.listView;\n r21 = r0;\n org.telegram.messenger.AndroidUtilities.clearDrawableAnimation(r21);\n r21 = 1;\n r0 = r21;\n r1 = r23;\n r1.scrolling = r0;\n r0 = r23;\n r0 = r0.listAdapter;\n r21 = r0;\n r21.notifyDataSetChanged();\n return;\n L_0x02ae:\n r21 = \"InternalStorage\";\n r22 = 2131493929; // 0x7f0c0429 float:1.8611352E38 double:1.0530979246E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r8.title = r0;\n r21 = 2131165528; // 0x7f070158 float:1.7945276E38 double:1.052935673E-314;\n r0 = r21;\n r8.icon = r0;\n goto L_0x0062;\n L_0x02c5:\n r21 = \"ExternalStorage\";\n r22 = 2131493730; // 0x7f0c0362 float:1.8610948E38 double:1.0530978263E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r13.title = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n goto L_0x0190;\n L_0x02d5:\n r21 = move-exception;\n r3 = r4;\n L_0x02d7:\n if (r3 == 0) goto L_0x02dc;\n L_0x02d9:\n r3.close();\t Catch:{ Exception -> 0x02f2 }\n L_0x02dc:\n throw r21;\n L_0x02dd:\n if (r4 == 0) goto L_0x0305;\n L_0x02df:\n r4.close();\t Catch:{ Exception -> 0x02e5 }\n r3 = r4;\n goto L_0x01cd;\n L_0x02e5:\n r7 = move-exception;\n org.telegram.messenger.FileLog.e(r7);\n r3 = r4;\n goto L_0x01cd;\n L_0x02ec:\n r7 = move-exception;\n org.telegram.messenger.FileLog.e(r7);\n goto L_0x01cd;\n L_0x02f2:\n r7 = move-exception;\n org.telegram.messenger.FileLog.e(r7);\n goto L_0x02dc;\n L_0x02f7:\n r7 = move-exception;\n L_0x02f8:\n org.telegram.messenger.FileLog.e(r7);\n goto L_0x0254;\n L_0x02fd:\n r7 = move-exception;\n r9 = r10;\n goto L_0x02f8;\n L_0x0300:\n r21 = move-exception;\n goto L_0x02d7;\n L_0x0302:\n r7 = move-exception;\n goto L_0x01c5;\n L_0x0305:\n r3 = r4;\n goto L_0x01cd;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.telegram.ui.DocumentSelectActivity.listRoots():void\");\n }", "public static void startup() {\n\t\tString thisLine;\n\t\tString currentName = \"\";\n\t\tboolean next = true;\n\n\t\t// DEBUG\n\t\t// System.out.println(\"entered here\");\n\n\t\t// Loop across the arguments\n\n\t\t// Open the file for reading\n\t\ttry {\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(GIGA_WORD));\n\t\t\twhile ((thisLine = br.readLine()) != null) {\n\t\t\t\tString str = thisLine.trim();// .replaceAll(\"(\\\\r|\\\\n)\", \"\");\n\t\t\t\tString[] wordNumber = str.split(\"[ ]{2,}\");\n\t\t\t\tString word = wordNumber[0].toLowerCase();\n\t\t\t\tint cnt = Integer.parseInt(wordNumber[1]);\n\t\t\t\tgigaMap.put(word, cnt);\n\t\t\t}\n\t\t\tbr.close();\n\t\t\tbr = null;\n\t\t\tbr = new BufferedReader(new FileReader(FILE_NAME));\n\t\t\twhile ((thisLine = br.readLine()) != null) {\n\t\t\t\tString str = thisLine.trim();// replaceAll(\"(\\\\r|\\\\n)\", \"\");\n\t\t\t\tif (str.equals(\"[Term]\")) {\n\t\t\t\t\tnext = true;\n\t\t\t\t}\n\t\t\t\tif (str.startsWith(\"name:\")) {\n\t\t\t\t\tif (next) {\n\t\t\t\t\t\tcurrentName = str.replaceAll(\"name: \", \"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (str.startsWith(\"synonym:\")) {\n\t\t\t\t\tif (str.contains(\"EXACT\") || str.contains(\"NARROW\")) {\n\t\t\t\t\t\t// synonym..\n\t\t\t\t\t\tPattern pattern = Pattern\n\t\t\t\t\t\t\t\t.compile(\"synonym:.*\\\"(.*)\\\".*\");\n\t\t\t\t\t\tMatcher matcher = pattern.matcher(str);\n\t\t\t\t\t\t// DEBUG\n\t\t\t\t\t\t// System.err.println(str);\n\t\t\t\t\t\tif (matcher.find()) {\n\t\t\t\t\t\t\tString syno = matcher.group(1);\n\t\t\t\t\t\t\tif (!currentName.equals(\"\")) {\n\t\t\t\t\t\t\t\t// System.err.format(\"%s:%s.\\n\", currentName,\n\t\t\t\t\t\t\t\t// syno);\n\n\t\t\t\t\t\t\t\tadd(currentName, syno);\n\t\t\t\t\t\t\t\tadd(syno, currentName);\n\t\t\t\t\t\t\t\trecursiveAddSyno(currentName, syno);\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\tbr.close();\n\t\t\tbr = null;\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Error: \" + e);\n\t\t}\n\t}", "public void start(){\n\t\tboolean readFromFile = readFromIndex();\r\n\t\tif (!readFromFile){\t\r\n\t\t\tfor (int i = 0;i<1000;++i){\r\n\t\t\t\tString file = \"../crawler/pages/page\"+i+\".html\";\r\n\t\t\t\taddFile(file);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void testDictionary() throws IOException {\n String wnhome=\"c:\\\\Users\\\\Katherine\\\\Documents\\\\2nd sem\\\\IR\\\\project\\\\WordNet_3.1\";\n String path = wnhome + File.separator + \"dict\";\n\n\n URL url = new URL(\"file\", null, path);\n\n IDictionary dictionary = new Dictionary(url);\n dictionary.open();\n // /Users/Ward/Downloads\n IIndexWord indexWord = dictionary.getIndexWord(\"use\", POS.VERB);\n\n for (IWordID wordID : indexWord.getWordIDs()) {\n\n IWord word = dictionary.getWord(wordID);\n for (IWord word1 : word.getSynset().getWords()) {\n System.out.println(word1.getLemma());\n }\n// System.out.println(\"Id = \" + wordID);\n// System.out.println(\" Lemma = \" + word.getLemma());\n// System.out.println(\" Gloss = \" + word.getSynset().getGloss());\n\n List<ISynsetID> hypernyms =\n word.getSynset().getRelatedSynsets(Pointer.HYPERNYM);\n // print out each h y p e r n y m s id and synonyms\n List<IWord> words;\n for (ISynsetID sid : hypernyms) {\n words = dictionary.getSynset(sid).getWords();\n System.out.print(sid + \" {\");\n for (Iterator<IWord> i = words.iterator(); i.hasNext(); ) {\n System.out.print(i.next().getLemma());\n if (i.hasNext())\n System.out.print(\", \");\n }\n System.out.println(\"}\");\n }\n }\n }", "@SuppressWarnings(\"unchecked\")\r\n private void newMap() throws IOException, ClassNotFoundException {\r\n this.music_map.clear();\r\n if (needNewMap()) {\r\n if (!save_file.exists()) {\r\n System.out.println(\"DIZIONARIO NON PRESENTE\");\r\n System.out.println(\"CREAZIONE NUOVO DIZIONARIO IN CORSO...\");\r\n\r\n this.setTarget();\r\n\r\n this.recoursiveMapCreation(this.music_root);\r\n this.saveMap();\r\n } else {\r\n System.out.println(\"DIZIONARIO NON AGGIORNATO\");\r\n if (!UtilFunctions.newDictionaryRequest(this.save_file, this.music_root)) {\r\n System.out.println(\"AGGIORNAMENTO DIZIONARIO RIFIUTATO\");\r\n FileInputStream f = new FileInputStream(this.save_file);\r\n ObjectInputStream o = new ObjectInputStream(f);\r\n this.music_map.putAll((Map<String, String[]>) o.readObject());\r\n current.set(ProgressDialog.TOTAL.get());\r\n } else {\r\n System.out.println(\"CREAZIONE NUOVO DIZIONARIO IN CORSO...\");\r\n this.setTarget();\r\n this.recoursiveMapCreation(this.music_root);\r\n this.saveMap();\r\n }\r\n }\r\n } else {\r\n System.out.println(\"DIZIONARIO GIA' PRESENTE\");\r\n FileInputStream f = new FileInputStream(this.save_file);\r\n ObjectInputStream o = new ObjectInputStream(f);\r\n this.music_map.putAll((Map<String, String[]>) o.readObject());\r\n current.set(ProgressDialog.TOTAL.get());\r\n }\r\n }", "private static void searchMemo() {\n\t\t\n\t}", "private static Positional_inverted_index posindexCorpus(DocumentCorpus corpus) throws ClassNotFoundException, InstantiationException, IllegalAccessException, FileNotFoundException, IOException {\n\n NewTokenProcessor processor = new NewTokenProcessor();\n Iterable<Document> docs = corpus.getDocuments(); //call registerFileDocumentFactory first?\n\n List<Double> Doc_length = new ArrayList<>();\n Positional_inverted_index index = new Positional_inverted_index();\n\n double token_count = 0;\n\n // Iterate through the documents, and:\n for (Document d : docs) {\n //File f = new File(path + \"\\\\\" + d.getTitle());\n File f = new File(path + \"\\\\\" + d.getFileName().toString());\n double Filesize = f.length();\n //edited by bhavya\n double doc_weight = 0; //first entry in docweights.bin\n double doc_tokens = 0;\n double doc_length = 0;\n HashMap<String, Integer> tftd = new HashMap<>();\n // Tokenize the document's content by constructing an EnglishTokenStream around the document's content.\n Reader reader = d.getContent();\n EnglishTokenStream stream = new EnglishTokenStream(reader); //can access tokens through this stream\n N++;\n // Iterate through the tokens in the document, processing them using a BasicTokenProcessor,\n //\t\tand adding them to the HashSet vocabulary.\n Iterable<String> tokens = stream.getTokens();\n int i = 0;\n\n for (String token : tokens) {\n\n //adding token in index\n List<String> word = new ArrayList<String>();\n word = processor.processToken(token);\n //System.out.println(word.get(0));\n if (word.get(0).matches(\"\")) {\n continue;\n } else {\n\n index.addTerm(word.get(0), i, d.getId());\n\n }\n i = i + 1;\n\n //we check if token already exists in hashmap or not. \n //if it exists, increase its freq by 1 else make a new entry.\n if (tftd.containsKey(word.get(0))) {\n doc_tokens++;\n int count = tftd.get(word.get(0));\n tftd.replace(word.get(0), count + 1);\n } else {\n doc_tokens++;\n// token_count++; //gives total number of tokens.\n tftd.put(word.get(0), 1);\n }\n\n }\n double length = 0;\n double wdt = 0;\n\n double total_tftd = 0;\n for (Map.Entry<String, Integer> entry : tftd.entrySet()) {\n\n wdt = 1 + log(entry.getValue());\n\n length = length + pow(wdt, 2);\n total_tftd = total_tftd + entry.getValue();\n }\n token_count = token_count + doc_tokens;\n doc_weight = pow(length, 0.5);\n double avg_tftd = total_tftd / (double) tftd.size();\n\n Doc_length.add(doc_weight);\n Doc_length.add(avg_tftd);\n Doc_length.add(doc_tokens);\n Doc_length.add(Filesize);\n }\n Doc_length.add(token_count / N);\n\n DiskIndexWriter d = new DiskIndexWriter();\n d.write_doc(path, Doc_length);\n\n return index;\n }", "@Override\n public void processCas(CAS aCas) throws ResourceProcessException {\nSystem.out.println(\"Retrival evaluator...\");\n JCas jcas;\n try {\n jcas = aCas.getJCas();\n } catch (CASException e) {\n throw new ResourceProcessException(e);\n }\n\n FSIterator it = jcas.getAnnotationIndex(Document.type).iterator();\n \n// if (it.hasNext()) {\n// Document doc = (Document) it.next();\n// cnt++;\n// }\n// log(cnt);\n it = jcas.getAnnotationIndex(Document.type).iterator();\n\n if (it.hasNext()) {\n Document doc = (Document) it.next();\n int queryid = doc.getQueryID();\n int rel = doc.getRelevanceValue();\n // Make sure that your previous annotators have populated this in CAS\n FSList fsTokenList = doc.getTokenList();\n ArrayList<Token> tokenList = Utils.fromFSListToCollection(fsTokenList, Token.class);\n Map<String, Integer> queryVector = new HashMap<String, Integer>();\n Map<String, Integer> docVector = new HashMap<String, Integer>();\n if (rel == 99) {\n for (Token t : tokenList) {\n queryVector.put(t.getText(), t.getFrequency());\n }\n queryVectorlist.add(queryVector);\n } else {\n for (Token t : tokenList) {\n docVector.put(t.getText(), t.getFrequency());\n }\n double cos = computeCosineSimilarity(queryVectorlist.get(queryid - 1), docVector);\n coslist.add(cos);\n\n if (rel == 1) {\n gold = lines;\n goldcos = cos;\n System.out.println(\"goldcos\"+goldcos);\n }\n }\n \n if (qIdList.size() >= 1 && qIdList.get(qIdList.size() - 1) != queryid) {\n// System.out.println(\"lines:\"+lines);\n sortSimilarity(coslist);\n log(coslist);\n int rank=findRank(coslist,goldcos);\n rankList.add(rank);\n coslist = new ArrayList<Double>();\n }\n\n qIdList.add(doc.getQueryID());// 有啥用???\n relList.add(doc.getRelevanceValue());\n\n // Do something useful here\n lines++;\n }\n //log(coslist);\n\n }", "public IndexDatabase(String index_path, String genomes_path_file, int K_size, SequenceDatabase genomeDb) {\n int cores = Runtime.getRuntime().availableProcessors() / 2 + 1;\n int k;\n long p;\n IndexPointer null_pointer = new IndexPointer();\n try {\n Files.createDirectory(Paths.get(index_path));\n System.out.println(\"Running KMC2... \");\n executeCommand(\"kmc -r -k\" + K_size + \" -t\" + cores + \" -m\" + \n (Runtime.getRuntime().maxMemory() / 1073741824L) + \" -ci1 -fm \" + \n (genomeDb.num_genomes > 1 ? \"@\" + genomes_path_file.trim() : genomeDb.genome_names[1]) + \" \" + index_path + \"/kmers \" + index_path);\n String output = executeCommand(\"kmc_tools sort \" + index_path + \"/kmers \" + index_path + \"/sorted\");\n if (output.startsWith(\"This database contains sorted k-mers already!\")) {\n new File(index_path + \"/kmers.kmc_pre\").renameTo(new File(index_path + \"/sorted.kmc_pre\"));\n new File(index_path + \"/kmers.kmc_suf\").renameTo(new File(index_path + \"/sorted.kmc_suf\"));\n //Files.copy(Paths.get(path+\"/kmers.kmc_pre\"), Paths.get(path+\"/sorted.kmc_pre\"));\n //Files.copy(Paths.get(path+\"/kmers.kmc_suf\"), Paths.get(path+\"/sorted.kmc_suf\"));\n } else {\n new File(index_path + \"/kmers.kmc_pre\").delete();\n new File(index_path + \"/kmers.kmc_suf\").delete();\n }\n pre_file = new RandomAccessFile(index_path + \"/sorted.kmc_pre\", \"r\");\n pre_file.seek(pre_file.length() - 8);\n header_pos = read_int(pre_file);\n pre_file.seek(pre_file.length() - 8 - header_pos);\n // read the index properties \n K = read_int(pre_file);\n mode = read_int(pre_file);\n ctr_size = read_int(pre_file);\n pre_len = read_int(pre_file);\n min_count = read_int(pre_file);\n max_count = read_int(pre_file);\n kmers_num = read_long(pre_file);\n suf_len = K - pre_len;\n key = new kmer(K, pre_len, suf_len);\n System.out.println(\"Indexing \" + kmers_num + \" kmers... \");\n // load the prefix file into the memory \n pre_file.seek(4);\n int q, len = 1 << (2 * pre_len);\n prefix_ptr = new long[len];\n MappedByteBuffer pre_buff;\n for (q = 0, p = 0; p < 8; ++p) {\n pre_buff = pre_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + p * len, len);\n for (k = 0; k < len / 8; ++k, ++q) {\n prefix_ptr[q] = read_long(pre_buff);\n }\n pre_buff = null;\n }\n pre_file.close();\n\n // mapping suffix file into the memory\n suf_rec_size = ctr_size + suf_len / 4;\n MAX_BYTE_COUNT = MAX_BYTE_COUNT / suf_rec_size * suf_rec_size;\n suf_parts_num = (int) ((kmers_num * suf_rec_size) % MAX_BYTE_COUNT == 0 ? (kmers_num * suf_rec_size) / MAX_BYTE_COUNT : (kmers_num * suf_rec_size) / MAX_BYTE_COUNT + 1);\n suf_parts_size = new long[suf_parts_num];\n suf_file = new RandomAccessFile(index_path + \"/sorted.kmc_suf\", \"r\");\n suf_buff = new MappedByteBuffer[suf_parts_num];\n for (k = 0; k < suf_parts_num; ++k) {\n suf_parts_size[k] = (int) (k == suf_parts_num - 1 ? (kmers_num * suf_rec_size) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n suf_buff[k] = suf_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + k * suf_parts_size[0], suf_parts_size[k]);\n }\n // mapping pointers file into the memory\n MAX_BYTE_COUNT = MAX_BYTE_COUNT / POINTER_LENGTH * POINTER_LENGTH;\n ptr_parts_num = (int) ((kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT == 0 ? (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT : (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT + 1);\n ptr_parts_size = new long[ptr_parts_num];\n ptr_file = new RandomAccessFile(index_path + \"/pointers.db\", \"rw\");\n ptr_buff = new MappedByteBuffer[ptr_parts_num];\n for (k = 0; k < ptr_parts_num; ++k) {\n ptr_parts_size[k] = (int) (k == ptr_parts_num - 1 ? (kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT : MAX_BYTE_COUNT);\n ptr_buff[k] = ptr_file.getChannel().map(FileChannel.MapMode.READ_WRITE, k * ptr_parts_size[0], ptr_parts_size[k]);\n }\n for (p = 0; p < kmers_num; ++p) {\n put_pointer(null_pointer, p);\n }\n } catch (IOException e) {\n System.out.println(e.getMessage());\n System.exit(1);\n }\n }", "String prepareLegalDocuments();", "public void map(Object key, Text value, Context context\n\t\t ) throws IOException, InterruptedException {\n\n\t\t\t\n\t\t\t\n\t\t\t \n\t\t\t String curr_string=value.toString();\n\t\t\t /// splitting based on \"*\" as a delimiter...\n\t\t\t String [] parts=curr_string.split(\"\\\\*\");\n\t\t\t String curr_key=parts[0];\n\t\t\t // Removing spaces from both left and right part of the string..\n\t\t\t String curr_value=parts[1].trim();\n\t\t\t String [] small_parts=curr_value.split(\",\");\n\t\t\t // Taking the count of unique files which are present in the input given to tfidf\n\t\t\t int no_of_unique_files=Integer.parseInt(small_parts[small_parts.length-1]);\n\t\t\t /// The formula to compute idf is log((1+no_of_files)/no_of_unique_files))....\n\t\t\t Configuration conf=context.getConfiguration();\n\t\t\t String value_count=conf.get(\"test\");\n\t\t\t if(!value_count.isEmpty())\n\t\t\t {\n\t\t\t int total_no_files=Integer.parseInt(value_count);\n\t\t\t double x=(total_no_files/no_of_unique_files);\n\t\t\t // Formula fo rcomputing the idf value....\n\t\t\t double idf_value=Math.log10(1+x);\n\t\t\t for(int i=0;i<small_parts.length-1;i++)\n\t\t\t {\n\t\t\t\t String [] waste=small_parts[i].split(\"=\");\n\t\t\t\t String file_name=waste[0];\n\t\t\t\t // Computing the tfidf on the fly...\n\t\t\t\t double tf_idf=idf_value*Double.parseDouble(waste[1]);\n\t\t\t\t Text word3 = new Text();\n\t\t\t\t Text word4 = new Text();\n\t\t\t\t word3.set(curr_key+\"#####\"+file_name+\",\");\n\t\t\t\t word4.set(tf_idf+\"\");\n\t\t\t\t context.write(word3,word4);\n\t\t\t\t \n\t\t\t }\n\t\t\t //word1.set(curr_key);\n\t\t\t //word2.set(idf_value+\"\");\n\t\t\t //context.write(word1,word2); \n\t\t\t} \n\t\t}" ]
[ "0.5995485", "0.5839277", "0.57960045", "0.55711436", "0.5396472", "0.5236064", "0.52118707", "0.51939565", "0.5157785", "0.5112572", "0.51100713", "0.5089438", "0.5079131", "0.50780505", "0.50760406", "0.5066933", "0.5057492", "0.50543725", "0.50523096", "0.5043695", "0.5038304", "0.5009075", "0.49719515", "0.49581295", "0.4944205", "0.49276507", "0.4907697", "0.4902209", "0.4896648", "0.48889354", "0.48823825", "0.488056", "0.48662427", "0.48614132", "0.4850053", "0.4849248", "0.48469514", "0.48429763", "0.48417798", "0.48406094", "0.4815679", "0.48137245", "0.48038596", "0.48017445", "0.4800362", "0.47947884", "0.47921696", "0.47903392", "0.478264", "0.4780683", "0.47727266", "0.4762182", "0.4758358", "0.4754589", "0.4750219", "0.47501132", "0.47488496", "0.47466916", "0.47464988", "0.4745162", "0.47450745", "0.47446653", "0.47435054", "0.47360802", "0.4730707", "0.47282305", "0.4725884", "0.47255173", "0.47235167", "0.47208193", "0.46977526", "0.46950242", "0.4693711", "0.46840605", "0.46834663", "0.46818656", "0.46722725", "0.4670596", "0.4668984", "0.46638846", "0.46635565", "0.46605822", "0.46480033", "0.4647653", "0.46438873", "0.46427816", "0.46359292", "0.46263427", "0.46230012", "0.4621833", "0.46208137", "0.46171245", "0.4617014", "0.461547", "0.46154234", "0.46147498", "0.46142325", "0.46139985", "0.46132553", "0.46095335", "0.46063212" ]
0.0
-1
[NEW] Saves the tokentermIDs map and list with document names
public void saveAll(){ // Store postings for (Map.Entry<String, PostingsList> entry : this.index.entrySet()) { saveJSON("postings/t"+hash(entry.getKey())+".json", entry.getValue()); System.err.println("postings/t"+hash(entry.getKey())+".json"); count++; if (count%1000==0) System.err.println("storing "+ count); } // Store mapping ID<->document names mapping this.saveJSON("postings/docIDs.json", this.docIDs); this.saveJSON("postings/docLengths.json", this.docLengths); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void saveToken() throws IOException {\n\t\t\n\t\tFileWriter termIdx = new FileWriter(StoragePath+Path.termIdxDir);\n\t\t\n\t\tfor(Entry<String, Integer> term: termDic.entrySet()){\n\t\t\ttermIdx.append(term.getKey() + \"\\n\" + term.getValue() + \"\\n\");\n\t\t}\n\t\t\n\t\ttermIdx.close();\n\t\t\n\t}", "public static void generateInvertedIndex(Map<String, List<Posting>> stemMap, List<String> documentIds)\n {\n long lineCounter = 0;\n int documentCounter = -1;\n String currentDocId = \"\";\n String currentDocTitle = \"\";\n Scanner scanner = new Scanner(System.in);\n\n while (scanner.hasNext())\n {\n String line = scanner.nextLine();\n lineCounter++;\n \n if (line.startsWith(\"$DOC\"))\n {\n String[] wordStems = line.split(\" \");\n currentDocId = wordStems[1];\n documentCounter++;\n }\n else if (line.startsWith(\"$TITLE\"))\n {\n /* Save document titles for documentId list */\n long docLineNumber = lineCounter - 1;\n currentDocTitle = \"\";\n \n while (scanner.hasNext())\n {\n String nextTitleLine = scanner.nextLine();\n if (nextTitleLine.startsWith(\"$TEXT\"))\n {\n lineCounter++;\n documentIds.add(String.format(\"%s %d %s\\n\", currentDocId, docLineNumber, currentDocTitle));\n break;\n }\n else\n {\n lineCounter++;\n currentDocTitle += nextTitleLine;\n currentDocTitle += \" \";\n }\n }\n }\n else\n {\n String[] wordStems = line.split(\" \");\n for (String wordStem: wordStems)\n {\n if (stemMap.containsKey(wordStem))\n {\n List<Posting> currentStemPostings = stemMap.get(wordStem);\n int lastElementIndex = currentStemPostings.size() - 1;\n Posting lastPosting = currentStemPostings.get(lastElementIndex);\n \n if (lastPosting.documentId == documentCounter)\n {\n lastPosting.termFrequency += 1;\n }\n else\n {\n Posting posting = new Posting(documentCounter, 1);\n currentStemPostings.add(posting);\n }\n }\n else\n {\n List<Posting> postings = new ArrayList<>();\n Posting posting = new Posting(documentCounter, 1);\n postings.add(posting);\n stemMap.put(wordStem, postings);\n }\n }\n }\n }\n scanner.close();\n }", "public void writeIDs() {\n try {\n FileOutputStream fileOut = new FileOutputStream(\"temp/ids.ser\");\n ObjectOutputStream out = new ObjectOutputStream(fileOut);\n out.writeObject(ids);\n out.close();\n fileOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "private void scanDocuments()\n{\n document_counts = new HashMap<>();\n kgram_counts = new HashMap<>();\n for (File f : root_files) {\n addDocuments(f);\n }\n}", "public static void printInvertedIndexToFile(Map<String, List<Posting>> stemMap, List<String> documentIds)\n {\n try\n {\n PrintWriter dictionaryPW = new PrintWriter(DICTIONARY_OUTPUT_FILE_PATH, \"UTF-8\");\n PrintWriter postingsPW = new PrintWriter(POSTINGS_OUTPUT_FILE_PATH, \"UTF-8\");\n PrintWriter docIdsPW = new PrintWriter(DOCUMENT_ID_OUTPUT_FILE_PATH, \"UTF-8\");\n\n int numStems = stemMap.size();\n int numPostingEntries = 0;\n int numDocuments = documentIds.size();\n \n for (List<Posting> posting: stemMap.values())\n {\n numPostingEntries += posting.size();\n }\n\n dictionaryPW.println(numStems);\n postingsPW.println(numPostingEntries);\n docIdsPW.println(numDocuments);\n\n for (Entry<String, List<Posting>> entrySet: stemMap.entrySet())\n {\n String stem = entrySet.getKey();\n List<Posting> postings = entrySet.getValue();\n\n dictionaryPW.println(String.format(\"%s %d\", stem, postings.size()));\n for (Posting posting: postings)\n {\n postingsPW.println(String.format(\"%d %d\", posting.documentId, posting.termFrequency));\n numPostingEntries++;\n }\n }\n\n for (String docId: documentIds)\n {\n docIdsPW.print(docId);\n }\n\n dictionaryPW.close();\n postingsPW.close();\n docIdsPW.close();\n }\n catch (Exception e)\n {\n System.out.println(e.getMessage());\n }\n }", "private void saveIds(ArrayList<String> idList) {\n\n\t\ttry {\n\t\t\tFileOutputStream fileOutputStream = context.openFileOutput(\n\t\t\t\t\tSAVE_FILE, Context.MODE_PRIVATE);\n\t\t\tOutputStreamWriter outputStreamWriter = new OutputStreamWriter(\n\t\t\t\t\tfileOutputStream);\n\t\t\tGsonBuilder builder = new GsonBuilder();\n\t\t\tGson gson = builder.create();\n\t\t\tgson.toJson(idList, outputStreamWriter); // Serialize to Json\n\t\t\toutputStreamWriter.flush();\n\t\t\toutputStreamWriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void save(String indexFileName) throws FileNotFoundException, UnsupportedEncodingException{\n\t\tHashMap<String, String> sCurrentHashMap = globalHash.get(indexFileName);\n\t\t\n\t\tPrintWriter writer = new PrintWriter(indexFileName+\".txt\", \"UTF-8\");\n\n\t\tIterator it = sCurrentHashMap.entrySet().iterator();\n\t\twhile(it.hasNext()){\n\t\t\tHashMap.Entry<String, String> entry = (HashMap.Entry<String, String>) it.next();\n\t\t\t//if this term appear more than one doc\n\t\t\tif(entry.getValue().length()>1) {\n\t\t\t\tStringTokenizer stDocID = new StringTokenizer(entry.getValue(),\",\");\n\t\t\t\twriter.println(entry.getKey()+\",\"+stDocID.countTokens()+\":<\"+entry.getValue()+\">\");\n\t\t\t} else{\n\t\t\t\twriter.println(entry.getKey()+\",1:<\"+entry.getValue()+\">\");\n\t\t\t}\n\t\t}\n\t\twriter.close();\n\t}", "public void IndexADocument(String docno, String content) throws IOException {\n\t\tdocid++;\n\t\tdoc2docid.put(docno, docid);\n\t\tdocid2doc.put(docid, docno);\n\n\t\t// Insert every term in this doc into docid2map\n\t\tString[] terms = content.trim().split(\" \");\n\t\tMap<Integer, Integer> docTerm = new HashMap<>();\n\t\tint thisTermid;\n\t\tfor(String term: terms){\n\t\t\t// get termid\n\t\t\tif(term2termid.get(term)!=null) thisTermid = term2termid.get(term);\n\t\t\telse{\n\t\t\t\tthisTermid = ++termid;\n\t\t\t\tterm2termid.put(term, thisTermid);\n\t\t\t}\n\t\t\tdocTerm.put(thisTermid, docTerm.getOrDefault(thisTermid, 0)+1);\n\t\t\t// Merge this term's information into termid2map\n\t\t\tMap<Integer, Integer> temp = termid2map.getOrDefault(thisTermid, new HashMap());\n\t\t\ttemp.put(docid, temp.getOrDefault(docid, 0)+1);\n\t\t\ttermid2map.put(thisTermid, temp);\n\t\t\ttermid2fre.put(thisTermid, termid2fre.getOrDefault(thisTermid, 0)+1);\n\t\t}\n\t\tdocid2map.put(docid, docTerm);\n\n//\t\t// Merge all the terms' information into termid2map\n//\t\tfor(Long tid: docTerm.keySet()){\n//\t\t\tMap<Long, Long> temp = termid2map.getOrDefault(tid, new HashMap());\n//\t\t\ttemp.put(docid,docTerm.get(tid));\n//\t\t\ttermid2map.put(tid, temp);\n//\t\t\t// update this term's frequency\n//\t\t\ttermid2fre.put(tid, termid2fre.getOrDefault(tid,0L)+docTerm.get(tid));\n//\t\t}\n\n\t\t// When termid2map and docid2map is big enough, put it into disk\n\t\tif(docid%blockSize==0){\n\t\t\tWritePostingFile();\n\t\t\tWriteDocFile();\n\t\t}\n\t}", "static private void saveSentenceTokens( final String outputDirPath,\n final String documentId, final Iterable<String> tokenizedSentences ) {\n // Be prepared for documentId that contains directory segments, some of which may not exist\n final File outputFile = new File( outputDirPath + File.pathSeparator + documentId );\n if ( !outputFile.getParentFile().exists() && !outputFile.getParentFile().mkdirs() ) {\n LOGGER.error( outputFile.getPath() + \" is an invalid output file path\" );\n return;\n }\n try ( final BufferedWriter writer = new BufferedWriter( new FileWriter( outputFile ) ) ) {\n for ( String tokenizedSentence : tokenizedSentences ) {\n writer.write( tokenizedSentence );\n writer.newLine();\n }\n } catch ( IOException ioE ) {\n LOGGER.error( ioE.getMessage() );\n }\n }", "private void writeVocabPost(FlIndexer fi) throws IOException{\n this.docNormPow = new HashMap<>();\n \n LinkedList<Integer> tf;\n LinkedList<String> files;\n String token;\n int position=0;\n File file = new File(\"CollectionIndex/VocabularyFile.txt\");\n File Postingfile = new File(\"CollectionIndex/PostingFile.txt\");\n \n\tFileWriter fw = new FileWriter(file.getAbsoluteFile());\n FileWriter fw_posting = new FileWriter(Postingfile.getAbsolutePath());\n try (BufferedWriter bw = new BufferedWriter(fw)) {\n try (BufferedWriter bw_posting = new BufferedWriter(fw_posting)){\n for (Map.Entry<String, TermNode> entry : fi.mapTerms.entrySet()){\n double idf = ((double)this.docMap.size())/entry.getValue().getDf();\n //idf=log2(idf, 2);\n bw.write(entry.getValue().getTerm()+\" \"+entry.getValue().getDf()+\" \"+idf+\" \"+position+\"\\n\");\n \n tf=entry.getValue().getTfList();\n files=entry.getValue().getFileList();\n int i=tf.size();\n for (int j=0; j<i; j++){\n double tfidf=idf*((double)tf.get(j)/fi.getMaxTF(files.get(j)));\n double tfidfpow=Math.pow(tfidf, 2);\n\n \n if(this.docNormPow.containsKey(files.get(j))){\n //this.docNorm.put(files.get(j), this.docNorm.get(files.get(j))+tfidf);\n this.docNormPow.put(files.get(j), this.docNormPow.get(files.get(j))+tfidfpow);\n }\n else{\n //this.docNorm.put(files.get(j), tfidf);\n this.docNormPow.put(files.get(j), tfidfpow);\n }\n \n token=this.docMap.get(files.get(j))+\" \"+tf.get(j)+\" \"\n +entry.getValue().multiMap.get(files.get(j))+\" \"+tfidf+\"\\n\";\n position= position + token.length();\n \n bw_posting.write(token);\n }\n }\n }\n }\n \n System.out.println(\"Done creating VocabularyFile.txt\");\n System.out.println(\"Done creating PostingFile.txt\");\n }", "public Vector mapDocument(MultiSet<String> bow) {\n //logger.info(\"lsm.mapDocument\");\n SparseVector vector = new SparseVector();\n\n Iterator<String> it = bow.iterator();\n String term = null;\n int index = 0;\n int tf = 0;\n float tfIdf;\n for (int i = 0; it.hasNext(); i++) {\n //logger.info(i + \" \" + t[i]);\n term = it.next();\n index = termIndex.get(term);\n\n if (index != -1) {\n tf = bow.getFrequency(term);\n tfIdf = (float) (log2(tf)) * Iidf[index];\n\n //logger.info(term + \" ==> \" + index + \", tf.idf = \" + tf + \"(\" + (log2(tf)) + \") * \" + Iidf[index] + \" = \" + tfIdf);\n vector.add(index, tfIdf);\n\n }\n } // end for\n\n return vector;\n }", "public static void main(String[] args) throws IOException{\n\t\tint termIndex = 1;\n\t\t\n\t\t// startOffset holds the start offset for each term in\n\t\t// the corpus.\n\t\tlong startOffset = 0;\n\t\t\t\n\t\t// unique_terms is true if there are atleast one more\n\t\t// unique term in corpus.\n\t\tboolean unique_terms = true;\n\t\t\n\t\t\n\t\t//load the stopwords from the HDD\n\t\tString stopwords = getStopWords();\n\t\t\n\t\t// allTokenHash contains all the terms and its termid\n\t\tHashMap<String, Integer> allTermHash = new HashMap<String, Integer>();\n\t\t\n\t\t// catalogHash contains the term and its position in\n\t\t// the inverted list present in the HDD.\n\t\tHashMap<Integer, Multimap> catalogHash = new HashMap<Integer, Multimap>();\n\t\t\n\t\t// finalCatalogHash contains the catalogHash for the invertedIndexHash\n\t\t// present in the HDD.\n\t\tHashMap<Integer, String> finalCatalogHash = new HashMap<Integer, String>();\n\t\t\n\t\t// token1000Hash contains the term and Dblocks for the first 1000\n\t\tHashMap<Integer, Multimap> token1000DocHash = new HashMap<Integer, Multimap>();\n\t\t\n\t\t// documentHash contains the doclength of all the documents in the corpus\n\t\tHashMap<String, String> documentHash = new HashMap<String, String>();\t\n\t\t\n\t\t// id holds the document id corresponding to the docNumber.\n\t\tint id = 1;\n\t\t\n\t\t// until all unique terms are exhausted\n\t\t// pass through the documents and index the terms.\n\t\t//while(unique_terms){\n\t\t\t\n\t\t\tFile folder = new File(\"C:/Naveen/CCS/IR/AP89_DATA/AP_DATA/ap89_collection\");\n\t\t\t//File folder = new File(\"C:/Users/Naveen/Desktop/TestFolder\");\n\t\t\tFile[] listOfFiles = folder.listFiles();\n\t\t\t\n\t\t\t//for each file in the folder \n\t\t\tfor (File file : listOfFiles) {\n\t\t\t if (file.isFile()) {\n\t\t\t \t\n\t\t\t \tString str = file.getPath().replace(\"\\\\\",\"//\");\n\t\t\t \t\n\t\t\t \t\n\t\t\t\t\t//Document doc = new Document();\n\t\t\t //System.out.println(\"\"+str);\n\t\t\t\t\t//variables to keep parse document.\n\t\t\t\t\tint docCount = 0;\n\t\t\t\t\tint docNumber = 0;\n\t\t\t\t\tint endDoc = 0;\n\t\t\t\t\tint textCount = 0;\n\t\t\t\t\tint noText = 0;\n\t\t\t\t\tPath path = Paths.get(str);\n\t\t\t\t\t\n\t\t\t\t\t//Document id and text\n\t\t\t\t\tString docID = null;\n\t\t\t\t\tString docTEXT = null;\n\t\t\t\t\t\n\t\t\t\t\t//Stringbuffer to hold the text of each document\n\t\t\t\t\tStringBuffer text = new StringBuffer();\n\t\t\t\t\t\n\t\t\t\t\tScanner scanner = new Scanner(path);\n\t\t\t\t\twhile(scanner.hasNext()){\n\t\t\t\t\t\tString line = scanner.nextLine();\n\t\t\t\t\t\tif(line.contains(\"<DOC>\")){\n\t\t\t\t\t\t\t++docCount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(line.contains(\"</DOC>\")){\n\t\t\t\t\t\t\t++endDoc;\n\t\t\t\t\t\t\tdocTEXT = text.toString();\n\t\t\t\t\t\t\t//docTEXT = docTEXT.replaceAll(\"[\\\\n]\",\" \");\n\t\t\t\t\t\t\tSystem.out.println(\"ID: \"+id);\n\t\t\t\t\t\t\t//System.out.println(\"TEXT: \"+docTEXT);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// text with stop words removed\n\t\t\t\t\t\t\tPattern pattern1 = Pattern.compile(\"\\\\b(?:\"+stopwords+\")\\\\b\\\\s*\", Pattern.CASE_INSENSITIVE);\n\t\t\t\t\t\t\tMatcher matcher1 = pattern1.matcher(docTEXT);\n\t\t\t\t\t\t\tdocTEXT = matcher1.replaceAll(\"\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// text with stemming\n\t\t\t\t\t\t\t//docTEXT = stemmer(docTEXT);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint docLength = 1;\n\t\t\t\t\t\t\t// regex to build the tokens from the document text\n\t\t\t\t\t\t\tPattern pattern = Pattern.compile(\"\\\\w+(\\\\.?\\\\w+)*\");\n\t\t\t\t\t\t\tMatcher matcher = pattern.matcher(docTEXT.toLowerCase());\n\t\t\t\t\t\t\twhile (matcher.find()) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor (int i = 0; i < matcher.groupCount(); i++) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// alltermHash contains term and term id\n\t\t\t\t\t\t\t\t\t// if term is present in the alltermHash\n\t\t\t\t\t\t\t\t\tif(allTermHash.containsKey(matcher.group(i))){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tint termId = allTermHash.get(matcher.group(i));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//if term is present in the token1000Hash\n\t\t\t\t\t\t\t\t\t\t//then update the dblock of the term.\n\t\t\t\t\t\t\t\t\t\tif(token1000DocHash.containsKey(termId)){\n\t\t\t\t\t\t\t\t\t\t\tMultimap<String, String> dBlockUpdate = token1000DocHash.get(termId);\n\t\t\t\t\t\t\t\t\t\t\t//Multimap<Integer, Integer> dBlockUpdate = token1000DocHash.get(matcher.group(i));\n\t\t\t\t\t\t\t\t\t\t\tif(dBlockUpdate.containsKey(id)){\n\t\t\t\t\t\t\t\t\t\t\t\tdBlockUpdate.put(String.valueOf(id), String.valueOf(matcher.start()));\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\tdBlockUpdate.put(String.valueOf(id), String.valueOf(matcher.start()));\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//if term is not present in the token1000hash\n\t\t\t\t\t\t\t\t\t\t//then add the token with its dBlock\n\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\tMultimap<String, String> dBlockInsert = ArrayListMultimap.create();\n\t\t\t\t\t\t\t\t\t\t\tdBlockInsert.put(String.valueOf(id), String.valueOf(matcher.start()));\n\t\t\t\t\t\t\t\t\t\t\ttoken1000DocHash.put(termId, dBlockInsert);\t\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// if the term is not present I will put the term into allTermHash\n\t\t\t\t\t\t\t\t\t// put corresponding value into the token1000DocHash and increment\n\t\t\t\t\t\t\t\t\t// termIndex\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\tallTermHash.put(matcher.group(i),termIndex);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tMultimap<String, String> dBlockInsert = ArrayListMultimap.create();\n\t\t\t\t\t\t\t\t\t\tdBlockInsert.put(String.valueOf(id), String.valueOf(matcher.start()));\n\t\t\t\t\t\t\t\t\t\ttoken1000DocHash.put(termIndex, dBlockInsert);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\ttermIndex++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocLength++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(id%1000 == 0){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// then dump index file to HDD\n\t\t\t\t\t\t\t\t\twriteInvertedIndex(token1000DocHash,\"token1000DocHash\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// update catalog file\n\t\t\t\t\t\t\t\t\t// to populate catalogHash with the offset\n\t\t\t\t\t\t\t\t\tfor(Entry<Integer, Multimap> entry : token1000DocHash.entrySet()){\n\t\t\t\t\t\t\t\t\t\tif(catalogHash.containsKey(entry.getKey())){\n\t\t\t\t\t\t\t\t\t\t\tint len = (entry.getKey()+\":\"+entry.getValue()).length();\n\t\t\t\t\t\t\t\t\t\t\t//String offset = String.valueOf(startOffset)+\":\"+String.valueOf(len);\n\t\t\t\t\t\t\t\t\t\t\tMultimap<String, String> catUpdate = catalogHash.get(entry.getKey());\n\t\t\t\t\t\t\t\t\t\t\tcatUpdate.put(String.valueOf(startOffset), String.valueOf(len));\n\t\t\t\t\t\t\t\t\t\t\tcatalogHash.put(entry.getKey(), catUpdate);\n\t\t\t\t\t\t\t\t\t\t\tstartOffset += len+2;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\tint len = (entry.getKey()+\":\"+entry.getValue()).length();\n\t\t\t\t\t\t\t\t\t\t\t//String offset = String.valueOf(startOffset)+\":\"+String.valueOf(len);\n\t\t\t\t\t\t\t\t\t\t\tMultimap<String, String> catInsert = ArrayListMultimap.create();\n\t\t\t\t\t\t\t\t\t\t\tcatInsert.put(String.valueOf(startOffset), String.valueOf(len));\n\t\t\t\t\t\t\t\t\t\t\tcatalogHash.put(entry.getKey(), catInsert);//entry.getValue());\n\t\t\t\t\t\t\t\t\t\t\tstartOffset += len+2;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//clear the token1000DocHash\n\t\t\t\t\t\t\t\t\ttoken1000DocHash.clear();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdocumentHash.put(docID, \"\"+id+\":\"+docLength);\n\t\t\t\t\t\t\tid++;\n\t\t\t\t\t\t\ttext = new StringBuffer();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(line.contains(\"<DOCNO>\")){\n\t\t\t\t\t\t\t++docNumber;\n\t\t\t\t\t\t\tdocID = line.substring(8, 21);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(line.contains(\"<TEXT>\")){\n\t\t\t\t\t\t\t++textCount;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if((line.contains(\"<DOC>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</DOC>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<DOCNO>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<FILEID>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<FIRST>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<SECOND>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<HEAD>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</HEAD>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<BYLINE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</BYLINE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<UNK>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</UNK>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<DATELINE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<NOTE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</NOTE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</TEXT>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<TEXT>\"))){\n\t\t\t\t\t\t\t ++noText;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(endDoc == docCount - 1){\n\t\t\t\t\t\t\ttext.append(line);\n\t\t\t\t\t\t\ttext.append(\" \");\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 }//end of if - to check if this is a file and parse.\n\t\t\t \n\t\t\t}//end of for loop to load each file\n\t\t\t\n\t\t//}//end of while loop \n\t\t\n\t// write catalogfile to the hdd to check.\n\t\t\t\n\t\t\t// then dump index file to HDD\n\t\t\twriteInvertedIndex(token1000DocHash,\"token1000DocHash\");\n\t\t\t\n\t\t\t// update catalog file\n\t\t\t// to populate catalogHash with the offset\n\t\t\tfor(Entry<Integer, Multimap> entry : token1000DocHash.entrySet()){\n\t\t\t\tif(catalogHash.containsKey(entry.getKey())){\n\t\t\t\t\tint len = (entry.getKey()+\":\"+entry.getValue()).length();\n\t\t\t\t\t//String offset = String.valueOf(startOffset)+\":\"+String.valueOf(len);\n\t\t\t\t\tMultimap<String, String> catUpdate = catalogHash.get(entry.getKey());\n\t\t\t\t\tcatUpdate.put(String.valueOf(startOffset), String.valueOf(len));\n\t\t\t\t\tcatalogHash.put(entry.getKey(), catUpdate);\n\t\t\t\t\tstartOffset += len+2;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tint len = (entry.getKey()+\":\"+entry.getValue()).length();\n\t\t\t\t\t//String offset = String.valueOf(startOffset)+\":\"+String.valueOf(len);\n\t\t\t\t\tMultimap<String, String> catInsert = ArrayListMultimap.create();\n\t\t\t\t\tcatInsert.put(String.valueOf(startOffset), String.valueOf(len));\n\t\t\t\t\tcatalogHash.put(entry.getKey(), catInsert);//entry.getValue());\n\t\t\t\t\tstartOffset += len+2;\n\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\twriteInvertedIndex(catalogHash,\"catalogHash\");\n\t\t\tprintHashMapSI(allTermHash);\n\t\t\tprintHashMapSS(documentHash);\n\t\t\t\n\t\t\tlong InvIndstartOffset = 0;\n\t\t\t\n\t\t\t//write it to file\n \n\t\t\t//change the finalcatalogHash to the form termid:startoffset:length\n\t\t\tfor (Integer name: catalogHash.keySet()){\n\t String key = name.toString();\n\t String value = catalogHash.get(name).toString(); \n\t //System.out.println(key + \" \" + value); \n\t String finalTermIndex = genInvertedIndex(key, value);\n\t finalTermIndex = key+\":\"+finalTermIndex;\n\t int indexLength = finalTermIndex.length();\n\t \n\t \n\t PrintWriter writer = new PrintWriter(new BufferedWriter\n\t \t\t(new FileWriter(\"C:/Users/Naveen/Desktop/TestRuns/LastRun/InvertedIndex\", true)));\n\t writer.println(finalTermIndex);\n\t writer.close();\n\t \n\t //update the finalcatalogHash\n\t //Multimap<String, String> catInsert = ArrayListMultimap.create();\n\t\t\t\t//catInsert.put(String.valueOf(InvIndstartOffset), String.valueOf(indexLength));\n\t\t\t\tfinalCatalogHash.put(name, String.valueOf(InvIndstartOffset)+\":\"+String.valueOf(indexLength));//entry.getValue());\n\t\t\t\tInvIndstartOffset += indexLength+2;\n\t \n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tprintHashMapIS(finalCatalogHash);\n\t\t\t\n\t}", "public static TreeMap<Integer,String> calc_tf_idf( String \tbaseFolder,\n\t\t\t\t\t\t\t\t\t\t\t\t\t String baseFolder_out,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tString \tinputFile, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tString delimiter_for_inputFile,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tint \ttoken_index_having_text,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tString \toutFile,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tboolean is_do_stemming_on_word,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tboolean is_ignore_stop_words_all_together,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tboolean isSOPprint\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t){\n\t\tTreeMap<Integer,String> mapOut=new TreeMap<Integer, String>();\n\t\ttry{\n\t\t\tString line=\"\";\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream( inputFile) ));\n\t\t\t//boolean is_do_stemming_on_word=true;\n\t\t\tStemmer stemmer=new Stemmer(); String token=\"\";\n\t\t TreeMap<String, Integer> mapVoc_Freq=new TreeMap<String, Integer>();\n\t\t TreeMap<String, List<Integer>> map_Word_UniqueDocumentIdHavingIT=new TreeMap<String, List<Integer>>();\n\t\t TreeMap<Integer, TreeMap<String, Integer > > map_DocID_wordFrequency=new TreeMap<Integer, TreeMap<String,Integer>>();\n\t\t\t\tint lineNumber=0; int last_doc_id=-1;\n\t\t\t\n\t\t\tFileWriter writer_voc=new FileWriter(new File(baseFolder_out+\"unique_word_vocabulary.txt\"));\n\t\t\t\t\n\t\t\tFileWriter writer=new FileWriter(new File(outFile));\n\t\t\t// files for docID wordID tf-idf output\n\t\t\tFileWriter writer_no_stopword=new FileWriter(new File(outFile+\"_noStopWord.txt\"));\t\t\t\n\t\t\tFileWriter writer_wordID=new FileWriter(new File(outFile+\"_WORD_ID.txt\"));\n\t\t\tFileWriter writer_wordID_no_stopword=new FileWriter(new File(outFile+\"_noStopWord_WORD_ID.txt\"));\n\t\t\tFileWriter writer_word_stemmedWord=new FileWriter(new File(outFile+\"_Word_stemmedWord.txt\"));\n\t\t\t\n\t\t\t// files for docID wordID frequency output\n\t\t\tFileWriter writer2=new FileWriter(new File(outFile+\"_docWordID_freq2.txt\"));\n\t\t\tFileWriter writer2_no_stopword=new FileWriter(new File(outFile+\"_noStopWord2.txt\"));\n\t\t\tFileWriter writer2_wordID=new FileWriter(new File(outFile+\"_WORD_ID2.txt\"));\n\t\t\tFileWriter writer2_wordID_no_stopword=new FileWriter(new File(outFile+\"_noStopWord_WORD_ID2.txt\"));\n\t\t\tFileWriter writer2_word_stemmedWord=new FileWriter(new File(outFile+\"_Word_stemmedWord2.txt\"));\n\t\t\t\n\n\t\t\t\n\t\t\tFileWriter writer_debug=new FileWriter(new File(outFile+\"_DEBUG.txt\"));\n\t\t\tFileWriter writer_debug_2=new FileWriter(new File(outFile+\"_DEBUG_2.txt\"));\n\t\t\t\n\t\t\tTreeMap<String,Integer> map_already_wrote=new TreeMap<String, Integer>();\n\t\t\t//\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tlineNumber++;\n\t\t\t\tSystem.out.println(\"lineNumber:\"+lineNumber);\n\t\t\t\t\n\t\t\t\t//DEBUG BREAK\n//\t\t\t\tif(lineNumber>100) break;\n\t\t\t\t\n\t\t\t\t//mapVoc_Freq=new TreeMap<String, Integer>();\n\t\t\t\tint curr_doc_id=lineNumber;\n\t\t\t\tString [] token_= line.split(delimiter_for_inputFile);\n\t\t\t\t\n\t\t\t\t //clean\n\t\t\t\t token=token_[token_index_having_text-1].replace(\"\\\"\", \" \").replace(\"'\", \" \").replace(\",\", \" \").replace(\";\",\" \").replace(\".\", \" \")\n\t\t\t\t\t\t\t\t .replace(\"‘\", \" \").replace(\"“\", \" \").replace(\"–\", \" \").replace(\")\", \" \").replace(\"(\", \" \")\n\t\t\t\t\t\t\t\t .replace(\"-\", \" \").replace(\":\", \" \").replace(\"’\", \" \").replace(\"”\", \" \").replace(\"—\", \" \")\n\t\t\t\t\t\t\t\t .replace(\"#\", \" \").replace(\"%\", \" \")//.replace(\"$\", \" \")\n\t\t\t\t\t\t\t\t .replace(\"/\",\" \")\n\t\t\t\t\t\t\t\t .replace(\" \", \" \");\n\t\t\t\t \n\t\t\t\t token=token.toLowerCase();\n\n\t\t\t\t \n\t\t\t\t // \n\t\t\t\t String [] arr_token=token.split(\" \");\n\t\t\t\t int cnt=0;\n\t\t\t\t // \n\t\t\t\t while(cnt < arr_token.length){\n\t\t\t\t\t String temp= Ltrim.ltrim( arr_token[cnt]);\n\t\t\t\t\t \n\t\t\t\t\t // ignore stop words all together\n\t\t\t\t\t if(is_ignore_stop_words_all_together==true && Stopwords.is_stopword(temp)){\n\t\t\t\t\t\t cnt++;\n\t\t\t\t\t\t continue;\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t // do stemming\n\t\t\t\t\t if(is_do_stemming_on_word){\n\t\t\t\t\t\t String orig_temp=temp;\n\t\t\t\t\t\t //ltrim.ltrim(\n\t\t\t\t\t\t temp= stemmer.stem(temp);\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(!map_already_wrote.containsKey(orig_temp)){\n\t\t\t\t\t\t\t writer_word_stemmedWord.append(orig_temp+\"!!!\"+temp +\"\\n\");\n\t\t\t\t\t\t\t writer_word_stemmedWord.flush();\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t map_already_wrote.put(orig_temp, -1);\n\t\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t\t else \n\t\t\t\t\t\t temp=temp;\n\n\t\t\t\t\t\t // \n\t\t\t\t\t\t if(!mapVoc_Freq.containsKey(temp)){\n\t\t\t\t\t\t\t //vocabulary term-freq\n\t\t\t\t\t\t\t mapVoc_Freq.put(temp, 1);\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t //word-document freq- unique number of documents this word occurs.\n\t\t\t\t\t\t\t List l=new ArrayList<Integer>();\n\t\t\t\t\t\t\t l.add(curr_doc_id);\n\t\t\t\t\t\t\t map_Word_UniqueDocumentIdHavingIT.put(temp, l);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t //doc-wise frequency\n\t\t\t\t\t\t\t if(!map_DocID_wordFrequency.containsKey(curr_doc_id)){\n\t\t\t\t\t\t\t\t TreeMap<String,Integer> t2=new TreeMap<String, Integer>();\n\t\t\t\t\t\t\t\t t2.put( temp, 1 ) ;\n\t\t\t\t\t\t\t\t map_DocID_wordFrequency.put(curr_doc_id, t2);\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t TreeMap<String,Integer> t2=map_DocID_wordFrequency.get(curr_doc_id);\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t if(!t2.containsKey(temp)){\n\t\t\t\t\t\t\t\t\t TreeMap<String,Integer> t2_2=map_DocID_wordFrequency.get(curr_doc_id);\n\t\t\t\t\t\t\t\t\t t2_2.put( temp, 1 ) ;\n\t\t\t\t\t\t\t\t\t map_DocID_wordFrequency.put(curr_doc_id, t2_2);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t\t TreeMap<String,Integer> t2_2=map_DocID_wordFrequency.get(curr_doc_id);\n\t\t\t\t\t\t\t\t\t int sz=t2.get(temp)+1;\n\t\t\t\t\t\t\t\t\t t2_2.put( temp, sz ) ;\n\t\t\t\t\t\t\t\t\t map_DocID_wordFrequency.put(curr_doc_id, t2_2);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t }\n\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t int freq=mapVoc_Freq.get(temp)+1;\n\t\t\t\t\t\t\t //System.out.println(\"last_doc_id!=curr_doc_id->\"+last_doc_id+\"<-->\"+curr_doc_id );\n\t\t\t\t\t\t\t //vocabulary term-freq\n\t\t\t\t\t\t\t mapVoc_Freq.put(temp, freq);\n\t\t\t\t\t\t\t // word-document freq- unique number of documents this word occurs.\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t List<Integer> uniq_doc=map_Word_UniqueDocumentIdHavingIT.get(temp);\n\t\t\t\t\t\t\t\t // if this docID not contained before in list\n\t\t\t\t\t\t\t\t if(!uniq_doc.contains(curr_doc_id)){\n\t\t\t\t\t\t\t\t\t uniq_doc.add(curr_doc_id );\n\t\t\t\t\t\t\t\t\t map_Word_UniqueDocumentIdHavingIT.put(temp, uniq_doc);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t //doc-wise frequency\n\t\t\t\t\t\t\t\t if(!map_DocID_wordFrequency.containsKey(curr_doc_id)){\n\t\t\t\t\t\t\t\t\t TreeMap<String,Integer> t2=new TreeMap<String, Integer>();\n\t\t\t\t\t\t\t\t\t t2.put( temp, 1 ) ;\n\t\t\t\t\t\t\t\t\t map_DocID_wordFrequency.put(curr_doc_id, t2);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t\t TreeMap<String,Integer> t2=map_DocID_wordFrequency.get(curr_doc_id);\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t if(!t2.containsKey(temp)){\n\t\t\t\t\t\t\t\t\t\t TreeMap<String,Integer> t2_2=map_DocID_wordFrequency.get(curr_doc_id);\n\t\t\t\t\t\t\t\t\t\t t2_2.put( temp, 1 ) ;\n\t\t\t\t\t\t\t\t\t\t map_DocID_wordFrequency.put(curr_doc_id, t2_2);\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t\t\t TreeMap<String,Integer> t2_2=map_DocID_wordFrequency.get(curr_doc_id);\n\t\t\t\t\t\t\t\t\t\t int sz=t2.get(temp)+1;\n\t\t\t\t\t\t\t\t\t\t t2_2.put( temp, sz ) ;\n\t\t\t\t\t\t\t\t\t\t map_DocID_wordFrequency.put(curr_doc_id, t2_2);\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t }\n\t\t\t\t\tcnt++;\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t if(isSOPprint){\n\t\t\t\t\t System.out.println(\"doc:\"+curr_doc_id+\" token-freq:\"+mapVoc_Freq.size()+\" token-doc.freq:\"+map_Word_UniqueDocumentIdHavingIT.size());\n\t\t\t\t }\n\t\t\t\t //\n\t\t\t\t last_doc_id=curr_doc_id;\n\t\t\t}\n\t\t\tSystem.out.println(\" token-freq:\"+mapVoc_Freq.size()+\" token-doc.freq:\"+map_Word_UniqueDocumentIdHavingIT.size());\n\t\t\tint uniq_word_id=1;\n\t\t\tTreeMap<String, Integer> mapVocabulary_word_wordID= new TreeMap<String, Integer>();\n\t\t\t// create uniq_word_id for each word in vocabulary\n\t\t\tfor(String word:mapVoc_Freq.keySet()){\n\t\t\t\tmapVocabulary_word_wordID.put(word, uniq_word_id);\n\t\t\t\t\n\t\t\t\twriter_voc.append(word+\"!!!\"+uniq_word_id+\"\\n\");\n\t\t\t\twriter_voc.flush();\n\t\t\t\t \n\t\t\t\tuniq_word_id++;\n\t\t\t}\n\t\t\tSystem.out.println(\"step 1: running docid-wordid-tf-IDF\");\n\t\t\t//step 1: calculate tf-idf (DONT COMMENT BELOW)\n\t\t\tfor(int docID:map_DocID_wordFrequency.keySet()){\n\t\t\t\t//System.out.println(\"docID:\"+docID+ \" size:\" +map_DocID_wordFrequency.get(docID).size()); //\t+\" word-freq:\"+map_DocID_wordFrequency.get(docID));\n\t\t\t\twriter_debug.append(\"docID:\"+docID+ \" size:\" +map_DocID_wordFrequency.get(docID).size()+\" word-freq:\"+map_DocID_wordFrequency.get(docID)+\"\\n\");\n\t\t\t\twriter_debug.flush();\n\t\t\t\tdouble tf_idf=0.0;\n\t\t\t\t//Iterate each word in current document\n\t\t\t\tfor(String word:map_DocID_wordFrequency.get(docID).keySet() ){\n\t\t\t\t\t//\n\t\t\t\t\tif(mapVoc_Freq.containsKey(word )){\n\t\t\t\t\t\t\n\t\t\t\t\t\t//System.out.println(\"param1,2:\"+map_DocID_wordFrequency.get(docID).get(word) +\" \"+map_Word_UniqueDocumentIdHavingIT.get(word).size() );\n\t\t\t\t\t\t// tf-idf\n\t\t\t\t\t\ttf_idf=map_DocID_wordFrequency.get(docID).get(word) * Math.log10( map_DocID_wordFrequency.size() / map_Word_UniqueDocumentIdHavingIT.get(word).size() );\n\t\t\t\t\t\t//System.out.println();\n\t\t\t\t\t\twriter.append( docID+\"!!!\"+word+\"!!!\"+tf_idf+\"\\n\");\n\t\t\t\t\t\twriter.flush();\n\t\t\t\t\t\t\n\t\t\t\t\t\twriter_wordID.append( docID+\"!!!\"+mapVocabulary_word_wordID.get(word)+\"!!!\"+tf_idf+\"\\n\");\n\t\t\t\t\t\twriter_wordID.flush();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// \n\t\t\t\t\t\tif(!Stopwords.is_stopword(word.toLowerCase())){\n\t\t\t\t\t\t\twriter_no_stopword.append(docID+\"!!!\"+word+\"!!!\"+tf_idf+\"\\n\");\n\t\t\t\t\t\t\twriter_no_stopword.flush();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twriter_wordID_no_stopword.append(docID+\"!!!\"+ mapVocabulary_word_wordID.get(word) +\"!!!\"+tf_idf+\"\\n\");\n\t\t\t\t\t\t\twriter_wordID_no_stopword.flush();\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\telse{\n\t\t\t\t\t\twriter_debug_2.append( \"(not exist in vocab) word->\"+word+\" for doc_id->\"+docID+\"\\n\");\n\t\t\t\t\t\twriter_debug_2.flush();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} //for(int docID:map_DocID_wordFrequency.keySet()){\n\t\t\t\n\t\t\tSystem.out.println(\"step 2: running docid-wordid-frquency\");\n\t\t\t//step 2: (DOC-WORDID AND FREQUENCY)another output - writing <docID!!!wordID!!!frequency>\n\t\t\tfor(int docID:map_DocID_wordFrequency.keySet()){\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"2.docID:\"+docID+ \" size:\" +map_DocID_wordFrequency.get(docID).size()); //\t+\" word-freq:\"+map_DocID_wordFrequency.get(docID));\n\t\t\t\t//writer_debug.append(\"docID:\"+docID+ \" size:\" +map_DocID_wordFrequency.get(docID).size()+\" word-freq:\"+map_DocID_wordFrequency.get(docID)+\"\\n\");\n\t\t\t\t//writer_debug.flush();\n\t\t\t\tint frequency=0;\n\t\t\t\t//Iterate each word in current document\n\t\t\t\tfor(String word:map_DocID_wordFrequency.get(docID).keySet() ){\n\t\t\t\t\t//\n\t\t\t\t\tif(mapVoc_Freq.containsKey(word )){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// System.out.println(\"param1,2:\"+map_DocID_wordFrequency.get(docID).get(word) +\" \"+map_Word_UniqueDocumentIdHavingIT.get(word).size() );\n\t\t\t\t\t\t// frequency\n\t\t\t\t\t\tfrequency=map_DocID_wordFrequency.get(docID).get(word);\n\t\t\t\t\t\t//System.out.println();\n\t\t\t\t\t\twriter2.append( docID+\"!!!\"+word+\"!!!\"+frequency+\"\\n\");\n\t\t\t\t\t\twriter2.flush();\n\t\t\t\t\t\t\n\t\t\t\t\t\twriter2_wordID.append( docID+\"!!!\"+mapVocabulary_word_wordID.get(word)+\"!!!\"+frequency+\"\\n\");\n\t\t\t\t\t\twriter2_wordID.flush();\n\t\t\t\t\t\t \n\t\t\t\t\t\t// \n\t\t\t\t\t\tif(!Stopwords.is_stopword(word.toLowerCase())){\n\t\t\t\t\t\t\twriter2_no_stopword.append(docID+\"!!!\"+word+\"!!!\"+frequency+\"\\n\");\n\t\t\t\t\t\t\twriter2_no_stopword.flush();\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\twriter2_wordID_no_stopword.append(docID+\"!!!\"+ mapVocabulary_word_wordID.get(word) +\"!!!\"+frequency+\"\\n\");\n\t\t\t\t\t\t\twriter2_wordID_no_stopword.flush();\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\telse{\n\t\t\t\t\t\twriter_debug_2.append( \"(not exist in vocab) word->\"+word+\" for doc_id->\"+docID+\"\\n\");\n\t\t\t\t\t\twriter_debug_2.flush();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} //for(int docID:map_DocID_wordFrequency.keySet()){\n\n\t\t\tSystem.out.println(\"********************************************\");\n\t\t\tSystem.out.println(\"File holding the not found words in vocabulary: \"+\"outFile+\\\"_DEBUG_2.txt\\\"\");\n\t\t\tSystem.out.println(\"Doc-wise word freq: \"+\"outFile+\\\"_DEBUG.txt\\\"\");\n\t\t\tSystem.out.println(\"******Below files are docId-wordID-tfIDF\");\n\t\t\tSystem.out.println(\"with Word->\"+outFile);\n\t\t\tSystem.out.println(\"with Word(no stopword)->\"+outFile+\"_noStopWord.txt\");\n\t\t\tSystem.out.println(\"with WordID->\"+outFile+\"_WORD_ID.txt\");\n\t\t\tSystem.out.println(\"with WordID(no stopword)->\"+outFile+\"_noStopWord_WORD_ID.txt\");\n\t\t\tSystem.out.println(\"VOC FILE ->\"+baseFolder+\"unique_word_vocabulary.txt\");\n\t\t\t//**********/\n\t\t\tSystem.out.println(\"***********Below files are docId-wordID-frequency (file ends with \\\"format2.txt\\\"\");\n\t\t\tSystem.out.println( \"\"+outFile+\"_docWordID_freq2.txt\");\n\t\t\tSystem.out.println( \"\"+outFile+\"_noStopWord2.txt\");\n\t\t\tSystem.out.println( \"\"+outFile+\"_WORD_ID2.txt\");\n\t\t\tSystem.out.println( \"\"+outFile+\"_noStopWord_WORD_ID2.txt\");\n\t\t\tSystem.out.println( \"\"+outFile+\"_Word_stemmedWord2.txt\");\n\t\t\t \n\t\t\tmapOut.put(-99, outFile+\"_noStopWord_WORD_ID.txt\");\n\t\t\t//maximum word id\n\t\t\tmapOut.put(1, String.valueOf( uniq_word_id) );\n\t\t}\n\t\tcatch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn mapOut;\n\t}", "public static void DocumentFrequencies() throws FileNotFoundException {\n for (Entry<String, List<Integer>> entry : dictionary.entrySet()) {\n List<Integer> termfrequency = new ArrayList<>();\n\n termfrequency = entry.getValue();\t// getting each word's termfrequency list\n int i = 0;\n termfrequency.add(0); \t\t\t//maintaining documentfrequency at the 57th index\n Integer documentFrequency = termfrequency.get(totaldocument+1);\n while(i<56) { //iterate 0 to 55 all speeches term frequency\n if(termfrequency.get(i)>0) {\t\t//increment document frequency of that word if termfrequency is greater than 0.0\n documentFrequency++;\t\t\t//increment document frequency\n }\n i++;\t\t//increment index\n }\n termfrequency.set(57, documentFrequency);\t//re-set the documentfrequency and save the current maintained document frequency from 0 to calculated value\n dictionary.put(entry.getKey(), termfrequency);\t\t// place the incremented final value of that word back to the same list in dictionary hashmap\n }\n //save();\n }", "public void createIDMap()\n {\n IDMap = new HashMap<>();\n idFile.open(\"idpassword.txt\");\n String line = idFile.getNextLine();\n\n\n\n while(line!=null) {\n String[] fields = line.split(\",\");\n IDMap.put(fields[0], fields[1]);\n\n line = idFile.getNextLine();\n\n }\n\n }", "public void indexDocument(String documentName, ArrayList<String> documentTokens) {\n for (String token : documentTokens) {\n if (!this.index.containsKey(token)) {\n // Create a key with that token\n this.index.put(token, new HashMap<>());\n }\n\n // Get the HashMap associated with that term\n HashMap<String, Integer> term = this.index.get(token);\n\n // Check if term has a posting for the document\n if (term.containsKey(documentName)) {\n // Increase its occurrence by 1\n int occurrences = term.get(documentName);\n term.put(documentName, ++occurrences);\n } else {\n // Create a new posting for the term\n term.put(documentName, 1);\n }\n }\n }", "public void buildWordFileMap(){\n hashWords.clear();\n DirectoryResource dr = new DirectoryResource();\n for (File f : dr.selectedFiles()){ //for all the files selected make the hashWords hashmap\n addWordsFromFile(f);\n }\n \n }", "private void createTokenIndex(){\n\t\tLinkedList<String> tokens = new LinkedList<>(tokenDict.keySet());\n\t\tArrayList<ArrayList<Integer>> vals = new ArrayList<>(tokenDict.values());\n\t\tint k = 8;\n\n\t\tKFront kf = new KFront(true);\n\t\tkf.createKFront(k, tokens);\n\n\t\tTokensIndex tIdx = new TokensIndex(k, this.dir);\n\t\ttIdx.insertData(kf.getTable(), vals, kf.getConcatString());\n\n\t\tsaveToDir(TOKEN_INDEX_FILE, tIdx);\n\t}", "private static Positional_inverted_index posindexCorpus(DocumentCorpus corpus) throws ClassNotFoundException, InstantiationException, IllegalAccessException, FileNotFoundException, IOException {\n\n NewTokenProcessor processor = new NewTokenProcessor();\n Iterable<Document> docs = corpus.getDocuments(); //call registerFileDocumentFactory first?\n\n List<Double> Doc_length = new ArrayList<>();\n Positional_inverted_index index = new Positional_inverted_index();\n\n double token_count = 0;\n\n // Iterate through the documents, and:\n for (Document d : docs) {\n //File f = new File(path + \"\\\\\" + d.getTitle());\n File f = new File(path + \"\\\\\" + d.getFileName().toString());\n double Filesize = f.length();\n //edited by bhavya\n double doc_weight = 0; //first entry in docweights.bin\n double doc_tokens = 0;\n double doc_length = 0;\n HashMap<String, Integer> tftd = new HashMap<>();\n // Tokenize the document's content by constructing an EnglishTokenStream around the document's content.\n Reader reader = d.getContent();\n EnglishTokenStream stream = new EnglishTokenStream(reader); //can access tokens through this stream\n N++;\n // Iterate through the tokens in the document, processing them using a BasicTokenProcessor,\n //\t\tand adding them to the HashSet vocabulary.\n Iterable<String> tokens = stream.getTokens();\n int i = 0;\n\n for (String token : tokens) {\n\n //adding token in index\n List<String> word = new ArrayList<String>();\n word = processor.processToken(token);\n //System.out.println(word.get(0));\n if (word.get(0).matches(\"\")) {\n continue;\n } else {\n\n index.addTerm(word.get(0), i, d.getId());\n\n }\n i = i + 1;\n\n //we check if token already exists in hashmap or not. \n //if it exists, increase its freq by 1 else make a new entry.\n if (tftd.containsKey(word.get(0))) {\n doc_tokens++;\n int count = tftd.get(word.get(0));\n tftd.replace(word.get(0), count + 1);\n } else {\n doc_tokens++;\n// token_count++; //gives total number of tokens.\n tftd.put(word.get(0), 1);\n }\n\n }\n double length = 0;\n double wdt = 0;\n\n double total_tftd = 0;\n for (Map.Entry<String, Integer> entry : tftd.entrySet()) {\n\n wdt = 1 + log(entry.getValue());\n\n length = length + pow(wdt, 2);\n total_tftd = total_tftd + entry.getValue();\n }\n token_count = token_count + doc_tokens;\n doc_weight = pow(length, 0.5);\n double avg_tftd = total_tftd / (double) tftd.size();\n\n Doc_length.add(doc_weight);\n Doc_length.add(avg_tftd);\n Doc_length.add(doc_tokens);\n Doc_length.add(Filesize);\n }\n Doc_length.add(token_count / N);\n\n DiskIndexWriter d = new DiskIndexWriter();\n d.write_doc(path, Doc_length);\n\n return index;\n }", "static void idlize() throws IOException {\r\n\t\t/**give mid who has name a id, for other mid, keep using mid to identify them*/\r\n\t\t//\t\tHashMap<String, Integer> namedmid2name = new HashMap<String, Integer>(20000000);\r\n\t\t//\t\tHashMap<String, Integer> relationname2id = new HashMap<String, Integer>(1000000);\r\n\t\t//\t\tDelimitedWriter dw = new DelimitedWriter(Main.dir + \"/visible_idize\");\r\n\t\t//\t\tDelimitedWriter dw_debug = new DelimitedWriter(Main.dir + \"/visible_debug\");\r\n\t\t//\t\t{\r\n\t\t//\t\t\tDelimitedReader dr = new DelimitedReader(Main.file_fbenglishname);\r\n\t\t//\t\t\tString[] l;\r\n\t\t//\t\t\twhile ((l = dr.read()) != null) {\r\n\t\t//\t\t\t\tnamedmid2name.put(l[0], namedmid2name.size());\r\n\t\t//\t\t\t}\r\n\t\t//\t\t\tD.p(\"load mid2name finished\");\r\n\t\t//\t\t\tdr.close();\r\n\t\t//\t\t}\r\n\t\t//\t\t{\r\n\t\t//\t\t\tDelimitedReader dr = new DelimitedReader(Main.file_visible_str);\r\n\t\t//\t\t\tString[] l;\r\n\t\t//\t\t\twhile ((l = dr.read()) != null) {\r\n\t\t//\t\t\t\tString mid = l[0];\r\n\t\t//\t\t\t\tInteger gid = namedmid2name.get(mid);\r\n\t\t//\t\t\t\tif (gid == null) {\r\n\t\t//\t\t\t\t\tdw_debug.write(l);\r\n\t\t//\t\t\t\t\tcontinue;\r\n\t\t//\t\t\t\t}\r\n\t\t//\t\t\t\tString relationname = l[2];\r\n\t\t//\t\t\t\tif (!relationname2id.containsKey(relationname)) {\r\n\t\t//\t\t\t\t\trelationname2id.put(relationname, relationname2id.size());\r\n\t\t//\t\t\t\t}\r\n\t\t//\t\t\t\tint relid = relationname2id.get(relationname);\r\n\t\t//\t\t\t\tdw.write(l[1], gid, relid, l[3]);\r\n\t\t//\t\t\t}\r\n\t\t//\t\t\tdr.close();\r\n\t\t//\t\t}\r\n\t\t//\t\t{\r\n\t\t//\t\t\tDelimitedReader dr = new DelimitedReader(Main.file_visible_str);\r\n\t\t//\t\t\tString[] l;\r\n\t\t//\t\t\twhile ((l = dr.read()) != null) {\r\n\t\t//\t\t\t\tString mid1 = l[0];\r\n\t\t//\t\t\t\tString mid2 = l[3];\r\n\t\t//\t\t\t\tInteger gid1 = namedmid2name.get(mid1);\r\n\t\t//\t\t\t\tInteger gid2 = namedmid2name.get(mid2);\r\n\t\t//\t\t\t\tif (gid1 == null || gid2 == null) {\r\n\t\t//\t\t\t\t\tdw_debug.write(l);\r\n\t\t//\t\t\t\t\tcontinue;\r\n\t\t//\t\t\t\t}\r\n\t\t//\t\t\t\tString relationname = l[2];\r\n\t\t//\t\t\t\tif (!relationname2id.containsKey(relationname)) {\r\n\t\t//\t\t\t\t\trelationname2id.put(relationname, relationname2id.size());\r\n\t\t//\t\t\t\t}\r\n\t\t//\t\t\t\tint relid = relationname2id.get(relationname);\r\n\t\t//\t\t\t\tdw.write(l[1], gid1, relid, gid2, l[3]);\r\n\t\t//\t\t\t}\r\n\t\t//\t\t\tdr.close();\r\n\t\t//\t\t}\r\n\t\t//\t\tdw.close();\r\n\t\t//\t\t{\r\n\t\t//\t\t\tDelimitedWriter dwrel = new DelimitedWriter(Main.dir + \"/visible_relations.temp\");\r\n\t\t//\t\t\tfor (Entry<String, Integer> e : relationname2id.entrySet()) {\r\n\t\t//\t\t\t\tdwrel.write(e.getValue(), e.getKey());\r\n\t\t//\t\t\t}\r\n\t\t//\t\t\tdwrel.close();\r\n\t\t//\t\t\tSort.sort(Main.dir + \"/visible_relations.temp\", Main.dir + \"/visible_relations\", Main.dir,\r\n\t\t//\t\t\t\t\tnew Comparator<String[]>() {\r\n\t\t//\t\t\t\t\t\t@Override\r\n\t\t//\t\t\t\t\t\tpublic int compare(String[] o1, String[] o2) {\r\n\t\t//\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t//\t\t\t\t\t\t\treturn Integer.parseInt(o1[0]) - Integer.parseInt(o2[0]);\r\n\t\t//\t\t\t\t\t\t}\r\n\t\t//\r\n\t\t//\t\t\t\t\t});\r\n\t\t//\t\t}\r\n\t\t//\t\t{\r\n\t\t//\t\t\tDelimitedWriter dwmid = new DelimitedWriter(Main.dir + \"/visible_mid2gid.temp\");\r\n\t\t//\t\t\tfor (Entry<String, Integer> e : namedmid2name.entrySet()) {\r\n\t\t//\t\t\t\tdwmid.write(e.getValue(), e.getKey());\r\n\t\t//\t\t\t}\r\n\t\t//\t\t\tdwmid.close();\r\n\t\t//\t\t\tSort.sort(Main.dir + \"/visible_mid2gid.temp\", Main.dir + \"/visible_mid2gid\", Main.dir,\r\n\t\t//\t\t\t\t\tnew Comparator<String[]>() {\r\n\t\t//\t\t\t\t\t\t@Override\r\n\t\t//\t\t\t\t\t\tpublic int compare(String[] o1, String[] o2) {\r\n\t\t//\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t//\t\t\t\t\t\t\treturn Integer.parseInt(o1[0]) - Integer.parseInt(o2[0]);\r\n\t\t//\t\t\t\t\t\t}\r\n\t\t//\r\n\t\t//\t\t\t\t\t});\r\n\t\t//\t\t}\r\n\t}", "public void map()\n\t{\n\t // key is the documentId\n\t\t// value is the url\n\t\t//fetch the document using the documentId\n\t\t\n\t}", "private void saveMap() {\r\n new Thread(() -> {\r\n try {\r\n FileOutputStream f = new FileOutputStream(this.save_file);\r\n ObjectOutputStream S = new ObjectOutputStream(f);\r\n S.writeObject(this.music_map);\r\n S.close();\r\n f.close();\r\n if (!this.save_file.setLastModified(this.music_root.lastModified())) {\r\n throw new IllegalStateException(\"Impossibile aggiornare il file dizionario\");\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }).start();\r\n }", "private static void collectVariables(Document document){\n //collecting all the nodes inside a list\n nodeList = document.selectNodes(NOTES);\n\n //initialising the lists\n entriesList = new ArrayList<>();\n locationsList = new ArrayList<>();\n attachmentList = new ArrayList<>();\n tagsForEntryList = new ArrayList<>();\n\n //hashSet for handling the duplicate fileNames\n fileNameSet = new LinkedHashSet<>();\n\n //linkedHashMap for storing the uid for each tag\n uidForEachTag = new LinkedHashMap<>();\n uidForEachLocation = new LinkedHashMap<>();\n\n //id set for storing unique location id\n locationsIdSet = new LinkedHashSet<>();\n\n Tags tags;\n Location location;\n Entry entry;\n Attachment attachment;\n\n byte[] decoded = null;\n\n //looping through the list\n for(Node node : nodeList){\n\n String title = \"\";\n String parsedHtml = \"\";\n String formattedDate = \"\";\n String location_uid = \"\";\n String mime = \"\";\n String fileName = \"\";\n String attachment_uid = null;\n String entry_uid = \"\";\n String type = \"photo\";\n String baseEncoding;\n String tag_uid = \"\";\n\n //get all tags including duplicates\n if( node.selectSingleNode(TAG) !=null) {\n List<Node> evernote_tags = node.selectNodes(TAG);\n for (Node evenote_tag : evernote_tags) {\n //generate unique id for the tag and map it.\n //if the name id pair does not exist\n if(!uidForEachTag.containsKey(evenote_tag.getText())) {\n uidForEachTag.put(evenote_tag.getText(), Entry.generateRandomUid());\n }\n //create new diaro.Tags Object\n tags = new Tags(uidForEachTag.get(evenote_tag.getText()),evenote_tag.getText());\n tagsForEntryList.add(tags);\n }\n }\n\n //get all Locations\n // using diaro.Entry.concatLatLng to add title as {<Latitude></Latitude>,<Longitude></Longitude>}\n if( node.selectSingleNode(LATITUDE) != null && node.selectSingleNode(LONGITUDE) != null) {\n String latitude = String.format(\"%.5f\",Double.parseDouble(node.selectSingleNode(LATITUDE).getText()));\n String longitude = String.format(\"%.5f\",Double.parseDouble(node.selectSingleNode(LONGITUDE).getText()));\n String location_title = (ImportUtils.concatLatLng(latitude, longitude));\n\n //mapping every uid to the address\n if(!uidForEachLocation.containsKey(location_title)) {\n uidForEachLocation.put(location_title, Entry.generateRandomUid());\n }\n location_uid = uidForEachLocation.get(location_title);\n location = new Location(location_uid,latitude,longitude,location_title, location_title, DEFAULT_ZOOM);\n if (!locationsIdSet.contains(location.location_uid)) {\n locationsList.add(location);\n locationsIdSet.add(location.location_uid);\n }\n }\n\n //get all Entries\n if(node.selectSingleNode(TITLE) != null ){\n title = node.selectSingleNode(TITLE).getText();\n }\n if(node.selectSingleNode(CONTENT) != null ){\n String text = node.selectSingleNode(CONTENT).getText();\n // using Jsoup to parseXml HTML inside Content\n parsedHtml = Jsoup.parse(text).text();\n }\n if(node.selectSingleNode(CREATED) != null){\n String date = node.selectSingleNode(CREATED).getText().substring(0, 8);\n String month = date.substring(4, 6);\n String day = date.substring(6, 8);\n String year = date.substring(2, 4);\n formattedDate = String.format(\"%s/%s/%s\", month, day, year);\n }\n\n //get all the tags\n //append all the string stringBuilder\n if(tagsForEntryList.size() != 0){\n for(Tags tag : tagsForEntryList) {\n tag_uid = tag_uid + (\",\") + (String.join(\",\", tag.tagsId));\n }\n tag_uid = tag_uid + (\",\");\n System.out.println(tag_uid);\n\n }\n entry = new Entry();\n entry.setUid(Entry.generateRandomUid());\n entry.setTz_offset(OFFSET);\n entry.setDate(formattedDate);\n entry.setText(parsedHtml);\n entry.setTitle(title);\n entry.setFolder_uid(FOLDER_UID);\n entry.setLocation_uid(location_uid);\n entry.setTags(tag_uid);\n //clear the list\n //clear the tag_uid variable for next loop\n tagsForEntryList.clear();\n tag_uid = \"\";\n //add entry in the list\n entriesList.add(entry);\n\n //get all the attachments\n if (node.selectSingleNode(RESOURCE) != null) {\n List<Node> attachmentsForEachEntry = node.selectNodes(RESOURCE);\n //loop through all the attachments for a single note/entry\n for (Node attachmentForeach : attachmentsForEachEntry) {\n try {\n mime = attachmentForeach.selectSingleNode(MIME).getText();\n\n }catch( NullPointerException e){\n e.printStackTrace();\n }\n // check for a valid attachment\n if(checkForImageMime(mime)) {\n try {\n fileName = attachmentForeach.selectSingleNode(RESOURCE_ATTRIBUTE_FILENAME).getText();\n attachment_uid = Entry.generateRandomUid();\n entry_uid = entry.uid;\n baseEncoding = attachmentForeach.selectSingleNode(DATA).getText();\n //----- please do a check for valid Base64--\n decoded = Base64.getMimeDecoder().decode(baseEncoding);\n // assign primary_photo uid to entry\n entry.primary_photo_uid = attachment_uid;\n }catch(IllegalArgumentException | NullPointerException e){\n e.printStackTrace();\n }\n // check if the fileName already exists\n // if true generate a new fileName to prevent duplicates\n if(fileNameSet.add(fileName)){\n fileNameSet.add(fileName);\n attachment = new Attachment(attachment_uid, entry_uid, type,fileName,decoded);\n }else{\n String newFileName = ImportUtils.generateNewFileName(fileName);\n fileNameSet.add(newFileName);\n attachment = new Attachment(attachment_uid, entry_uid, type,newFileName,decoded);\n }\n attachmentList.add(attachment);\n }\n }\n }\n }\n\n }", "private HashMap<String, HashSet<String>> convertIndexToMap(IndexReader reader) throws IOException{\n\t\t HashMap<String, HashSet<String>> hmap = new HashMap<String, HashSet<String>>();\n\t\t HashSet<String> docIdSet;\n\t\t \n\t\t for(int i=0; i<reader.numDocs(); i++){\n\t\t\t Fields termVect = reader.getTermVectors(i);\n\n\t\t\t if(termVect == null)\n\t\t\t\t continue;\n\t\t\t \n\t for (String field : termVect) {\n\t \t \n\t Terms terms = termVect.terms(field);\n\t TermsEnum termsEnum = terms.iterator();\n\t Document doc = reader.document(i);\n\t \n\t while(termsEnum.next() != null){\n\t \t BytesRef term = termsEnum.term();\n\t \t String strTerm = term.utf8ToString();\n\t \t \n\t \t if (hmap.containsKey(strTerm)){\n\t \t\t docIdSet = hmap.get(strTerm);\n\t \t\t docIdSet.add(doc.get(\"url\"));\n\t \t } else{\n\t \t\t docIdSet = new HashSet<String>();\n\t \t\t docIdSet.add(doc.get(\"url\"));\n\t \t\t hmap.put(strTerm, docIdSet);\n\t \t }\n\t }\n\t }\n\t\t }\n\t\t \n\t\t return hmap;\n\t}", "public void IndexADocument(String docno, String content) throws IOException {\n\t\tthis.idWriter.write(docID+\":\"+docno);\n\t\tthis.idWriter.newLine();\n\t\tthis.idWriter.flush();\n\t\tString[] words = content.split(\" \");\n\t\tHashMap<String,Integer> count = new HashMap<>();\n\t\tfor(String s:words){\n\t\t\tcount.put(s,count.getOrDefault(s,0)+1);\n\t\t}\n\t\tfor(String key: count.keySet()){\n\t\t\tif(this.map.containsKey(key)){\n\t\t\t\tthis.map.get(key).append(docID).append(\":\").append(count.get(key)).append(\",\");\n\t\t\t}else {\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\tthis.map.put(key, sb.append(docID).append(\":\").append(count.get(key)).append(\",\"));\n\t\t\t}\n\t\t}\n\t\tdocID++;\n\t}", "public void writeDocumentForA(String filename, String path) throws Exception\r\n\t{\n\t\tFile folder = new File(path);\r\n\t\tFile[] listOfFiles = folder.listFiles();\r\n\t \r\n\t \r\n\t \tFileWriter fwText;\r\n\t\tBufferedWriter bwText;\r\n\t\t\r\n\t\tfwText = new FileWriter(\"C:/Users/jipeng/Desktop/Qiang/updateSum/TAC2008/Parag/\"+ filename+\"/\" +\"A.txt\");\r\n\t\tbwText = new BufferedWriter(fwText);\r\n\t\t\r\n\t \tfor ( int i=0; i<listOfFiles.length; i++) {\r\n\t \t\t//String name = listOfFiles[i].getName();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tString text = readText(listOfFiles[i].getAbsolutePath());\r\n\t\t\t\r\n\t\t\tFileWriter fwWI = new FileWriter(\"C:/pun.txt\");\r\n\t\t\tBufferedWriter bwWI = new BufferedWriter(fwWI);\r\n\t\t\t\r\n\t\t\tbwWI.write(text);\r\n\t\t\t\r\n\t\t\tbwWI.close();\r\n\t\t\tfwWI.close();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tList<List<HasWord>> sentences = MaxentTagger.tokenizeText(new BufferedReader(new FileReader(\"C:/pun.txt\")));\r\n\t\t\t\r\n\t\t\t//System.out.println(text);\r\n\t\t\tArrayList<Integer> textList = new ArrayList<Integer>();\r\n\t\t\t\r\n\t\t\tfor (List<HasWord> sentence : sentences)\r\n\t\t\t {\r\n\t\t\t ArrayList<TaggedWord> tSentence = tagger.tagSentence(sentence);\r\n\t\t\t \r\n\t\t\t for(int j=0; j<tSentence.size(); j++)\r\n\t\t\t {\r\n\t\t\t \t \tString word = tSentence.get(j).value();\r\n\t\t\t \t \t\r\n\t\t\t \t \tString token = word.toLowerCase();\r\n\t\t\t \t \r\n\t\t\t \t \tif(token.length()>2 )\r\n\t\t\t\t \t{\r\n\t\t\t \t\t\t if (!m_EnStopwords.isStopword(token)) \r\n\t\t\t \t\t\t {\r\n\t\t\t \t\t\t\t\r\n\t\t\t\t\t\t\t\t if (word2IdHash.get(token)==null)\r\n\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t textList.add(id);\r\n\t\t\t\t\t\t\t\t\t // bwText.write(String.valueOf(id)+ \" \");\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t word2IdHash.put(token, id);\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t allWordsArr.add(token);\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t id++;\r\n\t\t\t\t\t\t\t\t } else\r\n\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t \tint wid=(Integer)word2IdHash.get(token);\r\n\t\t\t\t\t\t\t\t \tif(!textList.contains(wid))\r\n\t\t\t\t\t\t\t\t \t\ttextList.add(wid);\r\n\t\t\t\t\t\t\t\t \t//bwText.write(String.valueOf(wid)+ \" \");\r\n\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t \t}\r\n\t\t\t \t }\r\n\t\t\t }\r\n\t\t\tCollections.sort(textList);\r\n\t\t \r\n\t\t\tString text2 = valueFromList(textList);\r\n\t\t bwText.write(text2);\r\n\t\t //System.out.println(text2);\r\n\t\t bwText.newLine();\r\n\t\t textList.clear();\r\n\t\t \r\n\t \t}\r\n\t \tbwText.close();\r\n\t fwText.close();\r\n\t}", "public static void pageRankmain() {\n\t\t\t\n\t\t\tstopWordStore();\n\t\t\t//File[] file_read= dir.listFiles();\n\t\t\t//textProcessor(file_read);// Will be called from LinkCrawler\n\t\t\t//queryProcess();\n\t\t\t//System.out.println(\"docsave \"+ docsave);\n\t\t\t/*for ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t List<String> values = entry.getValue();\n\t\t\t System.out.print(\"Key = \" + key);\n\t\t\t System.out.println(\" , Values = \"+ values);\n\t\t\t}*/\n\t\t\t//########## RESPOINSIBLE FOR CREATING INVERTED INDEX OF TERMS ##########\n\t\t\tfor(int i=0;i<vocabulary.size();i++) {\n\t\t\t\tint count=1;\n\t\t\t\tMap<String, Integer> nestMap = new HashMap<String, Integer>();\n\t\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t\t String keyMain = entry.getKey();\n\t\t\t\t List<String> values = entry.getValue();\n\t\t\t\t if(values.contains(vocabulary.get(i)))\n\t\t\t\t \t{\n\t\t\t\t \tentryDf.put(vocabulary.get(i), count);//entryDf stores documents frequency of vocabulary word \\\\it increase the count value for specific key\n\t\t\t\t \tcount++;\n\t\t\t\t \t}\n\t\t\t\t \n\t\t\t\t nestMap.put(keyMain, Collections.frequency(values,vocabulary.get(i)));\n\t\t\t \t\n\t\t\t \t//System.out.println(\"VOC \"+ vocabulary.get(i)+ \" KeyMain \" +keyMain+ \" \"+ Collections.frequency(values,vocabulary.get(i)));\n\t\t\t\t\t}\n\t\t\t\t\ttfList.put(vocabulary.get(i), nestMap);\n\t\t\t}\n\t\t\t//########## RESPOINSIBLE FOR CREATING A MAP \"storeIdf\" TO STORE IDF VALUES OF TERMS ##########\n\t\t\tfor ( Map.Entry<String, Integer> endf : entryDf.entrySet()) {\n\t\t\t\tString keydf = endf.getKey();\n\t\t\t\tint valdf = endf.getValue();\n\t\t\t\t//System.out.print(\"Key = \" + \"'\"+keydf+ \"'\");\n\t\t\t //System.out.print(\" , Values = \"+ valdf);\n\t\t\t double Hudai = (double) (docsave.size())/valdf;\n\t\t\t //System.out.println(\"docsave size \"+docsave.size()+ \" valdf \"+ valdf + \" Hudai \"+ Hudai+ \" log Value1 \"+ Math.log(Hudai)+ \" log Value2 \"+ Math.log(2));\n\t\t\t double idf= Math.log(Hudai)/Math.log(2);\n\t\t\t storeIdf.put(keydf, idf);\n\t\t\t //System.out.print(\" idf-> \"+ idf);\n\t\t\t //System.out.println();\n\t\t\t} \n\t\t\t\n\t\t\t//############ Just for Printing ##########NO WORK HERE########\n\t\t\tfor (Map.Entry<String, Map<String, Integer>> tokTf : tfList.entrySet()) {\n\t\t\t\tString keyTf = tokTf.getKey();\n\t\t\t\tMap<String, Integer> valTF = tokTf.getValue();\n\t\t\t\tSystem.out.println(\"Inverted Indexing by Key Word = \" + \"'\"+keyTf+ \"'\");\n\t\t\t\tfor (Map.Entry<String, Integer> nesTf : valTF.entrySet()) {\n\t\t\t\t\tString keyTF = nesTf.getKey();\n\t\t\t\t\tInteger valTf = nesTf.getValue();\n\t\t\t\t\tSystem.out.print(\" Document Consists This Key Word = \" + \"'\"+ keyTF+ \"'\");\n\t\t\t\t\tSystem.out.println(\" , Term Frequencies in This Doc = \"+ valTf);\n\t\t\t\t} \n\t\t\t}\n\t\t\t//########### FOR CALCULATING DOCUMENT LENTH #############//\n\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry_new : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t{\n\t\t\t\tString keyMain_new = entry_new.getKey();\n\t\t\t\t//int countStop=0;\n\t\t\t\tdouble sum=0;\n\t\t\t\t for(Map.Entry<String, Map<String, Integer>> tokTf_new : tfList.entrySet()) // Iterating through the vocabulary\n\t\t\t\t { \n\t\t\t\t\t Map<String, Integer> valTF_new = tokTf_new.getValue();\n\t\t\t\t\t for (Map.Entry<String, Integer> nesTf_new : valTF_new.entrySet()) // Iterating Through the Documents\n\t\t\t\t\t {\n\t\t\t\t\t\t if(keyMain_new.equals(nesTf_new.getKey())) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t double val = nesTf_new.getValue()* (Double) storeIdf.get(tokTf_new.getKey());\n\t\t\t\t\t\t\t sum = sum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t //countStop++;\n\t\t\t\t }\n\t\t\t\t docLength.put(keyMain_new, Math.sqrt(sum));\n\t\t\t\t sum=0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Document Length \"+ docLength);\n\t\t\t//System.out.println(\"tfList \"+tfList);\n\t\t\t\n\t\t\t //########### FOR CALCULATING QUERY LENTH #############///\n\t\t\t\tdouble qrySum=0;\n\t\t\t\t for(String qryTerm: queryList) // Iterating through the vocabulary\n\t\t\t\t {\n\t\t\t\t\t//entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));// VUl ase\n\t\t\t\t\t \n\t\t\t\t\t\t if(storeIdf.get(qryTerm) != null) \n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));\n\t\t\t\t\t\t\t double val = entryQf.get(qryTerm)* (Double) storeIdf.get(qryTerm);\n\t\t\t\t\t\t\t qrySum = qrySum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t System.out.println(qryTerm+\" \"+entryQf.get(qryTerm)+ \" \"+ (Double) storeIdf.get(qryTerm));\n\t\t\t\t }\n\t\t\t\t qrySum=Math.sqrt(qrySum);\n\t\t\t\t System.out.println(\"qrySum \" + qrySum);\n\t\t\t\t \n\t\t\t\t//########### FOR CALCULATING COSINE SIMILARITY #############///\n\t\t\t\t for ( Map.Entry<String, ArrayList<String>> entry_dotP : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble sumProduct=0;\n\t\t\t\t\t\tdouble productTfIdf=0;\n\t\t\t\t\t\tString keyMain_new = entry_dotP.getKey(); //Geting Doc Name\n\t\t\t\t\t\t for(Map.Entry<String, Integer> qryTermItr : entryQf.entrySet()) // Iterating through the vocabulary\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t Map<String, Integer> matchTerm = tfList.get(qryTermItr.getKey()); // Getting a map of doc Names by a Query Term as value of tfList\n\n\t\t\t\t\t\t\t\t if(matchTerm.containsKey(keyMain_new)) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t //System.out.println(\"Test \"+ matchTerm.get(keyMain_new) +\" keyMain_new \" + keyMain_new);\n\t\t\t\t\t\t\t\t\t double docTfIdf= matchTerm.get(keyMain_new) * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t double qryTfIdf= qryTermItr.getValue() * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t productTfIdf = docTfIdf * qryTfIdf;\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t sumProduct= sumProduct+productTfIdf;\n\t\t\t\t\t\t\t //System.out.println(\"productTfIdf \"+productTfIdf+\" sumProduct \"+ sumProduct);\n\t\t\t\t\t\t\t productTfIdf=0;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t cosineProd.put(entry_dotP.getKey(), sumProduct/(docLength.get(entry_dotP.getKey())*qrySum));\n\t\t\t\t\t\t sumProduct=0;\n\t\t\t\t\t\t //System.out.println(entry_dotP.getKey()+ \" \" + docLength.get(entry_dotP.getKey()));\n\t\t\t\t\t}\n\t\t\t\t System.out.println(\"cosineProd \"+ cosineProd);\n\t\t\t\t \n\t\t\t\t System.out.println(\"Number of Top Pages you want to see\");\n\t\t\t\t int topRank = Integer.parseInt(scan.nextLine());\n\t\t\t\t Map<String, Double> result = cosineProd.entrySet().stream()\n\t\t\t .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).limit(topRank)\n\t\t\t .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,\n\t\t\t (oldValue, newValue) -> oldValue, LinkedHashMap::new));\n\n\t\t\t\t scan.close();\n\t\t\t //Alternative way\n\t\t\t //Map<String, Double> result2 = new LinkedHashMap<>();\n\t\t\t //cosineProd.entrySet().stream().sorted(Map.Entry.<String, Double>comparingByValue().reversed()).limit(2).forEachOrdered(x -> result2.put(x.getKey(), x.getValue()));\n\n\t\t\t System.out.println(\"Sorted...\");\n\t\t\t System.out.println(result);\n\t\t\t //System.out.println(result2);\n\t}", "private ArrayList<String> loadIds() {\n\n\t\tArrayList<String> idArray = new ArrayList<String>();\n\t\ttry {\n\t\t\tFileInputStream fileInputStream = context.openFileInput(SAVE_FILE);\n\t\t\tInputStreamReader inputStreamReader = new InputStreamReader(\n\t\t\t\t\tfileInputStream);\n\t\t\tType listType = new TypeToken<ArrayList<String>>() {\n\t\t\t}.getType();\n\t\t\tGsonBuilder builder = new GsonBuilder();\n\t\t\tGson gson = builder.create();\n\t\t\tArrayList<String> list = gson.fromJson(inputStreamReader, listType);\n\t\t\tidArray = list;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn idArray;\n\t}", "public List<K> getSavedIds() {\n if (dbObjects.length > 0 && dbObjects[0] instanceof JacksonDBObject) {\n throw new UnsupportedOperationException(\n \"Generated _id retrieval not supported when using stream serialization\");\n }\n\n List<K> ids = new ArrayList<K>();\n for (DBObject dbObject : dbObjects) {\n ids.add(jacksonDBCollection.convertFromDbId(dbObject.get(\"_id\")));\n }\n\n return ids;\n }", "private synchronized void saveInternal() {\n if (relatedDocumentsCounter == 0) {\r\n return;\r\n }\r\n\r\n final TrigramIndexJsonModel model = new TrigramIndexJsonModel( relatedDocuments, indexGeneration, trigram );\r\n final TrigramDocumentCountJsonModel count = new TrigramDocumentCountJsonModel( trigram, globalRelatedDocumentsCounter );\r\n\r\n indexGeneration++;\r\n relatedDocuments = new TreeSet<>();\r\n relatedDocumentsCounter = 0;\r\n\r\n // put that save action and all unnecessary path calculations into a thread pool, \r\n // no need that other word can't be indexed, because of someone's save action... \r\n\r\n Runnable runnable = new Runnable() {\r\n @Override\r\n public void run() {\r\n Path trigramsPath = TrigramSubPathCalculator.getPathForTrigram( trigramsBasePath, trigram,\r\n \".\" + model.getIndexGeneration() + TRIGRAM_REFERENCE_SUFFIX );\r\n createTargetDirectoryIfNotExist( trigramsPath.getParent() );\r\n\r\n // write content of one part of the index\r\n try (BufferedWriter writer = Files.newBufferedWriter( trigramsPath, StandardCharsets.UTF_8 )) {\r\n Gson gson = new Gson();\r\n writer.write( gson.toJson( model ) );\r\n }\r\n catch (IOException e) {\r\n System.out.println( String.format( \"saving file: '%s' caused this error...\", trigramsPath ) );\r\n e.printStackTrace();\r\n }\r\n\r\n // write+overwrite the global documents counter as well\r\n Path trigramCountPath = TrigramSubPathCalculator.getPathForTrigram( trigramsBasePath, trigram, TRIGRAM_COUNT_SUFFIX );\r\n\r\n try (BufferedWriter writer = Files.newBufferedWriter( trigramCountPath, StandardCharsets.UTF_8 )) {\r\n Gson gson = new Gson();\r\n writer.write( gson.toJson( count ) );\r\n }\r\n catch (IOException e) {\r\n System.out.println( String.format( \"saving file: '%s' caused this error...\", trigramCountPath ) );\r\n e.printStackTrace();\r\n }\r\n\r\n }\r\n };\r\n\r\n // TODO: put into task thread-pool (deque) for really saving indexing time.\r\n runnable.run();\r\n }", "private void saveGenres(){\n\t\tFile genreList = new File(Paths.get(\"genres.txt\").toString());\n\t\ttry{\n\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(genreList));\n\t\t\tfor (String s : genres){\n\t\t\t\twriter.write(s);\n\t\t\t\twriter.newLine();\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch(IOException ex){\n\t\t\t\n\t\t}\n\t}", "public static Map<String, AuthorMod> indexEmails(String fileName)\n\t{\n\t\tMap<String, AuthorMod> authBank= new HashMap<String, AuthorMod>();\t\t \n\t\tAuthorMod curAuth;\n\t\t//vars for for loop - one loop per email\n\t\tString curTok;\n\t\tString lastTok;\n\t\t\n\t\ttry \n\t\t{\n\t\t\tScanner scanner = new Scanner(new FileInputStream(fileName));\n\t\t try \n\t\t {\n\t\t while (scanner.hasNextLine())\n\t\t {\n\t\t \n\t\t \t String[] emailToks= SimpleTokenizer.INSTANCE.tokenize(scanner.nextLine());\n\t\t \t\n\t\t \t lastTok = \"<s>\";\n\t\t \t curTok = emailToks[3]; //maybe 2, check output\n\t\t \t Pair<String, String> firstBg = new Pair<String, String>(lastTok, curTok);\t\t \t \n\t\t \t //author check, possible set\n\t\t \t String authID = emailToks[0] + emailToks[1] + emailToks[2]; //check output from the tokenizer\t \t\n\t\t \t if (authBank.containsKey(authID)){\n\t\t \t\t curAuth = authBank.get(authID);\n\t\t \t\t curAuth.trainSize = curAuth.trainSize + (emailToks.length-2);\n\t\t \t\t curAuth.ug.updateSeen(lastTok);\n\t\t \t } else {\n\t\t \t\t curAuth = new AuthorMod();\n\t\t \t\t curAuth.id = authID;\n\t\t \t\t curAuth.trainSize = emailToks.length - 2;\n\t\t\t \t curAuth.ug.addNew(lastTok);\n\t\t \t }\n\t\t \t \n\t\t \t //initalize loop\n\t\t \t if(curAuth.ug.contains(curTok)) {\n\t\t \t\t curAuth.ug.updateSeen(curTok);\n\t\t \t } \n\t\t \t else {\t\t \n\t\t \t\t curAuth.ug.addNew(curTok);\n\t\t \t }\n\n\t\t \t if(curAuth.bg.containsBg(firstBg)) {\n\t\t \t\t curAuth.bg.updateSeen(firstBg);\n\t\t \t } else {\n\t\t \t\t curAuth.bg.addNew(firstBg);\n\t\t \t }\n\t\t \t \t \n\t\t \t //index for that author, code very similar to bigram/unigram\n\t\t \t for(int i = 4; i < emailToks.length; i++)\t\t \n\t\t \t\t {\n\t\t \t\t\t curTok= emailToks[i];\n\t\t \t\t\t Pair<String, String> loopBg = new Pair<String, String>(lastTok, curTok);\n\t\t \t\t\t \n\t\t \t\t\t //three cases. \n\t\t \t\t\t //1) bigram has been seen\n\t\t \t\t\t if (curAuth.bg.containsBg(loopBg))\n\t\t \t\t\t {\n\t\t \t\t\t\t curAuth.bg.updateSeen(loopBg);\n\t\t \t\t\t\t curAuth.ug.updateSeen(curTok);\n\t\t \t\t\t } \n\t\t \t\t\t //2) word seen, but not bigram\n\t\t \t\t\t else\n\t\t \t\t\t { \n\t\t \t\t\t\t if (curAuth.ug.contains(curTok))\n\t\t \t\t\t \t\t{\n\t\t \t\t\t\t\t curAuth.bg.addNew(loopBg);\n\t\t \t\t\t\t\t curAuth.ug.updateSeen(curTok);\n\t\t \t\t\t\t\t} \n\t\t \t\t\t\t //3) new word entirely\n\t\t \t\t\t\t else\n\t\t \t\t\t\t {\n\t\t \t\t\t\t\t curAuth.ug.addNew(curTok);\n\t\t \t\t\t\t\t curAuth.bg.addNew(loopBg); \n\t\t \t\t\t\t } \n\t\t \t\t\t }\t \n\t\t \t\t\t lastTok = curTok;\n\t\t \t\t\t} //end inner loop\n\t\t \tauthBank.put(curAuth.id, curAuth); \n\t\t \t\t} //end outer loop \n\t\t }\t\n\t\t finally\n\t\t {\n\t\t scanner.close();\n\t\t }\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.err.println(\"Error: \" + e.getMessage());\n\t\t}\n\t\treturn authBank;\n\t}", "Map<String, String> getTokens();", "private Map<String,Map<String,List<String>>> buildDictionary(Document doc){\n\t\t\n\t\tElement root = doc.getDocumentElement();\n\t\t\n\t\t\n\t\tMap<String,Map<String,List<String>>> dictionary = new HashMap<String,Map<String,List<String>>>();\n\t\tthis.termSet = new TreeSet<String>();\n\t\t\n\t\tNodeList termList = doc.getElementsByTagName(\"term\");\n\t\tfor(int i = 0; i < termList.getLength(); i++){\n\t\t\tElement termElement = (Element) termList.item(i);\n\t\t\tElement nameElement = (Element) termElement.getElementsByTagName(\"name\").item(0);\n\t\t\tString name = nameElement.getTextContent();\n\t\t\tthis.termSet.add(name);\n\n\t\t\tMap<String,List<String>> synonymGroup = new HashMap<String,List<String>>();\n\t\t\tsynonymGroup.put(\"exact\", new ArrayList<String>());\n\t\t\tsynonymGroup.put(\"related\", new ArrayList<String>());\n\t\t\tsynonymGroup.put(\"broad\", new ArrayList<String>());\n\t\t\tsynonymGroup.put(\"narrow\", new ArrayList<String>());\n\t\t\t\n\t\t\tNodeList synonyms = termElement.getElementsByTagName(\"synonym\");\n\t\t\tfor(int j=0; j<synonyms.getLength(); j++){\n\t\t\t\tElement synonymElement = (Element) synonyms.item(j);\n\t\t\t\tString synonym = synonymElement.getTextContent();\n\t\t\t\tString scope = synonymElement.getAttribute(\"scope\");\n\t\t\t\t//System.out.println(scope);\n\t\t\t\tList<String> synonymList = (List<String>) synonymGroup.get(scope);\n\t\t\t\t\n\t\t\t\t//System.out.println(synonym);\n\t\t\t\t\n\t\t\t\tsynonymList.add(synonym);\n\t\t\t}\n\t\t\t\n\t\t\tdictionary.put(name,synonymGroup);\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\treturn dictionary;\n\t}", "public synchronized List<Integer> getDocIdsTodosDocumentos() throws Exception{\r\n\t\tList<Integer> lista = new ArrayList<Integer>();\r\n\t\t\r\n\t\tMTDIterator<MTDDocument> iterator = iterator();\r\n\t\twhile(iterator.hasNext()){\r\n\t\t\tMTDDocument doc = iterator.next();\r\n\t\t\tlista.add(doc.getDocId());\r\n\t\t}\r\n\t\titerator.close();\r\n\t\t\r\n\t\treturn lista;\r\n\t}", "private static Map<String, List<List<String>>>[] splitYagoDataIntoDocumentSets(File yagoInputFile) {\r\n\t\tMap<String, List<List<String>>> trainData = new HashMap<String, List<List<String>>>();\r\n\t\tMap<String, List<List<String>>> testaData = new HashMap<String, List<List<String>>>();\r\n\t\tMap<String, List<List<String>>> testbData = new HashMap<String, List<List<String>>>();\r\n\t\t\r\n\t\tBufferedReader reader = FileUtil.getFileReader(yagoInputFile.getAbsolutePath());\r\n\t\ttry {\r\n\t\t\tString documentName = null;\r\n\t\t\tString documentSet = null;\r\n\t\t\tList<List<String>> documentLines = null;\r\n\t\t\tList<String> sentenceLines = null;\r\n\t\t\tString line = null;\r\n\t\t\twhile ((line = reader.readLine()) != null) {\r\n\t\t\t\tif (line.startsWith(\"-DOCSTART-\")) {\r\n\t\t\t\t\tif (documentSet != null) {\r\n\t\t\t\t\t\tif (documentSet.equals(\"train\"))\r\n\t\t\t\t\t\t\ttrainData.put(documentName, documentLines);\r\n\t\t\t\t\t\telse if (documentSet.equals(\"testa\"))\r\n\t\t\t\t\t\t\ttestaData.put(documentName, documentLines);\r\n\t\t\t\t\t\telse if (documentSet.equals(\"testb\"))\r\n\t\t\t\t\t\t\ttestbData.put(documentName, documentLines);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tString docId = line.substring(\"-DOCSTART- (\".length(), line.length() - 1);\r\n\t\t\t\t\tString[] docIdParts = docId.split(\" \");\r\n\t\t\t\t\tdocumentName = docIdParts[0] + \"_\" + docIdParts[1];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (docIdParts[0].endsWith(\"testa\"))\r\n\t\t\t\t\t\tdocumentSet = \"testa\";\r\n\t\t\t\t\telse if (docIdParts[0].endsWith(\"testb\"))\r\n\t\t\t\t\t\tdocumentSet = \"testb\";\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tdocumentSet = \"train\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tdocumentLines = new ArrayList<List<String>>();\r\n\t\t\t\t\tsentenceLines = new ArrayList<String>();\r\n\t\t\t\t} else if (line.trim().length() == 0) {\r\n\t\t\t\t\tdocumentLines.add(sentenceLines);\r\n\t\t\t\t\tsentenceLines = new ArrayList<String>();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsentenceLines.add(line);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (documentSet.equals(\"train\"))\r\n\t\t\t\ttrainData.put(documentName, documentLines);\r\n\t\t\telse if (documentSet.equals(\"testa\"))\r\n\t\t\t\ttestaData.put(documentName, documentLines);\r\n\t\t\telse if (documentSet.equals(\"testb\"))\r\n\t\t\t\ttestbData.put(documentName, documentLines);\r\n\t\t} catch (IOException e) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tMap<String, List<List<String>>>[] returnData = new HashMap[3];\r\n\t\treturnData[0] = trainData;\r\n\t\treturnData[1] = testaData;\r\n\t\treturnData[2] = testbData;\r\n\t\t\r\n\t\treturn returnData;\r\n\t}", "private static void writeToCoordinateFile(String idNames, String[] id_to_coord_list, String outputFileName){\n String[] stringToWrite = getStringBasedOnCoordinate( idNames, id_to_coord_list); //list of id we found, ignore the first 0th index\n writeToFile(stringToWrite, outputFileName);\n }", "public void allartongs() throws IOException{\r\n writefiles data=new writefiles(\"d:\\\\documents\\\\textfiles\\\\AllArtSongs.txt\",true);\r\n Map<String,String> ArrangerNamesLineMap=new HashMap<>();\r\n for(int songid:ArrangerLinesMap.keySet()){\r\n int arrangerid=ArrangerLinesMap.get(songid);\r\n ArrangersMap.get((songid));\r\n ArrangerNamesLineMap.put(test.getsongName(songid), ArrangersMap.get(arrangerid));\r\n }\r\n for(String songname:ArrangerNamesLineMap.keySet()){\r\n System.out.println(\"The artist is:\"+ArrangerNamesLineMap.get(songname)+\" The song is:\"+songname);\r\n data.writeToFile(\"The artist is:\"+ArrangerNamesLineMap.get(songname)+\" The song is:\"+songname);\r\n }\r\n System.out.println(ArrangerNamesLineMap.size());\r\n }", "public synchronized List<MTDDocument> getDocumentos(Collection<Integer> ids){\r\n\t\tArrayList<MTDDocument> listaRetorno = new ArrayList<MTDDocument>();\r\n\t\tDirectoryReader reader;\r\n\t\ttry {\r\n\t\t\treader = DirectoryReader.open(getCopiaDiretorioMemoria());\r\n\t\tIndexSearcher searcher = new IndexSearcher(reader);\t\t\r\n\t for(Integer docId: ids){\r\n \t\tDocument documento = searcher.doc(docId.intValue());\r\n \t\tif(documento != null){\r\n \t\tMTDDocument doc = new MTDDocumentBuilder().buildDocument(documento).build();\r\n \t\tdoc.setDocId(docId.intValue());\r\n \t\tlistaRetorno.add(doc);\r\n \t\t}else\r\n \t\t{System.out.println(\"Document with docId \"+docId.intValue()+\" not found.\");}\r\n\t }\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn listaRetorno;\r\n\t}", "private static void writeMappingsToFile(String releaseNumber, List<List<Object>> stableIdsToOldIdsMappings, Set<String> currentStableIdentifiers) throws IOException {\n\t\tPath oldStableIdsMappingFilePath = Paths.get(releaseNumber, \"reactome_stable_ids.txt\");\n\t\tString header = \"# Reactome stable IDs for release \" + releaseNumber + \"\\n\" + \"Stable_ID\\told_identifier(s)\\n\";\n\t\tFiles.write(oldStableIdsMappingFilePath, header.getBytes(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);\n\t\tfor (List<Object> stableIdsArray : stableIdsToOldIdsMappings)\n\t\t{\n\t\t\tString primaryId = (String) stableIdsArray.get(0);\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tList<String> secondaryIds = (ArrayList<String>) stableIdsArray.get(1);\n\t\t\tif (currentStableIdentifierWithMapping(currentStableIdentifiers, primaryId, secondaryIds)) {\n\t\t\t\tString line = primaryId + \"\\t\" + String.join(\",\", secondaryIds) + \"\\n\";\n\t\t\t\tFiles.write(oldStableIdsMappingFilePath, line.getBytes(), StandardOpenOption.APPEND);\n\t\t\t}\n\t\t}\n\t}", "private void savePoSTag(PoSTag poSTag){\n Long num;\n num = poSTagPerWordMap.get(poSTag.getWord());\n poSTagPerWordMap.put(poSTag.getWord(), (num == null) ? (long)1 : num+1);\n\n num = poSTagMap.get(poSTag);\n poSTagMap.put(poSTag, (num == null) ? (long)1 : num+1);\n\n\n }", "public void getVector() throws IOException {\n\t\tint i=1;\r\n\t\tfor(String key:keyword){\r\n\t\t\tWord w=new Word();\r\n\t\t\tdouble tf=calTF(key);\r\n\t\t\tdouble idf=calIDF(key);\r\n\t\t\tdouble tfidf=tf*idf;\r\n\t\t\tw.setId(i);\r\n\t\t\ti++;\r\n\t\t\tw.setName(key);\r\n\t\t\tw.setTfidf(tfidf);\r\n\t\t\tif(word.containsKey(key)){\r\n\t\t\t\tw.setCount((Integer) word.get(key));\r\n\t\t\t}\r\n\t\t\tkeymap.add(w);\r\n\t\t}\r\n\t\tFileHelper.writeTrainFile(keymap);\r\n\t\tFileHelper.writeTestFile(keymap);\r\n\t}", "public void saveToReadID(ArrayList<String> idList) {\n\n\t\tSAVE_FILE = TO_READ_FILE;\n\t\tsaveIds(idList);\n\t}", "private void saveMarkerPrefs(){\n String latLngsList = new Gson().toJson(latLngs);\n String namesList = new Gson().toJson(locationNames);\n dataStorage.setLatLngList(latLngsList);\n dataStorage.setLocNameList(namesList);\n }", "private void outputResults()\n{\n try {\n PrintWriter pw = new PrintWriter(new FileWriter(output_file));\n pw.println(total_documents);\n for (Map.Entry<String,Integer> ent : document_counts.entrySet()) {\n String wd = ent.getKey();\n int ct = ent.getValue();\n pw.println(ct + \" \" + wd);\n }\n pw.println(START_KGRAMS);\n pw.println(total_kdocuments);\n for (Map.Entry<String,Integer> ent : kgram_counts.entrySet()) {\n String wd = ent.getKey();\n int ct = ent.getValue();\n pw.println(ct + \" \" + wd);\n } \n pw.close();\n }\n catch (IOException e) {\n IvyLog.logE(\"SWIFT\",\"Problem generating output\",e);\n }\n}", "public static void docWtgArray() {\n int docCount = 0;\n\n while(docCount<totaldocument) {\n List<Double> pass = new ArrayList();\n for(Entry<String,List<Double>> entry : wtgMap.entrySet()) {\n List<Double> docList = new ArrayList();\n docList = entry.getValue();\n double temp = docList.get(docCount);\n pass.add(temp);\n }\n\n double answer = CosineSimilarity(pass,query);\n if(answer >= alpha) {\n DocID.put(docCount,answer);\n }\n docCount++;\n }\n }", "static private void printSentenceTokens( final String documentId, final Iterable<String> tokenizedSentences ) {\n System.out.println( \"=========================== \" + documentId + \" ===========================\" );\n for ( String tokenizedSentence : tokenizedSentences ) {\n System.out.println( tokenizedSentence );\n }\n }", "public VSM(String[] docs) {\n\t\tmyDocs = docs;\n\t\ttermList = new ArrayList<String>();\n\t\tdocLists = new ArrayList<ArrayList<Doc>>();\n\t\tArrayList<Doc> docList;\n\t\t// parse the documents to construct the index and collect the raw\n\t\t// frequencies.\n\t\tfor (int i = 0; i < myDocs.length; i++) {\n\t\t\tString[] tokens = myDocs[i].split(\" \");\n\t\t\tString token;\n\t\t\tfor (int j = 0; j < tokens.length; j++) {\n\t\t\t\ttoken = tokens[j];\n\t\t\t\tif (!termList.contains(token)) {\n\t\t\t\t\ttermList.add(token);\n\t\t\t\t\tdocList = new ArrayList<Doc>();\n\t\t\t\t\tDoc doc = new Doc(i, 1); // initial raw frequency is 1\n\t\t\t\t\tdocList.add(doc);\n\t\t\t\t\tdocLists.add(docList);\n\t\t\t\t} else {\n\t\t\t\t\tint index = termList.indexOf(token);\n\t\t\t\t\tdocList = docLists.get(index);\n\t\t\t\t\tint k = 0;\n\t\t\t\t\tboolean match = false;\n\n\t\t\t\t\t// search the postings list for a document id, if match,\n\t\t\t\t\t// insert a new position number to the document id\n\t\t\t\t\tfor (Doc doc : docList) {\n\t\t\t\t\t\tif (doc.docId == i) {\n\t\t\t\t\t\t\tdoc.tw++; // increase word count\n\t\t\t\t\t\t\tmatch = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tk++;\n\t\t\t\t\t}\n\t\t\t\t\t// if no match, add a new document id along with the\n\t\t\t\t\t// position number\n\t\t\t\t\tif (!match) {\n\t\t\t\t\t\tDoc doc = new Doc(i, 1);\n\t\t\t\t\t\tdocList.add(doc);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}//\n\t\t}// end with parsing\n\n\t\t// compute the tf-idf term weights and the doc lengths\n\t\tint N = myDocs.length;\n\t\tdocLength = new double[N];\n\t\tfor (int i = 0; i < termList.size(); i++) {\n\t\t\tdocList = docLists.get(i);\n\t\t\tint df = docList.size();\n\t\t\tDoc doc;\n\t\t\tfor (int j = 0; j < docList.size(); j++) {\n\t\t\t\tdoc = docList.get(j);\n\t\t\t\tdouble tfidf = (1 + Math.log(doc.tw))\n\t\t\t\t\t\t* Math.log(N / (df * 1.0));\n\t\t\t\tdocLength[doc.docId] += Math.pow(tfidf, 2);\n\t\t\t\tdoc.tw = tfidf;\n\t\t\t\tdocList.set(j, doc);\n\t\t\t}\n\t\t}\n\t\t// update the length\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tdocLength[i] = Math.sqrt(docLength[i]);\n\t\t}\n\n\t}", "public static void saveAsMultipleFiles(Map<Atto, List<ITerm>> atti, String path)\n\t{\n\t\tFile dir = new File(path);\n\t\tif (!dir.exists() || !dir.isDirectory())\n\t\t\tthrow new IllegalArgumentException(\"!dir.exists() || !dir.isDirectory()\");\n\t\t\n\t\tFileUtils.clearDirectory(dir);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tint counter = 0;\n\t\t\tfor (Entry<Atto, List<ITerm>> entry : atti.entrySet())\n\t\t\t{\n\t\n\t\t\t\tString filename = path + File.separator + attoTermsPrefix + counter + jsonExtension;\n\t\t\t\tJSONActDescriptorSaver saver = new JSONActDescriptorSaver(WritersFactory.newUTF8FileWriter(filename));\n\t\t\t\tsaver.save(entry);\n\t\t\t\t\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\tSystem.err.println(e);\n\t\t}\n\t}", "public void insert( String token, int docID, int offset ) {\n // Add to map of postingslist\n //if (docID % 100 == 0)\n //System.err.println(\"Trying to insert ''\" + token + \"'' found in doc \"+docID);\n if (this.index.containsKey(token)){\n //System.err.println(token+\" already in memory\");\n this.index.get(token).insert(docID, offset);\n }\n else{\n //System.err.println(\"new token: \" +token+\" stored\");\n PostingsList postingslist = new PostingsList();\n postingslist.insert(docID, offset);\n this.index.put(token, postingslist);\n }\n\n // Add to matrix of tf\n if (!this.tfMap.containsKey(docID)){\n HashMap<String, Integer> m = new HashMap<String, Integer>();\n m.put(token, 1);\n this.tfMap.put(docID, m);\n\n if (this.idfMap.containsKey(token))\n this.idfMap.put(token, this.idfMap.get(token)+1);\n else\n this.idfMap.put(token, 1);\n }\n\n else if (!this.tfMap.get(docID).containsKey(token)){\n this.tfMap.get(docID).put(token, 1);\n\n if (this.idfMap.containsKey(token))\n this.idfMap.put(token, this.idfMap.get(token)+1);\n else\n this.idfMap.put(token, 1);\n }\n\n else{\n int v = this.tfMap.get(docID).get(token) + 1;\n this.tfMap.get(docID).put(token, v);\n }\n }", "public long getDocumentName();", "public abstract Set<String> getTerms(Document doc);", "public String addStudent (String name,String admin){\n Document doc = new Document(\"name\", name);\n doc.put(\"skills\",Arrays.asList());\n studentSkills.insertOne(doc);\n this.createNewToken(doc.get(\"_id\").toString(),admin);\n return doc.get(\"_id\").toString();\n}", "public void saveBooks(){\n\t\ttry{\t\n\t\t\tPrintWriter pw = new PrintWriter(new FileWriter(\"../bin/books.csv\"));\t\n\t\t\tIterator bookIterator = bookMap.keySet().iterator();\n\t\t\twhile(bookIterator.hasNext() != false){\n\t\t\t\tString current = bookIterator.next().toString();\n\t\t\t\tfor(int i=0;i<bookMap.get(current).size();i++){\t\n\t\t\t\t\tpw.write(bookMap.get(current).get(i).getTitle() \n\t\t\t\t\t\t+ \",\" + bookMap.get(current).get(i).getAuthor()\n\t\t\t\t\t\t+ \",\" + bookMap.get(current).get(i).getYear()\n\t\t\t\t\t\t+ \",\" + bookMap.get(current).get(i).getType()\n\t\t\t\t\t\t+ \",\" + bookMap.get(current).get(i).getId());\n\t\t\t\t\tpw.write(\"\\n\");\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tpw.close();\n\t\t\tSystem.out.println(\"\\tDone!\");\n\t\t}catch(IOException e){\n\t\t\tSystem.out.println(e.toString());\n\t\t}\n\n\t}", "public void readIDs() {\n try {\n FileInputStream fileIn = new FileInputStream(\"temp/ids.ser\");\n ObjectInputStream in = new ObjectInputStream(fileIn);\n ids = (HashMap<String, Member>) in.readObject();\n in.close();\n fileIn.close();\n } catch (IOException e) {\n ids = new HashMap<>();\n } catch (ClassNotFoundException c) {\n System.out.println(\"Class HashMap not found\");\n c.printStackTrace();\n return;\n }\n\n }", "@Override\n public void run() {\n final Location location = getLastBestLocation();\n\n\n location.getLatitude();\n location.getLongitude();\n\n\n\n\n\n // Create a new user with a first and last name\n Map<String, Object> user = new HashMap<>();\n user.put(\"lat\", location.getLatitude());\n user.put(\"long\", location.getLongitude());\n\n// Add a new document with a generated ID\n\n db.collection(\"gps\").document(\"QvFfCM86QQJRAIk68MQv\").update(user)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\nString locs= location.getLatitude()+\",\"+location.getLongitude();\n loc.setText(locs);\n Log.w(TAG, \"onSuccess\"+count);\n count = count+1;\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.w(TAG, \"Error adding document\", e);\n }\n });\n\n // Repeat every 2 seconds\n handler.postDelayed(runnable, 500);\n }", "private void createDocWords() {\n\t\tArrayList<DocWords> docList=new ArrayList<>();\n\t\ttry {\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(\"E:\\\\graduate\\\\cloud\\\\project\\\\data\\\\docWords.txt\"));\n\t\t\tString line = \"\";\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\tString parts[] = line.split(\" \");\n\t\t\t\tDocWords docWords=new DocWords();\n\t\t\t\tdocWords.setDocName(parts[0].replace(\".txt\", \"\"));\n\t\t\t\tdocWords.setCount(Float.parseFloat(parts[1]));\n\t\t\t\tdocList.add(docWords);\n\t\t\t}\n\t\t\tin.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tDBUtil.insertDocWords(docList);\n\t}", "private void createDicts(String inputFile){\n\t\tproductIds = new TreeMap<>();\n\t\ttokenDict = new TreeMap<>();\n\t\treviewIds = new TreeMap<>();\n\n\t\tDataParser dataParser = null;\n\t\ttry {\n\t\t\tdataParser = new DataParser(inputFile);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error occurred while reading the reviews input file.\");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tfor (int i = 0; i < dataParser.allReviews.size(); i++) {\n\t\t\taddProductId(dataParser.allReviews.get(i).get(\"productId\"), i + 1);\n\t\t\tint length = addReviewText(dataParser.allReviews.get(i).get(\"text\"), i + 1);\n\t\t\taddReviewId(dataParser.allReviews.get(i), i, length);\n\t\t}\n\t}", "@SuppressWarnings(\"empty-statement\")\n public ArrayList process(String input){\n //public static void main(String[] args) throws SQLException {\n\n //Scanner in = new Scanner(System.in);\n //String InputStr = in.nextLine(); // to read user input;\n String InputStr = input;\n \n System.out.println(input);\n \n boolean quotated = false; // to know input with quotation or not;\n try {\n ConnectToDB();\n int TotalnumDoc = GetNumDocs();\n\n if (InputStr.startsWith(\"\\\"\") && InputStr.endsWith(\"\\\"\")) {\n System.out.println(\"quotation\");\n quotated = true;\n GetDoc_Word(InputStr, TotalnumDoc);\n System.out.println(\"total number of doc =\" + TotalnumDoc);\n Postions();\n } else {\n GetDoc_StemWord(InputStr, TotalnumDoc);\n quotated = false;\n }\n\n for (Map.Entry<String, SrchWord> entry1 : WordList.entrySet()) /// for\n /// printing\n {\n System.out.println(entry1.getKey() + \"\tIDF: \" + entry1.getValue().IDf);\n\n SrchWord w1 = entry1.getValue();\n w1.PrintSrchWord();\n System.out.println(\"___________________________\");\n\n }\n System.out.println(\"================================================================\");\n Ranker();\n \n for (Map.Entry<Integer, DocRank> entry1 : pages.entrySet()) \n {\n entry1.getValue().ID = entry1.getKey();\n }\n \n List<DocRank> sortedRank = new ArrayList<>(pages.values());\n \n if (!quotated)\n { \n sortedRank.sort( new SortByPageRank());\n }\n else\n {\n sortedRank.sort( new SortByValidFlag());\n }\n //*****************************************************************\n // sortedRank now contains objects DocRank containing the pageRank and the DocID(choose ascendingly or descendingly\n // from SortByPageRank.java compare function)\n // the ID should enable the retrieval of the URL and title from the table Docs_URL\n //****************************************************************\n \n ArrayList sortedIds = new ArrayList();\n \n for (int i=0; i<sortedRank.size(); i++)\n {\n System.out.println(\"DocID : \" +sortedRank.get(i).ID);\n System.out.println(\"pageRank: \" + sortedRank.get(i).rank);\n \n sortedIds.add(sortedRank.get(i).ID); // dont forget to change the comparator to descending\n //System.out.println(sortedRank.get(i).ID);\n }\n \n pages.clear();\n return sortedIds;\n \n } catch (Exception e) {\n\n e.printStackTrace();\n return null;\n\n } finally {\n\n WordList.clear(); // clearing map after searching\n if (con != null) {\n try {\n con.close();\n } catch (Exception e) {\n }\n }\n }\n\n }", "public void getThesaurusMap (String wordTofind) {\r\n\t \tfor (Entry<String, List> entry : tMap.entrySet()) {\r\n\t \t\tList singleListofSynonims = entry.getValue();\r\n\t \t\tif (singleListofSynonims.contains(wordTofind)){\r\n\t \t\t\t\r\n\t \t\t\tmappedList.add(singleListofSynonims);\r\n\t \t\t\tGoogleToThesarus.put(wordTofind,singleListofSynonims);\r\n\t \t\t}\r\n\t \t\telse {\r\n\t \t\t\t//System.out.println(\"value not in map\");\r\n\t \t}\r\n\t \t}\r\n\t }", "void genIDFData(String vocabFile, String outFile) throws Exception {\n List<String> lines = FileUtils.readLines(new File(vocabFile), Charset.defaultCharset());\n BufferedWriter bw = new BufferedWriter(new FileWriter(outFile));\n int N = reader.numDocs();\n for (String line: lines) {\n String word = TrecDocIndexer.analyze(indexer.getAnalyzer(), line).trim();\n int df = reader.docFreq(new Term(TrecDocIndexer.FIELD_ANALYZED_CONTENT, word));\n bw.write(line.trim() + \"\\t\");\n bw.write(String.valueOf(Math.log(N/(double)df)));\n bw.newLine();\n }\n bw.close();\n }", "public void saveReadID(ArrayList<String> idList) {\n\n\t\tSAVE_FILE = READ_FILE;\n\t\tsaveIds(idList);\n\t}", "public static void loadTargetTerm2IdMapping(File input) throws IOException {\n\t\t\tm_namesMap = new SimpleBidirectionalMap<String, Integer>();\n\t\t\tString encoding = FileUtils.getFileEncoding(input);\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(input), encoding));\n\t\t\tString line = reader.readLine();\n\t\t\tint lineNum = 1;\n\t\t\tboolean testFormat = false;\n\t\t\tif(StringUtils.checkIfNumber(line.split(\"\\t\")[0]))\n\t\t\t\ttestFormat = true;\n\t\t\twhile(line!= null) {\n\t\t\t\tif(line.equals(\"@@@\"))\n\t\t\t\t\tbreak;\n\t\t\t\tif(testFormat) {\n\t\t\t\t\tString num = line.split(\"\\t\")[0];\n\t\t\t\t\tSystem.out.println(\"key: \"+line.trim().substring(num.length()+1) + \" value: \" + Integer.parseInt(num));\n\t\t\t\t\tm_namesMap.put(line.trim().substring(num.length()+1), Integer.parseInt(num));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"key????\" + lineNum + \"instead of \" + line.split(\"\\t\")[0]);\n\t\t\t\t\tm_namesMap.put(line.trim(), lineNum);\n\t\t\t\t}\n\t\t\t\tline = reader.readLine();\n\t\t\t\tlineNum ++;\n\t\t\t}\n\t\t}", "public static void main(String[] args) throws FileNotFoundException, IOException {\n \n \n File textBank = new File(\"textbank/\");\n Hashtable<Integer,Integer> frequency;\n Hashtable<Integer, String> table;\n table = new Hashtable<>();\n frequency = new Hashtable<>();\n Scanner input = new Scanner(new File(\"stoplist.txt\"));\n int max=0;\n while (input.hasNext()) {\n String next;\n next = input.next();\n if(next.length()>max)\n max=next.length();\n table.put(next.hashCode(), next); //to set up the hashmap with the wordsd\n \n }\n \n System.out.println(max);\n \n Pattern p0=Pattern.compile(\"[\\\\,\\\\=\\\\{\\\\}\\\\\\\\\\\\\\\"\\\\_\\\\+\\\\*\\\\#\\\\<\\\\>\\\\!\\\\`\\\\-\\\\?\\\\'\\\\:\\\\;\\\\~\\\\^\\\\&\\\\%\\\\$\\\\(\\\\)\\\\]\\\\[]\") \n ,p1=Pattern.compile(\"[\\\\.\\\\,\\\\@\\\\d]+(?=(?:\\\\s+|$))\");\n \n \n \n wor = new ConcurrentSkipListMap<>();\n \n ConcurrentMap<String , Map<String,Integer>> wordToDoc = new ConcurrentMap<String, Map<String, Integer>>() {\n @Override\n public Map<String, Integer> putIfAbsent(String key, Map<String, Integer> value) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean remove(Object key, Object value) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean replace(String key, Map<String, Integer> oldValue, Map<String, Integer> newValue) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Map<String, Integer> replace(String key, Map<String, Integer> value) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public int size() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean isEmpty() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean containsKey(Object key) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean containsValue(Object value) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Map<String, Integer> get(Object key) {\n return wor.get((String)key);//To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Map<String, Integer> put(String key, Map<String, Integer> value) {\n wor.put(key, value); // this saving me n \n //if(frequency.get(key.hashCode())== null)\n \n //frequency.put(key.hashCode(), )\n return null;\n }\n\n @Override\n public Map<String, Integer> remove(Object key) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public void putAll(Map<? extends String, ? extends Map<String, Integer>> m) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public void clear() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Set<String> keySet() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Collection<Map<String, Integer>> values() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Set<Map.Entry<String, Map<String, Integer>>> entrySet() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n };\n totalFiles = textBank.listFiles().length;\n for (File textFile : textBank.listFiles()) {\n totalReadFiles++;\n //checking whether file has txt extension and file size is higher than 0\n if(textFile.getName().contains(\".txt\") && textFile.length() > 0){\n docName.add(textFile.getName().replace(\".txt\", \".stp\"));\n StopListHandler sp = new StopListHandler(textFile, table,System.currentTimeMillis(),p0,p1,wordToDoc);\n sp.setFinished(() -> {\n \n tmp++;\n \n if(tmp==counter)\n //printTable(counter);\n \n if(totalReadFiles == totalFiles)\n {\n printTable(counter);\n }\n \n });\n \n sp.start();\n counter ++;}\n \n \n }\n System.out.println(counter);\n //while(true){if(tmp==counter-1) break;}\n System.out.println(\"s\");\n \n }", "private void initIDFMap(List<List<Map<String,List<Double>>>> tfMap){\n\t\tfor (int i = 0; i < tfMap.size(); i++) {\n\t\t\tList<Map<String,List<Double>>> gestureDocument = tfMap.get(i);\n\t\t\tfor (int j = 0; j < gestureDocument.size(); j++) {\n\t\t\t\tMap<String,List<Double>> tempMap = gestureDocument.get(j);\n\t\t\t\tIterator<Entry<String, List<Double>>> it = tempMap.entrySet().iterator();\n\t\t\t\t while (it.hasNext()) {\n\t\t\t\t Map.Entry<String,Integer> pairs = (Map.Entry)it.next(); \n\t\t\t\t if(getTfIDFMapGlobal().containsKey(pairs.getKey()))\n\t\t\t\t \tgetTfIDFMapGlobal().put(pairs.getKey(), getTfIDFMapGlobal().get(pairs.getKey())+1);\n\t\t\t\t else\n\t\t\t\t \tgetTfIDFMapGlobal().put(pairs.getKey(), 1);\n\t\t\t\t }\n\t\t\t}\n\t\t}\n\t}", "private static void saveMapToFile(HashMap<String, Integer> posCounts, String fileName) throws FileNotFoundException, IOException {\n\t\tProperties properties = new Properties();\r\n\r\n\t for (Map.Entry<String,Integer> entry : posCounts.entrySet()) {\r\n\t properties.put(entry.getKey(), entry.getValue().toString());\r\n\t }\r\n\t \r\n\t properties.store(new FileOutputStream(fileName), null);\r\n\t}", "public static void save(String fname, ArrayList<Tweet> tw) {\n\ttry {\n\t FileOutputStream fout = new FileOutputStream(fname);\n\t ObjectOutputStream oos = new ObjectOutputStream(fout);\n\t oos.writeObject(tw);\n\t oos.close();\n\t} catch (FileNotFoundException ex) {\n\t ex.printStackTrace();\n\t} catch (IOException ioex) {\n\t ioex.printStackTrace();\n\t}\n }", "public static void printHashMapSS(Map<String, String> map) throws IOException{\n\t\tPrintWriter writer = new PrintWriter(\"C:/Users/Naveen/Desktop/TestRuns/LastRun/documentHash\");\n\t\tfor (Entry<String, String> entry : map.entrySet())\n\t {\t \t\t\n\t \t\twriter.println(entry.getKey()+\":\"+entry.getValue());\n\t }\n\t writer.close();\n\t}", "public void writeFile() {\n\t\ttry {\n\t\t\tFile dir = Environment.getExternalStorageDirectory();\n\t\t\tFile myFile = new File(dir.toString() + File.separator + FILENAME);\n\t\t\tLog.i(\"MyMovies\", \"SeSus write : \" + myFile.toString());\n\t\t\tmyFile.createNewFile();\n\t\t\tFileOutputStream fOut = new FileOutputStream(myFile);\n\t\t\tOutputStreamWriter myOutWriter = \n\t\t\t\t\tnew OutputStreamWriter(fOut);\n\t\t\tfor (Map.Entry<String, ValueElement> me : hm.entrySet()) {\n\t\t\t\tString refs = (me.getValue().cRefMovies>0? \"MOVIE\" : \"\");\n\t\t\t\trefs += (me.getValue().cRefBooks>0? \"BOOK\" : \"\");\n\t\t\t\tString line = me.getKey() + DELIMITER + me.getValue().zweiteZeile \n\t\t\t\t\t\t //+ DELIMITER\n\t\t\t\t\t\t //+ me.getValue().count\n\t\t\t\t\t \t+ DELIMITER\n\t\t\t\t\t \t+ refs\n\t\t\t\t\t \t + System.getProperty(\"line.separator\");\n\t\t\t\t//Log.i(\"MyMovies\", \"SeSus extracted : \" + line);\n\t\t\t\tmyOutWriter.write(line);\n\t\t\t}\n\t\t\tmyOutWriter.close();\n\t\t\tfOut.close();\n\t\t} catch (IOException e) {\n\t\t\t//\n\t\t\tLog.i(\"MyMovies\", \"SeSus write Exception : \");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void addWordsToDoc(int doc,List<VocabWord> words);", "public void saveUsers() {\n FileWriter fileWriter = null;\n PrintWriter printWriter = null;\n try {\n fileWriter = new FileWriter(pathData);\n printWriter = new PrintWriter(fileWriter);\n if (users != null) {\n \n for (Map.Entry m : users.entrySet()) {\n printWriter.println(m.getKey() + spChar + m.getValue() + \"\\n\");\n }\n }\n printWriter.close();\n } catch (IOException e) {\n }\n }", "public void map(LongWritable docID, Text value, OutputCollector<Text, Text> output, Reporter reporter) throws IOException {\n FileSplit fileSplit = (FileSplit) reporter.getInputSplit();\n String filename = \"\" + fileSplit.getPath().getName();\n\n int argc = Integer.parseInt(conf.get(\"argc\"));\n java.util.Map<String, Integer> keywords = new HashMap<String, Integer>();\n\n for (int i = 0; i < argc; i++) {\n String inputString = conf.get(\"keyword\" + i);\n\n keywords.put(inputString, 0);\n\n\n }\n\n String line = value.toString();\n StringTokenizer tokenizer = new StringTokenizer(line);\n while (tokenizer.hasMoreTokens()) {\n\n String token = tokenizer.nextToken();\n for (java.util.Map.Entry<String, Integer> me : keywords.entrySet()) {\n if (token.equalsIgnoreCase(me.getKey())) {\n\n keywords.put(me.getKey(), me.getValue() + 1);\n\n }\n }\n }\n\n for (java.util.Map.Entry<String, Integer> me : keywords.entrySet()) {\n\n keyword.set(me.getKey());\n filenameCount.set(filename + \"_\" + me.getValue());\n\n output.collect(keyword, filenameCount);\n }\n }", "private void saveToStorage() {\n FileOutputStream fos = null;\n try {\n fos = context.openFileOutput(\"GeoFences\", Context.MODE_PRIVATE);\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n oos.writeObject(currentList);\n oos.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void reLoadIndexesFromFileToIndexMap(File file) throws IOException {\n BufferedReader reader = new BufferedReader(new FileReader(file));\n for (String line = reader.readLine(); line != null; line = reader\n .readLine()) {\n String[] termIndex = line.split(\" \");\n String key = termIndex[0];\n LinkedList<TermPositions> value = new LinkedList<>();\n String postingList = termIndex[1];\n // split the posting lists 1:1,2,4;2:4\n String[] subPostings = postingList.split(\";\");\n for (String posting : subPostings) {\n String[] docPosting = posting.split(\":\");\n int docId = Integer.parseInt(docPosting[0]);\n String[] positions = docPosting[1].split(\",\");\n LinkedList<Integer> positionsList = new LinkedList<>();\n for (String position : positions) {\n positionsList.add(Integer.parseInt(position));\n }\n TermPositions termPositions = new TermPositions(docId, positionsList);\n value.add(termPositions);\n }\n indexMap.put(key, value);\n\n }\n\n }", "public static void update(String indexFileName, String listOfDoc) throws IOException{\n\t\tHashMap<String, String> sCurrentHashMap = null;\n\t\tboolean hasFile = true;\n\t\t\n\t\tif(globalHash.containsKey(indexFileName)){\n\t\t\t//ถ้ามีใน global แล้ว เอาออกมาแล้วเอามารวมกับที่เพิ่งอ่านไฟล์ได้เลย\n\t\t\tsCurrentHashMap = globalHash.get(indexFileName);\n\t\t\n\t\t}else{ \n\t\t\t//if no hashmap in globalHash, then check if there's this fileName.txt in directory\n\t\t\t\n\t\t\tif(!new File(indexFileName+\".txt\").isFile()){\n\t\t\t\t\tSystem.out.println(\"ERROR: The inverted file is not found.\");\n\t\t\t\t\thasFile = false;\n\t\t\t}else{\n\t \t sCurrentHashMap = genHashMapFromInvertedIndexFile(indexFileName);\n\t\t\t \n\t\t\t}\n\t\t}\n\t\t\n\t\tif(hasFile){\n\t\t\tArrayList<Term> newTermList = extractDoc(listOfDoc);\n\t\t\t//if the new term list has value (not doc not found)\n\t\t\tif(newTermList.size()>0){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tsCurrentHashMap = addListToHashMap(sCurrentHashMap, newTermList);\n\t\t\t\t\n\t\t\t\t/*เพิ่มเงื่อนไขกรณี ลบคำออกจากไฟล์ \n\t\t\t\t * 1.ทำ list เป็น hashMap อีกอันไว้เซิชไวไว\n\t\t\t\t * loop amount of doc\n\t\t\t\t * 2.ไล่ iterative ของ hashMap ว่ามี value อันไหน contain ชื่อไฟล์บ้าง ถ้าcontain ให้เช็คกลับว่า key นั้น มีในแฮชอีกอันหรือเปล่า\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t/* // Convert new word (from file) list to HashMap\n\t\t\t\tHashMap<String, String> newWordHashMap = new HashMap<String, String>();\n\t\t\t\tfor(Term i: newTermList){\n\t\t\t\t\tnewWordHashMap.put(i.getTerm(), i.getDocNumber()+\"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tIterator it = sCurrentHashMap.entrySet().iterator();\n\t\t\t\twhile(it.hasNext()){\n\t\t\t\t\tHashMap.Entry<String, String> entry = (HashMap.Entry<String, String>) it.next();\n\t\t\t\t\t//if its value contains the doc number, then check if its key is in the newTermHash or note\n\t\t\t\t\t// if not --> this term was removed --> remove this key out from sCurrentHashMap\n\t\t\t\t\tif(entry.getValue().contains(s)) {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\tglobalHash.put(indexFileName, sCurrentHashMap);\n\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void getAllDocumentIds(ArrayList idList, String collectionName) {\n idList.clear();\n MainActivity.db.collection(collectionName).get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {\n @Override\n public void onComplete(@NonNull Task<QuerySnapshot> task) {\n if (task.isSuccessful()) {\n for (QueryDocumentSnapshot document : task.getResult()) {\n idList.add(document.getId());\n Log.d(TAG, document.getId() + \" => \" + document.getData());\n }\n } else {\n Log.w(TAG, \"Error getting documents.\", task.getException());\n }\n }\n });\n }", "private void invertedToDatabase(){\r\n cleFreq = new HashMap<>();\r\n System.out.println(\"Strat collecting\");\r\n Map<String,List<Invertedindex>> collects = collecting();\r\n System.out.println(\"Ending collecting\");\r\n Database.getInstance().invertedIndex(collects);\r\n Database.getInstance().addPoids(cleFreq);\r\n }", "private void storeData() {\r\n final File tweetsFile = new File(tweetsStorePath);\r\n final File usersFile = new File(usersStorePath);\r\n final Set<TweetEntity> tweetEntities = new HashSet();\r\n final Set<UserEntity> userEntities = new HashSet();\r\n \r\n tweets.entrySet().stream().forEach(entry -> {\r\n entry.getValue().stream().forEach(\r\n status -> {\r\n try {\r\n tweetEntities.add(\r\n new TweetEntity(status,\r\n entry.getKey()));\r\n userEntities.add(\r\n new UserEntity(status.getUser()));\r\n } catch (UnsupportedEncodingException ex) {\r\n \r\n }\r\n });\r\n });\r\n\r\n try {\r\n try (PrintWriter tweetWriter = new PrintWriter(tweetsFile)) {\r\n tweetEntities.stream().forEach(entity -> {\r\n tweetWriter.println(entity.toString());\r\n });\r\n }\r\n try (PrintWriter userWriter = new PrintWriter(usersFile)) {\r\n userEntities.stream().forEach(entity -> {\r\n userWriter.println(entity.toString());\r\n });\r\n }\r\n } catch (IOException ex) {\r\n System.out.println(\"DBLIS - storeData() - error storing data\" + ex);\r\n }\r\n }", "public void parseThesaurus() throws IOException {\r\n\t\t\t//We create an object below to read the thesaurus file\r\n\t\t\tFileInputStream fis = new FileInputStream(\"src//ie//gmit//dip//resources//MobyThesaurus3.txt\");\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(fis));\r\n\t\t\t List <List<String>> listOflist= new ArrayList<>();\r\n\t\t\t// HashMap<String,List> tMap = new HashMap<>();\t\t\r\n\t\t\t List <String> individualListOfSynonyms= new ArrayList <String>();\r\n\r\n\t\t\t \r\n\t\t\t //we create a hashmap with the first word being the key value and the rest a list of synonims we will use\r\n\t\t\twhile(br.readLine()!=null) {\r\n\t\t\t\t\r\n\t\t\t\tString somestring = br.readLine();\r\n\t\t\t\tString[] testsplit= somestring.split(\",\");\r\n\t\t\t\tindividualListOfSynonyms=Arrays.asList(testsplit);\r\n\t\t\t\tString indexvalue=individualListOfSynonyms.get(0).toString();\r\n\t\t\t tMap.put(indexvalue, individualListOfSynonyms);\r\n\t\t\t //br.close();\r\n\t\t\t //System.out.println(tMap);\r\n\t\t\t }\r\n\t\t\t}", "public void setDocsInfo(String path) {\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(path)));\n String line = \"\";\n while ((line = (br.readLine())) != null) {\n String [] splitLineByDelimiter = line.split(\", \");\n String docId = splitLineByDelimiter[0].substring(0, splitLineByDelimiter[0].indexOf(\":\"));\n String docLength = splitLineByDelimiter[1];\n docsInfo.put(docId, Integer.parseInt(docLength));\n }\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "private void createDocs() {\n\t\t\n\t\tArrayList<Document> docs=new ArrayList<>();\n\t\tString foldername=\"E:\\\\graduate\\\\cloud\\\\project\\\\data\\\\input\";\n\t\tFile folder=new File(foldername);\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\tfor (File file : listOfFiles) {\n\t\t\ttry {\n\t\t\t\tFileInputStream fisTargetFile = new FileInputStream(new File(foldername+\"\\\\\"+file.getName()));\n\t\t\t\tString fileContents = IOUtils.toString(fisTargetFile, \"UTF-8\");\n\t\t\t\tString[] text=fileContents.split(\"ParseText::\");\n\t\t\t\tif(text.length>1){\n\t\t\t\t\tString snippet=text[1].trim().length()>100 ? text[1].trim().substring(0, 100): text[1].trim();\n\t\t\t\t\tDocument doc=new Document();\n\t\t\t\t\tdoc.setFileName(file.getName().replace(\".txt\", \"\"));\n\t\t\t\t\tdoc.setUrl(text[0].split(\"URL::\")[1].trim());\n\t\t\t\t\tdoc.setText(snippet+\"...\");\n\t\t\t\t\tdocs.add(doc);\n\t\t\t\t}\n\t\t\t}catch(IOException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\n\t\t}\t\n\t\tDBUtil.insertDocs(docs);\n\t}", "private void setUpPlaces(){\n db.collection(\"Tokens\").get()\n .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {\n @Override\n public void onComplete(@NonNull Task<QuerySnapshot> task) {\n if (task.isSuccessful()) {\n for (QueryDocumentSnapshot document : task.getResult()) {\n String id = document.getId();\n String name = document.get(\"name\").toString();\n String desc = document.get(\"description\").toString();\n String[] latLng = document.get(\"latlng\").toString().split(\",\");\n double latitude = Double.parseDouble(latLng[0]);\n double longitude = Double.parseDouble(latLng[1]);\n places.add(new PlaceToken(id, name, desc, new LatLng(latitude, longitude)));\n }\n }\n }\n });\n }", "public void map(Object key, Text value, Context context\n\t\t ) throws IOException, InterruptedException {\n\n\t\t\t\n\t\t\t\n\t\t\t \n\t\t\t String curr_string=value.toString();\n\t\t\t /// splitting based on \"*\" as a delimiter...\n\t\t\t String [] parts=curr_string.split(\"\\\\*\");\n\t\t\t String curr_key=parts[0];\n\t\t\t // Removing spaces from both left and right part of the string..\n\t\t\t String curr_value=parts[1].trim();\n\t\t\t String [] small_parts=curr_value.split(\",\");\n\t\t\t // Taking the count of unique files which are present in the input given to tfidf\n\t\t\t int no_of_unique_files=Integer.parseInt(small_parts[small_parts.length-1]);\n\t\t\t /// The formula to compute idf is log((1+no_of_files)/no_of_unique_files))....\n\t\t\t Configuration conf=context.getConfiguration();\n\t\t\t String value_count=conf.get(\"test\");\n\t\t\t if(!value_count.isEmpty())\n\t\t\t {\n\t\t\t int total_no_files=Integer.parseInt(value_count);\n\t\t\t double x=(total_no_files/no_of_unique_files);\n\t\t\t // Formula fo rcomputing the idf value....\n\t\t\t double idf_value=Math.log10(1+x);\n\t\t\t for(int i=0;i<small_parts.length-1;i++)\n\t\t\t {\n\t\t\t\t String [] waste=small_parts[i].split(\"=\");\n\t\t\t\t String file_name=waste[0];\n\t\t\t\t // Computing the tfidf on the fly...\n\t\t\t\t double tf_idf=idf_value*Double.parseDouble(waste[1]);\n\t\t\t\t Text word3 = new Text();\n\t\t\t\t Text word4 = new Text();\n\t\t\t\t word3.set(curr_key+\"#####\"+file_name+\",\");\n\t\t\t\t word4.set(tf_idf+\"\");\n\t\t\t\t context.write(word3,word4);\n\t\t\t\t \n\t\t\t }\n\t\t\t //word1.set(curr_key);\n\t\t\t //word2.set(idf_value+\"\");\n\t\t\t //context.write(word1,word2); \n\t\t\t} \n\t\t}", "public static void DumpLocationCoordinatestoKMLRevised(Places places) throws IOException{\n\n String filen = folder_path+\"loc2kmlRevised.txt\";\n File file = new File(filen);\n if (!file.exists()) {\n file.createNewFile();\n }\n BufferedWriter output = new BufferedWriter(new FileWriter(file));\n\n for(int i=0;i<places.places.size();i++){\n LocationCluster locationcls=places.places.get(i);\n output.write(locationcls.placeID+\"~\");\n\n List<UserPhoto> sublist=locationcls.getIdenticalsubLocations();\n if(sublist.size()>2){\n\n for(int j=0;j<sublist.size()-1;j++){\n\n output.write(sublist.get(j).geotag.lat+\",\"+sublist.get(j).geotag.lng);\n if(j<sublist.size()-2){\n output.write(\"|\");\n }\n }\n\n }\n else{\n\n GeoTag center =locationcls.GetCentriod();\n output.write(center.lat+\",\"+center.lng);\n }\n\n\n output.write(\"\\n\");\n\n\n\n\n }\noutput.flush();\n\n }", "private void loadLoreEntries() {\n entryIDMap = new ConcurrentHashMap<>();\n entryIDThreads = new ThreadGroup(\"entryIDThreads\");\n\n for (int i = 0; i < bookSelectionData.size(); i++) {\n\n final String entryName = bookSelectionData.get(i).getBookName();\n final long entryID = bookSelectionData.get(i).getBookID();\n\n new Thread(entryIDThreads, new Runnable() {\n @Override\n public void run() {\n try {\n ArrayList<Long> arraylist = new ArrayList<>();\n arraylist.add(entryID);\n DataAccessObject_LoreBookSelectionDefinition node = database.getDao().getPresentationNodeById(arraylist).get(0);\n JsonObject json = node.getJson();\n JsonArray entryNodes = json.getAsJsonObject(\"children\").getAsJsonArray(\"records\");\n\n long[] ID = new long[entryNodes.size()];\n for (int j = 0; j < entryNodes.size(); j++) {\n JsonObject entry = (JsonObject) entryNodes.get(j);\n long hash = Long.parseLong(entry.get(\"recordHash\").getAsString());\n ID[j] = convertHash(hash);\n }\n entryIDMap.put(entryName, ID);\n } catch (Exception ignored) {\n }\n }\n }).start();\n }\n }", "private void saveInFile() {\n\t\tthis.deleteFile();\n\t\tfor (CounterModel obj : counterListModel.getCounterList()) {\n\t\t\ttry {\n\t\t\t\tGson gson = new Gson();\n\t\t\t\tif (obj.getCounterName().equals(counterModel.getCounterName())) {\n\t\t\t\t\tobj = counterModel;\n\t\t\t\t}\n\t\t\t\tString json = gson.toJson(obj) +'\\n';\n\t\t\t\tFileOutputStream fos = openFileOutput(FILENAME,\n\t\t\t\t\t\tContext.MODE_APPEND);\n\t\t\t\tfos.write(json.getBytes());\n\t\t\t\tfos.close();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void allartistsongs() throws IOException{\r\n List<String> ArrangersAndTheirSongs=new ArrayList<>();\r\n String allsongs=\"\";\r\n int counter=0;\r\n for(int id: ArrangersMap.keySet()){\r\n String ArrangerName=ArrangersMap.get(id);\r\n for(String song:ArrangerLinesList){\r\n String perform[];\r\n perform=song.split(\"/\");\r\n int arrangeid=Integer.parseInt(perform[1]);\r\n if(id==arrangeid){\r\n int songid= Integer.parseInt(perform[0]);\r\n String songname=test.getsongName(songid);\r\n allsongs+=songname+\" \";\r\n counter++;\r\n } \r\n }\r\n ArrangersAndTheirSongs.add(\"The Arranger's Name is:\"+ArrangerName+\" The number of songs is:\"+counter+ \" Their songs are:\"+allsongs);\r\n allsongs=\"\";\r\n counter=0;\r\n }\r\n writeListToTextFile(\"d:\\\\documents\\\\textfiles\\\\ArrangersAndTheirSongs.txt\",ArrangersAndTheirSongs);\r\n // test.writeSongs(\"d:\\\\documents\\\\textfiles\\\\ArrangersAndTheirSongs.txt\");\r\n // Path path=Paths.get()\r\n for(String line:ArrangersAndTheirSongs){\r\n System.out.println(line);\r\n }\r\n System.out.println(ArrangersAndTheirSongs.size());\r\n \r\n System.out.println(\"The size of ArrangersMap is:\"+ArrangersMap.size());\r\n System.out.println(\"The counter is:\"+counter);\r\n }", "private static void readAndWriteNodes(String name) throws IOException {\n System.out.println(name);\n Map<Long, Long> nodeMap = new HashMap<>();\n boolean firstLine = true;\n fileReader = new BufferedReader(new FileReader(PATH + name));\n fileWriter = new BufferedWriter(new FileWriter(PATH + \"/uid/\" + name));\n String line;\n while ((line = fileReader.readLine()) != null) {\n if (!firstLine) {\n long globalId = getGlobalId();\n String[] lineTokens = LINE_TOKEN_SEPARATOR.split(line);\n long ID = Long.parseLong(lineTokens[0]);\n nodeMap.put(ID, globalId);\n String writeLine = \"\";\n for (int i = 0; i < lineTokens.length; i++) {\n if (i == 0) {\n writeLine += globalId;\n } else {\n writeLine += lineTokens[i];\n }\n writeLine += \"|\";\n }\n fileWriter.write(writeLine);\n fileWriter.newLine();\n vertexCount++;\n globalVertexCount++;\n } else {\n fileWriter.write(line);\n fileWriter.newLine();\n firstLine = false;\n }\n }\n fileWriter.close();\n fileReader.close();\n counterMapNodes.put(name, vertexCount);\n vertexCount = 0;\n vertexList.add(nodeMap);\n }", "BsonToken getCurrentToken();", "public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException\n {\n String line = value.toString().toLowerCase();\n\n // Splitting into doc number and its text\n String document_split[] = line.split(\"\\t\",2);\n Text document_number = new Text(document_split[0]);\n\n // Replace all non alphabetic characters and non spaces with a space\n String document_content=document_split[1].replaceAll(\"[^ a-z]+\", \" \");\n\n String bigram_word_1=null;\n String bigram_word_2=null;\n // Tokenize into words\n StringTokenizer tokenizer = new StringTokenizer(document_content);\n int x=0;\n while(tokenizer.hasMoreTokens())\n {\n x+=1;\n if(x==1)\n {\n bigram_word_1=tokenizer.nextToken();\n }\n else\n {\n bigram_word_2=tokenizer.nextToken();\n String bigram_pair_string=bigram_word_1+\" \"+bigram_word_2;\n bigram_pair.set(bigram_pair_string);\n context.write(bigram_pair, document_number);\n break;\n }\n }\n while(tokenizer.hasMoreTokens())\n {\n bigram_word_1=bigram_word_2;\n bigram_word_2=tokenizer.nextToken();\n String bigram_pair_string=bigram_word_1+\" \"+bigram_word_2;\n bigram_pair.set(bigram_pair_string);\n context.write(bigram_pair, document_number);\n }\n }", "public void indexCreate()\n {\n try{\n Directory dir = FSDirectory.open(Paths.get(\"indice/\"));\n Analyzer analyzer = new StandardAnalyzer();\n IndexWriterConfig iwc = new IndexWriterConfig(analyzer);\n iwc.setOpenMode(OpenMode.CREATE);\n IndexWriter writer = new IndexWriter(dir,iwc);\n MongoConnection mongo = MongoConnection.getMongo();\n mongo.OpenMongoClient();\n DBCursor cursor = mongo.getTweets();\n Document doc = null;\n\n while (cursor.hasNext()) {\n DBObject cur = cursor.next();\n if (cur.get(\"retweet\").toString().equals(\"false\")) {\n doc = new Document();\n doc.add(new StringField(\"id\", cur.get(\"_id\").toString(), Field.Store.YES));\n doc.add(new TextField(\"text\", cur.get(\"text\").toString(), Field.Store.YES));\n doc.add(new StringField(\"analysis\", cur.get(\"analysis\").toString(), Field.Store.YES));\n //doc.add(new StringField(\"finalCountry\",cur.get(\"finalCountry\").toString(),Field.Store.YES));\n doc.add(new StringField(\"userScreenName\", cur.get(\"userScreenName\").toString(), Field.Store.YES));\n doc.add(new StringField(\"userFollowersCount\", cur.get(\"userFollowersCount\").toString(), Field.Store.YES));\n doc.add(new StringField(\"favoriteCount\", cur.get(\"favoriteCount\").toString(), Field.Store.YES));\n\n if (writer.getConfig().getOpenMode() == OpenMode.CREATE) {\n System.out.println(\"Indexando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.addDocument(doc);\n System.out.println(doc);\n } else {\n System.out.println(\"Actualizando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.updateDocument(new Term(\"text\" + cur.get(\"text\")), doc);\n System.out.println(doc);\n }\n }\n }\n cursor.close();\n writer.close();\n }\n catch(IOException ioe){\n System.out.println(\" Error en \"+ ioe.getClass() + \"\\n mensaje: \" + ioe.getMessage());\n }\n }", "private void indexDocumentHelper(HashMap<String, StringBuilder> fm)\n\t\t\tthrows IOException {\n\n\t\tIndexWriter writer = getIndexWriter();\n\n\t\tDocument doc = new Document();\n\n\t\tfor (int i = 0; i < fieldNames.length; i++) {\n\n\t\t\tif (fieldNames[i].equals(\"DOCNO\")) {\n\n\t\t\t\tdoc.add(new StringField(fieldNames[i], fm.get(fieldNames[i])\n\t\t\t\t\t\t.toString(), Field.Store.YES));\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tdoc.add(new TextField(fieldNames[i], fm.get(fieldNames[i])\n\t\t\t\t\t\t.toString(), Field.Store.YES));\n\t\t\t}\n\t\t}\n\n\t\twriter.addDocument(doc);\n\n\t}", "java.lang.String getDocumentId();", "@Override\n\tpublic String getDocumentKey() {\n\t\treturn uid.toString();\n\t}", "public void updateMapsRecords(){\n\n // The file to save the maps records\n File file= new File(MAPS_FILE_PATH);\n Document document = DocumentHelper.createDocument();\n Element rootElement = document.addElement(\"xml\");\n if(mapsList==null)\n return;\n for(GridMap themap:mapsList){\n rootElement.add(themap.encode());\n }\n FileOperator.fileWriter(file,document);\n }", "@Override\n public void run() {\n FirebaseFirestore.getInstance().collection(\"users/\" + companyID + \"/trips\")\n .addSnapshotListener(new EventListener<QuerySnapshot>() {\n @Override\n public void onEvent(@Nullable QuerySnapshot value, @Nullable FirebaseFirestoreException e) {\n if (e != null) {\n Log.w(TAG, \"Listen failed.\", e);\n return;\n }\n tripList.clear();//clear the ArrayList, because this method get all the document id instead of\n //the one that just created\n for (QueryDocumentSnapshot doc : value) {\n if (doc.getId() != null) {\n tripList.add(doc.getId());//store the document IDs to ArrayList\n\n Log.d(TAG, \"Retrieved data: \" + doc.getId());\n }\n }\n showTripList();//show trip name to listView\n }\n });\n }", "@RequestMapping(\"/showUpload\")\n\tpublic String showDocument(ModelMap map){\n\t\t//get all DB records and send to UI\n\t\tList<Object[]> ob=service.getFileIdAndNames();\n\t\tmap.addAttribute(\"listOb\", ob);\n\t\treturn \"UploadFile\";\n\t}", "public static void main(String[] args) throws Exception \n\t{\n\t\tList<String> stopWords = new ArrayList<String>();\n\t\tstopWords = stopWordsCreation();\n\n\n\t\t\n\t\tHashMap<Integer, String> hmap = new HashMap<Integer, String>();\t//Used in tittle, all terms are unique, and any dups become \" \"\n\t\n\t\t\n\t\tList<String> uniqueTerms = new ArrayList<String>();\n\t\tList<String> allTerms = new ArrayList<String>();\n\t\t\t\t\n\t\t\n\t\tHashMap<Integer, String> hmap2 = new HashMap<Integer, String>();\n\t\tHashMap<Integer, String> allValues = new HashMap<Integer, String>();\n\t\tHashMap<Integer, Double> docNorms = new HashMap<Integer, Double>();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tMap<Integer, List<String>> postingsFileListAllWords = new HashMap<>();\t\t\n\t\tMap<Integer, List<String>> postingsFileList = new HashMap<>();\n\t\t\n\t\tMap<Integer, List<StringBuilder>> docAndTitles = new HashMap<>();\n\t\tMap<Integer, List<StringBuilder>> docAndAbstract = new HashMap<>();\n\t\tMap<Integer, List<StringBuilder>> docAndAuthors = new HashMap<>();\n\t\t\n\t\t\n\t\tMap<Integer, List<Double>> termWeights = new HashMap<>();\n\t\t\n\t\tList<Integer> docTermCountList = new ArrayList<Integer>();\n\t\t\n\t\tBufferedReader br = null;\n\t\tFileReader fr = null;\n\t\tString sCurrentLine;\n\n\t\tint documentCount = 0;\n\t\tint documentFound = 0;\n\t\tint articleNew = 0;\n\t\tint docTermCount = 0;\n\t\t\n\t\t\n\t\tboolean abstractReached = false;\n\n\t\ttry {\n\t\t\tfr = new FileReader(FILENAME);\n\t\t\tbr = new BufferedReader(fr);\n\n\t\t\t// Continues to get 1 line from document until it reaches the end of EVERY doc\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) \n\t\t\t{\n\t\t\t\t// sCurrentLine now contains the 1 line from the document\n\n\t\t\t\t// Take line and split each word and place them into array\n\t\t\t\tString[] arr = sCurrentLine.split(\" \");\n\n\n\t\t\t\t//Go through the entire array\n\t\t\t\tfor (String ss : arr) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t * This section takes the array and checks to see if it has reached a new\n\t\t\t\t\t * document or not. If the current line begins with an .I, then it knows that a\n\t\t\t\t\t * document has just started. If it incounters another .I, then it knows that a\n\t\t\t\t\t * new document has started.\n\t\t\t\t\t */\n\t\t\t\t\t//System.out.println(\"Before anything: \"+sCurrentLine);\n\t\t\t\t\tif (arr[0].equals(\".I\")) \n\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\tif (articleNew == 0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarticleNew = 1;\n\t\t\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\t\t\t\t\t\t} \n\t\t\t\t\t\telse if (articleNew == 1) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarticleNew = 0;\n\t\t\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t//System.out.println(documentFound);\n\t\t\t\t\t\t//count++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/* This section detects that after a document has entered,\n\t\t\t\t\t * it has to gather all the words contained in the title \n\t\t\t\t\t * section.\n\t\t\t\t\t */\n\t\t\t\t\tif (arr[0].equals(\".T\") ) \n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Go to line UNDER .T since that is where tittle is located\n\t\t\t\t\t\t//sCurrentLine = br.readLine();\n\t\t\t\t\t\tdocAndTitles.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\t\t\tStringBuilder title = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".B|.A|.N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\t\t/* In this section, there are 2 lists being made. One list\n\t\t\t\t\t\t\t * is for all the unique words in every title in the document (hmap).\n\t\t\t\t\t\t\t * Hmap contains all unique words, and anytime a duplicate word is \n\t\t\t\t\t\t\t * found, it is replaced with an empty space in the map.\n\t\t\t\t\t\t\t * All Values \n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//postingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\t\t\t//postingsFileList.get(documentFound - 1).add(term2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"current line: \"+sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] tittle = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (tittle[0].equals(\".W\") )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\tabstractReached = true;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttitle.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (String tittleWords : tittle)\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.toLowerCase();\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'{}*|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'*{}|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'{}*|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\t//System.out.println(tittleWords);\n\t\t\t\t\t\t\t\tif (hmap.containsValue(tittleWords)) \n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, \" \");\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\tallTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tallTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\tif (!(uniqueTerms.contains(tittleWords)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ((stopWordsSetting && !(stopWords.contains(tittleWords))))\n\t\t\t\t\t\t\t\t\t\t\tuniqueTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\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//docAndTitles.get(documentCount).add(\" \");\n\t\t\t\t\t\t\ttitle.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"Title: \"+title);\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\tdocAndTitles.get(documentFound).add(title);\n\t\t\t\t\t\t//System.out.println(\"Done!: \"+ docAndTitles);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (arr[0].equals(\".A\") ) \n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Go to line UNDER .T since that is where tittle is located\n\t\t\t\t\t\t//sCurrentLine = br.readLine();\n\t\t\t\t\t\tdocAndAuthors.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\t\t\tStringBuilder author = new StringBuilder();\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\twhile ( !(sCurrentLine = br.readLine()).matches(\".N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* In this section, there are 2 lists being made. One list\n\t\t\t\t\t\t\t * is for all the unique words in every title in the document (hmap).\n\t\t\t\t\t\t\t * Hmap contains all unique words, and anytime a duplicate word is \n\t\t\t\t\t\t\t * found, it is replaced with an empty space in the map.\n\t\t\t\t\t\t\t * All Values \n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//postingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\t\t\t//postingsFileList.get(documentFound - 1).add(term2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"current line: \"+sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] tittle = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (tittle[0].equals(\".W\") )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\tabstractReached = true;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tauthor.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//docAndTitles.get(documentCount).add(\" \");\n\t\t\t\t\t\t\tauthor.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"Title: \"+title);\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\tdocAndAuthors.get(documentFound).add(author);\n\t\t\t\t\t\t//System.out.println(\"Done!: \"+ docAndTitles);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/* Since there may or may not be an asbtract after\n\t\t\t\t\t * the title, we need to check what the next section\n\t\t\t\t\t * is. We know that every doc has a publication date,\n\t\t\t\t\t * so it can end there, but if there is no abstract,\n\t\t\t\t\t * then it will keep scanning until it reaches the publication\n\t\t\t\t\t * date. If abstract is empty (in tests), it will also finish instantly\n\t\t\t\t\t * since it's blank and goes straight to .B (the publishing date).\n\t\t\t\t\t * Works EXACTLY like Title \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 (abstractReached) \n\t\t\t\t\t{\t\n\t\t\t\t\t\t//System.out.println(\"\\n\");\n\t\t\t\t\t\t//System.out.println(\"REACHED ABSTRACT and current line is: \" +sCurrentLine);\n\t\t\t\t\t\tdocAndAbstract.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\tStringBuilder totalAbstract = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".T|.I|.A|.N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tString[] abstaract = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (abstaract[0].equals(\".B\") )\n\t\t\t\t\t\t\t{\t\t\t\n\t\t\t\t\t\t\t\tabstractReached = false;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttotalAbstract.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] misc = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tfor (String miscWords : misc) \n\t\t\t\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\tmiscWords = miscWords.toLowerCase(); \n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|?{}!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\t\t\n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\t\t\n\t\t\t\t\t\t\t\t//System.out.println(miscWords);\n\t\t\t\t\t\t\t\tif (hmap.containsValue(miscWords)) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, \" \");\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tallTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\n\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tallTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tif (!(uniqueTerms.contains(miscWords)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ((stopWordsSetting && !(stopWords.contains(miscWords))))\n\t\t\t\t\t\t\t\t\t\t\tuniqueTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\ttotalAbstract.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocAndAbstract.get(documentFound).add(totalAbstract);\n\t\t\t\t\t}\n\t\t\t\t\t\n\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\n\t\t\t\t//Once article is found, we enter all of of it's title and abstract terms \n\t\t\t\tif (articleNew == 0) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tdocumentFound = documentFound - 1;\n\t\t\t\t\t//System.out.println(\"Words found in Doc: \" + documentFound);\n\t\t\t\t\t//System.out.println(\"Map is\" +allValues);\n\t\t\t\t\tSet set = hmap.entrySet();\n\t\t\t\t\tIterator iterator = set.iterator();\n\n\t\t\t\t\tSet set2 = allValues.entrySet();\n\t\t\t\t\tIterator iterator2 = set2.iterator();\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tpostingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\tpostingsFileListAllWords.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\t\tMap.Entry mentry = (Map.Entry) iterator.next();\n\t\t\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// (\"Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// );\n\t\t\t\t\t\tString term = mentry.getValue().toString();\n\t\t\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\t\t\tpostingsFileList.get(documentFound - 1).add(term);\n\t\t\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t\t\tdocTermCount++;\n\t\t\t\t\t}\n\t\t\t\t\t// \"BEFORE its put in, this is what it looks like\" + hmap);\n\t\t\t\t\thmap2.putAll(hmap);\n\t\t\t\t\thmap.clear();\n\t\t\t\t\tarticleNew = 1;\n\n\t\t\t\t\tdocTermCountList.add(docTermCount);\n\t\t\t\t\tdocTermCount = 0;\n\n\t\t\t\t\twhile (iterator2.hasNext()) {\n\t\t\t\t\t\tMap.Entry mentry2 = (Map.Entry) iterator2.next();\n\t\t\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// (\"Value2 is: \" + mentry2.getValue());\n\t\t\t\t\t\t// );\n\t\t\t\t\t\tString term = mentry2.getValue().toString();\n\t\t\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\t\t\tpostingsFileListAllWords.get(documentFound - 1).add(term);\n\t\t\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t\t\t// docTermCount++;\n\t\t\t\t\t}\n\n\t\t\t\t\tallValues.clear();\t\t\t\t\t\n\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\n\t\t\t\t\t// \"MEANWHILE THESE ARE ALL VALUES\" + postingsFileListAllWords);\n\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Looking at final doc!\");\n\t\t\t//Final loop for last sets\n\t\t\tSet set = hmap.entrySet();\n\t\t\tIterator iterator = set.iterator();\n\n\t\t\tSet setA = allValues.entrySet();\n\t\t\tIterator iteratorA = setA.iterator();\n\t\t\tpostingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\tpostingsFileListAllWords.put(documentFound - 1, new ArrayList<String>());\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tMap.Entry mentry = (Map.Entry) iterator.next();\n\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t// (\"Value is: \" + mentry.getValue());\n\t\t\t\t// //);\n\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\tString term2 = mentry.getValue().toString();\n\t\t\t\tpostingsFileList.get(documentFound - 1).add(term2);\n\n\t\t\t\tdocTermCount++;\n\t\t\t}\n\t\t\t//System.out.println(\"Done looking at final doc!\");\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Sorting time!\");\n\t\t\twhile (iteratorA.hasNext()) {\n\t\t\t\tMap.Entry mentry2 = (Map.Entry) iteratorA.next();\n\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t// (\"Value2 is: \" + mentry2.getValue());\n\t\t\t\t// //);\n\t\t\t\tString term = mentry2.getValue().toString();\n\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\tpostingsFileListAllWords.get(documentFound - 1).add(term);\n\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t// docTermCount++;\n\t\t\t}\n\n\t\t\thmap2.putAll(hmap);\n\t\t\thmap.clear();\n\t\t\tdocTermCountList.add(docTermCount);\n\t\t\tdocTermCount = 0;\n\n\n\t\t\t\n\t\t\n\t\t\t// END OF LOOKING AT ALL DOCS\n\t\t\t\n\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\n\t\t\t//System.out.println(\"All terms\" +allTerms);\n\t\t\tString[] sortedArray = allTerms.toArray(new String[0]);\n\t\t\tString[] sortedArrayUnique = uniqueTerms.toArray(new String[0]);\n\t\t\t//System.out.println(Arrays.toString(sortedArray));\n\t\t\t\n\t\t\tArrays.sort(sortedArray);\n\t\t\tArrays.sort(sortedArrayUnique);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//Sortings \n\t\t\tSet set3 = hmap2.entrySet();\n\t\t\tIterator iterator3 = set3.iterator();\n\n\t\t\t// Sorting the map\n\t\t\t//System.out.println(\"Before sorting \" +hmap2);\t\t\t\n\t\t\tMap<Integer, String> map = sortByValues(hmap2);\n\t\t\t//System.out.println(\"after sorting \" +map);\n\t\t\t// //\"After Sorting:\");\n\t\t\tSet set2 = map.entrySet();\n\t\t\tIterator iterator2 = set2.iterator();\n\t\t\tint docCount = 1;\n\t\t\twhile (iterator2.hasNext()) {\n\t\t\t\tMap.Entry me2 = (Map.Entry) iterator2.next();\n\t\t\t\t// (me2.getKey() + \": \");\n\t\t\t\t// //me2.getValue());\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(\"Done sorting!\");\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Posting starts \");\n\t\t\t//\"THIS IS START OF DICTIONARTY\" \n\t\t\tBufferedWriter bw = null;\n\t\t\tFileWriter fw = null;\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Start making an array thats big as every doc total \");\n\t\t\tfor (int z = 1; z < documentFound+1; z++)\n\t\t\t{\n\t\t\t\ttermWeights.put(z, new ArrayList<Double>());\n\t\t\t}\n\t\t\t//System.out.println(\"Done making that large array Doc \");\n\t\t\t\n\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\n\t\t\t//System.out.println(\"All terms\" +allTerms)\n\t\t\t//System.out.println(Arrays.toString(sortedArray));\n\t\t\t//System.out.println(Arrays.toString(sortedArrayUnique));\n\t\t\t//System.out.println(uniqueTerms);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//\tSystem.out.println(\"Posting starts \");\n\t\t\t// \tPOSTING FILE STARTS \n\t\t\ttry {\n\t\t\t\t// Posting File\n\t\t\t\t//System.out.println(\"postingsFileListAllWords: \"+postingsFileListAllWords); //Contains every word including Dups, seperated per doc\n\t\t\t\t//System.out.println(\"postingsFileList: \"+postingsFileList); \t\t //Contains unique words, dups are \" \", seperated per doc\n\t\t\t\t//System.out.println(\"postingsFileListAllWords.size(): \" +postingsFileListAllWords.size()); //Total # of docs \n\t\t\t\t//System.out.println(\"Array size: \"+sortedArrayUnique.length);\n\n\t\t\t\tfw = new FileWriter(POSTING);\n\t\t\t\tbw = new BufferedWriter(fw);\n\t\t\t\tString temp = \" \";\n\t\t\t\tDouble termFreq = 0.0;\n\t\t\t\t// //postingsFileListAllWords);\n\t\t\t\tList<String> finalTermList = new ArrayList<String>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t// //postingsFileList.get(i).size());\n\t\t\t\t\tfor (int j = 0; j < sortedArrayUnique.length; ++j)\t\t\t\t\t // go thru each word, CURRENT TERM\n\t\t\t\t\t{\n\t\t\t\t\t\t//System.out.println(\"Term is: \" + sortedArrayUnique[j]);\n\t\t\t\t\t\ttemp = sortedArrayUnique[j];\t\t\t\t\t\n\t\t\t\t\t\tif ((stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!(finalTermList.contains(temp))) \n\t\t\t\t\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\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//PART TO FIND DOCUMENT FREQ\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint docCountIDF = 0;\n\t\t\t\t\t\t\t//Start here for dictionary \n\t\t\t\t\t\t\tfor (int totalWords = 0; totalWords < sortedArray.length; totalWords++) \t\t\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (temp.compareTo(\" \") == 0 || (stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//EITHER BLANK OR STOPWORD \n\t\t\t\t\t\t\t\t\t//System.out.println(\"fOUND STOP WORD\");\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tString temp2 = sortedArray[totalWords];\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Compare: \"+temp+ \" with \" +temp2);\n\t\t\t\t\t\t\t\t\tif (temp.compareTo(temp2) == 0) {\n\t\t\t\t\t\t\t\t\t\t// (temp2+\" \");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tdocCountIDF++;\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//System.out.println(\"Total Number: \" +docCountIDF);\n\t\t\t\t\t\t\t//System.out.println(\"documentFound: \" +documentFound);\n\t\t\t\t\t\t\t//System.out.println(\"So its \" + documentFound + \" dividied by \" +docCountIDF);\n\t\t\t\t\t\t\t//docCountIDF = 1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble idf = (Math.log10(((double)documentFound/(double)docCountIDF)));\n\t\t\t\t\t\t\t//System.out.println(\"Calculated IDF: \"+idf);\n\t\t\t\t\t\t\tif (idf < 0.0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tidf = 0.0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"IDF is: \" +idf);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"Size of doc words: \" + postingsFileListAllWords.size());\n\t\t\t\t\t\t\tfor (int k = 0; k < postingsFileListAllWords.size(); k++) \t\t//Go thru each doc. Since only looking at 1 term, it does it once per doc\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//System.out.println(\"Current Doc: \" +(k+1));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\ttermFreq = 1 + (Math.log10(Collections.frequency(postingsFileListAllWords.get(k), temp)));\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Freq is: \" +Collections.frequency(postingsFileListAllWords.get(k), temp));\n\t\t\t\t\t\t\t\t\t//System.out.println(termFreq + \": \" + termFreq.isInfinite());\n\t\t\t\t\t\t\t\t\tif (termFreq.isInfinite() || termFreq <= 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttermFreq = 0.0;\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(\"termFreq :\" +termFreq); \n\t\t\t\t\t\t\t\t\t//System.out.println(\"idf: \" +idf);\n\t\t\t\t\t\t\t\t\ttermWeights.get(k+1).add( (idf*termFreq) );\t\t\t\t\t\t\t\t\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\n\t\t\t\t\t\t\t//System.out.println(\"\");\n\t\t\t\t\t\t\tfinalTermList.add(temp);\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//FINALCOUNTER\n\t\t\t\t\t\t//System.out.println(\"Done looking at word: \" +j);\n\t\t\t\t\t\t//System.out.println(\"\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\twhile (true)\n\t\t\t\t {\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Enter a query: \");\n\t\t\t\t\t\n\t \tScanner scanner = new Scanner(System.in);\n\t \tString enterQuery = scanner.nextLine();\n\t \t\n\t \t\n\t\t\t\t\tList<Double> queryWeights = new ArrayList<Double>();\n\t\t\t\t\t\n\t\t\t\t\t// Query turn\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tenterQuery = enterQuery.toLowerCase();\t\t\n\t\t\t\t\tenterQuery = enterQuery.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"]\", \"\");\n\t\t\t\t\t//System.out.println(\"Query is: \" + enterQuery);\n\t\t\t\t\t\n\t\t\t\t\tif (enterQuery.equals(\"exit\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tString[] queryArray = enterQuery.split(\" \");\n\t\t\t\t\tArrays.sort(queryArray);\n\t\t\t\t\t\n\t\t\t\t\t//Find the query weights for each term in vocab\n\t\t\t\t\tfor (int j = 0; j < sortedArrayUnique.length; ++j)\t\t\t\t\t // go thru each word, CURRENT TERM\n\t\t\t\t\t{\n\t\t\t\t\t\t//System.out.println(\"Term is: \" + sortedArrayUnique[j]);\n\t\t\t\t\t\ttemp = sortedArrayUnique[j];\t\t\t\t\t\n\t\t\t\t\t\tif ((stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tint docCountDF = 0;\n\t\t\t\t\t\t//Start here for dictionary \n\t\t\t\t\t\tfor (int totalWords = 0; totalWords < queryArray.length; totalWords++) \t\t\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (temp.compareTo(\" \") == 0 || (stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//EITHER BLANK OR STOPWORD\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tString temp2 = queryArray[totalWords];\n\t\t\t\t\t\t\t\t//System.out.println(\"Compare: \"+temp+ \" with \" +temp2);\n\t\t\t\t\t\t\t\tif (temp.compareTo(temp2) == 0) {\n\t\t\t\t\t\t\t\t\t// (temp2+\" \");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocCountDF++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tDouble queryWeight = 1 + (Math.log10(docCountDF));\n\t\t\t\t\t\tif (queryWeight.isInfinite())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tqueryWeight = 0.0;\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tqueryWeights.add(queryWeight);\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Query WEights is: \"+queryWeights);\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\t// Finding the norms for DOCS\t\t\t\t\t\n\t\t\t\t\tfor (int norms = 1; norms < documentFound+1; norms++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble currentTotal = 0.0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (int weightsPerDoc = 0; weightsPerDoc < termWeights.get(norms).size(); weightsPerDoc++)\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble square = Math.pow(termWeights.get(norms).get(weightsPerDoc), 2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"Current square: \" + termWeights.get(norms).get(weightsPerDoc));\n\t\t\t\t\t\t\tcurrentTotal = currentTotal + square;\n\t\t\t\t\t\t\t//System.out.println(\"Current total: \" + currentTotal);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"About to square root this: \" +currentTotal);\n\t\t\t\t\t\tdouble root = Math.sqrt(currentTotal);\n\t\t\t\t\t\tdocNorms.put(norms, root);\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(\"All of the docs norms: \"+docNorms);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Finding the norm for the query\n\t\t\t\t\tdouble currentTotal = 0.0;\t\t\t\t\t\n\t\t\t\t\tfor (int weightsPerDoc = 0; weightsPerDoc < queryWeights.size(); weightsPerDoc++)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tdouble square = Math.pow(queryWeights.get(weightsPerDoc), 2);\n\t\t\t\t\t\tcurrentTotal = currentTotal + square;\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tdouble root = Math.sqrt(currentTotal);\n\t\t\t\t\tdouble queryNorm = root; \t\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Query norm \" + queryNorm);\n\t\t\t\t\t\n\t\t\t\t\t//Finding the cosine sim\n\t\t\t\t\t//System.out.println(\"Term Weights \" + termWeights);\n\t\t\t\t\tHashMap<Integer, Double> cosineScore = new HashMap<Integer, Double>();\n\t\t\t\t\tfor (int cosineSim = 1; cosineSim < documentFound+1; cosineSim++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble total = 0.0;\n\t\t\t\t\t\tfor (int docTerms = 0; docTerms < termWeights.get(cosineSim).size(); docTerms++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble docTermWeight = termWeights.get(cosineSim).get(docTerms);\n\t\t\t\t\t\t\tdouble queryTermWeight = queryWeights.get(docTerms);\n\t\t\t\t\t\t\t//System.out.println(\"queryTermWeight \" + queryTermWeight);\n\t\t\t\t\t\t\t//System.out.println(\"docTermWeight \" + docTermWeight);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttotal = total + (docTermWeight*queryTermWeight);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdouble cosineSimScore = 0.0;\n\t\t\t\t\t\tif (!(total == 0.0 || (docNorms.get(cosineSim) * queryNorm) == 0))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcosineSimScore = total / (docNorms.get(cosineSim) * queryNorm);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcosineSimScore = 0.0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcosineScore.put(cosineSim, cosineSimScore);\n\t\t\t\t\t}\n\t\t\t\t\tcosineScore = sortByValues2(cosineScore);\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"This is the cosineScores: \" +cosineScore);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"docAndTitles: \"+ docAndTitles);\n\t\t\t\t\tint topK = 0;\n\t\t\t\t\tint noValue = 0;\n\t\t\t\t\tfor (Integer name: cosineScore.keySet())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (topK < 50)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\n\t\t\t\t String key =name.toString();\n\t\t\t\t //String value = cosineScore.get(name).toString(); \n\t\t\t\t if (!(cosineScore.get(name) <= 0))\n\t\t\t\t {\n\t\t\t\t \tSystem.out.println(\"Doc: \"+key);\t\t\t\t \t\t\t\t\t \t\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \tStringBuilder builder = new StringBuilder();\n\t\t\t\t \tfor (StringBuilder value : docAndTitles.get(name)) {\n\t\t\t\t \t builder.append(value);\n\t\t\t\t \t}\n\t\t\t\t \tString text = builder.toString();\t\t\t\t \t\n\t\t\t\t \t//System.out.println(\"Title:\\n\" +docAndTitles.get(name));\n\t\t\t\t \tSystem.out.println(\"Title: \" +text);\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 \t\n\t\t\t\t \t//System.out.println(\"Authors:\\n\" +docAndAuthors.get(name));\n\t\t\t\t \t\n\t\t\t\t \tif (docAndAuthors.get(name) == null || docAndAuthors.get(name).toString().equals(\"\"))\n\t\t\t\t \t{\n\t\t\t\t \t\tSystem.out.println(\"Authors: N\\\\A\\n\");\n\t\t\t\t \t}\n\t\t\t\t \telse \n\t\t\t\t \t{\t\t\t\t \t\t\t\t\t\t \t\n\t\t\t\t\t \tStringBuilder builder2 = new StringBuilder();\n\t\t\t\t\t \tfor (StringBuilder value : docAndAuthors.get(name)) {\n\t\t\t\t\t \t builder2.append(value);\n\t\t\t\t\t \t}\n\t\t\t\t\t \tString text2 = builder2.toString();\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t\t\t\t \tSystem.out.println(\"Authors found: \" +text2);\n\t\t\t\t \t}\t\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t/* ABSTRACT \n\t\t\t\t \tif (docAndAbstract.get(name) == null)\n\t\t\t\t \t{\n\t\t\t\t \t\tSystem.out.println(\"Abstract: N\\\\A\\n\");\n\t\t\t\t \t}\n\t\t\t\t \telse \n\t\t\t\t \t{\t\t\t\t \t\t\t\t\t\t \t\n\t\t\t\t\t \tStringBuilder builder2 = new StringBuilder();\n\t\t\t\t\t \tfor (StringBuilder value : docAndAbstract.get(name)) {\n\t\t\t\t\t \t builder2.append(value);\n\t\t\t\t\t \t}\n\t\t\t\t\t \tString text2 = builder2.toString();\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t\t\t\t \tSystem.out.println(\"Abstract: \" +text2);\n\t\t\t\t \t}\t\n\t\t\t\t \t*/\n\t\t\t\t \t\n\t\t\t\t \tSystem.out.println(\"\");\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t \tnoValue++;\n\t\t\t\t }\n\t\t\t\t topK++;\n\t\t\t\t \n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (noValue == documentFound)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"No documents contain query!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\ttopK=0;\n\t\t\t\t\tnoValue = 0;\n\t\t\t\t }\n\t\t\t\t\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (bw != null)\n\t\t\t\t\t\tbw.close();\n\n\t\t\t\t\tif (fw != null)\n\t\t\t\t\t\tfw.close();\n\n\t\t\t\t} catch (IOException ex) {\n\n\t\t\t\t\tex.printStackTrace();\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null)\n\t\t\t\t\tbr.close();\n\n\t\t\t\tif (fr != null)\n\t\t\t\t\tfr.close();\n\n\t\t\t} catch (IOException ex) {\n\n\t\t\t\tex.printStackTrace();\n\n\t\t\t}\n\n\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\tint itemCount = uniqueTerms.size();\n\t\t\t//System.out.println(allValues);\n\t\t\tSystem.out.println(\"Total Terms BEFORE STEMING: \" +itemCount);\n\t\t\tSystem.out.println(\"Total Documents \" + documentFound);\n\t\t\t\t\t\t\n\t\t \n\t\t\t \n\t\t\t \n\t\t\t//END OF MAIN\n\t\t}", "public static Map<Object, Object> processDocuments(\n\t\t\tString trainingSetFolderPath,boolean removeStopWords, boolean doSmoothing) {\n\t\tint numTokens = 0; \n\n\t\t// Map to store the processed results.\n\t\tMap<Object, Object> result = new HashMap<Object, Object>(); \n\n\t\t// Map to keep track of words and its frequency\n\n\t\tMap<String, Integer> tokenCntMap = new HashMap<String, Integer>(); \n\n\t\tFile trainingSetFolder = new File(trainingSetFolderPath);\n\t\tFile[] documents = trainingSetFolder.listFiles();\n\t\tfor (File doc : documents) {\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tBufferedReader bufferedReader = new BufferedReader(\n\t\t\t\t\t\tnew FileReader(doc));\n\t\t\t\tString line;\n\t\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\t\t\t\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\t\t\t\tnumTokens += tokens.length;\n\t\t\t\t\tif(removeStopWords == false){\n\t\t\t\t\t\tfor (String token : tokens) {\n\t\t\t\t\t\t\ttoken = token.replaceAll(\"[^a-zA-Z]\", \"\");\n\t\t\t\t\t\t\ttoken = token.toLowerCase();\n\t\t\t\t\t\t\tif(!token.isEmpty()){\n\t\t\t\t\t\t\t\tif (tokenCntMap.containsKey(token)) {\n\t\t\t\t\t\t\t\t\ttokenCntMap.put(token, tokenCntMap.get(token)\n\t\t\t\t\t\t\t\t\t\t\t.intValue() + 1);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttokenCntMap.put(token, 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfor (String token : tokens) {\n\t\t\t\t\t\t\ttoken = token.replaceAll(\"[^a-zA-Z]\", \"\");\n\t\t\t\t\t\t\ttoken = token.toLowerCase();\n\t\t\t\t\t\t\tif(!token.isEmpty() && !stopWords.contains(token)){\n\t\t\t\t\t\t\t\tif (tokenCntMap.containsKey(token)) {\n\t\t\t\t\t\t\t\t\ttokenCntMap.put(token, tokenCntMap.get(token)\n\t\t\t\t\t\t\t\t\t\t\t.intValue() + 1);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttokenCntMap.put(token, 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbufferedReader.close();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tresult.put(\"NumTokens\", numTokens);\n\t\tresult.put(\"NumDocuments\", documents.length);\n\t\tresult.put(\"TokenCntMap\", tokenCntMap);\n\t\treturn result;\n\n\t}", "public void fileSaved(OpenDefinitionsDocument doc) { }" ]
[ "0.61611456", "0.588707", "0.5825966", "0.5631039", "0.56064516", "0.5588778", "0.5588274", "0.5588257", "0.5482481", "0.54597014", "0.53377825", "0.53221774", "0.5288427", "0.5280946", "0.5271845", "0.526328", "0.52533746", "0.5247164", "0.5237755", "0.52139837", "0.5147063", "0.5143095", "0.5139286", "0.51007867", "0.5065813", "0.5048442", "0.5041212", "0.5037475", "0.5032802", "0.5023923", "0.50215435", "0.5006723", "0.500668", "0.49713916", "0.49678943", "0.49669752", "0.49610227", "0.49518725", "0.49502826", "0.49481288", "0.49297896", "0.49252555", "0.49239096", "0.4916581", "0.49081257", "0.49066624", "0.4906592", "0.49014223", "0.48978886", "0.48976412", "0.48922306", "0.48879686", "0.48848957", "0.48791248", "0.48732713", "0.48731962", "0.48714042", "0.48681888", "0.48643652", "0.4849195", "0.4844192", "0.48410356", "0.48381498", "0.48316827", "0.4831313", "0.48312816", "0.48264974", "0.48211884", "0.481908", "0.480654", "0.48015672", "0.48009118", "0.47905332", "0.47892487", "0.47891122", "0.47871354", "0.47860894", "0.47832796", "0.47741818", "0.4766521", "0.47650522", "0.47635826", "0.4760822", "0.47568697", "0.47553137", "0.47517624", "0.47443023", "0.47428954", "0.47390237", "0.47360379", "0.4733088", "0.47323674", "0.47308633", "0.47210333", "0.4713181", "0.47122255", "0.47119135", "0.4710721", "0.47097856", "0.47086433" ]
0.55061305
8
[NEW] Saves object "o" as a JSON file called fileName
public void saveJSON(String fileName, Object o){ // System.err.println("accessing disk"); Gson gson = new Gson(); try(FileWriter writer = new FileWriter(fileName)){ gson.toJson(o, writer); //System.err.println("\n Token stored"); }catch (IOException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void writeJsonObjectFile(JsonEntity objectToWrite, String filePath) \n\t{\n\t\tGson gsonParser = new Gson();\n\t\t\n\t\ttry \n\t\t{\n\t\t\tFiles.write(gsonParser.toJson(objectToWrite).getBytes(), new File(filePath));\n\t\t}\n\t\tcatch (IOException e) \n\t\t{\n\t\t\tSystem.err.println(\"Can't write to the json file\" + e.getMessage());\n\t\t}\n\t}", "public static void writeToJsonGzFile(Object jsonObj, Path filePath) throws JsonGenerationException, JsonMappingException, IOException {\n\n GZIPOutputStream gzipOS = new GZIPOutputStream(Files.newOutputStream(filePath));\n WritableByteChannel out = Channels.newChannel(gzipOS);\n\n ObjectMapper mapper = new ObjectMapper();\n byte[] jsonOut = mapper.writeValueAsBytes(jsonObj);\n out.write(ByteBuffer.wrap(jsonOut));\n out.close();\n\n }", "public void exportAsJsonFile(String path) throws IOException {\n Gson gson = new GsonBuilder().setPrettyPrinting().create();\n String json = gson.toJson(this);\n\n FileWriter writer = new FileWriter(path);\n writer.write(json);\n writer.close();\n }", "private void writeToFile() {\n try {\n FileOutputStream fos = new FileOutputStream(f);\n String toWrite = myJSON.toString(4);\n byte[] b = toWrite.getBytes();\n fos.write(b);\n fos.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static void createJsonFile(JsonObject json) throws IOException {\n\r\n FileWriter file = new FileWriter(\"outputfile\", false);\r\n try {\r\n file.write(Jsoner.prettyPrint(json.toJson(),2));\r\n file.flush();\r\n } catch (IOException e) {\r\n out.println(\"Error \" + e);\r\n }\r\n }", "String saveToFile(Object data, String fileName, FileFormat fileFormat) throws IOException;", "@Override\n\tpublic void save(Object o, String file) {\n\t\t\n\t}", "public void guardarEnJSON () {\n Gson gson = new GsonBuilder().setPrettyPrinting().create();\n String s = gson.toJson(this);\n try {\n FileWriter fw = new FileWriter(\"files/graph.json\");\n fw.write(s);\n fw.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void saveGame(String fileName){\n Gson gson = new Gson();\n String userJson = gson.toJson(player);\n\n try(Writer w = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(fileName), \"UTF-8\"))) {\n w.write(userJson);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void writeToFile(String filename, Object object) {\n try {\n FileOutputStream fileOutputStream = openFileOutput(filename, MODE_PRIVATE);\n ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);\n objectOutputStream.writeObject(object);\n objectOutputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static void exportJsonFile(File configFile) {\n Gson gson = new Gson();\n \n // Java object to JSON, and assign to a String\n String jsonInString = gson.toJson(GameConfig.getInstance());\n \n try {\n FileWriter writer = new FileWriter(configFile);\n \n writer.append(jsonInString);\n writer.flush();\n writer.close();\n } catch (IOException e) {\n LogUtils.error(\"exportJsonFile => \",e);\n }\n }", "private void writeObject(String filePath, Object obj) throws IOException {\n OutputStream file = new FileOutputStream(filePath);\n OutputStream buffer = new BufferedOutputStream(file);\n ObjectOutput output = new ObjectOutputStream(buffer);\n output.writeObject(obj);\n output.close();\n }", "public static void writeListToJsonFile(Object jsonObj, Path filePath) throws JsonGenerationException, JsonMappingException, IOException {\n\n final OutputStream out = new ByteArrayOutputStream();\n ObjectMapper mapper = new ObjectMapper();\n mapper.writeValue(out, jsonObj);\n\n final byte[] data = ((ByteArrayOutputStream) out).toByteArray();\n\n Files.write(filePath, data);\n\n }", "private void saveInFile() {\n try {\n FileOutputStream fos = openFileOutput(FILENAME,\n Context.MODE_PRIVATE);//goes stream based on filename\n BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos)); //create buffer writer\n Gson gson = new Gson();\n gson.toJson(countbookList, out);//convert java object to json string & save in output\n out.flush();\n fos.close();\n } catch (FileNotFoundException e) {\n throw new RuntimeException();\n } catch (IOException e) {\n throw new RuntimeException();\n }\n }", "private void saveInFile() {\n try {\n FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);\n\n BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos));\n\n Gson gson = new Gson();\n Log.d(\"PersonList\", personList.toString());\n gson.toJson(personList, out);\n out.flush();\n\n fos.close();\n\n } catch (FileNotFoundException e){\n throw new RuntimeException();\n } catch (IOException e){\n e.printStackTrace();\n }\n\n }", "public static void saveObj(Object obj, File file)\n {\n try(ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file)))\n {\n oos.writeObject(obj);\n }\n \n catch(IOException e)\n {\n JOptionPane.showMessageDialog(null, \"[Error] Failed to save file: \" + e.getMessage());\n }\n }", "@SuppressWarnings(\"unused\")\n public void SaveJsonCollectionsToFiles(){\n try {\n String formattedDate = FileNameUtils.DATE_FORMAT.format(new Date());\n ObjectWriter writer = mapper.writer(new DefaultPrettyPrinter());\n writer.writeValue(new File(FileNameUtils.GetValuesFileName(formattedDate)), jsonObjects);\n }\n catch(IOException exp){\n System.err.println(\"Error while creating JSON file. Reason: \" + exp.getMessage());\n }\n }", "public static void saveJSON(List<JSONObject> objects, String outputFile) {\n try (FileWriter file = new FileWriter(outputFile)) {\n for (JSONObject obj: objects)\n file.write(obj.toString() + '\\n');\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static boolean saveToFile(Object o, String fileName) {\n FileOutputStream fos = null;\n BufferedOutputStream bos = null;\n ObjectOutputStream oos = null;\n File objectFile = null;\n\n objectFile = new File(fileName);\n try {\n fos = new FileOutputStream(objectFile);\n bos = new BufferedOutputStream(fos);\n oos = new ObjectOutputStream(bos);\n oos.writeObject(o);\n oos.close();\n bos.close();\n fos.close();\n } catch (FileNotFoundException e) {\n return false;\n } catch (IOException e) {\n return false;\n }\n return true;\n }", "private void saveInFile() {\n\t\tthis.deleteFile();\n\t\tfor (CounterModel obj : counterListModel.getCounterList()) {\n\t\t\ttry {\n\t\t\t\tGson gson = new Gson();\n\t\t\t\tif (obj.getCounterName().equals(counterModel.getCounterName())) {\n\t\t\t\t\tobj = counterModel;\n\t\t\t\t}\n\t\t\t\tString json = gson.toJson(obj) +'\\n';\n\t\t\t\tFileOutputStream fos = openFileOutput(FILENAME,\n\t\t\t\t\t\tContext.MODE_APPEND);\n\t\t\t\tfos.write(json.getBytes());\n\t\t\t\tfos.close();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public <T> String SerializeJson(T obj, String pathToRoot) {\n this.lastPath = pathToRoot + obj.getClass().getSimpleName().toLowerCase() + \"_object-\" + Math.abs(new Random().nextLong()) + \".json\";\n File file = new File(this.lastPath);\n ObjectMapper mapper = new ObjectMapper();\n\n mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);\n mapper.registerModule(new JavaTimeModule());\n mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);\n\n try {\n file.createNewFile();\n mapper.writeValue(file, obj);\n System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(obj));\n return mapper.writeValueAsString(obj);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return \"\";\n }", "public static void save(Object o, String filename) {\n\t\ttry\n\t {\n\t\t\tfilename = \"save\" + File.separator + filename + \".hsc\";\n\t\t\tcreateSaveDirIfNotExisting();\n\t\t\tprepareSaveFile(filename);\n\t FileOutputStream fileOut = new FileOutputStream(filename);\n\t ObjectOutputStream out = new ObjectOutputStream(fileOut);\n\t out.writeObject(o.getClass().cast(o));\n\t out.close();\n\t fileOut.close();\n\t //System.out.println(\"Serialized object is saved in \" + filename);\n\t }catch(NotSerializableException e) {\n\t \t System.out.println(\"Object to be saved does not implement java.io.Serializable!\");\n\t \t e.printStackTrace();\n\t }\n\t\tcatch(IOException i)\n\t {\n\t i.printStackTrace();\n\t } \n\t}", "public void writeToFile(Object obj) throws FileNotFoundException, IOException\n {\n ObjectOutputStream writeToFile = null;\n\n try\n {\n FileOutputStream fileOutStream = new FileOutputStream(FILE_NAME);\n writeToFile = new ObjectOutputStream(fileOutStream);\n\n writeToFile.writeObject(obj);\n }\n finally\n {\n if (writeToFile != null)\n {\n try\n {\n writeToFile.close();\n }\n catch (IOException e)\n {\n displayErrorMessage(\"IO File error on\", FILE_NAME);\n }\n }\n }\n }", "private static void jsonWriter(JSONObject bookList) throws Exception{\r\n FileWriter file = new FileWriter(\"libreria.json\");\r\n file.write(bookList.toJSONString());\r\n file.flush();\r\n }", "public void escribirFichero(String textoenjson){\n {\n OutputStreamWriter escritor=null;\n try\n {\n escritor=new OutputStreamWriter(openFileOutput(\"datos.json\", Context.MODE_PRIVATE));\n escritor.write(textoenjson);\n }\n catch (Exception ex)\n {\n Log.e(\"ivan\", \"Error al escribir fichero a memoria interna\");\n }\n finally\n {\n try {\n if(escritor!=null)\n escritor.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n\n }", "public static void writeObjectToDisk(Object obj, String name) throws IOException {\r\n\t\t// Create file output stream\r\n\t\tFileOutputStream fileOutStr = new FileOutputStream(name);\r\n\t\t// Create object output stream and write object\r\n\t\tObjectOutputStream objOutStr = new ObjectOutputStream(fileOutStr);\r\n\t\tobjOutStr.writeObject(obj);\r\n\t\t// Close all streams\r\n\t\tobjOutStr.close();\r\n\t\tfileOutStr.close();\r\n\t\tSystem.out.printf(\"Serialized data is saved in a file - \" + name); // Printing message and file name which is\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// saved\r\n\t}", "public void writeToFile (String json) {\n // reset fos to null for checks\n FileOutputStream fos = null;\n try {\n String FILE_NAME = \"ExportedLearningCards.json\";\n fos = openFileOutput(FILE_NAME, MODE_PRIVATE);\n fos.write(json.getBytes());\n Toast.makeText(this, \"Saved to \" + getFilesDir() + \"/\" + FILE_NAME,\n Toast.LENGTH_LONG).show();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (fos != null) {\n try {\n fos.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }", "public static void serialize(Object obj, String fileName) throws IOException {\n\t\tFileOutputStream fos = new FileOutputStream(fileName);\n\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\toos.writeObject(obj);\n\n\t\tfos.close();\n\t}", "public static void save(final String filename, final Serializable object)\r\n throws IOException {\r\n FileOutputStream fos = null;\r\n ObjectOutputStream out = null;\r\n\r\n fos = new FileOutputStream(filename);\r\n out = new ObjectOutputStream(fos);\r\n out.writeObject(object);\r\n out.close();\r\n }", "public void exportJSON()\n {\n Gson JSONConverter = new Gson();\n FileWriter writer;\n\n try\n {\n // wipe the file\n PrintWriter write = new PrintWriter(new File(fp));\n write.print(\"\");\n write.close();\n\n // Initialize FileWriter to write Strings into JSON file.\n writer = new FileWriter(fp + \"/queue.json\");\n\n Iterator<ComparableCalendar> iter = this.queue.iterator();\n // Loop through the PQ.\n while(iter.hasNext())\n {\n ComparableCalendar nextObject = iter.next();\n // Convert an issue object into a JSON-formatted representation of it, as a String.\n String representationJSON = JSONConverter.toJson(nextObject);\n\n // Write that String to the file.\n writer.write(representationJSON + \"\\n\");\n }\n // Close the FileWriter to conserve system resources.\n writer.close();\n\n }\n catch (Exception e)\n {\n // Print any error messages that results to the console.\n e.printStackTrace();\n }\n\n }", "public JSONObject save();", "void saveToFile() {\n\t\ttry {\n\t\t\tFile directory = GameApplication.getInstance().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS);\n\t\t\tFile target = new File(directory, FILE_NAME);\n\t\t\tif (!target.exists()) {\n\t\t\t\ttarget.createNewFile();\n\t\t\t}\n\t\t\tJsonWriter writer = new JsonWriter(new FileWriter(target));\n\t\t\twriter.setIndent(\" \");\n\t\t\twriter.beginArray();\n\t\t\tfor (Scoreboard scoreboard : scoreboards.values()) {\n\t\t\t\twriteScoreboard(writer, scoreboard);\n\t\t\t}\n\t\t\twriter.endArray();\n\t\t\twriter.flush();\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void writeJsonToFile(List<Object> objLst, File file) throws Exception {\n writeJsonToFile(objLst, file, false);\n }", "public void saveToFile(Map<String, T> data) throws IOException{\n\t\tOutputStream file = new FileOutputStream(filePath);\n OutputStream buffer = new BufferedOutputStream(file);\n ObjectOutput output = new ObjectOutputStream(buffer);\n\n // serialize the Map\n output.writeObject(data);\n output.close();\n\t}", "public static void storeObject(Object object, String filename) throws IOException\n {\n storeObject(object, new File(filename));\n }", "private void saveInFile() {\n try {\n FileOutputStream fOut = openFileOutput(FILENAME,\n Context.MODE_PRIVATE);\n\n OutputStreamWriter writer = new OutputStreamWriter(fOut);\n Gson gson = new Gson();\n gson.toJson(counters, writer);\n writer.flush();\n\n fOut.close();\n\n } catch (FileNotFoundException e) {\n throw new RuntimeException();\n } catch (IOException e) {\n throw new RuntimeException();\n }\n }", "private void serializeObject(String filename, Object content)\n throws IOException\n {\n synchronized(filename)\n {\n FileOutputStream fileOut = new FileOutputStream(filename);\n ObjectOutputStream out = new ObjectOutputStream(fileOut);\n out.writeObject(content);\n out.close();\n fileOut.close();\n }\n }", "public static boolean writeToJson(Quote[] quotes, String filename) throws IOException {\n Gson write = new Gson();\n OutputStream outStream = new FileOutputStream(filename);\n BufferedWriter buffer = new BufferedWriter(new OutputStreamWriter(outStream));\n write.toJson(quotes, buffer);\n buffer.close();\n return true;\n }", "public static void writeJSONToFile(File file, JSONObject jsonObject) throws IOException {\n writeToFile(file, JSONObject.toJSONString(jsonObject));\n }", "public static void writeObjectToFile(Serializable object, String fileName) throws IOException {\n try (FileOutputStream fos = new FileOutputStream(fileName);\n ObjectOutputStream oos = new ObjectOutputStream(fos);) {\n oos.writeObject(object);\n }\n }", "public void saveData() {\n try {\n JsonWriter jw = new JsonWriter(openFileOutput(DATA_FILE, Context.MODE_PRIVATE));\n jw.write(user);\n jw.close();\n } catch(Exception e) {\n Log.i(\"Exception :\", e.toString());\n }\n }", "public static void saveObjToFile(Object obj, String filePath) throws IOException {\n // create the enclosing folders if it doesn't exist\n createDir(filePath);\n\n FileOutputStream file = new FileOutputStream(filePath);\n ObjectOutputStream out = new ObjectOutputStream(file);\n out.writeObject(obj);\n out.close();\n }", "public void saveTodo() {\r\n File file = new File(\"C:\\\\Users\\\\Dalia\\\\Desktop\\\\CPSC 210\\\\Project\\\\project_b2h3b\\\\data\");\r\n JFileChooser chooser = new JFileChooser();\r\n chooser.setDialogTitle(\"Specify a file to save\");\r\n chooser.setCurrentDirectory(file);\r\n int userSelection = chooser.showSaveDialog(null);\r\n if (userSelection == JFileChooser.APPROVE_OPTION) {\r\n File f = chooser.getSelectedFile();\r\n System.out.println(\"Save as file: \" + f.getAbsolutePath());\r\n String tempFileName = f.getAbsolutePath();\r\n writer = new MyTodoJsonWriter(tempFileName);\r\n try {\r\n writer.open();\r\n writer.write(myTodo);\r\n fileName = tempFileName;\r\n playSound(\"c1.wav\");\r\n } catch (IOException ioException) {\r\n JOptionPane.showMessageDialog(null, \"Cannot save todolist!\");\r\n } finally {\r\n writer.close();\r\n JOptionPane.showMessageDialog(null, \"Save successful!\");\r\n }\r\n todoListGui();\r\n }\r\n }", "private static boolean saveMOTD(JSONObject motdObj) {\n File JSONFile = new File(plugin.getDataFolder() + \"/motd.json\");\n\n try ( //open our writer and write the player file\n PrintWriter writer = new PrintWriter(JSONFile)) {\n //System.out.println(obj);\n writer.print(motdObj.toString(4));\n writer.close();\n Logger.getLogger(MOTDHandler.class.getName()).log(Level.INFO, \"Successfully updated motd.json\");\n return true;\n } catch (FileNotFoundException ex) {\n\n Logger.getLogger(MOTDHandler.class.getName()).log(Level.SEVERE, null, ex);\n return false;\n }\n }", "void generateJSON(JSONObject object, String name);", "public void writeObject(Object obj, String path)throws IOException{\n FileOutputStream fos = new FileOutputStream(path);\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n\n oos.writeObject(obj);\n oos.close();\n }", "public void saveArchive() throws FileNotFoundException {\n jsonWriter.open();\n Archive archive = new Archive(cameraCollection, filmCollection);\n jsonWriter.write(archive);\n jsonWriter.close();\n }", "public void WriteJSON(Costumer costumer) {\n\n JSONObject costumerDetails = new JSONObject();\n JSONObject documentDetails = new JSONObject();\n\n documentDetails.put(\"type\", costumer.getDocument().getType());\n documentDetails.put(\"nDocument\", costumer.getDocument().getnDocument());\n documentDetails.put(\"ExpiryDate\", costumer.getDocument().getDateExpiry());\n\n System.out.println(\"dco \" + documentDetails);\n\n costumerDetails.put(\"name\", costumer.getName());\n costumerDetails.put(\"surname\", costumer.getSurname());\n costumerDetails.put(\"dateOfBirth\", costumer.getDateOfBirth());\n costumerDetails.put(\"cityOfBirth\", costumer.getCityOfBirth());\n costumerDetails.put(\"cityOfResidence\", costumer.getCityOfResidence());\n costumerDetails.put(\"address\", costumer.getAddress());\n costumerDetails.put(\"telephone\", costumer.getTelephone());\n costumerDetails.put(\"fiscalCode\", costumer.getFiscalCode());\n costumerDetails.put(\"province\", costumer.getProvince());\n costumerDetails.put(\"document\", documentDetails);\n\n costumerObject.put(\"costumer\", costumerDetails);\n\n //Add costumer to list\n costumerList.add(costumerObject);\n\n //add costumer ot the object list\n this.cList.add(costumer);\n\n //Write JSON file\n try (FileWriter file = new FileWriter(\"costumers.json\")) {\n\n file.write(costumerList.toJSONString());\n file.flush();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public static void saveConfig(Object config, File file) throws IOException {\n file.createNewFile();\n String json = gson.toJson(parser.parse(gson.toJson(config)));\n try (PrintWriter out = new PrintWriter(file)) {\n out.println(json);\n }\n }", "public static void writeObject(Activity activity, Object object, String filename) {\n FileOutputStream fos = null;\n ObjectOutputStream oos = null;\n try {\n fos = activity.openFileOutput(filename, Context.MODE_PRIVATE);\n oos = new ObjectOutputStream(fos);\n oos.writeObject(object);\n } catch (IOException e) {\n e.printStackTrace();\n }\n finally {\n closeOutputStream(fos);\n closeOutputStream(oos);\n }\n }", "public void createJSON(String filePath, JSONObject jsonObject) throws ExistException, UnimplementedException, UnderlyingStorageException {\n \t\tSystem.err.println(jsonObject);\n \t\tjsonObject=cspace264Hack_munge(jsonObject,filePath);\n \t\tautocreateJSON(\"\",jsonObject);\n \t\t// XXX End of here's what we do because of CSPACE-264\t\t\n \t\t// Here's what we should do ->\n \t\t// throw new UnimplementedException(\"Cannot create collectionobject at known path, use autocreateJSON\");\n \t}", "public static File writeObjectToTempFile(Serializable o, String filename)\n/* */ throws IOException\n/* */ {\n/* 76 */ File file = File.createTempFile(filename, \".tmp\");\n/* 77 */ file.deleteOnExit();\n/* 78 */ ObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(new GZIPOutputStream(new FileOutputStream(file))));\n/* 79 */ oos.writeObject(o);\n/* 80 */ oos.close();\n/* 81 */ return file;\n/* */ }", "@Override\n\tpublic void saveData(Object objectsToSave, String path) {\n\t\t\n\t\ttry {\n\t\t\tString objects = (String) objectsToSave;\n\t\t\tFileOutputStream fileOutputStream = new FileOutputStream(path);\n\t\t\tfileOutputStream.write(objects.getBytes());\n\t\t\tfileOutputStream.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public void save(){\n Player temp = Arena.CUR_PLAYER;\n try{\n FileOutputStream outputFile = new FileOutputStream(\"./data.sec\");\n ObjectOutputStream objectOut = new ObjectOutputStream(outputFile);\n objectOut.writeObject(temp);\n objectOut.close();\n outputFile.close();\n }\n catch(FileNotFoundException e){\n System.out.print(\"Cannot create a file at that location\");\n }\n catch(SecurityException e){\n System.out.print(\"Permission Denied!\");\n }\n catch(IOException e){\n System.out.println(\"Error 203\");\n } \n }", "private File getOpenApiFile(String oasDefinition) throws IOException {\n File oasTempFile = File.createTempFile(\"oasTempFile\", \".json\");\n try (BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(oasTempFile),\n StandardCharsets.UTF_8))) {\n bw.write(oasDefinition);\n }\n return oasTempFile;\n }", "public static void appendJsonToFile(List<Object> objLst, File file) throws Exception {\n writeJsonToFile(objLst, file, true);\n }", "private void setFile(Serializable object, String path) throws Exception {\t\t\n\t\t\n FileOutputStream fileOut = new FileOutputStream(path);\n ObjectOutputStream objectOut = new ObjectOutputStream(fileOut);\n objectOut.writeObject(object);\n objectOut.close(); \n\t\t\n\t}", "public static void jsonWrite() \n\t{\n JSONArray arrJson = new JSONArray(); \n FileWriter writeFile = null;\n Iterator<Taxi_Model> taxiIterator = L.iterator();\n\n while(taxiIterator.hasNext()) \n {\n \tJSONObject jsonObject = new JSONObject();\n \tTaxi_Model aux = new Taxi_Model();\n \taux = taxiIterator.next();\n \tJSONArray array = new JSONArray();\n \tarray.add(aux.getLocalizacao()[0]);\n \tarray.add(aux.getLocalizacao()[1]);\n \t\n \t//Armazena dados em um Objeto JSON\n \tjsonObject.put(\"Usuario\", aux.getUsuario());\n jsonObject.put(\"Nome\", aux.getNome());\n jsonObject.put(\"Senha\", aux.getSenha());\n jsonObject.put(\"CPF\", aux.getCpf());\n jsonObject.put(\"Cor do Carro\", aux.getCorCarro());\n jsonObject.put(\"Modelo do Carro\", aux.getModeloCarro());\n jsonObject.put(\"Placa do Carro\", aux.getPlaca());\n jsonObject.put(\"Localizacao\", array);\n jsonObject.put(\"Pontuacao\", aux.getPontuacao());\n jsonObject.put(\"Corridas\", aux.getTotalCorridas());\n jsonObject.put(\"Tempo total\", aux.getTempoTotal());\n jsonObject.put(\"Tempo programado\", aux.getTempoProgramada());\n arrJson.add(jsonObject);\n }\n \n try\n {\n writeFile = new FileWriter(\"taxis.json\");\n //Escreve no arquivo conteudo do Objeto JSON\n writeFile.write(arrJson.toJSONString());\n writeFile.close();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n\t}", "private void saveInFile(final String fileName, ArrayList<Habit> habitArray) {\r\n try {\r\n FileOutputStream fos = openFileOutput(fileName, 0);\r\n BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos));\r\n Gson gson = new Gson();\r\n gson.toJson(habitArray, out);\r\n out.flush();\r\n\r\n fos.close();\r\n } catch (FileNotFoundException e) {\r\n // TODO Auto-generated catch block\r\n throw new RuntimeException();\r\n } catch (IOException e) {\r\n // TODO Auto-generated catch block\r\n throw new RuntimeException();\r\n }\r\n }", "public static void writeuser(String modelJson, Context context){\n\t\ttry {\n\t\t\t\n\t\t\tOutputStream outputStream = context.getApplicationContext()\n\t\t\t\t\t.openFileOutput(filename, Context.MODE_PRIVATE);\n\t\t\tOutputStreamWriter fileWriter = new OutputStreamWriter(outputStream);\n\t\t\tfileWriter.write(modelJson + \"\\r\\n\");\n\t\t\tfileWriter.close();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void serialize(String file_name) {\n\t\t//Saving of object in a file\n\t\ttry {\n\t\t\tFileOutputStream file = new FileOutputStream(file_name);\n\t\t\tObjectOutputStream out = new ObjectOutputStream(file);\n\t\t\t// Method for serialization of object\n\t\t\tout.writeObject(this.GA);\n\n\t\t\tout.close();\n\t\t\tfile.close();\n\n\t\t\tSystem.out.println(\"Object has benn serialized\");\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"IOException is caught,Object didnt save.\");\n\t\t}\n\t}", "public void save(String json, Map<String,Object> properties);", "private void saveWorld() {\n try {\n jsonWriter.open();\n jsonWriter.write(world);\n jsonWriter.close();\n System.out.println(\"Saved world to \" + JSON_STORE);\n } catch (FileNotFoundException e) {\n System.out.println(\"Unable to write to file: \" + JSON_STORE);\n }\n }", "public void logEmissions(JSONObject object, Context context) {\n try {\n JSONArray jsonArray = readEmissionsLog(context);\n if (jsonArray == null) {\n jsonArray = new JSONArray();\n }\n FileOutputStream fos = context.openFileOutput(profileManager.getActiveUserName() + \"Nutrition.json\", Context.MODE_PRIVATE);\n JSONObject jsonObject = new JSONObject();\n jsonObject.put(\"Nutrition data\", object);\n jsonArray.put(jsonObject);\n fos.write(jsonArray.toString().getBytes());\n fos.close();\n } catch (IOException | JSONException e) {\n Log.e(\"IOException\", \"Error occurred writing file \");\n }\n }", "public synchronized void saveTableInJson(Table table) throws IOException {\r\n Gson gson = new GsonBuilder().setPrettyPrinting().create();\r\n\r\n /*\r\n * I don't know why but this line below doesn't work...\r\n * The strange thing is it was working fine, but just in one moment stopped.\r\n * I checked everything, I even reverted the done work to the initial state.\r\n * Nothing helped.\r\n */\r\n //gson.toJson(table, new FileWriter(stringPathToTable));\r\n\r\n String jsonTable = gson.toJson(table);\r\n FileWriter fileWriter = new FileWriter(stringPathToTable);\r\n fileWriter.write(jsonTable);\r\n fileWriter.close();\r\n }", "public static void write(String modelJson, Context context){\n\t\ttry {\n\t\t\t\n\t\t\tOutputStream outputStream = context.getApplicationContext()\n\t\t\t\t\t.openFileOutput(filename, Context.MODE_APPEND);\n\t\t\tOutputStreamWriter fileWriter = new OutputStreamWriter(outputStream);\n\t\t\tfileWriter.write(modelJson + \"\\r\\n\");\n\t\t\tfileWriter.close();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static final void serializeToFile(Object object,String filename)\n\t{\n\t\t// Define local constants.\n\n\t\tString METHOD_NAME = \"serializeToFile\";\n\n\t\t// Check the parameters received and throw the appropriate\n\t\t// exception if necessary.\n\n\t\tif ((null == object) || (null == filename))\n\t\t{\n\t\t\tthrow new NullPointerException(Messages.buildErrorMessage(CLASS_NAME,\n\t\t\t METHOD_NAME,\n\t\t\t Messages.NULL_PARAMETER_MSG));\n\t\t}\n\n\t\tif (0 == filename.length())\n\t\t{\n\t\t\tthrow new IllegalArgumentException(Messages.buildErrorMessage(CLASS_NAME,\n\t\t\t METHOD_NAME,\n\t\t\t Messages.ZERO_LENGTH_PARAMETER_MSG));\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\tObjectOutputStream objectOutputStream =\n\t\t\t\tnew ObjectOutputStream(new FileOutputStream(filename));\n\t\t\tobjectOutputStream.writeObject(object);\n\t\t\tobjectOutputStream.close();\n\t\t}\n\n\t\tcatch (IOException exception)\n\t\t{\n\t\t\tSystem.out.println(\"Caught: \" + exception);\n\t\t}\n\t}", "public static File writeObjectToTempFileNoExceptions(Serializable o, String filename)\n/* */ {\n/* */ try\n/* */ {\n/* 93 */ return writeObjectToTempFile(o, filename);\n/* */ } catch (Exception e) {\n/* 95 */ System.err.println(\"Error writing object to file \" + filename);\n/* 96 */ e.printStackTrace(); }\n/* 97 */ return null;\n/* */ }", "private void writeMapToFile() {\r\n\t\ttry {\r\n\t\t\tString dm = gson.toJson(daoMap);// gson.toJson(entity);\r\n\t\t\tFileWriter fileWriter = new FileWriter(path);\r\n\t\t\t\r\n\t\t\tfileWriter.write(dm);\r\n\t\t\tfileWriter.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "static void WriteEmployeeObjectIntoFile(Employee emp,String filename)\n\t{\n\t\t\n\t try\n\t {\n\t FileOutputStream fileOut =\n\t new FileOutputStream(filename);\n\t ObjectOutputStream out = new ObjectOutputStream(fileOut);\n\t //Main write method\n\t out.writeObject(emp);\n\t out.close();\n\t fileOut.close();\n\t System.out.printf(\"Serialized data is saved in \" + filename);\n\t }catch(IOException i)\n\t {\n\t i.printStackTrace();\n\t }\n\t}", "public boolean saveJson(String pathFile) {\n try {\n jsonObject.put(\"namespace\", this.numNamespace);\n jsonObject.put(\"class\", this.numClasses);\n jsonObject.put(\"interface\", this.numInterfaces);\n jsonObject.put(\"method\", this.numMethods);\n jsonObject.put(\"enumItem\", this.numEnumItem);\n jsonObject.put(\"enum\", this.numEnum);\n jsonObject.put(\"page\", this.numLinks);\n jsonObject.put(\"Classes\", classlist);\n jsonObject.put(\"Interfaces\", interfacelist);\n jsonObject.put(\"Enum\", enumlist);\n FileWriter file = new FileWriter(pathFile + this.fileName + \".json\");\n file.write(jsonObject.toJSONString());\n file.flush();\n file.close();\n return true;\n } catch (IOException e) {\n return false;\n }\n }", "String toJson() throws IOException;", "public void writeObject(Object obj) throws IOException;", "private static void saveJsonFile() {\n Log.println(Log.INFO, \"FileAccessing\", \"Writing settings file.\");\n JsonObject toSave = new JsonObject();\n JsonArray mappingControls = new JsonArray();\n for (int i = 0; i < TaskDetail.actionToTask.size(); i++) {\n JsonObject individualMapping = new JsonObject();\n TaskDetail detail = TaskDetail.actionToTask.valueAt(i);\n byte combinedAction = (byte) TaskDetail.actionToTask.keyAt(i);\n assert detail != null;\n int outerControl = detail.getTask();\n individualMapping.addProperty(\"combinedAction\", combinedAction);\n individualMapping.addProperty(\"task\", outerControl);\n mappingControls.add(individualMapping);\n }\n toSave.add(\"mappingControls\", mappingControls);\n\n JsonArray generalSettings = new JsonArray();\n for (SettingDetail setting : SettingDetail.settingDetails) {\n JsonObject individualSetting = new JsonObject();\n int status = setting.getCurrentIdx();\n individualSetting.addProperty(\"status\", status);\n generalSettings.add(individualSetting);\n }\n toSave.add(\"generalSettings\", generalSettings);\n\n JsonArray deviceList = new JsonArray();\n for (DeviceDetail device : DeviceDetail.deviceDetails) {\n JsonObject individualDevice = new JsonObject();\n individualDevice.addProperty(\"name\", device.deviceName);\n individualDevice.addProperty(\"mac\", device.macAddress);\n deviceList.add(individualDevice);\n }\n toSave.add(\"devices\", deviceList);\n\n JsonArray sensitivityList = new JsonArray();\n for (SensitivitySetting sensitivity : SensitivitySetting.sensitivitySettings) {\n JsonObject individualSensitivity = new JsonObject();\n individualSensitivity.addProperty(\"factor\", sensitivity.multiplicativeFactor);\n individualSensitivity.addProperty(\"sensitivity\", sensitivity.sensitivity);\n sensitivityList.add(individualSensitivity);\n }\n toSave.add(\"sensitivities\", sensitivityList);\n\n toSave.addProperty(\"currentlySelected\", DeviceDetail.getIndexSelected());\n\n try {\n FileOutputStream outputStreamWriter = context.openFileOutput(\"settingDetails.json\", Context.MODE_PRIVATE);\n outputStreamWriter.write(toSave.toString().getBytes());\n outputStreamWriter.close();\n } catch (IOException e) {\n Log.println(Log.ERROR, \"FileAccessing\", \"Settings file writing error.\");\n }\n }", "private void save(String fileName, String json){\n mJSonNotifications = getSharedPreferences(fileName, MODE_PRIVATE);\n mJSonNotifications.edit().putString(fileName, json).apply();\n }", "public static void saveTestSequenceToJson(TestSequenceList testSequenceList, String absoluteFilePath) {\n Gson gson = new GsonBuilder().enableComplexMapKeySerialization().setPrettyPrinting().create();\r\n String jsonString = gson.toJson(testSequenceList);\r\n try {\r\n FileWriter fileWriter = new FileWriter(absoluteFilePath);\r\n fileWriter.write(jsonString);\r\n System.out.println(\"File saved successfully\");\r\n fileWriter.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public static File writeObjectToFileNoExceptions(Serializable o, String filename)\n/* */ {\n/* 47 */ file = null;\n/* 48 */ ObjectOutputStream oos = null;\n/* */ try {\n/* 50 */ file = new File(filename);\n/* */ \n/* 52 */ oos = new ObjectOutputStream(new BufferedOutputStream(new GZIPOutputStream(new FileOutputStream(file))));\n/* 53 */ oos.writeObject(o);\n/* 54 */ oos.close();\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 65 */ return file;\n/* */ }\n/* */ catch (Exception e)\n/* */ {\n/* 56 */ e.printStackTrace();\n/* */ } finally {\n/* 58 */ if (oos != null) {\n/* */ try {\n/* 60 */ oos.close();\n/* */ }\n/* */ catch (Exception ioe) {}\n/* */ }\n/* */ }\n/* */ }", "public void serialize(JsonObject dest);", "public void writeToJSON(String filePath) throws IOException {\n try (PrintWriter pw = new PrintWriter(filePath)) {\n pw.printf(\"{\\n\\t\\\"patients\\\": [\\n\");\n for (int i = 0; i < dataFrame.getRowCount(); i++) {\n pw.printf(\"\\t\\t{\\n\");\n Iterator<String> it = dataFrame.getColumnNames().iterator();\n while (it.hasNext()){\n String colName = it.next();\n if (it.hasNext())\n pw.printf(\"\\t\\t\\t\\\"%s\\\":\\\"%s\\\",\\n\", colName, dataFrame.getValue(colName, i));\n else\n pw.printf(\"\\t\\t\\t\\\"%s\\\":\\\"%s\\\"\\n\", colName, dataFrame.getValue(colName, i));\n }\n if (i+1<dataFrame.getRowCount())\n pw.printf(\"\\t\\t},\\n\");\n else\n pw.printf(\"\\t\\t}\\n\\t]\\n\");\n }\n pw.printf(\"}\\n\");\n }\n }", "private void save() {\n if (mCacheFile.exists()) {\n mCacheFile.delete();\n }\n\n try (JsonWriter writer = new JsonWriter(new BufferedWriter(new FileWriter(mCacheFile)))) {\n writer.beginObject();\n writer.name(PRINTER_LIST_NAMES.get(0));\n writer.beginArray();\n for (DiscoveredPrinter printer : mSavedPrinters) {\n printer.write(writer);\n }\n writer.endArray();\n writer.endObject();\n } catch (NullPointerException | IOException e) {\n Log.w(TAG, \"Error while storing to \" + mCacheFile, e);\n }\n }", "public void saveToDoList() {\n try {\n jsonWriter.open();\n jsonWriter.write(toDoList);\n jsonWriter.close();\n\n System.out.println(\"Saved \" + toDoList.getName() + \" to \" + JSON_STORE);\n } catch (FileNotFoundException e) {\n System.out.println(\"Unable to write to file: \" + JSON_STORE);\n }\n }", "public static void save(DSAGraph objToSave, String filename)\n {\n FileOutputStream fileStrm;\n ObjectOutputStream objStrm;\n\n try\n {\n fileStrm = new FileOutputStream(filename); //Underlying stream\n objStrm = new ObjectOutputStream(fileStrm); //Object serialization stream\n objStrm.writeObject(objToSave); //Serialize and save to filename\n objStrm.close();//Clean up\n }\n catch (Exception e)\n { //should do more here\n throw new IllegalArgumentException(\"Unable to save object to file: \" + e);\n }\n }", "private String convertToJSON(Object o) throws JsonProcessingException {\n return new ObjectMapper().writeValueAsString(o);\n }", "public void WriteJSON(Dog dog) {\n\n JSONObject dogDetails = new JSONObject();\n\n dogDetails.put(\"id\", (dList.size()));\n dogDetails.put(\"name\", dog.getName());\n dogDetails.put(\"race\", dog.getRace());\n dogDetails.put(\"color\", dog.getColor());\n dogDetails.put(\"domestic\", dog.getDomestic());\n dogDetails.put(\"age\", dog.getAge());\n dogDetails.put(\"gender\", dog.getGender());\n dogDetails.put(\"size\", dog.getSize());\n dogDetails.put(\"medicalRecords\", null);\n dogDetails.put(\"quarantine\", \"No\");\n\n dogObject.put(\"dog\", dogDetails);\n\n //Add dog to Jsonlist\n dogList.add(dogObject);\n\n //Add dog to ObjectList\n this.dList.add(dog);\n\n //Write JSON file\n try (FileWriter file = new FileWriter(\"dogs.json\")) {\n\n file.write(dogList.toJSONString());\n file.flush();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public static void generarFicheroJSON(App aplicacion) throws IOException {\n\n ObjectMapper mapeador = new ObjectMapper();\n\n mapeador.configure(SerializationFeature.INDENT_OUTPUT, true);\n\n // Escribe en un fichero JSON el objeto que le pasamos\n mapeador.writeValue(new File(\"./aplicaciones/\" + aplicacion.getNombre() + \".json\"), aplicacion);\n\n }", "public void writeObjectToFile(ClickerCounterModel[] temp) {\n\t\ttry {\n\t\t\tGson gson = new Gson();\n\t\t\tString string = gson.toJson(temp);\n\t\t\tFileOutputStream outputStream = openFileOutput(filename,\n\t\t\t\t\tContext.MODE_PRIVATE);\n\t\t\toutputStream.write(string.getBytes());\n\t\t\toutputStream.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "String parseObjectToJson(Object obj);", "public String autocreateJSON(String filePath, JSONObject jsonObject) throws ExistException, UnderlyingStorageException, UnimplementedException {\n \t\ttry {\n \t\t\tDocument doc=cspace266Hack_munge(jxj.json2xml(jsonObject));\n \t\t\tSystem.err.println(\"153 got \"+doc.asXML());\n \t\t\tReturnedURL url = conn.getURL(RequestMethod.POST,\"collectionobjects/\",doc);\n \t\t\tif(url.getStatus()>299 || url.getStatus()<200)\n \t\t\t\tthrow new UnderlyingStorageException(\"Bad response \"+url.getStatus());\n \t\t\treturn url.getURLTail();\n \t\t} catch (BadRequestException e) {\n \t\t\tthrow new UnderlyingStorageException(\"Service layer exception\",e);\n \t\t} catch (InvalidXTmplException e) {\n \t\t\tthrow new UnimplementedException(\"Error in template\",e);\n \t\t}\n \t}", "public String objectToJson(Object o){\n Gson gson = new Gson();\n String json = gson.toJson(o);\n return json;\n }", "public static boolean writeObjectToFile(Object obj, File f) {\r\n try {\r\n FileOutputStream fout = new FileOutputStream(f);\r\n ObjectOutputStream oos = new ObjectOutputStream(fout);\r\n oos.writeObject(obj);\r\n oos.close();\r\n } catch (Exception e) {\r\n System.out.println(\"Error writing Object to file: \"\r\n + e.getMessage());\r\n return false;\r\n }\r\n return true;\r\n }", "public interface JStorable {\n\t/**\n\t * Return the Object as an JSONObject\n\t */\n\tpublic JSONObject save();\n\t/**\n\t * Load the Object from a JSONObject\n\t * @param obj\n\t * \t\tThe JSONObject\n\t */\n\tpublic void load(JSONObject obj);\n}", "private void writeToFile(String pathName,Object logs) {\r\n try {\r\n File save = new File(pathName);\r\n FileOutputStream fileOutputStream = new FileOutputStream(save);\r\n ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);\r\n objectOutputStream.writeObject(logs);\r\n // System.out.println(\"write successful for\"+pathName);\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void write(JSONDocument doc,File fl){\n try(FileWriter fw = new FileWriter(fl)){\n fw.write(doc.toString());\n fw.flush();\n }catch(Exception ex){\n ex.printStackTrace();\n }\n }", "private void saveToDir(String name, Object obj) {\n\t\tFileOutputStream fileOut = null;\n\t\ttry {\n\t\t\tfileOut = new FileOutputStream(this.dir + \"/\" + name);\n\t\t\tObjectOutputStream out = new ObjectOutputStream(fileOut);\n\t\t\tout.writeObject(obj);\n\t\t\tout.close();\n\t\t\tfileOut.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error occurred while saving the index file: \" + name);\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "void toJSON(Path path);", "public boolean save(Object o) {\n if (o instanceof String) {\n\n JsonParser parser = new JsonParser();\n\n JsonElement jsonElement = null;\n String jsonString = (String) o;\n\n try{\n while(!jsonString.startsWith(\"{\")){\n jsonString = jsonString.substring(1, jsonString.length()-2);\n }\n\n jsonElement = parser.parse(jsonString);\n dbClient.save(jsonElement.getAsJsonObject());\n return true;\n\n }catch(Exception e){\n e.printStackTrace();\n return false;\n }\n\n }\n\n return false;\n }", "public void serializeObject(String fileName, Automobile automobile) {\n try {\n String path = System.getProperty(\"user.dir\");\n String fileNameWithPath = path + File.separator + fileName;\n if(DEBUG) {\n System.out.printf(\" File Name with Path : %s\", fileNameWithPath);\n }\n FileOutputStream fileOut = new FileOutputStream(fileNameWithPath);\n ObjectOutputStream out = new ObjectOutputStream(fileOut);\n out.writeObject(automobile);\n out.close();\n fileOut.close();\n System.out.printf(\"Serialized data is saved in automotive.ser %s%n\", fileName);\n } catch (IOException i) {\n i.printStackTrace();\n }\n }", "public static void save(Serializable data, String fileName) throws Exception {\r\n\t\ttry(ObjectOutputStream out = new ObjectOutputStream( Files.newOutputStream(Paths.get(fileName)) )) {\r\n\t\t\tout.writeObject(data);\r\n\t\t}\r\n\t}", "public void crearPrimerFichero(){\n File f=new File(getApplicationContext().getFilesDir(),\"datos.json\");\n // si no existe lo creo\n if(!f.exists()) {\n String filename = \"datos.json\";\n String fileContents = \"[]\";\n FileOutputStream outputStream;\n\n try {\n outputStream = openFileOutput(filename, Context.MODE_PRIVATE);\n outputStream.write(fileContents.getBytes());\n outputStream.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n }", "public void saveGame(String fileName){\n try {\n File file1 = new File(fileName);\n FileOutputStream fileOutputStream = new FileOutputStream(file1);\n ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);\n objectOutputStream.writeObject(this);\n }catch (Exception e){\n System.err.println(\"Error when saving file\");\n }\n }" ]
[ "0.7685922", "0.7182024", "0.7159729", "0.7137173", "0.7057812", "0.70540637", "0.7053874", "0.7003681", "0.6954736", "0.6898823", "0.6881606", "0.6876142", "0.6826735", "0.6755188", "0.67119867", "0.6710243", "0.66534215", "0.66483724", "0.6613342", "0.6548435", "0.65134025", "0.65053004", "0.6435646", "0.6428433", "0.64227045", "0.640159", "0.64012986", "0.6393006", "0.638613", "0.6371547", "0.63695705", "0.636046", "0.63603544", "0.6346562", "0.63159305", "0.62941784", "0.6283597", "0.62831455", "0.6278853", "0.6270947", "0.625138", "0.6244548", "0.6243257", "0.62135744", "0.61912733", "0.61713266", "0.61698884", "0.61684686", "0.61576027", "0.6152752", "0.6103259", "0.6099513", "0.6088831", "0.6067302", "0.6062078", "0.60598576", "0.60543954", "0.60519904", "0.60390824", "0.60383993", "0.6034346", "0.6012126", "0.6011708", "0.60072654", "0.59989035", "0.59986806", "0.59970623", "0.59934556", "0.59718555", "0.59684795", "0.5959771", "0.5956077", "0.5955544", "0.5951574", "0.59496313", "0.59426713", "0.5922695", "0.59179956", "0.5913995", "0.591144", "0.5902395", "0.59003776", "0.5897416", "0.5889253", "0.5889145", "0.588301", "0.58726054", "0.5837218", "0.5834598", "0.5833659", "0.58324337", "0.5832432", "0.58291715", "0.58149", "0.58120763", "0.5808438", "0.57989734", "0.5784852", "0.57792753", "0.5777469" ]
0.86886233
0
No need for cleanup in a HashedIndex.
public void cleanup() { this.index = new TreeMap<String, PostingsList>(); this.count = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@AfterClass\n\tpublic static void cleanIndex() {\n\t\tEntityTest et = new EntityTest(id, \"EntityTest\");\n\t\tRedisQuery.remove(et, id);\n\t}", "void indexReset();", "public void clear() {\n index.clear();\n }", "private Reindex() {}", "private Reindex() {}", "void clearAllIndexes();", "public H_index() {\n\t\tsuper();\n\t}", "@Override\n\tpublic void clearIndex(String indexName) {\n\t\t\n\t}", "public void onIndexReset();", "@Override\n public void close()\n {\n notifyLegacyIndexOperationQueue();\n\n }", "@Override\n\tpublic void unIndexObject(ModelKey obj) throws ASException {\n\t\t\n\t}", "public void truncate() {\n\t\ttry {\n\t\t\t_reopenToken = _trackingIndexWriter.deleteAll();\n\t\t\tlog.warn(\"lucene index truncated\");\n\t\t} catch(IOException ioEx) {\n\t\t\tlog.error(\"Error truncating lucene index: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t \t\t \t ioEx);\t\t\t\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\t_indexWriter.commit(); \n\t\t\t} catch (IOException ioEx) {\n\t\t\t\tlog.error(\"Error truncating lucene index: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t ioEx);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void unIndexObject(String indexName, String key) throws ASException {\n\t\t\n\t}", "@Test\n public void testIndexMaintenanceWithIndexOnMethodEntrySet() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"entries.value.getID\",\n SEPARATOR + \"portfolio.entrySet() entries\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForEntries(ri);\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodKeys() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"ks.toString\",\n SEPARATOR + \"portfolio.keys() ks\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForKeys(ri);\n }", "private void cleanUp() {\n if (rehash()) {\n // If we rehashed, we needn't clean up (clean up happens as\n // a side effect).\n return;\n }\n\n if (size == 0) {\n // No live entries == nothing to clean.\n return;\n }\n\n // Clean log(table.length) entries picking up where we left off\n // last time.\n int index = clean;\n Object[] table = this.table;\n for (int counter = table.length; counter > 0; counter >>= 1,\n index = next(index)) {\n Object k = table[index];\n\n if (k == TOMBSTONE || k == null) {\n continue; // on to next entry\n }\n\n // The table can only contain null, tombstones and references.\n @SuppressWarnings(\"unchecked\")\n Reference<ThreadLocal<?>> reference\n = (Reference<ThreadLocal<?>>) k;\n if (reference.get() == null) {\n // This thread local was reclaimed by the garbage collector.\n table[index] = TOMBSTONE;\n table[index + 1] = null;\n tombstones++;\n size--;\n }\n }\n\n // Point cursor to next index.\n clean = index;\n }", "private void ensureHashingIndexExists() {\n DB metadataDB = client.getDB(\"cacheManagerMetadata\");\n if (!metadataDB.collectionExists(\"hashingIndex\")) {\n DBCollection hashingIndex = metadataDB.getCollection(\"hashingIndex\");\n hashingIndex.createIndex(new BasicDBObject(\"hashValue\", 1),\n new BasicDBObject(\"unique\", 1));\n }\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodKeySet() throws Exception {\n Index i1 =\n qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"ks.toString\",\n SEPARATOR + \"portfolio.keySet() ks\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForKeys(ri);\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodGetEntries() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"entries.value.getID\",\n SEPARATOR + \"portfolio.getEntries() entries\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForEntries(ri);\n }", "@Override\n\tpublic void clearIndex(Class<? extends ModelKey> clazz) {\n\t\t\n\t}", "public void close() throws IndexerException {\n\t\t//TODO\n\t\t\n\t}", "public abstract void deselectAllIndexes();", "@Override\n public void beforeRerunningIndexCreationQuery() {\n Thread th = new Thread(() -> {\n // Assert that the size of region is now 0\n assertTrue(region.size() == 0);\n region.put(\"\" + 8, new Portfolio(8));\n });\n th.start();\n ThreadUtils.join(th, 30 * 1000);\n assertTrue(region.size() == 1);\n }", "@Test\n public void testIndexMaintenanceWithHeterogenousObjects() throws Exception {\n DefaultQueryService.TEST_QUERY_HETEROGENEOUS_OBJECTS = true;\n IndexManager.TEST_RANGEINDEX_ONLY = true;\n Cache cache = CacheUtils.getCache();\n qs = cache.getQueryService();\n region = CacheUtils.createRegion(\"portfolio1\", null);\n idSet.clear();\n Portfolio p = new Portfolio(4);\n region.put(\"4\", p);\n idSet.add(\"\" + p.getID());\n p = new Portfolio(5);\n region.put(\"5\", p);\n idSet.add(\"\" + p.getID());\n region.put(\"6\", 6);\n Index i1 =\n qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID()\", SEPARATOR + \"portfolio1 pf\");\n RangeIndex ri = (RangeIndex) i1;\n assertEquals(2, ri.valueToEntriesMap.size());\n Iterator itr = ri.valueToEntriesMap.values().iterator();\n while (itr.hasNext()) {\n RangeIndex.RegionEntryToValuesMap re2ValMap = (RangeIndex.RegionEntryToValuesMap) itr.next();\n assertEquals(1, re2ValMap.map.size());\n Object obj = re2ValMap.map.values().iterator().next();\n assertFalse(obj instanceof Collection);\n assertTrue(obj instanceof Portfolio);\n Portfolio pf = (Portfolio) obj;\n assertTrue(idSet.contains(String.valueOf(pf.getID())));\n }\n assertEquals(1, ri.undefinedMappedEntries.map.size());\n Map.Entry entry = (Map.Entry) ri.undefinedMappedEntries.map.entrySet().iterator().next();\n assertFalse(entry.getValue() instanceof Collection);\n assertTrue(entry.getValue() instanceof Integer);\n assertTrue(entry.getValue().equals(6));\n\n region.put(\"7\", 7);\n idSet.add(7);\n assertEquals(2, ri.undefinedMappedEntries.map.size());\n itr = ri.undefinedMappedEntries.map.entrySet().iterator();\n while (itr.hasNext()) {\n entry = (Map.Entry) itr.next();\n assertFalse(entry.getValue() instanceof Collection);\n assertTrue(entry.getValue() instanceof Integer);\n idSet.contains(entry.getValue());\n }\n\n region.remove(\"7\");\n idSet.remove(7);\n Index i2 =\n qs.createIndex(\"indx2\", IndexType.FUNCTIONAL, \"pf.pkid\", SEPARATOR + \"portfolio1 pf\");\n ri = (RangeIndex) i2;\n assertEquals(2, ri.valueToEntriesMap.size());\n itr = ri.valueToEntriesMap.values().iterator();\n while (itr.hasNext()) {\n RangeIndex.RegionEntryToValuesMap re2ValMap = (RangeIndex.RegionEntryToValuesMap) itr.next();\n assertEquals(1, re2ValMap.map.size());\n Object obj = re2ValMap.map.values().iterator().next();\n assertFalse(obj instanceof Collection);\n assertTrue(obj instanceof Portfolio);\n Portfolio pf = (Portfolio) obj;\n assertTrue(idSet.contains(String.valueOf(pf.getID())));\n }\n assertEquals(1, ri.undefinedMappedEntries.map.size());\n entry = (Map.Entry) ri.undefinedMappedEntries.map.entrySet().iterator().next();\n assertFalse(entry.getValue() instanceof Collection);\n assertTrue(entry.getValue() instanceof Integer);\n assertTrue(entry.getValue().equals(6));\n\n region.put(\"7\", 7);\n idSet.add(7);\n assertEquals(2, ri.undefinedMappedEntries.map.size());\n itr = ri.undefinedMappedEntries.map.entrySet().iterator();\n while (itr.hasNext()) {\n entry = (Map.Entry) itr.next();\n assertFalse(entry.getValue() instanceof Collection);\n assertTrue(entry.getValue() instanceof Integer);\n idSet.contains(entry.getValue());\n }\n }", "@Override\n @Secured(SecurityRoles.ADMINISTRATOR)\n public void reindex() {\n revisionDao.deleteAll();\n // OK, launches a new indexation\n indexFromLatest();\n }", "@Test\n @Ignore\n public void testDelete_Index() throws Exception {\n System.out.println(\"delete\");\n Index entity = TestUtils.getTestIndex();\n Identifier identifier = entity.getId();\n instance.create(entity);\n assertTrue(instance.exists(identifier));\n instance.delete(entity);\n assertFalse(instance.exists(identifier));\n }", "public void flush() {\n synchronized (getLock()) {\n sIndexWritersCache.flush(this);\n sIndexReadersCache.removeIndexReader(this);\n }\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodGetKeys() throws Exception {\n Index i1 =\n qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"ks.toString\",\n SEPARATOR + \"portfolio.getKeys() ks\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForKeys(ri);\n }", "public void testCreIdx(){\r\n\t \r\n\t String dataDir = \"C:\\\\study\\\\Lucene\\\\Data\";\r\n\t String idxDir = \"C:\\\\study\\\\Lucene\\\\Index\";\r\n\t \r\n\t LuceneUtils.delAll(idxDir);\r\n\t \r\n\t CreateIndex ci = new CreateIndex();\r\n\t \r\n\t ci.Indexer(new File(idxDir), new File(dataDir));\r\n\t \r\n\t\t\r\n\t}", "public ThreadSafeInvertedIndex() {\n\t\tsuper();\n\t\tthis.lock = new ReadWriteLock();\n\t}", "@Test\n public void testCoh3733()\n {\n doSingleServerTest(\"IdxTestCoh3733\", new Runnable()\n {\n public void run()\n {\n NamedCache cache = getNamedCache(\"coh3733\");\n\n cache.addIndex(new IndexAwareExtractor()\n {\n public MapIndex createIndex(boolean fOrdered, Comparator comparator, Map mapIndex,\n BackingMapContext ctx)\n {\n MapIndex index = new SimpleMapIndex(this, false, null, ctx)\n {\n protected void removeInverseMapping(Map mapIndex, Object oIxValue, Object oKey)\n {\n Set setKeys = (Set) mapIndex.get(oIxValue);\n\n assertTrue(\"Attempted to remove non-existent index entry\",\n setKeys != null && setKeys.contains(oKey));\n super.removeInverseMapping(mapIndex, oIxValue, oKey);\n }\n };\n mapIndex.put(this, index);\n return index;\n }\n\n public MapIndex destroyIndex(Map mapIndex)\n {\n return (MapIndex) mapIndex.remove(this);\n }\n\n public Object extract(Object oTarget)\n {\n return oTarget;\n }\n }, false, null);\n cache.addMapListener(new MultiplexingMapListener()\n {\n protected void onMapEvent(MapEvent evt)\n {\n fail(\"Observed unexpected event: \" + evt);\n }\n });\n\n cache.remove(\"non-existent-key\");\n\n validateIndex(cache);\n }\n });\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodtoArray() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID\",\n SEPARATOR + \"portfolio.toArray() pf\");\n assertTrue(i1 instanceof CompactRangeIndex);\n Cache cache = CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForValues(ri);\n }", "void initiateRemoveIndexes(HarvestResultDTO harvestResult) throws DigitalAssetStoreException;", "private void close() throws CorruptIndexException, IOException {\n\n\t\tidxWriter.forceMerge(1);\n\t\tidxWriter.commit();\n\t\tidxWriter.close();\n\t}", "private void removeContentAfterIndexLink()\r\n \t{\r\n \t\tdeleteNodes(XPath.AFTER_INDEX_LINK.query);\r\n \t}", "@Test\n public void testIndexMaintenanceWithIndexOnMethodValues() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID\",\n SEPARATOR + \"portfolio.values() pf\");\n assertTrue(i1 instanceof CompactRangeIndex);\n Cache cache = CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForValues(ri);\n }", "public void clear()\n\t\t{\n\t\t\tindices.clear();\n\t\t}", "public void tIndex(IndexShort < O > index) throws Exception {\n File query = new File(testProperties.getProperty(\"test.query.input\"));\n File dbFolder = new File(testProperties.getProperty(\"test.db.path\"));\n\n int cx = 0;\n\n initIndex(index);\n //search(index, (short) 3, (byte) 3);\n //search(index, (short) 7, (byte) 1);\n //search(index, (short) 12, (byte) 3);\n \n search(index, (short) 1000, (byte) 1);\n\n search(index, (short) 1000, (byte) 3);\n\n search(index, (short) 1000, (byte) 10);\n \n search(index, (short) 1000, (byte) 50);\n \n long i = 0;\n // int realIndex = 0;\n // test special methods that only apply to\n // SynchronizableIndex\n \n\n // now we delete elements from the DB\n logger.info(\"Testing deletes\");\n i = 0;\n long max = index.databaseSize();\n while (i < max) {\n O x = index.getObject(i);\n OperationStatus ex = index.exists(x);\n assertTrue(ex.getStatus() == Status.EXISTS);\n assertTrue(ex.getId() == i);\n ex = index.delete(x);\n assertTrue(\"Status is: \" + ex.getStatus() + \" i: \" + i , ex.getStatus() == Status.OK);\n assertEquals(i, ex.getId());\n ex = index.exists(x); \n assertTrue( \"Exists after delete\" + ex.getStatus() + \" i \" + i, ex.getStatus() == Status.NOT_EXISTS);\n i++;\n }\n index.close();\n Directory.deleteDirectory(dbFolder);\n }", "public void updateIndex() {\n int i = this.index;\n if (i == -1 || i > HashBiMap.this.size || !Objects.equal(HashBiMap.this.keys[this.index], this.key)) {\n this.index = HashBiMap.this.findEntryByKey(this.key);\n }\n }", "public void clear() throws IOException {\n\t\tindexWriter.deleteAll();\n\t\tforceCommit();\n\t}", "public void onIndexUpdate();", "public void testIndexCosts() {\n this.classHandler.applyIndexes();\n }", "LuceneMemoryIndex createLuceneMemoryIndex();", "void stopIndexing();", "public long index() {\n return manager.compactIndex();\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodAsSet() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID\",\n SEPARATOR + \"portfolio.asSet() pf\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForValues(ri);\n }", "public void afterIndexCreated(IndexService indexService) {\n\n }", "@Override\r\n\tpublic void delete(int r_idx) throws Exception {\n\r\n\t}", "public void deleteIndex() throws Exception {\n\n\t\tRetryingRunnable runnable = new RetryingRunnable() \n\t\t{\t\n\t\t\tpublic void run() throws Exception \n\t\t\t{\n\t\t\t\tIndexWriter w = createIndexWriter(true); // open for writing and close (make empty)\n\t\t\t\tw.deleteAll();\n\t\t\t\tw.commit();\n\t\t\t\tw.close(true);\n\t\t\t\t\n\t\t\t\tDirectory dir = getIndexDir();\n\t\t\t\tfor(String file: dir.listAll())\n\t\t\t\t{\n\t\t\t\t\tif( dir.fileExists(file) ) // still exits\n\t\t\t\t\t{\n\t\t\t\t\t\tdir.sync(file);\n\t\t\t\t\t\tdir.deleteFile(file);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdir.close();\n\t\t\t}\n\t\t\t\n\t\t\tpublic boolean handleException(Throwable e) \n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\t\t\n\t\tchangeListener.onIndexReset(); // close searcher because index is deleted\n\t\t\n\t\trunRetryingRunnable(runnable); // delete index with retry\n\t}", "private void syncIndex(FundamentalData fd) throws Exception {\n\n List<MarketIndex> indexes = marketIndexService.findBySymbol(fd.getSymbol());\n if(indexes.size()>1){\n throw new Exception(\"Multiple instances (\"+indexes.size()+\") of symbol \"+fd.getSymbol()+\" present in the database.\");\n }\n\n MarketIndex index;\n if(indexes.size()==0){ // does not exist in db\n index=new MarketIndex();\n index.setSymbol(fd.getSymbol());\n index.setName(fd.getName());\n index.setCategory(fd.getType().getCode());\n\n }else{ // index exists in db\n index = indexes.get(0);\n if(fd.getName()!=null){\n index.setName(fd.getName());\n }\n if(fd.getType()!=null){\n index.setCategory(fd.getType().getCode());\n }\n\n }\n\n updateIcon(index);\n marketIndexService.update(index);\n\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodGetValues() throws Exception {\n Index i1 =\n qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID\",\n SEPARATOR + \"portfolio.getValues() pf\");\n assertTrue(i1 instanceof CompactRangeIndex);\n Cache cache = CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForValues(ri);\n }", "@Test\n public void testIndexMaintenanceOnCacheLoadedData() throws Exception {\n IndexManager.TEST_RANGEINDEX_ONLY = true;\n Cache cache = CacheUtils.getCache();\n qs = cache.getQueryService();\n region = CacheUtils.createRegion(\"portfolio1\", null);\n AttributesMutator am = region.getAttributesMutator();\n am.setCacheLoader(new CacheLoader() {\n\n @Override\n public Object load(LoaderHelper helper) throws CacheLoaderException {\n String key = (String) helper.getKey();\n Portfolio p = new Portfolio(Integer.parseInt(key));\n return p;\n }\n\n @Override\n public void close() {\n // nothing\n }\n });\n\n Index i1 =\n qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID()\", SEPARATOR + \"portfolio1 pf\");\n List keys = new ArrayList();\n keys.add(\"1\");\n keys.add(\"2\");\n keys.add(\"3\");\n keys.add(\"4\");\n\n region.getAll(keys);\n }", "private void flushCurrentIndexBlock() throws IOException {\n if (currentMemoryIndex.documentsInIndex() < 1) {\n return;\n }\n\n logger.info(\"Flushing current memory Index. id = \" + indexBlockCount);\n\n final MemoryIndex flushingMemoryIndex = currentMemoryIndex;\n final File shardFolder = getNextIndexShardFolder(1);\n\n try {\n // reset the current index\n // - this makes the flush operation thread safe while continuing to add new documents.\n resetCurrentMemoryIndex();\n } catch (Exception ex) {\n throw new IOException(ex);\n }\n\n try {\n // first flush the index to disk\n FlushToDisk.flushMemoryIndex(flushingMemoryIndex, shardFolder.getAbsolutePath(), false);\n\n // indicate that the flushing part of this thread is done\n synchronized (geometricParts) {\n // add flushed index to the set of bins -- needs to be a synconeous action\n geometricParts.add(0, shardFolder.getAbsolutePath());\n updateIndex();\n flushingMemoryIndex.close();\n }\n\n } catch (IOException e) {\n logger.severe(e.toString());\n }\n }", "@Override\n protected void cleanup(Context context) throws IOException, InterruptedException {\n logger.info(\"Cleanup\");\n super.cleanup(context);\n for (java.util.Map.Entry<String, FullImageMetadata> entry : indexer.getEntries().entrySet()) {\n String surt = entry.getKey();\n context.write(new Text(surt), entry.getValue());\n }\n }", "public void close() {\n\t\t\n\t\ttry {\n\t\t\tindexWriter.optimize();\n\t\t\t\n\t\t\tindexWriter.close();\n\t\t\t\n\t\t\tIndexSearcher = new IndexSearcher(idx);\n\t\t\t\n\t\t} catch (CorruptIndexException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t}", "@Test\n public void testIndexMaintenanceOnPutAll() throws Exception {\n IndexManager.TEST_RANGEINDEX_ONLY = true;\n Cache cache = CacheUtils.getCache();\n qs = cache.getQueryService();\n region = CacheUtils.createRegion(\"portfolio1\", null);\n region.put(\"1\", new Portfolio(1));\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"posvals.secId\",\n SEPARATOR + \"portfolio1 pf, pf.positions.values posvals \");\n Map data = new HashMap();\n for (int i = 1; i < 11; ++i) {\n data.put(\"\" + i, new Portfolio(i + 2));\n }\n\n region.putAll(data);\n }", "public void clear(long index);", "public Object migrateWords2index(String wordhash) throws IOException {\n File db = plasmaWordIndexFile.wordHash2path(oldDatabaseRoot, wordhash);\r\n if (!(db.exists())) return \"not available\";\r\n plasmaWordIndexFile entity = null;\r\n try {\r\n entity = new plasmaWordIndexFile(oldDatabaseRoot, wordhash, true);\r\n int size = entity.size();\r\n indexContainer container = new indexContainer(wordhash, payloadrow(), useCollectionIndex);\r\n \r\n try {\r\n Iterator entries = entity.elements(true);\r\n indexRWIEntry entry;\r\n while (entries.hasNext()) {\r\n entry = (indexRWIEntry) entries.next();\r\n // System.out.println(\"ENTRY = \" + entry.getUrlHash());\r\n container.add(new indexRWIEntry[] { entry }, System.currentTimeMillis());\r\n }\r\n // we have read all elements, now delete the entity\r\n entity.deleteComplete();\r\n entity.close();\r\n entity = null;\r\n \r\n indexContainer feedback = collections.addEntries(container, container.updated(), false);\r\n if (feedback != null) return feedback;\r\n return new Integer(size);\r\n } catch (kelondroException e) {\r\n // database corrupted, we simply give up the database and delete it\r\n try { entity.close(); } catch (Exception ee) { }\r\n entity = null;\r\n try { db.delete(); } catch (Exception ee) { }\r\n return \"database corrupted; deleted\";\r\n }\r\n } finally {\r\n if (entity != null) try {entity.close();}catch(Exception e){}\r\n }\r\n }", "public abstract void updateIndex();", "public void close() throws IndexException {\n }", "public void refresh() {\n getIndexOperations().refresh();\n }", "public interface FieldIndex<T> extends GenericIndex<T> \r\n{ \r\n /**\r\n * Put new object in the index. \r\n * @param obj object to be inserted in index. Object should contain indexed field. \r\n * Object can be not yet peristent, in this case\r\n * its forced to become persistent by assigning OID to it.\r\n * @return <code>true</code> if object is successfully inserted in the index, \r\n * <code>false</code> if index was declared as unique and there is already object with such value\r\n * of the key in the index. \r\n */\r\n public boolean put(T obj);\r\n\r\n /**\r\n * Associate new object with the key specified by object field value. \r\n * If there is already object with such key in the index, \r\n * then it will be removed from the index and new value associated with this key.\r\n * @param obj object to be inserted in index. Object should contain indexed field. \r\n * Object can be not yet peristent, in this case\r\n * its forced to become persistent by assigning OID to it.\r\n * @return object previously associated with this key, <code>null</code> if there was no such object\r\n */\r\n public T set(T obj);\r\n\r\n /**\r\n * Assign to the integer indexed field unique autoicremented value and \r\n * insert object in the index. \r\n * @param obj object to be inserted in index. Object should contain indexed field\r\n * of integer (<code>int</code> or <code>long</code>) type.\r\n * This field is assigned unique value (which will not be reused while \r\n * this index exists) and object is marked as modified.\r\n * Object can be not yet peristent, in this case\r\n * its forced to become persistent by assigning OID to it.\r\n * @exception StorageError(StorageError.INCOMPATIBLE_KEY_TYPE) when indexed field\r\n * has type other than <code>int</code> or <code>long</code>\r\n */\r\n public void append(T obj);\r\n\r\n /**\r\n * Remove object with specified key from the unique index\r\n * @param key value of removed key\r\n * @return removed object\r\n * @exception StorageError(StorageError.KEY_NOT_FOUND) exception if there is no such key in the index,\r\n * or StorageError(StorageError.KEY_NOT_UNIQUE) if index is not unique.\r\n */\r\n public T remove(Key key);\r\n\r\n /**\r\n * Remove object with specified key from the unique index\r\n * @param key value of removed key\r\n * @return removed object\r\n * @exception StorageError(StorageError.KEY_NOT_FOUND) exception if there is no such key in the index,\r\n * or StorageError(StorageError.KEY_NOT_UNIQUE) if index is not unique.\r\n */\r\n public T removeKey(Object key);\r\n\r\n /**\r\n * Check if index contains specified object instance.\r\n * @param obj object to be searched in the index. Object should contain indexed field. \r\n * @return <code>true</code> if object is present in the index, <code>false</code> otherwise\r\n */\r\n public boolean containsObject(T obj);\r\n\r\n /**\r\n * Locate objects with the same value of the key as specified object\r\n * @param obj object specifying search key value\r\n * @return selection iterator\r\n */\r\n public IterableIterator<T> queryByExample(T obj);\r\n\r\n /**\r\n * Get class obejct objects which can be inserted in this index\r\n * @return class specified in Storage.createFielIndex method\r\n */\r\n public Class getIndexedClass();\r\n\r\n /**\r\n * Get fields used as a key\r\n * @return array of index key fields\r\n */\r\n public Field[] getKeyFields();\r\n\r\n /**\r\n * Select members of the collection using search predicate\r\n * This iterator doesn't support remove() method.\r\n * To make it possible to update, remove or add members to the index \r\n * during iteration it is necessary to set \"perst.concurrent.iterator\"\r\n * property (by default it is not supported because it cause extra overhead during iteration)\r\n * @param predicate JSQL condition\r\n * @return iterator through members of the collection matching search condition\r\n */\r\n public IterableIterator<T> select(String predicate);\r\n\r\n /**\r\n * Check if field index is case insensitive\r\n * @return true if index ignore case of string keys\r\n */\r\n boolean isCaseInsensitive(); \r\n}", "public void finishedDirectIndexBuild()\n\t{\n\t\tif(logger.isInfoEnabled()){\n\t\t\tlogger.info(\"flushing utf block lexicon to disk after the direct index completed\");\n\t\t}\n\t\t//only write a temporary lexicon if there are any items in it\n\t\tif (TempLex.getNumberOfNodes() > 0)\n\t\t\twriteTemporaryLexicon();\n\n\t\t//merges the temporary lexicons\n\t\tif (tempLexFiles.size() > 0)\n\t\t{\n\t\t\ttry{\n\t\t\t\tmerge(tempLexFiles);\n\t\n\t\t\t\t//creates the offsets file\n\t\t\t\tfinal String lexiconFilename = \n\t\t\t\t\tindexPath + ApplicationSetup.FILE_SEPARATOR + \n\t\t\t\t\tindexPrefix + ApplicationSetup.LEXICONSUFFIX;\n\t\t\t\tLexiconInputStream lis = getLexInputStream(lexiconFilename);\n\t\t\t\tcreateLexiconIndex(\n\t\t\t\t\tlis,\n\t\t\t\t\tlis.numberOfEntries(),\n\t\t\t\t\t/* after inverted index is built, the lexicon will be transformed into a\n\t\t\t\t\t * normal lexicon, without block frequency */\n\t\t\t\t\tUTFLexicon.lexiconEntryLength\n\t\t\t\t\t); \n\t\t\t\tTermCount = lis.numberOfEntries();\n\t\t\t\tif (index != null)\n\t\t\t\t{\n\t\t\t\t\tindex.addIndexStructure(\"lexicon\", \"uk.ac.gla.terrier.structures.UTFBlockLexicon\");\n\t\t\t\t\tindex.addIndexStructureInputStream(\"lexicon\", \"uk.ac.gla.terrier.structures.UTFBlockLexiconInputStream\");\n\t\t\t\t\tindex.setIndexProperty(\"num.Terms\", \"\"+lis.numberOfEntries());\n\t\t\t\t\tindex.setIndexProperty(\"num.Pointers\", \"\"+lis.getNumberOfPointersRead());\n\t\t\t\t}\n\t\t\t} catch(IOException ioe){\n\t\t\t\tlogger.error(\"Indexing failed to write a lexicon index file to disk\", ioe);\n\t\t\t}\t\n\t\t}\n\t\telse\n\t\t\tlogger.warn(\"No temporary lexicons to merge, skipping\");\n\t\t\n\t}", "private IndexingManager() {\n Provider provider = new BouncyCastleProvider();\n Security.addProvider(provider);\n utility = Database_Utility.getInstance();\n conn = utility.getConnection();\n IMbuffer = IndexingManagerBuffer.getInstance();\n\n // This statement is to create purge table.\n\n boolean k = checkTable1(\"PurgeTable\");\n if (!k) {\n utility.createtable2(\"PurgeTable\");\n }\n boolean k1 = checkTable1(\"UserToCertMap\");\n if (!k1) {\n utility.createtable1();\n }\n\n // This statement is to run maintenance thread on loading of class to purge entries whose timer has expired.\n\n //maintenancethread();\n\n // This statement is to run maintenance thread on loading of class to ascertain root nodes.\n\n // maintenancethread1();\n\n // This statement is to run maintenance thread on loading of class to delete entries from purge table.\n\n // maintenancethread2();\n\n }", "protected void removeFromIndex(SimpleFeature feature) {\n\t\tif (feature==null) return;\n\t\t\n\t\t// ID Index\n\t\tidIndex.remove( feature.getID() );\n\t\t\n\t\t// Type name index\n\t\tName type = feature.getType().getName();\n\t\tSet<SimpleFeature> prev = typeNameIndex.get(type);\n\t\tif ( prev.remove( feature ) ) {\n\t\t\tif (prev.size()>0) {\n\t\t\t\ttypeNameIndex.put(type,prev);\n\t\t\t} else {\n\t\t\t\ttypeNameIndex.remove(type);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Tile Index\n\t\tif (feature.getID().matches(\".*-[0-9]+-[0-9]+-[0-9]+\")) {\n\t\t\tOSMTile tile = new OSMTile(feature.getID());\n\t\t\tprev = tileIndex.get( tile );\n\t\t\tif ( prev.remove( feature ) ) {\n\t\t\t\tif (prev.size()>0) {\n\t\t\t\t\ttileIndex.put(tile, prev);\n\t\t\t\t} else {\n\t\t\t\t\ttileIndex.remove(type);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Whatever for features\n\t\t}\n\t}", "public void beforeIndexClosed(IndexService indexService) {\n\n }", "@Test\n public void testIndexMaintenanceWithIndexOnMethodAsList() throws Exception {\n Index i1 = qs.createIndex(\"indx1\", IndexType.FUNCTIONAL, \"pf.getID\",\n SEPARATOR + \"portfolio.asList() pf\");\n CacheUtils.getCache();\n region = CacheUtils.getRegion(SEPARATOR + \"portfolio\");\n region.put(\"4\", new Portfolio(4));\n region.put(\"5\", new Portfolio(5));\n CompactRangeIndex ri = (CompactRangeIndex) i1;\n validateIndexForValues(ri);\n }", "private void readIndex() throws IOException {\n\t\t\tif (this.keys != null)\n\t\t\t\treturn;\n\t\t\tkeys = new HashMap<K, Long>(1024);\n\t\t\ttry {\n\t\t\t\twhile (index.hasNext()) {\n\t\t\t\t\tPair<K, Long> pair;// = new Pair<K, Long>(index.getSchema());\n\t\t\t\t\tpair = index.next();\n\t\t\t\t\tkeys.put(pair.key(), pair.value());\n\t\t\t\t\tif (firstKey == null)\n\t\t\t\t\t\tfirstKey = pair.key();\n\t\t\t\t\tfinalKey = pair.key();\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\n\t\t\t}finally {\n\t\t\t\tindexClosed = true;\n\t\t\t\tindex.close();\n\t\t\t}\n\t\t}", "@Override\n public void reindexImpl()\n {\n List<StoreRef> storeRefs = nodeService.getStores();\n int count = 0;\n for (StoreRef storeRef : storeRefs)\n {\n // prompt the FTS reindexing\n if (!ftsIndexerCalled)\n {\n ftsIndexer.requiresIndex(storeRef);\n }\n // reindex missing content\n count += reindexMissingContent(storeRef);\n // check if we have to break out\n if (isShuttingDown())\n {\n break;\n }\n }\n \n // The FTS indexer only needs to be prompted once\n ftsIndexerCalled = true;\n\n // done\n if (logger.isDebugEnabled())\n {\n logger.debug(\"Missing content indexing touched \" + count + \" content nodes\");\n }\n }", "@Override\n public void close() throws IOException {\n flushCurrentIndexBlock();\n\n // logger.info(\"Performing final merge\");\n // try {\n //Bin finalMergeBin = geometricParts.getAllShards();\n //doMerge(finalMergeBin, getNextIndexShardFolder(finalMergeBin.size + 1));\n // check point is updated by the merge op.\n\n // } catch (IOException ex) {\n // Logger.getLogger(GeometricRetrieval.class.getName()).log(Level.SEVERE, null, ex);\n //}\n\n }", "public interface IndexBuilder {\n\n /**\n * Rebuilds the index only when the existing index is not populated.\n */\n void rebuildIfNecessary();\n\n}", "@Override\n protected boolean preserveIndicesUponCompletion() {\n return true;\n }", "private static void deleteTest() throws SailException{\n\n\t\tString dir2 = \"repo-temp\";\n\t\tSail sail2 = new NativeStore(new File(dir2));\n\t\tsail2 = new IndexingSail(sail2, IndexManager.getInstance());\n\t\t\n//\t\tsail.initialize();\n\t\tsail2.initialize();\n\t\t\n//\t\tValueFactory factory = sail2.getValueFactory();\n//\t\tCloseableIteration<? extends Statement, SailException> statements = sail2\n//\t\t\t\t.getConnection().getStatements(null, null, null, false);\n\n\t\tSailConnection connection = sail2.getConnection();\n\n\t\tint cachesize = 1000;\n\t\tint cached = 0;\n\t\tlong count = 0;\n\t\tconnection.removeStatements(null, null, null, null);\n//\t\tconnection.commit();\n\t}", "public Object preparePut(Object object)\r\n {\n FullUniqueIndex perThreadAddedIndex = new FullUniqueIndex(this.hashStrategy);\r\n perThreadAddedIndex.setUnderlyingObjectGetter(transactionalUnderlyingObjectGetter);\r\n perThreadAddedIndex.putUsingUnderlying(object, ((MithraTransactionalObject) object).zGetNonTxData());\r\n synchronized (this.preparedIndices)\r\n {\r\n this.preparedIndices.add(perThreadAddedIndex);\r\n }\r\n return perThreadAddedIndex;\r\n }", "public void destroy() {\n //Write hit count to DB!!\n }", "private void resetCurrentMemoryIndex() throws Exception {\n // by using the globalParameters, the memory index can startup counters etc.\n // we set the documentCount to ensure all documents are given a unique number.\n tupleFlowParameters.getJSON().set(\"documentNumberOffset\", this.globalDocumentCount);\n currentMemoryIndex = new MemoryIndex(tupleFlowParameters);\n }", "@Test\n public void testIndexCreationThreshold() throws Exception {\n SchemaModel sm;\n //\n // sm = Util.loadSchemaModel2(\"resources/performance2/B.xsd\"); // NOI18N\n sm = Util.loadSchemaModel2(\"resources/performance2.zip\", \"B.xsd\"); // NOI18N\n //\n assertTrue(sm.getState() == State.VALID);\n //\n assertTrue(sm instanceof SchemaModelImpl);\n SchemaModelImpl smImpl = SchemaModelImpl.class.cast(sm);\n GlobalComponentsIndexSupport indexSupport = smImpl.getGlobalComponentsIndexSupport();\n assertNotNull(indexSupport);\n GlobalComponentsIndexSupport.JUnitTestSupport testSupport =\n indexSupport.getJUnitTestSupport();\n assertNotNull(testSupport);\n //\n // Initiate index building\n GlobalElement found = sm.findByNameAndType(\"B000\", GlobalElement.class);\n assertNotNull(found);\n Thread.sleep(500); // Wait the index is build\n //\n assertTrue(testSupport.isSupportIndex());\n int indexSise = testSupport.getIndexSize();\n assertEquals(indexSise, 90);\n //\n UndoManager um = new javax.swing.undo.UndoManager();\n AbstractDocumentModel.class.cast(sm).addUndoableEditListener(um);\n //\n sm.startTransaction();\n try {\n Schema schema = sm.getSchema();\n java.util.List<SchemaComponent> gChildren = schema.getChildren();\n int counter = 0;\n for (SchemaComponent child : gChildren) {\n //\n assertTrue(child instanceof GlobalElement);\n GlobalElement gElem = GlobalElement.class.cast(child);\n schema.removeElement(gElem);\n //\n counter++;\n if (counter >= 50) {\n break;\n }\n }\n } finally {\n sm.endTransaction();\n }\n //\n int childrenCount = sm.getSchema().getChildren().size();\n assertEquals(childrenCount, 40);\n assertFalse(testSupport.isSupportIndex());\n //\n //\n um.undo();\n //\n // Initiate index building again\n found = sm.findByNameAndType(\"B000\", GlobalElement.class);\n assertNotNull(found);\n Thread.sleep(500); // Wait the index is build\n //\n assertTrue(testSupport.isSupportIndex());\n indexSise = testSupport.getIndexSize();\n assertEquals(indexSise, 90);\n //\n System.out.println(\"=============================\"); // NOI18N\n System.out.println(\" testIndexCreationThreshold \"); // NOI18N\n System.out.println(\"=============LOG=============\"); // NOI18N\n String log = testSupport.printLog();\n System.out.print(log);\n System.out.println(\"=============================\"); // NOI18N\n //\n }", "abstract void onIndexDisrupted(String caseId);", "@Override\n public void cleanup() {\n \n }", "@Override\n public void cleanup() {\n \n }", "private void updateIndex() throws IOException {\n // maintain the document store (corpus) - if there is one\n if (currentMemoryIndex.containsPart(\"corpus\")) {\n // get all corpora + shove into document store\n ArrayList<DocumentReader> readers = new ArrayList<>();\n readers.add((DocumentReader) currentMemoryIndex.getIndexPart(\"corpus\"));\n for (String path : geometricParts.getAllShards().getBinPaths()) {\n String corpus = path + File.separator + \"corpus\";\n readers.add(new CorpusReader(corpus));\n }\n }\n // finally write new checkpointing data (checkpoints the disk indexes)\n Parameters checkpoint = createCheckpoint();\n this.checkpointer.saveCheckpoint(checkpoint);\n }", "@Override\n public void visit(Index node) {\n }", "@Override\r\n public ParaMap index(ParaMap inMap) throws Exception {\n return null;\r\n }", "void commit() throws IndexTransactionException;", "void remove(ThreadLocal<?> key) {\n cleanUp();\n\n for (int index = key.hash & mask;; index = next(index)) {\n Object reference = table[index];\n\n if (reference == key.reference) {\n // Success!\n table[index] = TOMBSTONE;\n table[index + 1] = null;\n tombstones++;\n size--;\n return;\n }\n\n if (reference == null) {\n // No entry found.\n return;\n }\n }\n }", "public void beforeIndexCreated(Index index) {\n\n }", "@Override\n\tpublic void clear() {\n\t\tsuper.clear();\n\t\tidIndex = new HashMap<String, SimpleFeature>();\n\t\ttypeNameIndex = new HashMap<Name, Set<SimpleFeature>>();\n\t\ttileIndex = new HashMap<OSMTile, Set<SimpleFeature>>();\n\t}", "public void unIndex(final Term idTerm) {\n\t\ttry {\n\t\t\t_reopenToken = _trackingIndexWriter.deleteDocuments(idTerm);\n\t\t\tlog.debug(\"{}={} term matching records un-indexed from lucene\",idTerm.field(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t idTerm.text());\n\t\t} catch(IOException ioEx) {\n\t\t\tlog.error(\"Error in un-index lucene operation: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t \t\t \t\t ioEx);\t\t\t\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\t_indexWriter.commit(); \n\t\t\t} catch (IOException ioEx) {\n\t\t\t\tlog.error(\"Error while commiting changes to Lucene index: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t \t\t\t\t\t ioEx);\n\t\t\t}\n\t\t}\n\t}", "public void clear(){\n\t\tcontenido = getName() + ':';\n\t\tindices.clear();\n\t\tindices.add(0);\n\t}", "@Override\n public void clear() {\n hashtableBean = null;\n\n hashtableBean = new HashTableBean[5];\n position = 0;\n }", "private void deleteBuckets(Vector<Vector<String>> index) {\n //deserialize bucket from each position\n for (int i = 0; i < index.size(); i++) {\n if (index.get(i) != null) {\n for (int j = 0; j < index.get(i).size(); j++) {\n Utilities.removeFromDisk(index.get(i).get(j));\n }\n\n }\n\n }\n //loop on entries and insert\n }", "public void cleanUp() {\n if(ticker.skipCleanup()) {\n return;\n } \n \n // At this point cleanup is inevitable, so linked list traversal should\n // be performed. \n Entry<K, V> e = segment.head();\n Entry<K, V> end = segment.tail();\n \n int processed = 0;\n long createThreshold = ticker.nextTick() - createTTL;\n long accessThreshold = ticker.nextTick() - accessTTL;\n\n Object removeKey = null;\n while ((e = e.getNext()) != end && processed++ < REMOVE_DEPTH) {\n if (null != removeKey) {\n segment.remove(removeKey);\n removeKey = null;\n }\n\n // both, access and creation thresholds might trigger entry removal \n if (e.getCreationTime() <= createThreshold || e.getAccessTime() <= accessThreshold) {\n removeKey = e.getKey();\n }\n }\n\n if (null != removeKey) {\n segment.remove(removeKey);\n } \n ticker.markCleanup();\n }", "@org.junit.Test\n public void remove() throws Exception {\n assertEquals(null, hashTable.remove(\"savon\"));\n assertEquals(\"Yuliya\", hashTable.remove(\"Savon\"));\n assertEquals(null, hashTable.remove(\"Savon\"));\n\n for (int i = 0; i < 2_000_000; i++) {\n hashTable.put(Integer.toString(i), Integer.toString(i));\n }\n\n for (int i = 0; i < 2_000_000; i++) {\n String curValue = hashTable.remove(Integer.toString(i));\n assertEquals(Integer.toString(i), curValue);\n }\n }", "@Test\n public void testDropIdxOnClient() {\n GridCacheDynamicLoadOnClientTest.srvNode.getOrCreateCache(DEFAULT_CACHE_NAME).query(new SqlFieldsQuery(((\"CREATE INDEX IDX_TST ON \" + (GridCacheDynamicLoadOnClientTest.FULL_TABLE_NAME)) + \" (name desc)\"))).getAll();\n // Due to client receive created index asynchronously we need add the ugly sleep.\n doSleep(2000);\n getDefaultCacheOnClient().query(new SqlFieldsQuery(((\"DROP INDEX \" + (GridCacheDynamicLoadOnClientTest.PERSON_SCHEMA)) + \".IDX_TST\"))).getAll();\n }", "@Override\n\tpublic void indexObject(ModelKey obj) throws ASException {\n\t\t\n\t}", "@Override\n public void ensureCapacity(int index) {\n\n }", "public synchronized void recreateIndex()\n throws InterruptedException, CancellationException, ExecutionException, IOException, IndexServiceException {\n // Clear index first\n clear();\n recreateService(IndexRecreateObject.Service.Groups);\n recreateService(IndexRecreateObject.Service.Acl);\n recreateService(IndexRecreateObject.Service.Themes);\n recreateService(IndexRecreateObject.Service.Series);\n recreateService(IndexRecreateObject.Service.Scheduler);\n recreateService(IndexRecreateObject.Service.Workflow);\n recreateService(IndexRecreateObject.Service.AssetManager);\n recreateService(IndexRecreateObject.Service.Comments);\n }", "@Override\r\n\tpublic void cleanup() {\n\t\t\r\n\t}", "protected int index(int hashvalue) {\r\n\t\tint hash=hashvalue& 0x7fffffff;\r\n\t\tint index = this.hashFunc1(hash) * FREE.length;////获取一个整型数值(正整数),用来定位一条数据存储\r\n\t\t// int stepSize = hashFunc2(hash);\r\n\t\tbyte[] cur = new byte[4];\r\n\t\tkeys.position(index);\r\n\t\tkeys.get(cur);\r\n\t\tint storehash=(cur[0] << 24)+ ((cur[1] & 0xFF) << 16)+ ((cur[2] & 0xFF) << 8)+ (cur[3] & 0xFF);\r\n\t\tif (storehash==hash) {\r\n\t\t\treturn index;\r\n\t\t}\r\n\t\tif (Arrays.equals(cur, FREE)) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\r\n\t\t// NOTE: here it has to be REMOVED or FULL (some user-given value)\r\n\t\tif (Arrays.equals(cur, REMOVED) || storehash!=hash) {\r\n\t\t\t// see Knuth, p. 529\r\n\t\t\tfinal int probe = (1 + (hash % (size - 2))) * FREE.length;\r\n\t\t\tint z = 0;\r\n\t\t\tdo {\r\n\t\t\t\tz++;\r\n\t\t\t\tindex += (probe); // add the step\r\n\t\t\t\tindex %= (size * FREE.length); // for wraparound\r\n\t\t\t\tcur = new byte[FREE.length];\r\n\t\t\t\tkeys.position(index);\r\n\t\t\t\tkeys.get(cur);\r\n\t\t\t\tif (z > size) {\r\n\t\t\t\t\tSDFSLogger.getLog().info(\r\n\t\t\t\t\t\t\t\"entries exhaused size=\" + this.size + \" entries=\"\r\n\t\t\t\t\t\t\t\t\t+ this.entries);\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t}\r\n\t\t\t} while (!Arrays.equals(cur, FREE)\r\n\t\t\t\t\t&& (Arrays.equals(cur, REMOVED) || storehash!=hash));\r\n\t\t}\r\n\r\n\t\treturn storehash!=hash ? -1 : index;\r\n\t}", "private void remove(int index){\r\n \tkeys[index] = null;\r\n \tvals[index] = null;\r\n deleteCheck(index);\r\n }" ]
[ "0.6721599", "0.6681743", "0.66589624", "0.65445966", "0.65445966", "0.6508383", "0.63637435", "0.6360245", "0.63154876", "0.62771064", "0.62437534", "0.6216059", "0.6196626", "0.61939406", "0.61733735", "0.61713153", "0.6138556", "0.61282516", "0.61186033", "0.6097255", "0.60916597", "0.6064276", "0.60636556", "0.60311574", "0.60201687", "0.59836733", "0.59775645", "0.5968548", "0.5936951", "0.5935982", "0.59297764", "0.5928079", "0.591542", "0.5915161", "0.5897357", "0.5894298", "0.5888599", "0.5876485", "0.58757263", "0.5874803", "0.5867999", "0.58547026", "0.5853894", "0.583781", "0.582098", "0.58162874", "0.5809275", "0.58071107", "0.5774035", "0.5769674", "0.57693124", "0.57682914", "0.5766046", "0.5762575", "0.5762243", "0.57544374", "0.57512045", "0.57316995", "0.5731581", "0.5728489", "0.5723132", "0.5716007", "0.56763524", "0.5671989", "0.5665374", "0.5664316", "0.56315935", "0.56250036", "0.5624256", "0.56185883", "0.56136805", "0.5613507", "0.5609511", "0.5594688", "0.5584218", "0.557975", "0.55759895", "0.5575217", "0.55751175", "0.55751175", "0.55672604", "0.5561553", "0.5543655", "0.55317926", "0.5528704", "0.5528623", "0.55217016", "0.5510281", "0.5504107", "0.5496991", "0.5494953", "0.54836965", "0.5483436", "0.5483425", "0.54728717", "0.54720855", "0.54545945", "0.5448113", "0.54410535", "0.54342276" ]
0.6162504
16
SEARCH MANAGEMENT (USER) [MODIFIED] Returns the postings for a specific term, or null if the term is not in the index.
public PostingsList getPostings( String token ) { PostingsList post = new PostingsList(); if(this.index.containsKey(token)) post = (this.index.get(token)).clone(); /*System.err.println("start search..."); // Read JSON file associated to token and return it as a postingslist String filename = "postings/t"+hash(token)+".json"; PostingsList post = new PostingsList(); try(Reader reader = new FileReader(filename)){ post = (new Gson()).fromJson(reader, PostingsList.class); } catch (IOException e) { e.printStackTrace(); }*/ return post; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@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 void termQuerySearch(String[] terms) {\n for (String term : terms) {\n LinkedList<TermPositions> postingLists = indexMap.get(analyzeTerm(term));\n if (postingLists != null) {\n for (TermPositions matches : postingLists) {\n double score = (double) 1 + Math.log((double) matches.getPositionList().size()) *\n Math.log((double) N / (double) postingLists.size());\n resultsCollector.add(new DocCollector(matches.getDocId(), score));\n }\n }\n }\n }", "List<DataTerm> search(String searchTerm);", "public void search(Indexer indexer, CityIndexer cityIndexer, Ranker ranker, String query, boolean withSemantic, ArrayList<String> chosenCities, ObservableList<String> citiesByTag, boolean withStemming, String saveInPath, String queryId, String queryDescription) {\n String[] originalQueryTerms = query.split(\" \");\n String originQuery = query;\n docsResults = new HashMap<>();\n parser = new Parse(withStemming, saveInPath, saveInPath);\n HashSet<String> docsOfChosenCities = new HashSet<>();\n query = \"\" + query + queryDescription;\n HashMap<String, Integer> queryTerms = parser.parseQuery(query);\n HashMap<String, ArrayList<Integer>> dictionary = indexer.getDictionary();\n if (!withStemming){\n setDocsInfo(saveInPath + \"\\\\docsInformation.txt\");\n }\n else{\n setDocsInfo(saveInPath + \"\\\\docsInformation_stemming.txt\");\n }\n\n\n //add semantic words of each term in query to 'queryTerms'\n if(withSemantic) {\n HashMap<String,ArrayList<String>> semanticWords = ws.connectToApi(originQuery);\n }\n\n //give an ID to query if it's a regular query (not queries file)\n if(queryId.equals(\"\")){\n queryId = \"\" + Searcher.queryID;\n Searcher.queryID++;\n }\n\n String postingDir;\n if (!withStemming) {\n postingDir = \"\\\\indexResults\\\\postingFiles\";\n } else {\n postingDir = \"\\\\indexResults\\\\postingFiles_Stemming\";\n }\n int pointer = 0;\n\n //find docs that contain the terms in the query in their text\n HashMap<String, Integer> queryTermsIgnoreCase = new HashMap<>();\n for (String term : queryTerms.keySet()) {\n String originTerm = term;\n if (!dictionary.containsKey(term.toUpperCase()) && !dictionary.containsKey(term.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(term.toLowerCase())){\n term = term.toLowerCase();\n }\n else {\n term = term.toUpperCase();\n }\n queryTermsIgnoreCase.put(term,queryTerms.get(originTerm));\n pointer = dictionary.get(term).get(2);\n String chunk = (\"\" + term.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsResults'\n if(line != null) {\n findDocsFromLine(line, term);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their text\n for (String cityTerm : chosenCities) {\n if (!dictionary.containsKey(cityTerm) && !dictionary.containsKey(cityTerm.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(cityTerm.toLowerCase())){\n cityTerm = cityTerm.toLowerCase();\n }\n pointer = dictionary.get(cityTerm).get(2);\n // char chunk = indexer.classifyToPosting(term).charAt(0);\n String chunk = (\"\" + cityTerm.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(0, line.indexOf(\"[\") - 1); //get 'docsListStr'\n String[] docsArr = docs.split(\";\");\n for (String docInfo : docsArr) {\n String doc = docInfo.substring(0, docInfo.indexOf(\": \"));\n while(doc.charAt(0) == ' '){\n doc = doc.substring(1);\n }\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their city tag\n if(!chosenCities.isEmpty()){\n for (String cityDicRec: chosenCities) {\n //get pointer to posting from cityDictionary\n try {\n pointer = cityIndexer.getCitiesDictionary().get(cityDicRec);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + \"\\\\cityIndexResults\" + \"\\\\posting_city\" + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(line.indexOf(\"[\") + 1, line.indexOf(\"]\")); //get 'docsListStr'\n String[] docsArr = docs.split(\"; \");\n for (String doc : docsArr) {\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n\n ranker.rank(docsResults, docsOfChosenCities, queryTermsIgnoreCase, dictionary, docsInfo,entities, queryId);\n }", "@Override\n public int getIndexByTerm(String term) {\n return 0;\n }", "@Override\n\tprotected void executeSearch(String term) {\n\t\t\n\t}", "@Override\n \tpublic ArrayList<Object> searchPostByName(String search) {\n\t\t\n\t\tSystem.out.println(\"i am in service search looking for cool posts\" + search);\n\t\t\n\t\tif(search == null){\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tArrayList<Object> list = null; //postRepository.findPostByName(search); ****Nick set this to null; otherwise it failed. Needs corrected in future\n\t\t\n\t\t//System.out.println(Arrays.toString(list));\n\t\treturn list;\n\t}", "public org.apache.xmlbeans.XmlAnySimpleType getSearchTerms()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlAnySimpleType target = null;\n target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().find_attribute_user(SEARCHTERMS$6);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "public PostingsList search( Query query, int queryType, int rankingType, int structureType ) {\r\n switch(queryType){\r\n case Index.INTERSECTION_QUERY : \r\n return searchIntersection( query, rankingType, structureType);\r\n\r\n case Index.PHRASE_QUERY :\r\n return searchPhrase( query, rankingType, structureType);\r\n default:\r\n break;\r\n }\r\n\r\n return null;\r\n }", "public static void searchJobs(String searchTerm) {\n\n for (int i = 0; i > PostJob.allJobs.size(); i++) {\n\n\n if (PostJob.allJobs.contains(searchTerm)) {\n int itemIndx = PostJob.allJobs.indexOf(searchTerm);\n String output = PostJob.allJobs.get(itemIndx);\n System.out.print(\"Available jobs within your search terms\" + output);\n\n }\n }\n }", "public void onSearchResults(String term, List<WikiPage> results);", "public int getTermIndex() {return termIndex;}", "public MagicSearch createMagicSearch();", "public interface DocumentRelatedTermsSearcher {\n List<ScoredTerm> getDocumentRelatedTerms(int docId, String term) throws SearchException;\n}", "public void SearchPhrase(Object_Ord temp) {\n\tif (!Doneloading) {\r\n\t return;\r\n\t}\r\n\tif (temp == null) {\r\n\t return;\r\n\t} else if (temp.Ordet.equals(\"\")) {\r\n\t return;\r\n\t}\r\n\ttemp.Set_Searched();\r\n\t//PrintAction( this.getClass().toString() + \" Searching for phrase \" + temp.Ordet );\r\n\tThread thread = new Thread_PhraseSearcher(this, temp);\r\n\tThreadsRunning++;\r\n\tThreadsStarted++;\r\n }", "public String search(String term, String location) {\n\t\t\t String limit = \"6\";\n\t\t OAuthRequest request = new OAuthRequest(Verb.GET, \"http://api.yelp.com/v2/search\");\n\t\t request.addQuerystringParameter(\"term\", term);\n\t\t request.addQuerystringParameter(\"location\", location);\n\t\t request.addQuerystringParameter(\"limit\", limit);\n\t\t this.service.signRequest(this.accessToken, request);\n\t\t Response response = request.send();\n\t\t return response.getBody();\n\t\t }", "public void onSearchSubmit(String queryTerm);", "public String getTerm(){\n return this.term;\n }", "public PostingsList getPostings( String token ) {\r\n PostingsList element = index.get(token) ;\r\n if (element != null)\r\n {\r\n return element;\r\n }\r\n return null;\r\n }", "List<User> searchUsers(String searchTerm) {\n return null;\n }", "@Override\n public List<SearchResult> search(String queryString, int k) {\n // TODO: YOUR CODE HERE\n\n // Tokenize the query and put it into a Set\n HashSet<String> tokenSet = new HashSet<>(Searcher.tokenize(queryString));\n\n /*\n * Section 1: FETCHING termId, termFreq and relevant docId from the Query\n */\n\n // Init a set to store Relevant Document Id\n HashSet<Integer> relevantDocIdSet = new HashSet<>();\n for (String token : tokenSet) { // Iterates thru all query tokens\n int termId;\n try {\n termId = indexer.getTermDict().get(token);\n } catch (NullPointerException e) { // In case current token is not in the termDict\n continue; // Skip this one\n }\n // Get the Posting associate to the termId\n HashSet<Integer> posting = indexer.getPostingLists().get(termId);\n relevantDocIdSet.addAll(posting); // Add them all to the Relevant Document Id set\n }\n\n /*\n * Section 2: Calculate Jaccard Coefficient between the Query and all POTENTIAL DOCUMENTS\n */\n\n // ArrayList for the Final Result\n ArrayList<SearchResult> searchResults = new ArrayList<>();\n for (Document doc : documents) { // Iterates thru all documents\n if (!relevantDocIdSet.contains(doc.getId())) { // If the document is relevant\n searchResults.add(new SearchResult(doc, 0)); // Add the document as a SearchResult with zero score\n } else {\n HashSet<String> termIdSet = new HashSet<>(doc.getTokens()); // Get the token set from the document\n\n // Calculate Jaccard Coefficient of the document\n double jaccardScore = JaccardMathHelper.calculateJaccardSimilarity(tokenSet, termIdSet);\n\n // Add the SearchResult with the computed Jaccard Score\n searchResults.add(new SearchResult(doc, jaccardScore));\n }\n }\n\n return TFIDFSearcher.finalizeSearchResult(searchResults, k);\n }", "@RequestMapping(method=RequestMethod.POST,value = \"/search\")\n public ArrayList<Results> searchMentors(@RequestBody SearchForm s) {\n return resultsRepository.findMentors(s.getFrom(),s.getCourse(),s.getTimeslot());\n }", "@Override\n public SearchResult search_hunter(String keyword, int page, int rows ,int search_type) throws Exception{\n\n return null;\n }", "public PostingsList search( Query query, int queryType, int rankingType,\n int structureType ) {\n double idf_threshold = new Double(0);\n double index_elimination = new Double(0.008);\n // System.err.println(pageRank[docNumber.get(\"121\")]);\n\n if (query.size()>0){\n switch (queryType){\n case Index.INTERSECTION_QUERY:\n System.err.println(\"Intersection query\");\n return intersect(query);\n case Index.PHRASE_QUERY:\n System.err.println(\"Phrase query\");\n return phrase_query(query);\n case Index.RANKED_QUERY:\n System.err.println(\"Ranked query\");\n switch(rankingType){\n case Index.TF_IDF: return ranked_query(query, 1, idf_threshold);\n case Index.PAGERANK: return ranked_query(query, 0, idf_threshold);//ranked_query(query, 0, idf_threshold);//ranked_query2(query, 0);\n case Index.COMBINATION: return ranked_query(query, index_elimination, idf_threshold);\n }\n default:\n System.out.println(\"not valid query\");\n return null;\n }\n }\n else\n // Query was empty\n return null;\n }", "public PostingsList phrase_query(Query query){\n\n LinkedList<PostingsList> listQueriedPostings = new LinkedList<PostingsList>();\n // List with postings corresponding to the queries\n for (int i = 0; i<query.size(); i++){\n // If any query has zero matches, return 0 results\n //if(!(new File(\"postings/t\"+hash(query.terms.get(i))+\".json\")).exists()){\n if (!this.index.containsKey(query.terms.get(i))){\n return null;\n }\n // Otherwise store postings in the list\n listQueriedPostings.add(this.getPostings(query.terms.get(i)));\n }\n\n PostingsList result = new PostingsList();\n result = listQueriedPostings.get(0);\n\n // In case only one word is queried\n if (listQueriedPostings.size() == 1){\n return result;\n }\n\n // Apply algorithm as many times as words in the query\n for(int i = 1; i < listQueriedPostings.size(); i++){\n result = phrase_query(result, listQueriedPostings.get(i));\n if (result.isEmpty()){\n return null;\n }\n }\n return result;\n }", "Search getSearch();", "public void search() {\r\n \t\r\n }", "SearchResult<TimelineMeta> search(SearchParameter searchParameter);", "com.google.ads.googleads.v6.resources.SearchTermView getSearchTermView();", "SearchResult<TimelineMeta> search(SearchQuery searchQuery);", "public void search() {\n String q = this.query.getText();\n String cat = this.category.getValue();\n if(cat.equals(\"Book\")) {\n searchBook(q);\n } else {\n searchCharacter(q);\n }\n }", "public Post[] wallSearch(String text) {\n return null;\n }", "private static String handleNonPhraseToken(String stringPart) {\r\n // Set of final terms to be used (no empty elements, right syntax of index fields)\r\n ArrayList <String> terms = new ArrayList <String> ();\r\n \r\n /** Case Index field **/\r\n if(stringPart.contains(\"[\") | stringPart.contains(\"[\")){ // at least an Index field contained here\r\n //separate brackets for term with one space (extra spaces dont matter, trim() is used later)\r\n stringPart = stringPart.replace(\"[\", \" [\");\r\n stringPart = stringPart.replace(\"]\", \"] \");\r\n }\r\n\r\n /** Case Bag of terms **/\r\n //replace space with AND (change default operator to match pubMed's)\r\n // No need for this if setDefaultOperator(QueryParser.Operator.AND) is used\r\n \r\n String[] tokens = stringPart.split(\"\\\\s\");\r\n if(tokens.length > 0){ \r\n for(int i = 1 ; i < tokens.length ; i++){\r\n tokens[i] = tokens[i].trim();\r\n /* Case index field [fieldName] */\r\n if(tokens[i].startsWith(\"[\") & tokens[i].endsWith(\"]\")){\r\n tokens[i] = tokens[i].replace(\"[\",\"\");// clean field name from brackets\r\n tokens[i] = tokens[i].replace(\"]\",\"\");// clean field name from brackets\r\n //Add index field as prefix to previus (not empty) term (as opening index fields handled separately, this index field should not be the first term of string part)\r\n int tmp = i-1;\r\n boolean perviusTermFound = false;\r\n while(!perviusTermFound & tmp >= 0){\r\n if(!tokens[tmp].equals(\"\")){\r\n perviusTermFound = true;\r\n //TO DO : handle wrong syntax (e.g. ... AND [ArticleTitle])\r\n String luceneField = supportedIndexFields.get(tokens[i]);\r\n if(luceneField != null){\r\n tokens[tmp] = luceneField + \":\" + tokens[tmp];\r\n } // else : Lucene counterpart not found, unsupported field - do nothing\r\n } else {\r\n tmp--;\r\n }\r\n }\r\n //Empty field to not be added as a search term in query\r\n tokens[i] = \"\";\r\n } \r\n \r\n /*\r\n \r\n else if(!tokens[i].equals(\"AND\") & !tokens[i].equals(\"\")) {\r\n terms.add(tokens[i]);\r\n }\r\n */\r\n }\r\n }\r\n \r\n String luceneQueryPart = \"\";\r\n boolean notWaiting = false;\r\n boolean orWaiting = false;\r\n for(int i = 0 ; i < tokens.length ; i++){\r\n\r\n if(!tokens[i].equals(\"AND\") & !tokens[i].equals(\"\")){\r\n //in case of AND nothing should happen, it is the default operator\r\n //empty elements are also ignored as useless\r\n \r\n if(!tokens[i].equals(\"NOT\") & !tokens[i].equals(\"OR\") ){ // it's not an operator, it's a term\r\n \r\n if(!luceneQueryPart.endsWith(\" OR \") & !luceneQueryPart.endsWith(\" -\") ) { \r\n luceneQueryPart += \" +\"; \r\n } \r\n luceneQueryPart += tokens[i];\r\n } else {\r\n if(tokens[i].equals(\"NOT\")) {\r\n luceneQueryPart += \" -\";\r\n }\r\n if(tokens[i].equals(\"OR\")){\r\n luceneQueryPart += \" OR \";\r\n }\r\n \r\n } \r\n } \r\n }\r\n \r\n return luceneQueryPart;\r\n }", "private void searchWord()\n {\n String inputWord = searchField.getText();\n \n if(inputWord.isEmpty())\n queryResult = null;\n \n else\n {\n char firstLetter = inputWord.toUpperCase().charAt(0);\n \n for(int i = 0 ; i < lexiNodeTrees.size() ; i++)\n {\n if(lexiNodeTrees.get(i).getCurrentCharacter() == firstLetter)\n {\n queryResult = lexiNodeTrees.get(i).searchWord(inputWord, false);\n i = lexiNodeTrees.size(); // escape the loop\n }\n }\n }\n \n // update the list on the GUI\n if(queryResult != null)\n {\n ArrayList<String> words = new ArrayList<>();\n for(WordDefinition word : queryResult)\n {\n words.add(word.getWord());\n }\n \n // sort the list of words alphabetically \n Collections.sort(words);\n \n // display the list of wordsin the UI\n DefaultListModel model = new DefaultListModel();\n for(String word : words)\n {\n model.addElement(word);\n }\n\n this.getSearchSuggestionList().setModel(model);\n }\n \n else\n this.getSearchSuggestionList().setModel( new DefaultListModel() );\n }", "public void search() {\n }", "@Override\r\n\tpublic String searchPoster(String searchPoster) throws Exception {\n\t\treturn null;\r\n\t}", "void search();", "void search();", "@Override\r\n\t\t\tpublic List<ScoredDocument> search(Query query) {\n\t\t\t\treturn null;\r\n\t\t\t}", "@Action\r\n public String search() {\n ServiceFunctions.clearCache();\r\n\r\n if (isAdmin()) {\r\n return adminSearch();\r\n }\r\n\r\n return publicSearch();\r\n }", "@Override\n public String getTermByIndex(int index) {\n return null;\n }", "public String getTerm() {\n return term;\n }", "@Override\r\n\t\t\tpublic boolean containsTerm(Document document, String term) {\n\t\t\t\treturn false;\r\n\t\t\t}", "public org.apache.xmlbeans.XmlAnySimpleType addNewSearchTerms()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlAnySimpleType target = null;\n target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().add_attribute_user(SEARCHTERMS$6);\n return target;\n }\n }", "@RequestMapping(\"/\")\n public String index(@RequestParam(value = \"searchTerm\", required = false, defaultValue = \"None\") String searchTerm, Model model) {\n List<Review> reviews = this.reviewService.fetchAll();\n if (!searchTerm.equals(\"None\")) {\n List<Review> filteredReviews = new ArrayList<>();\n for (Review review : reviews)\n if (review.getPlaceId().equals(searchTerm))\n filteredReviews.add(review);\n reviews = filteredReviews;\n }\n System.out.println(reviews);\n model.addAttribute(reviews);\n return \"index\";\n }", "public PostingsList ranked_query(Query query, double w, double idf_threshold){\n long startTime = System.nanoTime();\n PostingsList result = new PostingsList();\n\n // Obtain union of terms above idf threshold if indexElimination is true\n // (Set idf_threshold to zero to disable this feature)\n Set<String> termsToConsider = this.queryTermsConsidered(query, idf_threshold);\n result = this.union_query(query, termsToConsider);\n //System.err.println(\"Size of result is \" + result.size());\n\n long estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Union took: \" + estimatedTime);\n\n\n /*\n * 2) Iterate over PostingsEntries and build the solution\n */\n startTime = System.nanoTime();\n // Required when iterating over a PostingsList\n PostingsEntry postEnt = new PostingsEntry();\n // Number of documents in the collection\n double nDocs = this.docIDs.size();\n // Weight of a query vector coefficient\n double w_query_term;\n // Document tf-idf variables\n double termFrequency_doc, documentFrequency_doc, w_doc_term;\n\n for(String term : termsToConsider){\n // Obtain idf of the term\n documentFrequency_doc = Math.log(nDocs/new Double(this.idfMap.get(term)));\n\n // Obtain weight of the term\n w_query_term = query.weights.get(term);\n // Iterate over all documents containing the term and update the score(q,d)\n Iterator<PostingsEntry> it_d = result.iterator();\n while(it_d.hasNext()){\n postEnt = it_d.next();\n if (this.tfMap.get(postEnt.docID).containsKey(term)){\n termFrequency_doc = this.tfMap.get(postEnt.docID).get(term);\n w_doc_term = documentFrequency_doc*termFrequency_doc;\n postEnt.score += w_query_term*w_doc_term;\n }\n }\n }\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Building solution took: \" + estimatedTime);\n\n /*\n * 3) Normalize the scores\n */\n startTime = System.nanoTime();\n Iterator<PostingsEntry> it = result.iterator();\n while(it.hasNext()){\n postEnt = it.next();\n postEnt.score /= (new Double(this.docLengths.get(\"\"+postEnt.docID)));//(Math.sqrt(postEnt.norm2));\n postEnt.score = w * postEnt.score + (1-w) * quality(postEnt.docID);\n }\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Normalizing took: \" + estimatedTime);\n\n /*\n * 4) Sort the resulting solution\n */\n startTime = System.nanoTime();\n result.sort();\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Sorting took: \" + estimatedTime);\n\n return result;\n }", "ReagentSearch getReagentSearch();", "SpellResponse spellQuery(SearchRequest request, Map<SearchParam, String> params);", "@Override\n\tpublic List<Literature> searchKeywords() {\n\t\treturn null;\n\t}", "List<PilotContainer> Search(String cas, String word);", "abstract public void search();", "public IndexedList<Task> search() {\n\t\treturn null;\n\t}", "public ArrayList<ArrayList> simpleQuery(String word)\n {\n ArrayList<ArrayList> data = new ArrayList();\n\n IndexObject obj = myIndex.get(word.hashCode());\n if(obj == null)\n {\n errorMsg();\n return null;\n }\n data.add(new ArrayList<Document>(obj.getDocuments()));\n data.add(new ArrayList<Double>(obj.getRelevance()));\n data.add(new ArrayList<Integer>(obj.getOccurrence()));\n data.add(new ArrayList<Integer>(obj.getPopularity()));\n return data;\n }", "@Override\n public Data3DPlastic search() {\n return super.search();\n }", "public abstract HashMap search(String keyword);", "com.google.ads.googleads.v6.resources.SearchTermViewOrBuilder getSearchTermViewOrBuilder();", "public List<Recipe> search(String queryText, Category category, CookingMethod cookingMethod);", "@Override\n\tpublic void search() {\n\t}", "List<Block> search(String searchTerm);", "public HashMap<String, Double> search(String query) {\n // ===================================================\n // 1. Fetch all inverted lists corresponding to terms\n // in the query.\n // ===================================================\n String[] terms = query.split(\" \");\n HashMap<String, Integer> qf = new HashMap<String, Integer>();\n // Calculate term frequencies in the query\n for (String term : terms) {\n if (qf.containsKey(term))\n qf.put(term, qf.get(term) + 1);\n else\n qf.put(term, 1);\n }\n HashMap<String, Double> docScore = new HashMap<String, Double>();\n for (Entry<String, Integer> termEntry : qf.entrySet()) {\n String term = termEntry.getKey();\n int qfi = termEntry.getValue();\n\n // ===================================================\n // 2. Compute BM25 scores for documents in the lists.\n // Make a score list for documents in the inverted\n // lists. Assume that no relevance information is \n // available. For parameters, use k1=1.2, b=0.75, \n // k2=100.\n // ===================================================\n double k1 = 1.2;\n double b = 0.75;\n double k2 = 100;\n int ni = invIndex.get(term).size();\n\n\n for (Entry<String, IndexEntry> invListEntry : invIndex.get(term).entrySet()) {\n String docID = invListEntry.getKey();\n double bm25Score;\n if (docScore.containsKey(docID))\n bm25Score = docScore.get(docID);\n else\n bm25Score = 0;\n\n // length of the document\n int dl = docStat.get(docID);\n // frequency of the term in the document\n int fi = invListEntry.getValue().getTf();\n double K = k1 * ((1 - b) + b * ((double) dl / avdl));\n\n // ===================================================\n // 3. Accumulate scores for each term in a query\n // on the score list.\n // ===================================================\n bm25Score += Math.log((N - ni + 0.5) / (ni + 0.5))\n * (((k1 + 1) * fi * (k2 + 1) * qfi) / ((K + fi) * (k2 + qfi)));\n docScore.put(docID, bm25Score);\n }\n }\n\n return docScore;\n }", "List<SearchResult> search(SearchQuery searchQuery);", "public List<Post> search(PostCriteria criteria, int page, int size);", "private static List<SearchData> booleanSearchWord(Query query, Indexer si) {\n Tokenizer tkn = new SimpleTokenizer();\n tkn.tokenize(query.getStr(), \"[a-zA-Z]{3,}\", true, true);\n List<SearchData> searchList = new ArrayList<>();\n LinkedList<Token> wordsList = tkn.getTokens();\n Iterator<Token> wordsIt = wordsList.iterator();\n HashMap<String, LinkedList<Posting>> indexer = si.getIndexer();\n int idx;\n SearchData searched_doc;\n\n while (wordsIt.hasNext()) {\n String word = wordsIt.next().getSequence();\n if (indexer.containsKey(word)) {\n\n LinkedList<Posting> posting = indexer.get(word);\n\n for (Posting pst : posting) {\n\n SearchData sd = new SearchData(query, pst.getDocId());\n\n if (!searchList.contains(sd)) {\n sd.setScore(1);\n searchList.add(sd);\n } else {\n idx = searchList.indexOf(sd);\n searched_doc = searchList.get(idx);\n searched_doc.setScore(searched_doc.getScore() + 1);\n }\n }\n\n }\n\n\n }\n\n Collections.sort(searchList);\n\n return searchList;\n }", "public abstract int search(String[] words, String wordToFind) throws ItemNotFoundException;", "public static void searchSimillar(String keyword,int numberofResults,PreSearch ps) {\t\t\r\n\t\tHashMap<String,Integer> sortedDistance = sortByEditDistance(keyword,ps);\r\n\t\tIterator<Entry<String, Integer>> iterator2 = sortedDistance.entrySet().iterator(); \r\n\t\twhile(iterator2.hasNext()) \r\n\t\t{ \t\t\t\r\n\t\t\tMap.Entry<String, Integer> me = (Map.Entry<String, Integer>)iterator2.next();\r\n\t\t\tString word = me.getKey().toString();\t\t\t\r\n\t\t\tSystem.out.println(\"Instead showing results for : \"+word);\r\n\t\t\t\r\n\t\t\t//Searching for the word with lowest distance.\r\n\t\t\tMap<String,Integer> sortedMap;\r\n\t\t\tArrayList<String> as = ps.find(word);\r\n\t\t\tString phrase = word.toLowerCase();\r\n\t\t\t\r\n\t\t\tsortedMap = SortResultsByRank.sortByRank(as, phrase);\t\t\t\r\n\t\t\tSearch.printResult(sortedMap,numberofResults);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t}", "@RequestMapping(value={\"/search\"}, method={RequestMethod.GET})\n \tpublic ModelAndView handleSearch(@RequestParam(required=false) String q, @RequestParam(required=false,defaultValue=\"1\") Integer page){\n \t\tMap<String,Object> model = new HashMap<String,Object>();\n \t\t\n \t HashMap<String,Object> search = new HashMap<String,Object>();\n \t search.put(\"term\", \"\");\n \t search.put(\"total\",0);\n \n \t List<Map<String,String>> searchResult = new ArrayList<Map<String,String>>();\n \t if(StringUtils.isNotBlank(q)){\n \t \tsearch.put(\"term\", q);\n \t \tLimitedResult<List<NameConceptModelIF>> nameConceptModelList = null;\n \t \tint pageIndex = (page <= 0)?0:(page-1);\n \t \t//use page index +1 to avoid returning a bad page number\n \t\tsearch.put(\"pageNumber\", (pageIndex+1));\n \t\tsearch.put(\"pageSize\", searchService.getPageSize());\n \t\t//check if we want another page than the first one\n \t \tif(pageIndex > 0){\n \t \t\tnameConceptModelList = searchService.searchName(q,pageIndex);\n \t \t}\n \t \telse{\n \t \t\tnameConceptModelList = searchService.searchName(q);\n \t \t}\n \n \t\t search.put(\"total\",nameConceptModelList.getTotal_rows());\n \t\t List<Map<String,String>> searchResults = new ArrayList<Map<String,String>>();\n \t\t Map<String,String> searchRow = null;\n \t\t //TODO use objects directly instead of map\n \t\t for(NameConceptModelIF currNameConceptModel : nameConceptModelList.getRows()){\n \t\t \tif(currNameConceptModel.getClass().equals(NameConceptTaxonModel.class)){\n \t\t \t\tsearchRow = new HashMap<String,String>();\n \t\t \t\tsearchRow.put(\"type\",\"taxon\");\n \t\t \t\tsearchRow.put(\"name\", currNameConceptModel.getName());\n \t\t \t\tsearchRow.put(\"id\", currNameConceptModel.getTaxonId().toString());\n \t\t \t\tsearchRow.put(\"status\", currNameConceptModel.getStatus());\n \t\t \t\tsearchRow.put(\"namehtml\",((NameConceptTaxonModel)currNameConceptModel).getNamehtml());\n \t\t \t\tsearchRow.put(\"namehtmlauthor\",((NameConceptTaxonModel)currNameConceptModel).getNamehtmlauthor());\n \t\t \t\tsearchRow.put(\"rankname\",((NameConceptTaxonModel)currNameConceptModel).getRankname());\n \t\t \t\tsearchRow.put(\"parentid\",((NameConceptTaxonModel)currNameConceptModel).getParentid().toString());\n \t\t \t\tsearchRow.put(\"parentnamehtml\",((NameConceptTaxonModel)currNameConceptModel).getParentnamehtml());\n \t\t \t\tsearchResult.add(searchRow);\n \t\t \t}\n \t\t \telse if(currNameConceptModel.getClass().equals(NameConceptVernacularNameModel.class)){\n \t\t \t\tsearchRow = new HashMap<String, String>();\n \t\t \t\tsearchRow.put(\"type\",\"vernacular\");\n \t\t \t\tsearchRow.put(\"name\", currNameConceptModel.getName());\n \t\t \t\tsearchRow.put(\"id\", Integer.toString(((NameConceptVernacularNameModel)currNameConceptModel).getId()));\n \t\t \t\tsearchRow.put(\"status\", currNameConceptModel.getStatus());\n \t\t \t\tsearchRow.put(\"lang\",((NameConceptVernacularNameModel)currNameConceptModel).getLang());\n \t\t \t\tsearchRow.put(\"taxonid\",currNameConceptModel.getTaxonId().toString());\n \t\t \t\tsearchRow.put(\"taxonnamehtml\",((NameConceptVernacularNameModel)currNameConceptModel).getTaxonnamehtml());\n \t\t \t\tsearchResult.add(searchRow);\n \t\t \t}\n \t\t \telse{\n \t\t \t\t//logger\n \t\t \t\tsearchRow = null;\n \t\t \t}\n \t\t \tsearchResults.add(searchRow);\n \t\t }\n \t\t model.put(\"results\",searchResults);\n \t }\n \t \n \t model.put(\"search\",search);\n \t return new ModelAndView(\"search\", model);\n \t}", "@Override\n public List<KBHandle> searchItems(KnowledgeBase aKB, String aQuery)\n {\n return disambiguate(aKB, null, ConceptFeatureValueType.ANY_OBJECT, aQuery, null, 0, null);\n }", "public abstract S getSearch();", "public void searchIndexWithTermQueryByBody(final String toSearch) throws IOException, ParseException {\n searchIndexWithTermQuery(toSearch, \"body\", DEFAULT_LIMIT);\n }", "Boolean getSearchObjective();", "@Override\r\n\tpublic void search() {\n\r\n\t}", "private void performSearch() {\n String text = txtSearch.getText();\n String haystack = field.getText();\n \n // Is this case sensitive?\n if (!chkMatchCase.isSelected()) {\n text = text.toLowerCase();\n haystack = haystack.toLowerCase();\n }\n \n // Check if it is a new string that the user is searching for.\n if (!text.equals(needle)) {\n needle = text;\n curr_index = 0;\n }\n \n // Grab the list of places where we found it.\n populateFoundList(haystack);\n \n // Nothing was found.\n if (found.isEmpty()) {\n Debug.println(\"FINDING\", \"No occurrences of \" + needle + \" found.\");\n JOptionPane.showMessageDialog(null, \"No occurrences of \" + needle + \" found.\",\n \"Nothing found\", JOptionPane.INFORMATION_MESSAGE);\n \n return;\n }\n \n // Loop back the indexes if we have reached the end.\n if (curr_index == found.size()) {\n curr_index = 0;\n }\n \n // Go through the findings one at a time.\n int indexes[] = found.get(curr_index);\n field.select(indexes[0], indexes[1]);\n curr_index++;\n }", "public Map<String, String> directQuoteSearch (String q, String contentOrTitle) throws IOException, ParseException{\n\n\t\t\n\t\tif (contentOrTitle.equals(\"content\")){\n\t\t\tcontentOrTitle=field;\n\t\t} else if (contentOrTitle.equals(\"title\")){\n\t\t\tcontentOrTitle=title;\n\t\t}\n\t\t\n\t\tIndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(index)));\n\t\tIndexSearcher searcher = new IndexSearcher(reader);\n\t\tboolean raw = false;\n\t\tint repeat = 0;\n\n\t\tfinal List<String> stopWords = Arrays.asList();\n\t\tfinal CharArraySet stopSet = new CharArraySet(stopWords, true);\n\n\t\tAnalyzer analyzer = new StandardAnalyzer(stopSet);\n\t\tAnalyzingQueryParser parser = new AnalyzingQueryParser(contentOrTitle, analyzer);\n\t\t\n\n\t\t\n\t\tString[] items = q.split(\" \");\n\t\tList<String> itemList = Arrays.asList(items);\n\t\tQuery query=null;\n\t\t\n\t\t\n\t\tif (q.equals(\"\")){\n\t\t\tSystem.out.println(\"no input\");\n\t\t\t\n\t\t} else {\n\t\t\tquery = parser.parse(q);\n\n\t\t}\n\n\t\t\n\t\t\n\t\tBufferedReader in = null;\n\t\tin = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));\n\n\t\tif (repeat > 0) { // repeat & time as benchmark\n\t\t\tDate start = new Date();\n\t\t\tfor (int i = 0; i < repeat; i++) {\n\t\t\t\tsearcher.search(query, 100);\n\t\t\t}\n\t\t\tDate end = new Date();\n\t\t\tSystem.out.println(\"Time: \"+(end.getTime()-start.getTime())+\"ms\");\n\t\t}\n\n\t\treturn doPagingSearch(in, searcher, query, hitsPerPage, raw, true);\n\t}", "abstract public boolean performSearch();", "@Override\n\tpublic void searchMembers(String keyword) {\n\t}", "public HashMap<String, int[]> documentsContaining(String word) {\n return index.get(word);\n }", "@Override\n public String doSearchResult() {\n return null;\n }", "public byte filter(Manager m, SearchRequest q, ResultSet rs, int DocAtNumber, int DocNo)\n\t{\t\t\n\t\tString originalQuery = q.getOriginalQuery();\n\t\t//highlight query terms only for the queries, \n\t\t//which are not about finding related documents\n\t\t//this check may be removed, because the preparation of the \n\t\t//query terms for highlighting takes into account\n\t\t//the related: operator\n\t\tboolean highlightQueryTerms = true;\n\t\tif (originalQuery.matches(\"\\\\brelated:\\\\d+\\\\b\") || //check if the query uses the related: operator \n\t\t\t!enableQueryTermsHighlight || //check if the highlighting of terms is enabled\n\t\t\thighlight.pattern().equals(\"(\\\\b)()(\\\\b)\")) //check if there are no query terms to highlight\n\t\t\thighlightQueryTerms = false;\n\t\t\n\t\tString[] qTerms = q.getOriginalQuery().replaceAll(\" \\\\w+\\\\p{Punct}\\\\w+ \",\" \").toLowerCase().split(\" \");\n\t\t\n\t\tString[] metadata = null;\n\t\tint tmpSentence;\n\t\tdouble tmpScore;\n\t\tsynchronized(metaCache) {\n\t\t\ttry {\n\t\t\t\tInteger DocNoObject = new Integer(DocNo);\n\t\t\t\tif (metaCache.containsKey(DocNoObject))\n\t\t\t\t\t\tmetadata = (String[]) metaCache.get(DocNoObject);\n\t\t\t\telse {\n\t\t\t\t\tmetadata = metaIndex.getItems(keys, DocNo);\n\t\t\t\t\tmetaCache.put(DocNoObject,metadata);\n\t\t\t\t}\n\t\t\t} catch(IOException ioe) {} \n\t\t}\n\t\n\t\tif (show_snippet)\n\t\t{\n\t\t\tString extract = metadata[1];\n\t\t\tString[] sentences = sentencePattern.split(extract, 50); //use 50 sentences at most\n\t\t\tdouble[] sentenceScores = new double[sentences.length]; \n\t\t\tint frsSentence = -1;\n\t\t\tint sndSentence = -1;\n\t\t\tint top1Sentence = 0;\n\t\t\tint top2Sentence = 0;\n\t\t\tdouble max1Score = -1;\n\t\t\tdouble max2Score = 0;\n\t\t\tfinal int qTermsLength = qTerms.length;\n\t\t\tfor (int i=0; i<qTermsLength; i++) {\n\t\t\t\tqTerms[i] = removeEndings.matcher(qTerms[i]).replaceAll(\"\");\n\t\t\t}\n\t\t\tString lowerCaseSentence;\n\t\t\tint sentenceLength;\n\t\t\tfinal int sentencesLength = sentences.length;\n\n\t\t\tfor (int i=0; i<sentencesLength; i++) {\n\t\t\t\t\n\t\t\t\tlowerCaseSentence = sentences[i].toLowerCase();\n\t\t\t\tsentenceLength=sentences[i].length();\n\t\t\t\tif (sentenceLength < 20 || sentenceLength > 250) {\n\t\t\t\t\tfor (int j=0; j<qTermsLength; j++) {\n\t\t\t\t\t\tif (lowerCaseSentence.indexOf(qTerms[j])>=0) {\n\t\t\t\t\t\t\tsentenceScores[i]+=1.0d + sentenceLength / (20.0d + sentenceLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tfor (int j=0; j<qTermsLength; j++) {\n\t\t\t\t\t\tif (lowerCaseSentence.indexOf(qTerms[j])>=0) {\n\t\t\t\t\t\t\tsentenceScores[i]+=qTerms[j].length() + sentenceLength / (1.0d + sentenceLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t//do your best to get at least a second sentence for the snippet, \n\t\t\t\t//after having found the first one\n\t\t\t\tif (frsSentence > -1 && sndSentence == -1 && sentenceLength > 5) {\n\t\t\t\t\tsndSentence = i;\n\t\t\t\t}\n\n\t\t\t\t//do your best to get at least one sentence for the snippet\n\t\t\t\tif (frsSentence == -1 && sentenceLength > 5) { \n\t\t\t\t\tfrsSentence = i;\n\t\t\t\t}\n\n\t\t\t\tif (max2Score < sentenceScores[i]) {\n\t\t\t\t\tmax2Score = sentenceScores[i];\n\t\t\t\t\ttop2Sentence = i;\n\t\t\t\t\t//logger.debug(\"top 2 sentence is \" + i);\n\t\t\t\t\tif (max2Score > max1Score) {\n\t\t\t\t\t\ttmpScore = max1Score; max1Score = max2Score; max2Score = tmpScore;\n\t\t\t\t\t\ttmpSentence = top1Sentence; top1Sentence = top2Sentence; top2Sentence = tmpSentence;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tint lastIndexOfSpace = -1;\n\t\t\tString sentence=\"\";\n\t\t\tString secondSentence=\"\";\n\t\t\tString snippet = \"\";\n\t\t\tif (max1Score == -1) {\n\t\t\t\tif (frsSentence>=0) {\n\t\t\t\t\tsentence = sentences[frsSentence];\n\t\t\t\t\tif (sentence.length() > 100) {\n\t\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 100);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (sndSentence>=0) {\n\t\t\t\t\tsecondSentence = sentences[sndSentence];\n\t\t\t\t\tif (secondSentence.length() > 100) {\n\t\t\t\t\t\tlastIndexOfSpace = secondSentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\t\tsecondSentence = secondSentence.substring(0, lastIndexOfSpace>0 ? lastIndexOfSpace : 100);\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 (frsSentence >=0 && sndSentence >= 0) \n\t\t\t\t\tsnippet = sentence.trim() + \"...\" + secondSentence.trim();\n\t\t\t\telse if (frsSentence >= 0 && sndSentence<0) \n\t\t\t\t\tsnippet = sentence.trim();\n\t\t\t\t\n\t\t\t} else if (sentences[top1Sentence].length()<100 && top1Sentence!=top2Sentence) {\n\t\t\t\tsentence = sentences[top1Sentence];\n\t\t\t\tif (sentence.length() > 100) {\n\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 100);\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\tsecondSentence = sentences[top2Sentence];\n\t\t\t\tif (secondSentence.length() > 100) {\n\t\t\t\t\tlastIndexOfSpace = secondSentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\tsecondSentence = secondSentence.substring(0, lastIndexOfSpace>0 ? lastIndexOfSpace : 100);\n\t\t\t\t}\n\t\t\t\tsnippet = sentence.trim() + \"...\" + secondSentence.trim();\n\t\t\t} else {\n\t\t\t\tsentence = sentences[top1Sentence];\n\t\t\t\tif (sentence.length()>200) {\n\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 200).lastIndexOf(\" \");\n\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 200);\n\t\t\t\t}\n\t\t\t\tsnippet = sentence.trim();\n\t\t\t}\n\t\t\t\n\t\t\t//checking and removing any control characters\n\t\t\tcontrolNonVisibleCharactersMatcher.reset(snippet);\n\t\t\tsnippet = controlNonVisibleCharactersMatcher.replaceAll(\"\");\n\t\t\t\n\t\t\t//String escapedSnippet = StringEscapeUtils.escapeHtml(snippet);\n\t\t\t//if (highlightQueryTerms)\n\t\t\t//\tescapedSnippet = highlight.matcher(escapedSnippet).replaceAll(\"$1<b>$2</b>$3\");\n\t\t\tif (highlightQueryTerms)\n\t\t\t\tsnippet = highlight.matcher(snippet).replaceAll(\"$1<b>$2</b>$3\");\n\t\t\t//else \n\t\t\t//\tsnippet = StringEscapeUtils.escapeHtml(snippet);\n\t\t\t\n\t\t\t//change by Vassilis, 20/09/2006\n\t\t\t//disabling the xml escaping in order to move the data into ![CDATA[ ]]\n\t\t\t//the code was:\n\t\t\t//rs.addMetaItem(\"snippet\", DocAtNumber, StringEscapeUtils.escapeXml(snippet));\n\t\t\t//and now it is:\n\t\t\t//snippet.replaceAll(\"[^\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]\",\"\");\n\t\t\trs.addMetaItem(\"snippet\", DocAtNumber, snippet);\n\t\t\t\n\t\t}\n\t\tif (show_title)\n\t\t{\n\t\t\tString title = metadata[2];\n\t\t\t\n\t\t\t//checking and removing any control characters\n\t\t\tcontrolNonVisibleCharactersMatcher.reset(title);\n\t\t\ttitle = controlNonVisibleCharactersMatcher.replaceAll(\"\");\n\t\t\ttitle = (highlightQueryTerms)\n\t\t\t\t ? highlight.matcher(metadata[2]).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t\t : metadata[2];\n\t\t\t\n\t\t\t\n\t\t\t//String escapedTitle = StringEscapeUtils.escapeHtml(metadata[2]);\n\t\t\t//String title = (highlightQueryTerms)\n\t\t\t//\t\t\t ? highlight.matcher(escapedTitle).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t//\t\t\t : escapedTitle;\n\t\t\t//String title = (highlightQueryTerms) \n\t\t\t//\t\t? highlight.matcher(metadata[2]).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t//\t\t: metadata[2];\n\n\t\t\t//change by Vassilis, 20/09/2006\n\t\t\t//disabling the xml escaping in order to move the data into ![CDATA[ ]]\n\t\t\t//the code was:\n\t\t\t//rs.addMetaItem(\"title\", DocAtNumber, StringEscapeUtils.escapeXml(title));\n\t\t\t//and now is:\n\t\t\t//title.replaceAll(\"[^\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]\",\"\");\n\t\t\trs.addMetaItem(\"title\", DocAtNumber, title);\n\t\t\t\n\t\t}\n\t\tif (!show_docid_early && show_docid)\n\t\t{\n\t\t\trs.addMetaItem(\"docid\", DocAtNumber, docIndex.getDocumentNumber(DocNo));\n\t\t}\n\t\tif (!show_url_early && show_url)\n\t\t{\n\n\t\t\trs.addMetaItem(\"url\", DocAtNumber, StringEscapeUtils.escapeXml(metadata[0]));\n\t\t}\n\t\t\n\t\treturn FILTER_OK;\n\t}", "public void set_graph() throws ParseException, IOException {\n \tg = new WeightedUndirectedGraph(words.length);\n //g = new WeightedUndirectedGraph(most_important_terms.size());\n \n Directory dir = new SimpleFSDirectory(new File(\".\\\\data\\\\lucene_index_r_r\"));\n Analyzer analyzer = new StandardAnalyzer(LUCENE_41);\n \n // creat a map that stores, for each word (in the cluster), a set of all the documents that contain that word\n HashMap<String,HashSet<Integer>> word_to_docs_map = new HashMap<String,HashSet<Integer>>();\n int n_strings = words.length; \n \n // for each word...\n for (int idx = 0; idx < n_strings; idx++) {\n // query the index with that given word and retrieve all the documents that contains that word\n String query = words[idx]; \n QueryParser parser = new QueryParser(Version.LUCENE_41, \"text\", analyzer); \n Query q = parser.parse(query); \n\n IndexReader reader = DirectoryReader.open(dir);\n IndexSearcher searcher = new IndexSearcher(reader);\n TopDocs docs = searcher.search(q, reader.numDocs());\n ScoreDoc[] hits = docs.scoreDocs;\n \n // update map from word to docs it appears in \n //HashSet<Integer> tmp = null;\n // tmp is the set of all the document ids in which the current word is contained\n HashSet<Integer> tmp = new HashSet<>();\n //word_to_docs_map.put(query, tmp);\n \n // for each document, retrieved from the query\n for(Integer i=0;i<hits.length;i++) {\n Integer docId = hits[i].doc;\n // tmp = word_to_docs_map.get(query); \n // if the document is a document written by an user of interest \n if(indices.contains(docId)) {\n tmp.add(docId);\n }\n //word_to_docs_map.put(query, tmp); \n }\n word_to_docs_map.put(query, tmp);\n\t }\n\t \n\t // add edges: iterate over possible term pairs ...\n\t for(int idx_1 = 0; idx_1 < n_strings - 1; idx_1++) {\n\t \n\t for(int idx_2 = idx_1 + 1 ; idx_2 < n_strings ; idx_2 ++ ) {\n\t \n\t // extract document sets associated with the considered terms \n\t HashSet<Integer> set_a = word_to_docs_map.get(words[idx_1]); \n\t HashSet<Integer> set_b = word_to_docs_map.get(words[idx_2]); \n\t \n\t // compute set intersection \n\t int n = intersectionSize(set_a, set_b);\n\t \n\t // if the terms appear in at least one common document\n\t if(n>0) {\n\t // add edge \n\t g.testAndAdd(idx_1, idx_2 , n); \n\t }\n\t } \n\t }\n\t}", "protected final void searchForText() {\n Logger.debug(\" - search for text\");\n final String searchText = theSearchEdit.getText().toString();\n\n MultiDaoSearchTask task = new MultiDaoSearchTask() {\n @Override\n protected void onSearchCompleted(List<Object> results) {\n adapter.setData(results);\n }\n\n @Override\n protected int getMinSearchTextLength() {\n return 0;\n }\n };\n task.readDaos.add(crDao);\n task.readDaos.add(monsterDao);\n task.readDaos.add(customMonsterDao);\n task.execute(searchText.toUpperCase());\n }", "@Override\r\n\tpublic Set<Article> search(String keyworkds) {\n\t\treturn null;\r\n\t}", "protected Query newTermQuery(Term term, float boost) {\n Query q = new TermQuery(term);\n if (boost == DEFAULT_BOOST) {\n return q;\n }\n return new BoostQuery(q, boost);\n }", "public abstract Search defaultSearch(StringBuilder sb);", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n // Item searched\n String term = request.getParameter(\"term\");\n int type, pricefilter, order;\n try {\n // 0 Restaurant, 1 City, 2 Region\n type = Integer.parseInt(request.getParameter(\"type\"));\n // 0 All, 1 €, 2 €€, 3 €€€\n pricefilter = Integer.parseInt(request.getParameter(\"pricefilter\"));\n // 1 Raking, 2 Alphabetical, 3 Price\n order = Integer.parseInt(request.getParameter(\"order\"));\n } catch (NumberFormatException e){\n response.sendRedirect(\"index.jsp\");\n return;\n }\n\n // If null is searched, redirects\n if(term == null){\n response.sendRedirect(\"index.jsp\");\n return;\n }\n\n // Term searched must be at least 3 characters long\n if(term.length() < 3){\n // Input too short\n response.sendRedirect(\"index.jsp?alert=1\");\n return;\n }\n\n // Character which must not be searched\n if(term.toLowerCase().contains(\"%\") || term.toLowerCase().contains(\"[\") || term.toLowerCase().contains(\"]\") ||\n term.toLowerCase().contains(\"^\")){\n response.sendRedirect(\"index.jsp\");\n return;\n }\n\n // List of results depending on the filtering\n ArrayList<SearchResult> results = null;\n switch (type){\n case 0:\n results = dbmanager.getRestaurants(term, pricefilter, order);\n break;\n case 1:\n results = dbmanager.getRestaurantsByCity(term, pricefilter, order);\n break;\n case 2:\n results = dbmanager.getRestaurantsByRegion(term, pricefilter, order);\n break;\n default:\n }\n\n if(results == null){\n response.sendRedirect(\"index.jsp\");\n }else{\n request.setAttribute(\"results\", results);\n request.setAttribute(\"type\", type);\n request.setAttribute(\"term\", term);\n request.setAttribute(\"pricefilter\", pricefilter);\n request.setAttribute(\"order\", order);\n getServletContext().getRequestDispatcher(\"/searchResults.jsp\").forward(request, response);\n }\n\n }", "@Override\n\tpublic NodeIterator search(String queryString) throws Exception {\n\t\treturn null;\n\t}", "public SuggestedTerm(String term, int editDistance){\n this.term = term;\n this.editDistance = editDistance;\n }", "public Vector mapTerm(String term) throws TermNotFoundException {\n int i = termIndex.get(term);\n\n if (i == -1) {\n throw new TermNotFoundException(term);\n }\n\n return new DenseVector(Uk[i]);\n }", "private void search()\n {\n JTextField searchField = (currentSearchView.equals(SEARCH_PANE_VIEW))? searchBar : resultsSearchBar;\n String searchTerm = searchField.getText();\n \n showTransition(2000);\n \n currentPage = 1;\n showResultsView(true);\n paginate(1, getResultsPerPage());\n\n if(searchWeb) showResultsTableView(WEB_RESULTS_PANE);\n else showResultsTableView(IMAGE_RESULTS_PANE);\n\n \n showSearchView(RESULTS_PANE_VIEW);\n resultsSearchBar.setText(searchTerm);\n }", "public List<TermSpanRecord> getResults()\n {\n String whereClause = \"owner = ?\";\n List<TermSpanRecord> results = TermSpanRecord.find(TermSpanRecord.class, whereClause, new String[]{String.valueOf(getId())});\n return results;\n }", "private static void RankedQueryMode(DiskIndexWriter diskWriter, DiskPositionalIndex disk_posIndex) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {\n\n if (query.equals(\"q\")) {\n\n System.exit(0);\n }\n\n List<String> word = new ArrayList();\n String[] query_array = query.split(\"\\\\s+\");\n TokenProcessor processor = new NewTokenProcessor();\n\n for (int i = 0; i < query_array.length; i++) {\n word.add(processor.processToken(query_array[i]).get(0));\n }\n\n StrategyFactory sf = new StrategyFactory();\n StrategyInterface strategy = sf.execute(rankedOption);\n\n //maps postings to accumulator value\n HashMap<Integer, Doc_accum> postingMap = new HashMap<Integer, Doc_accum>();\n\n PriorityQueue<Doc_accum> queue = new PriorityQueue<>(Collections.reverseOrder());\n\n List<Posting> postings = new ArrayList<>();\n List<Doc_accum> results = new ArrayList<>();\n\n for (String term : word) {\n\n postings = disk_posIndex.getPosting_noPos(term);\n for (Posting p : postings) { //for each document in the postings list\n double t_fd = p.getT_fd();\n double d_ft = p.getD_ft();\n double w_qt = strategy.calculate_wqt(N, d_ft);\n double accum = 0;\n double w_dt = strategy.get_wdt(t_fd, disk_posIndex, p.getDocumentId());\n\n //pairs (Ranked_posting, accumulator factor)\n if (postingMap.containsKey(p.getDocumentId())) {\n accum = postingMap.get(p.getDocumentId()).getAccumulator();\n accum += (w_qt * w_dt);\n postingMap.replace(p.getDocumentId(), new Doc_accum(p, accum)); //replaces old accum value\n\n } else {\n accum += (w_qt * w_dt);\n postingMap.put(p.getDocumentId(), new Doc_accum(p, accum));\n }\n }\n\n }\n\n for (Integer p : postingMap.keySet()) {\n Doc_accum doc_temp = postingMap.get(p);\n double accum = doc_temp.getAccumulator(); //gets accum associated with doc\n\n if (accum > 0) {\n //search for each p's Ld factor in docWeights.bin\n double l_d = strategy.calculate_Ld(disk_posIndex, doc_temp.getPosting().getDocumentId());\n\n accum /= l_d;\n doc_temp.setAccumulator(accum);\n }\n\n queue.add(postingMap.get(p));\n\n }\n\n //returns top K=10 results \n int topK = 50;\n\n while ((results.size() < topK) && queue.size() > 0) {\n\n results.add(queue.poll()); //gets the posting acc pair and returns only posting\n\n }\n\n display_RankedResults(results);\n\n }", "List<ShipmentInfoPODDTO> search(String query);", "@Override\n public SearchResult search_item(String keyword, int page, int rows , int search_type) throws Exception{\n return null;\n }", "private List<SearchWord> getSearchWords(Long lastUpdateTime) {\n return new ArrayList<>();\n }", "@Test\n public void term() throws AtlasBaseException {\n SearchParameters params = new SearchParameters();\n params.setTermName(SALES_TERM+\"@\"+SALES_GLOSSARY);\n\n List<AtlasEntityHeader> entityHeaders = discoveryService.searchWithParameters(params).getEntities();\n\n Assert.assertTrue(CollectionUtils.isNotEmpty(entityHeaders));\n assertEquals(entityHeaders.size(), 10);\n }", "public void SearchTutor() {\n\t\t\n\t}", "public String search() {\n return \"manage\";\n }", "public T caseMOMoTSearch(MOMoTSearch object)\r\n {\r\n return null;\r\n }", "@Override\n\tpublic List<BoardVO> admin_search(String type, String keyword) {\n\t\treturn null;\n\t}", "private void searchFunction() {\n\t\t\r\n\t}", "@Override\n\tpublic List<T> searchInfo(String flag, String token) {\n\t\treturn trendsDao.searchInfo(flag, token);\n\t}" ]
[ "0.5979783", "0.59439623", "0.5828963", "0.5720514", "0.5714142", "0.56416255", "0.563343", "0.5438755", "0.5398442", "0.53896147", "0.5354768", "0.5341725", "0.531625", "0.5312132", "0.53009015", "0.5274076", "0.5270938", "0.52231854", "0.5207723", "0.5195788", "0.51900214", "0.517766", "0.5164126", "0.5151208", "0.51464766", "0.5142497", "0.5137106", "0.51017445", "0.5099717", "0.50917554", "0.5079044", "0.5075073", "0.5054392", "0.5036259", "0.50294185", "0.5025743", "0.50068676", "0.50068676", "0.5006172", "0.5000156", "0.49979353", "0.49956673", "0.4993676", "0.49903253", "0.49836314", "0.49783412", "0.49492773", "0.49317592", "0.49252412", "0.49241686", "0.49234182", "0.4918374", "0.49110228", "0.49009204", "0.4898666", "0.4888007", "0.48824668", "0.48801196", "0.48797354", "0.4878633", "0.48693866", "0.4867728", "0.4862818", "0.48504704", "0.48445645", "0.48416302", "0.48408225", "0.48406625", "0.48364678", "0.48089686", "0.48073113", "0.4793018", "0.4792933", "0.47901827", "0.47889656", "0.4785059", "0.47815242", "0.47809443", "0.47706783", "0.4764043", "0.4758914", "0.4758263", "0.4756697", "0.47483584", "0.47413394", "0.47406664", "0.47361144", "0.47340208", "0.47337246", "0.47324923", "0.47299927", "0.47282842", "0.4728135", "0.47242323", "0.47198763", "0.47167513", "0.4715453", "0.47089347", "0.4707816", "0.47020838" ]
0.5259476
17
QUERIES MANAGEMENT Searches the index for postings matching the query.
public PostingsList search( Query query, int queryType, int rankingType, int structureType ) { double idf_threshold = new Double(0); double index_elimination = new Double(0.008); // System.err.println(pageRank[docNumber.get("121")]); if (query.size()>0){ switch (queryType){ case Index.INTERSECTION_QUERY: System.err.println("Intersection query"); return intersect(query); case Index.PHRASE_QUERY: System.err.println("Phrase query"); return phrase_query(query); case Index.RANKED_QUERY: System.err.println("Ranked query"); switch(rankingType){ case Index.TF_IDF: return ranked_query(query, 1, idf_threshold); case Index.PAGERANK: return ranked_query(query, 0, idf_threshold);//ranked_query(query, 0, idf_threshold);//ranked_query2(query, 0); case Index.COMBINATION: return ranked_query(query, index_elimination, idf_threshold); } default: System.out.println("not valid query"); return null; } } else // Query was empty return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void queryPosts() {\n ParseQuery<OutfitPost> query = ParseQuery.getQuery(OutfitPost.class);\n // only include data referred by user key\n query.include(OutfitPost.KEY_USER);\n query.whereEqualTo(OutfitPost.KEY_USER, ParseUser.getCurrentUser());\n // limit query to latest 20 items\n query.setLimit(20);\n // order posts by creation date (newest first)\n query.addDescendingOrder(OutfitPost.KEY_CREATED_KEY);\n // start an asynchronous call for posts\n query.findInBackground(new FindCallback<OutfitPost>() {\n @Override\n public void done(List<OutfitPost> posts, ParseException e) {\n // check for errors\n if (e != null) {\n Log.e(TAG, \"Issue with getting posts\", e);\n return;\n }\n // Save oldest post in query for loading more posts\n if (posts.size() > 0) {\n oldestPost = posts.get(posts.size() - 1).getCreatedAt();\n }\n // update adapter with posts list\n adapter.clear();\n adapter.addAll(posts);\n }\n });\n }", "private void termQuerySearch(String[] terms) {\n for (String term : terms) {\n LinkedList<TermPositions> postingLists = indexMap.get(analyzeTerm(term));\n if (postingLists != null) {\n for (TermPositions matches : postingLists) {\n double score = (double) 1 + Math.log((double) matches.getPositionList().size()) *\n Math.log((double) N / (double) postingLists.size());\n resultsCollector.add(new DocCollector(matches.getDocId(), score));\n }\n }\n }\n }", "CampusSearchQuery generateQuery();", "WorldUps.UQuery getQueries(int index);", "@Override\n public boolean onQueryTextSubmit(String query) {\n prepareBooks(engine.search(query.toLowerCase(),filter));\n return false;\n }", "public PostingsList ranked_query(Query query, double w, double idf_threshold){\n long startTime = System.nanoTime();\n PostingsList result = new PostingsList();\n\n // Obtain union of terms above idf threshold if indexElimination is true\n // (Set idf_threshold to zero to disable this feature)\n Set<String> termsToConsider = this.queryTermsConsidered(query, idf_threshold);\n result = this.union_query(query, termsToConsider);\n //System.err.println(\"Size of result is \" + result.size());\n\n long estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Union took: \" + estimatedTime);\n\n\n /*\n * 2) Iterate over PostingsEntries and build the solution\n */\n startTime = System.nanoTime();\n // Required when iterating over a PostingsList\n PostingsEntry postEnt = new PostingsEntry();\n // Number of documents in the collection\n double nDocs = this.docIDs.size();\n // Weight of a query vector coefficient\n double w_query_term;\n // Document tf-idf variables\n double termFrequency_doc, documentFrequency_doc, w_doc_term;\n\n for(String term : termsToConsider){\n // Obtain idf of the term\n documentFrequency_doc = Math.log(nDocs/new Double(this.idfMap.get(term)));\n\n // Obtain weight of the term\n w_query_term = query.weights.get(term);\n // Iterate over all documents containing the term and update the score(q,d)\n Iterator<PostingsEntry> it_d = result.iterator();\n while(it_d.hasNext()){\n postEnt = it_d.next();\n if (this.tfMap.get(postEnt.docID).containsKey(term)){\n termFrequency_doc = this.tfMap.get(postEnt.docID).get(term);\n w_doc_term = documentFrequency_doc*termFrequency_doc;\n postEnt.score += w_query_term*w_doc_term;\n }\n }\n }\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Building solution took: \" + estimatedTime);\n\n /*\n * 3) Normalize the scores\n */\n startTime = System.nanoTime();\n Iterator<PostingsEntry> it = result.iterator();\n while(it.hasNext()){\n postEnt = it.next();\n postEnt.score /= (new Double(this.docLengths.get(\"\"+postEnt.docID)));//(Math.sqrt(postEnt.norm2));\n postEnt.score = w * postEnt.score + (1-w) * quality(postEnt.docID);\n }\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Normalizing took: \" + estimatedTime);\n\n /*\n * 4) Sort the resulting solution\n */\n startTime = System.nanoTime();\n result.sort();\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Sorting took: \" + estimatedTime);\n\n return result;\n }", "public List<Post> search(PostCriteria criteria, int page, int size);", "public void search(Indexer indexer, CityIndexer cityIndexer, Ranker ranker, String query, boolean withSemantic, ArrayList<String> chosenCities, ObservableList<String> citiesByTag, boolean withStemming, String saveInPath, String queryId, String queryDescription) {\n String[] originalQueryTerms = query.split(\" \");\n String originQuery = query;\n docsResults = new HashMap<>();\n parser = new Parse(withStemming, saveInPath, saveInPath);\n HashSet<String> docsOfChosenCities = new HashSet<>();\n query = \"\" + query + queryDescription;\n HashMap<String, Integer> queryTerms = parser.parseQuery(query);\n HashMap<String, ArrayList<Integer>> dictionary = indexer.getDictionary();\n if (!withStemming){\n setDocsInfo(saveInPath + \"\\\\docsInformation.txt\");\n }\n else{\n setDocsInfo(saveInPath + \"\\\\docsInformation_stemming.txt\");\n }\n\n\n //add semantic words of each term in query to 'queryTerms'\n if(withSemantic) {\n HashMap<String,ArrayList<String>> semanticWords = ws.connectToApi(originQuery);\n }\n\n //give an ID to query if it's a regular query (not queries file)\n if(queryId.equals(\"\")){\n queryId = \"\" + Searcher.queryID;\n Searcher.queryID++;\n }\n\n String postingDir;\n if (!withStemming) {\n postingDir = \"\\\\indexResults\\\\postingFiles\";\n } else {\n postingDir = \"\\\\indexResults\\\\postingFiles_Stemming\";\n }\n int pointer = 0;\n\n //find docs that contain the terms in the query in their text\n HashMap<String, Integer> queryTermsIgnoreCase = new HashMap<>();\n for (String term : queryTerms.keySet()) {\n String originTerm = term;\n if (!dictionary.containsKey(term.toUpperCase()) && !dictionary.containsKey(term.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(term.toLowerCase())){\n term = term.toLowerCase();\n }\n else {\n term = term.toUpperCase();\n }\n queryTermsIgnoreCase.put(term,queryTerms.get(originTerm));\n pointer = dictionary.get(term).get(2);\n String chunk = (\"\" + term.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsResults'\n if(line != null) {\n findDocsFromLine(line, term);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their text\n for (String cityTerm : chosenCities) {\n if (!dictionary.containsKey(cityTerm) && !dictionary.containsKey(cityTerm.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(cityTerm.toLowerCase())){\n cityTerm = cityTerm.toLowerCase();\n }\n pointer = dictionary.get(cityTerm).get(2);\n // char chunk = indexer.classifyToPosting(term).charAt(0);\n String chunk = (\"\" + cityTerm.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(0, line.indexOf(\"[\") - 1); //get 'docsListStr'\n String[] docsArr = docs.split(\";\");\n for (String docInfo : docsArr) {\n String doc = docInfo.substring(0, docInfo.indexOf(\": \"));\n while(doc.charAt(0) == ' '){\n doc = doc.substring(1);\n }\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their city tag\n if(!chosenCities.isEmpty()){\n for (String cityDicRec: chosenCities) {\n //get pointer to posting from cityDictionary\n try {\n pointer = cityIndexer.getCitiesDictionary().get(cityDicRec);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + \"\\\\cityIndexResults\" + \"\\\\posting_city\" + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(line.indexOf(\"[\") + 1, line.indexOf(\"]\")); //get 'docsListStr'\n String[] docsArr = docs.split(\"; \");\n for (String doc : docsArr) {\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n\n ranker.rank(docsResults, docsOfChosenCities, queryTermsIgnoreCase, dictionary, docsInfo,entities, queryId);\n }", "private static void RankedQueryMode(DiskIndexWriter diskWriter, DiskPositionalIndex disk_posIndex) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {\n\n if (query.equals(\"q\")) {\n\n System.exit(0);\n }\n\n List<String> word = new ArrayList();\n String[] query_array = query.split(\"\\\\s+\");\n TokenProcessor processor = new NewTokenProcessor();\n\n for (int i = 0; i < query_array.length; i++) {\n word.add(processor.processToken(query_array[i]).get(0));\n }\n\n StrategyFactory sf = new StrategyFactory();\n StrategyInterface strategy = sf.execute(rankedOption);\n\n //maps postings to accumulator value\n HashMap<Integer, Doc_accum> postingMap = new HashMap<Integer, Doc_accum>();\n\n PriorityQueue<Doc_accum> queue = new PriorityQueue<>(Collections.reverseOrder());\n\n List<Posting> postings = new ArrayList<>();\n List<Doc_accum> results = new ArrayList<>();\n\n for (String term : word) {\n\n postings = disk_posIndex.getPosting_noPos(term);\n for (Posting p : postings) { //for each document in the postings list\n double t_fd = p.getT_fd();\n double d_ft = p.getD_ft();\n double w_qt = strategy.calculate_wqt(N, d_ft);\n double accum = 0;\n double w_dt = strategy.get_wdt(t_fd, disk_posIndex, p.getDocumentId());\n\n //pairs (Ranked_posting, accumulator factor)\n if (postingMap.containsKey(p.getDocumentId())) {\n accum = postingMap.get(p.getDocumentId()).getAccumulator();\n accum += (w_qt * w_dt);\n postingMap.replace(p.getDocumentId(), new Doc_accum(p, accum)); //replaces old accum value\n\n } else {\n accum += (w_qt * w_dt);\n postingMap.put(p.getDocumentId(), new Doc_accum(p, accum));\n }\n }\n\n }\n\n for (Integer p : postingMap.keySet()) {\n Doc_accum doc_temp = postingMap.get(p);\n double accum = doc_temp.getAccumulator(); //gets accum associated with doc\n\n if (accum > 0) {\n //search for each p's Ld factor in docWeights.bin\n double l_d = strategy.calculate_Ld(disk_posIndex, doc_temp.getPosting().getDocumentId());\n\n accum /= l_d;\n doc_temp.setAccumulator(accum);\n }\n\n queue.add(postingMap.get(p));\n\n }\n\n //returns top K=10 results \n int topK = 50;\n\n while ((results.size() < topK) && queue.size() > 0) {\n\n results.add(queue.poll()); //gets the posting acc pair and returns only posting\n\n }\n\n display_RankedResults(results);\n\n }", "public interface SearchQuerySet extends QuerySet\n{\n\n // for AbstractSearch\n public static final int STAT_MODELS = 1;\n public static final int STAT_CLUSTERS = 2;\n public static final int STAT_GENOMES = 4;\n public static final int STAT_MODEL_CLUSTERS = 8;\n\n public String getStatsById(Collection data);\n public String getStatsByQuery(String query);\n public String getStatsById(Collection data,int stats);\n public String getStatsByQuery(String query,int stats);\n \n // for BlastSearch\n public String getBlastSearchQuery(Collection dbNames, Collection keys, KeyTypeUser.KeyType keyType);\n \n //for ClusterIDSearch\n public String getClusterIDSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for ClusterNameSearch\n public String getClusterNameSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for DescriptionSearch\n public String getDescriptionSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for GoSearch \n public String getGoSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for GoTextSearch\n public String getGoTextSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for IdSearch\n public String getIdSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for QueryCompSearch\n public String getQueryCompSearchQuery(String comp_id, String status, KeyTypeUser.KeyType keyType);\n \n // for QuerySearch\n public String getQuerySearchQuery(String queries_id, KeyTypeUser.KeyType keyType); \n \n // for SeqModelSearch\n public String getSeqModelSearchQuery(Collection model_ids, KeyTypeUser.KeyType keyType);\n \n // for UnknowclusterIdSearch\n public String getUnknownClusterIdSearchQuery(int cluster_id, KeyTypeUser.KeyType keyType);\n \n // for ProbeSetSearch\n public String getProbeSetSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for ProbeSetKeySearch\n public String getProbeSetKeySearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for QueryTestSearch\n public String getQueryTestSearchQuery(String query_id, String version, String genome_id);\n \n // for QueryStatsSearch\n public String getQueryStatsSearchQuery(List query_ids,List DBs);\n \n // for PskClusterSearch\n public String getPskClusterSearchQuery(int cluster_id,KeyTypeUser.KeyType keyType);\n \n // for ClusterCorrSearch\n public String getClusterCorrSearchQuery(int cluster_id, int psk_id, KeyTypeUser.KeyType keyType);\n \n // for UnknownGenesSearch\n public String getUnknownGenesSearchQuery(Collection sources, KeyTypeUser.KeyType keyType);\n \n}", "public Query( String queryString ) {\r\n\tStringTokenizer tok = new StringTokenizer( queryString );\r\n\twhile ( tok.hasMoreTokens() ) {\r\n\t terms.add( tok.nextToken() );\r\n\t weights.add( new Double(1) );\r\n\t} \r\n }", "Query query();", "public PageList query(String squadName, String axiser, String cubers, String followers,\n String investors, String status, Date gmtCreate, Date gmtModify,\n int pageSize, int pageNum) throws DataAccessException;", "public CheckOutQ() {\r\n\t\tq = new LinkedList<Person>();\r\n\t\tmaxQ = 0;\r\n\t}", "public PostingsList phrase_query(Query query){\n\n LinkedList<PostingsList> listQueriedPostings = new LinkedList<PostingsList>();\n // List with postings corresponding to the queries\n for (int i = 0; i<query.size(); i++){\n // If any query has zero matches, return 0 results\n //if(!(new File(\"postings/t\"+hash(query.terms.get(i))+\".json\")).exists()){\n if (!this.index.containsKey(query.terms.get(i))){\n return null;\n }\n // Otherwise store postings in the list\n listQueriedPostings.add(this.getPostings(query.terms.get(i)));\n }\n\n PostingsList result = new PostingsList();\n result = listQueriedPostings.get(0);\n\n // In case only one word is queried\n if (listQueriedPostings.size() == 1){\n return result;\n }\n\n // Apply algorithm as many times as words in the query\n for(int i = 1; i < listQueriedPostings.size(); i++){\n result = phrase_query(result, listQueriedPostings.get(i));\n if (result.isEmpty()){\n return null;\n }\n }\n return result;\n }", "private static void BooleanQueryMode(DiskIndexWriter diskWriter, DiskPositionalIndex disk_posIndex) throws ClassNotFoundException, InstantiationException, IllegalAccessException {\n if (!specialQueries(query)) {\n //newCorpus = false; \n BooleanQueryParser bParser = new BooleanQueryParser();\n QueryComponent qComponent = bParser.parseQuery(query);\n postings = qComponent.getPostings(disk_posIndex);\n\n if (postings.isEmpty()) {\n GUI.JListModel.clear();\n GUI.ResultsLabel.setText(\"\");\n clickList = false;\n\n String notFound = \"Your search '\" + query + \"' is not found in any documents\";\n GUI.ResultsLabel.setText(notFound);\n\n } else {\n clickList = true;\n\n //clears list and repopulates it \n String docInfo;\n\n GUI.JListModel.clear();\n GUI.ResultsLabel.setText(\"\");\n\n for (Posting p : postings) {\n if (queryMode) {\n corpus.getDocument(p.getDocumentId()).getContent();\n }\n docInfo = corpus.getDocument(p.getDocumentId()).getTitle();\n //docInfo = corpus.getDocument(p.getDocumentId()).getFileName().toString();\n GUI.JListModel.addElement(docInfo);\n\n }\n GUI.ResultsLabel.setText(\"Total Documents Found: \" + postings.size());\n }\n\n }\n\n //GUI.SearchBarTextField.setText(\"Enter a new search or 'q' to exit\");\n GUI.SearchBarTextField.selectAll();\n\n }", "public void search() {\n String q = this.query.getText();\n String cat = this.category.getValue();\n if(cat.equals(\"Book\")) {\n searchBook(q);\n } else {\n searchCharacter(q);\n }\n }", "private void queryIndex() {\n if (predicate == TruePredicate.INSTANCE) {\n return;\n }\n\n // get indexes\n MapService mapService = nodeEngine.getService(SERVICE_NAME);\n MapServiceContext mapServiceContext = mapService.getMapServiceContext();\n Indexes indexes = mapServiceContext.getMapContainer(name).getIndexes();\n // optimize predicate\n QueryOptimizer queryOptimizer = mapServiceContext.getQueryOptimizer();\n predicate = queryOptimizer.optimize(predicate, indexes);\n\n Set<QueryableEntry> querySet = indexes.query(predicate);\n if (querySet == null) {\n return;\n }\n\n List<Data> keys = null;\n for (QueryableEntry e : querySet) {\n if (keys == null) {\n keys = new ArrayList<Data>(querySet.size());\n }\n keys.add(e.getKeyData());\n }\n\n hasIndex = true;\n keySet = keys == null ? Collections.<Data>emptySet() : InflatableSet.newBuilder(keys).build();\n }", "private void executeQuery1(PersistenceManager pm) {\n Query query = pm.newQuery(Book.class, \"pages > 300\");\n Collection results = (Collection)query.execute();\n printCollection(\"Books with more than 300 pages:\", results.iterator());\n query.closeAll();\n }", "private void montaQuery(Publicacao object, Query q) {\t\t\n\t}", "protected void queryPosts() {\n ParseQuery<Post> query = ParseQuery.getQuery(Post.class);\n //get all the post objects from the database\n query.include(Post.KEY_USER);\n //set the limit to 20 posts being retrieved\n query.setLimit(POSTS_QUERY_LIMIT);\n\n query.addDescendingOrder(Post.KEY_CREATED_KEY);\n\n query.findInBackground(new FindCallback<Post>() {\n @Override\n public void done(List<Post> posts, ParseException e) {\n // e == null if success\n if (e != null) {\n Log.e(TAG, \"Issue with getting posts\", e);\n return;\n }\n\n for (Post post : posts) {\n Log.i(TAG, \"Post: \" + post.getDescription() + \", username: \" + post.getUser().getUsername());\n }\n adapter.clear();\n allPosts.addAll(posts);\n adapter.notifyDataSetChanged();\n }\n });\n }", "public void testAdvancedQuery() {\n\t\t//manager.advancedQuery(ElasticIndex.analyzed, \"metropolitan areas\", \"sports clubs\");\n\t\t//manager.advancedQuery(ElasticIndex.analyzed, \"\", \"Award\");\n\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"american actor\", \"list of movies starring Sean Connery\");\n//\tmanager.categorySearch(\"Sportspeople\", \"tennis\",ElasticIndex.analyzed,30);\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"Broadway musicals\", \"Grammy Award\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"musical movies\", \"Tony Award\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"Top level football leagues\", \"teams\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"american movies\", \"directed by Woody Allen\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"United states\", \"professional sports teams\");\n\t\t//manager.advancedQuery(\"musical movies\", \"tony award\");\n\t\t//manager.advancedQuery(\"grammy\", \"best album in 2012\"); \n\t\t//manager.advancedQuery(\"american movies\", \"directed by Woody Allen\"); \n\t\t//Canceled manager.advancedQuery(\"tennis\", \"international players\"); \n\t\t// canceled manager.advancedQuery(\"tennis\", \"french open\"); \n\t\t// canceled manager.advancedQuery(\"film movie\", \"1933\"); \n//\t\tmanager.advancedQuery(\"United states\", \"professional sports teams \");\n//\t\t manager.advancedQuery(\"computer games\", \"developed by Ubisoft\");\n//\t\tmanager.advancedQuery(\"movies\", \"academy award nominations\");\n //manager.advancedQuery(\"movies\", \"starring Dustin Hoffman\");\n // manager.advancedQuery(\"movies\", \"best costume design\");\n // manager.advancedQuery(\"concert tours\", \"england\");\n // manager.advancedQuery(\"sport\", \"Francesco\");\n\t\t//System.out.println(\"******* advanced query *******\");\n\t\t//manager.advancedQuery(\"sportspeople\", \"tennis\");\n//\t\tmanager.advancedQuery(ElasticIndex.analyzed, \"Broadway musicals\", \"Grammy Award\");\n //System.out.println(\"*****************************\");\n\n\n\t\t\n\t\t//manager.advancedQuery(\"football\", \"italian championship\");\n\t\t//manager.advancedQuery(\"american basketball\", \"team\");\n\t\t //manager.advancedQuery(\"Goya Award\", \"Winner and nominees from FRA\");\n\t\t//manager.advancedQuery(\"films\", \"american comedy \");\n\t\t//manager.advancedQuery(\"films\", \"american Adventure directed by James P. Hogan\");\n\t\t//manager.advancedQuery(\"NCAA Division\", \"american universities in Arkansas\");\n\t\t//manager.advancedQuery(\"Academy award\", \"winners and nominees in acting in 2011\");\n\t\t//manager.advancedQuery(\"canadian soccer\", \"Alain Rochat position \");\n\n\t}", "public void Query() {\n }", "protected boolean query() {\r\n\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()) + processQueryAuthor(queryBk.getCreator())\r\n\t\t\t\t+ processQueryPublisher(queryBk.getPublisher()));\r\n\t\tSystem.out.println(queryStr);\r\n\t\t// if edition is 'lastest' (coded '0'), no query is performed; and\r\n\t\t// return false.\r\n\t\tif (queryBk.parseEdition() == 0) {\r\n\t\t\treturn false;\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * The following section adds edition info to the query string if edition no. is\r\n\t\t * greater than one. By cataloging practice, for the first edition, probably\r\n\t\t * there is NO input on the associated MARC field. Considering this, edition\r\n\t\t * query string to Primo is NOT added if querying for the first edition or no\r\n\t\t * edition is specified.\r\n\t\t */\r\n\t\tif (queryBk.parseEdition() > 1) {\r\n\t\t\tqueryStr += processQueryEdition(queryBk.parseEdition());\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * Querying the Primo X-service; and invoking the matching processes (all done\r\n\t\t * by remoteQuery()).\r\n\t\t */\r\n\t\tif (strHandle.hasSomething(queryBk.getPublisher())) {\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * For various reasons, there are possibilities that the first query fails while\r\n\t\t * a match should be found. The follow work as remedy queries to ensure the\r\n\t\t * accuracy.\r\n\t\t */\r\n\r\n\t\tif (!match && strHandle.hasSomething(queryBk.getPublisher())) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryPublisher(queryBk.getPublisher()) + processQueryAuthor(queryBk.getCreator()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()) + processQueryAuthor(queryBk.getCreator()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match && strHandle.hasSomething(queryBk.getPublishYear())) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryAuthor(queryBk.getCreator()) + processQueryYear(queryBk.getPublishYear()));\r\n\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryAuthor(queryBk.getCreator()) + processQueryTitleShort(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t// Additional query for Chinese titles\r\n\r\n\t\tif (!match && (CJKStringHandling.isCJKString(queryBk.getTitle())\r\n\t\t\t\t|| CJKStringHandling.isCJKString(queryBk.getCreator())\r\n\t\t\t\t|| CJKStringHandling.isCJKString(queryBk.getPublisher()))) {\r\n\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\r\n\t\t\tif (!match && queryBk.parseEdition() != -1) {\r\n\t\t\t\tqueryStr = new String(\r\n\t\t\t\t\t\tprocessQueryTitle(queryBk.getTitle()) + processQueryEdition2(queryBk.parseEdition()));\r\n\t\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t\tsetBookInfo();\r\n\t\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t} // end if\r\n\r\n\t\t\t\tif (!match && queryBk.parseEdition() != -1) {\r\n\t\t\t\t\tqueryStr = new String(\r\n\t\t\t\t\t\t\tprocessQueryTitle(queryBk.getTitle()) + processQueryEdition3(queryBk.parseEdition()));\r\n\t\t\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\t\t\tmatch = true;\r\n\t\t\t\t\t\tsetBookInfo();\r\n\t\t\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tmatch = false;\r\n\t\t\t\t\t} // end if\r\n\t\t\t\t} // end if\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t// Additional check for ISO Document number in <search> <genernal> PNX\r\n\t\t// tag\r\n\t\tif (!match && !CJKStringHandling.isCJKString(queryBk.getTitle())) {\r\n\t\t\tqueryStr = new String(processQueryTitleISODoc(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t\terrMsg += \"Query: No record found on Primo.\" + Config.QUERY_SETTING;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\t\treturn false;\r\n\t}", "private void queryList (String query) {\n\t\tmemoListAdapter.query(query);\n\t}", "Term getQ();", "private static void prMode(DiskIndexWriter diskWriter, DiskPositionalIndex disk_posIndex) throws ClassNotFoundException, InstantiationException, IllegalAccessException, FileNotFoundException {\n long time = 0;\n GUI.JListModel.clear();\n\n if (query.equals(\"q\")) {\n\n System.exit(0);\n }\n MAP mean_ap = new MAP(path);\n //returns qRel.keyset() i.e. queries \n Set<String> queries = mean_ap.getQueries();\n List<Long> time_per_query = new ArrayList<>();\n //run ranked retrival for each query\n for (String q : queries) {\n time = 0;\n List<String> word = new ArrayList();\n\n query = q;\n long start = System.currentTimeMillis();\n\n String[] query_array = query.split(\"\\\\s+\");\n TokenProcessor processor = new NewTokenProcessor();\n\n for (int i = 0; i < query_array.length; i++) {\n word.add(processor.processToken(query_array[i]).get(0));\n }\n long t1 = System.currentTimeMillis();\n time = t1 - start; //time to parse\n StrategyFactory sf = new StrategyFactory();\n StrategyInterface strategy = sf.execute(rankedOption);\n\n //maps postings to accumulator value\n HashMap<Integer, Doc_accum> postingMap = new HashMap<Integer, Doc_accum>();\n\n PriorityQueue<Doc_accum> queue = new PriorityQueue<>(Collections.reverseOrder());\n\n List<Posting> postings = new ArrayList<>();\n List<Doc_accum> results = new ArrayList<>();\n\n for (String term : word) {\n long t2 = System.currentTimeMillis();\n\n if (term.equals(\"\")) {\n continue;\n } else {\n\n postings = disk_posIndex.getPosting_noPos(term);\n long t3 = System.currentTimeMillis();\n time = time + (t3 - t2);\n\n for (Posting p : postings) { //for each document in the postings list\n double t_fd = p.getT_fd();\n double d_ft = p.getD_ft();\n double w_qt = strategy.calculate_wqt(N, d_ft);\n double accum = 0;\n double w_dt = strategy.get_wdt(t_fd, disk_posIndex, p.getDocumentId());\n\n //pairs (Ranked_posting, accumulator factor)\n if (postingMap.containsKey(p.getDocumentId())) {\n accum = postingMap.get(p.getDocumentId()).getAccumulator();\n accum += (w_qt * w_dt);\n postingMap.replace(p.getDocumentId(), new Doc_accum(p, accum)); //replaces old accum value\n\n } else {\n accum += (w_qt * w_dt);\n postingMap.put(p.getDocumentId(), new Doc_accum(p, accum));\n }\n }\n\n }\n }\n for (Integer p : postingMap.keySet()) {\n Doc_accum doc_temp = postingMap.get(p);\n double accum = doc_temp.getAccumulator(); //gets accum associated with doc\n\n if (accum > 0) {\n //search for each p's Ld factor in docWeights.bin\n double l_d = strategy.calculate_Ld(disk_posIndex, doc_temp.getPosting().getDocumentId());\n\n accum /= l_d;\n doc_temp.setAccumulator(accum);\n }\n\n queue.add(postingMap.get(p));\n\n }\n\n //returns top K=10 results \n int topK = 50;\n\n while ((results.size() < topK) && queue.size() > 0) {\n\n results.add(queue.poll()); //gets the posting acc pair and returns only posting\n\n }\n time_per_query.add(time);\n List<String> filenames = get_RankedResults(results);\n\n mean_ap.add_poseRel(q, filenames);\n\n }\n\n double map_result = mean_ap.mean_ap();\n String mapDisplay = \"Mean average precision: \" + map_result;\n GUI.JListModel.addElement(mapDisplay);\n System.out.println(\"\\n\" + mapDisplay);\n\n double throughput_result = mean_ap.calculate_throughput(time_per_query);\n String throughput_Display = \"Throughput of the system is: \" + throughput_result;\n GUI.JListModel.addElement(throughput_Display);\n System.out.println(throughput_Display);\n\n double mrt_result = mean_ap.calculae_mean_response_time(time_per_query);\n String mrt_Display = \"Mean Response Time of the system is: \" + mrt_result;\n GUI.JListModel.addElement(mrt_Display);\n System.out.println(mrt_Display);\n\n }", "public void run(){\n\t\tif(searchHow==0){\n\t\t\tint isbnCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestIsbn = new SearchRequest(db, searchForThis, isbnCount, db.size());\n\t\t\t\t\tdb.searchByISBN(requestIsbn);\n\t\t\t\t\tisbnCount = requestIsbn.foundPos;\n\t\t\t\t\tif (requestIsbn.foundPos >= 0) {\n\t\t\t\t\t\tisbnCount++;\n\t\t\t\t\t\tString formatThis = \"Matched ISBN at position: \" + requestIsbn.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestIsbn.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==1){\n\t\t\tint titleCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestTitle = new SearchRequest(db, searchForThis, titleCount, db.size());\n\t\t\t\t\tdb.searchByTitle(requestTitle);\n\t\t\t\t\ttitleCount = requestTitle.foundPos;\n\t\t\t\t\tif (requestTitle.foundPos >= 0) {\n\t\t\t\t\t\ttitleCount++;\n\t\t\t\t\t\tString formatThis = \"Matched title at position: \" + requestTitle.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestTitle.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==2){\n\t\t\tint authorCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestAuthor = new SearchRequest(db, searchForThis, authorCount, db.size());\n\t\t\t\t\tdb.searchByAuthor(requestAuthor);\n\t\t\t\t\tauthorCount = requestAuthor.foundPos;\n\t\t\t\t\tif (requestAuthor.foundPos >= 0) {\n\t\t\t\t\t\tauthorCount++;\n\t\t\t\t\t\tString formatThis = \"Matched author at position: \" + requestAuthor.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestAuthor.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==3){\n\t\t\tint pageCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestPage = new SearchRequest(db, searchForThis, pageCount, db.size());\n\t\t\t\t\tdb.searchByNumPages(requestPage);\n\t\t\t\t\tpageCount = requestPage.foundPos;\n\t\t\t\t\tif (requestPage.foundPos >= 0) {\n\t\t\t\t\t\tpageCount++;\n\t\t\t\t\t\tString formatThis = \"Matched pages at position: \" + requestPage.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestPage.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==4){\n\t\t\tint yearCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestYear = new SearchRequest(db, searchForThis, yearCount, db.size());\n\t\t\t\t\tdb.searchByYear(requestYear);\n\t\t\t\t\tyearCount = requestYear.foundPos;\n\t\t\t\t\tif (requestYear.foundPos >= 0) {\n\t\t\t\t\t\tyearCount++;\n\t\t\t\t\t\tString formatThis = \"Matched year at position: \" + requestYear.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestYear.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t}", "@Override\n public boolean onQueryTextSubmit(String query) {\n topStories = false;\n filter.setQuery(query);\n gvResults.clearOnScrollListeners();\n setUpRecycler();\n findViewById(R.id.relativeLayout).setVisibility(View.GONE);\n findViewById(R.id.tvHeading).setVisibility(View.GONE);\n fetchArticles(0,true);\n searchView.clearFocus();\n return true;\n }", "public void query()\n\t{\n\t\tJSONObject queryInfo = new JSONObject();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tqueryInfo.put(\"type\", \"query\");\n\t\t\t\n\t\t\tos.println(queryInfo.toString());\n\t\t\tos.flush();\n\t\t\t\n\t\t\tSystem.out.println(\"send query request : \" + queryInfo.toString());\n\t\t}\n\t\tcatch (JSONException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected void queryPosts()\n {\n ParseQuery<Post> query = ParseQuery.getQuery(Post.class);\n query.include(Post.KEY_USER);\n query.whereEqualTo(Post.KEY_USER, ParseUser.getCurrentUser());\n query.setLimit(20);\n query.addDescendingOrder(Post.KEY_CREATED_AT);\n query.findInBackground(new FindCallback<Post>() {\n @Override\n public void done(List<Post> posts, ParseException e)\n {\n if(e != null)\n {\n Log.e(TAG, \"Issue with getting posts\", e);\n }\n for(Post post : posts)\n {\n Log.i(TAG, \"Post: \" + post.getDescription() + \", username\" + post.getUser().getUsername());\n }\n adapter.clear();\n allPosts.addAll(posts);\n swipeContainer.setRefreshing(false);\n adapter.notifyDataSetChanged();\n\n }\n });\n }", "public void search(IndexShort < O > index, short range, short k)\n throws Exception {\n // assertEquals(index.aDB.count(), index.bDB.count());\n // assertEquals(index.aDB.count(), index.bDB.count());\n // index.stats();\n index.resetStats();\n // it is time to Search\n int querySize = 1000; // amount of elements to read from the query\n String re = null;\n logger.info(\"Matching begins...\");\n File query = new File(testProperties.getProperty(\"test.query.input\"));\n File dbFolder = new File(testProperties.getProperty(\"test.db.path\"));\n BufferedReader r = new BufferedReader(new FileReader(query));\n List < OBPriorityQueueShort < O >> result = new LinkedList < OBPriorityQueueShort < O >>();\n re = r.readLine();\n int i = 0;\n long realIndex = index.databaseSize();\n\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n OBPriorityQueueShort < O > x = new OBPriorityQueueShort < O >(\n k);\n if (i % 100 == 0) {\n logger.info(\"Matching \" + i);\n }\n\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n if(i == 279){\n System.out.println(\"hey\");\n }\n index.searchOB(s, range, x);\n result.add(x);\n i++;\n }\n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n \n logger.info(index.getStats().toString());\n \n int maxQuery = i;\n // logger.info(\"Matching ends... Stats follow:\");\n // index.stats();\n\n // now we compare the results we got with the sequential search\n Iterator < OBPriorityQueueShort < O >> it = result.iterator();\n r.close();\n r = new BufferedReader(new FileReader(query));\n re = r.readLine();\n i = 0;\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n if (i % 300 == 0) {\n logger.info(\"Matching \" + i + \" of \" + maxQuery);\n }\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n OBPriorityQueueShort < O > x2 = new OBPriorityQueueShort < O >(\n k);\n searchSequential(realIndex, s, x2, index, range);\n OBPriorityQueueShort < O > x1 = it.next();\n //assertEquals(\"Error in query line: \" + i + \" slice: \"\n // + line, x2, x1); \n \n assertEquals(\"Error in query line: \" + i + \" \" + index.debug(s) + \"\\n slice: \"\n + line + \" \" + debug(x2,index ) + \"\\n\" + debug(x1,index), x2, x1);\n\n i++;\n }\n \n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n r.close();\n logger.info(\"Finished matching validation.\");\n assertFalse(it.hasNext());\n }", "@Override\n protected void queryPosts() {\n ParseQuery<Post> query = ParseQuery.getQuery(Post.class);\n query.include(Post.KEY_USER);\n query.whereEqualTo(Post.KEY_USER, ParseUser.getCurrentUser());\n Log.d(TAG, \"ParseUser\" + ParseUser.getCurrentUser().toString());\n query.setLimit(20);\n query.addDescendingOrder(Post.KEY_CREATED_AT);\n query.findInBackground(new FindCallback<Post>() {\n @Override\n public void done(List<Post> posts, ParseException e) {\n if (e != null){\n Log.e(TAG, \"Issue with getting posts\", e);\n return;\n }\n for (Post post: posts){\n Log.i(TAG, \"Post: \" + post.getDescription() + \", username: \" + post.getUser().getUsername());\n }\n allPosts.addAll(posts);\n adapter.notifyDataSetChanged();\n }\n });\n }", "private void queryPost() {\n tv_search.setText(\"Recently Added Posts:\");\n ParseQuery<Post> query = ParseQuery.getQuery(Post.class);\n query.include(Post.KEY_USER);\n query.setLimit(15);\n query.addDescendingOrder(Post.KEY_CREATED);\n query.findInBackground(new FindCallback<Post>() {\n @Override\n public void done(List<Post> posts, ParseException e) {\n if(e!= null){\n Log.e(tag, \"Issue with getting post\", e);\n return;\n }\n adaptor.clear();\n adaptor.addAll(posts);\n //allPost.addAll(posts);\n //adaptor.notifyDataSetChanged();\n //swipeRefreshLayout.setRefreshing(false);\n\n //user just created a post\n if (isJustCreatedNewPost == true)\n {\n //reset bool\n isJustCreatedNewPost = false;\n// //subscribe user to their new post channel\n// String postChannel = \"POST_\"+posts.get(0).getObjectId();\n// ParsePush.subscribeInBackground(postChannel);\n\n }\n }\n });\n }", "public Qs() {\n this(\"qs\", null);\n }", "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 static void searchJobs(String searchTerm) {\n\n for (int i = 0; i > PostJob.allJobs.size(); i++) {\n\n\n if (PostJob.allJobs.contains(searchTerm)) {\n int itemIndx = PostJob.allJobs.indexOf(searchTerm);\n String output = PostJob.allJobs.get(itemIndx);\n System.out.print(\"Available jobs within your search terms\" + output);\n\n }\n }\n }", "public void performQuack(){\n qb.quack();\n }", "SearchResponse query(SearchRequest request, Map<SearchParam, String> params);", "List<Revenue> search(String query);", "public static void query(String q) throws TwitterException, SQLException, ClassNotFoundException {\n\n\t\t//the search object returns a list of all the tweets from the query string q\n\t\tSearch newQuery = new Search(q);\n\t\t\n\t\tClass.forName(\"org.h2.Driver\");\n\t\tConnection conn = DriverManager.getConnection(DB, user, pass);\n\t\t\n\t\t//authentication allows a user to have up to 350 requests per hour over the normal 150\n\t\tTwitter a = OAuth.authenticate();\n\n\t\ttry {\n\t\t\tArrayList<Long> sid = new ArrayList<Long>();\n\t\t\tfor (Tweet tweets : newQuery.statusList) {\n\t\t\t\tlong statusID = tweets.getId();\n\t\t\t\t//this checks for redudant statuses then inserts new ones into the DB\n\t\t\t\tif (!(DB_Interface.exist_Status(statusID, conn))) {\n\t\t\t\t\tSystem.out.println(\"Preparin new insert of status \"\n\t\t\t\t\t\t\t+ statusID);\n\t\t\t\t\tsid.add(statusID);\n\t\t\t\t\t\n\t\t\t\t\t/* a.showStatus transforms a query tweet into a normal status this takes up a rate limit\n\t\t\t\t\t * this is a difficult problem to address because scraped tweets and streamed tweets are\n\t\t\t\t\t * formatted as a normal status, but only queried tweets are structured this way\n\t\t\t\t\t */\n\t\t\t\t\tDB_Interface.insertTweet(conn, a.showStatus(statusID));\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Status Already exists!!!!\");\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (JdbcSQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tconn.close();\n\n\t}", "public void performSearch() {\n final String url = String.format(BING_SEARCH_URL, Words.getRandomWord(), Words.getRandomWord());\n\n //open page with custom data\n openWebPage(url, \"Search url: \" + url);\n }", "@Override\r\n public boolean onQueryTextSubmit(String query) {\n searchAdapter.setSearchResults(DataCache.getInstance().getSearchResults(query));\r\n return false;\r\n }", "@Override\n public boolean onQueryTextSubmit(String query) {\n if(!TextUtils.isEmpty(query)){\n //seach\n seachHispost(query);\n }else {\n loadHisPosts();\n }\n return false;\n }", "List<Cemetery> search(String query);", "SearchResponse search(Pageable pageable, QueryBuilder query, Collection<AggregationBuilder> aggregations);", "void runQueries();", "private static void executeQuery4(PersistenceManager pm) {\n Query query = pm.newQuery(Category.class);\n query.declareParameters(\"int length\");\n query.declareVariables(\"Item item\");\n query.setFilter(\n \"elements.contains(item) && item.name.length() <= length\");\n Collection results = (Collection)query.execute(new Integer(10));\n printCollection(\"Categories containing an item with a short name: \",\n results.iterator());\n query.closeAll();\n }", "List<Job> findAllByLocation(String query);", "public IndexSearcher longQueryExpansion(String indexDir, String queriesFile, PrintWriter outputWriter, Debug debug, String similarity, Analyzer analyzer) throws IOException, ParseException {\t\t\n\t\t\n\t\t//Welcome to shortQueries\n\t\tSystem.out.println(\"Set requests to LONG QUERIES EXPANSION\");\n\t\t\n\t\t//Create IndexReader and Searcher\n\t\tIndexReader reader = DirectoryReader.open(FSDirectory.open( new File(indexDir).toPath()));\t\t//Creating an index reader\n\t\tIndexSearcher searcher = new IndexSearcher(reader);\t\t\t\t\t\t\t\t\t\t\t\t//Create an index searcher\n\t\t\n\t\t//Set similarity measure\n\t\tsearcher = new SetSimilarity().SetSimilaritySearcher(searcher, similarity);\n\t\t\n\t\t//Read queries from file\n\t\t\tString[] queries = Search.readQueriesFile(queriesFile);\n\t\t\t\n\t\t\tfor (int i=0; i < queries.length; i++ ){ //for all queries\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t//Parse Multiple fields Query\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tString str = queries[i];\t\t\t\t//take all queries\n\t\t\t\t\tString[] parts = str.split(\"#\", 3);\t\t//split them in three\n\t\t\t\t\t//String num = parts[0];\t\t\t\t\t//part 1 is number\n\t\t\t\t\tString title = parts[1];\t\t\t\t//part 2 is title\n\t\t\t\t\tString desc = parts[2];\t\t\t\t\t//part 3 is description\n\t\t\t\t\tString num = Integer.toString(i + 1);\t//(part 1 is number ) other option for queyrid\n\t\t\t\t\tSystem.out.println(\"Query number: \" + num);\n\t\t\t\t\tSystem.out.println(\"Title of query: \" + title); \n\t\t\t\t\tSystem.out.println(\"Description of query: \" + desc);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Title query\n\t\t\t\t\tQueryParser titleQP = new QueryParser(\"contents\", analyzer);\t\t\t\t//Built QueryParser\n\t\t\t\t\t\n\t\t\t\t\tString newTitle = title.substring(3, title.length());\t//Strip numbers from title\n\t\t\t\t\tQuery titleQuery = titleQP.parse(newTitle); \t\t\t\t\t\t\t\t\t//Parse titles\n\t\t\t\t\t//Desc query\n\t\t\t\t\tQueryParser descQP = new QueryParser (\"contents\", analyzer);\t\t\t\t//Build QueryParser\n\t\t\t\t\tQuery descQuery = descQP.parse(desc);\t\t\t\t\t\t\t\t\t\t//Parse descriptions\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Final Query\n\t\t\t\t\tBuilder booleanQuery = new BooleanQuery.Builder();\n\t\t\t\t\tbooleanQuery.add(titleQuery, BooleanClause.Occur.SHOULD);\n\t\t\t\t\tbooleanQuery.add(descQuery, BooleanClause.Occur.SHOULD);\n\t\t\t\t\tQuery q = booleanQuery.build();\n\t\t\t\t\tSearch.displayQuery(q);\n\t\t\t\t\t\n\t\t\t\t\t//Search\n\t\t\t\t\tTopScoreDocCollector collector = TopScoreDocCollector.create(1000);\t\t\t\t\t\t\t\t//Create a TopScore Collector\n\t\t\t\t\tsearcher.search(q, collector);\t\n\t\t\t\t\t\n\t\t\t\t\t//Print results\n\t\t\t\t\t//displayResults(searcher, collector);\n\t\t\t\t\t\n\t\t\t\t\t//Output results to file\n\t\t\t\t\tSearch.outputResults(searcher, collector, outputWriter, num);\n\t\t\t\t\t\n\t\t\t\t}//end try\n\t\t\t\tcatch (Exception e) {\n\t\t\t\t\tSystem.out.println(\"Parse exception in query #\" + i);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}//end catch\n\t\t\t\n\t\t}//end for\n\t\t\t//Close index reader\n\t\t\toutputWriter.close();\n\t\t\treader.close();\n\t\t\treturn searcher;\n\t\t\t\n\t}", "public void onSearchSubmit(String queryTerm);", "public static void QueryVector() {\n for(Entry<String, List<Double>> entry: wtgMap.entrySet()){\n List<Double> queryValue = new ArrayList();\n queryValue = entry.getValue();\n double temp = queryValue.get(totaldocument);\n\n query.add(temp);\n }\n }", "private void createAdapters() {\n // Available quests for a Neutral hero\n adapterAvailableNeutral = new QuestAdapter(this, new ParseQueryAdapter.QueryFactory<ParseObject>(){\n @Override\n public ParseQuery create() {\n ParseQuery query = new ParseQuery(QuestApp.QUEST_DATABASE);\n query.whereEqualTo(QuestApp.COMPLETED_KEY, false);\n query.whereDoesNotMatchKeyInQuery(QuestApp.ACCEPTEDBY_KEY, QuestApp.OBJECTID_KEY, ParseUser.getQuery());\n return query;\n }\n });\n\n // Available quests for a Good hero\n adapterAvailableGood = new QuestAdapter(this, new ParseQueryAdapter.QueryFactory<ParseObject>(){\n @Override\n public ParseQuery create() {\n ParseQuery query = new ParseQuery(QuestApp.QUEST_DATABASE);\n query.whereEqualTo(QuestApp.COMPLETED_KEY, false);\n query.whereEqualTo(QuestApp.ALIGNMENT_KEY, 0);\n query.whereDoesNotMatchKeyInQuery(QuestApp.ACCEPTEDBY_KEY, QuestApp.OBJECTID_KEY, ParseUser.getQuery());\n return query;\n }\n });\n\n // Available quests for an Evil hero\n adapterAvailableEvil = new QuestAdapter(this, new ParseQueryAdapter.QueryFactory<ParseObject>(){\n @Override\n public ParseQuery create() {\n ParseQuery query = new ParseQuery(QuestApp.QUEST_DATABASE);\n query.whereEqualTo(QuestApp.COMPLETED_KEY, false);\n query.whereEqualTo(QuestApp.ALIGNMENT_KEY, 2);\n query.whereDoesNotMatchKeyInQuery(QuestApp.ACCEPTEDBY_KEY, QuestApp.OBJECTID_KEY, ParseUser.getQuery());\n return query;\n }\n });\n\n // Quests accepted by user\n adapterAccepted = new QuestAdapter(this, new ParseQueryAdapter.QueryFactory<ParseObject>(){\n @Override\n public ParseQuery create() {\n ParseQuery query = new ParseQuery(QuestApp.QUEST_DATABASE);\n query.whereEqualTo(QuestApp.COMPLETED_KEY, false);\n query.whereEqualTo(QuestApp.ACCEPTEDBY_KEY, user);\n return query;\n }\n });\n\n // Quests completed by user\n adapterCompleted = new QuestAdapter(this, new ParseQueryAdapter.QueryFactory<ParseObject>(){\n @Override\n public ParseQuery create() {\n ParseQuery query = new ParseQuery(QuestApp.QUEST_DATABASE);\n query.whereEqualTo(QuestApp.COMPLETED_KEY, true);\n query.whereEqualTo(QuestApp.ACCEPTEDBY_KEY, user);\n return query;\n }\n });\n }", "private void addQueries(String query){\n ArrayList <String> idsFullSet = new ArrayList <String>(searchIDs);\n while(idsFullSet.size() > 0){\n ArrayList <String> idsSmallSet = new ArrayList <String>(); \n if(debugMode) {\n System.out.println(\"\\t Pmids not used in query available : \" + idsFullSet.size());\n }\n idsSmallSet.addAll(idsFullSet.subList(0,Math.min(getSearchIdsLimit(), idsFullSet.size())));\n idsFullSet.removeAll(idsSmallSet);\n String idsConstrain =\"\";\n idsConstrain = idsConstrain(idsSmallSet);\n addQuery(query,idsConstrain);\n }\n }", "public static void search(){\n\t\tfor (Page p:heap){\n\t\t\tfor(Building b:p.buildings){\n\t\t\t\t\n\t\t\t\t//System.out.println(b.buildingName);\n\t\t\t\tif(b.getBuildingName()!=null) {\n\t\t\t\t\tif(b.getBuildingName().contains(searchQuery)){\n\t\t\t\t\t\tSystem.out.println(\"======================================================\");\n\t\t\t\t\t\tSystem.out.println(\"Building Name: \" + b.getBuildingName());\n\t\t\t\t\t\tSystem.out.println(\"Property ID: \" + b.getPropID());\n\t\t\t\t\t\tSystem.out.println(\"Census year: \" + b.getCensusYear());\n\t\t\t\t\t\tSystem.out.println(\"======================================================\");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tbuildingsFound++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpagesSearched++;\n\t\t}\n\t}", "public void index(List<ParsedDocument> pdocs,int qid) {\n\t\ttry {\n\t\t\tint count = iw.maxDoc()+1;\n\t\t\tDocument doc = null;\n\t\t\tIndexDocument iDoc=null;\n\t\t\tfor (ParsedDocument pdoc : pdocs) {\n\t\t\t\t\n\t\t\t\tiDoc=parseDocument(pdoc);\n\t\t\t\tif(iDoc==null){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tField queryField = new Field(\"qid\", qid+\"\", Store.YES,\n\t\t\t\t\t\tIndex.NOT_ANALYZED);\n\t\t\t\tField uniqueField = new Field(\"id\", count + \"\", Store.YES,\n\t\t\t\t\t\tIndex.NOT_ANALYZED);\n\t\t\t\tField titleField = new Field(\"title\", iDoc.getTitle(),\n\t\t\t\t\t\tStore.YES, Index.ANALYZED, TermVector.YES);\n\t\t\t\tField bodyField = new Field(\"body\", iDoc.getBody(), Store.YES,\n\t\t\t\t\t\tIndex.ANALYZED, TermVector.YES);\n\t\t\t\tField urlField = new Field(\"url\", iDoc.getUrl(), Store.YES,\n\t\t\t\t\t\tIndex.NOT_ANALYZED);\n\t\t\t\tField anchorField = new Field(\"anchor\", iDoc.getAnchor(), Store.YES,\n\t\t\t\t\t\tIndex.ANALYZED, TermVector.YES);\n\n\t\t\t\tdoc = new Document();\n\t\t\t\tdoc.add(uniqueField);//标示不同的document\n\t\t\t\tdoc.add(queryField);//标示不同的query\n\t\t\t\tdoc.add(titleField);\n\t\t\t\tdoc.add(bodyField);\n\t\t\t\tdoc.add(urlField);\n\t\t\t\tdoc.add(anchorField);\n\t\t\t\t\n\t\t\t\tiw.addDocument(doc);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tiw.commit();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "public static void main(String[] args) {\n\t\tSession s2=util.getSession();\r\n\t\tQuery qry=s2.getNamedQuery(\"q2\");\r\n\t\t//Query qry=s2.getNamedQuery(\"q3\");\r\n\t\t//qry.setInteger(0, 50);\r\n\t\tList<Object[]> lust=qry.list();\r\n\t\tfor(Object[] row:lust) {\r\n\t\t\tSystem.out.println(Arrays.toString(row));\r\n\t\t}\r\n\t\tSystem.out.println(\"Completed\");\r\n\t}", "public List<T> query(QueryObject qo) {\n\t\treturn null;\n\t}", "private static String addQueryEntry(String query) throws IOException {\n\t\t\t\t\n\t\tString submittedQuery=null;\n\t\tString queryParts[]=query.split(\"&\"); // get parameters from query\t\t\n\t\tboolean isNextPage=false;\n\t\tString key=null;\n\t\tInteger value=null;\n\t\tboolean docsProcessed=false; // identifies if 'docs' occurs more than once in the query\t\t\n\t\tboolean termsProcessed=false; // identifies if 'terms' occurs more than once in the query\n\t\t\n\t\t// identify if it is a next page\n\t\tfor (int i=0;i<queryParts.length;i++) { // verifies if it is a next page\n\t\t\tString queryPartsFields[]=queryParts[i].split(\"=\",2);\t\t\t\n\t\t\tqueryPartsFields[0]=queryPartsFields[0].trim();\n\t\t\tif (queryPartsFields.length>1) {\n\t\t\t\tqueryPartsFields[1]=queryPartsFields[1].trim();\n\t\t\t}\n\t\t\t\n\t\t\tif (queryPartsFields[0].equals(DOCS_KEY) && queryPartsFields.length>1 && !queryPartsFields[1].equals(\"\")) {\t\t\t\n\t\t\t\tint ipage;\n\t\t\t\ttry {\n\t\t\t\t\tipage=Integer.parseInt(queryPartsFields[1]);\n\t\t\t\t}\n\t\t\t\tcatch (NumberFormatException e) {\n\t\t\t\t\tipage=0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (ipage!=0) { // regist only pages>0 \t\t\t\t\t\t\t\n\t\t\t\t\tisNextPage=true;\t\t\t\n\t\t\t\t\tif (ipage%RESULTS_PER_PAGE!=0) {\n\t\t\t\t\t\tSystem.err.println(\"Page results not multiple of \"+RESULTS_PER_PAGE+\": \"+ipage);\n\t\t\t\t\t\tipage+=ipage%RESULTS_PER_PAGE;\n\t\t\t\t\t}\n\t\t\t\t\tif (!docsProcessed) {\n\t\t\t\t\t\tint index=ipage/RESULTS_PER_PAGE>pagesViewedDistAux.length-1 ? pagesViewedDistAux.length-1 : ipage/RESULTS_PER_PAGE;\t\t\t\n\t\t\t\t\t\tif (index==0) { // sanity check\n\t\t\t\t\t\t throw new IOException(\"Error of index=0 on a next page. ipage:\"+ipage);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpagesViewedDistAux[index]++;\n\t\t\t\t\t}\n\t\t\t\t\tdocsProcessed=true;\t\t\t\t\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse if (queryPartsFields[0].equals(QUERY_KEY)) {\n\t\t\t\ttermsProcessed=true;\n\t\t\t}\n\t\t}\n\t\t// check wrong entries\n\t\tif (docsProcessed && !termsProcessed) {\n\t\t\tSystem.err.println(\"Error of query with docs without terms: \"+query);\n\t\t\treturn null;\n\t\t}\t\t\t\t\n\t\tif (isNextPage) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// count only first page\n\t\tdocsProcessed=false;\n\t\tfor (int i=0;i<queryParts.length;i++) {\t\t\t\t\t\t\t\t\t\n\t\t\tString queryPartsFields[]=queryParts[i].split(\"=\",2);\t\t\t\n\t\t\tqueryPartsFields[0]=queryPartsFields[0].trim();\n\t\t\t\n\t\t\tif (!queryPartsFields[0].equals(QUERY_KEY) || queryPartsFields.length!=2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// normalize query\t\t\t\n\t\t\ttry {\n\t\t\t\tqueryPartsFields[1]=decodeStrings(decodeNCR(java.net.URLDecoder.decode(queryPartsFields[1],\"ISO8859-1\").toLowerCase()));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\tcatch(IllegalArgumentException e) {\n\t\t\t\tqueryPartsFields[1]=decodeStrings(decodeNCR(queryPartsFields[1].toLowerCase()));\n\t\t\t}\n\t\t\t// remove spaces\n\t\t\tString terms[]=queryPartsFields[1].split(\"\\\\s\");\n\t\t\tqueryPartsFields[1]=\"\";\n\t\t\tfor (int j=0,k=0;j<terms.length;j++) {\t\t\t\t\t\n\t\t\t\tif (terms[j].equals(\"\")) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\t\t\t\t\t\n\t\t\t\tif (k>0) {\n\t\t\t\t\tqueryPartsFields[1]+=\" \";\t\n\t\t\t\t}\n\t\t\t\tqueryPartsFields[1]+=terms[j];\t\t\t\t\t\n\t\t\t\tk++;\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t// filter queries\t\t\t\t\t\n\t\t\tif (queryFiltersMap.containsKey(queryPartsFields[1]) || queryPartsFields[1].startsWith(\"cache%3\") || queryPartsFields[1].equals(\"\")) {\t\t\t\t\n\t\t\t\tcontinue;\n\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t// set first page viewed\n\t\t\tif (!docsProcessed) {\n\t\t\t\tpagesViewedDistAux[0]++;\n\t\t\t\tdocsProcessed=true;\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//key=queryPartsFields[0]+\" \"+queryPartsFields[1];\n\t\t\tkey=NEW_QUERY_KEY+\" \"+queryPartsFields[1];\t\t\t\n\t\t\tif ((value=queryPartsMap.get(key))==null) {\n\t\t\t\tqueryPartsMap.put(key,1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tqueryPartsMap.put(key,value+1);\n\t\t\t}\n\t\t\t\n\t\t\t// set submitted query\n\t\t\tif (submittedQuery!=null) { // sanity check\n\t\t\t\tthrow new IOException(\"Submitted query already set.\");\n\t\t\t}\n\t\t\tsubmittedQuery=queryPartsFields[1];\n\t\t\t\t\n\t\t\t// count queries per session\t\n\t\t\tnQueriesSession++;\n\t\t}\n\t\treturn submittedQuery;\n\t}", "public void parseQueryStringAndSearch(String searchString) {\n char[] chars = searchString.toCharArray();\n for (int i = 0; i < chars.length; i++) {\n Queue<Character> queue;\n int k;\n if (Character.isDigit(chars[i])) {\n k = Integer.parseInt(String.valueOf(chars[i]));\n i++;\n queue = new LinkedList<>();\n while (i < chars.length && chars[i] != ')') {\n queue.add(chars[i]);\n i++;\n }\n i++;\n String query = queryToString(queue);\n String[] terms = query.split(\" \");\n //System.out.println(query + \" and k: \" + k);\n positionIntersects(indexMap.get(analyzeTerm(terms[0])), indexMap.get(analyzeTerm(terms[1])), k);\n } else {\n queue = new LinkedList<>();\n while (i < chars.length && !Character.isDigit(chars[i])) {\n queue.add(chars[i]);\n i++;\n }\n i--;\n String query = queryToString(queue);\n String[] terms = query.trim().split(\" \");\n termQuerySearch(terms);\n }\n\n }\n\n }", "@ActionTrigger(action=\"KEY-ENTQRY\", function=KeyFunction.SEARCH)\n\t\tpublic void spriden_Search()\n\t\t{\n\t\t\t\n\t\t\t\texecuteAction(\"QUERY\");\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t}", "List<E> queryAll(String namedQuery);", "private SeqIter query(final int db, final int qu) throws Exception {\r\n final int size = qressizes[db * nqueries + qu];\r\n final double qtime = qt[db * nqueries + qu];\r\n \r\n if(size == 0) return new SeqIter();\r\n \r\n // query and cache result\r\n final String que = XQM + \"for $i score $s in \" +\r\n queries.get(qu) + \" order by $s descending \" +\r\n \"return (basex:sum-path($i), $s, base-uri($i))\";\r\n \r\n final Process proc = new XQuery(que);\r\n final CachedOutput res = new CachedOutput();\r\n if(session.execute(proc)) session.output(res);\r\n \r\n final SeqIter sq = new SeqIter();\r\n final StringTokenizer st = new StringTokenizer(res.toString(), \" \");\r\n String lp = \"\";\r\n int z = 0;\r\n while(st.hasMoreTokens() && z < size) {\r\n qtimes[qu] += qtime;\r\n final String p = st.nextToken();\r\n if(!st.hasMoreTokens()) break;\r\n final String s = st.nextToken();\r\n if(!st.hasMoreTokens()) break;\r\n String uri = st.nextToken();\r\n //while(uri.indexOf(\".xml\") == -1) uri = st.nextToken();\r\n uri = uri.substring(uri.lastIndexOf('/') + 1);\r\n final String tmp = uri + \";\" + p;\r\n if(!lp.equals(tmp)) {\r\n final Str str = Str.get(token(uri + \";\" + p));\r\n str.score(Double.parseDouble(s));\r\n sq.add(str);\r\n lp = tmp;\r\n }\r\n z++;\r\n }\r\n \r\n Main.outln(\"Query % on %: %\", qu + 1, databases.get(db), qtime);\r\n return sq;\r\n }", "public QueryController(String[] args){\n // Parse Args\n QueryArgs queryArgs = new QueryArgs();\n try {\n queryArgs.parseArgs(args);\n } catch (FileNotFoundException e) {\n //e.printStackTrace();\n System.err.println(\"Invalid Arguments received. Please check your arguments passed to ./search\");\n return;\n }\n\n // Run the Term Normaliser\n TermNormalizer normalizer = new TermNormalizer();\n String[] queryTerms = normalizer.transformedStringToTerms(queryArgs.queryString);\n\n //create the model\n Model model = new Model();\n model.loadCollectionFromMap(queryArgs.mapPath);\n model.loadLexicon(queryArgs.lexiconPath);\n model.loadInvertedList(queryArgs.invlistPath);\n if(queryArgs.stopListEnabled)\n {\n model.loadStopList(queryArgs.stopListPath);\n }\n if(queryArgs.printSummary && queryArgs.collectionPath != \"\")\n {\n model.setPathToCollection(queryArgs.collectionPath);\n }\n\n\n //fetch the top results from the query module\n QueryModule queryModule = new QueryModule();\n queryModule.doQuery(queryTerms, model, queryArgs.bm25Enabled);\n List<QueryResult> topResults = queryModule.getTopResult(queryArgs.maxResults);\n\n\n\n ResultsView resultsView = new ResultsView();\n if(queryArgs.printSummary)\n {\n\n DocSummary docSummary = new DocSummary();\n for(QueryResult result:topResults)\n {\n // retrieve the actualy text from the document collection\n result.setDoc(model.getDocumentCollection().getDocumentByIndex(result.getDoc().getIndex(), true));\n\n //set the summary on the result object by fetching it from the docSummary object\n result.setSummaryNQB(docSummary.getNonQueryBiasedSummary(result.getDoc(), model.getStopListModule()));\n result.setSummaryQB(docSummary.getQueryBiasedSummary(result.getDoc(), model.getStopListModule(), Arrays.asList(queryTerms)));\n }\n resultsView.printResultsWithSummary(topResults,queryArgs.queryLabel);\n }else\n {\n resultsView.printResults(topResults,queryArgs.queryLabel);\n }\n\n }", "@Test\n\tpublic void testKeywordQuery(){\n\t\t//manager.getResponse(\"american football \"); //match multiple keywords\n//\t\tmanager.getResponse(\"list of Bond 007 movies\");\n//\tmanager.getResponse(\"Disney movies\");\n\t\t//manager.keywordQuery(\"Paul Brown Stadium location\");\n\t\t//manager.keywordQuery(\"0Francesco\");\n System.out.println(\"******* keyword query *******\");\n\t\t//manager.keywordQuery(\"sportspeople in tennis\");\n\t\t//manager.keywordSearch(\"list of movies starring Sean Connery\",ElasticIndex.analyzed,100 );\n//\t\tmanager.keywordSearch(\"movies starring Sean Connery\",ElasticIndex.notStemmed,100 );\n// manager.keywordSearch(\"musical movies tony award\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"movies directed by Woody Allen\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"United states professional sports teams\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"computer games developed by Ubisoft\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"computer games developed by Ubisoft\",ElasticIndex.notStemmed,100 );\n// manager.keywordSearch(\"movies academy award nominations\",ElasticIndex.notStemmed,100 );\n System.out.println(SearchResultUtil.toSummary(manager.keywordSearch(\"movies directed by Woody Allen\",ElasticIndex.notLowercased,20 )));\n //manager.keywordSearch(\"grammy best album in 2012\",ElasticIndex.notAnalyzed,100 );\n //(better than analyzed) manager.keywordSearch(\"grammy best album in 2012\",ElasticIndex.notStemmed,100 );\n System.out.println(\"*****************************\");\n\n\t\t//manager.keywordQuery(\"Disney movies\");\n\t}", "public Query advancedQuery() \n {\n return null;\n }", "@Override\n public List<SearchResult> search(String queryString, int k) {\n // TODO: YOUR CODE HERE\n\n // Tokenize the query and put it into a Set\n HashSet<String> tokenSet = new HashSet<>(Searcher.tokenize(queryString));\n\n /*\n * Section 1: FETCHING termId, termFreq and relevant docId from the Query\n */\n\n // Init a set to store Relevant Document Id\n HashSet<Integer> relevantDocIdSet = new HashSet<>();\n for (String token : tokenSet) { // Iterates thru all query tokens\n int termId;\n try {\n termId = indexer.getTermDict().get(token);\n } catch (NullPointerException e) { // In case current token is not in the termDict\n continue; // Skip this one\n }\n // Get the Posting associate to the termId\n HashSet<Integer> posting = indexer.getPostingLists().get(termId);\n relevantDocIdSet.addAll(posting); // Add them all to the Relevant Document Id set\n }\n\n /*\n * Section 2: Calculate Jaccard Coefficient between the Query and all POTENTIAL DOCUMENTS\n */\n\n // ArrayList for the Final Result\n ArrayList<SearchResult> searchResults = new ArrayList<>();\n for (Document doc : documents) { // Iterates thru all documents\n if (!relevantDocIdSet.contains(doc.getId())) { // If the document is relevant\n searchResults.add(new SearchResult(doc, 0)); // Add the document as a SearchResult with zero score\n } else {\n HashSet<String> termIdSet = new HashSet<>(doc.getTokens()); // Get the token set from the document\n\n // Calculate Jaccard Coefficient of the document\n double jaccardScore = JaccardMathHelper.calculateJaccardSimilarity(tokenSet, termIdSet);\n\n // Add the SearchResult with the computed Jaccard Score\n searchResults.add(new SearchResult(doc, jaccardScore));\n }\n }\n\n return TFIDFSearcher.finalizeSearchResult(searchResults, k);\n }", "public Query getQuery ()\n {\n\n\treturn this.q;\n\n }", "QueryResponse query(SolrParams solrParams) throws SolrServerException;", "@Override\n public Data3DPlastic search() {\n return super.search();\n }", "public SearchResponse prepareSearchScrollRequest() {\n GetSettingsResponse getSettingsResponse = client.admin().indices().getSettings(new GetSettingsRequest().indices(dataPointer.getIndexName())).actionGet();\n int numShards = 0, numIndices = 0;\n for(ObjectCursor<Settings> settings : getSettingsResponse.getIndexToSettings().values()) {\n numShards += settings.value.getAsInt(\"index.number_of_shards\", 0);\n numIndices++;\n }\n\n int sizePerShard = (int)Math.ceil((double)SCROLL_SHARD_LIMIT/numShards);\n logger.info(\"Found \" + numIndices + \" indices and \" + numShards + \" shards matching the index-pattern, thus setting the sizePerShard to \" + sizePerShard);\n\n SearchRequestBuilder searchRequestBuilder = client.prepareSearch(dataPointer.getIndexName())\n .setTypes(dataPointer.getTypeName())\n .setSearchType(SearchType.SCAN)\n .addFields(\"_ttl\", \"_source\")\n .setScroll(new TimeValue(SCROLL_TIME_LIMIT))\n .setSize(sizePerShard);\n\n if (!Strings.isNullOrEmpty(query.getQuery())) {\n searchRequestBuilder.setQuery(query.getQuery());\n }\n if (!Strings.isNullOrEmpty(query.getSortField())) {\n searchRequestBuilder.addSort(new FieldSortBuilder(query.getSortField()).order(query.getSortOrder()));\n }\n\n bound.map(resolvedBound -> boundedFilterFactory.createBoundedFilter(segmentationField.get(), resolvedBound))\n .ifPresent(searchRequestBuilder::setQuery);\n\n return searchRequestBuilder.execute().actionGet();\n }", "private void compute(IndexSearcher searcher, int size) throws IOException {\n Bucket<Term> bucket = new Bucket<Term>(size);\n DocumentCounter counter = new DocumentCounter();\n for (TermQuery q : this._queries) {\n searcher.search(q, counter);\n bucket.add(q.getTerm(), counter.getCount());\n counter.reset();\n }\n this._bucket = bucket;\n }", "@Override\n\tprotected void executeSearch(String term) {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic List<ScoredDocument> search(Query query) {\n\t\t\t\treturn null;\r\n\t\t\t}", "public void setQ(int q) {\n this.q = q;\n }", "private void search()\n {\n JTextField searchField = (currentSearchView.equals(SEARCH_PANE_VIEW))? searchBar : resultsSearchBar;\n String searchTerm = searchField.getText();\n \n showTransition(2000);\n \n currentPage = 1;\n showResultsView(true);\n paginate(1, getResultsPerPage());\n\n if(searchWeb) showResultsTableView(WEB_RESULTS_PANE);\n else showResultsTableView(IMAGE_RESULTS_PANE);\n\n \n showSearchView(RESULTS_PANE_VIEW);\n resultsSearchBar.setText(searchTerm);\n }", "public interface Query {\n\n\t/**\n\t * @return ID of the given query\n\t */\n\tint queryID();\n\t\n\t/**\n\t * @return given query\n\t */\n\tString query();\n\t\n\t/**\n\t * @return list of relevant documents to the corresponding query\n\t */\n\tList<RelevanceInfo> listOfRelevantDocuments();\n\t\n\t/**\n\t * @return list of results to the corresponding query after running one of the retrieval models\n\t */\n\tList<Result> resultList();\n\t\n\t/**\n\t * @param resultList\n\t * @Effects adds results to the result list of the corresponding query\n\t */\n\tvoid putResultList(List<Result> resultList);\n}", "public void performSearch() {\n OASelect<QueryInfo> sel = getQueryInfoSearch().getSelect();\n sel.setSearchHub(getSearchFromHub());\n sel.setFinder(getFinder());\n getHub().select(sel);\n }", "public void testSearchRules() throws Exception {\n Project project = new Project();\r\n \r\n DateFormatSymbols symbols = new DateFormatSymbols(Locale.US);\r\n \r\n for (int i = 0; i < 12; i++) {\r\n \r\n String month = symbols.getMonths()[i];\r\n String shortMonth = symbols.getShortMonths()[i];\r\n \r\n // Basic project info\r\n project.setId(i);\r\n project.setCategoryId(1);\r\n project.setAllowGuests(true);\r\n project.setMembershipRequired(false);\r\n project.setApproved(true);\r\n project.setClosed(false);\r\n project.setPortal(false);\r\n \r\n // Unique Title\r\n project.setTitle(month + \" test project\");\r\n project.setShortDescription(month + \" description word\");\r\n project.setKeywords(shortMonth);\r\n \r\n // Unique Location\r\n project.setCity(\"Virginia Beach\");\r\n project.setState(\"VA\");\r\n project.setPostalCode(\"234\" + String.valueOf(50 + i));\r\n \r\n // Random Rating for now\r\n project.setRatingCount(i + 1);\r\n project.setRatingValue(project.getRatingCount() * StringUtils.rand(1, 5));\r\n project.setRatingAverage(project.getRatingValue() / project.getRatingCount());\r\n \r\n // Index it\r\n ProjectIndexer indexer = new ProjectIndexer();\r\n indexer.add(snowballWriter, project, true);\r\n }\r\n \r\n QueryParser parser = new QueryParser(\"contents\", snowballAnalyzer);\r\n \r\n {\r\n // Make sure a single matching term yields a single hit\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0]);\r\n search.setLocation(\"Virginia Beach\");\r\n assertNotNull(search.getQuery());\r\n assertNotNull(search.getLocation());\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january\"^20 OR january^15 OR january*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 1);\r\n }\r\n \r\n {\r\n // Make sure a single matching term stem yields a single hit\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0] + \"'s\");\r\n search.setLocation(\"Virginia Beach\");\r\n assertNotNull(search.getQuery());\r\n assertNotNull(search.getLocation());\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january's\"^20 OR january's^15 OR january's*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 1);\r\n }\r\n \r\n {\r\n // Make sure multiple matching words yield two hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0] + \" \" + symbols.getMonths()[1]);\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january february\"^20 OR january^15 OR february^14 OR january*^4 OR february*^3) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 2);\r\n }\r\n \r\n {\r\n // Make sure wilcards yield multiple hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(\"j\");\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n // Look for data with a \"j\" for comparison\r\n int jCount = 0;\r\n for (int i = 0; i < symbols.getMonths().length; i++) {\r\n if (symbols.getMonths()[i].toLowerCase().indexOf(\"j\") > -1 ||\r\n symbols.getShortMonths()[i].toLowerCase().indexOf(\"j\") > -1) {\r\n ++jCount;\r\n }\r\n }\r\n assertTrue(jCount > 0);\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"j\"^20 OR j^15 OR j*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == jCount);\r\n }\r\n \r\n {\r\n // Make sure alternate locations do not yield any hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0]);\r\n search.setLocation(\"Norfolk\");\r\n search.parseQuery();\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 0);\r\n }\r\n \r\n {\r\n // Make sure locations as query terms do not yield any hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(\"Virginia Beach\");\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 0);\r\n }\r\n }", "public WorldUps.UQuery getQueries(int index) {\n return queries_.get(index);\n }", "private void performNewQuery(){\n\n // update the label of the Activity\n setLabelForActivity();\n // reset the page number that is being used in queries\n pageNumberBeingQueried = 1;\n // clear the ArrayList of Movie objects\n cachedMovieData.clear();\n // notify our MovieAdapter about this\n movieAdapter.notifyDataSetChanged();\n // reset endless scroll listener when performing a new search\n recyclerViewScrollListener.resetState();\n\n /*\n * Loader call - case 3 of 3\n * We call loader methods as we have just performed reset of the data set\n * */\n // initiate a new query\n manageLoaders();\n\n }", "private void searchforResults() {\n\n List<String> queryList = new SavePreferences(this).getStringSetPref();\n if(queryList != null && queryList.size() > 0){\n Log.i(TAG, \"Searching for results \" + queryList.get(0));\n Intent searchIntent = new Intent(Intent.ACTION_WEB_SEARCH);\n searchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n searchIntent.putExtra(SearchManager.QUERY, queryList.get(0));\n this.startActivity(searchIntent);\n }\n }", "public void actionPerformed(ActionEvent e) {\n displayInfoText(\" \");\n // Turn the search string into a Query\n String queryString = queryWindow.getText().toLowerCase().trim();\n query = new Query(queryString);\n // Take relevance feedback from the user into account (assignment 3)\n // Check which documents the user has marked as relevant.\n if (box != null) {\n boolean[] relevant = new boolean[box.length];\n for (int i = 0; i < box.length; i++) {\n if (box[i] != null)\n relevant[i] = box[i].isSelected();\n }\n query.relevanceFeedback(results, relevant, engine);\n }\n // Search and print results. Access to the index is synchronized since\n // we don't want to search at the same time we're indexing new files\n // (this might corrupt the index).\n long startTime = System.currentTimeMillis();\n synchronized (engine.indexLock) {\n results = engine.searcher.search(query, queryType, rankingType);\n }\n long elapsedTime = System.currentTimeMillis() - startTime;\n // Display the first few results + a button to see all results.\n //\n // We don't want to show all results directly since the displaying itself\n // might take a long time, if there are many results.\n if (results != null) {\n displayResults(MAX_RESULTS, elapsedTime / 1000.0);\n } else {\n displayInfoText(\"Found 0 matching document(s)\");\n\n if (engine.speller != null) {\n startTime = System.currentTimeMillis();\n SpellingOptionsDialog dialog = new SpellingOptionsDialog(50);\n String[] corrections = engine.speller.check(query, 10);\n elapsedTime = System.currentTimeMillis() - startTime;\n System.err.println(\"It took \" + elapsedTime / 1000.0 + \"s to check spelling\");\n if (corrections != null && corrections.length > 0) {\n String choice = dialog.show(corrections, corrections[0]);\n if (choice != null) {\n queryWindow.setText(choice);\n queryWindow.grabFocus();\n\n this.actionPerformed(e);\n }\n }\n }\n }\n }", "public List<Recipe> search(String queryText, Category category, CookingMethod cookingMethod);", "private void search(SearchRequest request) {\r\n\t\tif(request == null)return;\r\n\t\tList<Record> results = handler.search(request);\r\n\t\tlist.show(results);\r\n\t\tpanInfo.setNumRec(results.size());\r\n\t\tpanInfo.setTotalAmt(Record.sumBalance(results));\r\n\t}", "public void testUsingQueriesFromQueryManger(){\n\t\tSet<String> names = testDataMap.keySet();\n\t\tUtils.prtObMess(this.getClass(), \"atm query\");\n\t\tDseInputQuery<BigDecimal> atmq = \n\t\t\t\tqm.getQuery(new AtmDiot());\n\t\tMap<String, ComplexQueryResult<BigDecimal>> bdResult = \n\t\t\t\tatmq.get(names, 1, TimeUnit.SECONDS);\n\t\tCollectionsStaticMethods.prtMapItems(bdResult);\n\n\t\tUtils.prtObMess(this.getClass(), \"vol query\");\n\t\tDseInputQuery<BigDecimal> volq = \n\t\t\t\tqm.getQuery(new VolDiotForTest());\n\t\tMap<String, ComplexQueryResult<BigDecimal>> dbResult = \n\t\t\t\tvolq.get(names, 1, TimeUnit.SECONDS);\n\t\tCollectionsStaticMethods.prtMapItems(dbResult);\n\t\n\t\tUtils.prtObMess(this.getClass(), \"integer query\");\n\t\tDseInputQuery<BigDecimal> strikeq = \n\t\t\t\tqm.getQuery(new StrikeDiotForTest());\n\t\tMap<String, ComplexQueryResult<BigDecimal>> strikeResult = \n\t\t\t\tstrikeq.get(names, 1, TimeUnit.SECONDS);\n\t\tCollectionsStaticMethods.prtMapItems(strikeResult);\n\t\n\t}", "PaginatedSearchResponseModel findAllPostsForUser(Party partyBean, Pageable page);", "@Override\r\n\t\t\tpublic double matchingItems(Query query) {\n\t\t\t\treturn 0;\r\n\t\t\t}", "List<ShipmentInfoPODDTO> search(String query);", "@Override\n\t\t\tpublic void run() {\n\n\t\t\t\tpostParameters[0] = new PostParameter(\"keyword\", searchKeyword);\n\t\t\t\tpostParameters[1] = new PostParameter(\"university\", university);\n\t\t\t\tpostParameters[2] = new PostParameter(\"page\", Integer.toString(requestTime));\n\t\t\t\t\n\t\t\t\tjsonString = HttpUtil.httpRequest(HttpUtil.USER_SEARCHBOOKS, postParameters, HttpUtil.POST);\n\t\t\t\tif (jsonString != null) {\t\t\t\t\t\n\t\t\t\t\tMessage msg = handler.obtainMessage();\n\t\t\t\t\tmsg.what = what;\n\t\t\t\t\thandler.sendMessage(msg);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\thandler.sendEmptyMessage(-1);\n\t\t\t\t}\n\t\t\t}", "default List<SearchResult> search(String tvShowName, int season, int episode, Quality quality) {\n return search(new SearchQuery(tvShowName, season, episode, quality));\n }", "public void searchAndWriteQueryResultsToOutput() {\n\n List<String> queryList = fu.textFileToList(QUERY_FILE_PATH);\n\n for (int queryID = 0; queryID < queryList.size(); queryID++) {\n String query = queryList.get(queryID);\n // ===================================================\n // 4. Sort the documents by the BM25 scores.\n // ===================================================\n HashMap<String, Double> docScore = search(query);\n List<Map.Entry<String, Double>> rankedDocList =\n new LinkedList<Map.Entry<String, Double>>(docScore.entrySet());\n Collections.sort(rankedDocList, new MapComparatorByValues());\n\n // ===================================================\n // 5. Write Query Results to output\n // =================================================== \n String outputFilePath =\n RANKING_RESULTS_PATH + \"queryID_\" + (queryID + 1) + \".txt\";\n StringBuilder toOutput = new StringBuilder();\n // display results in console\n System.out.println(\"Found \" + docScore.size() + \" hits.\");\n int i = 0;\n for (Entry<String, Double> scoreEntry : rankedDocList) {\n if (i >= NUM_OF_RESULTS_TO_RETURN)\n break;\n String docId = scoreEntry.getKey();\n Double score = scoreEntry.getValue();\n String resultLine =\n (queryID + 1) + \" Q0 \" + docId + \" \" + (i + 1) + \" \" + score + \" BM25\";\n toOutput.append(resultLine);\n toOutput.append(System.getProperty(\"line.separator\"));\n System.out.println(resultLine);\n i++;\n }\n fu.writeStringToFile(toOutput.toString(), outputFilePath);\n }\n }", "private Collection<Record> handleRequest(SearchRequest request) {\n\t\tCollection<Record> resultSet = getResults(request.getQuery());\n\t\treturn resultSet;\n\t}", "TSearchQuery prepareSearchQuery(SearchQueryDefinitionAPI searchQueryDefinition);", "public Map<String, String> directQuoteSearch (String q, String contentOrTitle) throws IOException, ParseException{\n\n\t\t\n\t\tif (contentOrTitle.equals(\"content\")){\n\t\t\tcontentOrTitle=field;\n\t\t} else if (contentOrTitle.equals(\"title\")){\n\t\t\tcontentOrTitle=title;\n\t\t}\n\t\t\n\t\tIndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(index)));\n\t\tIndexSearcher searcher = new IndexSearcher(reader);\n\t\tboolean raw = false;\n\t\tint repeat = 0;\n\n\t\tfinal List<String> stopWords = Arrays.asList();\n\t\tfinal CharArraySet stopSet = new CharArraySet(stopWords, true);\n\n\t\tAnalyzer analyzer = new StandardAnalyzer(stopSet);\n\t\tAnalyzingQueryParser parser = new AnalyzingQueryParser(contentOrTitle, analyzer);\n\t\t\n\n\t\t\n\t\tString[] items = q.split(\" \");\n\t\tList<String> itemList = Arrays.asList(items);\n\t\tQuery query=null;\n\t\t\n\t\t\n\t\tif (q.equals(\"\")){\n\t\t\tSystem.out.println(\"no input\");\n\t\t\t\n\t\t} else {\n\t\t\tquery = parser.parse(q);\n\n\t\t}\n\n\t\t\n\t\t\n\t\tBufferedReader in = null;\n\t\tin = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));\n\n\t\tif (repeat > 0) { // repeat & time as benchmark\n\t\t\tDate start = new Date();\n\t\t\tfor (int i = 0; i < repeat; i++) {\n\t\t\t\tsearcher.search(query, 100);\n\t\t\t}\n\t\t\tDate end = new Date();\n\t\t\tSystem.out.println(\"Time: \"+(end.getTime()-start.getTime())+\"ms\");\n\t\t}\n\n\t\treturn doPagingSearch(in, searcher, query, hitsPerPage, raw, true);\n\t}", "public Map<String, DataModel> getQuery() {\n if (queries == null) {\n queries = FxSharedUtils.getMappedFunction(new FxSharedUtils.ParameterMapper<String, DataModel>() {\n @Override\n public DataModel get(Object key) {\n try {\n final FxResultSet result = EJBLookup.getSearchEngine().search((String) key, 0, -1, null);\n return new FxResultSetDataModel(result);\n } catch (FxApplicationException e) {\n throw e.asRuntimeException();\n }\n }\n }, true);\n }\n return queries;\n }", "public PostingsList getPostings( String token ) {\n PostingsList post = new PostingsList();\n if(this.index.containsKey(token))\n post = (this.index.get(token)).clone();\n /*System.err.println(\"start search...\");\n // Read JSON file associated to token and return it as a postingslist\n String filename = \"postings/t\"+hash(token)+\".json\";\n PostingsList post = new PostingsList();\n try(Reader reader = new FileReader(filename)){\n post = (new Gson()).fromJson(reader, PostingsList.class);\n } catch (IOException e) {\n e.printStackTrace();\n }*/\n return post;\n }", "public static void main(String[] args) throws Exception {\n\n IndexManager indexManager = new IndexManager();\n Query query = new TermQuery(new Term(\"name\", \"求职\"));\n indexManager.excQuery(query);\n\n }", "public void doSearch(String query)\n \t{\n \t\tlistener.onQueryTextSubmit(query);\n \t}", "@Override\n public Set<Restaurant> getMatches(String queryString) {\n\n /* Setup grammar listener */\n CharStream stream = new ANTLRInputStream(queryString);\n QueryLexer lexer = new QueryLexer(stream);\n TokenStream tokens = new CommonTokenStream(lexer);\n QueryParser parser = new QueryParser(tokens);\n ParseTree tree = parser.root();\n ParseTreeWalker walker = new ParseTreeWalker();\n\n // Setup custom walker\n QueryCreator creator = new QueryCreator();\n walker.walk(creator, tree);\n\n Set<Restaurant> matches = new HashSet<Restaurant>();\n RestaurantHandle rH = creator.getHandle();\n Expression expTree = creator.getExpression();\n\n // Look through every restaurant, if one matches query add it to the set\n for (Restaurant r : this.restaurantMap.values()) {\n rH.setRestaurant(r);\n if (expTree.eval()) {\n matches.add(r);\n }\n }\n\n return matches;\n }" ]
[ "0.5320133", "0.52384716", "0.51909447", "0.51793134", "0.51689667", "0.5166202", "0.51531994", "0.511496", "0.51019454", "0.50839907", "0.5083817", "0.5078615", "0.5059571", "0.5005355", "0.5002798", "0.49850202", "0.49844736", "0.49838942", "0.49333358", "0.4925261", "0.4891706", "0.48816422", "0.48766887", "0.48577175", "0.48196107", "0.4803351", "0.4796386", "0.47883135", "0.47861728", "0.4770656", "0.47681835", "0.47563535", "0.47405282", "0.47252274", "0.4714537", "0.4702731", "0.4695658", "0.4680343", "0.46686047", "0.46577442", "0.4656255", "0.46429175", "0.4633484", "0.46318266", "0.4631485", "0.46303356", "0.4628821", "0.4622601", "0.4619522", "0.46154833", "0.46138468", "0.46138206", "0.46008316", "0.45999223", "0.45943874", "0.45833945", "0.45812356", "0.45800745", "0.45745844", "0.45735294", "0.45727086", "0.45721406", "0.45714852", "0.4571419", "0.45688608", "0.45562577", "0.45474562", "0.4543923", "0.45233175", "0.45175025", "0.450942", "0.4502668", "0.44969207", "0.44843516", "0.44829416", "0.44739553", "0.44693533", "0.44693476", "0.44648525", "0.4462255", "0.44556433", "0.4451209", "0.44503224", "0.4444923", "0.44449106", "0.44444564", "0.44408336", "0.4437653", "0.44374847", "0.4434583", "0.4432412", "0.44267124", "0.44266358", "0.44258076", "0.44251183", "0.44224918", "0.44202486", "0.4414116", "0.4411601", "0.4409517" ]
0.4517407
70
query: Query inserted by the user w: Weight the tfidf score, usually very small to account for scale difference with pagerank idf_threshold: Threshold to perform index elimination / 1) Obtain union of results containing the considered query terms
public PostingsList ranked_query(Query query, double w, double idf_threshold){ long startTime = System.nanoTime(); PostingsList result = new PostingsList(); // Obtain union of terms above idf threshold if indexElimination is true // (Set idf_threshold to zero to disable this feature) Set<String> termsToConsider = this.queryTermsConsidered(query, idf_threshold); result = this.union_query(query, termsToConsider); //System.err.println("Size of result is " + result.size()); long estimatedTime = (System.nanoTime() - startTime)/1000000; System.err.println("* Union took: " + estimatedTime); /* * 2) Iterate over PostingsEntries and build the solution */ startTime = System.nanoTime(); // Required when iterating over a PostingsList PostingsEntry postEnt = new PostingsEntry(); // Number of documents in the collection double nDocs = this.docIDs.size(); // Weight of a query vector coefficient double w_query_term; // Document tf-idf variables double termFrequency_doc, documentFrequency_doc, w_doc_term; for(String term : termsToConsider){ // Obtain idf of the term documentFrequency_doc = Math.log(nDocs/new Double(this.idfMap.get(term))); // Obtain weight of the term w_query_term = query.weights.get(term); // Iterate over all documents containing the term and update the score(q,d) Iterator<PostingsEntry> it_d = result.iterator(); while(it_d.hasNext()){ postEnt = it_d.next(); if (this.tfMap.get(postEnt.docID).containsKey(term)){ termFrequency_doc = this.tfMap.get(postEnt.docID).get(term); w_doc_term = documentFrequency_doc*termFrequency_doc; postEnt.score += w_query_term*w_doc_term; } } } estimatedTime = (System.nanoTime() - startTime)/1000000; System.err.println("* Building solution took: " + estimatedTime); /* * 3) Normalize the scores */ startTime = System.nanoTime(); Iterator<PostingsEntry> it = result.iterator(); while(it.hasNext()){ postEnt = it.next(); postEnt.score /= (new Double(this.docLengths.get(""+postEnt.docID)));//(Math.sqrt(postEnt.norm2)); postEnt.score = w * postEnt.score + (1-w) * quality(postEnt.docID); } estimatedTime = (System.nanoTime() - startTime)/1000000; System.err.println("* Normalizing took: " + estimatedTime); /* * 4) Sort the resulting solution */ startTime = System.nanoTime(); result.sort(); estimatedTime = (System.nanoTime() - startTime)/1000000; System.err.println("* Sorting took: " + estimatedTime); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Set<String> queryTermsConsidered(Query query, double idf_threshold){\n double idf, nDocs = this.docIDs.size();\n String term;\n\n Set<String> termsToConsider = new HashSet<String>();\n\n Iterator<String> it = query.terms.iterator();\n while(it.hasNext()){\n term = it.next();\n idf = -1;\n if(this.idfMap.containsKey(term))\n idf = Math.log(nDocs/new Double(this.idfMap.get(term)));\n if (idf >= idf_threshold){\n termsToConsider.add(term);\n }\n /*else{\n System.err.println(term + \" not considered since idf = \" + idf);\n }*/\n }\n\n return termsToConsider;\n\n }", "private HashMap<String,HashMap<String,Integer>> computeTFForQueryWords(ArrayList<String> queryPostingLines) {\n HashMap<String,HashMap<String,Integer>> queryWordsTF = new HashMap<>();\n HashMap<String,HashMap<String,Integer>> queryWordsTFPerDoc = new HashMap<>();\n String docID,term;\n Integer tf;\n HashSet<String> docIDs = new HashSet<>();\n for(String postingLine : queryPostingLines){\n HashMap<String,Integer> frequenciesInDocuments = new HashMap<>();\n term = postingLine.substring(0,postingLine.indexOf(\"|\"));\n postingLine = postingLine.substring(postingLine.indexOf(\"|\")+1);\n while(!postingLine.equals(\"\")) {\n docID = postingLine.substring(0, postingLine.indexOf(\":\"));\n docIDs.add(docID);\n postingLine = postingLine.substring(postingLine.indexOf(\"_\") + 1);\n tf = Integer.valueOf(postingLine.substring(0, postingLine.indexOf(\"_\")));\n postingLine = postingLine.substring(postingLine.indexOf(\"_\") + 1);\n frequenciesInDocuments.put(docID,tf);\n }\n queryWordsTF.put(term,frequenciesInDocuments);\n }\n\n ArrayList<String> allTermsInQuery = new ArrayList<>(queryWordsTF.keySet());\n for(String doc : docIDs){\n HashMap<String,Integer> tfsInDoc = new HashMap<>();\n for(String termInQuery : allTermsInQuery){\n HashMap<String,Integer> termsTFInDoc = queryWordsTF.get(termInQuery);\n if(termsTFInDoc.containsKey(doc)){\n tfsInDoc.put(termInQuery,termsTFInDoc.get(doc));\n }\n }\n queryWordsTFPerDoc.put(doc,tfsInDoc);\n }\n return queryWordsTFPerDoc;\n }", "public List<IResult> getResults(List<Integer> relatedDocs, String query) {\r\n\r\n // results\r\n List<IResult> rs = new ArrayList<>();\r\n List<Double> documentVector, queryVector = new ArrayList<>();\r\n\r\n Map<String, Integer> termFreqs = this.preprocessor.processQuery(query);\r\n\r\n for(String op : new String[]{\"and\", \"or\", \"not\"}) {\r\n termFreqs.remove(op);\r\n }\r\n\r\n\r\n double highestVal = 0;\r\n\r\n // query TF-IDF vector\r\n for(String term : termFreqs.keySet()) {\r\n\r\n // unknown term == contained in no doc\r\n if(!this.index.getDict().containsKey(term)) {\r\n continue;\r\n }\r\n\r\n // # docs where term occurs in\r\n int termTotalFreq = this.index.getTermInDocCount(term);\r\n\r\n // query tf-idf vector\r\n double qTfIdf = this.tfidf.tfidfQuery(termFreqs.get(term), termTotalFreq);\r\n queryVector.add(qTfIdf);\r\n\r\n if(qTfIdf > highestVal) highestVal = qTfIdf;\r\n }\r\n\r\n // query vector normalization\r\n for(int i = 0; i < queryVector.size(); i++) {\r\n queryVector.set(i, queryVector.get(i)/highestVal);\r\n }\r\n\r\n\r\n for(int docId : relatedDocs) {\r\n documentVector = new ArrayList<>();\r\n highestVal = 0;\r\n\r\n for(String term : termFreqs.keySet()) {\r\n\r\n // unknown term == contained in no doc\r\n if(!this.index.getDict().containsKey(term)) {\r\n continue;\r\n }\r\n\r\n // document tf-idf vector\r\n double dTfIdf = this.tfidf.getTfIdf(term, docId);\r\n documentVector.add(dTfIdf);\r\n\r\n if(dTfIdf > highestVal) highestVal = dTfIdf;\r\n }\r\n\r\n // document vector normalization\r\n for(int i = 0; i < documentVector.size(); i++) {\r\n documentVector.set(i, documentVector.get(i)/highestVal);\r\n }\r\n\r\n Result result = new Result();\r\n result.setDocumentId(this.docs.get(docId).getUrl());\r\n result.setDocument(this.docs.get(docId));\r\n result.setScore((float) CosineSimilarity.process(documentVector, queryVector));\r\n rs.add(result);\r\n }\r\n\r\n Collections.sort(rs, new ResultComparator());\r\n\r\n // limit number of results\r\n if(rs.size() > IndexerConfig.MAX_RESULT_COUNT)\r\n rs = rs.subList(0, IndexerConfig.MAX_RESULT_COUNT);\r\n\r\n // rank it\r\n for(int i = 0; i < rs.size(); i++) {\r\n ((Result) rs.get(i)).setRank (i + 1);\r\n }\r\n\r\n return rs;\r\n }", "public HashMap<String, Double> search(String query) {\n // ===================================================\n // 1. Fetch all inverted lists corresponding to terms\n // in the query.\n // ===================================================\n String[] terms = query.split(\" \");\n HashMap<String, Integer> qf = new HashMap<String, Integer>();\n // Calculate term frequencies in the query\n for (String term : terms) {\n if (qf.containsKey(term))\n qf.put(term, qf.get(term) + 1);\n else\n qf.put(term, 1);\n }\n HashMap<String, Double> docScore = new HashMap<String, Double>();\n for (Entry<String, Integer> termEntry : qf.entrySet()) {\n String term = termEntry.getKey();\n int qfi = termEntry.getValue();\n\n // ===================================================\n // 2. Compute BM25 scores for documents in the lists.\n // Make a score list for documents in the inverted\n // lists. Assume that no relevance information is \n // available. For parameters, use k1=1.2, b=0.75, \n // k2=100.\n // ===================================================\n double k1 = 1.2;\n double b = 0.75;\n double k2 = 100;\n int ni = invIndex.get(term).size();\n\n\n for (Entry<String, IndexEntry> invListEntry : invIndex.get(term).entrySet()) {\n String docID = invListEntry.getKey();\n double bm25Score;\n if (docScore.containsKey(docID))\n bm25Score = docScore.get(docID);\n else\n bm25Score = 0;\n\n // length of the document\n int dl = docStat.get(docID);\n // frequency of the term in the document\n int fi = invListEntry.getValue().getTf();\n double K = k1 * ((1 - b) + b * ((double) dl / avdl));\n\n // ===================================================\n // 3. Accumulate scores for each term in a query\n // on the score list.\n // ===================================================\n bm25Score += Math.log((N - ni + 0.5) / (ni + 0.5))\n * (((k1 + 1) * fi * (k2 + 1) * qfi) / ((K + fi) * (k2 + qfi)));\n docScore.put(docID, bm25Score);\n }\n }\n\n return docScore;\n }", "public /*TreeMap<String, Float>*/void getTopnTermsOverlapWithQuery() throws IOException, ParseException{\n\t\tString outputfile = \"./output/score/test3.txt\";\n\n\t\tFileOutputStream out = new FileOutputStream(outputfile);\n\t\tPrintStream ps = new PrintStream(out);\n\t\t/*-------------------------------------------------------------------------------*/\n\n\t\tTreeMap<String,Float> termsscoressorted = null;\n\t\tCollectionReader reader = new CollectionReader(indexDir); \n\t\tIndexReader ir = reader.getIndexReader();\t\t\n\n\t\tTopicsInMemory topics = new TopicsInMemory(\"data/CLEF-IP-2010/PAC_test/topics/PAC_topics-test2.xml\"/*omit-PAC-1094.xml\"*/);\n\t\tfor(Map.Entry<String, PatentDocument> topic : topics.getTopics().entrySet()){\n\t\t\tString qUcid = topic.getValue().getUcid();\n\t\t\tString queryid = topic.getKey();\n\t\t\tString queryName = topic.getKey() + \"_\" + topic.getValue().getUcid();\n\t\t\tString queryfile = topic.getKey() + \"_\" + topic.getValue().getUcid() + \".xml\";\n\n\t\t\t/*System.out.println(\"=========================================\");\n\t\t\tSystem.out.println(queryName);\n\t\t\tSystem.out.println(\"=========================================\");*/\n\t\t\t/*int docid = reader.getDocId(\"UN-EP-0663270\", PatentDocument.FileName);\n\t\t\tir.getTermVector(docid, field) getTermVectors(b);*/\n\n\t\t\tEvaluateResults er = new EvaluateResults();\n\t\t\tArrayList<String> tps = er.evaluatePatents(queryid, \"TP\");\n\t\t\tArrayList<String> fps = er.evaluatePatents(queryid, \"FP\");\n\t\t\tHashMap<String, Float> /*TFreqs*/ termsscores = new HashMap<>();\n\n\n\t\t\t/*--------------------------------- Query Words -------------------------------*/\n\t\t\t//\t\t\tHashMap<String, Integer> query_termsfreqspair = reader.gettermfreqpair(qUcid, PatentDocument.Description);\n\t\t\tHashSet<String> query_terms = reader.getDocTerms(qUcid, PatentDocument.Description);\n\t\t\t//\t\t\tSystem.out.println(query_termsfreqspair.size() +\"\\t\"+ query_termsfreqspair);\n//\t\t\tSystem.out.println(query_terms.size() + \"\\t\" + query_terms);\n\t\t\t/*-----------------------------------------------------------------------------*/\t\t\t\n\n\n\t\t\t//\t\t\tSystem.out.println(\"-----TPs----\");\n\t\t\tfor (String tp : tps) {\n\t\t\t\t/*System.out.println(\"---------\");\n\t\t\t\tSystem.out.println(tp);*/\n\t\t\t\tHashMap<String, Integer> termsfreqsTP = reader.gettermfreqpairAllsecs(\"UN-\" + tp);\n\n\t\t\t\tfor(Entry<String, Integer> tfTP:termsfreqsTP.entrySet()){\n\t\t\t\t\tif(termsscores.containsKey(tfTP.getKey())){\n\t\t\t\t\t\ttermsscores.put(tfTP.getKey(), termsscores.get(tfTP.getKey()) + (float)tfTP.getValue()/tps.size());\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//\t\t\t\t\t\tfloat test = (float)t.getValue()/tps.size();\n\t\t\t\t\t\t//\t\t\t\t\t\tSystem.out.println(test);\n\t\t\t\t\t\ttermsscores.put(tfTP.getKey(), (float)tfTP.getValue()/tps.size());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//\t\t\t\tSystem.out.println(termsscores.size() + \" \" + termsscores);\t\t\t\t\t\n\t\t\t}\n\n\t\t\t/*System.out.println();\n\t\t\tSystem.out.println(\"-----FNs----\");*/\n\t\t\tfor (String fp : fps) {\n\t\t\t\t/*System.out.println(\"---------\");\n\t\t\t\tSystem.out.println(fp);*/\n\t\t\t\tHashMap<String, Integer> termsfreqsFP = reader.gettermfreqpairAllsecs(\"UN-\" + fp);\n\n\t\t\t\tfor(Entry<String, Integer> t:termsfreqsFP.entrySet()){\n\t\t\t\t\tif(termsscores.containsKey(t.getKey())){\n\t\t\t\t\t\ttermsscores.put(t.getKey(), termsscores.get(t.getKey()) - (float)t.getValue()/fps.size());\n\t\t\t\t\t}else{\t\t\t\t\t\t\n\t\t\t\t\t\ttermsscores.put(t.getKey(), -(float)t.getValue()/fps.size());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//\t\t\t\tSystem.out.println(TFreqs.size() + \" \" + TFreqs);\n\t\t\t}\n\t\t\t//\t\t\tSystem.out.println(termsscores.size() + \" \" + termsscores);\n\t\t\tValueComparator bvc = new ValueComparator(termsscores);\n\t\t\ttermsscoressorted = new TreeMap<String,Float>(bvc);\t\t\t\n\t\t\ttermsscoressorted.putAll(termsscores);\n\t\t\tSystem.out.println(queryid + \"\\t\"+ termsscoressorted.size() + \"\\t\" + termsscoressorted/*.keySet()*/);\n\t\t\tint overlap = 0;\n\t\t\tint i = 0;\n\t\t\tfor(Entry<String, Float> scoresorted:termsscoressorted.entrySet()){\n\t\t\t\ti++;\n\t\t\t\tif(i<=100){\n\t\t\t\t\tif(query_terms.contains(scoresorted.getKey())){\n\t\t\t\t\t\toverlap++;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tSystem.out.println(queryName + \"\\t\"+overlap);\n//\t\t\tps.println(queryName + \"\\t\"+overlap);\n\t\t}\n\t}", "private static void statsForQuery(String query) {\n\t\tHashMap<String,Integer> oldTerms=newTerms; // record the terms to analyze modified queries\n\t\tnewTerms=new HashMap<String,Integer>();\n\t\t\t\t\n\t\tString terms[]=query.split(\"\\\\s\");\t\t\t\t\n\t\tint matchingTerms=0;\n\t\tint matchingTermsStopwords=0;\n\t\tint matchingTermsOrder=0;\n\t\tfor (int j=0;j<terms.length;j++) {\n\t\t\tif (!terms[j].equals(\"\")) {\n\t\t\t \tif (oldTerms.containsKey(terms[j])) {\n\t\t\t \t\tmatchingTerms++;\t\t\t\t\t \n\t\t\t \t\tif (stopwordsMap.containsKey(terms[j])) { // match if it is stopword\n\t\t\t \t\t\tmatchingTermsStopwords++;\n\t\t\t \t\t}\n\t\t\t \t\tif (oldTerms.get(terms[j])==j) { // match if it has the same order\n\t\t\t \t\t\tmatchingTermsOrder++;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tnewTerms.put(terms[j],j);\n\t\t\t}\n\t\t}\t\n\n\t\tif (newTerms.size()==oldTerms.size() && matchingTerms==oldTerms.size() && matchingTerms>0) { // the queries have the same terms\n\t\t totalEqualTermsQueries++;\n\t\t\t\t \t\t\t\t \t\t\t\t\t\t \t\t\t\t \t\t\t\t \n\t\t if (matchingTermsStopwords==oldTerms.size()) {\n\t\t \ttotalEqualTermsStopwordsQueries++;\n\t\t }\n\t\t if (matchingTermsOrder==oldTerms.size()) {\n\t\t \ttotalEqualTermsOrderQueries++;\n\t\t }\n\t\t if (query.equals(oldQuery)) {\n\t\t \ttotalIdenticalQueries++;\n\t\t }\n\t\t if (sessionQueries.contains(query)) {\n\t\t \ttotalIdenticalSessionQueries++;\n\t\t }\n\t\t}\n\t\telse if (matchingTerms-matchingTermsStopwords>0) { // the queries have at least one term equal and diferent from a stopword\n\t\t totalModifiedQueries++;\n\t\t int index=newTerms.size()-oldTerms.size()+N_MODIFIED_TERMS_RANGE/2;\n\t\t if (index<0) {\n\t\t \tindex=0;\n\t\t }\n\t\t else if (index>N_MODIFIED_TERMS_RANGE-1) {\n\t\t \tindex=N_MODIFIED_TERMS_RANGE-1;\n\t\t }\n\t\t nModifiedTerms[index]++;\n\t\t}\n\t\toldQuery=query; \n\t\t\t\t\t\t\n\t\t// store session query\n\t\tsessionQueries.add(query);\n\t}", "static void returnTfIdfResults() {\n\t\tSet<String> specificWords = findKeywords();\n\n\t\t// for every phrase\n\t\tfor (String word : specificWords) {\n\t\t\t// get the total number of documents\n\t\t\tdouble totalSize = size;\n\n\t\t\t// get the collection of documents containing that word\n\t\t\tCollection<File> containingWordSet = invertedMap.getValues(word);\n\n\t\t\t// makes a new one if null (for ease of code)\n\t\t\tif (containingWordSet == null) {\n\t\t\t\tcontainingWordSet = new HashSet<File>();\n\t\t\t}\n\n\t\t\t// the number containing the word\n\t\t\tdouble numContainingWord = containingWordSet.size();\n\n\t\t\t// get the idf (log(total/(1 + |# contain word|)\n\t\t\t// it is normalize with 1 to prevent division by 0\n\t\t\tdouble idf = Math.log(totalSize / (1 + numContainingWord));\n\n\t\t\t// System.out.println(\"------------------\");\n\t\t\t// System.out.println(word + \" totalSize \" + totalSize);\n\t\t\t// System.out.println(word + \" numContainingWord \" +\n\t\t\t// numContainingWord);\n\t\t\t// System.out.println(word + \" idf \" + idf);\n\t\t\t// System.out.println(\"------------------\");\n\n\t\t\t// set the wordscore to 0\n\t\t\tdouble wordScore = 0;\n\n\t\t\t// for all of the files with the word\n\t\t\tfor (File file : containingWordSet) {\n\t\t\t\tString fileName = file.getName();\n\n\t\t\t\t// get the phrase count for this document\n\t\t\t\tInteger phraseCount = phraseCountMap.get(fileName);\n\t\t\t\tdouble numPhrases = phraseCount.doubleValue();\n\n\t\t\t\t// get the word frequency map for this page\n\t\t\t\tHashMap<String, Integer> docFreqMap = wordFreqMap.get(fileName);\n\t\t\t\tInteger freq = docFreqMap.get(word);\n\n\t\t\t\t// otherwise, get the tf\n\t\t\t\tdouble tf;\n\t\t\t\tif (freq == null) {\n\t\t\t\t\t// if it's not present, it's 0\n\t\t\t\t\ttf = 0;\n\t\t\t\t} else {\n\t\t\t\t\t// otherwise, it's the value\n\t\t\t\t\ttf = freq / numPhrases;\n\t\t\t\t\t// System.out.println(tf);\n\t\t\t\t}\n\n\t\t\t\t// multiply for this score\n\t\t\t\tdouble score = tf * idf;\n\n\t\t\t\t// add it to the page score\n\t\t\t\twordScore += score;\n\t\t\t}\n\n\t\t\t// make a node with the sum of tf-idf for all relevant phrases and\n\t\t\t// add to pq\n\t\t\tWordNode w = new WordNode(word, wordScore);\n\t\t\tpq.add(w);\n\t\t}\n\t}", "@Override\n protected QueryProcessor computeResult(ResultComputingContext<? extends TermsIndexingEquipment> context) {\n final TermWeight idf = context.preliminaryResult(CalculatingInvertedTermFrequency.getInstance());\n final TermDocumentWeight tf = context.preliminaryResult(context.equipment().termFrequencyCalculation());\n //for obtaining set of terms in each document.\n final EachDocumentTermsExtraction documentsTerms = context.preliminaryResult(ExtractingEachDocumentTerms.getInstance());\n //for obtaining document length\n final Map<Document, TermsOccurences> termsOccurences = context.preliminaryResult(CountingTermsOccurencesInEachDocument.getInstance());\n final double averageDocLength = context.preliminaryResult(ComputingAverageDocumentLength.getInstance());\n\n QueryProcessor res = new QueryProcessor() {\n @Override\n public DocumentRanker rankForQuery(final Collection<String> query) {\n return new DocumentRanker() {\n @Override\n public double score(Document document) {\n /*\n * BM25 score is calculated here\n */\n\n //obtaining the set of terms in the document\n Set<String> allDocTerms = documentsTerms.termsExtractedFromDocument(document).allTerms();\n\n //keeping only the query terms that are in the document\n Collection<String> relevantTerms = new LinkedHashSet<>(query);\n relevantTerms.retainAll(allDocTerms);\n\n //compute score using a sum formula on each query term\n int docLength = termsOccurences.get(document).totalNumberOfOccurences();\n double score = 0.0;\n for (String term : relevantTerms) {\n double termIDF = idf.weight(term);\n double termTF = tf.weight(term, document);\n\n score += termIDF * (termTF * (k1 + 1)) / (termTF + k1 * (1 - b + b * (docLength / averageDocLength)));\n }\n\n return score;\n }\n };\n\n }\n };\n\n logger.log(Level.INFO, \"Just created a BM25 query processor with parameters : \" + \"k1={0}, b={1}\", new Object[]{k1, b});\n\n return res;\n }", "public TreeSet<TermFrequencyPerFile> search(Query query)\n\t\t\tthrows SearcherException, InterruptedException, ExecutionException {\n\t\tClause tempClause;\n\t\t// Clauses with (start operator|default operator)\n\t\tList<Clause> andAndClauses = new LinkedList<Clause>();\n\t\tList<Clause> andOrClauses = new LinkedList<Clause>();\n\t\tList<Clause> orAndClauses = new LinkedList<Clause>();\n\t\tList<Clause> orOrClauses = new LinkedList<Clause>();\n\t\tList<Clause> tempClauses;\n\t\t// Sets with the clauses of (start operator|default operator)\n\t\tList<Future<TreeSet<TermFrequencyPerFile>>> andSets =\n\t\t\t\tnew LinkedList<Future<TreeSet<TermFrequencyPerFile>>>();\n\t\tList<Future<TreeSet<TermFrequencyPerFile>>> orSets =\n\t\t\t\tnew LinkedList<Future<TreeSet<TermFrequencyPerFile>>>();\n\t\t// Result set from sub-query\n\t\tList<TreeSet<TermFrequencyPerFile>> subAndSet =\n\t\t\t\tnew LinkedList<TreeSet<TermFrequencyPerFile>>();\n\t\tList<TreeSet<TermFrequencyPerFile>> subOrSet =\n\t\t\t\tnew LinkedList<TreeSet<TermFrequencyPerFile>>();\n\t\tList<TreeSet<TermFrequencyPerFile>> subNotSet =\n\t\t\t\tnew LinkedList<TreeSet<TermFrequencyPerFile>>();\n\t\t// Result set\n\t\tTreeSet<TermFrequencyPerFile> result;\n\t\t\n\t\tfor (int i = 0; i < query.size(); ++i) {\n\t\t\ttempClause = query.getClause(i);\n\t\t\t\n\t\t\tif (tempClause.isQuery()) {\n\t\t\t\tassignAllWorks(andAndClauses, andOrClauses\n\t\t\t\t\t\t, orAndClauses, orOrClauses, andSets, orSets);\n\t\t\t\tif ((tempClause.getStartOP() == null)\n\t\t\t\t\t\t|| tempClause.getStartOP().equals(Operator.AND)) {\n\t\t\t\t\tsubAndSet.add(search((Query) tempClause.getComponent()));\n\t\t\t\t} else if (tempClause.getStartOP().equals(Operator.OR)) {\n\t\t\t\t\tsubOrSet.add(search((Query) tempClause.getComponent()));\n\t\t\t\t} else {\n\t\t\t\t\tsubNotSet.add(search((Query) tempClause.getComponent()));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Group similar clauses\n\t\t\ttempClauses = termSearch(tempClause, andAndClauses\n\t\t\t\t\t, andOrClauses, orAndClauses, orOrClauses);\n\t\t\t\n\t\t\t// Assign work\n\t\t\tif (tempClauses != null) {\n\t\t\t\t// A clause is ready to get queried\n\t\t\t\tassignWork(tempClauses, andSets, orSets);\n\t\t\t} else {\n\t\t\t\tif ((tempClause.getStartOP() != null) \n\t\t\t\t\t\t&& tempClause.getStartOP().equals(Operator.NOT)) {\n\t\t\t\t\tTerm t = (Term)tempClause.getComponent();\n\t\t\t\t\tassert(t.size() == 1);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsubNotSet.add(notSearch(tempClause));\n\t\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tassignAllWorks(andAndClauses, andOrClauses\n\t\t\t\t, orAndClauses, orOrClauses, andSets, orSets);\n\t\t\n\t\t// Wait for AND set result\n\t\tfor (Future<TreeSet<TermFrequencyPerFile>> future: andSets) {\n\t\t\tsubAndSet.add(future.get());\n\t\t}\n\t\t// Integrate All relations at current clause level\n\t\tresult = intersect(subAndSet);\n\t\t\n\t\t// Wait for OR set result\n\t\tfor (Future<TreeSet<TermFrequencyPerFile>> future: orSets) {\n\t\t\tsubOrSet.add(future.get());\n\t\t}\n\t\tfor (TreeSet<TermFrequencyPerFile> set: subOrSet) {\n\t\t\tresult.addAll(set);\n\t\t}\n\n\t\t// Exclude NOT queries\n\t\tresult.removeAll(subNotSet);\n\t\t\n\t\treturn result;\n\t}", "private void termQuerySearch(String[] terms) {\n for (String term : terms) {\n LinkedList<TermPositions> postingLists = indexMap.get(analyzeTerm(term));\n if (postingLists != null) {\n for (TermPositions matches : postingLists) {\n double score = (double) 1 + Math.log((double) matches.getPositionList().size()) *\n Math.log((double) N / (double) postingLists.size());\n resultsCollector.add(new DocCollector(matches.getDocId(), score));\n }\n }\n }\n }", "protected void calculaterVSMforAllQuery(String type)\n {\n ArrayList<String> resultAll=new ArrayList<>();\n for(String qid: this.queryTFscore.keySet())\n {\n //System.out.println(qid+\"----------------------------------------------------------------------------------------------\"+this.maxLength+\" \"+this.minLength);\n HashMap<String, Double> queryInfo=this.queryTFscore.get(qid);\n System.out.println(qid+\" \"+queryInfo);\n HashMap <String, Double> finalResult=new HashMap<>();\n for(String docID:this.corpusTFscore.keySet())\n {\n HashMap<String, Double> docInfo=this.corpusTFscore.get(docID);\n double upperscore=this.calculateUpperPart(queryInfo, docInfo, docID);\n double lowerscore=this.calculateLowerPart(queryInfo, docInfo, docID);\n double score=0.0;\n \n //Calculate gTerms\n //Calculate Nx\n double Nx=0.0;\n if(this.LengthInfoMap.containsKey(docID)){\n Nx=(this.LengthInfoMap.get(docID)-this.minLength)/(this.maxLength-this.minLength);\n }\n \n //Calculate gTerms\n double gTerms=1/(1+Math.exp(-Nx));\n if(upperscore!=0&&lowerscore!=0) score=gTerms*(upperscore)/lowerscore;\n //if(upperscore!=0&&lowerscore!=0) score=(upperscore)/lowerscore;\n if(score>0) {\n //System.out.println(docID+\" = \"+score);\n finalResult.put(docID, score);\n }\n \n }\n HashMap<String, Double> normalizedAndSortedResult=doNormalization(finalResult);\n //HashMap<String, Double> sortedResult=MiscUtility.sortByValues(finalResult);\n //System.out.println(normalizedAndSortedResult);\n int count=0;\n for(String docID:normalizedAndSortedResult.keySet())\n {\n if(count>9) break;\n String fullPath=this.corpusMap.get(docID);\n resultAll.add(qid+\",\"+fullPath+\",\"+normalizedAndSortedResult.get(docID));\n count++;\n }\n }\n ContentWriter.writeContent(this.base+\"\\\\Result\\\\\"+this.corpus+\"_result\"+type+\".txt\", resultAll);\n }", "public static void QueryVector() {\n for(Entry<String, List<Double>> entry: wtgMap.entrySet()){\n List<Double> queryValue = new ArrayList();\n queryValue = entry.getValue();\n double temp = queryValue.get(totaldocument);\n\n query.add(temp);\n }\n }", "public Query( String queryString ) {\r\n\tStringTokenizer tok = new StringTokenizer( queryString );\r\n\twhile ( tok.hasMoreTokens() ) {\r\n\t terms.add( tok.nextToken() );\r\n\t weights.add( new Double(1) );\r\n\t} \r\n }", "@Override\n public double score(Document document) {\n Set<String> allDocTerms = documentsTerms.termsExtractedFromDocument(document).allTerms();\n\n //keeping only the query terms that are in the document\n Collection<String> relevantTerms = new LinkedHashSet<>(query);\n relevantTerms.retainAll(allDocTerms);\n\n //compute score using a sum formula on each query term\n int docLength = termsOccurences.get(document).totalNumberOfOccurences();\n double score = 0.0;\n for (String term : relevantTerms) {\n double termIDF = idf.weight(term);\n double termTF = tf.weight(term, document);\n\n score += termIDF * (termTF * (k1 + 1)) / (termTF + k1 * (1 - b + b * (docLength / averageDocLength)));\n }\n\n return score;\n }", "public PostingsList phrase_query(Query query){\n\n LinkedList<PostingsList> listQueriedPostings = new LinkedList<PostingsList>();\n // List with postings corresponding to the queries\n for (int i = 0; i<query.size(); i++){\n // If any query has zero matches, return 0 results\n //if(!(new File(\"postings/t\"+hash(query.terms.get(i))+\".json\")).exists()){\n if (!this.index.containsKey(query.terms.get(i))){\n return null;\n }\n // Otherwise store postings in the list\n listQueriedPostings.add(this.getPostings(query.terms.get(i)));\n }\n\n PostingsList result = new PostingsList();\n result = listQueriedPostings.get(0);\n\n // In case only one word is queried\n if (listQueriedPostings.size() == 1){\n return result;\n }\n\n // Apply algorithm as many times as words in the query\n for(int i = 1; i < listQueriedPostings.size(); i++){\n result = phrase_query(result, listQueriedPostings.get(i));\n if (result.isEmpty()){\n return null;\n }\n }\n return result;\n }", "@Override\n public List<SearchResult> search(String queryString, int k) {\n // TODO: YOUR CODE HERE\n\n // Tokenize the query and put it into a Set\n HashSet<String> tokenSet = new HashSet<>(Searcher.tokenize(queryString));\n\n /*\n * Section 1: FETCHING termId, termFreq and relevant docId from the Query\n */\n\n // Init a set to store Relevant Document Id\n HashSet<Integer> relevantDocIdSet = new HashSet<>();\n for (String token : tokenSet) { // Iterates thru all query tokens\n int termId;\n try {\n termId = indexer.getTermDict().get(token);\n } catch (NullPointerException e) { // In case current token is not in the termDict\n continue; // Skip this one\n }\n // Get the Posting associate to the termId\n HashSet<Integer> posting = indexer.getPostingLists().get(termId);\n relevantDocIdSet.addAll(posting); // Add them all to the Relevant Document Id set\n }\n\n /*\n * Section 2: Calculate Jaccard Coefficient between the Query and all POTENTIAL DOCUMENTS\n */\n\n // ArrayList for the Final Result\n ArrayList<SearchResult> searchResults = new ArrayList<>();\n for (Document doc : documents) { // Iterates thru all documents\n if (!relevantDocIdSet.contains(doc.getId())) { // If the document is relevant\n searchResults.add(new SearchResult(doc, 0)); // Add the document as a SearchResult with zero score\n } else {\n HashSet<String> termIdSet = new HashSet<>(doc.getTokens()); // Get the token set from the document\n\n // Calculate Jaccard Coefficient of the document\n double jaccardScore = JaccardMathHelper.calculateJaccardSimilarity(tokenSet, termIdSet);\n\n // Add the SearchResult with the computed Jaccard Score\n searchResults.add(new SearchResult(doc, jaccardScore));\n }\n }\n\n return TFIDFSearcher.finalizeSearchResult(searchResults, k);\n }", "private static List<SearchData> booleanSearchFrequency(Query query, Indexer si) {\n Tokenizer tkn = new SimpleTokenizer();\n tkn.tokenize(query.getStr(), \"[a-zA-Z]{3,}\", true, true);\n List<SearchData> searchList = new ArrayList<>();\n LinkedList<Token> wordsList = tkn.getTokens();\n Iterator<Token> wordsIt = wordsList.iterator();\n HashMap<String, LinkedList<Posting>> indexer = si.getIndexer();\n int idx;\n SearchData searched_doc;\n\n while (wordsIt.hasNext()) {\n String word = wordsIt.next().getSequence();\n if (indexer.containsKey(word)) {\n\n LinkedList<Posting> posting = indexer.get(word);\n\n for (Posting pst : posting) {\n\n SearchData sd = new SearchData(query, pst.getDocId());\n\n if (!searchList.contains(sd)) {\n sd.setScore(pst.getTermFreq());\n searchList.add(sd);\n } else {\n idx = searchList.indexOf(sd);\n searched_doc = searchList.get(idx);\n searched_doc.setScore(searched_doc.getScore() + pst.getTermFreq());\n }\n }\n }\n }\n\n Collections.sort(searchList);\n\n return searchList;\n }", "private double rankByBM25(List<String> query, String docId, HashMap<String,Integer> queryWordsTFPerDoc){\n int termFrequency, documentFrequency;\n double numOfDocs = documentDetails.size(), idf, rank = 0, k = 1.2, b = 0.75, numerator, denominator;\n int documentLength = Integer.valueOf(documentDetails.get(docId)[3]);\n\n for(String term : query){\n if(queryWordsTFPerDoc.containsKey(term.toUpperCase())) {\n term = term.toUpperCase();\n }\n else if(queryWordsTFPerDoc.containsKey(term.toLowerCase())){\n term = term.toLowerCase();\n }\n termFrequency = queryWordsTFPerDoc.getOrDefault(term,0);\n\n if(termFrequency != 0) {\n documentFrequency = Integer.valueOf(termsDF.get(term));\n idf = log2(numOfDocs / documentFrequency);\n\n numerator = termFrequency * (k + 1);\n denominator = termFrequency + k * (1 - b + b * (documentLength / averageDocumentLength));\n\n rank += idf * (numerator / denominator);\n }\n }\n return rank;\n }", "private static List<SearchData> booleanSearchWord(Query query, Indexer si) {\n Tokenizer tkn = new SimpleTokenizer();\n tkn.tokenize(query.getStr(), \"[a-zA-Z]{3,}\", true, true);\n List<SearchData> searchList = new ArrayList<>();\n LinkedList<Token> wordsList = tkn.getTokens();\n Iterator<Token> wordsIt = wordsList.iterator();\n HashMap<String, LinkedList<Posting>> indexer = si.getIndexer();\n int idx;\n SearchData searched_doc;\n\n while (wordsIt.hasNext()) {\n String word = wordsIt.next().getSequence();\n if (indexer.containsKey(word)) {\n\n LinkedList<Posting> posting = indexer.get(word);\n\n for (Posting pst : posting) {\n\n SearchData sd = new SearchData(query, pst.getDocId());\n\n if (!searchList.contains(sd)) {\n sd.setScore(1);\n searchList.add(sd);\n } else {\n idx = searchList.indexOf(sd);\n searched_doc = searchList.get(idx);\n searched_doc.setScore(searched_doc.getScore() + 1);\n }\n }\n\n }\n\n\n }\n\n Collections.sort(searchList);\n\n return searchList;\n }", "public PostingsList intersect(Query query){\n\n LinkedList<PostingsList> listQueriedPostings = new LinkedList<PostingsList>();\n // List with postings corresponding to the queries\n for (int i = 0; i<query.size(); i++){\n // If any query has zero matches, return 0 results\n //if(!(new File(\"postings/t\"+hash(query.terms.get(i))+\".json\")).exists()){\n if (!this.index.containsKey(query.terms.get(i))){\n return null;\n }\n // Otherwise store postings in the list\n listQueriedPostings.add(this.getPostings(query.terms.get(i)));\n }\n\n // Order the posting list by increasing document frequency\n listQueriedPostings = sortByIncreasingFrequency(listQueriedPostings);\n\n PostingsList result = (PostingsList)listQueriedPostings.get(0);\n\n // In case only one word is queried\n if (listQueriedPostings.size() == 1){\n return result;\n }\n\n // Apply algorithm as many times as words in the query\n for(int i = 1; i < listQueriedPostings.size(); i++){\n result = intersect(result, listQueriedPostings.get(i));\n if (result.isEmpty()){\n return null;\n }\n }\n return result;\n }", "private List<Integer> processRelatedDocsQuery(String query) {\r\n List<Integer> result = new ArrayList<>();\r\n\r\n for(String term : this.preprocessor.processQuery(query).keySet()) {\r\n\r\n // skip unknown terms\r\n if (!this.index.getDict().containsKey(term)) continue;\r\n\r\n // for each occurrence\r\n for(TermFrequency tf : this.index.getDict().get(term)){\r\n int id = tf.getDocId();\r\n if(!result.contains(id))\r\n result.add(id);\r\n }\r\n }\r\n\r\n return result;\r\n }", "@Override\r\n\t\t\tpublic List<ScoredDocument> search(Query query) {\n\t\t\t\treturn null;\r\n\t\t\t}", "public Double computeRelevance(IList<String> query, URI pageUri) {\n\t if (query == null || pageUri == null) {\n\t\t throw new NullPointerException();\n\t }\n\t \n IDictionary<String, Double> documentVector = documentTfIdfVectors.get(pageUri);\n IDictionary<String, Double> queryTfScores = computeTfScores(query);\n IDictionary<String, Double> queryVector = new ChainedHashDictionary<String, Double>();\n Double numerator = 0.0;\n \n for (KVPair<String, Double> pair: queryTfScores) {\n\t \t\tDouble queryWordScore = 0.0;\n\t \t\tDouble docWordScore = 0.0;\n\t \t\tif (idfScores.containsKey(pair.getKey())) {\t\n\t \t\t queryWordScore = queryTfScores.get(pair.getKey()) * idfScores.get(pair.getKey());\n\t \t\t}\n \t\t\tqueryVector.put(pair.getKey(), queryWordScore);\n\t \t\tif (documentVector.containsKey(pair.getKey())) {\n\t \t\t\tdocWordScore = documentVector.get(pair.getKey());\n\t \t\t} \n\t \t\tnumerator += queryWordScore * docWordScore;\n } \n \n Double denominator = docDenomScore.get(pageUri) * norm(queryVector);\n \n // A check to avoid division by zero\n if (denominator != 0.0) {\n \t\t return numerator / denominator;\n } else {\n return 0.0;\n }\n }", "static void ReadQuery(String input) throws FileNotFoundException {\n input = input.replaceAll(\"[^A-Za-z]\",\" \");\n String[] arr = input.split(\" \"); // splitting the whole string into words by split on the basis of white spaces\n\n\n for(int i=0; i<arr.length; i++) {\n String termWord = arr[i].toLowerCase();\t//same pre-processing is applied to all the query word\n //termWord = RemoveSpecialCharacter(termWord);\n termWord = removeStopWords(termWord);\n\n if(!termWord.equalsIgnoreCase(\"\")) { // all the white spaces are removed as if not removed then lemmatization wont be successfully done\n\n termWord = Lemmatize(termWord);\n System.out.println(termWord);\n if(dictionary.containsKey(termWord)) {\n List<Integer> wordList = new ArrayList<>();\n wordList = dictionary.get(termWord);\n int queryWordFrequency = wordList.get(totaldocument);\n queryWordFrequency++;\n wordList.set(totaldocument, queryWordFrequency); // all the frequencies of the query words are stored at the 56th index of the List stored in the\n //hashmap associated with its word-terms\n dictionary.put(termWord, wordList);\n }\n else {\n //if any of the enterd query word not present in all the docs so list will have 0.0 value from 0th index to 55th and 56th index is reserver\n // for query word frequency\n List<Integer> wordList = new ArrayList<>();\n for(int j=0; j<totaldocument+1; j++) {\n wordList.add(0);\n }\n wordList.add(1);\n dictionary.put(termWord, wordList); //updating the dictionary hashmap now containing all the query words frequencies\n }\n }\n }\n save();\n }", "private static void RankedQueryMode(DiskIndexWriter diskWriter, DiskPositionalIndex disk_posIndex) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {\n\n if (query.equals(\"q\")) {\n\n System.exit(0);\n }\n\n List<String> word = new ArrayList();\n String[] query_array = query.split(\"\\\\s+\");\n TokenProcessor processor = new NewTokenProcessor();\n\n for (int i = 0; i < query_array.length; i++) {\n word.add(processor.processToken(query_array[i]).get(0));\n }\n\n StrategyFactory sf = new StrategyFactory();\n StrategyInterface strategy = sf.execute(rankedOption);\n\n //maps postings to accumulator value\n HashMap<Integer, Doc_accum> postingMap = new HashMap<Integer, Doc_accum>();\n\n PriorityQueue<Doc_accum> queue = new PriorityQueue<>(Collections.reverseOrder());\n\n List<Posting> postings = new ArrayList<>();\n List<Doc_accum> results = new ArrayList<>();\n\n for (String term : word) {\n\n postings = disk_posIndex.getPosting_noPos(term);\n for (Posting p : postings) { //for each document in the postings list\n double t_fd = p.getT_fd();\n double d_ft = p.getD_ft();\n double w_qt = strategy.calculate_wqt(N, d_ft);\n double accum = 0;\n double w_dt = strategy.get_wdt(t_fd, disk_posIndex, p.getDocumentId());\n\n //pairs (Ranked_posting, accumulator factor)\n if (postingMap.containsKey(p.getDocumentId())) {\n accum = postingMap.get(p.getDocumentId()).getAccumulator();\n accum += (w_qt * w_dt);\n postingMap.replace(p.getDocumentId(), new Doc_accum(p, accum)); //replaces old accum value\n\n } else {\n accum += (w_qt * w_dt);\n postingMap.put(p.getDocumentId(), new Doc_accum(p, accum));\n }\n }\n\n }\n\n for (Integer p : postingMap.keySet()) {\n Doc_accum doc_temp = postingMap.get(p);\n double accum = doc_temp.getAccumulator(); //gets accum associated with doc\n\n if (accum > 0) {\n //search for each p's Ld factor in docWeights.bin\n double l_d = strategy.calculate_Ld(disk_posIndex, doc_temp.getPosting().getDocumentId());\n\n accum /= l_d;\n doc_temp.setAccumulator(accum);\n }\n\n queue.add(postingMap.get(p));\n\n }\n\n //returns top K=10 results \n int topK = 50;\n\n while ((results.size() < topK) && queue.size() > 0) {\n\n results.add(queue.poll()); //gets the posting acc pair and returns only posting\n\n }\n\n display_RankedResults(results);\n\n }", "public void searchAndWriteQueryResultsToOutput() {\n\n List<String> queryList = fu.textFileToList(QUERY_FILE_PATH);\n\n for (int queryID = 0; queryID < queryList.size(); queryID++) {\n String query = queryList.get(queryID);\n // ===================================================\n // 4. Sort the documents by the BM25 scores.\n // ===================================================\n HashMap<String, Double> docScore = search(query);\n List<Map.Entry<String, Double>> rankedDocList =\n new LinkedList<Map.Entry<String, Double>>(docScore.entrySet());\n Collections.sort(rankedDocList, new MapComparatorByValues());\n\n // ===================================================\n // 5. Write Query Results to output\n // =================================================== \n String outputFilePath =\n RANKING_RESULTS_PATH + \"queryID_\" + (queryID + 1) + \".txt\";\n StringBuilder toOutput = new StringBuilder();\n // display results in console\n System.out.println(\"Found \" + docScore.size() + \" hits.\");\n int i = 0;\n for (Entry<String, Double> scoreEntry : rankedDocList) {\n if (i >= NUM_OF_RESULTS_TO_RETURN)\n break;\n String docId = scoreEntry.getKey();\n Double score = scoreEntry.getValue();\n String resultLine =\n (queryID + 1) + \" Q0 \" + docId + \" \" + (i + 1) + \" \" + score + \" BM25\";\n toOutput.append(resultLine);\n toOutput.append(System.getProperty(\"line.separator\"));\n System.out.println(resultLine);\n i++;\n }\n fu.writeStringToFile(toOutput.toString(), outputFilePath);\n }\n }", "private static Boolean specialQueries(String query) throws ClassNotFoundException, InstantiationException, IllegalAccessException {\n clickList = false;\n //newCorpus = true;\n\n if (query.equals(\"q\")) {\n\n System.exit(0);\n return true;\n }\n\n String[] subqueries = query.split(\"\\\\s+\"); //split around white space\n\n if (subqueries[0].equals(\"stem\")) //first term in subqueries tells computer what to do \n {\n GUI.JListModel.clear();\n GUI.ResultsLabel.setText(\"\");\n TokenProcessor processor = new NewTokenProcessor();\n if (subqueries.length > 1) //user meant to stem the token not to search stem\n {\n List<String> stems = processor.processToken(subqueries[1]);\n\n //clears list and repopulates it \n String stem = \"Stem of query '\" + subqueries[1] + \"' is '\" + stems.get(0) + \"'\";\n\n GUI.ResultsLabel.setText(stem);\n\n return true;\n }\n\n } else if (subqueries[0].equals(\"vocab\")) {\n List<String> vocabList = Disk_posIndex.getVocabulary();\n GUI.JListModel.clear();\n GUI.ResultsLabel.setText(\"\");\n\n int vocabCount = 0;\n for (String v : vocabList) {\n if (vocabCount < 1000) {\n vocabCount++;\n GUI.JListModel.addElement(v);\n }\n }\n GUI.ResultsLabel.setText(\"Total size of vocabulary: \" + vocabCount);\n return true;\n }\n\n return false;\n }", "SwiftScoredSet getTfIdf(String text,ASTNode n,boolean kgram)\n{\n Map<String,Integer> words = null;\n Map<String,Integer> totals = null;\n double tot = 0;\n if (kgram){\n words = buildKgramCounts(text,n);\n totals = kgram_counts;\n tot = total_kdocuments;\n } \n else {\n words = handleDocumentText(text);\n totals = document_counts;\n tot = total_documents;\n }\n double termtot = 1;\n \n for (Integer iv : words.values()) {\n termtot += iv;\n }\n \n SwiftScoredSet rslt = new SwiftScoredSet();\n for (Map.Entry<String,Integer> ent : words.entrySet()) {\n String wd = ent.getKey();\n double ct = ent.getValue();\n Integer docs = totals.get(wd);\n double docct = 0;\n if (docs != null) docct = docs;\n double idf = Math.log(tot/(1+docct));\n double tf = ct/termtot;\n double tfidf = tf*idf;\n rslt.add(wd,tfidf);\n }\n rslt.normalize();\n \n return rslt;\n}", "public void queryDataPreProcess(String queryText) throws Exception {\n StopwordRemover stopwordRemover = new StopwordRemover();\n WordNormalizer wordNormalizer = new WordNormalizer();\n\n // initiate the BufferedWriter to output result\n FilePathGenerator fpg = new FilePathGenerator(\"result.txt\");\n String path = fpg.getPath();\n\n // queryId\n String queryId = \"\";\n if (queryId == null || queryId.length() == 0){\n// queryId = UUID.randomUUID().toString().replace(\"-\", \"\");\n queryId = String.valueOf(FileConst.query_doc_id);\n }\n\n // append query_id:query_text to exiting doc_id:doc_content text file\n try (FileWriter fileWriter = new FileWriter(path, true); // Path.ResultAssignment1\n BufferedWriter bw = new BufferedWriter(fileWriter)){\n // write doc_id into the result file\n bw.write(queryId + '\\n');\n\n // load doc content\n char[] content = queryText.toCharArray();\n\n // initiate a word object to hold a word\n char[] word;\n\n // initiate the WordTokenizer\n WordTokenizer tokenizer = new WordTokenizer(content);\n\n // process the query word by word iteratively\n while ((word = tokenizer.nextWord()) != null){\n word = wordNormalizer.lowercase(word);\n // write only non-stopword into result file\n if (!stopwordRemover.isStopword(Arrays.toString(word))){\n bw.append(wordNormalizer.toStem(word)).append(\" \");\n query_tokens.add(wordNormalizer.toStem(word));\n }\n }\n bw.append(\"\\n\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public String [] getTerm (String [] query) {\r\n String [] unique = query;\r\n //find duplicate for get unique\r\n return unique;\r\n }", "private static ArrayList<Result> distanceMatching(Query query, DataManager myVocab) {\n\t\tString queryterm = query.getQuery();\n\t\tint maxScore;\n\t\tif (queryterm.length()<9)\n\t\t\tmaxScore= queryterm.length()-THRESHOLD_LEV;\n\t\telse\n\t\t\tmaxScore = queryterm.length()-(queryterm.length()/THRESHOLD_LEV);\n\t\tArrayList<Result> fuzzyResults = new ArrayList<Result>();\n\t\tfor (int i = 0; i < myVocab.vocab.size(); i++){\n\t\t\tString vocabterm = myVocab.vocab.get(i).trim();\n\t\t\tint distance = levenshteinDistance(vocabterm, queryterm);\n\t\t\t// subtract the distance that's just the length difference\n\t\t\t// to only take into account the character substitution\n\t\t\tdistance = distance - (Math.abs(vocabterm.length() - queryterm.length()));\n\t\t\tif (distance < maxScore){\n\t\t\t\tdouble score;\n\t\t\t\tif (vocabterm.length() < queryterm.length())\n\t\t\t\t\tscore = ((double)(vocabterm.length())/(double)(queryterm.length()+distance))*99;\n\t\t\t\telse\n\t\t\t\t\tscore = (((double)queryterm.length()/(double)(vocabterm.length()+distance)))*99;\n\t\t\t\tfuzzyResults.add(new Result(query.getType()+\"/\"+myVocab.vocab.get(i), myVocab.vocab.get(i), query.getType(),score, false));\n\t\t\t}\n\t\t}\n\t\treturn fuzzyResults;\n\t}", "public static Map<Integer, Double> accumulate(DiskPositionalIndex index, int corpusSize, String query) throws IOException {\n Map<Integer, Double> accumulator = new HashMap<>();\n\n getTokens(query).forEach((token) -> {\n List<Posting> postings = index.getPostings(token);\n\n System.out.println(\"Postings size: \" + postings.size());\n \n //Calculate w(q,t) \n double wQT = 0.0, accu = 0.0, wDT = 0.0;\n \n if (!postings.isEmpty()) {\n wQT = Math.log(1.0 + ((double) corpusSize / (double) postings.size()));\n }\n\n for (Posting p : postings) {\n // Never encountered, add and initialize\n // if (!accumulator.containsKey(p.getDocumentId())) {\n // accumulator.put(p.getDocumentId(), 0.0);\n // }\n \n // Calculate weight of doc = 1 + ln(tf(t,d)) \n // wDT = 1.0 + Math.log((double) p.getPositions().size());\n wDT = p.getTermFrequency();\n \n // Acquire A(d)\n accu = accumulator.getOrDefault(p.getDocumentId(), 0.0); \n \n accumulator.put(p.getDocumentId(), accu + (wQT * wDT));\n }\n });\n \n // Divide all A(d) by L(d)\n for (Integer key : accumulator.keySet()) {\n if (accumulator.get(key) != 0.0) {\n // Accumulator = Accumulator / L(d)\n accumulator.put(key, (double) accumulator.get(key) / index.getDocWeight(key));\n }\n }\n \n return accumulator; \n }", "public void queryRecommended(Query query, float score, String original);", "public void search(Indexer indexer, CityIndexer cityIndexer, Ranker ranker, String query, boolean withSemantic, ArrayList<String> chosenCities, ObservableList<String> citiesByTag, boolean withStemming, String saveInPath, String queryId, String queryDescription) {\n String[] originalQueryTerms = query.split(\" \");\n String originQuery = query;\n docsResults = new HashMap<>();\n parser = new Parse(withStemming, saveInPath, saveInPath);\n HashSet<String> docsOfChosenCities = new HashSet<>();\n query = \"\" + query + queryDescription;\n HashMap<String, Integer> queryTerms = parser.parseQuery(query);\n HashMap<String, ArrayList<Integer>> dictionary = indexer.getDictionary();\n if (!withStemming){\n setDocsInfo(saveInPath + \"\\\\docsInformation.txt\");\n }\n else{\n setDocsInfo(saveInPath + \"\\\\docsInformation_stemming.txt\");\n }\n\n\n //add semantic words of each term in query to 'queryTerms'\n if(withSemantic) {\n HashMap<String,ArrayList<String>> semanticWords = ws.connectToApi(originQuery);\n }\n\n //give an ID to query if it's a regular query (not queries file)\n if(queryId.equals(\"\")){\n queryId = \"\" + Searcher.queryID;\n Searcher.queryID++;\n }\n\n String postingDir;\n if (!withStemming) {\n postingDir = \"\\\\indexResults\\\\postingFiles\";\n } else {\n postingDir = \"\\\\indexResults\\\\postingFiles_Stemming\";\n }\n int pointer = 0;\n\n //find docs that contain the terms in the query in their text\n HashMap<String, Integer> queryTermsIgnoreCase = new HashMap<>();\n for (String term : queryTerms.keySet()) {\n String originTerm = term;\n if (!dictionary.containsKey(term.toUpperCase()) && !dictionary.containsKey(term.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(term.toLowerCase())){\n term = term.toLowerCase();\n }\n else {\n term = term.toUpperCase();\n }\n queryTermsIgnoreCase.put(term,queryTerms.get(originTerm));\n pointer = dictionary.get(term).get(2);\n String chunk = (\"\" + term.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsResults'\n if(line != null) {\n findDocsFromLine(line, term);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their text\n for (String cityTerm : chosenCities) {\n if (!dictionary.containsKey(cityTerm) && !dictionary.containsKey(cityTerm.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(cityTerm.toLowerCase())){\n cityTerm = cityTerm.toLowerCase();\n }\n pointer = dictionary.get(cityTerm).get(2);\n // char chunk = indexer.classifyToPosting(term).charAt(0);\n String chunk = (\"\" + cityTerm.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(0, line.indexOf(\"[\") - 1); //get 'docsListStr'\n String[] docsArr = docs.split(\";\");\n for (String docInfo : docsArr) {\n String doc = docInfo.substring(0, docInfo.indexOf(\": \"));\n while(doc.charAt(0) == ' '){\n doc = doc.substring(1);\n }\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their city tag\n if(!chosenCities.isEmpty()){\n for (String cityDicRec: chosenCities) {\n //get pointer to posting from cityDictionary\n try {\n pointer = cityIndexer.getCitiesDictionary().get(cityDicRec);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + \"\\\\cityIndexResults\" + \"\\\\posting_city\" + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(line.indexOf(\"[\") + 1, line.indexOf(\"]\")); //get 'docsListStr'\n String[] docsArr = docs.split(\"; \");\n for (String doc : docsArr) {\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n\n ranker.rank(docsResults, docsOfChosenCities, queryTermsIgnoreCase, dictionary, docsInfo,entities, queryId);\n }", "public HashMap<String, Double> GetTokenRFScore(Query aQuery, int TopK) throws Exception {\r\n\t\t// Store <token, score> for being returned\r\n\t\tHashMap<String, Double> TokenRFScore = new HashMap<>();\r\n\t\t\r\n\t\t// Get tokens in the given query\r\n\t String[] tokens = aQuery.getQueryContent().split(\" \");\r\n\t \r\n\t // Get feedback docs by the given query using feedback retrieval model\r\n\t List<Classes.Document> feedbackDocs = new QueryRetrievalModel().retrieveQuery(aQuery, TopK);\r\n\r\n\t // Initiate qeuryResult map <docid, <term, tf>> and termFreq map <term, cf>\r\n\t queryResult = new HashMap<>();\r\n\t termFreq = new HashMap<>();\r\n\r\n\t // Search each token appearing in the given query \r\n\t for(String token : tokens) {\r\n\t \t// Determine whether the current token exists in collection \r\n\t \tlong cf = myireader.CollectionFreq(token);\r\n\t \ttermFreq.put(token, cf);\r\n\t \tif(cf == 0) {\r\n\t \t\tcontinue; \r\n\t \t}\r\n\t \r\n\t \tint[][] postingList = myireader.getPostingList(token);\r\n\t \tfor(int[] posting : postingList) {\r\n\t \t\tif(!queryResult.containsKey(posting[0])) { // posting[0]: docid\r\n\t \t\t\tHashMap<String, Integer> tfMap = new HashMap<>();\r\n\t \t\t\ttfMap.put(token, posting[1]); // posting[1]: tf\r\n\t \t\t\tqueryResult.put(posting[0], tfMap);\r\n\t \t\t} else {\r\n\t \t\t\tqueryResult.get(posting[0]).put(token, posting[1]);\r\n\t \t\t}\r\n\t \t}\r\n\t }\r\n\t /*\r\n\t\t * After the for loop, we have the map <docid, <term, term_freq>> for each doc to all terms in the query\r\n\t\t * tokens = [Hong, Kong, economics, Singapore]\r\n\t\t * \r\n\t\t * queryResult : <docid, <term, term_freq>>\r\n\t\t * 1, hong, 15\r\n\t\t * Singapore, 3\r\n\t\t * 3, Singapore, 1\r\n\t\t * kong, 10\r\n\t\t * economics, 30\r\n\t\t * ..., ...\r\n\t\t */\t\r\n\r\n\t // Here all feedback docs are treated as one big pseudo document!!!!!!\r\n\t int len = 0;\r\n\t // Store <term, tf>\r\n\t Map<String, Integer> pseudoDoc = new HashMap<>();\r\n\t for(Classes.Document doc : feedbackDocs) {\r\n\t \tqueryResult.get(Integer.parseInt(doc.getLuceneID())).forEach((term, tf) -> { // Iterate each tfMap\r\n\t \t\tif(!pseudoDoc.containsKey(term)) {\r\n\t \t\t\tpseudoDoc.put(term, tf);\r\n\t \t\t} else {\r\n\t \t\t\tpseudoDoc.put(term, tf + pseudoDoc.get(term));\r\n\t \t\t}\r\n\t \t});\r\n\t \t\r\n\t \t// Accumulate by the current doc's length\r\n\t \tlen += myireader.docLength(Integer.parseInt(doc.getLuceneID()));\r\n\t }\r\n\t \r\n\t /**\r\n\t\t * Dirichlet Prior Smoothing:\r\n\t\t * p(w|D) = (|D|/(|D|+MU))*(c(w,D)/|D|) + (MU/(|D|+MU))*p(w|REF)\r\n\t * score = λ*p_doc + (1-λ)*p_ref\r\n\t * = c1*p_doc + c2*p_ref\r\n\t\t */\r\n\t int pseudoLen = len;\r\n\t double c1 = pseudoLen / (pseudoLen + MU);\r\n\t double c2 = MU / (pseudoLen + MU);\r\n\t // Calculate the probability of pseudoDoc generating each term\r\n\t pseudoDoc.forEach((token, tf) -> {\r\n\t \tlong cf = termFreq.get(token);\r\n\t \tdouble pDoc = (double) tf / pseudoLen; // p(w|D)\r\n\t \tdouble pRef = (double) cf / CORPUS_SIZE; // p(w|REF)\r\n\t \tdouble score = c1 * pDoc + c2 * pRef;\r\n\t \t\r\n\t \t// Get the RF probability of each token \r\n\t \tTokenRFScore.put(token, score); \r\n\t });\r\n\r\n\t\treturn TokenRFScore;\r\n\t}", "@Test\n\tpublic void testKeywordQuery(){\n\t\t//manager.getResponse(\"american football \"); //match multiple keywords\n//\t\tmanager.getResponse(\"list of Bond 007 movies\");\n//\tmanager.getResponse(\"Disney movies\");\n\t\t//manager.keywordQuery(\"Paul Brown Stadium location\");\n\t\t//manager.keywordQuery(\"0Francesco\");\n System.out.println(\"******* keyword query *******\");\n\t\t//manager.keywordQuery(\"sportspeople in tennis\");\n\t\t//manager.keywordSearch(\"list of movies starring Sean Connery\",ElasticIndex.analyzed,100 );\n//\t\tmanager.keywordSearch(\"movies starring Sean Connery\",ElasticIndex.notStemmed,100 );\n// manager.keywordSearch(\"musical movies tony award\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"movies directed by Woody Allen\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"United states professional sports teams\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"computer games developed by Ubisoft\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"computer games developed by Ubisoft\",ElasticIndex.notStemmed,100 );\n// manager.keywordSearch(\"movies academy award nominations\",ElasticIndex.notStemmed,100 );\n System.out.println(SearchResultUtil.toSummary(manager.keywordSearch(\"movies directed by Woody Allen\",ElasticIndex.notLowercased,20 )));\n //manager.keywordSearch(\"grammy best album in 2012\",ElasticIndex.notAnalyzed,100 );\n //(better than analyzed) manager.keywordSearch(\"grammy best album in 2012\",ElasticIndex.notStemmed,100 );\n System.out.println(\"*****************************\");\n\n\t\t//manager.keywordQuery(\"Disney movies\");\n\t}", "public static ArrayList<Result> findMatches(Query query, DataManager myVocab){\n\n\t\t//Uncomment this for logging in this class\t\n//\t\tmyLogger.setLevel(Level.INFO); \n\n\t\t// get the term we're going to search for and\n\t\t// take out any leading or trailing whitespaces\n\t\tString querystr = query.getQuery();\n\t\tquerystr = querystr.trim();\n\t\tString uncleaned = querystr;\n\t\t\n\t\t// This is in case of numeric entries. Google Refine doesn't seem\n\t\t// to have int cell types, instead it adds an invisible .0 to all\n\t\t// numbers. This fixes that issue, as it sometimes causes false negatives.\n\t\tif (querystr.endsWith(\".0\")){\n\t\t Pattern p = Pattern.compile(\"[^0-9\\\\.]+\");\n\t\t Matcher m = p.matcher(querystr);\n\t\t boolean result = m.find();\n\t\t if (!result){\n\t\t \t querystr = querystr.substring(0, querystr.length()-2);\n\t\t }\n\t\t}\n\t\t// see if it's in the synonyms map, if it is\n\t\t// replace it with the appropriate term, if it's\n\t\t// not, don't do anything. \n\n\t\tif (myVocab.subMap.get(querystr)!=null){\n\t\t\tquerystr = myVocab.subMap.get(querystr);\n\t\t\tquery.setQuery(querystr);\n\t\t}\n\t\t\n\t\t// Clean up the query string if it isn't case/punctuation sensitive\n\t\tif (!myVocab.capsSensitive()){\t\t\n\t\t\tquerystr = querystr.toLowerCase();\n\t\t}\n\t\tif (! myVocab.punctSensitive()){\t\t\n\t\t\tquerystr = querystr.replaceAll(\"[\\\\W_]\", \"\");\n\t\t}\n\t\t\n\t\t// see if it's in the synonyms map, if it is\n\t\t// replace it with the appropriate term, if it's\n\t\t// not, don't do anything. \n\t\tif(myVocab.subMap.get(querystr)!=null){\n\t\t\tquerystr = myVocab.subMap.get(querystr);\n\t\t\tquery.setQuery(querystr);\n\t\t}\n\n\t\tString type = query.getType();\n\n\t\t// This ArrayList is the results that are going to be returned. \n\t\tArrayList<Result> results = getDirectMatches(myVocab, querystr, uncleaned, type);\n\t\t\n\t\t// If there's a perfect match return it.\n\t\tif (results.size() == 1 && results.get(0).match){\n\t\t\treturn results;\n\t\t}else{\n\t\t\t// Otherwise, add the initial ones and try matching\n\t\t\t// based on distance to vocabulary terms.\n\t\t\tresults.addAll(distanceMatching(query, myVocab));\n\t\t\t\n\t\t\t// Split the original query term by space and non-alphanumeric characters \n\t\t\t// to find how many words there are.\n\t\t\t//querystr = query.getQuery().replaceAll(\"[\\\\W_]\", \" \");\n\t\t\tString [] termList = querystr.split(\" \");\n\t\t\t\n\t\t\t// if there's more than one, run bagOfWords\n\t\t\t// which tries to find a match for each of the words.\n\t\t\tif (termList.length > 1){\n\t\t\t\tresults.addAll(bagOfWords(query, myVocab));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Clean the results: no duplicates\n\t\t// no extra results to return, and sorted\n\t\t// them by score before returning them\n\t\tresults = removeDuplicates(results);\n\t\t\n\t\t// They do not need to be reduced in \n\t\t// number if there are fewer than \n\t\t// the max results.\n\t\t// The pruneResults sorts them\n\t\t// by score already.\n\t\tif(query.getLimit()!=null){\n\t\t\tresults = pruneResults(results,Integer.parseInt(query.getLimit()));\n\t\t}else{\n\t\t\tresults = pruneResults(results,MAX_RESULTS);\n\t\t}\n\t\t\t\n\t\tresults = sortByScore(results);\n\t\tfor (int i = 0; i< results.size(); i++){\n//\t\t\tmyLogger.log(Level.SEVERE,results.get(i).getScore()+ \" is bigger than 100?\");\n\t\t\tif(results.get(i).getScore() > (double)100){\n\t\t\t\tresults.get(i).setScore((double)100 - (results.get(i).getScore()-(double)100));\n//\t\t\t\tmyLogger.log(Level.SEVERE,results.get(i).getScore()+\" is bigger than 100! and was set to \"+\n//\t\t\t\t\t\t((double)100 - (results.get(i).getScore()-(double)100)));\n\t\t\t}\n\t\t}\n\t\treturn results;\n\t}", "protected HashMap<String,Double> rank(ArrayList<String> queryPostingLines, ArrayList<String> query){\n HashMap<String,HashMap<String,Integer>> queryWordsTFPerDoc = computeTFForQueryWords(queryPostingLines);\n ArrayList<String> retrievedDocuments = new ArrayList<>(queryWordsTFPerDoc.keySet());\n HashMap<String,Double> rankedDocs = new HashMap<>();\n\n for(String doc : retrievedDocuments){\n HashMap<String,Integer> docTFs = queryWordsTFPerDoc.get(doc);\n double rank = 0.3*rankByBM25(query,doc,docTFs) + 0.7*rankByPosition(query,doc,queryPostingLines);// - rankByCosSim(query,doc,docTFs);\n rankedDocs.put(doc,rank);\n }\n rankedDocs = sortByValue(rankedDocs);\n ArrayList<String> docsAfterSort = new ArrayList<>(rankedDocs.keySet());\n HashMap<String,Double> docsToRetrieve = new HashMap<>();\n int i=0;\n for(String doc: docsAfterSort){\n docsToRetrieve.put(documentDetails.get(doc)[0],rankedDocs.get(doc));\n i++;\n if(i == 50)\n break;\n }\n return docsToRetrieve;\n }", "public void relevanceFeedback(PostingsList results, boolean[] docIsRelevant, Indexer indexer ) {\r\n// results contain the ranked list from the current search\r\n// docIsRelevant contains the users feedback on which of the 10 first hits are relevant\r\n\tdouble gamma = 0.0; // används ej, de orelevanta dokumenterna. städa upp queryn. Vad innehller de orelevanta dokumenterna för termer\r\n// dess termer tar vi bort från den relebanta.)\r\n\r\n\tdouble alfa = 0.8; // hur mycket litar på det gamla sökning innan feedback\r\n\tdouble beta = 0.6; // hur mycket hänsyn du ska ta till nya sökningen efter feedback \r\n\r\n\r\n\t/* \r\n\r\n\tAlgorithm: \r\n\tThe Rocchio algorithm is based on a method of relevance \r\n\tfeedback found in information retrieval systems\r\n\tThe algorithm is based on the assumption that most users \r\n\thave a general conception of which documents should be denoted \r\n\tas relevant or non-relevant.[1] Therefore, the user's search \r\n\tquery is revised to include an arbitrary percentage of relevant \r\n\tand non-relevant documents as a means of increasing the search \r\n\tengine's recall, and possibly the precision as well. The number \r\n\tof relevant and non-relevant documents allowed to enter a query \r\n\tis dictated by the weights of the a, b.\r\n\tthe associated weights (a, b) are responsible for shaping the \r\n\tmodified vector in a direction closer, or farther away, from the \r\n\toriginal query, related documents, and non-related documents.\r\n\r\n\r\n\r\n\tLimitations of rocchio:\r\n\t\tTherefore the two queries of \"Burma\" and \"Myanmar\" will \r\n\t\tappear much farther apart in the vector space model, \r\n\t\tthough they both contain similar origins\r\n\tWhy not use non-relevant documents:\r\n\t\tThough there are benefits to ranking documents as not-relevant, \r\n\t\ta relevant document ranking will result in more precise documents \r\n\t\tbeing made available to the user. \r\n\t\r\n\r\n\r\n\tRoccio algoritmen: \r\n\t\talfa = Original query weight \r\n\t\tbeta = related document weight\r\n\t\t\r\n\t\thigher alpha means that we give more focus to the original query terms\r\n\t\thigher beta means that we give more focus to the new search feedback. i.e new terms.\r\n\r\n\t\tTar en org query\r\n\t\tTar den gamla gånnger en viss vikt \r\n\t\tvikt är alfa + beta (entill vektor) plus att den kollar på original vektor, q0 \r\n\t\t\thögre alfa mer fokus på original queryn \r\n\t\t\thögra beta skiftar till mer fokus på de nya termerna. \r\n\t\tdvs utökas med ord/termer från dokument vektorerna som var relevanta. \r\n\r\n\tVanligtvis har man väldigt häg alfa och beta lite under för att det är standard. man tycker att den \r\n\tförsta queryn är väldigt bra.\r\n\r\n\t\r\n\t*/\r\n\r\n\tPostingsList related_doc_vector = new PostingsList();\r\n\tHashMap<String, Double> qm = new HashMap<String, Double>(); // spara termer och weights.\r\n\t// normalize weights\r\n\tfor(Double w : weights){\r\n\t\tw = w/weights.size();\r\n\t}\r\n\r\n\tIterator<PostingsEntry> it = results.iterator();\r\n\tfor(int i = 0; i < docIsRelevant.length; i++){\r\n\t\tif(docIsRelevant[i] == true){\r\n\t\t\trelated_doc_vector.list.add(results.get(i));\r\n\t\t} \r\n\t}\r\n\r\n\t// apply Rocchio algorithm.\r\n\tfor(int i = 0; i < terms.size(); i++){\r\n\t\tdouble new_weigt = weights.get(i) * alfa;\r\n\t\tqm.put(terms.get(i), new_weigt);\r\n\t}\r\n\r\n\tfor(int i = 0; i < related_doc_vector.size(); i++){\r\n\t\tIterator<PostingsEntry> ite = related_doc_vector.iterator();\r\n\t\twhile(ite.hasNext()){\r\n\t\t\tPostingsEntry postingsentry = ite.next();\r\n\t\t\tint docID = postingsentry.docID;\r\n\t\t\tString filename = indexer.index.docIDs.get(Integer.toString(docID)); // hämtar filnamnet\r\n\t\t\tString path = \"/Users/monadadoun/Desktop/ir/lab/davisWiki/\" + filename; \r\n\t\t\tFile file = new File(path);\r\n\t\t\tHashSet<String> hs = new HashSet<>();\r\n\t\t\t// lägger till alla ord som finns till mitt hashet\r\n\t\t\ttry (Reader reader = new InputStreamReader( new FileInputStream(file), StandardCharsets.UTF_8 )){\r\n\t\t\t\tTokenizer tok = new Tokenizer( reader, true, false, true, indexer.patterns_file );\r\n\t\t\t\twhile (tok.hasMoreTokens()) {\r\n\t\t\t\t\ths.add(tok.nextToken());\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tIterator<String> iter = hs.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tString s = iter.next();\r\n\t\t\t\tif(qm.containsKey(s)){\r\n\t\t\t\t\tDouble tmp = qm.get(s);\r\n\t\t\t\t\tqm.put(s, tmp + beta * postingsentry.score);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tqm.put(s, beta * postingsentry.score);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tLinkedList<String> term = new LinkedList<>();\r\n\tLinkedList<Double> weight = new LinkedList<>();\r\n\tList<Map.Entry<String,Double>> answer = new ArrayList<Map.Entry<String,Double>>(qm.entrySet());\r\n\tanswer.sort((e1,e2) -> e2.getValue().compareTo(e1.getValue())); // sorterar efter värde så att orden med högst score ligger först\r\n\tfor (int i = 0; i < answer.size(); i++) {\r\n\t\tterm.add(answer.get(i).getKey());\r\n\t\tweight.add(answer.get(i).getValue()/answer.size());\r\n\t}\r\n\r\n\tterms = term;\r\n\tweights = weight;\r\n\t}", "public List<Document> retrieveQuery( Query aQuery, int TopN ) throws IOException {\n\t\t// NT: you will find our IndexingLucene.Myindexreader provides method: docLength()\n\t\t// implement your retrieval model here, and for each input query, return the topN retrieved documents\n\t\t// sort the documents based on their relevance score, from high to low\n\n\t\tHashMap<Integer, HashMap<String,Integer>> idTokenDocFrequencyMap = new HashMap<>();\t//docid - (token - document frequency) map\n\t\tHashMap<String, Long> tokenColFrequencyMap = new HashMap<>();\t// token - collection frequency map\n\t\tString content = aQuery.GetQueryContent();\n\t\tString[] tokens = content.split(\" \");\n\n\t\tfor(String token : tokens){\n\t\t\ttokenColFrequencyMap.put(token, indexReader.CollectionFreq(token)); \t// update the second map\n\t\t\tint [][]postingList = indexReader.getPostingList(token);\n\t\t\tif(postingList == null) continue;\n\t\t\tfor(int i = 0; i < postingList.length; i++){\n\t\t\t\tint docid = postingList[i][0];\n\t\t\t\tint freq = postingList[i][1];\n\t\t\t\tif(idTokenDocFrequencyMap.containsKey(docid)){\t\t// update the first map\n\t\t\t\t\tidTokenDocFrequencyMap.get(docid).put(token,freq);\n\t\t\t\t}else {\n\t\t\t\t\tHashMap<String,Integer> tokenFrequencyMap = new HashMap<>();\n\t\t\t\t\ttokenFrequencyMap.put(token,freq);\n\t\t\t\t\tidTokenDocFrequencyMap.put(docid,tokenFrequencyMap);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdouble U = 2000.0;\n\t\tList<Document> documentList = new ArrayList<>();\n\t\t// if use a docidList, it will have some duplicates.\n\t\tfor(Map.Entry<Integer, HashMap<String,Integer>> entry : idTokenDocFrequencyMap.entrySet()){\n\t\t\tdouble score = 1.0;\t\t\t// each document have one score\n\t\t\tint docid = entry.getKey();\n\t\t\tint docLen = indexReader.docLength(docid);\t// get document length\n\t\t\tHashMap<String,Integer> tokenDocFrequencyMap = idTokenDocFrequencyMap.get(docid);\n\t\t\tfor(String token : tokens){\t\t// for each token, not the token just exist in the document\n\t\t\t\tlong colFreq = tokenColFrequencyMap.getOrDefault(token,0l);\t// get collection frequency\n\t\t\t\tif(colFreq != 0){\n\t\t\t\t\tint docFreq = 0;\t// if this document don't have token, just set document frequency as 0\n\t\t\t\t\tif(tokenDocFrequencyMap.containsKey(token)){\n\t\t\t\t\t\tdocFreq = tokenDocFrequencyMap.get(token);\n\t\t\t\t\t}\n\t\t\t\t\tscore = score * (docFreq + U * ((double)colFreq / colLen)) / (docLen + U);\t//equation\n\t\t\t\t}\n\t\t\t}\n\t\t\tDocument document = new Document(docid+\"\", indexReader.getDocno(docid),score);\n\t\t\tdocumentList.add(document);\n\t\t}\n\n\t\tCollections.sort(documentList, new Comparator<Document>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Document o1, Document o2) {\n\t\t\t\treturn Double.compare(o2.score(),o1.score());\n\t\t\t}\n\t\t});\n\t\tList<Document> res = new ArrayList<>();\n\t\tfor(int i = 0 ; i < TopN; i++){\n\t\t\tres.add(documentList.get(i));\n\t\t}\n\t\treturn res;\n\t}", "private static Query computeBooleanQueryNP(String textQuery){\n\t\tBooleanQuery query = new BooleanQuery();\n\n\t\tHmmDecoder mPosTagger = null;\n\t\tTokenizerFactory mTokenizerFactory = null;\n\t\tPhraseChunker pChunker = new PhraseChunker(mPosTagger,mTokenizerFactory);\n\t\tArrayList<String> pchuncker = new ArrayList<String>();\n\n\t\tpchuncker = pChunker.getCHunkNounPhrases(textQuery.toLowerCase());\n\n\t\tfor (int k = 0; k<= pchuncker.size()-1;k++ ){\n\t\t\tString wordInList = ((String) pchuncker.get(k));\n\t\t\twordInList = wordInList.toLowerCase().replaceAll(\"-\",\" \");\n\t\t\tString [] wordInListSplit = wordInList.split(\" \");\n\t\t\tfor (String word: wordInListSplit){\n\n\t\t\t\tquery.add(new TermQuery(new Term(\"content\", word)), Occur.SHOULD );\n\t\t\t}\n\n\t\t}\n\n\t\t/* String[] tQuery = textQuery.split(\" \");\n\t\t for(String s: tQuery )\n\t\t\t query.add(new TermQuery(new Term(\"text\", s)), Occur.SHOULD);*/\n\n\t\treturn query;\n\t}", "private static ArrayList<Result> bagOfWords(Query query, DataManager myVocab) {\n\t\tString queryname = query.getQuery();\n\t\t// split on space and punctuation\n\t\tString[] termList = queryname.split(\" \");\n\t\tArrayList<Result> bagResults = new ArrayList<Result>();\n\t\tfor (int i=0; i<termList.length; i++){\n\t\t\tQuery newQuery = new Query(termList[i], query.getLimit(), query.getType(), query.getTypeStrict(), query.properties()) ;\n\t\t\tArrayList<Result> tempResults = new ArrayList<Result>(findMatches(newQuery, myVocab));\n\t\t\tfor(int j=0; j<tempResults.size(); j++){\n\n\t\t\t\ttempResults.get(j).setMatch(false);\n\t\t\t\ttempResults.get(j).decreaseScore(termList.length);\n\t\t\t\tif(tempResults.get(j).getScore()>100){\n\t\t\t\t\ttempResults.get(j).setScore(99.0);\n\t\t\t\t}else if (tempResults.get(j).getScore()<1){\n\t\t\t\t\ttempResults.get(j).setScore(tempResults.get(j).getScore()*10);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbagResults.addAll(tempResults);\n\t\t}\n\t\treturn bagResults;\n\t}", "public double getTfIdf(){ return tf_idf; }", "public void updateUnseenTermInThisQuery(int relevanceFeedbackMethod) {\n System.out.println(\"Nomor Query Lama : \" + listDocumentRetrievedForThisQuery.getQuery().getIndex());\n System.out.println(\"Isi Query Lama : \" + listDocumentRetrievedForThisQuery.getQuery().getQueryContent());\n int thisQueryIndex = listDocumentRetrievedForThisQuery.getQuery().getIndex();\n for (Map.Entry m : invertedFile.getListTermWeights().entrySet()) {\n String keyTerm = (String) m.getKey();\n if (!isTermAppearInQuery(keyTerm)) {\n double newWeight = computeNewWeightTerm(relevanceFeedbackMethod,keyTerm,0.0);\n if (newWeight > 0) {\n String filteredWord = \"\";\n if (invertedFile.isStemmingApplied()) {\n filteredWord = invertedFile.getMappingStemmedTermToNormalTerm().get(keyTerm);\n } else {\n filteredWord = keyTerm;\n }\n newQueryComposition.put(filteredWord,newWeight);\n invertedFileQuery.insertRowTable(keyTerm,thisQueryIndex,newWeight);\n normalFileQuery.insertElement(thisQueryIndex,keyTerm);\n }\n }\n }\n System.out.println(\"Nomor Query Baru : \" + convertNewQueryComposition().getIndex());\n System.out.println(\"Isi Query Baru : \" + convertNewQueryComposition().getQueryContent());\n }", "@Test\n public void testCombineRankZeroPageRankWeight() {\n Iterator<Pair<Document, Double>> resultIterator = icsSearchEngine.searchQuery(Arrays.asList(\"anteater\"),\n 100, 0.0);\n ImmutableList<Pair<Document, Double>> resultListCombined = ImmutableList.copyOf(resultIterator);\n\n Iterator<Pair<Document, Double>> resultIteratorTfIdf = invertedIndexManager.searchTfIdf(Arrays.asList(\"anteater\"), 100);\n ImmutableList<Pair<Document, Double>> resultListTfIdf = ImmutableList.copyOf(resultIteratorTfIdf);\n\n Assert.assertEquals(resultListTfIdf, resultListCombined);\n }", "private Node estimateRelevance(Node original) throws Exception {\n Node combineNode = new Node(\"combine\", new NodeParameters(), original.getInternalNodes(), original.getPosition());\n\n // Only get as many as we need\n Parameters localParameters = retrieval.getGlobalParameters().clone();\n int fbDocs = (int) retrieval.getGlobalParameters().get(\"fbDocs\", 10);\n localParameters.set(\"requested\", fbDocs);\n\n // transform and run\n Node transformedCombineNode = retrieval.transformQuery(combineNode, localParameters);\n List<ScoredDocument> initialResults = retrieval.executeQuery(transformedCombineNode, localParameters).scoredDocuments;\n \n // Gather content\n ArrayList<String> names = new ArrayList<String>();\n for (ScoredDocument sd : initialResults) {\n names.add(sd.documentName);\n }\n List<Document> docs = getDocuments(names);\n\n // Now the maps from the different information sources\n // Each of these is a term -> field -> score double-mapping\n HashMap<String, TObjectDoubleHashMap<String>> uCFSs = null;\n double ucfw = p.get(\"ucfw\", 1.0);\n if (ucfw != 0.0) {\n uCFSs = getUnigramCollFieldScores();\n }\n\n HashMap<String, TObjectDoubleHashMap<String>> bCFSs = null;\n double bcfw = p.get(\"bcfw\", 1.0);\n if (bcfw != 0.0) {\n bCFSs = getBigramCollFieldScores();\n }\n\n HashMap<String, TObjectDoubleHashMap<String>> uPRFSs = null;\n double uprfw = p.get(\"uprfw\", 1.0);\n if (uprfw != 0.0) {\n uPRFSs = getUnigramPRFScores(docs);\n }\n\n HashMap<String, TObjectDoubleHashMap<String>> bPRFSs = null;\n double bprfw = p.get(\"bprfw\", 1.0);\n if (bprfw != 0.0) {\n bPRFSs = getBigramPRFScores(docs);\n }\n\n // We can now construct term-field weights using our supplied lambdas\n // and scores\n Node termNodes = new Node(\"combine\", new NodeParameters(), new ArrayList<Node>(), 0);\n termNodes.getNodeParameters().set(\"norm\", false);\n TObjectDoubleHashMap<String> weights = new TObjectDoubleHashMap<String>();\n for (String term : queryTerms) {\n weights.clear();\n for (String field : fields) {\n double sum = 0.0;\n if (uCFSs != null) {\n sum += (ucfw * uCFSs.get(term).get(field));\n }\n\n if (bCFSs != null) {\n TObjectDoubleHashMap<String> termMap = bCFSs.get(term);\n if (termMap != null) {\n sum += (bcfw * termMap.get(field));\n }\n }\n\n if (uPRFSs != null) {\n sum += (uprfw * uPRFSs.get(term).get(field));\n }\n\n if (bPRFSs != null) {\n TObjectDoubleHashMap<String> termMap = bPRFSs.get(term);\n if (termMap != null) {\n sum += (bprfw * termMap.get(field));\n }\n }\n weights.put(field, sum);\n }\n termNodes.addChild(createTermFieldNodes(term, weights));\n }\n return termNodes;\n }", "public static String tfidf(String str) throws Exception{\n\t\tIndexReader r = IndexReader.open(FSDirectory.open(new File(\"index\")));\r\n\r\n\t\t// this code takes care of calculating idf for each term\r\n\r\n\t\tHashMap<String, Double> idf_map = new HashMap<String, Double>();\r\n\t\tTermEnum t = r.terms();\r\n\t\tdouble docs_count = r.maxDoc();\r\n\t\twhile (t.next()) {\r\n\t\t\tTerm te = new Term(\"contents\", t.term().text());\r\n\t\t\tdouble idf = Math.log(docs_count / r.docFreq(te));\r\n\t\t\tidf_map.put(t.term().text(), idf);\r\n\t\t}\r\n\r\n\t\t// This code is a test stub to get the term with lowest IDF value\r\n\r\n\t\t/*\r\n\t\t * double minVal = Collections.min(idf_map.values()); for(Entry<String,\r\n\t\t * Double> entry:idf_map.entrySet()){ if(entry.getValue() == minVal){\r\n\t\t * System.out.println(\"Term with lowest idf is: \"+entry.getKey()); } }\r\n\t\t */\r\n\r\n\t\tlong t1, t2;\r\n\t\tlong start = System.currentTimeMillis();\r\n\r\n\t\t// code to get |d| for every document\r\n\r\n\t\tHashMap<Integer, HashMap<String, Integer>> hmap = new HashMap<Integer, HashMap<String, Integer>>();\r\n\t\tTermEnum trm = r.terms();\r\n\t\twhile (trm.next()) {\r\n\t\t\tTerm te1 = new Term(\"contents\", trm.term().text());\r\n\t\t\tTermDocs td1 = r.termDocs(te1);\r\n\r\n\t\t\twhile (td1.next()) {\r\n\t\t\t\tHashMap<String, Integer> a1 = hmap.get(td1.doc());\r\n\t\t\t\tif (a1 == null) {\r\n\t\t\t\t\ta1 = new HashMap<String, Integer>();\r\n\t\t\t\t\ta1.put(trm.term().text(), td1.freq());\r\n\t\t\t\t\thmap.put(td1.doc(), a1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ta1.put(trm.term().text(), td1.freq());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// compute magnitude of each document vector and store it in array\r\n\r\n\t\tArrayList<Double> doc_magnitude = new ArrayList<Double>();\r\n\t\tHashMap<String, Integer> val = new HashMap<String, Integer>();\r\n\t\tSet<Entry<Integer, HashMap<String, Integer>>> entrySet = hmap.entrySet();\r\n\r\n\t\tjava.util.Iterator<Entry<Integer, HashMap<String, Integer>>> it = entrySet.iterator();\r\n\t\twhile (it.hasNext()) { // foreach document id\r\n\t\t\tdouble square_sum = 0.0;\r\n\t\t\tMap.Entry<Integer, HashMap<String, Integer>> me = (Entry<Integer, HashMap<String, Integer>>) it.next();\r\n\t\t\tval = me.getValue();\r\n\t\t\tSet<Map.Entry<String, Integer>> entry = val.entrySet();\r\n\t\t\tjava.util.Iterator<Map.Entry<String, Integer>> iterator = entry.iterator();\r\n\t\t\twhile (iterator.hasNext()) { // foreach term\r\n\t\t\t\tMap.Entry<String, Integer> mp = iterator.next();\r\n\t\t\t\tsquare_sum += mp.getValue() * mp.getValue();\r\n\t\t\t}\r\n\t\t\tdouble root = Math.sqrt(square_sum);\r\n\t\t\tdoc_magnitude.add(me.getKey(), root);\r\n\t\t}\r\n\r\n\t\t// long end = System.currentTimeMillis();\r\n\t\t// double diff = end - start;\r\n\t\t// System.out.println(\"Time taken to compute norms(in seconds): \" + diff\r\n\t\t// / 1000 + \"\\n\");\r\n\r\n\t\t// get the query and find similarity with the documents\r\n\t\tHashMap<Integer, Double> similarity_map = new HashMap<Integer, Double>();\r\n\t\tSet<Entry<Integer, HashMap<String, Integer>>> entrySet1 = hmap.entrySet();\r\n\t\tjava.util.Iterator<Entry<Integer, HashMap<String, Integer>>> it1 = entrySet1.iterator();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tHashMap<Integer, Double> dot_product_map = new HashMap<Integer, Double>();\r\n\r\n\t\t\r\n\t\t\tdot_product_map.clear();\r\n\t\t\tsimilarity_map.clear();\r\n\r\n\t\t\tString[] terms = str.split(\"\\\\s+\");\r\n\t\t\tint cnt = 0;\r\n\r\n\t\t\tlong result_st = System.currentTimeMillis();\r\n\t\t\tt1 = System.nanoTime();\r\n\r\n\t\t\t// for each term get the documents containing the corresponding term\r\n\t\t\tfor (String word : terms) // foreach term in query\r\n\t\t\t{\r\n\t\t\t\tTerm te = new Term(\"contents\", word);\r\n\t\t\t\tTermDocs tdocs = r.termDocs(te);\r\n\t\t\t\twhile (tdocs.next() /* && tdocs.doc() < number */) {\r\n\t\t\t\t\t// Map.Entry<Integer, HashMap<String, Integer>> me =\r\n\t\t\t\t\t// (Entry<Integer, HashMap<String, Integer>>) it1.next();\r\n\t\t\t\t\tdouble freq = hmap.get(tdocs.doc()).get(word);\r\n\t\t\t\t\tDouble temp = dot_product_map.get(tdocs.doc());\r\n\t\t\t\t\tif (temp == null) {\r\n\t\t\t\t\t\tdot_product_map.put(tdocs.doc(), freq * idf_map.get(word));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdot_product_map.put(tdocs.doc(), dot_product_map.get(tdocs.doc()) + freq * idf_map.get(word));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcnt++;\r\n\t\t\t}\r\n\t\t\tSet<Entry<Integer, Double>> se = dot_product_map.entrySet();\r\n\t\t\tjava.util.Iterator<Entry<Integer, Double>> iter = se.iterator();\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tMap.Entry<Integer, Double> me = (Entry<Integer, Double>) iter.next();\r\n\t\t\t\tsimilarity_map.put(me.getKey(), me.getValue() / (Math.sqrt(cnt) * doc_magnitude.get(me.getKey())));\r\n\t\t\t}\r\n\r\n\t\t\t// Normalize the map\r\n\t\t\tdouble sum = 0;\r\n\t\t\tfor (int i : similarity_map.keySet()) {\r\n\t\t\t\tsum += similarity_map.get(i);\r\n\t\t\t}\r\n\r\n\t\t\tfor (int i : similarity_map.keySet()) {\r\n\t\t\t\tdouble temp = similarity_map.get(i) / sum;\r\n\t\t\t\tsimilarity_map.put(i, temp);\r\n\t\t\t}\r\n\r\n\t\t\tString result=\"\";\r\n\r\n\t\t\tList<Integer> l1 = new ArrayList<Integer>();\r\n\t\t\tHashMap<Integer, Double> sim_map = sortMap(similarity_map, r);\r\n\t\t\tfor(Integer i:sim_map.keySet()){\r\n\t\t\t\tl1.add(i);\r\n\t\t\t\tDocument d1 = r.document(i);\r\n\t\t\t\tString url = d1.getFieldable(\"path\").stringValue();\r\n\t\t\t\t//String snippet = getSnippet(hmap.get(i));\r\n\t\t\t\turl = url.replace(\"%%\", \"/\");\r\n\t\t\t\tString snippet = Snippet.getContent(url,terms[0]); //read the content of url\r\n\t\t\t\tresult +=/*i+\" \"+*/url+\"\\n\";\r\n\t\t\t\tresult +=snippet+\"\\n\\n\\n\";\r\n\t\t\t\t//result += snippet+\"\\n\\n\";\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t\t\r\n}", "public void analyzequery(JSONObject json) {\n\t\ttry {\n\t\t\t\n\t\t\tJSONArray jarray = json.getJSONArray(\"Reviews\");\n\t\t\t\n\t\t\tfor (int i = 0; i < jarray.length(); i++) {\n\t\t\t\t\n\t\t\t\tPost review = new Post(jarray.getJSONObject(i));\n\t\t\t\tSystem.out.println(\"55\");\n\t\t\t\tString content = review.getContent();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tHashMap<String, Integer> querytf = new HashMap<String, Integer>();\n\n\t\t\t\tHashSet<String> biminiset = new HashSet<String>();\n\n\t\t\t\tArrayList uniquery = new ArrayList();\n\n\t\t\t\tfor (String token : tokenizer.tokenize(content)) {\n\t\t\t\t\tif (m_stopwords.contains(token))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (token.isEmpty())\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tuniquery.add(PorterStemmingDemo(SnowballStemmingDemo(NormalizationDemo(token))));\n\n\t\t\t\t}\n\n\t\t\t\tfor (int k = 0; k < uniquery.size(); k++) {\n\n\t\t\t\t\tif (querytf.containsKey(uniquery.get(i).toString())) {\n\t\t\t\t\t\tquerytf.put(uniquery.get(i).toString(),\n\t\t\t\t\t\t\t\tquerytf.get(uniquery.get(i).toString()) + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerytf.put(uniquery.get(i).toString(), 1);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tArrayList<String> N_gram = new ArrayList<String>();\n\n\t\t\t\tfor (String token : tokenizer.tokenize(content)) {\n\n\t\t\t\t\ttoken = PorterStemmingDemo(SnowballStemmingDemo(NormalizationDemo(token)));\n\t\t\t\t\tif (token.isEmpty()) {\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tN_gram.add(token);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tString[] fine = new String[N_gram.size()];\n\n\t\t\t\tfor (int p = 0; p < N_gram.size() - 1; p++) {\n\t\t\t\t\tif (m_stopwords.contains(N_gram.get(p)))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (m_stopwords.contains(N_gram.get(p + 1)))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tfine[p] = N_gram.get(p) + \"-\" + N_gram.get(p + 1);\n\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\tfor (String str2 : fine) {\n\n\t\t\t\t\tif (querytf.containsKey(str2)) {\n\t\t\t\t\t\tquerytf.put(str2, querytf.get(str2) + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerytf.put(str2, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (String key : querytf.keySet()) {\n\t\t\t\t\tif (m_stats.containsKey(key)) {\n\t\t\t\t\t\tdouble df = (double) m_stats.get(key);\n\n\t\t\t\t\t\tdouble idf = (1 + Math.log(102201 / df));\n\n\t\t\t\t\t\tdouble tf = querytf.get(key);\n\n\t\t\t\t\t\tdouble result = tf * idf;\n\n\t\t\t\t\t\tquery_idf.put(key, result);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquery_idf.put(key, 0.0);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch (JSONException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t}", "public void ComputeSimilarity() {\n\t\t\n\t\t//first construct the vector space representations for these five reviews\n\t\t// the our smaples vector, finally get the similarity metric \n\t\tanalyzequery(LoadJson(\"./data/samples/query.json\"));\n\t\n\t\t\n\t\tHashMap<String, Double> Similarity = new HashMap<String, Double>();\n\n\t\tfor (int i = 0; i < m_reviews.size(); i++) {\n\t\t\tString content = m_reviews.get(i).getContent();\n\n\t\t\tHashMap<String, Integer> conunttf = new HashMap<String, Integer>();\n\n\t\t\tHashSet<String> biminiset = new HashSet<String>();\n \n\t\t\t//danci means word unit: one or two words\n\t\t\tArrayList danci = new ArrayList();\n\n\t\t\tfor (String token : tokenizer.tokenize(content)) {\n\t\t\t\tif (m_stopwords.contains(token))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (token.isEmpty())\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdanci.add(PorterStemmingDemo(SnowballStemmingDemo(NormalizationDemo(token))));\n\n\t\t\t}\n \n\t\t\t//get word count in a document\n\t\t\tfor (int k = 0; k < danci.size(); k++) {\n\n\t\t\t\tif (conunttf.containsKey(danci.get(k).toString())) {\n\t\t\t\t\tconunttf.put(danci.get(k).toString(),\n\t\t\t\t\t\t\tconunttf.get(danci.get(k).toString()) + 1);\n\t\t\t\t} else {\n\t\t\t\t\tconunttf.put(danci.get(k).toString(), 1);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tArrayList<String> N_gram = new ArrayList<String>();\n\n\t\t\tfor (String token : tokenizer.tokenize(content)) {\n\n\t\t\t\ttoken = PorterStemmingDemo(SnowballStemmingDemo(NormalizationDemo(token)));\n\t\t\t\tif (token.isEmpty()) {\n\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\n\t\t\t\t\tN_gram.add(token);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tString[] fine = new String[N_gram.size()];\n \n\t\t\t//get rid of stopwords\n\t\t\tfor (int p = 0; p < N_gram.size() - 1; p++) {\n\t\t\t\tif (m_stopwords.contains(N_gram.get(p)))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (m_stopwords.contains(N_gram.get(p + 1)))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tfine[p] = N_gram.get(p) + \"-\" + N_gram.get(p + 1);\n\n\t\t\t}\n\n\t\t\t\n\t\t\tfor (String str2 : fine) {\n\n\t\t\t\tif (conunttf.containsKey(str2)) {\n\t\t\t\t\tconunttf.put(str2, conunttf.get(str2) + 1);\n\t\t\t\t} else {\n\t\t\t\t\tconunttf.put(str2, 1);\n\t\t\t\t}\n\t\t\t}\n \n\t\t\t//compute tf * idf for each document\n\t\t\tfor (String key : conunttf.keySet()) {\n\t\t\t\tif (m_stats.containsKey(key)) {\n\t\t\t\t\tdouble df = (double) m_stats.get(key);\n\n\t\t\t\t\tdouble idf = (1 + Math.log(102201 / df));\n\n\t\t\t\t\tdouble tf = conunttf.get(key);\n\n\t\t\t\t\tdouble result = tf * idf;\n\n\t\t\t\t\tm_idf.put(key, result);\n\t\t\t\t} else {\n\t\t\t\t\tm_idf.put(key, 0.0);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\tHashMap<String, Double> query = new HashMap<String, Double>();\n\t\t\tHashMap<String, Double> test = new HashMap<String, Double>();\n \n\t\t\t//If query contains this word, store it for future computation \n\t\t\tfor (Map.Entry<String, Double> entry : m_idf.entrySet()) {\n\t\t\t\tString key = entry.getKey();\n\t\t\t\tif (query_idf.containsKey(key)) {\n\t\t\t\t\tquery.put(key, query_idf.get(key));\n\t\t\t\t\ttest.put(key, m_idf.get(key));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdouble dotProduct = 0.00;\n\t\t\tdouble magnitude1 = 0.0;\n\t\t\tdouble magnitude2 = 0.0;\n\t\t\tdouble magnitude3 = 0.0;\n\t\t\tdouble magnitude4 = 0.0;\n\t\t\tdouble cosineSimilarity = 0;\n \n\t\t\t\n\t\t\t//compute Compute similarity between query document and each document in file\n\t\t\tfor (String cal : test.keySet()) {\n\t\t\t\tdotProduct += query.get(cal) * test.get(cal); // a.b\n\t\t\t\tmagnitude1 += Math.pow(query.get(cal), 2); // (a^2)\n\t\t\t\tmagnitude2 += Math.pow(test.get(cal), 2); // (b^2)\n\n\t\t\t\tmagnitude3 = Math.sqrt(magnitude1);// sqrt(a^2)\n\t\t\t\tmagnitude4 = Math.sqrt(magnitude2);// sqrt(b^2)\n\t\t\t}\n\n\t\t\tif (magnitude3 != 0.0 | magnitude4 != 0.0)\n\t\t\t\tcosineSimilarity = dotProduct / (magnitude3 * magnitude4);\n\n\t\t\telse\n\t\t\t\tcosineSimilarity = 0;\n\n\t\t\tSimilarity.put(content, cosineSimilarity);\n\n\t\t\t\t\t\n\n\t\t}\n\n\t\t// sort output to get 3 reviews with the highest similarity with query review\n\t\tList<Map.Entry<String, Double>> infoIds = new ArrayList<Map.Entry<String, Double>>(\n\t\t\t\tSimilarity.entrySet());\n\n\t\tCollections.sort(infoIds, new Comparator<Map.Entry<String, Double>>() {\n\t\t\tpublic int compare(Map.Entry<String, Double> o1,\n\t\t\t\t\tMap.Entry<String, Double> o2) {\n\t\t\t\treturn (int) (o1.getValue() - o2.getValue());\n\t\t\t}\n\t\t});\n\n\t\tfor (int i = infoIds.size() - 1; i > infoIds.size() - 4; i--) {\n\t\t\tEntry<String, Double> ent = infoIds.get(i);\n\t\t\tSystem.out.println(ent.getValue()+\"++\"+ent.getKey()+\"\\n\");\n\n\t\t}\n\n\t}", "private ScoreDoc[] searchExec (Query query) {\n\n ScoreDoc[] hits = null;\n\n try {\n IndexReader reader = DirectoryReader.open(indexDir);\n IndexSearcher searcher = new IndexSearcher(reader);\n TopDocs docs = searcher.search(query, hitsPerPage, new Sort(SortField.FIELD_SCORE)); //search(query, docs);\n hits = docs.scoreDocs;\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return hits;\n }", "private static String addQueryEntry(String query) throws IOException {\n\t\t\t\t\n\t\tString submittedQuery=null;\n\t\tString queryParts[]=query.split(\"&\"); // get parameters from query\t\t\n\t\tboolean isNextPage=false;\n\t\tString key=null;\n\t\tInteger value=null;\n\t\tboolean docsProcessed=false; // identifies if 'docs' occurs more than once in the query\t\t\n\t\tboolean termsProcessed=false; // identifies if 'terms' occurs more than once in the query\n\t\t\n\t\t// identify if it is a next page\n\t\tfor (int i=0;i<queryParts.length;i++) { // verifies if it is a next page\n\t\t\tString queryPartsFields[]=queryParts[i].split(\"=\",2);\t\t\t\n\t\t\tqueryPartsFields[0]=queryPartsFields[0].trim();\n\t\t\tif (queryPartsFields.length>1) {\n\t\t\t\tqueryPartsFields[1]=queryPartsFields[1].trim();\n\t\t\t}\n\t\t\t\n\t\t\tif (queryPartsFields[0].equals(DOCS_KEY) && queryPartsFields.length>1 && !queryPartsFields[1].equals(\"\")) {\t\t\t\n\t\t\t\tint ipage;\n\t\t\t\ttry {\n\t\t\t\t\tipage=Integer.parseInt(queryPartsFields[1]);\n\t\t\t\t}\n\t\t\t\tcatch (NumberFormatException e) {\n\t\t\t\t\tipage=0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (ipage!=0) { // regist only pages>0 \t\t\t\t\t\t\t\n\t\t\t\t\tisNextPage=true;\t\t\t\n\t\t\t\t\tif (ipage%RESULTS_PER_PAGE!=0) {\n\t\t\t\t\t\tSystem.err.println(\"Page results not multiple of \"+RESULTS_PER_PAGE+\": \"+ipage);\n\t\t\t\t\t\tipage+=ipage%RESULTS_PER_PAGE;\n\t\t\t\t\t}\n\t\t\t\t\tif (!docsProcessed) {\n\t\t\t\t\t\tint index=ipage/RESULTS_PER_PAGE>pagesViewedDistAux.length-1 ? pagesViewedDistAux.length-1 : ipage/RESULTS_PER_PAGE;\t\t\t\n\t\t\t\t\t\tif (index==0) { // sanity check\n\t\t\t\t\t\t throw new IOException(\"Error of index=0 on a next page. ipage:\"+ipage);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpagesViewedDistAux[index]++;\n\t\t\t\t\t}\n\t\t\t\t\tdocsProcessed=true;\t\t\t\t\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse if (queryPartsFields[0].equals(QUERY_KEY)) {\n\t\t\t\ttermsProcessed=true;\n\t\t\t}\n\t\t}\n\t\t// check wrong entries\n\t\tif (docsProcessed && !termsProcessed) {\n\t\t\tSystem.err.println(\"Error of query with docs without terms: \"+query);\n\t\t\treturn null;\n\t\t}\t\t\t\t\n\t\tif (isNextPage) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// count only first page\n\t\tdocsProcessed=false;\n\t\tfor (int i=0;i<queryParts.length;i++) {\t\t\t\t\t\t\t\t\t\n\t\t\tString queryPartsFields[]=queryParts[i].split(\"=\",2);\t\t\t\n\t\t\tqueryPartsFields[0]=queryPartsFields[0].trim();\n\t\t\t\n\t\t\tif (!queryPartsFields[0].equals(QUERY_KEY) || queryPartsFields.length!=2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// normalize query\t\t\t\n\t\t\ttry {\n\t\t\t\tqueryPartsFields[1]=decodeStrings(decodeNCR(java.net.URLDecoder.decode(queryPartsFields[1],\"ISO8859-1\").toLowerCase()));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\tcatch(IllegalArgumentException e) {\n\t\t\t\tqueryPartsFields[1]=decodeStrings(decodeNCR(queryPartsFields[1].toLowerCase()));\n\t\t\t}\n\t\t\t// remove spaces\n\t\t\tString terms[]=queryPartsFields[1].split(\"\\\\s\");\n\t\t\tqueryPartsFields[1]=\"\";\n\t\t\tfor (int j=0,k=0;j<terms.length;j++) {\t\t\t\t\t\n\t\t\t\tif (terms[j].equals(\"\")) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\t\t\t\t\t\n\t\t\t\tif (k>0) {\n\t\t\t\t\tqueryPartsFields[1]+=\" \";\t\n\t\t\t\t}\n\t\t\t\tqueryPartsFields[1]+=terms[j];\t\t\t\t\t\n\t\t\t\tk++;\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t// filter queries\t\t\t\t\t\n\t\t\tif (queryFiltersMap.containsKey(queryPartsFields[1]) || queryPartsFields[1].startsWith(\"cache%3\") || queryPartsFields[1].equals(\"\")) {\t\t\t\t\n\t\t\t\tcontinue;\n\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t// set first page viewed\n\t\t\tif (!docsProcessed) {\n\t\t\t\tpagesViewedDistAux[0]++;\n\t\t\t\tdocsProcessed=true;\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//key=queryPartsFields[0]+\" \"+queryPartsFields[1];\n\t\t\tkey=NEW_QUERY_KEY+\" \"+queryPartsFields[1];\t\t\t\n\t\t\tif ((value=queryPartsMap.get(key))==null) {\n\t\t\t\tqueryPartsMap.put(key,1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tqueryPartsMap.put(key,value+1);\n\t\t\t}\n\t\t\t\n\t\t\t// set submitted query\n\t\t\tif (submittedQuery!=null) { // sanity check\n\t\t\t\tthrow new IOException(\"Submitted query already set.\");\n\t\t\t}\n\t\t\tsubmittedQuery=queryPartsFields[1];\n\t\t\t\t\n\t\t\t// count queries per session\t\n\t\t\tnQueriesSession++;\n\t\t}\n\t\treturn submittedQuery;\n\t}", "public Set<String> calculateDistance() throws IOException {\n booleanSearch();\n\n Set<String> words = invertedIndexForQuerryWords.keySet();\n Map<String, Double> tfidfQuerry = new TreeMap<>();\n\n //load idf\n char c='a';\n char prC = 'v';\n for (String word : words){\n c = word.charAt(0);\n if(c != prC) {\n String path = Constants.PATH_TO_IDF + c + \"IDF.idf\";\n prC = c;\n idfMap.putAll(objectMapper.readValue(new File(path), new TypeReference<TreeMap<String, Double>>(){}));\n }\n }\n\n Map<String, Double> distanceMap = new HashMap<>();\n double sum = 0.0;\n //calculez norma interogarii\n for(String word:words){\n double idf, tf;\n if(idfMap.containsKey(word)) {\n idf = idfMap.get(word);\n tf = 1.0 / words.size();\n tfidfQuerry.put(word, tf * idf);\n\n sum += (tf * idf) * (tf * idf);\n } else {\n sum += 0.0;\n }\n }\n\n double normQuerry = Math.sqrt(sum);\n\n //iau toate documentele rezultate din boolean search\n Set<String> docs = new TreeSet<>();\n for(List<MyPair> list : invertedIndexForQuerryWords.values()) {\n if (list != null) {\n docs.addAll(list.stream().map(p -> p.getKey()).collect(Collectors.toSet()));\n }\n }\n\n List<File> documents = FileLoader.getFilesForInternalPath(\"Norms\", \".norm\");\n\n Map<String, Double> norms = new HashMap<>();\n for(File file : documents) {\n norms.putAll(objectMapper.readValue(file, new TypeReference<TreeMap<String, Double>>(){}));\n }\n\n //pentru fiecare document din boolean search calculez distanta cosinus\n for(String doc : docs) {\n\n String fileName = Paths.get(doc).getFileName().toString();\n\n String filePath = Constants.PATH_TO_TF + fileName.replaceFirst(\"[.][^.]+$\", \".tf\");\n\n Map<String, Double> tf = objectMapper.readValue(new File(filePath), new TypeReference<TreeMap<String, Double>>(){});\n double wordTF, wordIDF;\n double vectorialProduct = 0.0;\n double tfidfForQueryWord;\n\n for(String word : words) {\n if (tf.containsKey(word)) {\n wordTF = tf.get(word);\n wordIDF = idfMap.get(word);\n tfidfForQueryWord = tfidfQuerry.get(word);\n\n vectorialProduct += tfidfForQueryWord * wordIDF * wordTF;\n }\n }\n\n double normProduct = normQuerry * norms.get(Paths.get(doc).getFileName().toString());\n\n distanceMap.put(doc, vectorialProduct / normProduct);\n }\n\n //sortare distance map\n distanceMap = distanceMap.entrySet().stream()\n .sorted(Map.Entry.comparingByValue(Collections.reverseOrder()))\n .collect(Collectors.toMap(\n Map.Entry::getKey,\n Map.Entry::getValue,\n (e1, e2) -> e1,\n LinkedHashMap::new));\n\n// System.out.println(\"Cos distance:\");\n// for(Map.Entry entry : distanceMap.entrySet()){\n// System.out.println(entry);\n// }\n\n return distanceMap.keySet();\n }", "public static void calcuTFIDF() throws IOException {\n\n\t\tHashtable<String, Double> idf = new Hashtable<String, Double>();\n\t\tArrayList<String> terms = new ArrayList<String>();\n\t\tdouble fileCount = 0.0;\n\t\tString featurePath = \"./corpus/features\";\n\t\tString featureWeight = \"./corpus/featureWeight\";\n\t\tString trainPath = \"./corpus/trainData\";\n\t\tString testPath = \"./corpus/testData\";\n\t\tString stopPath = \"./corpus/english.stop\";\n\t\tString trainOutPath = \"./corpus/trainVectors\";\n\t\tString testOutPath = \"./corpus/testVectors\";\n\t\tBufferedReader br = new BufferedReader(new FileReader(featurePath));\n\t\tBufferedWriter featureWriter = new BufferedWriter(new FileWriter(\n\t\t\t\tfeatureWeight));\n\t\tBufferedReader trainReader = new BufferedReader(new FileReader(\n\t\t\t\ttrainPath));\n\t\tBufferedReader testReader = new BufferedReader(new FileReader(testPath));\n\t\tBufferedReader br2 = new BufferedReader(new FileReader(stopPath));\n\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(trainOutPath));\n\t\tBufferedWriter testWriter = new BufferedWriter(new FileWriter(\n\t\t\t\ttestOutPath));\n\t\tString oneline;\n\t\tArrayList<String> as = new ArrayList<String>();\n\t\twhile ((oneline = br2.readLine()) != null) {\n\t\t\tas.add(oneline);\n\t\t}\n\t\tString[] stopWords = new String[as.size()];\n\t\tas.toArray(stopWords);\n\t\tAnalyzer analyzer = new SnowballAnalyzer(\"English\", stopWords);\n\n\t\twhile ((oneline = br.readLine()) != null) {\n\t\t\tidf.put(oneline, 0.0);\n\t\t\tterms.add(oneline);\n\t\t}\n\n\t\twhile ((oneline = trainReader.readLine()) != null) {\n\n\t\t\tint pos = oneline.indexOf(\"\\t\");\n\t\t\tString topic = oneline.substring(0, pos);\n\t\t\tString content = oneline.substring(pos + 1);\n\t\t\tfileCount++;\n\t\t\tHashtable<String, Integer> termList = new Hashtable<String, Integer>();\n\t\t\tTokenStream stream = analyzer.tokenStream(\"\", new StringReader(\n\t\t\t\t\tcontent));\n\t\t\twhile (true) {\n\t\t\t\tToken token = stream.next();\n\t\t\t\tif (token == null)\n\t\t\t\t\tbreak;\n\t\t\t\tString tmp = token.termText();\n\t\t\t\tif (!termList.containsKey(tmp))\n\t\t\t\t\ttermList.put(tmp, new Integer(1));\n\t\t\t}\n\t\t\tSet<String> keys = termList.keySet();\n\t\t\tfor (String tmp : keys) {\n\t\t\t\tif (idf.containsKey(tmp)) {\n\t\t\t\t\tDouble num = idf.get(tmp);\n\t\t\t\t\tidf.put(tmp, num + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (String term : terms) {\n\n\t\t\tdouble weightOfTerm = Math.log((double) fileCount / idf.get(term)\n\t\t\t\t\t+ 0.01);\n\t\t\tfeatureWriter.write(term + \" \" + weightOfTerm);\n\t\t\tfeatureWriter.newLine();\n\t\t\tidf.put(term, weightOfTerm);\n\n\t\t}\n\t\tfeatureWriter.flush();\n\t\tfeatureWriter.close();\n\n\t\ttrainReader = new BufferedReader(new FileReader(trainPath));\n\t\twhile ((oneline = trainReader.readLine()) != null) {\n\n\t\t\tint pos = oneline.indexOf(\"\\t\");\n\t\t\tString topic = oneline.substring(0, pos);\n\t\t\tString content = oneline.substring(pos + 1);\n\t\t\tHashtable<String, Integer> termFrequent = new Hashtable<String, Integer>();\n\t\t\tTokenStream stream = analyzer.tokenStream(\"\", new StringReader(\n\t\t\t\t\tcontent));\n\t\t\twhile (true) {\n\t\t\t\tToken token = stream.next();\n\t\t\t\tif (token == null)\n\t\t\t\t\tbreak;\n\t\t\t\tString tmp = token.termText();\n\t\t\t\tif (!termFrequent.containsKey(tmp))\n\t\t\t\t\ttermFrequent.put(tmp, new Integer(1));\n\t\t\t\telse {\n\t\t\t\t\tInteger num = termFrequent.get(tmp);\n\t\t\t\t\ttermFrequent.put(tmp, num + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdouble weights[] = new double[terms.size()];\n\t\t\tdouble denominator = 0.0;\n\t\t\tint i = 0;\n\t\t\tfor (String term : terms) {\n\t\t\t\tdouble count;\n\t\t\t\tif (termFrequent.containsKey(term)) {\n\t\t\t\t\tcount = termFrequent.get(term);\n\t\t\t\t} else {\n\t\t\t\t\tcount = 0;\n\t\t\t\t}\n\n\t\t\t\tdouble tmp = count * idf.get(term);\n\t\t\t\tdenominator += tmp;\n\t\t\t\tweights[i++] = tmp;\n\t\t\t}\n\t\t\tdenominator = Math.sqrt(denominator);\n\t\t\twriter.write(topic);\n\t\t\tfor (int j = 1; j <= weights.length; j++) {\n\t\t\t\tdouble tmp = weights[j - 1];\n\t\t\t\tif (tmp > 0.0) {\n\t\t\t\t\ttmp = Math.sqrt(tmp) / denominator;\n\t\t\t\t\twriter.write(\" \" + j + \":\" + tmp);\n\t\t\t\t}\n\t\t\t}\n\t\t\twriter.newLine();\n\t\t}\n\n\t\twhile ((oneline = testReader.readLine()) != null) {\n\n\t\t\tint pos = oneline.indexOf(\"\\t\");\n\t\t\tString topic = oneline.substring(0, pos);\n\t\t\tString content = oneline.substring(pos + 1);\n\t\t\tHashtable<String, Integer> termFrequent = new Hashtable<String, Integer>();\n\t\t\tTokenStream stream = analyzer.tokenStream(\"\", new StringReader(\n\t\t\t\t\tcontent));\n\t\t\twhile (true) {\n\t\t\t\tToken token = stream.next();\n\t\t\t\tif (token == null)\n\t\t\t\t\tbreak;\n\t\t\t\tString tmp = token.termText();\n\t\t\t\tif (!termFrequent.containsKey(tmp))\n\t\t\t\t\ttermFrequent.put(tmp, new Integer(1));\n\t\t\t\telse {\n\t\t\t\t\tInteger num = termFrequent.get(tmp);\n\t\t\t\t\ttermFrequent.put(tmp, num + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdouble weights[] = new double[terms.size()];\n\t\t\tdouble denominator = 0.0;\n\t\t\tint i = 0;\n\t\t\tfor (String term : terms) {\n\t\t\t\tdouble count;\n\t\t\t\tif (termFrequent.containsKey(term)) {\n\t\t\t\t\tcount = termFrequent.get(term);\n\t\t\t\t} else {\n\t\t\t\t\tcount = 0;\n\t\t\t\t}\n\t\t\t\tdouble tmp = count * idf.get(term);\n\t\t\t\tdenominator += tmp;\n\t\t\t\tweights[i++] = tmp;\n\t\t\t}\n\t\t\tdenominator = Math.sqrt(denominator);\n\t\t\ttestWriter.write(topic);\n\t\t\tfor (int j = 1; j <= weights.length; j++) {\n\t\t\t\tdouble tmp = weights[j - 1];\n\t\t\t\tif (tmp > 0.0) {\n\t\t\t\t\ttmp = Math.sqrt(tmp) / denominator;\n\t\t\t\t\ttestWriter.write(\" \" + j + \":\" + tmp);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttestWriter.newLine();\n\t\t}\n\t\twriter.close();\n\t\ttestWriter.close();\n\t}", "public void makeQueryTermList() {\n for (int i = 0; i < this.stemmed_query.size(); i++) {\n boolean added = false;\n String curTerm = this.stemmed_query.get(i);\n for (int j = 0; j < this.query_terms_list.size(); j++) {\n if (this.query_terms_list.get(j).strTerm.compareTo(curTerm) == 0) {\n this.query_terms_list.get(j).timeOccur++;\n added = true;\n break;\n }\n }\n if (added == false) {\n this.query_terms_list.add(new QueryTerm(curTerm));\n }\n }\n }", "public interface Query {\n\n\t/**\n\t * @return ID of the given query\n\t */\n\tint queryID();\n\t\n\t/**\n\t * @return given query\n\t */\n\tString query();\n\t\n\t/**\n\t * @return list of relevant documents to the corresponding query\n\t */\n\tList<RelevanceInfo> listOfRelevantDocuments();\n\t\n\t/**\n\t * @return list of results to the corresponding query after running one of the retrieval models\n\t */\n\tList<Result> resultList();\n\t\n\t/**\n\t * @param resultList\n\t * @Effects adds results to the result list of the corresponding query\n\t */\n\tvoid putResultList(List<Result> resultList);\n}", "private ArrayList<WordDocument> executeAdvancedQuery(){\n ArrayList<WordDocument> documents = customDijkstrasTwoStack(this.query.split(\" \"));\n ArrayList<WordDocument> result = new ArrayList<WordDocument>();\n\n try{\n String[] orderByPart = query.substring(query.indexOf(\"ORDERBY\")).trim().toLowerCase().split(\" \");\n if(isOrderByCommand(orderByPart[0]))\n result = orderBy(documents, orderByPart[1], orderByPart[2]);\n }catch (StringIndexOutOfBoundsException ex){\n result = documents;\n }\n\n return result;\n }", "public List<Integer> processRelatedDocs(Query query) {\r\n List<Integer> result = new ArrayList<>();\r\n\r\n if (query.isTerm()) {\r\n\r\n result = this.processRelatedDocsQuery(query.getText());\r\n\r\n } else {\r\n\r\n //query.getNodes().keySet()\r\n for (BooleanClause.Occur key : new BooleanClause.Occur[] {\r\n BooleanClause.Occur.MUST,\r\n BooleanClause.Occur.SHOULD,\r\n BooleanClause.Occur.MUST_NOT }) {\r\n\r\n List<Query> nodes = query.getNodes().get(key);\r\n\r\n // no-op\r\n if(nodes.isEmpty()) continue;\r\n\r\n switch (key) {\r\n /* AND */ case MUST:\r\n for (Query node : nodes) {\r\n List<Integer> rel = this.processRelatedDocs(node);\r\n result = this.operator.and(result, rel);\r\n }\r\n break;\r\n /* OR */ case SHOULD:\r\n for (Query node : nodes) {\r\n List<Integer> rel = this.processRelatedDocs(node);\r\n result = this.operator.or(result, rel);\r\n }\r\n break;\r\n /* NOT */ case MUST_NOT:\r\n for (Query node : nodes) {\r\n List<Integer> rel = this.processRelatedDocs(node);\r\n result = this.operator.not(result, rel);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }", "@Override\n public synchronized Long count(String query) {\n long count = 0L;\n String nQuery = normalizeQuery(query);\n Set<String> keys = suggestIndex.getKeys();\n Map index = suggestIndex.getIndex();\n LinkedHashSet<Long> result = new LinkedHashSet<Long>();\n\n logger.debug(\"IN SEARCH: query={}, keys={}\", query, keys);\n\n StringBuilder patternBuilder;\n List<Pattern> patterns = new ArrayList<Pattern>();\n for (String keyPart : nQuery.split(\" \")) {\n patternBuilder = new StringBuilder(\"^(?iu)\");\n patternBuilder.append(ALLOWED_CHARS_REGEXP);\n keyPart = Normalizer.normalize(keyPart, Normalizer.Form.NFD);\n patternBuilder.append(keyPart)\n .append(ALLOWED_CHARS_REGEXP)\n .append('$');\n patterns.add(Pattern.compile(patternBuilder.toString()));\n }\n\n for (String key : keys) {\n for (Pattern pattern : patterns) {\n\n if (pattern.matcher(key).matches()) {\n result.addAll((LinkedHashSet<Long>) index.get(key));\n count += ((LinkedHashSet<Long>) index.get(key)).size();\n }\n }\n }\n return Long.valueOf(result.size());\n }", "CampusSearchQuery generateQuery();", "public void set_graph() throws ParseException, IOException {\n \tg = new WeightedUndirectedGraph(words.length);\n //g = new WeightedUndirectedGraph(most_important_terms.size());\n \n Directory dir = new SimpleFSDirectory(new File(\".\\\\data\\\\lucene_index_r_r\"));\n Analyzer analyzer = new StandardAnalyzer(LUCENE_41);\n \n // creat a map that stores, for each word (in the cluster), a set of all the documents that contain that word\n HashMap<String,HashSet<Integer>> word_to_docs_map = new HashMap<String,HashSet<Integer>>();\n int n_strings = words.length; \n \n // for each word...\n for (int idx = 0; idx < n_strings; idx++) {\n // query the index with that given word and retrieve all the documents that contains that word\n String query = words[idx]; \n QueryParser parser = new QueryParser(Version.LUCENE_41, \"text\", analyzer); \n Query q = parser.parse(query); \n\n IndexReader reader = DirectoryReader.open(dir);\n IndexSearcher searcher = new IndexSearcher(reader);\n TopDocs docs = searcher.search(q, reader.numDocs());\n ScoreDoc[] hits = docs.scoreDocs;\n \n // update map from word to docs it appears in \n //HashSet<Integer> tmp = null;\n // tmp is the set of all the document ids in which the current word is contained\n HashSet<Integer> tmp = new HashSet<>();\n //word_to_docs_map.put(query, tmp);\n \n // for each document, retrieved from the query\n for(Integer i=0;i<hits.length;i++) {\n Integer docId = hits[i].doc;\n // tmp = word_to_docs_map.get(query); \n // if the document is a document written by an user of interest \n if(indices.contains(docId)) {\n tmp.add(docId);\n }\n //word_to_docs_map.put(query, tmp); \n }\n word_to_docs_map.put(query, tmp);\n\t }\n\t \n\t // add edges: iterate over possible term pairs ...\n\t for(int idx_1 = 0; idx_1 < n_strings - 1; idx_1++) {\n\t \n\t for(int idx_2 = idx_1 + 1 ; idx_2 < n_strings ; idx_2 ++ ) {\n\t \n\t // extract document sets associated with the considered terms \n\t HashSet<Integer> set_a = word_to_docs_map.get(words[idx_1]); \n\t HashSet<Integer> set_b = word_to_docs_map.get(words[idx_2]); \n\t \n\t // compute set intersection \n\t int n = intersectionSize(set_a, set_b);\n\t \n\t // if the terms appear in at least one common document\n\t if(n>0) {\n\t // add edge \n\t g.testAndAdd(idx_1, idx_2 , n); \n\t }\n\t } \n\t }\n\t}", "@Override\n public boolean onQueryTextSubmit(String query) {\n prepareBooks(engine.search(query.toLowerCase(),filter));\n return false;\n }", "public static List<String> query_intersect(List<String> queryWords) throws IOException {\n\t\tif (!initialized) initialize();\n\t\tList<PostingList> pls = new ArrayList<PostingList> ();\n\t\tfor (String queryWord : queryWords) {\n\t\t\tqueryWord = queryWord.toLowerCase();\n\t\t\tif (!termDict.containsKey(queryWord)) {\n\t\t\t\tpls.clear();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tPostingList pl = readPosting(fc, termDict.get(queryWord));\n\t\t\tif (pl == null) {\n\t\t\t\tpls.clear();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpls.add(readPosting(fc, termDict.get(queryWord)));\n\t\t}\n\t\tCollections.sort(pls, new Comparator<PostingList>(){\n\t\t public int compare(PostingList p1, PostingList p2) {\n\t\t return p1.size() - p2.size(); // assumes you want biggest to smallest\n\t\t }\n\t\t});\n\t\tif (pls.size() == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tList<Integer> current = pls.get(0).getList();\n\t\t\tfor (int i = 1; i < pls.size(); i++) {\n\t\t\t\tList<Integer> toBeAdd = pls.get(i).getList();\n\t\t\t\tcurrent = intersect(current, toBeAdd);\n\t\t\t}\n\t\t\tif (current.size() == 0) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\tList<String> result = new ArrayList<String>();\n\t\t\t\tfor (int docId : current) {\n\t\t\t\t\tresult.add(docDict.get(docId));\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}", "public void calculateTermWeights() {\n\t\tfor (String termString : terms.keySet()) {\n\t\t\tTerm t = terms.get(termString);\n\t\t\tMap<Integer, TermDoc> posting = t.getPostings();\n\n\t\t\t// Iterate through the docs in which the selected term is found.\n\t\t\tfor (Integer docId : posting.keySet()) {\n\n\t\t\t\tTermDoc td = posting.get(docId);\n\t\t\t\tDocument doc = this.getDocument(docId);\n\n\t\t\t\tfinal double a = 0.4;\n\t\t\t\tdouble ntf = a + (1 - a) * (double) td.getFreq() / (double) doc.getMaxTermFreq();\n\t\t\t\tdouble idf = Math.log((double) documents.size() / (1 + (double) t.getDocFreq()));\n\t\t\t\tdoc.addWeight(termString, ntf * idf);\n\t\t\t}\n\t\t}\n\n\t\tfor (Document doc : documents.values())\n\t\t\tdoc.setEuclideanDistance();\n\t}", "public void parseAndRankQuery(String stringNumber) throws Exception {\n\n if (this.semantics) { //if the user choose semantic\n semantic=new ArrayList<>();\n Word2VecModel model = Word2VecModel.fromTextFile(new File(\"word2vec.c.output.model.txt\"));\n com.medallia.word2vec.Searcher semanticSearchrt = model.forSearch();\n int num = 10;\n String[] semanQuery = query.split(\" \");\n for (String s : semanQuery)\n {\n try {\n List<com.medallia.word2vec.Searcher.Match> matches = semanticSearchrt.getMatches(s.toLowerCase(), num);\n for (com.medallia.word2vec.Searcher.Match match : matches) {\n match.match();\n }\n if(matches.get(0).equals(s)) {\n query = query + \" \" + matches.get(1);\n String dd=\"\"+matches.get(1);\n semantic.add(dd);\n }\n else {\n query = query + \" \" + matches.get(0); //add to query the high semantics 3 top words score\n String dd=\"\"+matches.get(0);\n semantic.add(dd);\n }\n } catch(com.medallia.word2vec.Searcher.UnknownWordException e){\n }\n }\n }\n\n ranker = new Ranker(this.indexer,stringNumber,path,originalString); // new ranker\n ArrayList<String> cleanQuery;\n ArrayList<String> parsedQueryList;\n ReadFile rd=new ReadFile();\n cleanQuery=rd.cleanLine(stemming,query); //clean the query from dots and other signs\n HashMap<String, Pair<Integer,String>> parsedQuery=new HashMap<>();\n parsedQuery=parser.Tokenizer(cleanQuery,\"\",stemming); //parse the query\n Iterator it = parsedQuery.entrySet().iterator();\n parsedQueryList=new ArrayList<>();\n while (it.hasNext()) {\n Map.Entry pair = (Map.Entry)it.next();\n parsedQueryList.add((String)pair.getKey());\n it.remove(); // avoids a ConcurrentModificationException\n }\n ranker.setParseredQuery(parsedQueryList);\n try {\n ranker.orgByPostFile();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public void testAdvancedQuery() {\n\t\t//manager.advancedQuery(ElasticIndex.analyzed, \"metropolitan areas\", \"sports clubs\");\n\t\t//manager.advancedQuery(ElasticIndex.analyzed, \"\", \"Award\");\n\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"american actor\", \"list of movies starring Sean Connery\");\n//\tmanager.categorySearch(\"Sportspeople\", \"tennis\",ElasticIndex.analyzed,30);\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"Broadway musicals\", \"Grammy Award\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"musical movies\", \"Tony Award\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"Top level football leagues\", \"teams\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"american movies\", \"directed by Woody Allen\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"United states\", \"professional sports teams\");\n\t\t//manager.advancedQuery(\"musical movies\", \"tony award\");\n\t\t//manager.advancedQuery(\"grammy\", \"best album in 2012\"); \n\t\t//manager.advancedQuery(\"american movies\", \"directed by Woody Allen\"); \n\t\t//Canceled manager.advancedQuery(\"tennis\", \"international players\"); \n\t\t// canceled manager.advancedQuery(\"tennis\", \"french open\"); \n\t\t// canceled manager.advancedQuery(\"film movie\", \"1933\"); \n//\t\tmanager.advancedQuery(\"United states\", \"professional sports teams \");\n//\t\t manager.advancedQuery(\"computer games\", \"developed by Ubisoft\");\n//\t\tmanager.advancedQuery(\"movies\", \"academy award nominations\");\n //manager.advancedQuery(\"movies\", \"starring Dustin Hoffman\");\n // manager.advancedQuery(\"movies\", \"best costume design\");\n // manager.advancedQuery(\"concert tours\", \"england\");\n // manager.advancedQuery(\"sport\", \"Francesco\");\n\t\t//System.out.println(\"******* advanced query *******\");\n\t\t//manager.advancedQuery(\"sportspeople\", \"tennis\");\n//\t\tmanager.advancedQuery(ElasticIndex.analyzed, \"Broadway musicals\", \"Grammy Award\");\n //System.out.println(\"*****************************\");\n\n\n\t\t\n\t\t//manager.advancedQuery(\"football\", \"italian championship\");\n\t\t//manager.advancedQuery(\"american basketball\", \"team\");\n\t\t //manager.advancedQuery(\"Goya Award\", \"Winner and nominees from FRA\");\n\t\t//manager.advancedQuery(\"films\", \"american comedy \");\n\t\t//manager.advancedQuery(\"films\", \"american Adventure directed by James P. Hogan\");\n\t\t//manager.advancedQuery(\"NCAA Division\", \"american universities in Arkansas\");\n\t\t//manager.advancedQuery(\"Academy award\", \"winners and nominees in acting in 2011\");\n\t\t//manager.advancedQuery(\"canadian soccer\", \"Alain Rochat position \");\n\n\t}", "public Vector mapDocument(BOW bow) {\n //logger.info(\"lsm.mapDocument\");\n SparseVector vector = new SparseVector();\n\n Iterator<String> it = bow.termSet().iterator();\n String term = null;\n int index = 0;\n //int tf = 0;\n float tfIdf;\n for (int i = 0; it.hasNext(); i++) {\n //logger.info(i + \" \" + t[i]);\n term = it.next();\n index = termIndex.get(term);\n\n if (index != -1) {\n //tf = bow.getFrequency(term);\n //tfIdf = (float) (log2(tf)) * Iidf[index];\n //tfIdf = (float) bow.augmentedFrequency(term) * Iidf[index];\n tfIdf = (float) bow.tf(term) * Iidf[index];\n //logger.info(term + \" ==> \" + index + \", tf.idf = \" + tf + \"(\" + (log2(tf)) + \") * \" + Iidf[index] + \" = \" + tfIdf);\n vector.add(index, tfIdf);\n\n }\n } // end for\n\n return vector;\n }", "public void updateTermInThisQuery(int relevanceFeedbackMethod) {\n query thisQuery = listDocumentRetrievedForThisQuery.getQuery();\n StringTokenizer token = new StringTokenizer(thisQuery.getQueryContent(), \" %&\\\"*#@$^_<>|`+=-1234567890'(){}[]/.:;?!,\\n\");\n while (token.hasMoreTokens()) {\n String keyTerm = token.nextToken();\n String filteredWord;\n if (invertedFileQuery.isStemmingApplied()) {\n filteredWord = StemmingPorter.stripAffixes(keyTerm);\n } else {\n filteredWord = keyTerm;\n }\n try {\n termWeightingDocument relation = invertedFileQuery.getListTermWeights().get(filteredWord);\n if (relation.getDocumentWeightCounterInOneTerm().get(thisQuery.getIndex()) != null) {\n double oldWeight = relation.getDocumentWeightCounterInOneTerm().get(thisQuery.getIndex()).getWeight();\n double newWeight = computeNewWeightTerm(relevanceFeedbackMethod,filteredWord,oldWeight);\n if (newWeight > 0) {\n newQueryComposition.put(keyTerm, newWeight);\n relation.getDocumentWeightCounterInOneTerm().get(thisQuery.getIndex()).setWeight(newWeight);\n } else {\n relation.getDocumentWeightCounterInOneTerm().get(thisQuery.getIndex()).setWeight(0.0);\n }\n }\n } catch (Exception e) {\n\n }\n }\n }", "public List<Classes.Document> RetrieveQuery(Classes.Query cQuery, int TopN, int TopK, double alpha) throws Exception { \r\n\t\t// Get P(token|feedback model)\r\n\t\tHashMap<String, Double> TokenRFScore = GetTokenRFScore(cQuery, TopK);\r\n\r\n\t\t// Store sorted top N results (from most relevant to least)\r\n\t\tList<Classes.Document> rankedList = new ArrayList<>();\r\n\t\t\r\n\t\t// Get query's content as input into retrieval model\r\n\t\tString[] tokens = cQuery.getQueryContent().split(\" \");\r\n\t\tList<DocScore> docScoreList = new ArrayList<>();\r\n\t\tqueryResult.forEach((luceneID, tfMap) -> {\r\n\t\t int doclen = 0;\r\n\t\t double score = 1.0;\r\n\t\t try {\r\n\t\t doclen = myireader.docLength(luceneID);\r\n\t\t } catch (Exception e) {\r\n\t\t \t e.printStackTrace();\r\n\t\t };\r\n\t\t \r\n\t\t /**\r\n\t\t\t * Dirichlet Prior Smoothing:\r\n\t\t\t * p(w|D) = (|D|/(|D|+MU))*(c(w,D)/|D|) + (MU/(|D|+MU))*p(w|REF)\r\n\t\t * score = λ*p_doc + (1-λ)*p_ref\r\n\t\t * = c1*p_doc + c2*p_ref\r\n\t\t\t */\r\n\t\t double c1 = doclen / (doclen + MU);\r\n\t\t double c2 = MU / (doclen + MU);\r\n\t\t for(String token : tokens) {\r\n\t\t \t long cf = termFreq.get(token);\r\n\t\t \t if(cf == 0) {\t\r\n\t\t \t\t continue;\r\n\t\t \t }\r\n\t\t \r\n\t\t \t int tf = tfMap.getOrDefault(token, 0);\r\n\t\t \t double p_doc = (double) tf / doclen; // c(w, D)\r\n\t\t \t double p_ref = (double) cf / CORPUS_SIZE; // p(w|REF)\r\n\t\t \t \r\n\t\t \t // Get the final probability of each token with pseudo RF score\r\n\t\t \t score *= alpha * (c1 * p_doc + c2 * p_ref) + (1 - alpha) * TokenRFScore.get(token);\r\n\t\t }\r\n\t\t \r\n\t\t DocScore docScore = new DocScore(luceneID, score);\r\n\t\t docScoreList.add(docScore);\r\n\t\t}); // The end of forEach loop block\r\n\r\n\t\t// Sort the result List \r\n\t\tCollections.sort(docScoreList, new Comparator<DocScore>() {\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(DocScore ds1, DocScore ds2) {\r\n\t\t\t\tif(ds1.score != ds2.score) {\r\n\t\t\t\t\treturn ds1.score < ds2.score ? 1 : -1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// Put all documents into result list\r\n\t\tfor(int n = 0; n < TopN; n++) {\r\n\t\t DocScore docScore = docScoreList.get(n);\r\n\t\t Classes.Document doc = null;\r\n\t\t try {\r\n\t\t \t int luceneID = docScore.getId(); // Get Lucene id\r\n\t\t \t doc = new Document(Integer.toString(luceneID), \r\n\t\t \t\t\t \t\t\tmyireader.getDocno(luceneID), \r\n\t\t \t\t\t docScore.getScore(),\r\n\t\t \t\t\t dreader.document(luceneID).get(\"restName\"),\r\n\t\t \t\t\t dreader.document(luceneID).get(\"restUrl\"),\r\n\t\t \t\t\t dreader.document(luceneID).get(\"originalContent\"));\r\n\t\t } catch(Exception e) {\r\n\t\t \t e.printStackTrace();\r\n\t\t };\r\n\t\t \r\n\t\t rankedList.add(doc);\r\n\t\t}\r\n\r\n\t\treturn rankedList;\r\n\t}", "public static void docWtgArray() {\n int docCount = 0;\n\n while(docCount<totaldocument) {\n List<Double> pass = new ArrayList();\n for(Entry<String,List<Double>> entry : wtgMap.entrySet()) {\n List<Double> docList = new ArrayList();\n docList = entry.getValue();\n double temp = docList.get(docCount);\n pass.add(temp);\n }\n\n double answer = CosineSimilarity(pass,query);\n if(answer >= alpha) {\n DocID.put(docCount,answer);\n }\n docCount++;\n }\n }", "protected Query newTermQuery(Term term, float boost) {\n Query q = new TermQuery(term);\n if (boost == DEFAULT_BOOST) {\n return q;\n }\n return new BoostQuery(q, boost);\n }", "@Override\r\n\t\t\tpublic List<ScoredDocument> search(Query query, long maxNumberOfDocuments) {\n\t\t\t\treturn null;\r\n\t\t\t}", "public ArrayList<String> getResults(String query) {\r\n\t\t// TODO: Add code here\r\n\t\tHashMap<String,Double> map=new HashMap<>();\r\n\t\tArrayList<String> urls=wordIndex.get(query);\r\n\t\tif(urls==null){\r\n\t\t\treturn new ArrayList<>();\r\n\t\t}\r\n\t\tfor(String url:urls){\r\n\t\t\tmap.put(url,internet.getPageRank(url));\r\n\t\t}\r\n\t\treturn Sorting.fastSort(map);\r\n\t}", "public void actionPerformed(ActionEvent e) {\n displayInfoText(\" \");\n // Turn the search string into a Query\n String queryString = queryWindow.getText().toLowerCase().trim();\n query = new Query(queryString);\n // Take relevance feedback from the user into account (assignment 3)\n // Check which documents the user has marked as relevant.\n if (box != null) {\n boolean[] relevant = new boolean[box.length];\n for (int i = 0; i < box.length; i++) {\n if (box[i] != null)\n relevant[i] = box[i].isSelected();\n }\n query.relevanceFeedback(results, relevant, engine);\n }\n // Search and print results. Access to the index is synchronized since\n // we don't want to search at the same time we're indexing new files\n // (this might corrupt the index).\n long startTime = System.currentTimeMillis();\n synchronized (engine.indexLock) {\n results = engine.searcher.search(query, queryType, rankingType);\n }\n long elapsedTime = System.currentTimeMillis() - startTime;\n // Display the first few results + a button to see all results.\n //\n // We don't want to show all results directly since the displaying itself\n // might take a long time, if there are many results.\n if (results != null) {\n displayResults(MAX_RESULTS, elapsedTime / 1000.0);\n } else {\n displayInfoText(\"Found 0 matching document(s)\");\n\n if (engine.speller != null) {\n startTime = System.currentTimeMillis();\n SpellingOptionsDialog dialog = new SpellingOptionsDialog(50);\n String[] corrections = engine.speller.check(query, 10);\n elapsedTime = System.currentTimeMillis() - startTime;\n System.err.println(\"It took \" + elapsedTime / 1000.0 + \"s to check spelling\");\n if (corrections != null && corrections.length > 0) {\n String choice = dialog.show(corrections, corrections[0]);\n if (choice != null) {\n queryWindow.setText(choice);\n queryWindow.grabFocus();\n\n this.actionPerformed(e);\n }\n }\n }\n }\n }", "public QueryController(String[] args){\n // Parse Args\n QueryArgs queryArgs = new QueryArgs();\n try {\n queryArgs.parseArgs(args);\n } catch (FileNotFoundException e) {\n //e.printStackTrace();\n System.err.println(\"Invalid Arguments received. Please check your arguments passed to ./search\");\n return;\n }\n\n // Run the Term Normaliser\n TermNormalizer normalizer = new TermNormalizer();\n String[] queryTerms = normalizer.transformedStringToTerms(queryArgs.queryString);\n\n //create the model\n Model model = new Model();\n model.loadCollectionFromMap(queryArgs.mapPath);\n model.loadLexicon(queryArgs.lexiconPath);\n model.loadInvertedList(queryArgs.invlistPath);\n if(queryArgs.stopListEnabled)\n {\n model.loadStopList(queryArgs.stopListPath);\n }\n if(queryArgs.printSummary && queryArgs.collectionPath != \"\")\n {\n model.setPathToCollection(queryArgs.collectionPath);\n }\n\n\n //fetch the top results from the query module\n QueryModule queryModule = new QueryModule();\n queryModule.doQuery(queryTerms, model, queryArgs.bm25Enabled);\n List<QueryResult> topResults = queryModule.getTopResult(queryArgs.maxResults);\n\n\n\n ResultsView resultsView = new ResultsView();\n if(queryArgs.printSummary)\n {\n\n DocSummary docSummary = new DocSummary();\n for(QueryResult result:topResults)\n {\n // retrieve the actualy text from the document collection\n result.setDoc(model.getDocumentCollection().getDocumentByIndex(result.getDoc().getIndex(), true));\n\n //set the summary on the result object by fetching it from the docSummary object\n result.setSummaryNQB(docSummary.getNonQueryBiasedSummary(result.getDoc(), model.getStopListModule()));\n result.setSummaryQB(docSummary.getQueryBiasedSummary(result.getDoc(), model.getStopListModule(), Arrays.asList(queryTerms)));\n }\n resultsView.printResultsWithSummary(topResults,queryArgs.queryLabel);\n }else\n {\n resultsView.printResults(topResults,queryArgs.queryLabel);\n }\n\n }", "@Test\n public void testPhrase() {\n assertQ(req(\"q\",\"text:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='1']\"\n );\n // should generate a query of (now OR cow) and match both docs\n assertQ(req(\"q\",\"text_np:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='2']\"\n );\n }", "public Vector mapDocument(MultiSet<String> bow) {\n //logger.info(\"lsm.mapDocument\");\n SparseVector vector = new SparseVector();\n\n Iterator<String> it = bow.iterator();\n String term = null;\n int index = 0;\n int tf = 0;\n float tfIdf;\n for (int i = 0; it.hasNext(); i++) {\n //logger.info(i + \" \" + t[i]);\n term = it.next();\n index = termIndex.get(term);\n\n if (index != -1) {\n tf = bow.getFrequency(term);\n tfIdf = (float) (log2(tf)) * Iidf[index];\n\n //logger.info(term + \" ==> \" + index + \", tf.idf = \" + tf + \"(\" + (log2(tf)) + \") * \" + Iidf[index] + \" = \" + tfIdf);\n vector.add(index, tfIdf);\n\n }\n } // end for\n\n return vector;\n }", "public SortedSet<LabeledVector> query(double[] queryVector) {\n SortedSet<LabeledVector> sortedSet = new TreeSet<LabeledVector>(new LabeledVectorCompare(queryVector));\n for (int i = 0; i < vectors.length; i++) {\n boolean addedDoc = sortedSet.add(new LabeledVector(i, vectors[i]));\n assert(addedDoc);\n }\n return sortedSet;\n }", "public Utwor search2(String query) {\n for (Utwor utwor : utwory) {\n if (utwor.getTitle().equals(query)) {\n return utwor;\n }\n }\n return null;\n }", "@Override\n public void postInserts() \n {\n for(IndexObject i: myIndex.values())\n {\n i.tfidf(documentData);\n }\n }", "public abstract double score(double tf, double docLength);", "public ArrayList<String> top5search(String kw1, String kw2) {\n\t\t/** COMPLETE THIS METHOD **/\n\t\tArrayList<String> results = new ArrayList<String>();\n\t\tArrayList<Occurrence> ocArr1 = new ArrayList<Occurrence>();\n\t\tArrayList<Occurrence> ocArr2 = new ArrayList<Occurrence>();\n\t\tArrayList<Occurrence> combined = new ArrayList<Occurrence>();\n\t\t\n\t\tif (keywordsIndex.containsKey(kw1))\n\t\t\tocArr1 = keywordsIndex.get(kw1);\n\t\t\n\t\tif (keywordsIndex.containsKey(kw2))\n\t\t\tocArr2 = keywordsIndex.get(kw2);\n\t\t\n\t\tcombined.addAll(ocArr1);\n\t\tcombined.addAll(ocArr2);\n\t\t\n\t\tif (!(ocArr1.isEmpty()) && !(ocArr2.isEmpty()))\n\t\t{\n\t\t\t// Sort with preference for ocArr1\n\t\t\tfor (int x = 0; x < combined.size()-1; x++)\n\t\t\t{\n\t\t\t\tfor (int y = 1; y < combined.size()-x; y++)\n\t\t\t\t{\n\t\t\t\t\tif (combined.get(y-1).frequency < combined.get(y).frequency)\n\t\t\t\t\t{\n\t\t\t\t\t\tOccurrence temp = combined.get(y-1);\n\t\t\t\t\t\tcombined.set(y-1, combined.get(y));\n\t\t\t\t\t\tcombined.set(y, temp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove duplicates\n\t\t\tfor (int x = 0; x < combined.size()-1; x++)\n\t\t\t{\n\t\t\t\tfor (int y = x + 1; y < combined.size(); y++)\n\t\t\t\t{\n\t\t\t\t\tif (combined.get(x).document == combined.get(y).document)\n\t\t\t\t\t\tcombined.remove(y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Top 5\n\t\twhile (combined.size() > 5)\n\t\t\tcombined.remove(combined.size()-1);\n\t\t\n\t\t//System.out.println(combined);\n\t\t\n\t\tfor (Occurrence oc : combined)\n\t\t\tresults.add(oc.document);\n\n\t\treturn results;\n\t\n\t\t\n\t\t// following line is a placeholder to make the program compile\n\t\t// you should modify it as needed when you write your code\n\t\n\t}", "private static void printTable(int numberOfDocs) {\n \n Gson gs = new Gson();\n String json = gs.toJson(wor);\n // System.out.println(json);\n \n List<String> queryWords = new ArrayList();\n //to test it for other query word you can change the following two words\n //queryWords.add(\"carpet\");\n //queryWords.add(\"hous\");\n queryWords.add(\"the\");\n queryWords.add(\"crystallin\");\n queryWords.add(\"len\");\n queryWords.add(\"vertebr\");\n queryWords.add(\"includ\");\n \n \n FrequencySummary frequencySummary = new FrequencySummary();\n frequencySummary.getSummary(json,docName, queryWords);\n \n System.exit(0);\n \n Hashtable<Integer,Integer> g = new Hashtable<>();\n \n /* wor.entrySet().forEach((wordToDocument) -> {\n String currentWord = wordToDocument.getKey();\n Map<String, Integer> documentToWordCount = wordToDocument.getValue();\n freq.set(0);\n df.set(0);\n documentToWordCount.entrySet().forEach((documentToFrequency) -> {\n String document = documentToFrequency.getKey();\n Integer wordCount = documentToFrequency.getValue();\n freq.addAndGet(wordCount);\n System.out.println(\"Word \" + currentWord + \" found \" + wordCount +\n \" times in document \" + document);\n \n if(g.getOrDefault(currentWord.hashCode(), null)==null){\n g.put(currentWord.hashCode(),1);\n \n }else {\n System.out.println(\"Hello\");\n \n int i = g.get(currentWord.hashCode());\n System.out.println(\"i \"+i);\n g.put(currentWord.hashCode(), i++);\n }\n // System.out.println(currentWord+\" \"+ g.get(currentWord.hashCode()));\n // g.put(currentWord.hashCode(), g.getOrDefault(currentWord.hashCode(), 0)+wordCount);\n \n });\n // System.out.println(freq.doubleValue());\n \n // System.out.println(\"IDF for this word: \"+Math.log10( (double)(counter/freq.doubleValue())));\n });\n // System.out.println(g.get(\"plai\".hashCode()));\n //System.out.println(\"IDF for this word: \"+Math.log10( (double)(counter/(double)g.get(\"plai\".hashCode()))));\n */\n }", "public ArrayList<String> top5search(String kw1, String kw2) {\n // COMPLETE THIS METHOD\n ArrayList<Occurrence> Res1 = keywordsIndex.get(getKeyWord(kw1));\n ArrayList<Occurrence> res2 = keywordsIndex.get(getKeyWord(kw1));\n ArrayList<String> arrayList = new ArrayList<String>();\n\n while (arrayList.size() < 6) {\n Occurrence aa = null;\n Occurrence b = null;\n {\n if (Res1 != null) {\n for (Occurrence occr : Res1) {\n if (!arrayList.contains(occr.document)) {\n aa = occr;\n }\n }\n } if(Res1 == null){\n aa = new Occurrence(null, 0);\n }\n else aa = new Occurrence(null,0);\n }\n {\n if(res2 != null){\n for(Occurrence occr : res2){\n if(!arrayList.contains(occr.document)){\n b = occr;\n }\n }\n }\n if(res2 == null){\n b = new Occurrence(null,0);\n }\n else b = new Occurrence(null,0);\n }\n Occurrence[] a = {aa,b};//{search(arrayList, Res1), search(arrayList, res2)};\n Occurrence m = null;\n if (a[0].frequency < a[1].frequency) {\n m = a[1];\n } else m = a[0];\n if (m.document != null) {\n arrayList.add(m.document);\n } else break;\n }\n return arrayList;\n }", "private static String handleNonPhraseToken(String stringPart) {\r\n // Set of final terms to be used (no empty elements, right syntax of index fields)\r\n ArrayList <String> terms = new ArrayList <String> ();\r\n \r\n /** Case Index field **/\r\n if(stringPart.contains(\"[\") | stringPart.contains(\"[\")){ // at least an Index field contained here\r\n //separate brackets for term with one space (extra spaces dont matter, trim() is used later)\r\n stringPart = stringPart.replace(\"[\", \" [\");\r\n stringPart = stringPart.replace(\"]\", \"] \");\r\n }\r\n\r\n /** Case Bag of terms **/\r\n //replace space with AND (change default operator to match pubMed's)\r\n // No need for this if setDefaultOperator(QueryParser.Operator.AND) is used\r\n \r\n String[] tokens = stringPart.split(\"\\\\s\");\r\n if(tokens.length > 0){ \r\n for(int i = 1 ; i < tokens.length ; i++){\r\n tokens[i] = tokens[i].trim();\r\n /* Case index field [fieldName] */\r\n if(tokens[i].startsWith(\"[\") & tokens[i].endsWith(\"]\")){\r\n tokens[i] = tokens[i].replace(\"[\",\"\");// clean field name from brackets\r\n tokens[i] = tokens[i].replace(\"]\",\"\");// clean field name from brackets\r\n //Add index field as prefix to previus (not empty) term (as opening index fields handled separately, this index field should not be the first term of string part)\r\n int tmp = i-1;\r\n boolean perviusTermFound = false;\r\n while(!perviusTermFound & tmp >= 0){\r\n if(!tokens[tmp].equals(\"\")){\r\n perviusTermFound = true;\r\n //TO DO : handle wrong syntax (e.g. ... AND [ArticleTitle])\r\n String luceneField = supportedIndexFields.get(tokens[i]);\r\n if(luceneField != null){\r\n tokens[tmp] = luceneField + \":\" + tokens[tmp];\r\n } // else : Lucene counterpart not found, unsupported field - do nothing\r\n } else {\r\n tmp--;\r\n }\r\n }\r\n //Empty field to not be added as a search term in query\r\n tokens[i] = \"\";\r\n } \r\n \r\n /*\r\n \r\n else if(!tokens[i].equals(\"AND\") & !tokens[i].equals(\"\")) {\r\n terms.add(tokens[i]);\r\n }\r\n */\r\n }\r\n }\r\n \r\n String luceneQueryPart = \"\";\r\n boolean notWaiting = false;\r\n boolean orWaiting = false;\r\n for(int i = 0 ; i < tokens.length ; i++){\r\n\r\n if(!tokens[i].equals(\"AND\") & !tokens[i].equals(\"\")){\r\n //in case of AND nothing should happen, it is the default operator\r\n //empty elements are also ignored as useless\r\n \r\n if(!tokens[i].equals(\"NOT\") & !tokens[i].equals(\"OR\") ){ // it's not an operator, it's a term\r\n \r\n if(!luceneQueryPart.endsWith(\" OR \") & !luceneQueryPart.endsWith(\" -\") ) { \r\n luceneQueryPart += \" +\"; \r\n } \r\n luceneQueryPart += tokens[i];\r\n } else {\r\n if(tokens[i].equals(\"NOT\")) {\r\n luceneQueryPart += \" -\";\r\n }\r\n if(tokens[i].equals(\"OR\")){\r\n luceneQueryPart += \" OR \";\r\n }\r\n \r\n } \r\n } \r\n }\r\n \r\n return luceneQueryPart;\r\n }", "public Query getQuery(String[] values, Collection<String> termCollector) {\n Query result = null;\n\n String[] termValues = values;\n if (values != null){\n if(isOffByOne()){\n for(int i = 0; i < values.length; i++){\n termValues[i] = String.valueOf(Integer.parseInt(values[i]) - 1);\n }\n }\n }\n\n if (index == Field.Index.ANALYZED || normalizer == null) {\n result = LuceneUtils.toQuery(getAnalyzer(), label, termValues, termCollector);\n }\n else {\n if (termValues != null && termValues.length > 0) {\n if (termValues.length == 1) {\n result = LuceneUtils.tokensToQuery(label, tokenize(termValues[0]), termCollector);\n }\n else {\n final PhraseQuery phraseQuery = new PhraseQuery();\n for (String value : termValues) {\n final String[] tokens = tokenize(value);\n if (tokens != null && tokens.length > 0) {\n for (String token : tokens) {\n phraseQuery.add(new Term(label, token));\n if (termCollector != null) termCollector.add(token);\n }\n }\n }\n result = phraseQuery;\n }\n }\n }\n\n return result;\n }", "public ArrayList<String> tokeniseQuery(String query) {\n ArrayList<String> tokens;\n\n tokens = this.tokeniseString(query);\n\n // Normalise the tokens\n tokens = this.normaliseTokens(tokens);\n\n // Remove commas\n tokens = this.removeCommas(tokens);\n\n // Remove the stopwords\n this.removeStopwords(tokens);\n\n // Remove empty tokens that resulted from normalisation\n this.removeEmptyTokens(tokens);\n\n // Stem the tokens\n tokens = this.stemTokens(tokens);\n\n return tokens;\n }", "SearchResult getBestResult(List<SearchResult> results, SearchQuery query);", "public DocFile[] searchResponse(ScoreDoc[] results, Query query) {\n\n DocFile[] result = new DocFile[results.length];\n FastVectorHighlighter highlighter = new FastVectorHighlighter(true,true);\n FieldQuery highlightQuery = highlighter.getFieldQuery(query); \n\n try {\n IndexReader reader = DirectoryReader.open(indexDir);\n IndexSearcher searcher = new IndexSearcher(reader);\n\n for (int i = 0; i < results.length; i++) {\n int docId = results[i].doc;\n Document document = searcher.doc(docId);\n \n //Highlight the best Content context from each Doc\n String contextString = highlighter.getBestFragment(highlightQuery, \n searcher.getIndexReader(), results[i].doc,Constants.INDEX_KEY_CONTENT,140);\n \n DocFile toAdd = new DocFile(\n document.get(Constants.INDEX_KEY_FILENAME),\n document.get(Constants.INDEX_KEY_TITLE),\n document.get(Constants.INDEX_KEY_OWNER),\n document.get(Constants.INDEX_KEY_PATH),\n document.get(Constants.INDEX_KEY_STATUS).equalsIgnoreCase(\"true\"));\n \n if (contextString != null) {\n toAdd.setContextString(contextString);\n }\n \n toAdd.setId(document.get(Constants.INDEX_KEY_ID));\n toAdd.setPermissions(Integer.parseInt(document.get(Constants.INDEX_KEY_PERMISSION)));\n toAdd.setCourseCode(document.get(Constants.INDEX_KEY_COURSE));\n result[i] = toAdd;\n\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return result;\n }", "public VSM(String[] docs) {\n\t\tmyDocs = docs;\n\t\ttermList = new ArrayList<String>();\n\t\tdocLists = new ArrayList<ArrayList<Doc>>();\n\t\tArrayList<Doc> docList;\n\t\t// parse the documents to construct the index and collect the raw\n\t\t// frequencies.\n\t\tfor (int i = 0; i < myDocs.length; i++) {\n\t\t\tString[] tokens = myDocs[i].split(\" \");\n\t\t\tString token;\n\t\t\tfor (int j = 0; j < tokens.length; j++) {\n\t\t\t\ttoken = tokens[j];\n\t\t\t\tif (!termList.contains(token)) {\n\t\t\t\t\ttermList.add(token);\n\t\t\t\t\tdocList = new ArrayList<Doc>();\n\t\t\t\t\tDoc doc = new Doc(i, 1); // initial raw frequency is 1\n\t\t\t\t\tdocList.add(doc);\n\t\t\t\t\tdocLists.add(docList);\n\t\t\t\t} else {\n\t\t\t\t\tint index = termList.indexOf(token);\n\t\t\t\t\tdocList = docLists.get(index);\n\t\t\t\t\tint k = 0;\n\t\t\t\t\tboolean match = false;\n\n\t\t\t\t\t// search the postings list for a document id, if match,\n\t\t\t\t\t// insert a new position number to the document id\n\t\t\t\t\tfor (Doc doc : docList) {\n\t\t\t\t\t\tif (doc.docId == i) {\n\t\t\t\t\t\t\tdoc.tw++; // increase word count\n\t\t\t\t\t\t\tmatch = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tk++;\n\t\t\t\t\t}\n\t\t\t\t\t// if no match, add a new document id along with the\n\t\t\t\t\t// position number\n\t\t\t\t\tif (!match) {\n\t\t\t\t\t\tDoc doc = new Doc(i, 1);\n\t\t\t\t\t\tdocList.add(doc);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}//\n\t\t}// end with parsing\n\n\t\t// compute the tf-idf term weights and the doc lengths\n\t\tint N = myDocs.length;\n\t\tdocLength = new double[N];\n\t\tfor (int i = 0; i < termList.size(); i++) {\n\t\t\tdocList = docLists.get(i);\n\t\t\tint df = docList.size();\n\t\t\tDoc doc;\n\t\t\tfor (int j = 0; j < docList.size(); j++) {\n\t\t\t\tdoc = docList.get(j);\n\t\t\t\tdouble tfidf = (1 + Math.log(doc.tw))\n\t\t\t\t\t\t* Math.log(N / (df * 1.0));\n\t\t\t\tdocLength[doc.docId] += Math.pow(tfidf, 2);\n\t\t\t\tdoc.tw = tfidf;\n\t\t\t\tdocList.set(j, doc);\n\t\t\t}\n\t\t}\n\t\t// update the length\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tdocLength[i] = Math.sqrt(docLength[i]);\n\t\t}\n\n\t}", "public void onSearchSubmit(String queryTerm);", "static AnalysisResult analyseQuery(String query) {\n for (String attack : commonAttacks) {\n attack = attack.toLowerCase();\n if (trim(query.toLowerCase()).contains(trim(attack))) {\n return new AnalysisResult(true, null, attack, true);\n }\n }\n return new AnalysisResult(false, null, null, true);\n }", "private IDictionary<URI, IDictionary<String, Double>> computeAllDocumentTfIdfVectors(ISet<Webpage> pages) {\n // Hint: this method should use the idfScores field and\n // call the computeTfScores(...) method.\n\t\tdocumentTfIdfVectors = new ChainedHashDictionary<URI, IDictionary<String, Double>>();\n\t\t\n\t\t// Iterates through the given set of webpages\n\t\tfor (Webpage page: pages) {\n\t\t\tIDictionary<String, Double> tfIdfScores = new ChainedHashDictionary<String, Double>();\n\t\t\tIDictionary<String, Double> tfScores = computeTfScores(page.getWords());\n\t\t\t\n\t\t\t// Computes TfIdf scores\n\t\t\tfor (KVPair<String, Double> pair: tfScores) {\n\t\t\t\tDouble tfIdfScore = pair.getValue() * idfScores.get(pair.getKey());\n\t\t\t\ttfIdfScores.put(pair.getKey(), tfIdfScore);\n\t\t\t}\n\t\t\tdocumentTfIdfVectors.put(page.getUri(), tfIdfScores);\n\t\t}\n\t\treturn documentTfIdfVectors;\n }", "@Test\n void testAndFilterWithoutExplicitIndex() {\n Query q = newQueryFromEncoded(\"?query=trump\" +\n \"&model.type=all\" +\n \"&model.defaultIndex=text\" +\n \"&filter=%2B%28filterTerm%29\");\n assertEquals(\"AND text:trump |text:filterTerm\",\n q.getModel().getQueryTree().toString());\n }", "public static String getAllEvaluationAsString(String query, Vector<String> retrievalResults, Map<String, DocumentRelevances> judgments) throws IOException{\n double precisionAt1 = precisionAtK(retrievalResults, 1, judgments);\n double precisionAt5 = precisionAtK(retrievalResults, 5, judgments);\n double precisionAt10 = precisionAtK(retrievalResults, 10, judgments);\n double recallAt1 = recallAtK(retrievalResults, 1, judgments);\n double recallAt5 = recallAtK(retrievalResults, 5, judgments);\n double recallAt10 = recallAtK(retrievalResults, 10, judgments);\n double F05At1 = F05AtK(retrievalResults, 1, judgments);\n double F05At5 = F05AtK(retrievalResults, 5, judgments);\n double F05At10 = F05AtK(retrievalResults, 10, judgments);\n double[] precisionsAtRecalls = precisionAtRecall(retrievalResults, judgments);\n double averagePrecision = averagePrecision(retrievalResults, judgments);\n double NDCGAt1 = NDCGAtK(retrievalResults, 1, judgments);\n double NDCGAt5 = NDCGAtK(retrievalResults, 5, judgments);\n double NDCGAt10 = NDCGAtK(retrievalResults, 10, judgments);\n double reciprocalRank = reciprocalRank(retrievalResults, judgments);\n \n String output = query+\"\\n\"+\n \t\t \"Precision at 1: \"+Double.toString(precisionAt1)+\"\\n\"+\n \t\t \"Precision at 5: \"+Double.toString(precisionAt5)+\"\\n\"+\n \t\t \"Precision at 10: \"+Double.toString(precisionAt10)+\"\\n\"+\n \t\t \"Recall at 1: \"+Double.toString(recallAt1)+\"\\n\"+\n \t\t \"Recall at 5: \"+Double.toString(recallAt5)+\"\\n\"+\n \t\t \"Recall at 10: \"+Double.toString(recallAt10)+\"\\n\"+\n \t\t \"F05 at 1: \"+Double.toString(F05At1)+\"\\n\"+\n \t\t \"F05 at 5: \"+Double.toString(F05At5)+\"\\n\"+\n \t\t \"F05 at 10: \"+Double.toString(F05At10)+\"\\n\"+\n \t\t \"Precision at Recall 0.0: \"+Double.toString(precisionsAtRecalls[0])+\"\\n\"+\n \t\t \"Precision at Recall 0.1: \"+Double.toString(precisionsAtRecalls[1])+\"\\n\"+\n \t\t \"Precision at Recall 0.2: \"+Double.toString(precisionsAtRecalls[2])+\"\\n\"+\n \t\t \"Precision at Recall 0.3: \"+Double.toString(precisionsAtRecalls[3])+\"\\n\"+\n \t\t \"Precision at Recall 0.4: \"+Double.toString(precisionsAtRecalls[4])+\"\\n\"+\n \t\t \"Precision at Recall 0.5: \"+Double.toString(precisionsAtRecalls[5])+\"\\n\"+\n \t\t \"Precision at Recall 0.6: \"+Double.toString(precisionsAtRecalls[6])+\"\\n\"+\n \t\t \"Precision at Recall 0.7: \"+Double.toString(precisionsAtRecalls[7])+\"\\n\"+\n \t\t \"Precision at Recall 0.8: \"+Double.toString(precisionsAtRecalls[8])+\"\\n\"+\n \t\t \"Precision at Recall 0.9: \"+Double.toString(precisionsAtRecalls[9])+\"\\n\"+\n \t\t \"Precision at Recall 1.0: \"+Double.toString(precisionsAtRecalls[10])+\"\\n\"+\n \t\t \"Average precision: \"+Double.toString(averagePrecision)+\"\\n\"+\n \t\t \"NDCG at 1: \"+Double.toString(NDCGAt1)+\"\\n\"+\n \t\t \"NDCG at 5: \"+Double.toString(NDCGAt5)+\"\\n\"+\n \t\t \"NDCG at 10: \"+Double.toString(NDCGAt10)+\"\\n\"+\n \t\t \"Reciprocal rank: \"+Double.toString(reciprocalRank);\n\t\t\t\t\t\t\t\t\n return output;\n }", "@Override\n\tpublic String toString() {\n\t\treturn weight + \"\\t\" + query;\n\t}", "public void doSearch(String query)\n \t{\n \t\tlistener.onQueryTextSubmit(query);\n \t}", "public void splitQuery(){\n for (int i=0;i<stemmed_query.size();i++){\n String stemmed_term = stemmed_query.get(i);\n for (int j=0;j<num_slave_client_threads;j++){\n if (stemmed_term.compareTo(ServerThread.start_terms[j]) >= 0 && stemmed_term.compareTo(ServerThread.end_terms[j]) <= 0){\n slave_queries.set(j, slave_queries.get(j)+\" \"+stemmed_term);\n break;\n }\n }\n }\n }", "@Override\n public void init(SearchHits hits) { \n\n \tint numFbDocs = 50;\n \tint numFbTerms = 20;\n \tdouble lambda = 1.0;\n \tdouble alpha = 5.0;\n \t\n if (paramTable.get(FB_DOCS) != null ) \n \tnumFbDocs = paramTable.get(FB_DOCS).intValue();\n if (paramTable.get(FB_TERMS) != null ) \n \tnumFbTerms = paramTable.get(FB_TERMS).intValue();\n if (paramTable.get(LAMBDA) != null ) \n \tlambda = paramTable.get(LAMBDA).doubleValue();\n if (paramTable.get(ALPHA) != null ) \n \talpha = paramTable.get(ALPHA).doubleValue(); \n \n if (hits.size() < numFbDocs) \n \tnumFbDocs = hits.size();\n \n SearchHits fbDocs = new SearchHits(hits.hits().subList(0, numFbDocs));\n FeedbackRelevanceModel rm = new FeedbackRelevanceModel();\n rm.setDocCount(numFbDocs);\n rm.setTermCount(numFbTerms);\n rm.setIndex(index);\n rm.setStopper(null);\n rm.setRes(fbDocs);\n rm.build(); \n \n FeatureVector rmVector = rm.asFeatureVector();\n rmVector.clip(numFbTerms);\n rmVector.normalize();\n \n TermTimeSeries ts = new TermTimeSeries(startTime, endTime, interval, \n \t\trm.asFeatureVector().getFeatures());\n \n for (SearchHit hit: hits.hits()) {\n \t\tlong docTime = TemporalScorer.getTime(hit);\n \t\tdouble score = hit.getScore();\n \t\tts.addDocument(docTime, score, hit.getFeatureVector());\n }\n \n RUtil rutil = new RUtil();\n \n double sdps =0;\n for (String term: rmVector.getFeatures()) {\n \tdouble[] tsw = ts.getTermFrequencies(term);\n \tif (sum(tsw) > 0) {\n \t\ttry {\n \t\t\tsdps += rutil.dps(tsw);\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}\n } \n \n FeatureVector tsfv = new FeatureVector(null);\n for (String term: rmVector.getFeatures()) {\n \tdouble[] termts = ts.getTermFrequencies(term);\n \ttry {\n \t\tdouble dps = rutil.dps(termts)/sdps;\n \t\t\n \tdouble weight = Math.pow(dps, alpha) * Math.pow(rmVector.getFeatureWeight(term), (1-alpha));\n tsfv.addTerm(term, weight);\n \n \t} catch (Exception e) {\n \t\te.printStackTrace();\n \t}\n }\n tsfv.normalize();\n\n gQuery.getFeatureVector().normalize();\n FeatureVector fv =\n \t\tFeatureVector.interpolate(gQuery.getFeatureVector(), tsfv, lambda);\n gQuery.setFeatureVector(fv);\n \n System.out.println(rmVector.toString(10));\n System.out.println(tsfv.toString(10));\n System.out.println(fv.toString(10));\n rutil.close();\n \n }", "private void addQueries(String query){\n ArrayList <String> idsFullSet = new ArrayList <String>(searchIDs);\n while(idsFullSet.size() > 0){\n ArrayList <String> idsSmallSet = new ArrayList <String>(); \n if(debugMode) {\n System.out.println(\"\\t Pmids not used in query available : \" + idsFullSet.size());\n }\n idsSmallSet.addAll(idsFullSet.subList(0,Math.min(getSearchIdsLimit(), idsFullSet.size())));\n idsFullSet.removeAll(idsSmallSet);\n String idsConstrain =\"\";\n idsConstrain = idsConstrain(idsSmallSet);\n addQuery(query,idsConstrain);\n }\n }", "public byte filter(Manager m, SearchRequest q, ResultSet rs, int DocAtNumber, int DocNo)\n\t{\t\t\n\t\tString originalQuery = q.getOriginalQuery();\n\t\t//highlight query terms only for the queries, \n\t\t//which are not about finding related documents\n\t\t//this check may be removed, because the preparation of the \n\t\t//query terms for highlighting takes into account\n\t\t//the related: operator\n\t\tboolean highlightQueryTerms = true;\n\t\tif (originalQuery.matches(\"\\\\brelated:\\\\d+\\\\b\") || //check if the query uses the related: operator \n\t\t\t!enableQueryTermsHighlight || //check if the highlighting of terms is enabled\n\t\t\thighlight.pattern().equals(\"(\\\\b)()(\\\\b)\")) //check if there are no query terms to highlight\n\t\t\thighlightQueryTerms = false;\n\t\t\n\t\tString[] qTerms = q.getOriginalQuery().replaceAll(\" \\\\w+\\\\p{Punct}\\\\w+ \",\" \").toLowerCase().split(\" \");\n\t\t\n\t\tString[] metadata = null;\n\t\tint tmpSentence;\n\t\tdouble tmpScore;\n\t\tsynchronized(metaCache) {\n\t\t\ttry {\n\t\t\t\tInteger DocNoObject = new Integer(DocNo);\n\t\t\t\tif (metaCache.containsKey(DocNoObject))\n\t\t\t\t\t\tmetadata = (String[]) metaCache.get(DocNoObject);\n\t\t\t\telse {\n\t\t\t\t\tmetadata = metaIndex.getItems(keys, DocNo);\n\t\t\t\t\tmetaCache.put(DocNoObject,metadata);\n\t\t\t\t}\n\t\t\t} catch(IOException ioe) {} \n\t\t}\n\t\n\t\tif (show_snippet)\n\t\t{\n\t\t\tString extract = metadata[1];\n\t\t\tString[] sentences = sentencePattern.split(extract, 50); //use 50 sentences at most\n\t\t\tdouble[] sentenceScores = new double[sentences.length]; \n\t\t\tint frsSentence = -1;\n\t\t\tint sndSentence = -1;\n\t\t\tint top1Sentence = 0;\n\t\t\tint top2Sentence = 0;\n\t\t\tdouble max1Score = -1;\n\t\t\tdouble max2Score = 0;\n\t\t\tfinal int qTermsLength = qTerms.length;\n\t\t\tfor (int i=0; i<qTermsLength; i++) {\n\t\t\t\tqTerms[i] = removeEndings.matcher(qTerms[i]).replaceAll(\"\");\n\t\t\t}\n\t\t\tString lowerCaseSentence;\n\t\t\tint sentenceLength;\n\t\t\tfinal int sentencesLength = sentences.length;\n\n\t\t\tfor (int i=0; i<sentencesLength; i++) {\n\t\t\t\t\n\t\t\t\tlowerCaseSentence = sentences[i].toLowerCase();\n\t\t\t\tsentenceLength=sentences[i].length();\n\t\t\t\tif (sentenceLength < 20 || sentenceLength > 250) {\n\t\t\t\t\tfor (int j=0; j<qTermsLength; j++) {\n\t\t\t\t\t\tif (lowerCaseSentence.indexOf(qTerms[j])>=0) {\n\t\t\t\t\t\t\tsentenceScores[i]+=1.0d + sentenceLength / (20.0d + sentenceLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tfor (int j=0; j<qTermsLength; j++) {\n\t\t\t\t\t\tif (lowerCaseSentence.indexOf(qTerms[j])>=0) {\n\t\t\t\t\t\t\tsentenceScores[i]+=qTerms[j].length() + sentenceLength / (1.0d + sentenceLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t//do your best to get at least a second sentence for the snippet, \n\t\t\t\t//after having found the first one\n\t\t\t\tif (frsSentence > -1 && sndSentence == -1 && sentenceLength > 5) {\n\t\t\t\t\tsndSentence = i;\n\t\t\t\t}\n\n\t\t\t\t//do your best to get at least one sentence for the snippet\n\t\t\t\tif (frsSentence == -1 && sentenceLength > 5) { \n\t\t\t\t\tfrsSentence = i;\n\t\t\t\t}\n\n\t\t\t\tif (max2Score < sentenceScores[i]) {\n\t\t\t\t\tmax2Score = sentenceScores[i];\n\t\t\t\t\ttop2Sentence = i;\n\t\t\t\t\t//logger.debug(\"top 2 sentence is \" + i);\n\t\t\t\t\tif (max2Score > max1Score) {\n\t\t\t\t\t\ttmpScore = max1Score; max1Score = max2Score; max2Score = tmpScore;\n\t\t\t\t\t\ttmpSentence = top1Sentence; top1Sentence = top2Sentence; top2Sentence = tmpSentence;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tint lastIndexOfSpace = -1;\n\t\t\tString sentence=\"\";\n\t\t\tString secondSentence=\"\";\n\t\t\tString snippet = \"\";\n\t\t\tif (max1Score == -1) {\n\t\t\t\tif (frsSentence>=0) {\n\t\t\t\t\tsentence = sentences[frsSentence];\n\t\t\t\t\tif (sentence.length() > 100) {\n\t\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 100);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (sndSentence>=0) {\n\t\t\t\t\tsecondSentence = sentences[sndSentence];\n\t\t\t\t\tif (secondSentence.length() > 100) {\n\t\t\t\t\t\tlastIndexOfSpace = secondSentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\t\tsecondSentence = secondSentence.substring(0, lastIndexOfSpace>0 ? lastIndexOfSpace : 100);\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 (frsSentence >=0 && sndSentence >= 0) \n\t\t\t\t\tsnippet = sentence.trim() + \"...\" + secondSentence.trim();\n\t\t\t\telse if (frsSentence >= 0 && sndSentence<0) \n\t\t\t\t\tsnippet = sentence.trim();\n\t\t\t\t\n\t\t\t} else if (sentences[top1Sentence].length()<100 && top1Sentence!=top2Sentence) {\n\t\t\t\tsentence = sentences[top1Sentence];\n\t\t\t\tif (sentence.length() > 100) {\n\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 100);\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\tsecondSentence = sentences[top2Sentence];\n\t\t\t\tif (secondSentence.length() > 100) {\n\t\t\t\t\tlastIndexOfSpace = secondSentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\tsecondSentence = secondSentence.substring(0, lastIndexOfSpace>0 ? lastIndexOfSpace : 100);\n\t\t\t\t}\n\t\t\t\tsnippet = sentence.trim() + \"...\" + secondSentence.trim();\n\t\t\t} else {\n\t\t\t\tsentence = sentences[top1Sentence];\n\t\t\t\tif (sentence.length()>200) {\n\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 200).lastIndexOf(\" \");\n\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 200);\n\t\t\t\t}\n\t\t\t\tsnippet = sentence.trim();\n\t\t\t}\n\t\t\t\n\t\t\t//checking and removing any control characters\n\t\t\tcontrolNonVisibleCharactersMatcher.reset(snippet);\n\t\t\tsnippet = controlNonVisibleCharactersMatcher.replaceAll(\"\");\n\t\t\t\n\t\t\t//String escapedSnippet = StringEscapeUtils.escapeHtml(snippet);\n\t\t\t//if (highlightQueryTerms)\n\t\t\t//\tescapedSnippet = highlight.matcher(escapedSnippet).replaceAll(\"$1<b>$2</b>$3\");\n\t\t\tif (highlightQueryTerms)\n\t\t\t\tsnippet = highlight.matcher(snippet).replaceAll(\"$1<b>$2</b>$3\");\n\t\t\t//else \n\t\t\t//\tsnippet = StringEscapeUtils.escapeHtml(snippet);\n\t\t\t\n\t\t\t//change by Vassilis, 20/09/2006\n\t\t\t//disabling the xml escaping in order to move the data into ![CDATA[ ]]\n\t\t\t//the code was:\n\t\t\t//rs.addMetaItem(\"snippet\", DocAtNumber, StringEscapeUtils.escapeXml(snippet));\n\t\t\t//and now it is:\n\t\t\t//snippet.replaceAll(\"[^\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]\",\"\");\n\t\t\trs.addMetaItem(\"snippet\", DocAtNumber, snippet);\n\t\t\t\n\t\t}\n\t\tif (show_title)\n\t\t{\n\t\t\tString title = metadata[2];\n\t\t\t\n\t\t\t//checking and removing any control characters\n\t\t\tcontrolNonVisibleCharactersMatcher.reset(title);\n\t\t\ttitle = controlNonVisibleCharactersMatcher.replaceAll(\"\");\n\t\t\ttitle = (highlightQueryTerms)\n\t\t\t\t ? highlight.matcher(metadata[2]).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t\t : metadata[2];\n\t\t\t\n\t\t\t\n\t\t\t//String escapedTitle = StringEscapeUtils.escapeHtml(metadata[2]);\n\t\t\t//String title = (highlightQueryTerms)\n\t\t\t//\t\t\t ? highlight.matcher(escapedTitle).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t//\t\t\t : escapedTitle;\n\t\t\t//String title = (highlightQueryTerms) \n\t\t\t//\t\t? highlight.matcher(metadata[2]).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t//\t\t: metadata[2];\n\n\t\t\t//change by Vassilis, 20/09/2006\n\t\t\t//disabling the xml escaping in order to move the data into ![CDATA[ ]]\n\t\t\t//the code was:\n\t\t\t//rs.addMetaItem(\"title\", DocAtNumber, StringEscapeUtils.escapeXml(title));\n\t\t\t//and now is:\n\t\t\t//title.replaceAll(\"[^\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]\",\"\");\n\t\t\trs.addMetaItem(\"title\", DocAtNumber, title);\n\t\t\t\n\t\t}\n\t\tif (!show_docid_early && show_docid)\n\t\t{\n\t\t\trs.addMetaItem(\"docid\", DocAtNumber, docIndex.getDocumentNumber(DocNo));\n\t\t}\n\t\tif (!show_url_early && show_url)\n\t\t{\n\n\t\t\trs.addMetaItem(\"url\", DocAtNumber, StringEscapeUtils.escapeXml(metadata[0]));\n\t\t}\n\t\t\n\t\treturn FILTER_OK;\n\t}" ]
[ "0.713265", "0.67490345", "0.6708787", "0.6570831", "0.65290445", "0.65091664", "0.6301124", "0.62564147", "0.62462723", "0.62303966", "0.6121615", "0.6092577", "0.60881495", "0.6067615", "0.6061933", "0.60572237", "0.6025526", "0.59403056", "0.5899081", "0.58948946", "0.5887808", "0.5887068", "0.5864838", "0.58580875", "0.5853241", "0.58524257", "0.5845645", "0.5837921", "0.5837022", "0.5825521", "0.58220243", "0.5820077", "0.5803137", "0.5726654", "0.5679536", "0.5675475", "0.56683815", "0.564162", "0.56369144", "0.56121457", "0.5604361", "0.5595679", "0.55587804", "0.5549475", "0.55488926", "0.55241674", "0.5520853", "0.55040574", "0.5493972", "0.5485638", "0.5479736", "0.5455311", "0.543085", "0.5424341", "0.5389106", "0.5379557", "0.53745854", "0.5352378", "0.53452796", "0.533532", "0.5317884", "0.5313038", "0.52934", "0.5284727", "0.52823675", "0.5276282", "0.5265649", "0.52643824", "0.52623487", "0.52522624", "0.5248299", "0.52344877", "0.522835", "0.5220491", "0.5213272", "0.5203328", "0.5188717", "0.51854587", "0.517874", "0.5167496", "0.51624376", "0.51594985", "0.5156694", "0.5149749", "0.51480454", "0.51459414", "0.5144377", "0.513359", "0.5132872", "0.5131469", "0.5130192", "0.51292807", "0.5125858", "0.51187575", "0.5116828", "0.5114698", "0.5110938", "0.5104272", "0.5102763", "0.51016533" ]
0.7497625
0
Which terms should be considered? Based on Index elimination theory, idfthresholding!
public Set<String> queryTermsConsidered(Query query, double idf_threshold){ double idf, nDocs = this.docIDs.size(); String term; Set<String> termsToConsider = new HashSet<String>(); Iterator<String> it = query.terms.iterator(); while(it.hasNext()){ term = it.next(); idf = -1; if(this.idfMap.containsKey(term)) idf = Math.log(nDocs/new Double(this.idfMap.get(term))); if (idf >= idf_threshold){ termsToConsider.add(term); } /*else{ System.err.println(term + " not considered since idf = " + idf); }*/ } return termsToConsider; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract int numberOfTerms();", "int DF(String term) {\n for (int i = 0; i < count1; i++) {\n if (economydocument[i].contains(term)) {\n df++;\n }\n }\n for (int i = 0; i < count2; i++) {\n if (educationdocument[i].contains(term)) {\n df++;\n }\n }\n for (int i = 0; i < count3; i++) {\n if (sportdocument[i].contains(term)) {\n df++;\n }\n }\n for (int i = 0; i < count4; i++) {\n if (culturedocument[i].contains(term)) {\n df++;\n }\n }\n for (int i = 0; i < count5; i++) {\n if (accedentdocument[i].contains(term)) {\n df++;\n }\n }\n for (int i = 0; i < count6; i++) {\n if (environmntaldocument[i].contains(term)) {\n df++;\n }\n }\n for (int i = 0; i < count7; i++) {\n if (foreign_affairdocument[i].contains(term)) {\n df++;\n }\n }\n for (int i = 0; i < count8; i++) {\n if (law_justicedocument[i].contains(term)) {\n df++;\n }\n }\n for (int i = 0; i < count9; i++) {\n if (agriculture[i].contains(term)) {\n df++;\n }\n }\n for (int i = 0; i < count10; i++) {\n if (politicsdocument[i].contains(term)) {\n df++;\n }\n }\n for (int i = 0; i < count12; i++) {\n if (science_technologydocument[i].contains(term)) {\n df++;\n }\n }\n for (int i = 0; i < count13; i++) {\n if (healthdocument[i].contains(term)) {\n df++;\n }\n }\n for (int i = 0; i < count14; i++) {\n if (army[i].contains(term)) {\n df++;\n }\n }\n return df;\n }", "public int getTermIndex() {return termIndex;}", "private void termQuerySearch(String[] terms) {\n for (String term : terms) {\n LinkedList<TermPositions> postingLists = indexMap.get(analyzeTerm(term));\n if (postingLists != null) {\n for (TermPositions matches : postingLists) {\n double score = (double) 1 + Math.log((double) matches.getPositionList().size()) *\n Math.log((double) N / (double) postingLists.size());\n resultsCollector.add(new DocCollector(matches.getDocId(), score));\n }\n }\n }\n }", "static void returnTfIdfResults() {\n\t\tSet<String> specificWords = findKeywords();\n\n\t\t// for every phrase\n\t\tfor (String word : specificWords) {\n\t\t\t// get the total number of documents\n\t\t\tdouble totalSize = size;\n\n\t\t\t// get the collection of documents containing that word\n\t\t\tCollection<File> containingWordSet = invertedMap.getValues(word);\n\n\t\t\t// makes a new one if null (for ease of code)\n\t\t\tif (containingWordSet == null) {\n\t\t\t\tcontainingWordSet = new HashSet<File>();\n\t\t\t}\n\n\t\t\t// the number containing the word\n\t\t\tdouble numContainingWord = containingWordSet.size();\n\n\t\t\t// get the idf (log(total/(1 + |# contain word|)\n\t\t\t// it is normalize with 1 to prevent division by 0\n\t\t\tdouble idf = Math.log(totalSize / (1 + numContainingWord));\n\n\t\t\t// System.out.println(\"------------------\");\n\t\t\t// System.out.println(word + \" totalSize \" + totalSize);\n\t\t\t// System.out.println(word + \" numContainingWord \" +\n\t\t\t// numContainingWord);\n\t\t\t// System.out.println(word + \" idf \" + idf);\n\t\t\t// System.out.println(\"------------------\");\n\n\t\t\t// set the wordscore to 0\n\t\t\tdouble wordScore = 0;\n\n\t\t\t// for all of the files with the word\n\t\t\tfor (File file : containingWordSet) {\n\t\t\t\tString fileName = file.getName();\n\n\t\t\t\t// get the phrase count for this document\n\t\t\t\tInteger phraseCount = phraseCountMap.get(fileName);\n\t\t\t\tdouble numPhrases = phraseCount.doubleValue();\n\n\t\t\t\t// get the word frequency map for this page\n\t\t\t\tHashMap<String, Integer> docFreqMap = wordFreqMap.get(fileName);\n\t\t\t\tInteger freq = docFreqMap.get(word);\n\n\t\t\t\t// otherwise, get the tf\n\t\t\t\tdouble tf;\n\t\t\t\tif (freq == null) {\n\t\t\t\t\t// if it's not present, it's 0\n\t\t\t\t\ttf = 0;\n\t\t\t\t} else {\n\t\t\t\t\t// otherwise, it's the value\n\t\t\t\t\ttf = freq / numPhrases;\n\t\t\t\t\t// System.out.println(tf);\n\t\t\t\t}\n\n\t\t\t\t// multiply for this score\n\t\t\t\tdouble score = tf * idf;\n\n\t\t\t\t// add it to the page score\n\t\t\t\twordScore += score;\n\t\t\t}\n\n\t\t\t// make a node with the sum of tf-idf for all relevant phrases and\n\t\t\t// add to pq\n\t\t\tWordNode w = new WordNode(word, wordScore);\n\t\t\tpq.add(w);\n\t\t}\n\t}", "@Override\n public int getTermFrequency(String term) {\n return 0;\n }", "private double idf(String term) {\n return 1 + Math.log(this.numberOfDocuments / (double) termToDocumentsContainingTerm.get(term).size());\n }", "void documentFrequncy(Set<String> features,\n int index,\n int troush\n ) {\n for (String str : features) {\n switch (index) {\n case 1:\n for (int i = 0; i < count1; i++) {\n if (economydocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyeco.put(str, e);\n }\n e = 0;\n break;\n case 2:\n for (int i = 0; i < count2; i++) {\n if (educationdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyedu.put(str, e);\n }\n e = 0;\n break;\n case 3:\n for (int i = 0; i < count3; i++) {\n if (sportdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyspo.put(str, e);\n }\n e = 0;\n break;\n case 4:\n for (int i = 0; i < count4; i++) {\n if (culturedocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencycul.put(str, e);\n }\n e = 0;\n break;\n case 5:\n for (int i = 0; i < count5; i++) {\n if (accedentdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyaccid.put(str, e);\n }\n e = 0;\n break;\n case 6:\n for (int i = 0; i < count6; i++) {\n if (environmntaldocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyenv.put(str, e);\n }\n e = 0;\n break;\n case 7:\n for (int i = 0; i < count7; i++) {\n if (foreign_affairdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencydep.put(str, e);\n }\n e = 0;\n break;\n case 8:\n for (int i = 0; i < count8; i++) {\n if (law_justicedocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencylaw.put(str, e);\n }\n e = 0;\n break;\n case 9:\n for (int i = 0; i < count9; i++) {\n if (agriculture[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyagri.put(str, e);\n }\n e = 0;\n break;\n case 10:\n for (int i = 0; i < count10; i++) {\n if (politicsdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencypoltics.put(str, e);\n }\n e = 0;\n break;\n// case 11:\n//\n// for (int i = 0; i < count11; i++) {\n// if (social_affairsdocument[i].contains(str)) {\n// e++;\n// }\n// }\n// if (e > troush) {\n// documntfrequencysocial.put(str, e);\n// }\n// e = 0;\n// break;\n case 11:\n for (int i = 0; i < count12; i++) {\n if (science_technologydocument[i].contains(str)) {\n e++;\n }\n }\n\n if (e > troush) {\n documntfrequencysci.put(str, e);\n }\n e = 0;\n break;\n case 12:\n for (int i = 0; i < count13; i++) {\n if (healthdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyhel.put(str, e);\n }\n e = 0;\n break;\n case 13:\n for (int i = 0; i < count14; i++) {\n if (army[i].contains(str)) {\n e++;\n }\n }\n\n if (e > troush) {\n documntfrequencyarmy.put(str, e);\n }\n e = 0;\n break;\n default:\n break;\n }\n\n }\n }", "public ComputeTermFrequencies() { super(); }", "public double numTerms()\r\n\t{\r\n\t\treturn unionAll.size();\r\n\t}", "abstract public int docFreq(Term t) throws IOException;", "@Override\n public int getIndexByTerm(String term) {\n return 0;\n }", "public static void calcuTFIDF() throws IOException {\n\n\t\tHashtable<String, Double> idf = new Hashtable<String, Double>();\n\t\tArrayList<String> terms = new ArrayList<String>();\n\t\tdouble fileCount = 0.0;\n\t\tString featurePath = \"./corpus/features\";\n\t\tString featureWeight = \"./corpus/featureWeight\";\n\t\tString trainPath = \"./corpus/trainData\";\n\t\tString testPath = \"./corpus/testData\";\n\t\tString stopPath = \"./corpus/english.stop\";\n\t\tString trainOutPath = \"./corpus/trainVectors\";\n\t\tString testOutPath = \"./corpus/testVectors\";\n\t\tBufferedReader br = new BufferedReader(new FileReader(featurePath));\n\t\tBufferedWriter featureWriter = new BufferedWriter(new FileWriter(\n\t\t\t\tfeatureWeight));\n\t\tBufferedReader trainReader = new BufferedReader(new FileReader(\n\t\t\t\ttrainPath));\n\t\tBufferedReader testReader = new BufferedReader(new FileReader(testPath));\n\t\tBufferedReader br2 = new BufferedReader(new FileReader(stopPath));\n\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(trainOutPath));\n\t\tBufferedWriter testWriter = new BufferedWriter(new FileWriter(\n\t\t\t\ttestOutPath));\n\t\tString oneline;\n\t\tArrayList<String> as = new ArrayList<String>();\n\t\twhile ((oneline = br2.readLine()) != null) {\n\t\t\tas.add(oneline);\n\t\t}\n\t\tString[] stopWords = new String[as.size()];\n\t\tas.toArray(stopWords);\n\t\tAnalyzer analyzer = new SnowballAnalyzer(\"English\", stopWords);\n\n\t\twhile ((oneline = br.readLine()) != null) {\n\t\t\tidf.put(oneline, 0.0);\n\t\t\tterms.add(oneline);\n\t\t}\n\n\t\twhile ((oneline = trainReader.readLine()) != null) {\n\n\t\t\tint pos = oneline.indexOf(\"\\t\");\n\t\t\tString topic = oneline.substring(0, pos);\n\t\t\tString content = oneline.substring(pos + 1);\n\t\t\tfileCount++;\n\t\t\tHashtable<String, Integer> termList = new Hashtable<String, Integer>();\n\t\t\tTokenStream stream = analyzer.tokenStream(\"\", new StringReader(\n\t\t\t\t\tcontent));\n\t\t\twhile (true) {\n\t\t\t\tToken token = stream.next();\n\t\t\t\tif (token == null)\n\t\t\t\t\tbreak;\n\t\t\t\tString tmp = token.termText();\n\t\t\t\tif (!termList.containsKey(tmp))\n\t\t\t\t\ttermList.put(tmp, new Integer(1));\n\t\t\t}\n\t\t\tSet<String> keys = termList.keySet();\n\t\t\tfor (String tmp : keys) {\n\t\t\t\tif (idf.containsKey(tmp)) {\n\t\t\t\t\tDouble num = idf.get(tmp);\n\t\t\t\t\tidf.put(tmp, num + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (String term : terms) {\n\n\t\t\tdouble weightOfTerm = Math.log((double) fileCount / idf.get(term)\n\t\t\t\t\t+ 0.01);\n\t\t\tfeatureWriter.write(term + \" \" + weightOfTerm);\n\t\t\tfeatureWriter.newLine();\n\t\t\tidf.put(term, weightOfTerm);\n\n\t\t}\n\t\tfeatureWriter.flush();\n\t\tfeatureWriter.close();\n\n\t\ttrainReader = new BufferedReader(new FileReader(trainPath));\n\t\twhile ((oneline = trainReader.readLine()) != null) {\n\n\t\t\tint pos = oneline.indexOf(\"\\t\");\n\t\t\tString topic = oneline.substring(0, pos);\n\t\t\tString content = oneline.substring(pos + 1);\n\t\t\tHashtable<String, Integer> termFrequent = new Hashtable<String, Integer>();\n\t\t\tTokenStream stream = analyzer.tokenStream(\"\", new StringReader(\n\t\t\t\t\tcontent));\n\t\t\twhile (true) {\n\t\t\t\tToken token = stream.next();\n\t\t\t\tif (token == null)\n\t\t\t\t\tbreak;\n\t\t\t\tString tmp = token.termText();\n\t\t\t\tif (!termFrequent.containsKey(tmp))\n\t\t\t\t\ttermFrequent.put(tmp, new Integer(1));\n\t\t\t\telse {\n\t\t\t\t\tInteger num = termFrequent.get(tmp);\n\t\t\t\t\ttermFrequent.put(tmp, num + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdouble weights[] = new double[terms.size()];\n\t\t\tdouble denominator = 0.0;\n\t\t\tint i = 0;\n\t\t\tfor (String term : terms) {\n\t\t\t\tdouble count;\n\t\t\t\tif (termFrequent.containsKey(term)) {\n\t\t\t\t\tcount = termFrequent.get(term);\n\t\t\t\t} else {\n\t\t\t\t\tcount = 0;\n\t\t\t\t}\n\n\t\t\t\tdouble tmp = count * idf.get(term);\n\t\t\t\tdenominator += tmp;\n\t\t\t\tweights[i++] = tmp;\n\t\t\t}\n\t\t\tdenominator = Math.sqrt(denominator);\n\t\t\twriter.write(topic);\n\t\t\tfor (int j = 1; j <= weights.length; j++) {\n\t\t\t\tdouble tmp = weights[j - 1];\n\t\t\t\tif (tmp > 0.0) {\n\t\t\t\t\ttmp = Math.sqrt(tmp) / denominator;\n\t\t\t\t\twriter.write(\" \" + j + \":\" + tmp);\n\t\t\t\t}\n\t\t\t}\n\t\t\twriter.newLine();\n\t\t}\n\n\t\twhile ((oneline = testReader.readLine()) != null) {\n\n\t\t\tint pos = oneline.indexOf(\"\\t\");\n\t\t\tString topic = oneline.substring(0, pos);\n\t\t\tString content = oneline.substring(pos + 1);\n\t\t\tHashtable<String, Integer> termFrequent = new Hashtable<String, Integer>();\n\t\t\tTokenStream stream = analyzer.tokenStream(\"\", new StringReader(\n\t\t\t\t\tcontent));\n\t\t\twhile (true) {\n\t\t\t\tToken token = stream.next();\n\t\t\t\tif (token == null)\n\t\t\t\t\tbreak;\n\t\t\t\tString tmp = token.termText();\n\t\t\t\tif (!termFrequent.containsKey(tmp))\n\t\t\t\t\ttermFrequent.put(tmp, new Integer(1));\n\t\t\t\telse {\n\t\t\t\t\tInteger num = termFrequent.get(tmp);\n\t\t\t\t\ttermFrequent.put(tmp, num + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdouble weights[] = new double[terms.size()];\n\t\t\tdouble denominator = 0.0;\n\t\t\tint i = 0;\n\t\t\tfor (String term : terms) {\n\t\t\t\tdouble count;\n\t\t\t\tif (termFrequent.containsKey(term)) {\n\t\t\t\t\tcount = termFrequent.get(term);\n\t\t\t\t} else {\n\t\t\t\t\tcount = 0;\n\t\t\t\t}\n\t\t\t\tdouble tmp = count * idf.get(term);\n\t\t\t\tdenominator += tmp;\n\t\t\t\tweights[i++] = tmp;\n\t\t\t}\n\t\t\tdenominator = Math.sqrt(denominator);\n\t\t\ttestWriter.write(topic);\n\t\t\tfor (int j = 1; j <= weights.length; j++) {\n\t\t\t\tdouble tmp = weights[j - 1];\n\t\t\t\tif (tmp > 0.0) {\n\t\t\t\t\ttmp = Math.sqrt(tmp) / denominator;\n\t\t\t\t\ttestWriter.write(\" \" + j + \":\" + tmp);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttestWriter.newLine();\n\t\t}\n\t\twriter.close();\n\t\ttestWriter.close();\n\t}", "private void calculateIdf(){\r\n\t\tIdf = new HashMap<>();\r\n\t\tOcc = new HashMap<>();\r\n\t\t\r\n\t\tfor (Entry<String, Document> doc : Docs.entrySet()){\r\n\t\t\tdoc.getValue().wordSet.forEach(word -> {\r\n\t\t\t\tdouble count = Idf.containsKey(word) ? Idf.get(word) : 0;\r\n \tIdf.put(word, count+1);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tdoc.getValue().words.forEach((w, o) -> words.add(w));\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tfor (Entry<String, Double> e : new HashMap<>(Idf).entrySet()){\r\n\t\t\tIdf.put(e.getKey(),\r\n\t\t\t\t\tMath.log(Idf.keySet().size() / e.getValue()));\r\n\t\t}\r\n\t}", "public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}", "public void calculateTermWeights() {\n\t\tfor (String termString : terms.keySet()) {\n\t\t\tTerm t = terms.get(termString);\n\t\t\tMap<Integer, TermDoc> posting = t.getPostings();\n\n\t\t\t// Iterate through the docs in which the selected term is found.\n\t\t\tfor (Integer docId : posting.keySet()) {\n\n\t\t\t\tTermDoc td = posting.get(docId);\n\t\t\t\tDocument doc = this.getDocument(docId);\n\n\t\t\t\tfinal double a = 0.4;\n\t\t\t\tdouble ntf = a + (1 - a) * (double) td.getFreq() / (double) doc.getMaxTermFreq();\n\t\t\t\tdouble idf = Math.log((double) documents.size() / (1 + (double) t.getDocFreq()));\n\t\t\t\tdoc.addWeight(termString, ntf * idf);\n\t\t\t}\n\t\t}\n\n\t\tfor (Document doc : documents.values())\n\t\t\tdoc.setEuclideanDistance();\n\t}", "@Override\n public double score(Document document) {\n Set<String> allDocTerms = documentsTerms.termsExtractedFromDocument(document).allTerms();\n\n //keeping only the query terms that are in the document\n Collection<String> relevantTerms = new LinkedHashSet<>(query);\n relevantTerms.retainAll(allDocTerms);\n\n //compute score using a sum formula on each query term\n int docLength = termsOccurences.get(document).totalNumberOfOccurences();\n double score = 0.0;\n for (String term : relevantTerms) {\n double termIDF = idf.weight(term);\n double termTF = tf.weight(term, document);\n\n score += termIDF * (termTF * (k1 + 1)) / (termTF + k1 * (1 - b + b * (docLength / averageDocLength)));\n }\n\n return score;\n }", "SwiftScoredSet getTfIdf(String text,ASTNode n,boolean kgram)\n{\n Map<String,Integer> words = null;\n Map<String,Integer> totals = null;\n double tot = 0;\n if (kgram){\n words = buildKgramCounts(text,n);\n totals = kgram_counts;\n tot = total_kdocuments;\n } \n else {\n words = handleDocumentText(text);\n totals = document_counts;\n tot = total_documents;\n }\n double termtot = 1;\n \n for (Integer iv : words.values()) {\n termtot += iv;\n }\n \n SwiftScoredSet rslt = new SwiftScoredSet();\n for (Map.Entry<String,Integer> ent : words.entrySet()) {\n String wd = ent.getKey();\n double ct = ent.getValue();\n Integer docs = totals.get(wd);\n double docct = 0;\n if (docs != null) docct = docs;\n double idf = Math.log(tot/(1+docct));\n double tf = ct/termtot;\n double tfidf = tf*idf;\n rslt.add(wd,tfidf);\n }\n rslt.normalize();\n \n return rslt;\n}", "private void doBayesianClassification() {\n\t\tList<MutualInformation> mutualInformationList = new ArrayList<MutualInformation>();\r\n\t\tint k = 5;\r\n\t\tSystem.out.println(\"k = \" + k);\r\n\t\tdouble N = fileNames.size();\r\n\t\t\r\n\t\tList<Set<String>> classifiedDocsList = new ArrayList<Set<String>>();\r\n\t\tclassifiedDocsList.add(setOfHamiltonDocs);\r\n\t\tclassifiedDocsList.add(setOfMadisonDocs);\r\n\t\tclassifiedDocsList.add(setOfJayDocs);\r\n\t\t\r\n\t\tfor (String term : corpusVocab) {\r\n\r\n\t\t\t// All docs containing this term\r\n\t\t\tSet<String> matchingDocs = new HashSet<String>();\r\n\t\t\t\r\n\t\t\tfor (PositionalPosting posting : pInvertedIndex.getPostings(term)) {\r\n\t\t\t\tmatchingDocs.add(fileNames.get(posting.getDocumentId()));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// iterate through all classes (Hamilton, Madison, Jay)\r\n\t\t\tfor (int i = 0; i < classifiedDocsList.size(); i++) {\r\n\t\t\t\t\r\n\t\t\t\tSet<String> classifiedDocs = classifiedDocsList.get(i);\r\n\t\t\t\t\r\n\t\t\t\tSet<String> intersection = new HashSet<String>(matchingDocs);\r\n\t\t\t\tintersection.retainAll(classifiedDocs);\r\n\t\t\t\tdouble N11 = intersection.size();\r\n\t\t\t\t\r\n\t\t\t\tSet<String> difference = new HashSet<String>(matchingDocs);\r\n\t\t\t\tdifference.removeAll(classifiedDocs);\r\n\t\t\t\tdouble N10 = difference.size();\r\n\t\t\t\t\r\n\t\t\t\tdouble N01 = classifiedDocs.size() - N11;\r\n\t\t\t\tdouble N00 = fileNames.size() - classifiedDocs.size() - N10;\r\n\r\n\t\t\t\t// Calculate I(t,c)\r\n\t\t\t\tdouble Itc = (N11 / N) * log2((N * N11) / ((N11 + N10) * (N11 + N01)))\r\n\t\t\t\t\t\t+ (N01 / N) * log2((N * N01) / ((N01 + N00) * (N11 + N01)))\r\n\t\t\t\t\t\t+ (N10 / N) * log2((N * N10) / ((N11 + N10) * (N10 + N00)))\r\n\t\t\t\t\t\t+ (N00 / N) * log2((N * N00) / ((N01 + N00) * (N10 + N00)));\r\n\t\t\t\tif (!Double.isNaN(Itc)) {\r\n\t\t\t\t\tmutualInformationList.add(new MutualInformation(term, Itc));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Build Discriminating Set of vocab terms by sorting mutual information\r\n\t\t// list and keep the first k values\r\n\t\tSet<String> terms = new HashSet<String>();\r\n\t\tCollections.sort(mutualInformationList, Collections.reverseOrder());\r\n\t\tfor (int i = 0; i < k; i++) {\r\n\t\t\tterms.add(mutualInformationList.get(i).getTerm());\r\n\t\t}\r\n\t\t\r\n\t\t// get term counts in classified (trainer) docs\t\t\r\n\t\tint[] classifiedDocsTermFreq = new int[classifiedDocsList.size()];\r\n\t\t\r\n\t\tclassifiedDocsTermFreq[0] = getTermFreq(hamiltonDocs, terms);\r\n\t\tclassifiedDocsTermFreq[1] = getTermFreq(madisonDocs, terms);\r\n\t\tclassifiedDocsTermFreq[2] = getTermFreq(jayDocs, terms);\r\n\t\t\r\n\t\t// Calculate p(t|c)\r\n\t\t// maps term to list of p(t|c) for each class\r\n\t\tMap<String, List<Double>> ptc = new HashMap<String, List<Double>>();\r\n\t\t\r\n\t\tfor (String term : terms) {\r\n\t\t\tptc.put(term, new ArrayList<Double>());\r\n\t\t\tfor (int i = 0; i < classifiedDocsList.size(); i++) {\r\n\t\t\t\t\r\n\t\t\t\tint ftc = 0;\r\n\t\t\t\tfor (PositionalPosting posting : pInvertedIndex.getPostings(term)) {\r\n\t\t\t\t\tif (classifiedDocsList.get(i).contains(fileNames.get(posting.getDocumentId()))) {\r\n\t\t\t\t\t\tftc += posting.getPositions().size();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tptc.get(term).add((double) (ftc + 1) / (double) (classifiedDocsTermFreq[i] + terms.size()));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// visit each unclassified document\r\n\t\ttry {\r\n\t\t\tPath currentWorkingPath = Paths.get(toBeClassified).toAbsolutePath();\r\n\t\t\t// This is our standard \"walk through all .txt files\" code.\r\n\t\t\tFiles.walkFileTree(currentWorkingPath, new SimpleFileVisitor<Path>() {\r\n\r\n\t\t\t\tpublic FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {\r\n\t\t\t\t\t// make sure we only process the current working directory\r\n\t\t\t\t\tif (currentWorkingPath.equals(dir)) {\r\n\t\t\t\t\t\treturn FileVisitResult.CONTINUE;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn FileVisitResult.SKIP_SUBTREE;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tpublic FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {\r\n\r\n\t\t\t\t\tif (file.toString().endsWith(\".txt\")) {\r\n\r\n\t\t\t\t\t\tTokenStream tokenStream = null;\r\n\t\t\t\t\t\t// terms in this document\r\n\t\t\t\t\t\tSet<String> docTerms = new HashSet<String>();\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\ttokenStream = Utils.getTokenStreams(file.toFile());\r\n\t\t\t\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\twhile (tokenStream.hasNextToken()) {\r\n\t\t\t\t\t\t\tString token = Utils.processWord(tokenStream.nextToken().trim(), false);\r\n\t\t\t\t\t\t\tdocTerms.add(token);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// only keep terms in discriminating set\r\n\t\t\t\t\t\tdocTerms.retainAll(terms);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// calculate log(p(c) + sum(log(p(ti|c))) for each class\r\n\t\t\t\t\t\tdouble[] pce = new double[classifiedDocsList.size()];\r\n\t\t\t\t\t\tfor (int i = 0; i < classifiedDocsList.size(); i++) {\r\n\t\t\t\t\t\t\tdouble sum = 0;\r\n\t\t\t\t\t\t\tfor (String term : docTerms) {\r\n\t\t\t\t\t\t\t\tsum += Math.log(ptc.get(term).get(i));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tpce[i] = Math.log(classifiedDocsTermFreq[i] / terms.size()) + sum;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (pce[0] > pce[1] && pce[0] > pce[2]) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"Document : \" + file.getFileName().toString() + \" : belongs to Hamilton\");\r\n\t\t\t\t\t\t} else if (pce[1] > pce[0] && pce[1] > pce[2]) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"Document : \" + file.getFileName().toString() + \" : belongs to Madison\");\r\n\t\t\t\t\t\t} else if (pce[2] > pce[0] && pce[2] > pce[1]) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"Document : \" + file.getFileName().toString() + \" : belongs to Jay\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tSystem.out.println(\"I don't know whom document : \" + file.getFileName().toString() + \" : belongs to.\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn FileVisitResult.CONTINUE;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// don't throw exceptions if files are locked/other errors occur\r\n\t\t\t\tpublic FileVisitResult visitFileFailed(Path file, IOException e) {\r\n\t\t\t\t\treturn FileVisitResult.CONTINUE;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static String tfidf(String str) throws Exception{\n\t\tIndexReader r = IndexReader.open(FSDirectory.open(new File(\"index\")));\r\n\r\n\t\t// this code takes care of calculating idf for each term\r\n\r\n\t\tHashMap<String, Double> idf_map = new HashMap<String, Double>();\r\n\t\tTermEnum t = r.terms();\r\n\t\tdouble docs_count = r.maxDoc();\r\n\t\twhile (t.next()) {\r\n\t\t\tTerm te = new Term(\"contents\", t.term().text());\r\n\t\t\tdouble idf = Math.log(docs_count / r.docFreq(te));\r\n\t\t\tidf_map.put(t.term().text(), idf);\r\n\t\t}\r\n\r\n\t\t// This code is a test stub to get the term with lowest IDF value\r\n\r\n\t\t/*\r\n\t\t * double minVal = Collections.min(idf_map.values()); for(Entry<String,\r\n\t\t * Double> entry:idf_map.entrySet()){ if(entry.getValue() == minVal){\r\n\t\t * System.out.println(\"Term with lowest idf is: \"+entry.getKey()); } }\r\n\t\t */\r\n\r\n\t\tlong t1, t2;\r\n\t\tlong start = System.currentTimeMillis();\r\n\r\n\t\t// code to get |d| for every document\r\n\r\n\t\tHashMap<Integer, HashMap<String, Integer>> hmap = new HashMap<Integer, HashMap<String, Integer>>();\r\n\t\tTermEnum trm = r.terms();\r\n\t\twhile (trm.next()) {\r\n\t\t\tTerm te1 = new Term(\"contents\", trm.term().text());\r\n\t\t\tTermDocs td1 = r.termDocs(te1);\r\n\r\n\t\t\twhile (td1.next()) {\r\n\t\t\t\tHashMap<String, Integer> a1 = hmap.get(td1.doc());\r\n\t\t\t\tif (a1 == null) {\r\n\t\t\t\t\ta1 = new HashMap<String, Integer>();\r\n\t\t\t\t\ta1.put(trm.term().text(), td1.freq());\r\n\t\t\t\t\thmap.put(td1.doc(), a1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ta1.put(trm.term().text(), td1.freq());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// compute magnitude of each document vector and store it in array\r\n\r\n\t\tArrayList<Double> doc_magnitude = new ArrayList<Double>();\r\n\t\tHashMap<String, Integer> val = new HashMap<String, Integer>();\r\n\t\tSet<Entry<Integer, HashMap<String, Integer>>> entrySet = hmap.entrySet();\r\n\r\n\t\tjava.util.Iterator<Entry<Integer, HashMap<String, Integer>>> it = entrySet.iterator();\r\n\t\twhile (it.hasNext()) { // foreach document id\r\n\t\t\tdouble square_sum = 0.0;\r\n\t\t\tMap.Entry<Integer, HashMap<String, Integer>> me = (Entry<Integer, HashMap<String, Integer>>) it.next();\r\n\t\t\tval = me.getValue();\r\n\t\t\tSet<Map.Entry<String, Integer>> entry = val.entrySet();\r\n\t\t\tjava.util.Iterator<Map.Entry<String, Integer>> iterator = entry.iterator();\r\n\t\t\twhile (iterator.hasNext()) { // foreach term\r\n\t\t\t\tMap.Entry<String, Integer> mp = iterator.next();\r\n\t\t\t\tsquare_sum += mp.getValue() * mp.getValue();\r\n\t\t\t}\r\n\t\t\tdouble root = Math.sqrt(square_sum);\r\n\t\t\tdoc_magnitude.add(me.getKey(), root);\r\n\t\t}\r\n\r\n\t\t// long end = System.currentTimeMillis();\r\n\t\t// double diff = end - start;\r\n\t\t// System.out.println(\"Time taken to compute norms(in seconds): \" + diff\r\n\t\t// / 1000 + \"\\n\");\r\n\r\n\t\t// get the query and find similarity with the documents\r\n\t\tHashMap<Integer, Double> similarity_map = new HashMap<Integer, Double>();\r\n\t\tSet<Entry<Integer, HashMap<String, Integer>>> entrySet1 = hmap.entrySet();\r\n\t\tjava.util.Iterator<Entry<Integer, HashMap<String, Integer>>> it1 = entrySet1.iterator();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tHashMap<Integer, Double> dot_product_map = new HashMap<Integer, Double>();\r\n\r\n\t\t\r\n\t\t\tdot_product_map.clear();\r\n\t\t\tsimilarity_map.clear();\r\n\r\n\t\t\tString[] terms = str.split(\"\\\\s+\");\r\n\t\t\tint cnt = 0;\r\n\r\n\t\t\tlong result_st = System.currentTimeMillis();\r\n\t\t\tt1 = System.nanoTime();\r\n\r\n\t\t\t// for each term get the documents containing the corresponding term\r\n\t\t\tfor (String word : terms) // foreach term in query\r\n\t\t\t{\r\n\t\t\t\tTerm te = new Term(\"contents\", word);\r\n\t\t\t\tTermDocs tdocs = r.termDocs(te);\r\n\t\t\t\twhile (tdocs.next() /* && tdocs.doc() < number */) {\r\n\t\t\t\t\t// Map.Entry<Integer, HashMap<String, Integer>> me =\r\n\t\t\t\t\t// (Entry<Integer, HashMap<String, Integer>>) it1.next();\r\n\t\t\t\t\tdouble freq = hmap.get(tdocs.doc()).get(word);\r\n\t\t\t\t\tDouble temp = dot_product_map.get(tdocs.doc());\r\n\t\t\t\t\tif (temp == null) {\r\n\t\t\t\t\t\tdot_product_map.put(tdocs.doc(), freq * idf_map.get(word));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdot_product_map.put(tdocs.doc(), dot_product_map.get(tdocs.doc()) + freq * idf_map.get(word));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcnt++;\r\n\t\t\t}\r\n\t\t\tSet<Entry<Integer, Double>> se = dot_product_map.entrySet();\r\n\t\t\tjava.util.Iterator<Entry<Integer, Double>> iter = se.iterator();\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tMap.Entry<Integer, Double> me = (Entry<Integer, Double>) iter.next();\r\n\t\t\t\tsimilarity_map.put(me.getKey(), me.getValue() / (Math.sqrt(cnt) * doc_magnitude.get(me.getKey())));\r\n\t\t\t}\r\n\r\n\t\t\t// Normalize the map\r\n\t\t\tdouble sum = 0;\r\n\t\t\tfor (int i : similarity_map.keySet()) {\r\n\t\t\t\tsum += similarity_map.get(i);\r\n\t\t\t}\r\n\r\n\t\t\tfor (int i : similarity_map.keySet()) {\r\n\t\t\t\tdouble temp = similarity_map.get(i) / sum;\r\n\t\t\t\tsimilarity_map.put(i, temp);\r\n\t\t\t}\r\n\r\n\t\t\tString result=\"\";\r\n\r\n\t\t\tList<Integer> l1 = new ArrayList<Integer>();\r\n\t\t\tHashMap<Integer, Double> sim_map = sortMap(similarity_map, r);\r\n\t\t\tfor(Integer i:sim_map.keySet()){\r\n\t\t\t\tl1.add(i);\r\n\t\t\t\tDocument d1 = r.document(i);\r\n\t\t\t\tString url = d1.getFieldable(\"path\").stringValue();\r\n\t\t\t\t//String snippet = getSnippet(hmap.get(i));\r\n\t\t\t\turl = url.replace(\"%%\", \"/\");\r\n\t\t\t\tString snippet = Snippet.getContent(url,terms[0]); //read the content of url\r\n\t\t\t\tresult +=/*i+\" \"+*/url+\"\\n\";\r\n\t\t\t\tresult +=snippet+\"\\n\\n\\n\";\r\n\t\t\t\t//result += snippet+\"\\n\\n\";\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t\t\r\n}", "boolean hasFreq();", "private static String handleNonPhraseToken(String stringPart) {\r\n // Set of final terms to be used (no empty elements, right syntax of index fields)\r\n ArrayList <String> terms = new ArrayList <String> ();\r\n \r\n /** Case Index field **/\r\n if(stringPart.contains(\"[\") | stringPart.contains(\"[\")){ // at least an Index field contained here\r\n //separate brackets for term with one space (extra spaces dont matter, trim() is used later)\r\n stringPart = stringPart.replace(\"[\", \" [\");\r\n stringPart = stringPart.replace(\"]\", \"] \");\r\n }\r\n\r\n /** Case Bag of terms **/\r\n //replace space with AND (change default operator to match pubMed's)\r\n // No need for this if setDefaultOperator(QueryParser.Operator.AND) is used\r\n \r\n String[] tokens = stringPart.split(\"\\\\s\");\r\n if(tokens.length > 0){ \r\n for(int i = 1 ; i < tokens.length ; i++){\r\n tokens[i] = tokens[i].trim();\r\n /* Case index field [fieldName] */\r\n if(tokens[i].startsWith(\"[\") & tokens[i].endsWith(\"]\")){\r\n tokens[i] = tokens[i].replace(\"[\",\"\");// clean field name from brackets\r\n tokens[i] = tokens[i].replace(\"]\",\"\");// clean field name from brackets\r\n //Add index field as prefix to previus (not empty) term (as opening index fields handled separately, this index field should not be the first term of string part)\r\n int tmp = i-1;\r\n boolean perviusTermFound = false;\r\n while(!perviusTermFound & tmp >= 0){\r\n if(!tokens[tmp].equals(\"\")){\r\n perviusTermFound = true;\r\n //TO DO : handle wrong syntax (e.g. ... AND [ArticleTitle])\r\n String luceneField = supportedIndexFields.get(tokens[i]);\r\n if(luceneField != null){\r\n tokens[tmp] = luceneField + \":\" + tokens[tmp];\r\n } // else : Lucene counterpart not found, unsupported field - do nothing\r\n } else {\r\n tmp--;\r\n }\r\n }\r\n //Empty field to not be added as a search term in query\r\n tokens[i] = \"\";\r\n } \r\n \r\n /*\r\n \r\n else if(!tokens[i].equals(\"AND\") & !tokens[i].equals(\"\")) {\r\n terms.add(tokens[i]);\r\n }\r\n */\r\n }\r\n }\r\n \r\n String luceneQueryPart = \"\";\r\n boolean notWaiting = false;\r\n boolean orWaiting = false;\r\n for(int i = 0 ; i < tokens.length ; i++){\r\n\r\n if(!tokens[i].equals(\"AND\") & !tokens[i].equals(\"\")){\r\n //in case of AND nothing should happen, it is the default operator\r\n //empty elements are also ignored as useless\r\n \r\n if(!tokens[i].equals(\"NOT\") & !tokens[i].equals(\"OR\") ){ // it's not an operator, it's a term\r\n \r\n if(!luceneQueryPart.endsWith(\" OR \") & !luceneQueryPart.endsWith(\" -\") ) { \r\n luceneQueryPart += \" +\"; \r\n } \r\n luceneQueryPart += tokens[i];\r\n } else {\r\n if(tokens[i].equals(\"NOT\")) {\r\n luceneQueryPart += \" -\";\r\n }\r\n if(tokens[i].equals(\"OR\")){\r\n luceneQueryPart += \" OR \";\r\n }\r\n \r\n } \r\n } \r\n }\r\n \r\n return luceneQueryPart;\r\n }", "public abstract void addFeatures(Collection<Double> indices,Predicate pred, Word arg,boolean allWords);", "public void setTerms(Term[] terms) { this.terms = terms; }", "public float computeTermScore(int term, int dl, int tf, GlobalStats stats);", "public double getTfIdf(){ return tf_idf; }", "private Float weightTermUniqeness(String term) throws IOException{\n\t\tFloat result = null;\n\t\t\n\t\tLong docCnt\t\t= this.elasticClient.getDocCount();\n\t\tLong termDocCnt = this.elasticClient.getDocCount(term);\n\t\t\n\t\tresult = ((Long)(docCnt / termDocCnt)).floatValue();\n\t\t\n\t\treturn result;\n\t}", "@Override\n protected float score(BasicStats stats, float termFreq, float docLength) {\n double s = 0.75;\n\n long N = stats.getNumberOfDocuments();\n long df = stats.getDocFreq();\n float cwd = termFreq;\n float cwq = 1; //assume that the query term frequency is always one\n float n = docLength;\n float navg = stats.getAvgFieldLength();\n\n double p1 = (1+Math.log(1+Math.log(cwd)))/(1-s+s*n/navg);\n float ans = (float) (p1 * cwq * Math.log((N+1)/df));\n\n return ans;\n }", "public HashMap<String, Double> search(String query) {\n // ===================================================\n // 1. Fetch all inverted lists corresponding to terms\n // in the query.\n // ===================================================\n String[] terms = query.split(\" \");\n HashMap<String, Integer> qf = new HashMap<String, Integer>();\n // Calculate term frequencies in the query\n for (String term : terms) {\n if (qf.containsKey(term))\n qf.put(term, qf.get(term) + 1);\n else\n qf.put(term, 1);\n }\n HashMap<String, Double> docScore = new HashMap<String, Double>();\n for (Entry<String, Integer> termEntry : qf.entrySet()) {\n String term = termEntry.getKey();\n int qfi = termEntry.getValue();\n\n // ===================================================\n // 2. Compute BM25 scores for documents in the lists.\n // Make a score list for documents in the inverted\n // lists. Assume that no relevance information is \n // available. For parameters, use k1=1.2, b=0.75, \n // k2=100.\n // ===================================================\n double k1 = 1.2;\n double b = 0.75;\n double k2 = 100;\n int ni = invIndex.get(term).size();\n\n\n for (Entry<String, IndexEntry> invListEntry : invIndex.get(term).entrySet()) {\n String docID = invListEntry.getKey();\n double bm25Score;\n if (docScore.containsKey(docID))\n bm25Score = docScore.get(docID);\n else\n bm25Score = 0;\n\n // length of the document\n int dl = docStat.get(docID);\n // frequency of the term in the document\n int fi = invListEntry.getValue().getTf();\n double K = k1 * ((1 - b) + b * ((double) dl / avdl));\n\n // ===================================================\n // 3. Accumulate scores for each term in a query\n // on the score list.\n // ===================================================\n bm25Score += Math.log((N - ni + 0.5) / (ni + 0.5))\n * (((k1 + 1) * fi * (k2 + 1) * qfi) / ((K + fi) * (k2 + qfi)));\n docScore.put(docID, bm25Score);\n }\n }\n\n return docScore;\n }", "public Term[] getTerms() { return terms; }", "@Override\n protected float score(BasicStats stats, float termFreq, float docLength) {\n float k1 = (float)1.2;\n float k2 = 750;\n float b = (float)0.75;\n float N = stats.getNumberOfDocuments();\n float df = stats.getDocFreq();\n float qtermFreq = 1;\n float score = (float)Math.log((N - df + 0.5)/df+0.5);\n score*=((k1+1)*termFreq)/(k1*(1-b+b*(docLength/stats.getAvgFieldLength()))+termFreq);\n score*=((k2+1)*qtermFreq)/(k2+qtermFreq);\n return score; }", "public /*TreeMap<String, Float>*/void getTopnTermsOverlapWithQuery() throws IOException, ParseException{\n\t\tString outputfile = \"./output/score/test3.txt\";\n\n\t\tFileOutputStream out = new FileOutputStream(outputfile);\n\t\tPrintStream ps = new PrintStream(out);\n\t\t/*-------------------------------------------------------------------------------*/\n\n\t\tTreeMap<String,Float> termsscoressorted = null;\n\t\tCollectionReader reader = new CollectionReader(indexDir); \n\t\tIndexReader ir = reader.getIndexReader();\t\t\n\n\t\tTopicsInMemory topics = new TopicsInMemory(\"data/CLEF-IP-2010/PAC_test/topics/PAC_topics-test2.xml\"/*omit-PAC-1094.xml\"*/);\n\t\tfor(Map.Entry<String, PatentDocument> topic : topics.getTopics().entrySet()){\n\t\t\tString qUcid = topic.getValue().getUcid();\n\t\t\tString queryid = topic.getKey();\n\t\t\tString queryName = topic.getKey() + \"_\" + topic.getValue().getUcid();\n\t\t\tString queryfile = topic.getKey() + \"_\" + topic.getValue().getUcid() + \".xml\";\n\n\t\t\t/*System.out.println(\"=========================================\");\n\t\t\tSystem.out.println(queryName);\n\t\t\tSystem.out.println(\"=========================================\");*/\n\t\t\t/*int docid = reader.getDocId(\"UN-EP-0663270\", PatentDocument.FileName);\n\t\t\tir.getTermVector(docid, field) getTermVectors(b);*/\n\n\t\t\tEvaluateResults er = new EvaluateResults();\n\t\t\tArrayList<String> tps = er.evaluatePatents(queryid, \"TP\");\n\t\t\tArrayList<String> fps = er.evaluatePatents(queryid, \"FP\");\n\t\t\tHashMap<String, Float> /*TFreqs*/ termsscores = new HashMap<>();\n\n\n\t\t\t/*--------------------------------- Query Words -------------------------------*/\n\t\t\t//\t\t\tHashMap<String, Integer> query_termsfreqspair = reader.gettermfreqpair(qUcid, PatentDocument.Description);\n\t\t\tHashSet<String> query_terms = reader.getDocTerms(qUcid, PatentDocument.Description);\n\t\t\t//\t\t\tSystem.out.println(query_termsfreqspair.size() +\"\\t\"+ query_termsfreqspair);\n//\t\t\tSystem.out.println(query_terms.size() + \"\\t\" + query_terms);\n\t\t\t/*-----------------------------------------------------------------------------*/\t\t\t\n\n\n\t\t\t//\t\t\tSystem.out.println(\"-----TPs----\");\n\t\t\tfor (String tp : tps) {\n\t\t\t\t/*System.out.println(\"---------\");\n\t\t\t\tSystem.out.println(tp);*/\n\t\t\t\tHashMap<String, Integer> termsfreqsTP = reader.gettermfreqpairAllsecs(\"UN-\" + tp);\n\n\t\t\t\tfor(Entry<String, Integer> tfTP:termsfreqsTP.entrySet()){\n\t\t\t\t\tif(termsscores.containsKey(tfTP.getKey())){\n\t\t\t\t\t\ttermsscores.put(tfTP.getKey(), termsscores.get(tfTP.getKey()) + (float)tfTP.getValue()/tps.size());\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//\t\t\t\t\t\tfloat test = (float)t.getValue()/tps.size();\n\t\t\t\t\t\t//\t\t\t\t\t\tSystem.out.println(test);\n\t\t\t\t\t\ttermsscores.put(tfTP.getKey(), (float)tfTP.getValue()/tps.size());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//\t\t\t\tSystem.out.println(termsscores.size() + \" \" + termsscores);\t\t\t\t\t\n\t\t\t}\n\n\t\t\t/*System.out.println();\n\t\t\tSystem.out.println(\"-----FNs----\");*/\n\t\t\tfor (String fp : fps) {\n\t\t\t\t/*System.out.println(\"---------\");\n\t\t\t\tSystem.out.println(fp);*/\n\t\t\t\tHashMap<String, Integer> termsfreqsFP = reader.gettermfreqpairAllsecs(\"UN-\" + fp);\n\n\t\t\t\tfor(Entry<String, Integer> t:termsfreqsFP.entrySet()){\n\t\t\t\t\tif(termsscores.containsKey(t.getKey())){\n\t\t\t\t\t\ttermsscores.put(t.getKey(), termsscores.get(t.getKey()) - (float)t.getValue()/fps.size());\n\t\t\t\t\t}else{\t\t\t\t\t\t\n\t\t\t\t\t\ttermsscores.put(t.getKey(), -(float)t.getValue()/fps.size());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//\t\t\t\tSystem.out.println(TFreqs.size() + \" \" + TFreqs);\n\t\t\t}\n\t\t\t//\t\t\tSystem.out.println(termsscores.size() + \" \" + termsscores);\n\t\t\tValueComparator bvc = new ValueComparator(termsscores);\n\t\t\ttermsscoressorted = new TreeMap<String,Float>(bvc);\t\t\t\n\t\t\ttermsscoressorted.putAll(termsscores);\n\t\t\tSystem.out.println(queryid + \"\\t\"+ termsscoressorted.size() + \"\\t\" + termsscoressorted/*.keySet()*/);\n\t\t\tint overlap = 0;\n\t\t\tint i = 0;\n\t\t\tfor(Entry<String, Float> scoresorted:termsscoressorted.entrySet()){\n\t\t\t\ti++;\n\t\t\t\tif(i<=100){\n\t\t\t\t\tif(query_terms.contains(scoresorted.getKey())){\n\t\t\t\t\t\toverlap++;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tSystem.out.println(queryName + \"\\t\"+overlap);\n//\t\t\tps.println(queryName + \"\\t\"+overlap);\n\t\t}\n\t}", "private Double getSentenceTfIdf(String sentence, Article article) {\n Double sentenceTfIdf = 0.0;\n PriorityQueue<Double> topFiveWords = new PriorityQueue<>(Collections.reverseOrder());\n Set<String> alreadyConsideredWords = new HashSet<>();\n\n // Split the words in a sentence\n String[] sentenceTerms = sentence.split(\"\\\\s+\");\n\n for (String term: sentenceTerms) {\n // format the raw term to remove non-alphanumeric characters\n term = term.replaceAll(\"[^a-zA-Z\\\\d]\", \"\").toLowerCase().trim();\n\n if (!term.isEmpty()) {\n // lookup term in unigrams map to get its TF.IDF score\n Unigram correspondingUnigram = article.unigrams.get(term);\n\n if (correspondingUnigram != null && !alreadyConsideredWords.contains(term)) {\n topFiveWords.add(correspondingUnigram.getTf_idf());\n alreadyConsideredWords.add(term);\n }\n }\n }\n\n int limit = Math.min(5, topFiveWords.size());\n for (int i = 0; i < limit; i++) {\n sentenceTfIdf += topFiveWords.poll();\n }\n\n return sentenceTfIdf;\n }", "public void relevanceFeedback(PostingsList results, boolean[] docIsRelevant, Indexer indexer ) {\r\n// results contain the ranked list from the current search\r\n// docIsRelevant contains the users feedback on which of the 10 first hits are relevant\r\n\tdouble gamma = 0.0; // används ej, de orelevanta dokumenterna. städa upp queryn. Vad innehller de orelevanta dokumenterna för termer\r\n// dess termer tar vi bort från den relebanta.)\r\n\r\n\tdouble alfa = 0.8; // hur mycket litar på det gamla sökning innan feedback\r\n\tdouble beta = 0.6; // hur mycket hänsyn du ska ta till nya sökningen efter feedback \r\n\r\n\r\n\t/* \r\n\r\n\tAlgorithm: \r\n\tThe Rocchio algorithm is based on a method of relevance \r\n\tfeedback found in information retrieval systems\r\n\tThe algorithm is based on the assumption that most users \r\n\thave a general conception of which documents should be denoted \r\n\tas relevant or non-relevant.[1] Therefore, the user's search \r\n\tquery is revised to include an arbitrary percentage of relevant \r\n\tand non-relevant documents as a means of increasing the search \r\n\tengine's recall, and possibly the precision as well. The number \r\n\tof relevant and non-relevant documents allowed to enter a query \r\n\tis dictated by the weights of the a, b.\r\n\tthe associated weights (a, b) are responsible for shaping the \r\n\tmodified vector in a direction closer, or farther away, from the \r\n\toriginal query, related documents, and non-related documents.\r\n\r\n\r\n\r\n\tLimitations of rocchio:\r\n\t\tTherefore the two queries of \"Burma\" and \"Myanmar\" will \r\n\t\tappear much farther apart in the vector space model, \r\n\t\tthough they both contain similar origins\r\n\tWhy not use non-relevant documents:\r\n\t\tThough there are benefits to ranking documents as not-relevant, \r\n\t\ta relevant document ranking will result in more precise documents \r\n\t\tbeing made available to the user. \r\n\t\r\n\r\n\r\n\tRoccio algoritmen: \r\n\t\talfa = Original query weight \r\n\t\tbeta = related document weight\r\n\t\t\r\n\t\thigher alpha means that we give more focus to the original query terms\r\n\t\thigher beta means that we give more focus to the new search feedback. i.e new terms.\r\n\r\n\t\tTar en org query\r\n\t\tTar den gamla gånnger en viss vikt \r\n\t\tvikt är alfa + beta (entill vektor) plus att den kollar på original vektor, q0 \r\n\t\t\thögre alfa mer fokus på original queryn \r\n\t\t\thögra beta skiftar till mer fokus på de nya termerna. \r\n\t\tdvs utökas med ord/termer från dokument vektorerna som var relevanta. \r\n\r\n\tVanligtvis har man väldigt häg alfa och beta lite under för att det är standard. man tycker att den \r\n\tförsta queryn är väldigt bra.\r\n\r\n\t\r\n\t*/\r\n\r\n\tPostingsList related_doc_vector = new PostingsList();\r\n\tHashMap<String, Double> qm = new HashMap<String, Double>(); // spara termer och weights.\r\n\t// normalize weights\r\n\tfor(Double w : weights){\r\n\t\tw = w/weights.size();\r\n\t}\r\n\r\n\tIterator<PostingsEntry> it = results.iterator();\r\n\tfor(int i = 0; i < docIsRelevant.length; i++){\r\n\t\tif(docIsRelevant[i] == true){\r\n\t\t\trelated_doc_vector.list.add(results.get(i));\r\n\t\t} \r\n\t}\r\n\r\n\t// apply Rocchio algorithm.\r\n\tfor(int i = 0; i < terms.size(); i++){\r\n\t\tdouble new_weigt = weights.get(i) * alfa;\r\n\t\tqm.put(terms.get(i), new_weigt);\r\n\t}\r\n\r\n\tfor(int i = 0; i < related_doc_vector.size(); i++){\r\n\t\tIterator<PostingsEntry> ite = related_doc_vector.iterator();\r\n\t\twhile(ite.hasNext()){\r\n\t\t\tPostingsEntry postingsentry = ite.next();\r\n\t\t\tint docID = postingsentry.docID;\r\n\t\t\tString filename = indexer.index.docIDs.get(Integer.toString(docID)); // hämtar filnamnet\r\n\t\t\tString path = \"/Users/monadadoun/Desktop/ir/lab/davisWiki/\" + filename; \r\n\t\t\tFile file = new File(path);\r\n\t\t\tHashSet<String> hs = new HashSet<>();\r\n\t\t\t// lägger till alla ord som finns till mitt hashet\r\n\t\t\ttry (Reader reader = new InputStreamReader( new FileInputStream(file), StandardCharsets.UTF_8 )){\r\n\t\t\t\tTokenizer tok = new Tokenizer( reader, true, false, true, indexer.patterns_file );\r\n\t\t\t\twhile (tok.hasMoreTokens()) {\r\n\t\t\t\t\ths.add(tok.nextToken());\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tIterator<String> iter = hs.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tString s = iter.next();\r\n\t\t\t\tif(qm.containsKey(s)){\r\n\t\t\t\t\tDouble tmp = qm.get(s);\r\n\t\t\t\t\tqm.put(s, tmp + beta * postingsentry.score);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tqm.put(s, beta * postingsentry.score);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tLinkedList<String> term = new LinkedList<>();\r\n\tLinkedList<Double> weight = new LinkedList<>();\r\n\tList<Map.Entry<String,Double>> answer = new ArrayList<Map.Entry<String,Double>>(qm.entrySet());\r\n\tanswer.sort((e1,e2) -> e2.getValue().compareTo(e1.getValue())); // sorterar efter värde så att orden med högst score ligger först\r\n\tfor (int i = 0; i < answer.size(); i++) {\r\n\t\tterm.add(answer.get(i).getKey());\r\n\t\tweight.add(answer.get(i).getValue()/answer.size());\r\n\t}\r\n\r\n\tterms = term;\r\n\tweights = weight;\r\n\t}", "public TermToVertexCount[] getSubTermVertexMappings(String term)\n {\n /* String is not valid as-is.\n * \n * Replace and split words into parts.\n */\n term = term.replace('-', ' ');\n String [] arr = term.split(\" \");\n\n /* Remove common words */\n for(int i = 0; i < arr.length; i++)\n {\n if(arr[i].equals(\"and\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"or\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"to\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"be\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"the\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"a\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"of\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"on\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"in\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"for\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"with\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"by\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"into\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"an\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"is\"))\n {\n arr[i] = \"\";\n }\n else if(arr[i].equals(\"no\"))\n {\n arr[i] = \"\";\n }\n }//end: for(i)\n\n /* Create String array without common terms */\n int size = 0;\n for(int i = 0; i < arr.length; i++)\n {\n if(!arr[i].equals(\"\") && stem)\n { // Stem if required\n arr[i] = PorterStemmerTokenizerFactory.stem(arr[i]);\n }\n \n // Check for valid term\n if(!arr[i].equals(\"\") && getVertexMappings(arr[i]) != null)\n {\n size++;\n }\n }//end: for(i)\n \n if(size == 0)\n { /* No valid terms found */\n return null;\n }\n \n /* At least one valid term was found */\n TermToVertexCount[] words = new TermToVertexCount[size];\n int pos = 0;\n \n for(int i = 0; i < arr.length; i++)\n {\n // Check for valid term\n if(!arr[i].equals(\"\"))\n {\n // Get mappings for sub-term\n TermToVertexCount[] temp = getVertexMappings(arr[i]);\n \n if(temp != null)\n {\n words[pos] = temp[0];\n pos++;\n }//end: if(temp)\n \n }//end: if(!arr[i])\n }//end: for(i)\n \n return words; \n }", "private static void statsForQuery(String query) {\n\t\tHashMap<String,Integer> oldTerms=newTerms; // record the terms to analyze modified queries\n\t\tnewTerms=new HashMap<String,Integer>();\n\t\t\t\t\n\t\tString terms[]=query.split(\"\\\\s\");\t\t\t\t\n\t\tint matchingTerms=0;\n\t\tint matchingTermsStopwords=0;\n\t\tint matchingTermsOrder=0;\n\t\tfor (int j=0;j<terms.length;j++) {\n\t\t\tif (!terms[j].equals(\"\")) {\n\t\t\t \tif (oldTerms.containsKey(terms[j])) {\n\t\t\t \t\tmatchingTerms++;\t\t\t\t\t \n\t\t\t \t\tif (stopwordsMap.containsKey(terms[j])) { // match if it is stopword\n\t\t\t \t\t\tmatchingTermsStopwords++;\n\t\t\t \t\t}\n\t\t\t \t\tif (oldTerms.get(terms[j])==j) { // match if it has the same order\n\t\t\t \t\t\tmatchingTermsOrder++;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tnewTerms.put(terms[j],j);\n\t\t\t}\n\t\t}\t\n\n\t\tif (newTerms.size()==oldTerms.size() && matchingTerms==oldTerms.size() && matchingTerms>0) { // the queries have the same terms\n\t\t totalEqualTermsQueries++;\n\t\t\t\t \t\t\t\t \t\t\t\t\t\t \t\t\t\t \t\t\t\t \n\t\t if (matchingTermsStopwords==oldTerms.size()) {\n\t\t \ttotalEqualTermsStopwordsQueries++;\n\t\t }\n\t\t if (matchingTermsOrder==oldTerms.size()) {\n\t\t \ttotalEqualTermsOrderQueries++;\n\t\t }\n\t\t if (query.equals(oldQuery)) {\n\t\t \ttotalIdenticalQueries++;\n\t\t }\n\t\t if (sessionQueries.contains(query)) {\n\t\t \ttotalIdenticalSessionQueries++;\n\t\t }\n\t\t}\n\t\telse if (matchingTerms-matchingTermsStopwords>0) { // the queries have at least one term equal and diferent from a stopword\n\t\t totalModifiedQueries++;\n\t\t int index=newTerms.size()-oldTerms.size()+N_MODIFIED_TERMS_RANGE/2;\n\t\t if (index<0) {\n\t\t \tindex=0;\n\t\t }\n\t\t else if (index>N_MODIFIED_TERMS_RANGE-1) {\n\t\t \tindex=N_MODIFIED_TERMS_RANGE-1;\n\t\t }\n\t\t nModifiedTerms[index]++;\n\t\t}\n\t\toldQuery=query; \n\t\t\t\t\t\t\n\t\t// store session query\n\t\tsessionQueries.add(query);\n\t}", "abstract public TermEnum terms(Term t) throws IOException;", "public int getNatureFilter();", "@Override\n public int getDocumentFrequencyByTerm(String term) {\n return 0;\n }", "int getSimilarityThreshold(final int field);", "private double getTermOccurrence(String term, ClassificationClass classificationClass) {\n int termOccurrence = 0;\n\n for (Document document : documents) {\n if (document.getClassificationClasses().contains(classificationClass)) {\n if (document.getFeatures().containsKey(term)) {\n termOccurrence += document.getFeatures().get(term);\n }\n }\n }\n\n return termOccurrence;\n }", "@Override\n\t\tpublic int hashCode() {\n\t\t\treturn mTerm.hashCode();\n\t\t}", "private HashMap<String,HashMap<String,Integer>> computeTFForQueryWords(ArrayList<String> queryPostingLines) {\n HashMap<String,HashMap<String,Integer>> queryWordsTF = new HashMap<>();\n HashMap<String,HashMap<String,Integer>> queryWordsTFPerDoc = new HashMap<>();\n String docID,term;\n Integer tf;\n HashSet<String> docIDs = new HashSet<>();\n for(String postingLine : queryPostingLines){\n HashMap<String,Integer> frequenciesInDocuments = new HashMap<>();\n term = postingLine.substring(0,postingLine.indexOf(\"|\"));\n postingLine = postingLine.substring(postingLine.indexOf(\"|\")+1);\n while(!postingLine.equals(\"\")) {\n docID = postingLine.substring(0, postingLine.indexOf(\":\"));\n docIDs.add(docID);\n postingLine = postingLine.substring(postingLine.indexOf(\"_\") + 1);\n tf = Integer.valueOf(postingLine.substring(0, postingLine.indexOf(\"_\")));\n postingLine = postingLine.substring(postingLine.indexOf(\"_\") + 1);\n frequenciesInDocuments.put(docID,tf);\n }\n queryWordsTF.put(term,frequenciesInDocuments);\n }\n\n ArrayList<String> allTermsInQuery = new ArrayList<>(queryWordsTF.keySet());\n for(String doc : docIDs){\n HashMap<String,Integer> tfsInDoc = new HashMap<>();\n for(String termInQuery : allTermsInQuery){\n HashMap<String,Integer> termsTFInDoc = queryWordsTF.get(termInQuery);\n if(termsTFInDoc.containsKey(doc)){\n tfsInDoc.put(termInQuery,termsTFInDoc.get(doc));\n }\n }\n queryWordsTFPerDoc.put(doc,tfsInDoc);\n }\n return queryWordsTFPerDoc;\n }", "public abstract List<LambdaTerm> containedLambdaTerms(LambdaTerm P);", "public void theDude() {\n\t\ttotal_targets = 0;\n\t\ttotal = 0;\n\t\tint target_count = 0;\n\t\tresult.clear();\n\t\t\n\t\tfor(int k=0; k<input.getWords().size();k++) {\n\t\t\tWord currentWordStat = input.getWordStatistics().get(k);\n\t\t\ttarget_count = 0;\n\t\t\t\n\t\t\tfor(int i=0;i<input.getWords().get(k).length();i++) {\n\t\t\t\tif(target.contains(input.getWords().get(k).charAt(i))) {\n\t\t\t\t\ttarget_count++;\n\t\t\t\t\ttotal_targets++;\n\t\t\t\t}\n\t\t\t\ttotal++;\n\t\t\t}\n\t\t\t\n\t\t\tif(result.containsKey(currentWordStat)) {\n\t\t\t\tresult.put(currentWordStat, result.get(currentWordStat)+target_count);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tresult.put(currentWordStat, target_count);\n\t\t\t}\n\t\t}\t\n\t}", "public float getTFIDF(Index index, String word) {\n long docCount = index.getDocuments().stream().filter(document -> document.hasWord(word)).count();\n return (float) getWordOccurrence(word) * (float) Math.log((float) index.getDocuments().size() / (float) docCount);\n }", "public int getDocFreq(Term t){\n\t\tint freq = 0;\r\n\t\tfor (Map.Entry<String, IndexedDoc> set : index.entrySet()){\r\n\t\t\tif (set.getValue().containsTerm(t)){\r\n\t\t\t\tfreq++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn freq;\r\n\t}", "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 }", "@Override\n protected QueryProcessor computeResult(ResultComputingContext<? extends TermsIndexingEquipment> context) {\n final TermWeight idf = context.preliminaryResult(CalculatingInvertedTermFrequency.getInstance());\n final TermDocumentWeight tf = context.preliminaryResult(context.equipment().termFrequencyCalculation());\n //for obtaining set of terms in each document.\n final EachDocumentTermsExtraction documentsTerms = context.preliminaryResult(ExtractingEachDocumentTerms.getInstance());\n //for obtaining document length\n final Map<Document, TermsOccurences> termsOccurences = context.preliminaryResult(CountingTermsOccurencesInEachDocument.getInstance());\n final double averageDocLength = context.preliminaryResult(ComputingAverageDocumentLength.getInstance());\n\n QueryProcessor res = new QueryProcessor() {\n @Override\n public DocumentRanker rankForQuery(final Collection<String> query) {\n return new DocumentRanker() {\n @Override\n public double score(Document document) {\n /*\n * BM25 score is calculated here\n */\n\n //obtaining the set of terms in the document\n Set<String> allDocTerms = documentsTerms.termsExtractedFromDocument(document).allTerms();\n\n //keeping only the query terms that are in the document\n Collection<String> relevantTerms = new LinkedHashSet<>(query);\n relevantTerms.retainAll(allDocTerms);\n\n //compute score using a sum formula on each query term\n int docLength = termsOccurences.get(document).totalNumberOfOccurences();\n double score = 0.0;\n for (String term : relevantTerms) {\n double termIDF = idf.weight(term);\n double termTF = tf.weight(term, document);\n\n score += termIDF * (termTF * (k1 + 1)) / (termTF + k1 * (1 - b + b * (docLength / averageDocLength)));\n }\n\n return score;\n }\n };\n\n }\n };\n\n logger.log(Level.INFO, \"Just created a BM25 query processor with parameters : \" + \"k1={0}, b={1}\", new Object[]{k1, b});\n\n return res;\n }", "String legalTerms();", "void collectLeastFrequent(FrequencyTable fq);", "public Taxonomy getInterests();", "@Override\n protected double getTFDocument(BasicStats stats, float termFreq, float docLength) {\n return ((k1 + 1) * termFreq / (k1 * (1 - b +\n b * docLength / stats.getAvgFieldLength()) + termFreq));\n }", "public abstract void addFeatures(Collection<Integer> indices,Predicate pred,Word arg,Integer offset,boolean allWords);", "@Override\r\n\t\t\tpublic long getDocumentFrequency(String term) {\n\t\t\t\treturn 0;\r\n\t\t\t}", "public static HashMap<String, Double> getTFIDF(String inputStr) throws IOException{\n\t\tHashMap<String, Double> result = new HashMap<String, Double>();\n\t\tHashMap<String, Integer> termsMap = new HashMap<String, Integer>();\t\t\n\t\tArrayList<String> inputTerms = getTerms(inputStr);\n\t\t\n\t\tfor(String s : inputTerms){\n\t\t\tif(termsMap.containsKey(s) != true){\n\t\t\t\ttermsMap.put(s, 1);\n\t\t\t}else{\n\t\t\t\ttermsMap.put(s, termsMap.get(s)+1);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(String term : termsMap.keySet()){\n\t\t\tdouble TF;\n\t\t\t//System.out.println(term + \" \" + termsMap.get(term));\t\t\t\t\n\t\t\tTF = (double)termsMap.get(term)/inputTerms.size();\n\t\t\tresult.put(term, TF*cal_IDF(term));\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public static void main(String[] args) throws Exception {\n\t\tint i;\r\n\t\tint [][]preci_recall = new int [5][6]; \r\n\r\n\t\tNGRAM ngram = new NGRAM();\r\n\t\t\r\n\t\tfor(i=0; i<5; i++) {\r\n\t\t\t\r\n\t\t\tSystem.out.println((i+1) + \" th FOLD IS A TEST SET\");\r\n\t\t\t\r\n\t\t\tdouble[][] test_ngram_features = ngram.feature(i,1);\r\n\t\t\tdouble[][] train_ngram_features = ngram.feature(i,0);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"NGRAM FEATURES...OK\");\r\n\t\r\n//\t\t\t\r\n//\t\t\tLIWC liwc = new LIWC();\r\n//\t\t\t\r\n//\t\t\tdouble[][] test_liwc_features = liwc.feature(i,1,test_ngram_features.length);\r\n//\t\t\tdouble[][] train_liwc_features = liwc.feature(i,0,train_ngram_features.length);\r\n//\r\n//\t\t\tSystem.out.println(\"LIWC FEATURES..OK\");\r\n//\t\t\t\r\n//\t\t\tCOMBINE combine = new COMBINE();\r\n//\t\t\tdouble[][] train_features = combine.sum(train_liwc_features,train_ngram_features);\r\n//\t\t\tdouble[][] test_features = combine.sum(test_liwc_features,test_ngram_features);\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"COMBINE...OK\");\r\n\t\t\r\n\t\t\tSVMLIGHT svmlight = new SVMLIGHT();\r\n\t\t\tpreci_recall[i]=svmlight.calcc(train_ngram_features, test_ngram_features);\r\n\r\n\t\t}\r\n\t\t\r\n//\t 0 : truthful TP\r\n//\t 1 : truthful TP+FP\r\n//\t 2 : truthful TP+FN\r\n//\t 3 : deceptive TP\r\n//\t 4 : deceptive TP+FP\r\n//\t 5 : deceptive TP+FN\r\n\t\t\r\n\t\tint truthful_TP_sum=0,truthful_TPFP_sum=0,truthful_TPFN_sum=0;\r\n\t\tint deceptive_TP_sum=0,deceptive_TPFP_sum=0,deceptive_TPFN_sum=0;\r\n\t\t\r\n\t\tfor(i=0;i<5;i++) {\r\n\t\t\ttruthful_TP_sum+=preci_recall[i][0];\r\n\t\t\ttruthful_TPFP_sum+=preci_recall[i][1];\r\n\t\t\ttruthful_TPFN_sum+=preci_recall[i][2];\r\n\t\t\t\r\n\t\t\tdeceptive_TP_sum+=preci_recall[i][3];\r\n\t\t\tdeceptive_TPFP_sum+=preci_recall[i][4];\r\n\t\t\tdeceptive_TPFN_sum+=preci_recall[i][5];\r\n\t\t}\r\n\t\t\t\t\r\n\t\tSystem.out.println(\"\\n\\nTRUTHFUL_TP_SUM : \" + truthful_TP_sum);\r\n\t\tSystem.out.println(\"TRUTHFUL_TPFP_SUM : \" + truthful_TPFP_sum);\r\n\t\tSystem.out.println(\"TRUTHFUL_TPFN_SUM : \" + truthful_TPFN_sum);\r\n\t\t\r\n\t\tSystem.out.println(\"DECEPTIVE_TP_SUM : \" + deceptive_TP_sum);\r\n\t\tSystem.out.println(\"DECEPTIVE_TPFP_SUM : \" + deceptive_TPFP_sum);\r\n\t\tSystem.out.println(\"DECEPTIVE_TPFN_SUM : \" + deceptive_TPFN_sum);\r\n\t\t\r\n\t\tSystem.out.println(\"\\nTRUTHFUL PRECISION : \" + (double)(truthful_TP_sum)/(double)(truthful_TPFP_sum));\r\n\t\tSystem.out.println(\"TRUTHFUL RECALL : \" + (double)(truthful_TP_sum)/(double)(truthful_TPFN_sum));\r\n\t\t\r\n\t\tSystem.out.println(\"DECEPTIVE PRECISION : \" + (double)(deceptive_TP_sum)/(double)(deceptive_TPFP_sum));\r\n\t\tSystem.out.println(\"DECEPTIVE RECALL : \" + (double)(deceptive_TP_sum)/(double)(deceptive_TPFN_sum));\r\n\t\t\r\n\r\n\t}", "public int getTermTotal(){\n\t\tint total = 0;\r\n\t\tfor (Map.Entry<String, IndexedDoc> set : index.entrySet()){\r\n\t\t\ttotal += set.getValue().getTotalTerms();\r\n\t\t}\r\n\t\treturn total;\r\n\t}", "private boolean classify(FeatureVector<? extends Number> wd) {\n\t\tfloat sum = 0;\n\t\t// Scalar Product\n\t\tfor (int i = 0; i < this.getDimensionality(); ++i) {\n\t\t\t// TODO check the type of the vector\n\t\t\tsum += wd.getValue(i).doubleValue()\n\t\t\t\t\t* this.getValue(i).doubleValue();\n\t\t}\n\n\t\t// sign binary function\n\t\tif (sum <= 0) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public void fillHandBuilt(Indexer index, String [] terms) {\n\t\tindex.addPosition(terms[0], 3, 1); // ar Term, docID, pos\n\t\tindex.addPosition(terms[1], 2, 4); // british\n\t\tindex.addPosition(terms[2], 3, 3); // dog\n\t\tindex.addPosition(terms[2], 4, 0); // dog\n\t\tindex.addPosition(terms[2], 4, 3); // dog\n\t\tindex.addPosition(terms[3], 4, 1); // enjoi\n\t\tindex.addPosition(terms[4], 0, 6); // enjoy\n\t\tindex.addPosition(terms[5], 1, 5); // in, potential error\n\t\tindex.addPosition(terms[5], 3, 4); // in\n\t\tindex.addPosition(terms[6], 1, 4); // is, potential error\n\t\tindex.addPosition(terms[7], 1, 1); // known\n\t\tindex.addPosition(terms[8], 3, 2); // mani\n\t\tindex.addPosition(terms[9], 0, 1); // monument\n\t\tindex.addPosition(terms[9], 1, 3); // monument potential error\n\t\tindex.addPosition(terms[10], 0, 3); // on\n\t\tindex.addPosition(terms[10], 2, 2); // on\n\t\tindex.addPosition(terms[11], 0, 4); // park\n\t\tindex.addPosition(terms[11], 4, 4); // park\n\t\tindex.addPosition(terms[12], 0, 2); // raid\n\t\tindex.addPosition(terms[12], 2, 1); // raid\n\t\tindex.addPosition(terms[13], 3, 5); // seattl\n\t\tindex.addPosition(terms[14], 0, 0); // the\n\t\tindex.addPosition(terms[14], 1, 0); // the\n\t\tindex.addPosition(terms[14], 2, 3); // the\n\t\tindex.addPosition(terms[14], 4, 2); // the\n\t\tindex.addPosition(terms[15], 3, 0); // there\n\t\tindex.addPosition(terms[16], 0, 5); // wa\n\t\tindex.addPosition(terms[17], 1, 2); // washington potential error\n\t\tindex.addPosition(terms[17], 2, 6); // washington potential error\n\t\tindex.addPosition(terms[17], 2, 0); // washington\n\t\tindex.addPosition(terms[17], 3, 6); // washington\n\t\tindex.addPosition(terms[18], 1, 1); // well potential error\n\t\tindex.addPosition(terms[18], 2, 6); // well \n\t\tindex.addPosition(terms[19], 1, 1); // wellknown\n\t\tindex.addPosition(terms[20], 2, 6); // went\n\t}", "int indexOfFeature(Feature feature);", "private static void banFeature(ArrayList t) {\n\t\tSet setKeys = Utility.vocabHM.keySet();\n\t\tIterator i = setKeys.iterator();\n\t\tSystem.out.print(\"Word cut : [\");\n\t\tint idx = 0;\n\t\twhile (i.hasNext()) {\n\t\t\tString s = (String) i.next();\n\t\t\tInteger df = (Integer) Utility.vocabHM.get(s);\n\n\t\t\tif (t.contains(s)){\n\t\t\t\tSystem.out.print(s+\", \");\n\t\t\t\ti.remove();\n\t\t\t\tidx++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"]\\n ::banned::\"+idx+\" feature.\");\n\t}", "public void translate() {\n\t\tif(!init)\r\n\t\t\treturn; \r\n\t\ttermPhraseTranslation.clear();\r\n\t\t// document threshold: number of terms / / 8\r\n//\t\tdocThreshold = (int) (wordKeyList.size() / computeAvgTermNum(documentTermRelation) / 8.0);\r\n\t\t//\t\tuseDocFrequency = true;\r\n\t\tint minFrequency=1;\r\n\t\temBkgCoefficient=0.5;\r\n\t\tprobThreshold=0.001;//\r\n\t\titerationNum = 20;\r\n\t\tArrayList<Token> tokenList;\r\n\t\tToken curToken;\r\n\t\tint j,k;\r\n\t\t//p(w|C)\r\n\r\n\t\tint[] termValues = termIndexList.values;\r\n\t\tboolean[] termActive = termIndexList.allocated;\r\n\t\ttotalCollectionCount = 0;\r\n\t\tfor(k=0;k<termActive.length;k++){\r\n\t\t\tif(!termActive[k])\r\n\t\t\t\tcontinue;\r\n\t\t\ttotalCollectionCount +=termValues[k];\r\n\t\t}\r\n\t\t\r\n\t\t// for each phrase\r\n\t\tint[] phraseFreqKeys = phraseFrequencyIndex.keys;\r\n\t\tint[] phraseFreqValues = phraseFrequencyIndex.values;\r\n\t\tboolean[] states = phraseFrequencyIndex.allocated;\r\n\t\tfor (int phraseEntry = 0;phraseEntry<states.length;phraseEntry++){\r\n\t\t\tif(!states[phraseEntry]){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (phraseFreqValues[phraseEntry] < minFrequency)\r\n\t\t\t\tcontinue;\r\n\t\t\ttokenList=genSignatureTranslation(phraseFreqKeys[phraseEntry]); // i is phrase number\r\n\t\t\tfor (j = 0; j <tokenList.size(); j++) {\r\n\t\t\t\tcurToken=(Token)tokenList.get(j);\r\n\t\t\t\tif(termPhraseTranslation.containsKey(curToken.getIndex())){\r\n\t\t\t\t\tIntFloatOpenHashMap old = termPhraseTranslation.get(curToken.getIndex());\r\n\t\t\t\t\tif(old.containsKey(phraseFreqKeys[phraseEntry])){\r\n\t\t\t\t\t\tSystem.out.println(\"aha need correction\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\told.put(phraseFreqKeys[phraseEntry], (float) curToken.getWeight()); //phrase, weight\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tIntFloatOpenHashMap newPhrase = new IntFloatOpenHashMap();\r\n\t\t\t\t\tnewPhrase.put(phraseFreqKeys[phraseEntry], (float) curToken.getWeight());\r\n\t\t\t\t\ttermPhraseTranslation.put(curToken.getIndex(), newPhrase);\r\n\t\t\t\t}\r\n\t\t\t\t//\t\t\t\toutputTransMatrix.add(i,curToken.getIndex(),curToken.getWeight());\r\n\t\t\t\t//\t\t\t\toutputTransTMatrix.add(curToken.getIndex(), i, curToken.getWeight());\r\n\t\t\t\t//TODO termPhrase exists, create PhraseTerm\r\n\t\t\t}\r\n\t\t\ttokenList.clear();\r\n\t\t}\r\n\r\n\t}", "private void calculateIDF2Values() throws IOException {\n\t\tfor (int i = 0; i < getTfMapArrayIDF().size(); i++) {\n\t\t\tList<Map<String, List<Double>>> gestureDocument = getTfMapArrayIDF()\n\t\t\t\t\t.get(i);\n\t\t\tMap<String, Double> idf2PerDocument = getTfMapArrayIDF2().get(i);\n\n\t\t\tfor (int j = 0; j < gestureDocument.size(); j++) {\n\t\t\t\tMap<String, List<Double>> tempMap = gestureDocument.get(j);\n\t\t\t\tIterator<Entry<String, List<Double>>> it = tempMap.entrySet()\n\t\t\t\t\t\t.iterator();\n\t\t\t\twhile (it.hasNext()) {\n\t\t\t\t\tMap.Entry<String, List<Double>> pairs = (Map.Entry) it\n\t\t\t\t\t\t\t.next();\n\t\t\t\t\tDouble inverse = (new Double(getTfMapArrayIDF().get(0)\n\t\t\t\t\t\t\t.size()) / idf2PerDocument.get(pairs.getKey())); // already\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// inversse\n\t\t\t\t\tList<Double> tf = pairs.getValue();\n\t\t\t\t\ttf.set(2,Math.log(inverse));\n\t\t\t\t\ttf.set(3,tf.get(0) * tf.get(1)); //tf-idf\n\t\t\t\t\tidfValues.add(tf.get(1));\n\t\t\t\t\ttf.set(4,tf.get(0) * tf.get(2)); //tf-idf2\n\t\t\t\t\tidf2Values.add(tf.get(2));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void evaluationLogic() {\n // setup for logic:\n // if distToClosestEstimate[i][0] is smaller than threshold, we have a Tp\n // if distToClosestEstimate[i][0] is larger than threshold, we have a Fn\n // all estimatedFeatures that are not assigned Tp are therefore Fp\n for (int i = 0; i < groundTruthInstant.size(); ++i) {\n if (distToClosestEstimate[i][0] < truePositiveThreshold) {\n ++truePositiveCount;\n int assignedEstimatedFeature = (int) distToClosestEstimate[i][1];\n assignedEstimatedFeatures[assignedEstimatedFeature] = true;\n } else\n ++falseNegativeCount;\n }\n for (int i = 0; i < estimatedInstant.size(); ++i)\n if (!assignedEstimatedFeatures[i])\n ++falsePositiveCount;\n }", "static double binarySearchForBuckets (double[] splits, double feature, boolean keepInvalid) { throw new RuntimeException(); }", "abstract public TermEnum terms() throws IOException;", "public abstract double score(double tf, double docLength, double precomp);", "boolean isIndexed();", "boolean isIndexed();", "@Override\n public double classify(String[] words) {\n if (words == null || words.length == 0) {\n throw new IllegalArgumentException(\"words must not be null or empty\");\n }\n return Activation.SIGMOID.apply(bias + dotProduct(words));\n }", "public Map<Integer, Boolean> testCategorization(String topic, String[] features) {\n\n\t\tint n = trainingSet.size(); // Count docs.\n\n\t\t// Count docs in class.\n\t\tint nc = 0;\n\t\tfor (Integer id : trainingSet) {\n\t\t\tboolean inClass = this.getDocument(id).getTopics().contains(topic);\n\t\t\tif (inClass)\n\t\t\t\tnc++;\n\t\t}\n\n\t\tdouble prior_c = nc / (double) n;\n\t\tdouble prior_cbar = (n - nc) / (double) n;\n\n\t\tMap<String, Double> condProb_c = new HashMap<String, Double>();\n\t\tMap<String, Double> condProb_cbar = new HashMap<String, Double>();\n\n\t\t// Count docs in class containing term.\n\t\tfor (String term : features) {\n\t\t\tSet<Integer> postings = terms.get(term).getPostings().keySet();\n\t\t\tint nct_c = 0, nct_cbar = 0;\n\t\t\tfor (Integer id : trainingSet) {\n\t\t\t\tboolean inClass = this.getDocument(id).getTopics().contains(topic);\n\t\t\t\tif (postings.contains(id)) { // document contains the term\n\t\t\t\t\tif (inClass)\n\t\t\t\t\t\tnct_c++;\n\t\t\t\t\telse\n\t\t\t\t\t\tnct_cbar++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// And calculate conditional probabilities.\n\t\t\tcondProb_c.put(term, (nct_c + 1) / (double) (nc + 2));\n\t\t\tcondProb_cbar.put(term, (nct_cbar + 1) / (double) ((n - nc) + 2));\n\t\t}\n\n\t\t// ---APPLY BERNOULLI----\n\n\t\tMap<Integer, Boolean> marked = new HashMap<Integer, Boolean>();\n\t\tfor (Integer id : testSet) {\n\t\t\tdouble score_c = Math.log(prior_c);\n\t\t\tdouble score_cbar = Math.log(prior_cbar);\n\t\t\tfor (String term : features) {\n\t\t\t\tSet<Integer> postings = terms.get(term).getPostings().keySet();\n\t\t\t\tif (postings.contains(id)) {\n\t\t\t\t\tscore_c += Math.log(condProb_c.get(term));\n\t\t\t\t\tscore_cbar += Math.log(condProb_cbar.get(term));\n\t\t\t\t} else {\n\t\t\t\t\tscore_c += Math.log(1 - condProb_c.get(term));\n\t\t\t\t\tscore_cbar += Math.log(1 - condProb_cbar.get(term));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (score_c > score_cbar)\n\t\t\t\tmarked.put(id, true);\n\t\t\telse\n\t\t\t\tmarked.put(id, false);\n\t\t}\n\t\treturn marked;\n\t}", "public Object eval(Individual ind)\r\n {\r\n BinaryIndividual bi = (BinaryIndividual)ind;\r\n int partialFitness = 0;\r\n int distance = 0;\r\n double fitness = 0.0;\r\n\r\n\t for (int i=0; i<100; i++){\r\n\r\n\t distance = 0;\r\n\r\n\t for (int j=0; j<100; j++){\r\n\t if (!((BinaryIndividual)target[i]).getBooleanAllele(j)^bi.getBooleanAllele(j)) { \r\n\t\t distance++;\r\n\t }\r\n \r\n\t if (distance > partialFitness) {\r\n\t partialFitness = distance;\r\n\t }\r\n\t }\r\n }\r\n\r\n fitness = (double)partialFitness/100.0;\r\n return new Double(fitness);\r\n \r\n\r\n }", "private static List<SearchData> booleanSearchFrequency(Query query, Indexer si) {\n Tokenizer tkn = new SimpleTokenizer();\n tkn.tokenize(query.getStr(), \"[a-zA-Z]{3,}\", true, true);\n List<SearchData> searchList = new ArrayList<>();\n LinkedList<Token> wordsList = tkn.getTokens();\n Iterator<Token> wordsIt = wordsList.iterator();\n HashMap<String, LinkedList<Posting>> indexer = si.getIndexer();\n int idx;\n SearchData searched_doc;\n\n while (wordsIt.hasNext()) {\n String word = wordsIt.next().getSequence();\n if (indexer.containsKey(word)) {\n\n LinkedList<Posting> posting = indexer.get(word);\n\n for (Posting pst : posting) {\n\n SearchData sd = new SearchData(query, pst.getDocId());\n\n if (!searchList.contains(sd)) {\n sd.setScore(pst.getTermFreq());\n searchList.add(sd);\n } else {\n idx = searchList.indexOf(sd);\n searched_doc = searchList.get(idx);\n searched_doc.setScore(searched_doc.getScore() + pst.getTermFreq());\n }\n }\n }\n }\n\n Collections.sort(searchList);\n\n return searchList;\n }", "public int getIDFScore(String term) { \r\n\t\tif (map.containsKey(term) == false)\r\n\t\t\treturn 0;\r\n\t\treturn map.get(term).size();\r\n\t}", "public interface Term {\n\t\n\t/**\n\t * Get the coefficient of a term\n\t * @return the coefficient \n\t */\n\tpublic double getCoefficient();\n\t\n\t/**\n\t * Get the exponent of a term\n\t * @return the exponent\n\t */\n\tpublic int getExponent();\n\t\n\t/**\n\t * Evaluate a term by a given value. c = constant, a(c)^n \n\t * @param x The value to be evaluated \n\t * @return The result of the evaluated term \n\t */\n\tpublic double evaluate(double x);\n\t\n}", "public void setTerm(java.lang.Integer value) {\n this.term = value;\n }", "public double idfCalculator(String targetWord, List<List<String>> tokenizedDescriptionCollection) {\n // indicator if the List<String> uniqueWordCollection contains the String targetWord\n // indicator can only be 1 or 0\n // 1: indicates List<String> uniqueWordCollection contains the target word\n // 0: indicates List<String> uniqueWordCollection does not contain the target word\n double totalCount = 0.0;\n for (List<String> uniqueWordCollection : tokenizedDescriptionCollection) {\n double indicator = 0.0;\n for (String word : uniqueWordCollection) {\n if (word.equals(targetWord)) {\n indicator++;\n break; // break statement is needed since indicator is either 0 or 1\n }\n }\n totalCount += indicator;\n }\n return Math.log10( (1 + tokenizedDescriptionCollection.size()) / (1 + totalCount) ) + 1;\n }", "public static void main(String[] args) throws Exception \n\t{\n\t\tList<String> stopWords = new ArrayList<String>();\n\t\tstopWords = stopWordsCreation();\n\n\n\t\t\n\t\tHashMap<Integer, String> hmap = new HashMap<Integer, String>();\t//Used in tittle, all terms are unique, and any dups become \" \"\n\t\n\t\t\n\t\tList<String> uniqueTerms = new ArrayList<String>();\n\t\tList<String> allTerms = new ArrayList<String>();\n\t\t\t\t\n\t\t\n\t\tHashMap<Integer, String> hmap2 = new HashMap<Integer, String>();\n\t\tHashMap<Integer, String> allValues = new HashMap<Integer, String>();\n\t\tHashMap<Integer, Double> docNorms = new HashMap<Integer, Double>();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tMap<Integer, List<String>> postingsFileListAllWords = new HashMap<>();\t\t\n\t\tMap<Integer, List<String>> postingsFileList = new HashMap<>();\n\t\t\n\t\tMap<Integer, List<StringBuilder>> docAndTitles = new HashMap<>();\n\t\tMap<Integer, List<StringBuilder>> docAndAbstract = new HashMap<>();\n\t\tMap<Integer, List<StringBuilder>> docAndAuthors = new HashMap<>();\n\t\t\n\t\t\n\t\tMap<Integer, List<Double>> termWeights = new HashMap<>();\n\t\t\n\t\tList<Integer> docTermCountList = new ArrayList<Integer>();\n\t\t\n\t\tBufferedReader br = null;\n\t\tFileReader fr = null;\n\t\tString sCurrentLine;\n\n\t\tint documentCount = 0;\n\t\tint documentFound = 0;\n\t\tint articleNew = 0;\n\t\tint docTermCount = 0;\n\t\t\n\t\t\n\t\tboolean abstractReached = false;\n\n\t\ttry {\n\t\t\tfr = new FileReader(FILENAME);\n\t\t\tbr = new BufferedReader(fr);\n\n\t\t\t// Continues to get 1 line from document until it reaches the end of EVERY doc\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) \n\t\t\t{\n\t\t\t\t// sCurrentLine now contains the 1 line from the document\n\n\t\t\t\t// Take line and split each word and place them into array\n\t\t\t\tString[] arr = sCurrentLine.split(\" \");\n\n\n\t\t\t\t//Go through the entire array\n\t\t\t\tfor (String ss : arr) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t * This section takes the array and checks to see if it has reached a new\n\t\t\t\t\t * document or not. If the current line begins with an .I, then it knows that a\n\t\t\t\t\t * document has just started. If it incounters another .I, then it knows that a\n\t\t\t\t\t * new document has started.\n\t\t\t\t\t */\n\t\t\t\t\t//System.out.println(\"Before anything: \"+sCurrentLine);\n\t\t\t\t\tif (arr[0].equals(\".I\")) \n\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\tif (articleNew == 0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarticleNew = 1;\n\t\t\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\t\t\t\t\t\t} \n\t\t\t\t\t\telse if (articleNew == 1) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarticleNew = 0;\n\t\t\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t//System.out.println(documentFound);\n\t\t\t\t\t\t//count++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/* This section detects that after a document has entered,\n\t\t\t\t\t * it has to gather all the words contained in the title \n\t\t\t\t\t * section.\n\t\t\t\t\t */\n\t\t\t\t\tif (arr[0].equals(\".T\") ) \n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Go to line UNDER .T since that is where tittle is located\n\t\t\t\t\t\t//sCurrentLine = br.readLine();\n\t\t\t\t\t\tdocAndTitles.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\t\t\tStringBuilder title = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".B|.A|.N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\t\t/* In this section, there are 2 lists being made. One list\n\t\t\t\t\t\t\t * is for all the unique words in every title in the document (hmap).\n\t\t\t\t\t\t\t * Hmap contains all unique words, and anytime a duplicate word is \n\t\t\t\t\t\t\t * found, it is replaced with an empty space in the map.\n\t\t\t\t\t\t\t * All Values \n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//postingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\t\t\t//postingsFileList.get(documentFound - 1).add(term2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"current line: \"+sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] tittle = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (tittle[0].equals(\".W\") )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\tabstractReached = true;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttitle.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (String tittleWords : tittle)\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.toLowerCase();\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'{}*|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'*{}|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'{}*|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\t//System.out.println(tittleWords);\n\t\t\t\t\t\t\t\tif (hmap.containsValue(tittleWords)) \n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, \" \");\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\tallTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tallTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\tif (!(uniqueTerms.contains(tittleWords)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ((stopWordsSetting && !(stopWords.contains(tittleWords))))\n\t\t\t\t\t\t\t\t\t\t\tuniqueTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\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//docAndTitles.get(documentCount).add(\" \");\n\t\t\t\t\t\t\ttitle.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"Title: \"+title);\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\tdocAndTitles.get(documentFound).add(title);\n\t\t\t\t\t\t//System.out.println(\"Done!: \"+ docAndTitles);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (arr[0].equals(\".A\") ) \n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Go to line UNDER .T since that is where tittle is located\n\t\t\t\t\t\t//sCurrentLine = br.readLine();\n\t\t\t\t\t\tdocAndAuthors.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\t\t\tStringBuilder author = new StringBuilder();\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\twhile ( !(sCurrentLine = br.readLine()).matches(\".N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* In this section, there are 2 lists being made. One list\n\t\t\t\t\t\t\t * is for all the unique words in every title in the document (hmap).\n\t\t\t\t\t\t\t * Hmap contains all unique words, and anytime a duplicate word is \n\t\t\t\t\t\t\t * found, it is replaced with an empty space in the map.\n\t\t\t\t\t\t\t * All Values \n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//postingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\t\t\t//postingsFileList.get(documentFound - 1).add(term2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"current line: \"+sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] tittle = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (tittle[0].equals(\".W\") )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\tabstractReached = true;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tauthor.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//docAndTitles.get(documentCount).add(\" \");\n\t\t\t\t\t\t\tauthor.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"Title: \"+title);\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\tdocAndAuthors.get(documentFound).add(author);\n\t\t\t\t\t\t//System.out.println(\"Done!: \"+ docAndTitles);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/* Since there may or may not be an asbtract after\n\t\t\t\t\t * the title, we need to check what the next section\n\t\t\t\t\t * is. We know that every doc has a publication date,\n\t\t\t\t\t * so it can end there, but if there is no abstract,\n\t\t\t\t\t * then it will keep scanning until it reaches the publication\n\t\t\t\t\t * date. If abstract is empty (in tests), it will also finish instantly\n\t\t\t\t\t * since it's blank and goes straight to .B (the publishing date).\n\t\t\t\t\t * Works EXACTLY like Title \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 (abstractReached) \n\t\t\t\t\t{\t\n\t\t\t\t\t\t//System.out.println(\"\\n\");\n\t\t\t\t\t\t//System.out.println(\"REACHED ABSTRACT and current line is: \" +sCurrentLine);\n\t\t\t\t\t\tdocAndAbstract.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\tStringBuilder totalAbstract = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".T|.I|.A|.N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tString[] abstaract = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (abstaract[0].equals(\".B\") )\n\t\t\t\t\t\t\t{\t\t\t\n\t\t\t\t\t\t\t\tabstractReached = false;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttotalAbstract.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] misc = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tfor (String miscWords : misc) \n\t\t\t\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\tmiscWords = miscWords.toLowerCase(); \n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|?{}!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\t\t\n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\t\t\n\t\t\t\t\t\t\t\t//System.out.println(miscWords);\n\t\t\t\t\t\t\t\tif (hmap.containsValue(miscWords)) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, \" \");\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tallTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\n\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tallTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tif (!(uniqueTerms.contains(miscWords)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ((stopWordsSetting && !(stopWords.contains(miscWords))))\n\t\t\t\t\t\t\t\t\t\t\tuniqueTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\ttotalAbstract.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocAndAbstract.get(documentFound).add(totalAbstract);\n\t\t\t\t\t}\n\t\t\t\t\t\n\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\n\t\t\t\t//Once article is found, we enter all of of it's title and abstract terms \n\t\t\t\tif (articleNew == 0) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tdocumentFound = documentFound - 1;\n\t\t\t\t\t//System.out.println(\"Words found in Doc: \" + documentFound);\n\t\t\t\t\t//System.out.println(\"Map is\" +allValues);\n\t\t\t\t\tSet set = hmap.entrySet();\n\t\t\t\t\tIterator iterator = set.iterator();\n\n\t\t\t\t\tSet set2 = allValues.entrySet();\n\t\t\t\t\tIterator iterator2 = set2.iterator();\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tpostingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\tpostingsFileListAllWords.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\t\tMap.Entry mentry = (Map.Entry) iterator.next();\n\t\t\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// (\"Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// );\n\t\t\t\t\t\tString term = mentry.getValue().toString();\n\t\t\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\t\t\tpostingsFileList.get(documentFound - 1).add(term);\n\t\t\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t\t\tdocTermCount++;\n\t\t\t\t\t}\n\t\t\t\t\t// \"BEFORE its put in, this is what it looks like\" + hmap);\n\t\t\t\t\thmap2.putAll(hmap);\n\t\t\t\t\thmap.clear();\n\t\t\t\t\tarticleNew = 1;\n\n\t\t\t\t\tdocTermCountList.add(docTermCount);\n\t\t\t\t\tdocTermCount = 0;\n\n\t\t\t\t\twhile (iterator2.hasNext()) {\n\t\t\t\t\t\tMap.Entry mentry2 = (Map.Entry) iterator2.next();\n\t\t\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// (\"Value2 is: \" + mentry2.getValue());\n\t\t\t\t\t\t// );\n\t\t\t\t\t\tString term = mentry2.getValue().toString();\n\t\t\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\t\t\tpostingsFileListAllWords.get(documentFound - 1).add(term);\n\t\t\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t\t\t// docTermCount++;\n\t\t\t\t\t}\n\n\t\t\t\t\tallValues.clear();\t\t\t\t\t\n\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\n\t\t\t\t\t// \"MEANWHILE THESE ARE ALL VALUES\" + postingsFileListAllWords);\n\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Looking at final doc!\");\n\t\t\t//Final loop for last sets\n\t\t\tSet set = hmap.entrySet();\n\t\t\tIterator iterator = set.iterator();\n\n\t\t\tSet setA = allValues.entrySet();\n\t\t\tIterator iteratorA = setA.iterator();\n\t\t\tpostingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\tpostingsFileListAllWords.put(documentFound - 1, new ArrayList<String>());\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tMap.Entry mentry = (Map.Entry) iterator.next();\n\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t// (\"Value is: \" + mentry.getValue());\n\t\t\t\t// //);\n\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\tString term2 = mentry.getValue().toString();\n\t\t\t\tpostingsFileList.get(documentFound - 1).add(term2);\n\n\t\t\t\tdocTermCount++;\n\t\t\t}\n\t\t\t//System.out.println(\"Done looking at final doc!\");\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Sorting time!\");\n\t\t\twhile (iteratorA.hasNext()) {\n\t\t\t\tMap.Entry mentry2 = (Map.Entry) iteratorA.next();\n\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t// (\"Value2 is: \" + mentry2.getValue());\n\t\t\t\t// //);\n\t\t\t\tString term = mentry2.getValue().toString();\n\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\tpostingsFileListAllWords.get(documentFound - 1).add(term);\n\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t// docTermCount++;\n\t\t\t}\n\n\t\t\thmap2.putAll(hmap);\n\t\t\thmap.clear();\n\t\t\tdocTermCountList.add(docTermCount);\n\t\t\tdocTermCount = 0;\n\n\n\t\t\t\n\t\t\n\t\t\t// END OF LOOKING AT ALL DOCS\n\t\t\t\n\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\n\t\t\t//System.out.println(\"All terms\" +allTerms);\n\t\t\tString[] sortedArray = allTerms.toArray(new String[0]);\n\t\t\tString[] sortedArrayUnique = uniqueTerms.toArray(new String[0]);\n\t\t\t//System.out.println(Arrays.toString(sortedArray));\n\t\t\t\n\t\t\tArrays.sort(sortedArray);\n\t\t\tArrays.sort(sortedArrayUnique);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//Sortings \n\t\t\tSet set3 = hmap2.entrySet();\n\t\t\tIterator iterator3 = set3.iterator();\n\n\t\t\t// Sorting the map\n\t\t\t//System.out.println(\"Before sorting \" +hmap2);\t\t\t\n\t\t\tMap<Integer, String> map = sortByValues(hmap2);\n\t\t\t//System.out.println(\"after sorting \" +map);\n\t\t\t// //\"After Sorting:\");\n\t\t\tSet set2 = map.entrySet();\n\t\t\tIterator iterator2 = set2.iterator();\n\t\t\tint docCount = 1;\n\t\t\twhile (iterator2.hasNext()) {\n\t\t\t\tMap.Entry me2 = (Map.Entry) iterator2.next();\n\t\t\t\t// (me2.getKey() + \": \");\n\t\t\t\t// //me2.getValue());\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(\"Done sorting!\");\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Posting starts \");\n\t\t\t//\"THIS IS START OF DICTIONARTY\" \n\t\t\tBufferedWriter bw = null;\n\t\t\tFileWriter fw = null;\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Start making an array thats big as every doc total \");\n\t\t\tfor (int z = 1; z < documentFound+1; z++)\n\t\t\t{\n\t\t\t\ttermWeights.put(z, new ArrayList<Double>());\n\t\t\t}\n\t\t\t//System.out.println(\"Done making that large array Doc \");\n\t\t\t\n\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\n\t\t\t//System.out.println(\"All terms\" +allTerms)\n\t\t\t//System.out.println(Arrays.toString(sortedArray));\n\t\t\t//System.out.println(Arrays.toString(sortedArrayUnique));\n\t\t\t//System.out.println(uniqueTerms);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//\tSystem.out.println(\"Posting starts \");\n\t\t\t// \tPOSTING FILE STARTS \n\t\t\ttry {\n\t\t\t\t// Posting File\n\t\t\t\t//System.out.println(\"postingsFileListAllWords: \"+postingsFileListAllWords); //Contains every word including Dups, seperated per doc\n\t\t\t\t//System.out.println(\"postingsFileList: \"+postingsFileList); \t\t //Contains unique words, dups are \" \", seperated per doc\n\t\t\t\t//System.out.println(\"postingsFileListAllWords.size(): \" +postingsFileListAllWords.size()); //Total # of docs \n\t\t\t\t//System.out.println(\"Array size: \"+sortedArrayUnique.length);\n\n\t\t\t\tfw = new FileWriter(POSTING);\n\t\t\t\tbw = new BufferedWriter(fw);\n\t\t\t\tString temp = \" \";\n\t\t\t\tDouble termFreq = 0.0;\n\t\t\t\t// //postingsFileListAllWords);\n\t\t\t\tList<String> finalTermList = new ArrayList<String>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t// //postingsFileList.get(i).size());\n\t\t\t\t\tfor (int j = 0; j < sortedArrayUnique.length; ++j)\t\t\t\t\t // go thru each word, CURRENT TERM\n\t\t\t\t\t{\n\t\t\t\t\t\t//System.out.println(\"Term is: \" + sortedArrayUnique[j]);\n\t\t\t\t\t\ttemp = sortedArrayUnique[j];\t\t\t\t\t\n\t\t\t\t\t\tif ((stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!(finalTermList.contains(temp))) \n\t\t\t\t\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\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//PART TO FIND DOCUMENT FREQ\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint docCountIDF = 0;\n\t\t\t\t\t\t\t//Start here for dictionary \n\t\t\t\t\t\t\tfor (int totalWords = 0; totalWords < sortedArray.length; totalWords++) \t\t\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (temp.compareTo(\" \") == 0 || (stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//EITHER BLANK OR STOPWORD \n\t\t\t\t\t\t\t\t\t//System.out.println(\"fOUND STOP WORD\");\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tString temp2 = sortedArray[totalWords];\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Compare: \"+temp+ \" with \" +temp2);\n\t\t\t\t\t\t\t\t\tif (temp.compareTo(temp2) == 0) {\n\t\t\t\t\t\t\t\t\t\t// (temp2+\" \");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tdocCountIDF++;\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//System.out.println(\"Total Number: \" +docCountIDF);\n\t\t\t\t\t\t\t//System.out.println(\"documentFound: \" +documentFound);\n\t\t\t\t\t\t\t//System.out.println(\"So its \" + documentFound + \" dividied by \" +docCountIDF);\n\t\t\t\t\t\t\t//docCountIDF = 1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble idf = (Math.log10(((double)documentFound/(double)docCountIDF)));\n\t\t\t\t\t\t\t//System.out.println(\"Calculated IDF: \"+idf);\n\t\t\t\t\t\t\tif (idf < 0.0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tidf = 0.0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"IDF is: \" +idf);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"Size of doc words: \" + postingsFileListAllWords.size());\n\t\t\t\t\t\t\tfor (int k = 0; k < postingsFileListAllWords.size(); k++) \t\t//Go thru each doc. Since only looking at 1 term, it does it once per doc\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//System.out.println(\"Current Doc: \" +(k+1));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\ttermFreq = 1 + (Math.log10(Collections.frequency(postingsFileListAllWords.get(k), temp)));\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Freq is: \" +Collections.frequency(postingsFileListAllWords.get(k), temp));\n\t\t\t\t\t\t\t\t\t//System.out.println(termFreq + \": \" + termFreq.isInfinite());\n\t\t\t\t\t\t\t\t\tif (termFreq.isInfinite() || termFreq <= 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttermFreq = 0.0;\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(\"termFreq :\" +termFreq); \n\t\t\t\t\t\t\t\t\t//System.out.println(\"idf: \" +idf);\n\t\t\t\t\t\t\t\t\ttermWeights.get(k+1).add( (idf*termFreq) );\t\t\t\t\t\t\t\t\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\n\t\t\t\t\t\t\t//System.out.println(\"\");\n\t\t\t\t\t\t\tfinalTermList.add(temp);\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//FINALCOUNTER\n\t\t\t\t\t\t//System.out.println(\"Done looking at word: \" +j);\n\t\t\t\t\t\t//System.out.println(\"\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\twhile (true)\n\t\t\t\t {\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Enter a query: \");\n\t\t\t\t\t\n\t \tScanner scanner = new Scanner(System.in);\n\t \tString enterQuery = scanner.nextLine();\n\t \t\n\t \t\n\t\t\t\t\tList<Double> queryWeights = new ArrayList<Double>();\n\t\t\t\t\t\n\t\t\t\t\t// Query turn\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tenterQuery = enterQuery.toLowerCase();\t\t\n\t\t\t\t\tenterQuery = enterQuery.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"]\", \"\");\n\t\t\t\t\t//System.out.println(\"Query is: \" + enterQuery);\n\t\t\t\t\t\n\t\t\t\t\tif (enterQuery.equals(\"exit\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tString[] queryArray = enterQuery.split(\" \");\n\t\t\t\t\tArrays.sort(queryArray);\n\t\t\t\t\t\n\t\t\t\t\t//Find the query weights for each term in vocab\n\t\t\t\t\tfor (int j = 0; j < sortedArrayUnique.length; ++j)\t\t\t\t\t // go thru each word, CURRENT TERM\n\t\t\t\t\t{\n\t\t\t\t\t\t//System.out.println(\"Term is: \" + sortedArrayUnique[j]);\n\t\t\t\t\t\ttemp = sortedArrayUnique[j];\t\t\t\t\t\n\t\t\t\t\t\tif ((stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tint docCountDF = 0;\n\t\t\t\t\t\t//Start here for dictionary \n\t\t\t\t\t\tfor (int totalWords = 0; totalWords < queryArray.length; totalWords++) \t\t\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (temp.compareTo(\" \") == 0 || (stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//EITHER BLANK OR STOPWORD\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tString temp2 = queryArray[totalWords];\n\t\t\t\t\t\t\t\t//System.out.println(\"Compare: \"+temp+ \" with \" +temp2);\n\t\t\t\t\t\t\t\tif (temp.compareTo(temp2) == 0) {\n\t\t\t\t\t\t\t\t\t// (temp2+\" \");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocCountDF++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tDouble queryWeight = 1 + (Math.log10(docCountDF));\n\t\t\t\t\t\tif (queryWeight.isInfinite())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tqueryWeight = 0.0;\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tqueryWeights.add(queryWeight);\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Query WEights is: \"+queryWeights);\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\t// Finding the norms for DOCS\t\t\t\t\t\n\t\t\t\t\tfor (int norms = 1; norms < documentFound+1; norms++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble currentTotal = 0.0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (int weightsPerDoc = 0; weightsPerDoc < termWeights.get(norms).size(); weightsPerDoc++)\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble square = Math.pow(termWeights.get(norms).get(weightsPerDoc), 2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"Current square: \" + termWeights.get(norms).get(weightsPerDoc));\n\t\t\t\t\t\t\tcurrentTotal = currentTotal + square;\n\t\t\t\t\t\t\t//System.out.println(\"Current total: \" + currentTotal);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"About to square root this: \" +currentTotal);\n\t\t\t\t\t\tdouble root = Math.sqrt(currentTotal);\n\t\t\t\t\t\tdocNorms.put(norms, root);\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(\"All of the docs norms: \"+docNorms);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Finding the norm for the query\n\t\t\t\t\tdouble currentTotal = 0.0;\t\t\t\t\t\n\t\t\t\t\tfor (int weightsPerDoc = 0; weightsPerDoc < queryWeights.size(); weightsPerDoc++)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tdouble square = Math.pow(queryWeights.get(weightsPerDoc), 2);\n\t\t\t\t\t\tcurrentTotal = currentTotal + square;\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tdouble root = Math.sqrt(currentTotal);\n\t\t\t\t\tdouble queryNorm = root; \t\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Query norm \" + queryNorm);\n\t\t\t\t\t\n\t\t\t\t\t//Finding the cosine sim\n\t\t\t\t\t//System.out.println(\"Term Weights \" + termWeights);\n\t\t\t\t\tHashMap<Integer, Double> cosineScore = new HashMap<Integer, Double>();\n\t\t\t\t\tfor (int cosineSim = 1; cosineSim < documentFound+1; cosineSim++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble total = 0.0;\n\t\t\t\t\t\tfor (int docTerms = 0; docTerms < termWeights.get(cosineSim).size(); docTerms++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble docTermWeight = termWeights.get(cosineSim).get(docTerms);\n\t\t\t\t\t\t\tdouble queryTermWeight = queryWeights.get(docTerms);\n\t\t\t\t\t\t\t//System.out.println(\"queryTermWeight \" + queryTermWeight);\n\t\t\t\t\t\t\t//System.out.println(\"docTermWeight \" + docTermWeight);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttotal = total + (docTermWeight*queryTermWeight);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdouble cosineSimScore = 0.0;\n\t\t\t\t\t\tif (!(total == 0.0 || (docNorms.get(cosineSim) * queryNorm) == 0))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcosineSimScore = total / (docNorms.get(cosineSim) * queryNorm);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcosineSimScore = 0.0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcosineScore.put(cosineSim, cosineSimScore);\n\t\t\t\t\t}\n\t\t\t\t\tcosineScore = sortByValues2(cosineScore);\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"This is the cosineScores: \" +cosineScore);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"docAndTitles: \"+ docAndTitles);\n\t\t\t\t\tint topK = 0;\n\t\t\t\t\tint noValue = 0;\n\t\t\t\t\tfor (Integer name: cosineScore.keySet())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (topK < 50)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\n\t\t\t\t String key =name.toString();\n\t\t\t\t //String value = cosineScore.get(name).toString(); \n\t\t\t\t if (!(cosineScore.get(name) <= 0))\n\t\t\t\t {\n\t\t\t\t \tSystem.out.println(\"Doc: \"+key);\t\t\t\t \t\t\t\t\t \t\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \tStringBuilder builder = new StringBuilder();\n\t\t\t\t \tfor (StringBuilder value : docAndTitles.get(name)) {\n\t\t\t\t \t builder.append(value);\n\t\t\t\t \t}\n\t\t\t\t \tString text = builder.toString();\t\t\t\t \t\n\t\t\t\t \t//System.out.println(\"Title:\\n\" +docAndTitles.get(name));\n\t\t\t\t \tSystem.out.println(\"Title: \" +text);\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 \t\n\t\t\t\t \t//System.out.println(\"Authors:\\n\" +docAndAuthors.get(name));\n\t\t\t\t \t\n\t\t\t\t \tif (docAndAuthors.get(name) == null || docAndAuthors.get(name).toString().equals(\"\"))\n\t\t\t\t \t{\n\t\t\t\t \t\tSystem.out.println(\"Authors: N\\\\A\\n\");\n\t\t\t\t \t}\n\t\t\t\t \telse \n\t\t\t\t \t{\t\t\t\t \t\t\t\t\t\t \t\n\t\t\t\t\t \tStringBuilder builder2 = new StringBuilder();\n\t\t\t\t\t \tfor (StringBuilder value : docAndAuthors.get(name)) {\n\t\t\t\t\t \t builder2.append(value);\n\t\t\t\t\t \t}\n\t\t\t\t\t \tString text2 = builder2.toString();\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t\t\t\t \tSystem.out.println(\"Authors found: \" +text2);\n\t\t\t\t \t}\t\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t/* ABSTRACT \n\t\t\t\t \tif (docAndAbstract.get(name) == null)\n\t\t\t\t \t{\n\t\t\t\t \t\tSystem.out.println(\"Abstract: N\\\\A\\n\");\n\t\t\t\t \t}\n\t\t\t\t \telse \n\t\t\t\t \t{\t\t\t\t \t\t\t\t\t\t \t\n\t\t\t\t\t \tStringBuilder builder2 = new StringBuilder();\n\t\t\t\t\t \tfor (StringBuilder value : docAndAbstract.get(name)) {\n\t\t\t\t\t \t builder2.append(value);\n\t\t\t\t\t \t}\n\t\t\t\t\t \tString text2 = builder2.toString();\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t\t\t\t \tSystem.out.println(\"Abstract: \" +text2);\n\t\t\t\t \t}\t\n\t\t\t\t \t*/\n\t\t\t\t \t\n\t\t\t\t \tSystem.out.println(\"\");\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t \tnoValue++;\n\t\t\t\t }\n\t\t\t\t topK++;\n\t\t\t\t \n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (noValue == documentFound)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"No documents contain query!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\ttopK=0;\n\t\t\t\t\tnoValue = 0;\n\t\t\t\t }\n\t\t\t\t\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (bw != null)\n\t\t\t\t\t\tbw.close();\n\n\t\t\t\t\tif (fw != null)\n\t\t\t\t\t\tfw.close();\n\n\t\t\t\t} catch (IOException ex) {\n\n\t\t\t\t\tex.printStackTrace();\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null)\n\t\t\t\t\tbr.close();\n\n\t\t\t\tif (fr != null)\n\t\t\t\t\tfr.close();\n\n\t\t\t} catch (IOException ex) {\n\n\t\t\t\tex.printStackTrace();\n\n\t\t\t}\n\n\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\tint itemCount = uniqueTerms.size();\n\t\t\t//System.out.println(allValues);\n\t\t\tSystem.out.println(\"Total Terms BEFORE STEMING: \" +itemCount);\n\t\t\tSystem.out.println(\"Total Documents \" + documentFound);\n\t\t\t\t\t\t\n\t\t \n\t\t\t \n\t\t\t \n\t\t\t//END OF MAIN\n\t\t}", "private int disjunctMatch( int ix0, int ix1 )\n {\n \tint n = 0;\n if( ix0 == ix1 ){\n // TODO: complain, this should never happen.\n return 0;\n }\n \n if( ix0>ix1 ){\n int h = ix0;\n ix0 = ix1;\n ix1 = h;\n }\n \twhile( (ix0+n)<ix1 && (text[ix0+n] == text[ix1+n]) && (text[ix0+n] != STOP) ){\n \t n++;\n \t}\n \treturn n;\n }", "private void countOnePseudoDoc(int docIdx) {\n\t\tFeatureSequence fs = (FeatureSequence)documents.get(docIdx).getData();\n\t\tint[] tokens = fs.getFeatures();\n\t\tdouble[] tmpCounts = new double[numOfTerms];\n\t\tArrays.fill(tmpCounts, 0);\n\t\tfor(int i=0; i<tokens.length; i++) {\n\t\t\tint term = tokens[i];\n\t\t\ttmpCounts[term] += alpha * 1;\n\t\t}\n\t\t\n\t\tPairedInfo pairedDocs = pairs.links.get(docIdx);\n\t\tif(!pairedDocs.isEmpty()) {\n//\t\t\tSystem.out.println(docIdx + \":\" + Arrays.toString(tokens));\n\t\t\tint[] pIds = pairedDocs.getPairedIdsArray();\n//\t\t\tSystem.out.println(docIdx + \": \" + pairedDocs.getLength() + \":\" + Arrays.toString(pIds));\n\t\t\tdouble[] sims = pairedDocs.getPairedSimArray();\n\t\t\tsims = Util.reWeightVector(sims);\n\t\t\tfor(int p=0; p<pIds.length; p++) {\n\t\t\t\tfs = (FeatureSequence)documents.get(p).getData();\n\t\t\t\tint[] pTokens = fs.getFeatures();\n\t\t\t\tfor(int i=0; i<pTokens.length; i++) {\n\t\t\t\t\tint term = pTokens[i];\n\t\t\t\t\ttmpCounts[term] += (1-alpha) * sims[p];\n\t\t\t\t}\n\t\t\t\ttokens = ArrayUtils.append(tokens, fs.getFeatures());\n\t\t\t}\n//\t\t\tSystem.out.println(docIdx + \":\" + Arrays.toString(tokens));\n\t\t}\n\t\t\n\t\tint termNum = MalletTfidf.distinctNumbers(tokens);\n\t\tpseudoTermIndex[docIdx]= new int[termNum];\n\t\tpseudoTf[docIdx] = new double[termNum];\n\t\tint[] tmpTf = new int[termNum];\n\t\tMalletTfidf.countTf(tokens, pseudoTermIndex[docIdx], tmpTf); // count the tf frequency\n\t\tfor(int i=0; i<pseudoTermIndex[docIdx].length; i++) {\n\t\t\tint term = pseudoTermIndex[docIdx][i];\n\t\t\tpseudoTf[docIdx][i] = tmpCounts[term];\n\t\t}\n\t\tpseudoTermWeight[docIdx] = Util.reWeightVector(pseudoTf[docIdx]);\n\t}", "int countTypedFeatures();", "public java.lang.Integer getTerm() {\n return term;\n }", "public abstract double score(double tf, double docLength);", "boolean hasFixedHotwordGain();", "public static float[] getVector(\n Map<String, Map<String, List<Integer>>> index,\n List<String> allTerms,\n Map<String, List<Integer>> docTerms,\n int docCount) {\n\n float[] vector = new float[allTerms.size()];\n\n for (int i = 0; i < allTerms.size(); i++) {\n String term = allTerms.get(i);\n\n // the number of documents in which the term appears\n int termDocCount = 0;\n if (index.containsKey(term)) {\n termDocCount = index.get(term).size();\n }\n\n if (docTerms.containsKey(term)) {\n vector[i] =\n (float)\n (Math.sqrt(docTerms.get(term).size())\n * Math.log10((double) docCount / termDocCount));\n }\n }\n\n return vector;\n }", "@Override\n public void postInserts() \n {\n for(IndexObject i: myIndex.values())\n {\n i.tfidf(documentData);\n }\n }", "@Override\n public double makePrediction(ParsedText text) {\n double pr = 0.0;\n\n /* FILL IN HERE */\n double productSpam = 0;\n double productNoSpam = 0;\n \n int i, tempSpam,tempNoSpam;\n int minSpam, minNoSpam ;\n \n \n for (String ng: text.ngrams) {\n \tminSpam = Integer.MAX_VALUE;\n \tminNoSpam = Integer.MAX_VALUE;\n \n\n \tfor (int h = 0;h < nbOfHashes; h++) {\n \t\ti = hash(ng,h);\n\n \t\ttempSpam = counts[1][h][i];\n \t\ttempNoSpam = counts[0][h][i];\n \t\t\n \t\t//System.out.print(tempSpam + \" \");\n\n \t\tminSpam = minSpam<tempSpam?minSpam:tempSpam; \n \t\tminNoSpam = minNoSpam<tempNoSpam?minNoSpam:tempNoSpam; \n \t\t\n \t}\n\n \t//System.out.println(minSpam + \"\\n\");\n \tproductSpam += Math.log(minSpam);\n \tproductNoSpam += Math.log(minNoSpam);\n }\n \n // size of set minus 1\n int lm1 = text.ngrams.size() - 1;\n \n //System.out.println((productNoSpam - productSpam ));\n //System.out.println((lm1*Math.log(this.classCounts[1]) - lm1*Math.log(this.classCounts[0])));\n\n //\n pr = 1 + Math.exp(productNoSpam - productSpam + lm1*(Math.log(classCounts[1]) - Math.log(classCounts[0])));\n // System.out.print(1.0/pr + \"\\n\");\n \n return 1.0 / pr;\n\n }", "int countFeatures();", "int countFeatures();", "private IDictionary<URI, IDictionary<String, Double>> computeAllDocumentTfIdfVectors(ISet<Webpage> pages) {\n // Hint: this method should use the idfScores field and\n // call the computeTfScores(...) method.\n\t\tdocumentTfIdfVectors = new ChainedHashDictionary<URI, IDictionary<String, Double>>();\n\t\t\n\t\t// Iterates through the given set of webpages\n\t\tfor (Webpage page: pages) {\n\t\t\tIDictionary<String, Double> tfIdfScores = new ChainedHashDictionary<String, Double>();\n\t\t\tIDictionary<String, Double> tfScores = computeTfScores(page.getWords());\n\t\t\t\n\t\t\t// Computes TfIdf scores\n\t\t\tfor (KVPair<String, Double> pair: tfScores) {\n\t\t\t\tDouble tfIdfScore = pair.getValue() * idfScores.get(pair.getKey());\n\t\t\t\ttfIdfScores.put(pair.getKey(), tfIdfScore);\n\t\t\t}\n\t\t\tdocumentTfIdfVectors.put(page.getUri(), tfIdfScores);\n\t\t}\n\t\treturn documentTfIdfVectors;\n }", "static boolean checkTerm() {\r\n // Checks if this is a complete term\r\n boolean complete = false;\r\n\r\n // simple_term (base case)\r\n if (token.equals(\"IDENTIFIER\") || token.equals(\"SIGNED_INTEGER\") || token.equals(\"UNSIGNED_INTEGER\")) {\r\n complete = true;\r\n lex();\r\n\r\n // simple_term op\r\n if (token.equals(\"PLUS\") || token.equals(\"MINUS\") || token.equals(\"STAR\") || token.equals(\"DIVOP\") || token.equals(\"MOD\")) {\r\n complete = false;\r\n lex();\r\n\r\n // simple_term op term\r\n if(checkTerm()) {\r\n complete = true;\r\n }\r\n }\r\n }\r\n\r\n // (\r\n else if (token.equals(\"LEFT_PAREN\")) {\r\n lex();\r\n\r\n // ( term\r\n if(checkTerm()) {\r\n\r\n // ( term )\r\n if (token.equals(\"RIGHT_PAREN\")) {\r\n complete = true;\r\n lex();\r\n\r\n // ( term ) op\r\n if (token.equals(\"PLUS\") || token.equals(\"MINUS\") || token.equals(\"STAR\") || token.equals(\"DIVOP\") || token.equals(\"MOD\")) {\r\n complete = false;\r\n lex();\r\n\r\n // ( term ) op term\r\n if (checkTerm()) {\r\n complete = true;\r\n }\r\n }\r\n }\r\n\r\n // ( term op\r\n else if (token.equals(\"PLUS\") || token.equals(\"MINUS\") || token.equals(\"STAR\") || token.equals(\"DIVOP\") || token.equals(\"MOD\")) {\r\n complete = false;\r\n lex();\r\n\r\n // ( term op term\r\n if(checkTerm()) {\r\n\r\n // ( term op term )\r\n if (token.equals(\"RIGHT_PAREN\")) {\r\n complete = true;\r\n lex();\r\n\r\n // ( term op term ) op\r\n if (token.equals(\"PLUS\") || token.equals(\"MINUS\") || token.equals(\"STAR\") || token.equals(\"DIVOP\") || token.equals(\"MOD\")) {\r\n complete = false;\r\n lex();\r\n\r\n // ( term op term ) op term\r\n if (checkTerm()) {\r\n complete = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return complete;\r\n }", "public abstract double score(\n\t\tdouble tf,\n\t\tdouble docLength,\n\t\tdouble n_t,\n\t\tdouble F_t,\n\t\tdouble keyFrequency);", "public double computeIDF(HashMap<String, Integer> termPostings, int documents) {\n // Document frequency is the number of postings\n int df = termPostings.size();\n\n return Math.log(((double) documents) / (df + 1));\n }", "public Set<String> calculateDistance() throws IOException {\n booleanSearch();\n\n Set<String> words = invertedIndexForQuerryWords.keySet();\n Map<String, Double> tfidfQuerry = new TreeMap<>();\n\n //load idf\n char c='a';\n char prC = 'v';\n for (String word : words){\n c = word.charAt(0);\n if(c != prC) {\n String path = Constants.PATH_TO_IDF + c + \"IDF.idf\";\n prC = c;\n idfMap.putAll(objectMapper.readValue(new File(path), new TypeReference<TreeMap<String, Double>>(){}));\n }\n }\n\n Map<String, Double> distanceMap = new HashMap<>();\n double sum = 0.0;\n //calculez norma interogarii\n for(String word:words){\n double idf, tf;\n if(idfMap.containsKey(word)) {\n idf = idfMap.get(word);\n tf = 1.0 / words.size();\n tfidfQuerry.put(word, tf * idf);\n\n sum += (tf * idf) * (tf * idf);\n } else {\n sum += 0.0;\n }\n }\n\n double normQuerry = Math.sqrt(sum);\n\n //iau toate documentele rezultate din boolean search\n Set<String> docs = new TreeSet<>();\n for(List<MyPair> list : invertedIndexForQuerryWords.values()) {\n if (list != null) {\n docs.addAll(list.stream().map(p -> p.getKey()).collect(Collectors.toSet()));\n }\n }\n\n List<File> documents = FileLoader.getFilesForInternalPath(\"Norms\", \".norm\");\n\n Map<String, Double> norms = new HashMap<>();\n for(File file : documents) {\n norms.putAll(objectMapper.readValue(file, new TypeReference<TreeMap<String, Double>>(){}));\n }\n\n //pentru fiecare document din boolean search calculez distanta cosinus\n for(String doc : docs) {\n\n String fileName = Paths.get(doc).getFileName().toString();\n\n String filePath = Constants.PATH_TO_TF + fileName.replaceFirst(\"[.][^.]+$\", \".tf\");\n\n Map<String, Double> tf = objectMapper.readValue(new File(filePath), new TypeReference<TreeMap<String, Double>>(){});\n double wordTF, wordIDF;\n double vectorialProduct = 0.0;\n double tfidfForQueryWord;\n\n for(String word : words) {\n if (tf.containsKey(word)) {\n wordTF = tf.get(word);\n wordIDF = idfMap.get(word);\n tfidfForQueryWord = tfidfQuerry.get(word);\n\n vectorialProduct += tfidfForQueryWord * wordIDF * wordTF;\n }\n }\n\n double normProduct = normQuerry * norms.get(Paths.get(doc).getFileName().toString());\n\n distanceMap.put(doc, vectorialProduct / normProduct);\n }\n\n //sortare distance map\n distanceMap = distanceMap.entrySet().stream()\n .sorted(Map.Entry.comparingByValue(Collections.reverseOrder()))\n .collect(Collectors.toMap(\n Map.Entry::getKey,\n Map.Entry::getValue,\n (e1, e2) -> e1,\n LinkedHashMap::new));\n\n// System.out.println(\"Cos distance:\");\n// for(Map.Entry entry : distanceMap.entrySet()){\n// System.out.println(entry);\n// }\n\n return distanceMap.keySet();\n }", "public void countTerm() throws IOException {\n\n long countBody = reader.getSumDocFreq(\"body\");\n long countTitle = reader.getSumDocFreq(\"title\");\n\n System.out.println(\"Body: \" + countBody);\n System.out.println(\"Title: \" + countTitle);\n System.out.println(\"Total count Terms: \" + (countTitle + countBody));\n\n }", "public void computeTermTable(IndexReader reader) throws IOException {\n\t\t//MultiFields.getFields(reader).terms(field)\n\t\tint numDocs = reader.numDocs();\n\t\tfor (int docID =0 ; docID < numDocs; docID++) {\n\t\t\tTerms termVector = reader.getTermVector(docID, FieldName.METHOD_DESC.getName());\n\t\t\tif(termVector == null)\n\t\t\t\tcontinue;\n\t\t\tTermsEnum iterator = termVector.iterator(null);\n\t\t\tBytesRef next = iterator.next();\n\t\t\twhile (next != null) {\n\t\t\t\tint docFreq = reader.docFreq(FieldName.METHOD_DESC.getName(), next);\n\t\t\t\t\n\t\t\t\ttermTable.put(next.utf8ToString(), docFreq);\n\t\t\t\tnext = iterator.next();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tcomputeStatProperties(reader,termTable);\n\t}", "public abstract Object[] getSimilarityFactors();", "public static void InvertedDocFrequency() throws FileNotFoundException {\n //int totalDoc = totaldocument;\n int i = 0;\n for(Entry<String, List<Integer>> entry: dictionary.entrySet()) {\n List<Integer> docFrequency = new ArrayList<>();\n //\tList<Double> idfValue = new ArrayList<>();\n docFrequency = entry.getValue(); //again taking the list of word terms from the same dictionary hashmap\n int df = docFrequency.get(totaldocument+1); // it will save the idf of every word term at the 57th index\n double ans = Math.log10(df);\n ans /= totaldocument;\n\n idfFinal.add(i,ans); //updatin\n i++;\n }\n saveidf();\n }", "default List<String> interestingConcepts(int topK, UnitLocation located,\n Set<Location> irrelevantSet){\n // collect frequent words outside the blacklist of locations\n final TokenIterator extractor = new TokenIterator(irrelevantSet);\n located.getUnitNode().accept(extractor);\n\n final WordCounter wordCounter = new WordCounter(extractor.getItems());\n\n return wordCounter.mostFrequent(topK);\n }" ]
[ "0.60107577", "0.5797017", "0.5660234", "0.5633843", "0.5564556", "0.5551654", "0.554559", "0.5543597", "0.5539202", "0.55127895", "0.54864407", "0.54860085", "0.54856205", "0.54337925", "0.5350816", "0.5343665", "0.5324684", "0.53126794", "0.5291859", "0.5283408", "0.52833915", "0.52810985", "0.5260584", "0.52293646", "0.522235", "0.52118814", "0.5193171", "0.51519144", "0.51427376", "0.5131274", "0.5105942", "0.50823694", "0.50749946", "0.5070671", "0.5065016", "0.5063753", "0.5063058", "0.50403696", "0.5039093", "0.50314504", "0.50302464", "0.50160533", "0.5011331", "0.5007651", "0.50058025", "0.50027436", "0.5000992", "0.49926874", "0.4987358", "0.49833938", "0.49646062", "0.49582765", "0.4934672", "0.49273926", "0.4921564", "0.49116609", "0.4903203", "0.48812383", "0.48807624", "0.4877343", "0.48594695", "0.48582518", "0.48558256", "0.48537046", "0.4849764", "0.4843289", "0.48429158", "0.48374242", "0.48346326", "0.48346326", "0.48248807", "0.48203266", "0.4818896", "0.48164356", "0.48157892", "0.48115194", "0.4808889", "0.48057535", "0.4804191", "0.48023957", "0.48015392", "0.4785952", "0.47762436", "0.47581244", "0.4757003", "0.47550023", "0.47509572", "0.47498724", "0.47487736", "0.47487736", "0.47469592", "0.47441903", "0.47415993", "0.4738378", "0.4735741", "0.4734797", "0.47299358", "0.47286695", "0.47264475", "0.47118115" ]
0.6349889
0
[NEW] Finds documents containing the query as a phrase TODO: Skip pointer
public PostingsList phrase_query(Query query){ LinkedList<PostingsList> listQueriedPostings = new LinkedList<PostingsList>(); // List with postings corresponding to the queries for (int i = 0; i<query.size(); i++){ // If any query has zero matches, return 0 results //if(!(new File("postings/t"+hash(query.terms.get(i))+".json")).exists()){ if (!this.index.containsKey(query.terms.get(i))){ return null; } // Otherwise store postings in the list listQueriedPostings.add(this.getPostings(query.terms.get(i))); } PostingsList result = new PostingsList(); result = listQueriedPostings.get(0); // In case only one word is queried if (listQueriedPostings.size() == 1){ return result; } // Apply algorithm as many times as words in the query for(int i = 1; i < listQueriedPostings.size(); i++){ result = phrase_query(result, listQueriedPostings.get(i)); if (result.isEmpty()){ return null; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testPhrase() {\n assertQ(req(\"q\",\"text:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='1']\"\n );\n // should generate a query of (now OR cow) and match both docs\n assertQ(req(\"q\",\"text_np:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='2']\"\n );\n }", "private static String handlePhrases(String PubmedQuery) {\r\n //Find phrases \"between double quotes\"\r\n String[] phrases = PubmedQuery.split(\"\\\"\");\r\n for(int i = 0 ; i < phrases.length ; i++){\r\n phrases[i] = phrases[i].trim();\r\n if(!phrases[i].equals(\"\")){ // String not Empty\r\n if(i%2 != 0){ // String surrounded by quotes, i.e. a phrase\r\n phrases[i] = \"\\\"\" + phrases[i] + \"\\\"\";\r\n } else { // not a phrase, i.e. a bag of terms, operator or [field of index] (inside brackets)\r\n if(phrases[i].startsWith(\"[\")){ //index field of previus component contained (i.e. case: \"...\"[...])\r\n boolean perviusPhraseFound = false; // True if index field was added to previus phrase element\r\n // Get index field of previus component and handle proprietly\r\n String [] tokens = phrases[i].split(\"]\");\r\n String indexField = tokens[0].replace(\"[\", \"\");\r\n String luceneField = supportedIndexFields.get(indexField);\r\n if(luceneField != null){ \r\n //add \"indexField:\" as a prefix in previus (not empty) phrase\r\n int tmp = i-1;\r\n while(!perviusPhraseFound & tmp >= 0){\r\n if(!phrases[tmp].equals(\"\")){\r\n perviusPhraseFound = true;\r\n //TO DO : handle wrong syntax (e.g. ... AND [ArticleTitle])\r\n phrases[tmp] = luceneField + \":\" + phrases[tmp] + \"\";\r\n } else {\r\n tmp--;\r\n }\r\n }\r\n } // else : Lucene counterpart not found, unsupported field - do nothing\r\n // Remove from current phrase this index field (prefix)\r\n phrases[i] = phrases[i].substring(indexField.length()+2 );\r\n } \r\n // Further handling...\r\n phrases[i] = handleNonPhraseToken(phrases[i]);\r\n }\r\n } //else { /* Empty token, do nothing with this */ System.out.println(\"\\t\\t\\t empty\"); }\r\n }\r\n \r\n String luceneQuery = \"\";\r\n boolean fisrtPhrase = true;\r\n for(int i = 0 ; i < phrases.length ; i ++){\r\n if(phrases[i].length() > 0){\r\n if(!phrases[i].startsWith(\" OR \") & !phrases[i].startsWith(\" -\") & !phrases[i].startsWith(\" +\") ){\r\n if(fisrtPhrase){\r\n luceneQuery += \" +\";\r\n fisrtPhrase = false;\r\n } else {\r\n if(!phrases[i-1].endsWith(\" OR \") & !phrases[i-1].endsWith(\" -\") & !phrases[i-1].endsWith(\" +\")){\r\n luceneQuery += \" +\";\r\n }\r\n } \r\n } // add default operator + when required (no OR or - is present for that term)\r\n luceneQuery += phrases[i];\r\n }// else empty phrase : skip\r\n }\r\n return luceneQuery;\r\n }", "private static List<SearchData> booleanSearchWord(Query query, Indexer si) {\n Tokenizer tkn = new SimpleTokenizer();\n tkn.tokenize(query.getStr(), \"[a-zA-Z]{3,}\", true, true);\n List<SearchData> searchList = new ArrayList<>();\n LinkedList<Token> wordsList = tkn.getTokens();\n Iterator<Token> wordsIt = wordsList.iterator();\n HashMap<String, LinkedList<Posting>> indexer = si.getIndexer();\n int idx;\n SearchData searched_doc;\n\n while (wordsIt.hasNext()) {\n String word = wordsIt.next().getSequence();\n if (indexer.containsKey(word)) {\n\n LinkedList<Posting> posting = indexer.get(word);\n\n for (Posting pst : posting) {\n\n SearchData sd = new SearchData(query, pst.getDocId());\n\n if (!searchList.contains(sd)) {\n sd.setScore(1);\n searchList.add(sd);\n } else {\n idx = searchList.indexOf(sd);\n searched_doc = searchList.get(idx);\n searched_doc.setScore(searched_doc.getScore() + 1);\n }\n }\n\n }\n\n\n }\n\n Collections.sort(searchList);\n\n return searchList;\n }", "@Override\r\n\t\t\tpublic List<ScoredDocument> search(Query query) {\n\t\t\t\treturn null;\r\n\t\t\t}", "public Map<String, String> directQuoteSearch (String q, String contentOrTitle) throws IOException, ParseException{\n\n\t\t\n\t\tif (contentOrTitle.equals(\"content\")){\n\t\t\tcontentOrTitle=field;\n\t\t} else if (contentOrTitle.equals(\"title\")){\n\t\t\tcontentOrTitle=title;\n\t\t}\n\t\t\n\t\tIndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(index)));\n\t\tIndexSearcher searcher = new IndexSearcher(reader);\n\t\tboolean raw = false;\n\t\tint repeat = 0;\n\n\t\tfinal List<String> stopWords = Arrays.asList();\n\t\tfinal CharArraySet stopSet = new CharArraySet(stopWords, true);\n\n\t\tAnalyzer analyzer = new StandardAnalyzer(stopSet);\n\t\tAnalyzingQueryParser parser = new AnalyzingQueryParser(contentOrTitle, analyzer);\n\t\t\n\n\t\t\n\t\tString[] items = q.split(\" \");\n\t\tList<String> itemList = Arrays.asList(items);\n\t\tQuery query=null;\n\t\t\n\t\t\n\t\tif (q.equals(\"\")){\n\t\t\tSystem.out.println(\"no input\");\n\t\t\t\n\t\t} else {\n\t\t\tquery = parser.parse(q);\n\n\t\t}\n\n\t\t\n\t\t\n\t\tBufferedReader in = null;\n\t\tin = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));\n\n\t\tif (repeat > 0) { // repeat & time as benchmark\n\t\t\tDate start = new Date();\n\t\t\tfor (int i = 0; i < repeat; i++) {\n\t\t\t\tsearcher.search(query, 100);\n\t\t\t}\n\t\t\tDate end = new Date();\n\t\t\tSystem.out.println(\"Time: \"+(end.getTime()-start.getTime())+\"ms\");\n\t\t}\n\n\t\treturn doPagingSearch(in, searcher, query, hitsPerPage, raw, true);\n\t}", "@In String search();", "public byte filter(Manager m, SearchRequest q, ResultSet rs, int DocAtNumber, int DocNo)\n\t{\t\t\n\t\tString originalQuery = q.getOriginalQuery();\n\t\t//highlight query terms only for the queries, \n\t\t//which are not about finding related documents\n\t\t//this check may be removed, because the preparation of the \n\t\t//query terms for highlighting takes into account\n\t\t//the related: operator\n\t\tboolean highlightQueryTerms = true;\n\t\tif (originalQuery.matches(\"\\\\brelated:\\\\d+\\\\b\") || //check if the query uses the related: operator \n\t\t\t!enableQueryTermsHighlight || //check if the highlighting of terms is enabled\n\t\t\thighlight.pattern().equals(\"(\\\\b)()(\\\\b)\")) //check if there are no query terms to highlight\n\t\t\thighlightQueryTerms = false;\n\t\t\n\t\tString[] qTerms = q.getOriginalQuery().replaceAll(\" \\\\w+\\\\p{Punct}\\\\w+ \",\" \").toLowerCase().split(\" \");\n\t\t\n\t\tString[] metadata = null;\n\t\tint tmpSentence;\n\t\tdouble tmpScore;\n\t\tsynchronized(metaCache) {\n\t\t\ttry {\n\t\t\t\tInteger DocNoObject = new Integer(DocNo);\n\t\t\t\tif (metaCache.containsKey(DocNoObject))\n\t\t\t\t\t\tmetadata = (String[]) metaCache.get(DocNoObject);\n\t\t\t\telse {\n\t\t\t\t\tmetadata = metaIndex.getItems(keys, DocNo);\n\t\t\t\t\tmetaCache.put(DocNoObject,metadata);\n\t\t\t\t}\n\t\t\t} catch(IOException ioe) {} \n\t\t}\n\t\n\t\tif (show_snippet)\n\t\t{\n\t\t\tString extract = metadata[1];\n\t\t\tString[] sentences = sentencePattern.split(extract, 50); //use 50 sentences at most\n\t\t\tdouble[] sentenceScores = new double[sentences.length]; \n\t\t\tint frsSentence = -1;\n\t\t\tint sndSentence = -1;\n\t\t\tint top1Sentence = 0;\n\t\t\tint top2Sentence = 0;\n\t\t\tdouble max1Score = -1;\n\t\t\tdouble max2Score = 0;\n\t\t\tfinal int qTermsLength = qTerms.length;\n\t\t\tfor (int i=0; i<qTermsLength; i++) {\n\t\t\t\tqTerms[i] = removeEndings.matcher(qTerms[i]).replaceAll(\"\");\n\t\t\t}\n\t\t\tString lowerCaseSentence;\n\t\t\tint sentenceLength;\n\t\t\tfinal int sentencesLength = sentences.length;\n\n\t\t\tfor (int i=0; i<sentencesLength; i++) {\n\t\t\t\t\n\t\t\t\tlowerCaseSentence = sentences[i].toLowerCase();\n\t\t\t\tsentenceLength=sentences[i].length();\n\t\t\t\tif (sentenceLength < 20 || sentenceLength > 250) {\n\t\t\t\t\tfor (int j=0; j<qTermsLength; j++) {\n\t\t\t\t\t\tif (lowerCaseSentence.indexOf(qTerms[j])>=0) {\n\t\t\t\t\t\t\tsentenceScores[i]+=1.0d + sentenceLength / (20.0d + sentenceLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tfor (int j=0; j<qTermsLength; j++) {\n\t\t\t\t\t\tif (lowerCaseSentence.indexOf(qTerms[j])>=0) {\n\t\t\t\t\t\t\tsentenceScores[i]+=qTerms[j].length() + sentenceLength / (1.0d + sentenceLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t//do your best to get at least a second sentence for the snippet, \n\t\t\t\t//after having found the first one\n\t\t\t\tif (frsSentence > -1 && sndSentence == -1 && sentenceLength > 5) {\n\t\t\t\t\tsndSentence = i;\n\t\t\t\t}\n\n\t\t\t\t//do your best to get at least one sentence for the snippet\n\t\t\t\tif (frsSentence == -1 && sentenceLength > 5) { \n\t\t\t\t\tfrsSentence = i;\n\t\t\t\t}\n\n\t\t\t\tif (max2Score < sentenceScores[i]) {\n\t\t\t\t\tmax2Score = sentenceScores[i];\n\t\t\t\t\ttop2Sentence = i;\n\t\t\t\t\t//logger.debug(\"top 2 sentence is \" + i);\n\t\t\t\t\tif (max2Score > max1Score) {\n\t\t\t\t\t\ttmpScore = max1Score; max1Score = max2Score; max2Score = tmpScore;\n\t\t\t\t\t\ttmpSentence = top1Sentence; top1Sentence = top2Sentence; top2Sentence = tmpSentence;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tint lastIndexOfSpace = -1;\n\t\t\tString sentence=\"\";\n\t\t\tString secondSentence=\"\";\n\t\t\tString snippet = \"\";\n\t\t\tif (max1Score == -1) {\n\t\t\t\tif (frsSentence>=0) {\n\t\t\t\t\tsentence = sentences[frsSentence];\n\t\t\t\t\tif (sentence.length() > 100) {\n\t\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 100);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (sndSentence>=0) {\n\t\t\t\t\tsecondSentence = sentences[sndSentence];\n\t\t\t\t\tif (secondSentence.length() > 100) {\n\t\t\t\t\t\tlastIndexOfSpace = secondSentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\t\tsecondSentence = secondSentence.substring(0, lastIndexOfSpace>0 ? lastIndexOfSpace : 100);\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 (frsSentence >=0 && sndSentence >= 0) \n\t\t\t\t\tsnippet = sentence.trim() + \"...\" + secondSentence.trim();\n\t\t\t\telse if (frsSentence >= 0 && sndSentence<0) \n\t\t\t\t\tsnippet = sentence.trim();\n\t\t\t\t\n\t\t\t} else if (sentences[top1Sentence].length()<100 && top1Sentence!=top2Sentence) {\n\t\t\t\tsentence = sentences[top1Sentence];\n\t\t\t\tif (sentence.length() > 100) {\n\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 100);\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\tsecondSentence = sentences[top2Sentence];\n\t\t\t\tif (secondSentence.length() > 100) {\n\t\t\t\t\tlastIndexOfSpace = secondSentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\tsecondSentence = secondSentence.substring(0, lastIndexOfSpace>0 ? lastIndexOfSpace : 100);\n\t\t\t\t}\n\t\t\t\tsnippet = sentence.trim() + \"...\" + secondSentence.trim();\n\t\t\t} else {\n\t\t\t\tsentence = sentences[top1Sentence];\n\t\t\t\tif (sentence.length()>200) {\n\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 200).lastIndexOf(\" \");\n\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 200);\n\t\t\t\t}\n\t\t\t\tsnippet = sentence.trim();\n\t\t\t}\n\t\t\t\n\t\t\t//checking and removing any control characters\n\t\t\tcontrolNonVisibleCharactersMatcher.reset(snippet);\n\t\t\tsnippet = controlNonVisibleCharactersMatcher.replaceAll(\"\");\n\t\t\t\n\t\t\t//String escapedSnippet = StringEscapeUtils.escapeHtml(snippet);\n\t\t\t//if (highlightQueryTerms)\n\t\t\t//\tescapedSnippet = highlight.matcher(escapedSnippet).replaceAll(\"$1<b>$2</b>$3\");\n\t\t\tif (highlightQueryTerms)\n\t\t\t\tsnippet = highlight.matcher(snippet).replaceAll(\"$1<b>$2</b>$3\");\n\t\t\t//else \n\t\t\t//\tsnippet = StringEscapeUtils.escapeHtml(snippet);\n\t\t\t\n\t\t\t//change by Vassilis, 20/09/2006\n\t\t\t//disabling the xml escaping in order to move the data into ![CDATA[ ]]\n\t\t\t//the code was:\n\t\t\t//rs.addMetaItem(\"snippet\", DocAtNumber, StringEscapeUtils.escapeXml(snippet));\n\t\t\t//and now it is:\n\t\t\t//snippet.replaceAll(\"[^\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]\",\"\");\n\t\t\trs.addMetaItem(\"snippet\", DocAtNumber, snippet);\n\t\t\t\n\t\t}\n\t\tif (show_title)\n\t\t{\n\t\t\tString title = metadata[2];\n\t\t\t\n\t\t\t//checking and removing any control characters\n\t\t\tcontrolNonVisibleCharactersMatcher.reset(title);\n\t\t\ttitle = controlNonVisibleCharactersMatcher.replaceAll(\"\");\n\t\t\ttitle = (highlightQueryTerms)\n\t\t\t\t ? highlight.matcher(metadata[2]).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t\t : metadata[2];\n\t\t\t\n\t\t\t\n\t\t\t//String escapedTitle = StringEscapeUtils.escapeHtml(metadata[2]);\n\t\t\t//String title = (highlightQueryTerms)\n\t\t\t//\t\t\t ? highlight.matcher(escapedTitle).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t//\t\t\t : escapedTitle;\n\t\t\t//String title = (highlightQueryTerms) \n\t\t\t//\t\t? highlight.matcher(metadata[2]).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t//\t\t: metadata[2];\n\n\t\t\t//change by Vassilis, 20/09/2006\n\t\t\t//disabling the xml escaping in order to move the data into ![CDATA[ ]]\n\t\t\t//the code was:\n\t\t\t//rs.addMetaItem(\"title\", DocAtNumber, StringEscapeUtils.escapeXml(title));\n\t\t\t//and now is:\n\t\t\t//title.replaceAll(\"[^\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]\",\"\");\n\t\t\trs.addMetaItem(\"title\", DocAtNumber, title);\n\t\t\t\n\t\t}\n\t\tif (!show_docid_early && show_docid)\n\t\t{\n\t\t\trs.addMetaItem(\"docid\", DocAtNumber, docIndex.getDocumentNumber(DocNo));\n\t\t}\n\t\tif (!show_url_early && show_url)\n\t\t{\n\n\t\t\trs.addMetaItem(\"url\", DocAtNumber, StringEscapeUtils.escapeXml(metadata[0]));\n\t\t}\n\t\t\n\t\treturn FILTER_OK;\n\t}", "@Test\n\tpublic void phraseGrepTest1() throws Exception {\n\t\t// phrase is \"I am forced\"\n\t\tHashSet<String> grepFound = loadGrepResults(\"i+am+forced\");\n\t\tCollection<Page> index = queryTest.query(\"\\\"I am Forced\\\"\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\t// tests set equality \n\t\tassertEquals(indexFound, grepFound);\n\t}", "private ArrayList<WordDocument> executeRegularQuery(){\n String[] splitedQuery = this.query.split(\" \");\n ArrayList<WordDocument> listOfWordDocuments = new ArrayList<WordDocument>();\n String word = \"\";\n\n for(int i = 0; i < splitedQuery.length; i++){\n if(!isOrderByCommand(splitedQuery[i]) && i == 0) {\n word = splitedQuery[i];\n\n if(cache.isCached(word))\n addWithoutDuplicate(listOfWordDocuments, cache.getCachedResult(word));\n else\n addWithoutDuplicate(listOfWordDocuments, getDocumentsWhereWordExists(word));\n\n }else if(i >= 1 && isOrderByCommand(splitedQuery[i])) {\n subQueries.add(word);\n listOfWordDocuments = orderBy(listOfWordDocuments, splitedQuery[++i], splitedQuery[++i]);\n break;\n }\n else\n throw new IllegalArgumentException();\n }\n\n return listOfWordDocuments;\n }", "public void search(Indexer indexer, CityIndexer cityIndexer, Ranker ranker, String query, boolean withSemantic, ArrayList<String> chosenCities, ObservableList<String> citiesByTag, boolean withStemming, String saveInPath, String queryId, String queryDescription) {\n String[] originalQueryTerms = query.split(\" \");\n String originQuery = query;\n docsResults = new HashMap<>();\n parser = new Parse(withStemming, saveInPath, saveInPath);\n HashSet<String> docsOfChosenCities = new HashSet<>();\n query = \"\" + query + queryDescription;\n HashMap<String, Integer> queryTerms = parser.parseQuery(query);\n HashMap<String, ArrayList<Integer>> dictionary = indexer.getDictionary();\n if (!withStemming){\n setDocsInfo(saveInPath + \"\\\\docsInformation.txt\");\n }\n else{\n setDocsInfo(saveInPath + \"\\\\docsInformation_stemming.txt\");\n }\n\n\n //add semantic words of each term in query to 'queryTerms'\n if(withSemantic) {\n HashMap<String,ArrayList<String>> semanticWords = ws.connectToApi(originQuery);\n }\n\n //give an ID to query if it's a regular query (not queries file)\n if(queryId.equals(\"\")){\n queryId = \"\" + Searcher.queryID;\n Searcher.queryID++;\n }\n\n String postingDir;\n if (!withStemming) {\n postingDir = \"\\\\indexResults\\\\postingFiles\";\n } else {\n postingDir = \"\\\\indexResults\\\\postingFiles_Stemming\";\n }\n int pointer = 0;\n\n //find docs that contain the terms in the query in their text\n HashMap<String, Integer> queryTermsIgnoreCase = new HashMap<>();\n for (String term : queryTerms.keySet()) {\n String originTerm = term;\n if (!dictionary.containsKey(term.toUpperCase()) && !dictionary.containsKey(term.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(term.toLowerCase())){\n term = term.toLowerCase();\n }\n else {\n term = term.toUpperCase();\n }\n queryTermsIgnoreCase.put(term,queryTerms.get(originTerm));\n pointer = dictionary.get(term).get(2);\n String chunk = (\"\" + term.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsResults'\n if(line != null) {\n findDocsFromLine(line, term);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their text\n for (String cityTerm : chosenCities) {\n if (!dictionary.containsKey(cityTerm) && !dictionary.containsKey(cityTerm.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(cityTerm.toLowerCase())){\n cityTerm = cityTerm.toLowerCase();\n }\n pointer = dictionary.get(cityTerm).get(2);\n // char chunk = indexer.classifyToPosting(term).charAt(0);\n String chunk = (\"\" + cityTerm.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(0, line.indexOf(\"[\") - 1); //get 'docsListStr'\n String[] docsArr = docs.split(\";\");\n for (String docInfo : docsArr) {\n String doc = docInfo.substring(0, docInfo.indexOf(\": \"));\n while(doc.charAt(0) == ' '){\n doc = doc.substring(1);\n }\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their city tag\n if(!chosenCities.isEmpty()){\n for (String cityDicRec: chosenCities) {\n //get pointer to posting from cityDictionary\n try {\n pointer = cityIndexer.getCitiesDictionary().get(cityDicRec);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + \"\\\\cityIndexResults\" + \"\\\\posting_city\" + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(line.indexOf(\"[\") + 1, line.indexOf(\"]\")); //get 'docsListStr'\n String[] docsArr = docs.split(\"; \");\n for (String doc : docsArr) {\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n\n ranker.rank(docsResults, docsOfChosenCities, queryTermsIgnoreCase, dictionary, docsInfo,entities, queryId);\n }", "public DocumentListFeed fullTextQuery(String text) throws MalformedURLException, IOException, ServiceException;", "private static Query computeBooleanQueryNP(String textQuery){\n\t\tBooleanQuery query = new BooleanQuery();\n\n\t\tHmmDecoder mPosTagger = null;\n\t\tTokenizerFactory mTokenizerFactory = null;\n\t\tPhraseChunker pChunker = new PhraseChunker(mPosTagger,mTokenizerFactory);\n\t\tArrayList<String> pchuncker = new ArrayList<String>();\n\n\t\tpchuncker = pChunker.getCHunkNounPhrases(textQuery.toLowerCase());\n\n\t\tfor (int k = 0; k<= pchuncker.size()-1;k++ ){\n\t\t\tString wordInList = ((String) pchuncker.get(k));\n\t\t\twordInList = wordInList.toLowerCase().replaceAll(\"-\",\" \");\n\t\t\tString [] wordInListSplit = wordInList.split(\" \");\n\t\t\tfor (String word: wordInListSplit){\n\n\t\t\t\tquery.add(new TermQuery(new Term(\"content\", word)), Occur.SHOULD );\n\t\t\t}\n\n\t\t}\n\n\t\t/* String[] tQuery = textQuery.split(\" \");\n\t\t for(String s: tQuery )\n\t\t\t query.add(new TermQuery(new Term(\"text\", s)), Occur.SHOULD);*/\n\n\t\treturn query;\n\t}", "private static String getPhraseInput() {\n\t\treturn getQuery(\"Query Phrase\");\n\t}", "public SearchResult search(String text, String subText);", "List<String> getDocumentTitles(String query) throws SearcherException;", "public List<Document> SearchField(String queryStr ,String fieldName)\r\n\t{\r\n\t\treturn null;\r\n\t}", "String phraseQuery(String field, String val, int from, int size,\n\t\t\tboolean isSubdoc, DomeoPermissions permissions3) {\n\t\tString query = buildPhraseQuery(field, val, from, size, permissions3);\n\t\tString searchUrl = isSubdoc ? esSearchSubdocUrl : esSearchUrl;\n\t\t@SuppressWarnings(\"unused\")\n\t\tint resCode = doHttpOperation(searchUrl, HTTP_POST, query);\n\t\treturn decodeNS(lastResponse);\n\t}", "SpellResponse spellQuery(SearchRequest request, Map<SearchParam, String> params);", "@Test\n\tpublic void singleWordGrepTest4() throws Exception {\n\t\t// word is 'undocumented'\n\t\tHashSet<String> grepFound = loadGrepResults(\"undocumented\");\n\t\tCollection<Page> index = queryTest.query(\"undocumented\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\t// tests set equality \n\t\tassertEquals(indexFound, grepFound);\n\t}", "@Test\n\tpublic void notPhraseGrepTest() throws Exception {\n\t\t// phrase is \"I am forced\"\n\t\tHashSet<String> grepFound = loadGrepResults(\"!i+am+forced\");\n\t\tCollection<Page> index = queryTest.query(\"! \\\"I am Forced\\\"\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\tassertEquals(grepFound, indexFound);\n\t}", "public static ArrayList<Result> findMatches(Query query, DataManager myVocab){\n\n\t\t//Uncomment this for logging in this class\t\n//\t\tmyLogger.setLevel(Level.INFO); \n\n\t\t// get the term we're going to search for and\n\t\t// take out any leading or trailing whitespaces\n\t\tString querystr = query.getQuery();\n\t\tquerystr = querystr.trim();\n\t\tString uncleaned = querystr;\n\t\t\n\t\t// This is in case of numeric entries. Google Refine doesn't seem\n\t\t// to have int cell types, instead it adds an invisible .0 to all\n\t\t// numbers. This fixes that issue, as it sometimes causes false negatives.\n\t\tif (querystr.endsWith(\".0\")){\n\t\t Pattern p = Pattern.compile(\"[^0-9\\\\.]+\");\n\t\t Matcher m = p.matcher(querystr);\n\t\t boolean result = m.find();\n\t\t if (!result){\n\t\t \t querystr = querystr.substring(0, querystr.length()-2);\n\t\t }\n\t\t}\n\t\t// see if it's in the synonyms map, if it is\n\t\t// replace it with the appropriate term, if it's\n\t\t// not, don't do anything. \n\n\t\tif (myVocab.subMap.get(querystr)!=null){\n\t\t\tquerystr = myVocab.subMap.get(querystr);\n\t\t\tquery.setQuery(querystr);\n\t\t}\n\t\t\n\t\t// Clean up the query string if it isn't case/punctuation sensitive\n\t\tif (!myVocab.capsSensitive()){\t\t\n\t\t\tquerystr = querystr.toLowerCase();\n\t\t}\n\t\tif (! myVocab.punctSensitive()){\t\t\n\t\t\tquerystr = querystr.replaceAll(\"[\\\\W_]\", \"\");\n\t\t}\n\t\t\n\t\t// see if it's in the synonyms map, if it is\n\t\t// replace it with the appropriate term, if it's\n\t\t// not, don't do anything. \n\t\tif(myVocab.subMap.get(querystr)!=null){\n\t\t\tquerystr = myVocab.subMap.get(querystr);\n\t\t\tquery.setQuery(querystr);\n\t\t}\n\n\t\tString type = query.getType();\n\n\t\t// This ArrayList is the results that are going to be returned. \n\t\tArrayList<Result> results = getDirectMatches(myVocab, querystr, uncleaned, type);\n\t\t\n\t\t// If there's a perfect match return it.\n\t\tif (results.size() == 1 && results.get(0).match){\n\t\t\treturn results;\n\t\t}else{\n\t\t\t// Otherwise, add the initial ones and try matching\n\t\t\t// based on distance to vocabulary terms.\n\t\t\tresults.addAll(distanceMatching(query, myVocab));\n\t\t\t\n\t\t\t// Split the original query term by space and non-alphanumeric characters \n\t\t\t// to find how many words there are.\n\t\t\t//querystr = query.getQuery().replaceAll(\"[\\\\W_]\", \" \");\n\t\t\tString [] termList = querystr.split(\" \");\n\t\t\t\n\t\t\t// if there's more than one, run bagOfWords\n\t\t\t// which tries to find a match for each of the words.\n\t\t\tif (termList.length > 1){\n\t\t\t\tresults.addAll(bagOfWords(query, myVocab));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Clean the results: no duplicates\n\t\t// no extra results to return, and sorted\n\t\t// them by score before returning them\n\t\tresults = removeDuplicates(results);\n\t\t\n\t\t// They do not need to be reduced in \n\t\t// number if there are fewer than \n\t\t// the max results.\n\t\t// The pruneResults sorts them\n\t\t// by score already.\n\t\tif(query.getLimit()!=null){\n\t\t\tresults = pruneResults(results,Integer.parseInt(query.getLimit()));\n\t\t}else{\n\t\t\tresults = pruneResults(results,MAX_RESULTS);\n\t\t}\n\t\t\t\n\t\tresults = sortByScore(results);\n\t\tfor (int i = 0; i< results.size(); i++){\n//\t\t\tmyLogger.log(Level.SEVERE,results.get(i).getScore()+ \" is bigger than 100?\");\n\t\t\tif(results.get(i).getScore() > (double)100){\n\t\t\t\tresults.get(i).setScore((double)100 - (results.get(i).getScore()-(double)100));\n//\t\t\t\tmyLogger.log(Level.SEVERE,results.get(i).getScore()+\" is bigger than 100! and was set to \"+\n//\t\t\t\t\t\t((double)100 - (results.get(i).getScore()-(double)100)));\n\t\t\t}\n\t\t}\n\t\treturn results;\n\t}", "private String keywordFound(){\r\n\t\tString rtn = \"\";\r\n\t\tString tmp = \"\";\r\n\t\tint carr_pos = getCaretPosition();\r\n\t\t//estract part of text for keyword search\r\n\t\ttry { \r\n\t\tif(carr_pos>50)\r\n\t\t\ttmp = doc.getText(carr_pos-50,50);\r\n\t\telse\r\n\t\t\ttmp = doc.getText(0,carr_pos);\r\n\t\t}catch(BadLocationException a){\r\n\t\t\tSystem.out.println(\"exception\");\r\n\t\t\treturn rtn;\r\n\t\t};\r\n\t\t//Start check\r\n\t\tint i = 0;\r\n\t\tif(tmp.length() >= 2)i = tmp.length()-2;\t\r\n\t\twhile(checkOperator(tmp.charAt(i)) && i > 0){\r\n\t\t\trtn += tmp.charAt(i);\r\n\t\t\ti--;\r\n\t\t}\r\n\t\tif(i == 0)rtn += tmp.charAt(i);\t\t\r\n\t\treturn mirrorString(rtn);\r\n\t}", "@Override\n public List<Document> search(String string)\n { \n ArrayList<ArrayList> data = new ArrayList<ArrayList>();\n data.add(new ArrayList<Document>()); //documents\n data.add(new ArrayList<Double>()); //relevance\n data.add(new ArrayList<Integer>()); //occurrence\n data.add(new ArrayList<Integer>()); //popularity\n \n ParseTree tree = new ParseTree(this);\n \n String inputarray[]= StringUtils.split(string); //Splits the query on \" \" \n if(inputarray.length == 0)\n {\n errorMsg();\n return null;\n }\n \n for(int i = 0; i<inputarray.length; i++) //Inserts the operators/operands in the parsetree.\n {\n tree.insert(inputarray[i]);\n }\n data = tree.execute(); //executes the parsetree (the difference operations\n //are executed and data is returned.\n this.infix = tree.getInfix(); //gets the infix-notation.\n\n if(data != null)\n {\n return data.get(0);\n }\n return null;\n }", "@Override\r\n\tpublic SearchableTeletextPage[] getPagesWithText(String query) {\n\t\treturn null;\r\n\t}", "private void termQuerySearch(String[] terms) {\n for (String term : terms) {\n LinkedList<TermPositions> postingLists = indexMap.get(analyzeTerm(term));\n if (postingLists != null) {\n for (TermPositions matches : postingLists) {\n double score = (double) 1 + Math.log((double) matches.getPositionList().size()) *\n Math.log((double) N / (double) postingLists.size());\n resultsCollector.add(new DocCollector(matches.getDocId(), score));\n }\n }\n }\n }", "@Override\n\tpublic List<ScoredTextDocument> search(String query) {\n\t\tList<ScoredTextDocument> scored = new ArrayList<>();\n\t\tDirectory dir = null;\n\n\t\tStandardAnalyzer analyzer = new StandardAnalyzer(Version.LUCENE_35);\n\n\t\tQuery q;\n\t\ttry {\n\t\t\tq = new QueryParser(Version.LUCENE_35, Utils.STR_CONTENT, analyzer).parse(query);\n\t\t} catch (ParseException ex) {\n\t\t\tLogger.getLogger(LuceneSearcher.class.getName()).log(Level.SEVERE, null, ex);\n\t\t\tSystem.out.println(\"Error en LuceneSearcher\");\n\t\t\treturn null;\n\t\t}\n\t\tTopDocs top;\n\t\ttry {\n\t\t\t//Finds the top n hits for query.\n\t\t\ttop = this.indexSearcher.search(q, null, this.indexSearcher.maxDoc());\n\t\t} catch (IOException ex) {\n\t\t\tLogger.getLogger(LuceneSearcher.class.getName()).log(Level.SEVERE, null, ex);\n\t\t\tSystem.out.println(\"Error en LuceneSearcher\");\n\t\t\treturn null;\n\t\t}\n\n\t\tfor (ScoreDoc d : top.scoreDocs) {\n\t\t\tDocument aux = null;\n\t\t\ttry {\n\t\t\t\t//aux=reader.document(top.scoreDocs[j].doc);\n\t\t\t\taux = this.indexSearcher.doc(d.doc);\n\t\t\t} catch (IOException ex) {\n\t\t\t\tLogger.getLogger(LuceneSearcher.class.getName()).log(Level.SEVERE, null, ex);\n\t\t\t}\n\t\t\tif (aux == null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString docPath = aux.getFieldable(Utils.DOC_STR_NAME).stringValue();\n\t\t\tScoredTextDocument textdoc = new ScoredTextDocument(docPath, d.score);\n\t\t\tscored.add(textdoc);\n\t\t}\n\t\tCollections.sort(scored);\n\n\t\treturn scored;\n\t}", "public void SearchPhrase(Object_Ord temp) {\n\tif (!Doneloading) {\r\n\t return;\r\n\t}\r\n\tif (temp == null) {\r\n\t return;\r\n\t} else if (temp.Ordet.equals(\"\")) {\r\n\t return;\r\n\t}\r\n\ttemp.Set_Searched();\r\n\t//PrintAction( this.getClass().toString() + \" Searching for phrase \" + temp.Ordet );\r\n\tThread thread = new Thread_PhraseSearcher(this, temp);\r\n\tThreadsRunning++;\r\n\tThreadsStarted++;\r\n }", "List<DataTerm> search(String searchTerm);", "protected Query analyzePhrase(String field, TokenStream stream, int slop) throws IOException {\n PhraseQuery.Builder builder = new PhraseQuery.Builder();\n builder.setSlop(slop);\n\n TermToBytesRefAttribute termAtt = stream.getAttribute(TermToBytesRefAttribute.class);\n BoostAttribute boostAtt = stream.addAttribute(BoostAttribute.class);\n PositionIncrementAttribute posIncrAtt = stream.getAttribute(PositionIncrementAttribute.class);\n int position = -1;\n float phraseBoost = DEFAULT_BOOST;\n stream.reset();\n while (stream.incrementToken()) {\n if (enablePositionIncrements) {\n position += posIncrAtt.getPositionIncrement();\n } else {\n position += 1;\n }\n builder.add(new Term(field, termAtt.getBytesRef()), position);\n phraseBoost *= boostAtt.getBoost();\n }\n PhraseQuery query = builder.build();\n if (phraseBoost == DEFAULT_BOOST) {\n return query;\n }\n return new BoostQuery(query, phraseBoost);\n }", "private ScoreDoc[] searchExec (Query query) {\n\n ScoreDoc[] hits = null;\n\n try {\n IndexReader reader = DirectoryReader.open(indexDir);\n IndexSearcher searcher = new IndexSearcher(reader);\n TopDocs docs = searcher.search(query, hitsPerPage, new Sort(SortField.FIELD_SCORE)); //search(query, docs);\n hits = docs.scoreDocs;\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return hits;\n }", "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 }", "private ArrayList<WordDocument> executeAdvancedQuery(){\n ArrayList<WordDocument> documents = customDijkstrasTwoStack(this.query.split(\" \"));\n ArrayList<WordDocument> result = new ArrayList<WordDocument>();\n\n try{\n String[] orderByPart = query.substring(query.indexOf(\"ORDERBY\")).trim().toLowerCase().split(\" \");\n if(isOrderByCommand(orderByPart[0]))\n result = orderBy(documents, orderByPart[1], orderByPart[2]);\n }catch (StringIndexOutOfBoundsException ex){\n result = documents;\n }\n\n return result;\n }", "public interface DocumentRelatedTermsSearcher {\n List<ScoredTerm> getDocumentRelatedTerms(int docId, String term) throws SearchException;\n}", "@Test\n public void testCase3 () throws IOException {\n //\t\tlog.trace(\"Testcase3\");\n sq = new SpanSegmentQuery(new SpanTermQuery(new Term(\"base\", \"s:d\")),\n new SpanTermQuery(new Term(\"base\", \"s:b\")));\n\n kr = ki.search(sq, (short) 10);\n ki.close();\n\n assertEquals(\"totalResults\", kr.getTotalResults(), 1);\n assertEquals(\"doc-number\", 2, kr.getMatch(0).getLocalDocID());\n assertEquals(\"StartPos (0)\", 1, kr.getMatch(0).startPos);\n assertEquals(\"EndPos (0)\", 2, kr.getMatch(0).endPos);\n }", "public void search() {\n String q = this.query.getText();\n String cat = this.category.getValue();\n if(cat.equals(\"Book\")) {\n searchBook(q);\n } else {\n searchCharacter(q);\n }\n }", "CampusSearchQuery generateQuery();", "@Override\n\tprotected void executeSearch(String term) {\n\t\t\n\t}", "@Override\n public List<SearchResult> search(String queryString, int k) {\n // TODO: YOUR CODE HERE\n\n // Tokenize the query and put it into a Set\n HashSet<String> tokenSet = new HashSet<>(Searcher.tokenize(queryString));\n\n /*\n * Section 1: FETCHING termId, termFreq and relevant docId from the Query\n */\n\n // Init a set to store Relevant Document Id\n HashSet<Integer> relevantDocIdSet = new HashSet<>();\n for (String token : tokenSet) { // Iterates thru all query tokens\n int termId;\n try {\n termId = indexer.getTermDict().get(token);\n } catch (NullPointerException e) { // In case current token is not in the termDict\n continue; // Skip this one\n }\n // Get the Posting associate to the termId\n HashSet<Integer> posting = indexer.getPostingLists().get(termId);\n relevantDocIdSet.addAll(posting); // Add them all to the Relevant Document Id set\n }\n\n /*\n * Section 2: Calculate Jaccard Coefficient between the Query and all POTENTIAL DOCUMENTS\n */\n\n // ArrayList for the Final Result\n ArrayList<SearchResult> searchResults = new ArrayList<>();\n for (Document doc : documents) { // Iterates thru all documents\n if (!relevantDocIdSet.contains(doc.getId())) { // If the document is relevant\n searchResults.add(new SearchResult(doc, 0)); // Add the document as a SearchResult with zero score\n } else {\n HashSet<String> termIdSet = new HashSet<>(doc.getTokens()); // Get the token set from the document\n\n // Calculate Jaccard Coefficient of the document\n double jaccardScore = JaccardMathHelper.calculateJaccardSimilarity(tokenSet, termIdSet);\n\n // Add the SearchResult with the computed Jaccard Score\n searchResults.add(new SearchResult(doc, jaccardScore));\n }\n }\n\n return TFIDFSearcher.finalizeSearchResult(searchResults, k);\n }", "public String[] searchIndex(Directory ramdir, Query query) \n\t\t\tthrows Exception {\n\t\tSortedMap<Float,String> sentenceMap = \n\t\t\t\tnew TreeMap<Float,String>();\n\t\tIndexReader indexReader = DirectoryReader.open(ramdir);\n\t\tIndexSearcher indexSearcher = new IndexSearcher(indexReader);\n\t\tBM25Similarity similarity = new BM25Similarity(1.2f, 100f);\n\n\t\tindexSearcher.setSimilarity(similarity);\n\t\tTopDocs topDocs = indexSearcher.search(query, this.numSentences);\n\n\t\tfor (ScoreDoc scoreDoc : topDocs.scoreDocs) {\n\n\t\t\t// System.out.println(scoreDoc.score)\n\t\t\tint docId = scoreDoc.doc;\n\t\t\t//System.out.println(searcher.explain(query, docId));\n\t\t\tDocument doc = indexSearcher.doc(docId);\n\t\t\t// System.out.println(sentences.get(docId));\n\t\t\tSystem.out.println(doc.get(\"content\"));\n\n\t\t\t// System.out.println(doc.get(\"text\"));\n\n\t\t\t// if(scoreDoc.score>=0.1F){\n\n\t\t\tsentenceMap.put((float) scoreDoc.doc, \">> \"+StringUtils.chomp(doc.get(\"content\")));\n\t\t\t//sentenceMap.put(1/scoreDoc.score,sentences.get(docId));\n\t\t\t// System.out.println(scoreDoc);\n\t\t\t// System.out.println(StringUtils.chomp(doc.get(\"text\")));\n\t\t\t// }\n\t\t}\n\n\t\treturn sentenceMap.values().toArray(new String[0]);\n\n\t}", "public List<Document> SearchField(String queryStr ,List<String> fieldName)\r\n\t{\r\n\t\treturn null;\r\n\t}", "@Override\r\n\t\t\tpublic List<ScoredDocument> search(Query query, long maxNumberOfDocuments) {\n\t\t\t\treturn null;\r\n\t\t\t}", "public static void doPagingSearch(BufferedReader in, IndexSearcher searcher, Query query,\n int hitsPerPage, boolean raw, boolean interactive) throws IOException {\n TopDocs results = searcher.search(query, 5 * hitsPerPage);\n ScoreDoc[] hits = results.scoreDocs;\n\n int numTotalHits = results.totalHits;\n System.out.println(numTotalHits + \" total matching documents\");\n\n int start = 0;\n int end = Math.min(numTotalHits, hitsPerPage);\n\n while (true) {\n if (end > hits.length) {\n //System.out.println(\"Only results 1 - \" + hits.length + \" of \" + numTotalHits + \" total matching documents collected.\");\n //System.out.println(\"Collect more (y/n) ?\");\n String line = in.readLine();\n if (line.length() == 0 || line.charAt(0) == 'n') {\n break;\n }\n hits = searcher.search(query, numTotalHits).scoreDocs;\n }\n\n end = Math.min(hits.length, start + hitsPerPage);\n\n for (int i = start; i < end; i++) {\n if (raw) {\n System.out.println(\"doc=\" + hits[i].doc + \" score= \" + hits[i].score);\n continue;\n }\n\n Document doc = searcher.doc(hits[i].doc);\n String path = doc.get(\"path\");\n if (path != null) {\n System.out.println((i + 1) + \". \" + path);\n String title = doc.get(\"title\");\n if (title != null) {\n System.out.println(\" Title: \" + doc.get(\"title\"));\n }\n } else {\n System.out.println((i + 1) + \". \" + \"No path for this document\");\n }\n }\n\n if (!interactive || end == 0) {\n break;\n }\n\n if (numTotalHits >= end) {\n boolean quit = false;\n while (true) {\n System.out.print(\"Press \");\n if (start - hitsPerPage >= 0) {\n System.out.print(\"(p)revious page, \");\n }\n if (start + hitsPerPage < numTotalHits) {\n System.out.print(\"(n)ext page, \");\n }\n System.out.println(\"(q)uit or enter number to jump to a page.\");\n\n String line = in.readLine();\n if (line.length() == 0 || line.charAt(0) == 'q') {\n quit = true;\n break;\n }\n if (line.charAt(0) == 'p') {\n start = Math.max(0, start - hitsPerPage);\n break;\n } else if (line.charAt(0) == 'n') {\n if (start + hitsPerPage < numTotalHits) {\n start += hitsPerPage;\n }\n break;\n } else {\n int page = Integer.parseInt(line);\n if ((page - 1) * hitsPerPage < numTotalHits) {\n start = (page - 1) * hitsPerPage;\n break;\n } else {\n System.out.println(\"No such page\");\n }\n }\n }\n if (quit) break;\n end = Math.min(numTotalHits, start + hitsPerPage);\n }\n }\n }", "public List<String> findPhrases() {\n\t\t\n\t\tTrie root = new Trie();\n\t\tList<String> result = new ArrayList<>();\n\t\tQueue<TrieNode> queue = new LinkedList<>();\n\n\t\tfor (String phrase : phrases) {\n\t\t\t// build the trie\n\t\t\t\n\t\t\troot.insert(phrase);\n\t\t}\n\t\t\n\t\t// initialize the queue\n\t\tqueue.offer(root.getRootNode());\n\t\t\t\t\n\t\tfor (String word : stream) {\n\t\t\t\n\t\t\t// Search one word at a time and store TrieNodes that match this word.\n\t\t\t// If the current word extends a previous TrieNode, it may be a matching phrase\n\t\t\t\n\t\t\t// buffer to store current matches\n\t\t\tQueue<TrieNode> buffer = new LinkedList<>();\n\t\t\t\n\t\t\twhile(!queue.isEmpty()) {\n\t\t\t\t// iterate through previous matches\n\t\t\t\t\n\t\t\t\tTrieNode next = queue.poll().find(word);\n\t\t\t\t\n\t\t\t\tif (next != null) {\n\t\t\t\t\t\n\t\t\t\t\t// if this word extends the previous word, add it to the buffer\n\t\t\t\t\t// in case the next word can also extend it\n\t\t\t\t\t\n\t\t\t\t\tbuffer.offer(next);\n\t\t\t\t\t\n\t\t\t\t\tif (next.isPhrase()) {\n\t\t\t\t\t\t// if we found a valid phrase node, add it to the result\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tresult.add(next.getPhrase());\n\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\tqueue = buffer;\n\t\t\tqueue.offer(root.getRootNode());\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "protected final void searchForText() {\n Logger.debug(\" - search for text\");\n final String searchText = theSearchEdit.getText().toString();\n\n MultiDaoSearchTask task = new MultiDaoSearchTask() {\n @Override\n protected void onSearchCompleted(List<Object> results) {\n adapter.setData(results);\n }\n\n @Override\n protected int getMinSearchTextLength() {\n return 0;\n }\n };\n task.readDaos.add(crDao);\n task.readDaos.add(monsterDao);\n task.readDaos.add(customMonsterDao);\n task.execute(searchText.toUpperCase());\n }", "List<SearchResult> search(SearchQuery searchQuery);", "public PostingsList phrase_query(PostingsList l1, PostingsList l2){\n\n PostingsList phrase = new PostingsList();\n\n // Counters to iterate docIDs\n int count1 = 0;\n int count2 = 0;\n // Counters to iterate positional indices\n int subcount1 = 0;\n int subcount2 = 0;\n\n // First posting\n PostingsEntry p1 = l1.get(0);\n PostingsEntry p2 = l2.get(0);\n\n // List of positional indices (changes at each iteration)\n LinkedList<Integer> ll1;\n LinkedList<Integer> ll2;\n\n // Used to store positional index\n int pp1;\n int pp2;\n\n while(true){\n // docID match (1/2) //\n if (p1.docID == p2.docID){\n // Obtain list of positional indices\n ll1 = p1.positions;\n ll2 = p2.positions;\n // First positional indices\n pp1 = ll1.get(0);\n pp2 = ll2.get(0);\n // Initialize counter\n subcount1 = 0;\n subcount2 = 0;\n\n // Search if the phrase exists\n while(true){\n // Match, consecutive words (2/2) - EUREKA! //\n if (pp1+1 == pp2){\n // Save found match (docID and positional index of last\n // word)\n phrase.insert(p1.docID, pp2);\n // Increase counters and pos indices if list is not finished\n subcount1++;\n subcount2++;\n if (subcount1<ll1.size() && subcount2<ll2.size()){\n pp1 = ll1.get(subcount1);\n pp2 = ll2.get(subcount2);\n }\n // If list finished, break\n else\n break;\n }\n // Not match\n else if (pp1+1 < pp2){\n subcount1++;\n if (subcount1<ll1.size())\n pp1 = ll1.get(subcount1);\n // If list finished, break\n else\n break;\n }\n // Not match\n else{\n subcount2++;\n if (subcount2<ll2.size())\n pp2 = ll2.get(subcount2);\n else\n break;\n }\n }\n\n // Once we finished looking at the list of positional indices of one\n // posting, increase counters and go to next postings (if there are)\n count1++;\n count2++;\n if (count1<l1.size() && count2<l2.size()){\n p1 = l1.get(count1);\n p2 = l2.get(count2);\n }\n else{\n break;\n }\n }\n // docID not match, increase lowest counter\n else if (p1.docID < p2.docID){\n count1++;\n if (count1<l1.size()){\n p1 = l1.get(count1);\n }\n else{\n break;\n }\n }\n // docID not match, increase lowest counter\n else{\n count2++;\n if (count2<l2.size()){\n p2 = l2.get(count2);\n }\n else{\n break;\n }\n }\n }\n\n return phrase;\n }", "Page<NoteDTO> search(String query, Pageable pageable);", "public List<SearchResultDocument> getSearchResults(String query) throws IOException, ParseException {\n return luceneIndexer.getSearchResults(query);\n }", "public abstract Search defaultSearch(StringBuilder sb);", "@Override\n\tpublic NodeIterator search(String queryString) throws Exception {\n\t\treturn null;\n\t}", "@Query(\"name = ?\")\n List<PersonDocument> findByName(String name);", "public HashMap<String, Double> search(String query) {\n // ===================================================\n // 1. Fetch all inverted lists corresponding to terms\n // in the query.\n // ===================================================\n String[] terms = query.split(\" \");\n HashMap<String, Integer> qf = new HashMap<String, Integer>();\n // Calculate term frequencies in the query\n for (String term : terms) {\n if (qf.containsKey(term))\n qf.put(term, qf.get(term) + 1);\n else\n qf.put(term, 1);\n }\n HashMap<String, Double> docScore = new HashMap<String, Double>();\n for (Entry<String, Integer> termEntry : qf.entrySet()) {\n String term = termEntry.getKey();\n int qfi = termEntry.getValue();\n\n // ===================================================\n // 2. Compute BM25 scores for documents in the lists.\n // Make a score list for documents in the inverted\n // lists. Assume that no relevance information is \n // available. For parameters, use k1=1.2, b=0.75, \n // k2=100.\n // ===================================================\n double k1 = 1.2;\n double b = 0.75;\n double k2 = 100;\n int ni = invIndex.get(term).size();\n\n\n for (Entry<String, IndexEntry> invListEntry : invIndex.get(term).entrySet()) {\n String docID = invListEntry.getKey();\n double bm25Score;\n if (docScore.containsKey(docID))\n bm25Score = docScore.get(docID);\n else\n bm25Score = 0;\n\n // length of the document\n int dl = docStat.get(docID);\n // frequency of the term in the document\n int fi = invListEntry.getValue().getTf();\n double K = k1 * ((1 - b) + b * ((double) dl / avdl));\n\n // ===================================================\n // 3. Accumulate scores for each term in a query\n // on the score list.\n // ===================================================\n bm25Score += Math.log((N - ni + 0.5) / (ni + 0.5))\n * (((k1 + 1) * fi * (k2 + 1) * qfi) / ((K + fi) * (k2 + qfi)));\n docScore.put(docID, bm25Score);\n }\n }\n\n return docScore;\n }", "abstract public void search();", "MongoCursor<Document> findByPersonName(String personName);", "private ArrayList<WordDocument> getDocumentsWhereWordExists(String word){\n try{\n return dictionary.get(word).getDocumentWhereWordExistsIn();\n }catch (NullPointerException ex){\n return new ArrayList<WordDocument>();\n }\n }", "@Override\n public List<DefinitionDTO> findWordsByWord(String query) {\n List<Word> words = wordRepository.findBySearchString(query);\n return DTOMapper.mapWordListToDefinitionDTOList(words);\n }", "List<Corretor> search(String query);", "public void doSearch(BufferedReader in, IndexSearcher searcher, Query query, \n int hitsPerPage, boolean raw, boolean interactive) throws IOException {\n TopDocs results = searcher.search(query, 5 * hitsPerPage);\n ScoreDoc[] hits = results.scoreDocs;\n \n int numTotalHits = results.totalHits;\n System.out.println(numTotalHits + \" total matching documents\");\n\n int start = 0;\n int end = Math.min(numTotalHits, hitsPerPage);\n \n for (int i = start; i < end; i++) \n {\n Document doc = searcher.doc(hits[i].doc);\n String id = doc.get(\"id\");\n String author=doc.get(\"author\");\n String price=doc.get(\"price\");\n String category=doc.get(\"category\");\n String bookname=doc.get(\"bookname\");\n System.out.println(id+author+price+category+bookname);\n }\n }", "static void allDocumentAnalyzer() throws IOException {\n\t\tFile allFiles = new File(\".\"); // current directory\n\t\tFile[] files = allFiles.listFiles(); // file array\n\n\t\t// recurse through all documents\n\t\tfor (File doc : files) {\n\t\t\t// other files we don't need\n\t\t\tif (doc.getName().contains(\".java\") || doc.getName().contains(\"words\") || doc.getName().contains(\"names\")\n\t\t\t\t\t|| doc.getName().contains(\"phrases\") || doc.getName().contains(\".class\")\n\t\t\t\t\t|| doc.getName().contains(\"Data\") || doc.getName().contains(\".sh\") || doc.isDirectory()\n\t\t\t\t\t|| !doc.getName().contains(\".txt\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tString name = doc.getName();\n\t\t\tSystem.out.println(name);\n\t\t\tname = name.substring(0, name.length() - 11);\n\t\t\tSystem.out.println(name);\n\n\t\t\tif (!names.contains(name)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// make readers\n\t\t\tFileReader fr = new FileReader(doc);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\n\t\t\t// phrase list\n\t\t\tArrayList<String> words = new ArrayList<String>();\n\n\t\t\t// retrieve all text, trim, refine and add to phrase list\n\t\t\tString nextLine = br.readLine();\n\t\t\twhile (nextLine != null) {\n\t\t\t\tnextLine = nextLine.replace(\"\\n\", \" \");\n\t\t\t\tnextLine = nextLine.trim();\n\n\t\t\t\tif (nextLine.contains(\"no experience listed\")) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tString[] lineArray = nextLine.split(\"\\\\s+\");\n\n\t\t\t\t// recurse through every word to find phrases\n\t\t\t\tfor (int i = 0; i < lineArray.length - 1; i++) {\n\t\t\t\t\t// get the current word and refine\n\t\t\t\t\tString currentWord = lineArray[i];\n\n\t\t\t\t\tcurrentWord = currentWord.trim();\n\t\t\t\t\tcurrentWord = refineWord(currentWord);\n\n\t\t\t\t\tif (currentWord.equals(\"\") || currentWord.isEmpty()) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\twords.add(currentWord);\n\t\t\t\t}\n\t\t\t\tnextLine = br.readLine();\n\t\t\t}\n\n\t\t\tbr.close();\n\n\t\t\t// continue if empty\n\t\t\tif (words.size() == 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// otherwise, increment number of files in corpus\n\t\t\tsize++;\n\n\t\t\t// updating the phrase count map for tf\n\t\t\tString fileName = doc.getName();\n\t\t\tphraseCountMap.put(fileName, words.size());\n\n\t\t\t// recurse through every word\n\t\t\tfor (String word : words) {\n\t\t\t\t// get map from string to freq\n\t\t\t\tHashMap<String, Integer> textFreqMap = wordFreqMap.get(fileName);\n\n\t\t\t\t// if it's null, make one\n\t\t\t\tif (textFreqMap == null) {\n\t\t\t\t\ttextFreqMap = new HashMap<String, Integer>();\n\t\t\t\t\t// make freq as 1\n\t\t\t\t\ttextFreqMap.put(word, 1);\n\t\t\t\t\t// put that in wordFreq\n\t\t\t\t\twordFreqMap.put(fileName, textFreqMap);\n\t\t\t\t} else {\n\t\t\t\t\t// otherwise, get the current num\n\t\t\t\t\tInteger currentFreq = textFreqMap.get(word);\n\n\t\t\t\t\t// if it's null,\n\t\t\t\t\tif (currentFreq == null) {\n\t\t\t\t\t\t// the frequency is just 0\n\t\t\t\t\t\tcurrentFreq = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t// increment the frequency\n\t\t\t\t\tcurrentFreq++;\n\n\t\t\t\t\t// put it in the textFreqMap\n\t\t\t\t\ttextFreqMap.put(word, currentFreq);\n\n\t\t\t\t\t// put that in the wordFreqMap\n\t\t\t\t\twordFreqMap.put(fileName, textFreqMap);\n\t\t\t\t}\n\n\t\t\t\t// add this to record (map from phrases to docs with that\n\t\t\t\t// phrase)\n\t\t\t\tinvertedMap.addValue(word, doc);\n\t\t\t}\n\t\t}\n\t}", "public void search() {\r\n \t\r\n }", "private void searchWord()\n {\n String inputWord = searchField.getText();\n \n if(inputWord.isEmpty())\n queryResult = null;\n \n else\n {\n char firstLetter = inputWord.toUpperCase().charAt(0);\n \n for(int i = 0 ; i < lexiNodeTrees.size() ; i++)\n {\n if(lexiNodeTrees.get(i).getCurrentCharacter() == firstLetter)\n {\n queryResult = lexiNodeTrees.get(i).searchWord(inputWord, false);\n i = lexiNodeTrees.size(); // escape the loop\n }\n }\n }\n \n // update the list on the GUI\n if(queryResult != null)\n {\n ArrayList<String> words = new ArrayList<>();\n for(WordDefinition word : queryResult)\n {\n words.add(word.getWord());\n }\n \n // sort the list of words alphabetically \n Collections.sort(words);\n \n // display the list of wordsin the UI\n DefaultListModel model = new DefaultListModel();\n for(String word : words)\n {\n model.addElement(word);\n }\n\n this.getSearchSuggestionList().setModel(model);\n }\n \n else\n this.getSearchSuggestionList().setModel( new DefaultListModel() );\n }", "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 void searchIndex(Directory index) throws Exception{\n\t\tString searchString = getSearchString();\n\t\t\n\t\tSystem.out.println(\"Searching for '\" + searchString + \"'\");\n\n\t\tIndexReader indexReader = DirectoryReader.open(index);\n\t\tIndexSearcher indexSearcher = new IndexSearcher(indexReader);\n\n\t\tAnalyzer analyzer = new StandardAnalyzer();\n\t\t\n\t\tString query_string = \"title:\" + searchString + \" OR content:\" + searchString + \"OR important:\" + searchString + \"OR h1:\" + searchString +\n\t\t\t\t\"OR h2:\" + searchString + \"OR h3:\" + searchString + \"OR h4:\" + searchString + \"OR h5:\" + searchString + \"OR h6:\" + searchString;\n\t\tQueryParser queryParser = new QueryParser(\"title\", analyzer);\n\t\t\n\t\tTopDocs docs = indexSearcher.search(queryParser.parse(query_string), 10);\n\t\t\n\t\t\n//\t\tString[] fields = {\"content\", \"title\", \"important\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"};\n//\t\tBooleanClause.Occur[] flags = \n//\t\t{\n//\t\t\tBooleanClause.Occur.SHOULD,\n//\t\t\tBooleanClause.Occur.SHOULD,\n//\t\t\tBooleanClause.Occur.SHOULD,\n//\t\t\tBooleanClause.Occur.SHOULD,\n//\t\t\tBooleanClause.Occur.SHOULD,\n//\t\t\tBooleanClause.Occur.SHOULD,\n//\t\t\tBooleanClause.Occur.SHOULD,\n//\t\t\tBooleanClause.Occur.SHOULD,\n//\t\t\tBooleanClause.Occur.SHOULD,\n// };\n//\t\t\n//\t\tTopDocs docs = indexSearcher.search(MultiFieldQueryParser.parse(searchString, fields, flags, analyzer), 10);\n\n\t\tScoreDoc[] hits = docs.scoreDocs;\n\n\t System.out.println(\"Found \" + hits.length + \" hits.\");\n\t for(int i=0;i<hits.length;++i) {\n\t \tint docId = hits[i].doc;\n\t Document d = indexSearcher.doc(docId);\n\t System.out.println((i + 1) + \". \" + d.get(\"title\") + \"\\t\" + d.get(\"url\") + \"\\t\" + hits[i].score);\n\t }\n\t}", "@Test\n\tpublic void testKeywordQuery(){\n\t\t//manager.getResponse(\"american football \"); //match multiple keywords\n//\t\tmanager.getResponse(\"list of Bond 007 movies\");\n//\tmanager.getResponse(\"Disney movies\");\n\t\t//manager.keywordQuery(\"Paul Brown Stadium location\");\n\t\t//manager.keywordQuery(\"0Francesco\");\n System.out.println(\"******* keyword query *******\");\n\t\t//manager.keywordQuery(\"sportspeople in tennis\");\n\t\t//manager.keywordSearch(\"list of movies starring Sean Connery\",ElasticIndex.analyzed,100 );\n//\t\tmanager.keywordSearch(\"movies starring Sean Connery\",ElasticIndex.notStemmed,100 );\n// manager.keywordSearch(\"musical movies tony award\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"movies directed by Woody Allen\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"United states professional sports teams\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"computer games developed by Ubisoft\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"computer games developed by Ubisoft\",ElasticIndex.notStemmed,100 );\n// manager.keywordSearch(\"movies academy award nominations\",ElasticIndex.notStemmed,100 );\n System.out.println(SearchResultUtil.toSummary(manager.keywordSearch(\"movies directed by Woody Allen\",ElasticIndex.notLowercased,20 )));\n //manager.keywordSearch(\"grammy best album in 2012\",ElasticIndex.notAnalyzed,100 );\n //(better than analyzed) manager.keywordSearch(\"grammy best album in 2012\",ElasticIndex.notStemmed,100 );\n System.out.println(\"*****************************\");\n\n\t\t//manager.keywordQuery(\"Disney movies\");\n\t}", "List<PilotContainer> Search(String cas, String word);", "@Test\n public void findsByKeyword() throws Exception {\n final Base base = new DyBase(\n this.dynamo.region(), new MkSttc().counters().get(\"ttt\")\n );\n final Book book = base.books().add(\n \"@book{best2014, author=\\\"Walter\\\"}\"\n );\n final Quotes quotes = base.quotes();\n quotes.add(\n book, \"never give up and never think about bad things, Bobby\",\n \"99-101, 256-257, 315\"\n );\n MatcherAssert.assertThat(\n quotes.refine(\"bobby\").iterate(),\n Matchers.<Quote>iterableWithSize(1)\n );\n MatcherAssert.assertThat(\n quotes.refine(\"another-something\").iterate(),\n Matchers.<Quote>iterableWithSize(0)\n );\n }", "@Override\n\tpublic List<Document> findDocumentsByQuestion(String question) {\n\t\t\n\t\tString [] keyWords = question.split(\" \");\n\t\tList<Document> documents = new ArrayList<>();\n\t\t\n\t\tList<Filters> filters = filtersRepository.findByCommonsWordsWordIn(keyWords);\n\t\tfor(Filters f : filters){\n\t\t\tdocuments.addAll(f.getDocuments());\n\t\t}\n\t\t\n\t\treturn documents;\n\t}", "List<Cemetery> search(String query);", "public List<Document> retrieveQuery( Query aQuery, int TopN ) throws IOException {\n\t\t// NT: you will find our IndexingLucene.Myindexreader provides method: docLength()\n\t\t// implement your retrieval model here, and for each input query, return the topN retrieved documents\n\t\t// sort the documents based on their relevance score, from high to low\n\n\t\tHashMap<Integer, HashMap<String,Integer>> idTokenDocFrequencyMap = new HashMap<>();\t//docid - (token - document frequency) map\n\t\tHashMap<String, Long> tokenColFrequencyMap = new HashMap<>();\t// token - collection frequency map\n\t\tString content = aQuery.GetQueryContent();\n\t\tString[] tokens = content.split(\" \");\n\n\t\tfor(String token : tokens){\n\t\t\ttokenColFrequencyMap.put(token, indexReader.CollectionFreq(token)); \t// update the second map\n\t\t\tint [][]postingList = indexReader.getPostingList(token);\n\t\t\tif(postingList == null) continue;\n\t\t\tfor(int i = 0; i < postingList.length; i++){\n\t\t\t\tint docid = postingList[i][0];\n\t\t\t\tint freq = postingList[i][1];\n\t\t\t\tif(idTokenDocFrequencyMap.containsKey(docid)){\t\t// update the first map\n\t\t\t\t\tidTokenDocFrequencyMap.get(docid).put(token,freq);\n\t\t\t\t}else {\n\t\t\t\t\tHashMap<String,Integer> tokenFrequencyMap = new HashMap<>();\n\t\t\t\t\ttokenFrequencyMap.put(token,freq);\n\t\t\t\t\tidTokenDocFrequencyMap.put(docid,tokenFrequencyMap);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdouble U = 2000.0;\n\t\tList<Document> documentList = new ArrayList<>();\n\t\t// if use a docidList, it will have some duplicates.\n\t\tfor(Map.Entry<Integer, HashMap<String,Integer>> entry : idTokenDocFrequencyMap.entrySet()){\n\t\t\tdouble score = 1.0;\t\t\t// each document have one score\n\t\t\tint docid = entry.getKey();\n\t\t\tint docLen = indexReader.docLength(docid);\t// get document length\n\t\t\tHashMap<String,Integer> tokenDocFrequencyMap = idTokenDocFrequencyMap.get(docid);\n\t\t\tfor(String token : tokens){\t\t// for each token, not the token just exist in the document\n\t\t\t\tlong colFreq = tokenColFrequencyMap.getOrDefault(token,0l);\t// get collection frequency\n\t\t\t\tif(colFreq != 0){\n\t\t\t\t\tint docFreq = 0;\t// if this document don't have token, just set document frequency as 0\n\t\t\t\t\tif(tokenDocFrequencyMap.containsKey(token)){\n\t\t\t\t\t\tdocFreq = tokenDocFrequencyMap.get(token);\n\t\t\t\t\t}\n\t\t\t\t\tscore = score * (docFreq + U * ((double)colFreq / colLen)) / (docLen + U);\t//equation\n\t\t\t\t}\n\t\t\t}\n\t\t\tDocument document = new Document(docid+\"\", indexReader.getDocno(docid),score);\n\t\t\tdocumentList.add(document);\n\t\t}\n\n\t\tCollections.sort(documentList, new Comparator<Document>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Document o1, Document o2) {\n\t\t\t\treturn Double.compare(o2.score(),o1.score());\n\t\t\t}\n\t\t});\n\t\tList<Document> res = new ArrayList<>();\n\t\tfor(int i = 0 ; i < TopN; i++){\n\t\t\tres.add(documentList.get(i));\n\t\t}\n\t\treturn res;\n\t}", "public static SearchQuery buildAutocompleteKnowledgeQuery(String searchWord) {\n\n BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();\n boolQueryBuilder.should(QueryBuilders.matchQuery(\"nameNgram\", searchWord))\n .must(QueryBuilders.matchQuery(\"nameSimple\", searchWord));\n// boolQueryBuilder.must(QueryBuilders.matchQuery(\"nameNgram\", searchWord)).must(QueryBuilders.matchQuery(\"nameSimple\", searchWord));\n// boolQueryBuilder.should(QueryBuilders.matchQuery(\"nameNgram\", searchWord));\n\n return buildNativeQuery(boolQueryBuilder, 0, 20);\n }", "private DocFile[] search (String[] queries, String[] filters, BooleanClause.Occur filterOccur) throws ParseException {\n // create a master query builder\n BooleanQuery.Builder masterQueryBuilder = new BooleanQuery.Builder();\n // loop through all queries\n for (String query : queries) {\n if (query.equals(\"\")) continue;\n // create a boolean query for the each query\n BooleanQuery.Builder queryBuilder = new BooleanQuery.Builder();\n // loop through all filters\n for (String filter : filters) {\n if (filter.equals(\"\")) continue;\n QueryParser parser = new QueryParser(filter, analyzer);\n parser.setAllowLeadingWildcard(true);\n if (!filter.equals(Constants.INDEX_KEY_OWNER)) {\n Query parsedQ = parser.parse(query);\n queryBuilder.add(parsedQ, filterOccur);\n }\n else {\n queryBuilder.add(new PhraseQuery(filter, queries), filterOccur);\n }\n }\n masterQueryBuilder.add(queryBuilder.build(), BooleanClause.Occur.SHOULD);\n }\n\n // build the masterQuery\n BooleanQuery masterQuery = masterQueryBuilder.build();\n\n return searchResponse(searchExec(masterQuery), masterQuery);\n }", "Set<Document> findDocuments(Map<String, String> fields, int offset, int numberOfResults);", "@Override\n public String search(String word) {\n return search(word, root);\n }", "@Override\n public boolean onQueryTextSubmit(String query) {\n prepareBooks(engine.search(query.toLowerCase(),filter));\n return false;\n }", "@Test\n public void testCase2 () throws IOException {\n //\t\tlog.trace(\"Testcase2\");\n sq = new SpanSegmentQuery(new SpanTermQuery(new Term(\"base\", \"s:a\")),\n new SpanTermQuery(new Term(\"base\", \"s:b\")));\n\n kr = ki.search(sq, (short) 10);\n ki.close();\n\n assertEquals(\"totalResults\", kr.getTotalResults(), 3);\n // Match #0\n assertEquals(\"doc-number\", 1, kr.getMatch(0).getLocalDocID());\n assertEquals(\"StartPos\", 1, kr.getMatch(0).startPos);\n assertEquals(\"EndPos\", 2, kr.getMatch(0).endPos);\n // Match #2\n assertEquals(\"doc-number\", 2, kr.getMatch(2).getLocalDocID());\n assertEquals(\"StartPos\", 2, kr.getMatch(2).startPos);\n assertEquals(\"EndPos\", 3, kr.getMatch(2).endPos);\n }", "public abstract int search(String[] words, String wordToFind) throws ItemNotFoundException;", "public void parseQueryStringAndSearch(String searchString) {\n char[] chars = searchString.toCharArray();\n for (int i = 0; i < chars.length; i++) {\n Queue<Character> queue;\n int k;\n if (Character.isDigit(chars[i])) {\n k = Integer.parseInt(String.valueOf(chars[i]));\n i++;\n queue = new LinkedList<>();\n while (i < chars.length && chars[i] != ')') {\n queue.add(chars[i]);\n i++;\n }\n i++;\n String query = queryToString(queue);\n String[] terms = query.split(\" \");\n //System.out.println(query + \" and k: \" + k);\n positionIntersects(indexMap.get(analyzeTerm(terms[0])), indexMap.get(analyzeTerm(terms[1])), k);\n } else {\n queue = new LinkedList<>();\n while (i < chars.length && !Character.isDigit(chars[i])) {\n queue.add(chars[i]);\n i++;\n }\n i--;\n String query = queryToString(queue);\n String[] terms = query.trim().split(\" \");\n termQuerySearch(terms);\n }\n\n }\n\n }", "@Override\n public SearchDocument nextDocument(SearchQuery query, int docId) {\n return null;\n }", "public void doSearch(String query)\n \t{\n \t\tlistener.onQueryTextSubmit(query);\n \t}", "public void search() {\n }", "private static String lookForSentenceWhichContains(String[] words, String documentPath) throws IOException {\r\n\r\n File document = new File(documentPath);\r\n\r\n if (!document.exists()) throw new FileNotFoundException(\"File located at \"+documentPath+\" doesn't exist.\\n\");\r\n\r\n FileReader r = new FileReader(document);\r\n BufferedReader br = new BufferedReader(r);\r\n\r\n String line;\r\n String documentText = \"\";\r\n while ( (line=br.readLine()) != null) {\r\n documentText += line;\r\n }\r\n\r\n documentText = Jsoup.parse(documentText).text();\r\n\r\n String[] listOfSentences = documentText.split(\"\\\\.\");\r\n HashMap<String,String> originalToNormalized = new HashMap<>();\r\n String original;\r\n\r\n for (String sentence: listOfSentences){\r\n\r\n original = sentence;\r\n\r\n sentence = sentence.toLowerCase();\r\n sentence = StringUtils.stripAccents(sentence);\r\n sentence = sentence.replaceAll(\"[^a-z0-9-._\\\\n]\", \" \");\r\n\r\n originalToNormalized.put(original,sentence);\r\n }\r\n\r\n int matches, maxMatches = 0;\r\n String output = \"\";\r\n\r\n for (Map.Entry<String,String> sentence: originalToNormalized.entrySet()){\r\n\r\n matches = 0;\r\n\r\n for (String word: words){\r\n if (sentence.getValue().contains(word)) matches++;\r\n }\r\n\r\n if (matches == words.length) return sentence.getKey();\r\n if (matches > maxMatches){\r\n maxMatches = matches;\r\n output = sentence.getKey();\r\n }\r\n }\r\n\r\n return output;\r\n\r\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}", "Page<T> search(Pageable pageable, String query);", "@Test\n public void testCase1 () throws IOException {\n sq = new SpanSegmentQuery(new SpanTermQuery(new Term(\"base\", \"s:b\")),\n new SpanTermQuery(new Term(\"base\", \"s:c\")));\n\n kr = ki.search(sq, (short) 10);\n ki.close();\n\n assertEquals(\"totalResults\", kr.getTotalResults(), 3);\n assertEquals(\"StartPos (0)\", 1, kr.getMatch(0).startPos);\n assertEquals(\"EndPos (0)\", 2, kr.getMatch(0).endPos);\n assertEquals(\"StartPos (1)\", 4, kr.getMatch(1).startPos);\n assertEquals(\"EndPos (1)\", 5, kr.getMatch(1).endPos);\n }", "void search();", "void search();", "@Override\n public List<Document> findInDocuments(String collectionName, Bson query) {\n return null;\n }", "private boolean isTermAppearInQuery(String term) {\n boolean isTermAppear = false;\n query thisQuery = listDocumentRetrievedForThisQuery.getQuery();\n StringTokenizer token = new StringTokenizer(thisQuery.getQueryContent(), \" %&\\\"*#@$^_<>|`+=-1234567890'(){}[]/.:;?!,\\n\");\n while (token.hasMoreTokens()) {\n String keyTerm = token.nextToken();\n if (invertedFile.isStemmingApplied()) {\n keyTerm = StemmingPorter.stripAffixes(keyTerm);\n }\n if (term.equals(keyTerm.toLowerCase())) {\n isTermAppear = true;\n break;\n }\n }\n return isTermAppear;\n }", "Page<T> search(Pageable pageable, QueryBuilder query);", "public MagicSearch createMagicSearch();", "@Test\n public void testCase4 () throws IOException {\n //\t\tlog.trace(\"Testcase4\");\n\n ki = new KrillIndex();\n ki.addDoc(createFieldDoc0());\n ki.commit();\n ki.addDoc(createFieldDoc1());\n ki.addDoc(createFieldDoc2());\n ki.commit();\n\n sq = new SpanSegmentQuery(new SpanElementQuery(\"base\", \"e\"),\n new SpanNextQuery(new SpanTermQuery(new Term(\"base\", \"s:a\")),\n new SpanTermQuery(new Term(\"base\", \"s:b\"))));\n\n kr = ki.search(sq, (short) 10);\n ki.close();\n\n assertEquals(\"totalResults\", kr.getTotalResults(), 2);\n // Match #0\n assertEquals(\"doc-number\", 0, kr.getMatch(0).getLocalDocID());\n assertEquals(\"StartPos\", 3, kr.getMatch(0).startPos);\n assertEquals(\"EndPos\", 5, kr.getMatch(0).endPos);\n // Match #1\n assertEquals(\"doc-number\", 0, kr.getMatch(1).getLocalDocID());\n assertEquals(\"StartPos\", 1, kr.getMatch(1).startPos);\n assertEquals(\"EndPos\", 3, kr.getMatch(1).endPos);\n }", "public DocFile[] searchResponse(ScoreDoc[] results, Query query) {\n\n DocFile[] result = new DocFile[results.length];\n FastVectorHighlighter highlighter = new FastVectorHighlighter(true,true);\n FieldQuery highlightQuery = highlighter.getFieldQuery(query); \n\n try {\n IndexReader reader = DirectoryReader.open(indexDir);\n IndexSearcher searcher = new IndexSearcher(reader);\n\n for (int i = 0; i < results.length; i++) {\n int docId = results[i].doc;\n Document document = searcher.doc(docId);\n \n //Highlight the best Content context from each Doc\n String contextString = highlighter.getBestFragment(highlightQuery, \n searcher.getIndexReader(), results[i].doc,Constants.INDEX_KEY_CONTENT,140);\n \n DocFile toAdd = new DocFile(\n document.get(Constants.INDEX_KEY_FILENAME),\n document.get(Constants.INDEX_KEY_TITLE),\n document.get(Constants.INDEX_KEY_OWNER),\n document.get(Constants.INDEX_KEY_PATH),\n document.get(Constants.INDEX_KEY_STATUS).equalsIgnoreCase(\"true\"));\n \n if (contextString != null) {\n toAdd.setContextString(contextString);\n }\n \n toAdd.setId(document.get(Constants.INDEX_KEY_ID));\n toAdd.setPermissions(Integer.parseInt(document.get(Constants.INDEX_KEY_PERMISSION)));\n toAdd.setCourseCode(document.get(Constants.INDEX_KEY_COURSE));\n result[i] = toAdd;\n\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return result;\n }", "private List<SearchWord> getSearchWords(Long lastUpdateTime) {\n return new ArrayList<>();\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic JSONArray findMatches(String query){\n\t\t\n\t\t// Increment the search tasks counter\n\t\t++numOfSearchTasks;\n\t\t\n\t\t// Start the timer for this task\n\t\tTimer.start();\n\t\t\n\t\t// Number of needed matches\n\t\tresultsToBeFound = 10;\n\t\t\n\t\t// Clear the matches list\n\t\tsetForTypeahead.clear();\n\t\t\n\t\t// The returned JSON array\n\t\tJSONArray arrayObj = new JSONArray();\n\t\t\n\t\t// Search in all predicates\n\t\tfor(int i = 0; i < predicatesList.size(); ++i){\n\t\t\tif(predicatesList.get(i).toLowerCase().contains(query.toLowerCase())){\n\t\t\t\tarrayObj.add(predicatesList.get(i));\n\t\t\t}\n\t\t\tArrayList<String> semanticRelations = semanticRelationsMap.get(query.toLowerCase());\n\t\t\tif(semanticRelations != null) {\n\t\t\t\tfor(String s : semanticRelations) {\n\t\t\t\t\tif(predicatesList.get(i).toLowerCase().contains(s.toLowerCase())){\n\t\t\t\t\t\tarrayObj.add(predicatesList.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Start the timer for this task\n\t\tTimer.start();\n\t\t\n\t\t// Search in index first\n\t\tCollection<Integer> list = in.search(query.toLowerCase());\n\t\tHashSet<Integer> output = null;\n\t\tif(list.size() > 0) {\n\t\t\toutput = (HashSet<Integer>) list;\n\t\t}\n\t\telse {\n\t\t\toutput = new HashSet<Integer>();\n\t\t}\n\n\t\t// If found a match, that's a hit\n\t\tif(output.size() > 0) {\n\t\t\t++numOfIndexHits;\n\t\t}\n\t\t\n\t\tfor(Integer index : output) {\n\t\t\tarrayObj.add(frequentLiteralsList.get(index));\n \t\t--resultsToBeFound;\n \t}\n\t\tdouble tempStopTime;\n\t\t// If all results were found in suffix tree\n\t\tif(resultsToBeFound < 0) {\n\t\t\tTimer.stop();\n\t\t\tsuffixTreeTime += Timer.getTimeInSeconds();\n\t\t\ttotalTime += Timer.getTimeInSeconds();\n\t\t\twriteStatsToFile();\n\t\t\treturn arrayObj;\n\t\t}\n\t\t\n\t\tTimer.stop();\n\t\tsuffixTreeTime += Timer.getTimeInSeconds();\n\t\ttempStopTime = Timer.getTimeInSeconds();\n\t\tTimer.start();\n\t\t// In length bins\n\t\t// Search in bins with a minimum length of the query\n\t\t// and a maximum of the query length + 10\n\t\tint minLength = query.length()-1;\n\t\tint maxLength = query.length() + 9;\n\t\t\n\t\tint minIndex = Integer.MAX_VALUE;\n\t\tint maxIndex = -1;\n\t\t\n\t\t// Determine which indices of the literals array\n\t\t// to search within\n\t\tfor(int i = 0; i < lengths.size(); ++i){\n\t\t\tif(lengths.get(i) > maxLength) {\n\t\t\t\tmaxIndex = indexes.get(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(minLength >= lengths.get(i)) {\n\t\t\t\tminIndex = indexes.get(i);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpruningPercentage += 1 - (1.0 * (maxIndex - minIndex) / literalsList.size());\n\t\ttry{\n\t\tSystem.out.println(\"Searching for \" + query + \" between indeces: \" + minIndex + \n\t\t\t\t\" corresponding to length \" + (literalsList.get(minIndex).length()-5) +\n\t\t\t\t\" and \" + maxIndex + \" corresponding to length \" + \n\t\t\t\t(literalsList.get(maxIndex).length()-5));\n\t\t}\n\t\tcatch(IndexOutOfBoundsException e) {\n\t\t\tSystem.out.println(\"query = \" + query);\n\t\t\tSystem.out.println(\"minIndex = \" + minIndex);\n\t\t\tSystem.out.println(\"maxIndex = \" + maxIndex);\n\t\t}\n\t\t\n\t\t// Assign threads to search tasks\n\t\tint indexesPerThread = (maxIndex - minIndex) / (numOfCores);\n\t\t\n\t\t// Arraylist to keep track of threads\n\t\tArrayList<Thread> threads = new ArrayList<Thread>();\n\t\t\n\t\tfor(int i = minIndex; i < maxIndex; i += indexesPerThread) {\n\t\t\tthreads.add(new Thread(new SearchTask(i, i + indexesPerThread, query)));\n\t\t}\n\t\t\n\t\t// Start threads\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\tthreads.get(i).start();\n\t\t}\n\t\t\n\t\t// Join threads before continue\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\ttry {\n\t\t\t\tthreads.get(i).join();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Stop timer\n\t\tTimer.stop();\n\t\ttotalTime += tempStopTime + Timer.getTimeInSeconds();\n\t\t\n\t\t// Sort by length\n\t\tArrayList<String> tempList = new ArrayList<String>();\n\t\tfor(String string : setForTypeahead) {\n\t\t\tif(!arrayObj.contains(string))\n\t\t\t\ttempList.add(string);\n\t\t}\n\t\tjava.util.Collections.sort(tempList, new LengthComparator());\n\t\t\n\t\t// Fill the array\n\t\tfor(int i = 0; i < tempList.size() && resultsToBeFound > 0; ++i, --resultsToBeFound) {\n\t\t\tarrayObj.add(tempList.get(i));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Update the stats file with number of tasks and hits\n\t\twriteStatsToFile();\n\t\t\n\t\treturn arrayObj;\n\t}", "void findAllWords() {\n\t\tScanner in = new Scanner(textEditor.getText());\n\t\tint head = 0;\n\t\twhile (in.hasNext()) {\n\t\t\tString value = in.next();\n\t\t\tif (value.equals(findWord)) {\n\t\t\t\tint tail = value.length();\n\t\t\t\tfinder.add(new WordPosition(head, tail + head +1));\n\t\t\t}\n\t\t\thead += (value.length()+1);\n\t\t}\n\t\tin.close();\n\t}", "private void performSearch() {\n String text = txtSearch.getText();\n String haystack = field.getText();\n \n // Is this case sensitive?\n if (!chkMatchCase.isSelected()) {\n text = text.toLowerCase();\n haystack = haystack.toLowerCase();\n }\n \n // Check if it is a new string that the user is searching for.\n if (!text.equals(needle)) {\n needle = text;\n curr_index = 0;\n }\n \n // Grab the list of places where we found it.\n populateFoundList(haystack);\n \n // Nothing was found.\n if (found.isEmpty()) {\n Debug.println(\"FINDING\", \"No occurrences of \" + needle + \" found.\");\n JOptionPane.showMessageDialog(null, \"No occurrences of \" + needle + \" found.\",\n \"Nothing found\", JOptionPane.INFORMATION_MESSAGE);\n \n return;\n }\n \n // Loop back the indexes if we have reached the end.\n if (curr_index == found.size()) {\n curr_index = 0;\n }\n \n // Go through the findings one at a time.\n int indexes[] = found.get(curr_index);\n field.select(indexes[0], indexes[1]);\n curr_index++;\n }", "public static void textQueries(List<String> sentences, List<String> queries) {\n // Write your code here\n for(String q: queries){\n boolean a = false;\n int i=0;\n for(String s: sentences){\n if(Arrays.asList(s.split(\" \")).containsAll(Arrays.asList(q.split(\" \")))){\n System.out.print(i+\" \");\n a = true;\n }\n i++;\n }\n if(!a)\n System.out.println(-1);\n else\n System.out.println(\"\");\n }\n \n }", "public void searchIndexWithTermQueryByBody(final String toSearch) throws IOException, ParseException {\n searchIndexWithTermQuery(toSearch, \"body\", DEFAULT_LIMIT);\n }", "Search getSearch();", "private static Boolean specialQueries(String query) throws ClassNotFoundException, InstantiationException, IllegalAccessException {\n clickList = false;\n //newCorpus = true;\n\n if (query.equals(\"q\")) {\n\n System.exit(0);\n return true;\n }\n\n String[] subqueries = query.split(\"\\\\s+\"); //split around white space\n\n if (subqueries[0].equals(\"stem\")) //first term in subqueries tells computer what to do \n {\n GUI.JListModel.clear();\n GUI.ResultsLabel.setText(\"\");\n TokenProcessor processor = new NewTokenProcessor();\n if (subqueries.length > 1) //user meant to stem the token not to search stem\n {\n List<String> stems = processor.processToken(subqueries[1]);\n\n //clears list and repopulates it \n String stem = \"Stem of query '\" + subqueries[1] + \"' is '\" + stems.get(0) + \"'\";\n\n GUI.ResultsLabel.setText(stem);\n\n return true;\n }\n\n } else if (subqueries[0].equals(\"vocab\")) {\n List<String> vocabList = Disk_posIndex.getVocabulary();\n GUI.JListModel.clear();\n GUI.ResultsLabel.setText(\"\");\n\n int vocabCount = 0;\n for (String v : vocabList) {\n if (vocabCount < 1000) {\n vocabCount++;\n GUI.JListModel.addElement(v);\n }\n }\n GUI.ResultsLabel.setText(\"Total size of vocabulary: \" + vocabCount);\n return true;\n }\n\n return false;\n }" ]
[ "0.7247035", "0.6326672", "0.61507344", "0.614432", "0.6127424", "0.61083686", "0.60629725", "0.60173154", "0.5970413", "0.59642434", "0.595486", "0.59493905", "0.5948072", "0.5947946", "0.5944434", "0.5918083", "0.59072393", "0.5887826", "0.58828676", "0.58804107", "0.5874601", "0.58453447", "0.58405197", "0.58261496", "0.58032167", "0.58024776", "0.57938033", "0.5765702", "0.5764247", "0.5741455", "0.5736575", "0.5722735", "0.57102543", "0.56955045", "0.5693578", "0.56882", "0.56584895", "0.5657661", "0.5642594", "0.5636657", "0.5628783", "0.56138533", "0.56103", "0.56093293", "0.56061774", "0.5588893", "0.5581583", "0.5576428", "0.55657125", "0.5539316", "0.5535463", "0.55315137", "0.553116", "0.55238885", "0.5523665", "0.5521453", "0.55085516", "0.5501453", "0.54891545", "0.5488139", "0.54749084", "0.546393", "0.5462747", "0.5462017", "0.54545933", "0.54507387", "0.5447161", "0.54422414", "0.5441447", "0.5440184", "0.544018", "0.5438049", "0.54374784", "0.5434466", "0.54322106", "0.5424088", "0.54239994", "0.5418512", "0.54134786", "0.5410486", "0.54064715", "0.54029024", "0.5401156", "0.54010284", "0.5391461", "0.5391461", "0.5384889", "0.5382696", "0.5373321", "0.5367916", "0.5365786", "0.53656626", "0.5365409", "0.5362767", "0.5354548", "0.53532493", "0.5344425", "0.5344344", "0.53431", "0.53379005" ]
0.60083085
8
[NEW] Finds documents containing a twowords phrase
public PostingsList phrase_query(PostingsList l1, PostingsList l2){ PostingsList phrase = new PostingsList(); // Counters to iterate docIDs int count1 = 0; int count2 = 0; // Counters to iterate positional indices int subcount1 = 0; int subcount2 = 0; // First posting PostingsEntry p1 = l1.get(0); PostingsEntry p2 = l2.get(0); // List of positional indices (changes at each iteration) LinkedList<Integer> ll1; LinkedList<Integer> ll2; // Used to store positional index int pp1; int pp2; while(true){ // docID match (1/2) // if (p1.docID == p2.docID){ // Obtain list of positional indices ll1 = p1.positions; ll2 = p2.positions; // First positional indices pp1 = ll1.get(0); pp2 = ll2.get(0); // Initialize counter subcount1 = 0; subcount2 = 0; // Search if the phrase exists while(true){ // Match, consecutive words (2/2) - EUREKA! // if (pp1+1 == pp2){ // Save found match (docID and positional index of last // word) phrase.insert(p1.docID, pp2); // Increase counters and pos indices if list is not finished subcount1++; subcount2++; if (subcount1<ll1.size() && subcount2<ll2.size()){ pp1 = ll1.get(subcount1); pp2 = ll2.get(subcount2); } // If list finished, break else break; } // Not match else if (pp1+1 < pp2){ subcount1++; if (subcount1<ll1.size()) pp1 = ll1.get(subcount1); // If list finished, break else break; } // Not match else{ subcount2++; if (subcount2<ll2.size()) pp2 = ll2.get(subcount2); else break; } } // Once we finished looking at the list of positional indices of one // posting, increase counters and go to next postings (if there are) count1++; count2++; if (count1<l1.size() && count2<l2.size()){ p1 = l1.get(count1); p2 = l2.get(count2); } else{ break; } } // docID not match, increase lowest counter else if (p1.docID < p2.docID){ count1++; if (count1<l1.size()){ p1 = l1.get(count1); } else{ break; } } // docID not match, increase lowest counter else{ count2++; if (count2<l2.size()){ p2 = l2.get(count2); } else{ break; } } } return phrase; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testPhrase() {\n assertQ(req(\"q\",\"text:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='1']\"\n );\n // should generate a query of (now OR cow) and match both docs\n assertQ(req(\"q\",\"text_np:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='2']\"\n );\n }", "private static String lookForSentenceWhichContains(String[] words, String documentPath) throws IOException {\r\n\r\n File document = new File(documentPath);\r\n\r\n if (!document.exists()) throw new FileNotFoundException(\"File located at \"+documentPath+\" doesn't exist.\\n\");\r\n\r\n FileReader r = new FileReader(document);\r\n BufferedReader br = new BufferedReader(r);\r\n\r\n String line;\r\n String documentText = \"\";\r\n while ( (line=br.readLine()) != null) {\r\n documentText += line;\r\n }\r\n\r\n documentText = Jsoup.parse(documentText).text();\r\n\r\n String[] listOfSentences = documentText.split(\"\\\\.\");\r\n HashMap<String,String> originalToNormalized = new HashMap<>();\r\n String original;\r\n\r\n for (String sentence: listOfSentences){\r\n\r\n original = sentence;\r\n\r\n sentence = sentence.toLowerCase();\r\n sentence = StringUtils.stripAccents(sentence);\r\n sentence = sentence.replaceAll(\"[^a-z0-9-._\\\\n]\", \" \");\r\n\r\n originalToNormalized.put(original,sentence);\r\n }\r\n\r\n int matches, maxMatches = 0;\r\n String output = \"\";\r\n\r\n for (Map.Entry<String,String> sentence: originalToNormalized.entrySet()){\r\n\r\n matches = 0;\r\n\r\n for (String word: words){\r\n if (sentence.getValue().contains(word)) matches++;\r\n }\r\n\r\n if (matches == words.length) return sentence.getKey();\r\n if (matches > maxMatches){\r\n maxMatches = matches;\r\n output = sentence.getKey();\r\n }\r\n }\r\n\r\n return output;\r\n\r\n }", "private ArrayList<WordDocument> getDocumentsWhereWordExists(String word){\n try{\n return dictionary.get(word).getDocumentWhereWordExistsIn();\n }catch (NullPointerException ex){\n return new ArrayList<WordDocument>();\n }\n }", "public List<String> findPhrases() {\n\t\t\n\t\tTrie root = new Trie();\n\t\tList<String> result = new ArrayList<>();\n\t\tQueue<TrieNode> queue = new LinkedList<>();\n\n\t\tfor (String phrase : phrases) {\n\t\t\t// build the trie\n\t\t\t\n\t\t\troot.insert(phrase);\n\t\t}\n\t\t\n\t\t// initialize the queue\n\t\tqueue.offer(root.getRootNode());\n\t\t\t\t\n\t\tfor (String word : stream) {\n\t\t\t\n\t\t\t// Search one word at a time and store TrieNodes that match this word.\n\t\t\t// If the current word extends a previous TrieNode, it may be a matching phrase\n\t\t\t\n\t\t\t// buffer to store current matches\n\t\t\tQueue<TrieNode> buffer = new LinkedList<>();\n\t\t\t\n\t\t\twhile(!queue.isEmpty()) {\n\t\t\t\t// iterate through previous matches\n\t\t\t\t\n\t\t\t\tTrieNode next = queue.poll().find(word);\n\t\t\t\t\n\t\t\t\tif (next != null) {\n\t\t\t\t\t\n\t\t\t\t\t// if this word extends the previous word, add it to the buffer\n\t\t\t\t\t// in case the next word can also extend it\n\t\t\t\t\t\n\t\t\t\t\tbuffer.offer(next);\n\t\t\t\t\t\n\t\t\t\t\tif (next.isPhrase()) {\n\t\t\t\t\t\t// if we found a valid phrase node, add it to the result\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tresult.add(next.getPhrase());\n\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\tqueue = buffer;\n\t\t\tqueue.offer(root.getRootNode());\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public boolean find(T word);", "private static String handlePhrases(String PubmedQuery) {\r\n //Find phrases \"between double quotes\"\r\n String[] phrases = PubmedQuery.split(\"\\\"\");\r\n for(int i = 0 ; i < phrases.length ; i++){\r\n phrases[i] = phrases[i].trim();\r\n if(!phrases[i].equals(\"\")){ // String not Empty\r\n if(i%2 != 0){ // String surrounded by quotes, i.e. a phrase\r\n phrases[i] = \"\\\"\" + phrases[i] + \"\\\"\";\r\n } else { // not a phrase, i.e. a bag of terms, operator or [field of index] (inside brackets)\r\n if(phrases[i].startsWith(\"[\")){ //index field of previus component contained (i.e. case: \"...\"[...])\r\n boolean perviusPhraseFound = false; // True if index field was added to previus phrase element\r\n // Get index field of previus component and handle proprietly\r\n String [] tokens = phrases[i].split(\"]\");\r\n String indexField = tokens[0].replace(\"[\", \"\");\r\n String luceneField = supportedIndexFields.get(indexField);\r\n if(luceneField != null){ \r\n //add \"indexField:\" as a prefix in previus (not empty) phrase\r\n int tmp = i-1;\r\n while(!perviusPhraseFound & tmp >= 0){\r\n if(!phrases[tmp].equals(\"\")){\r\n perviusPhraseFound = true;\r\n //TO DO : handle wrong syntax (e.g. ... AND [ArticleTitle])\r\n phrases[tmp] = luceneField + \":\" + phrases[tmp] + \"\";\r\n } else {\r\n tmp--;\r\n }\r\n }\r\n } // else : Lucene counterpart not found, unsupported field - do nothing\r\n // Remove from current phrase this index field (prefix)\r\n phrases[i] = phrases[i].substring(indexField.length()+2 );\r\n } \r\n // Further handling...\r\n phrases[i] = handleNonPhraseToken(phrases[i]);\r\n }\r\n } //else { /* Empty token, do nothing with this */ System.out.println(\"\\t\\t\\t empty\"); }\r\n }\r\n \r\n String luceneQuery = \"\";\r\n boolean fisrtPhrase = true;\r\n for(int i = 0 ; i < phrases.length ; i ++){\r\n if(phrases[i].length() > 0){\r\n if(!phrases[i].startsWith(\" OR \") & !phrases[i].startsWith(\" -\") & !phrases[i].startsWith(\" +\") ){\r\n if(fisrtPhrase){\r\n luceneQuery += \" +\";\r\n fisrtPhrase = false;\r\n } else {\r\n if(!phrases[i-1].endsWith(\" OR \") & !phrases[i-1].endsWith(\" -\") & !phrases[i-1].endsWith(\" +\")){\r\n luceneQuery += \" +\";\r\n }\r\n } \r\n } // add default operator + when required (no OR or - is present for that term)\r\n luceneQuery += phrases[i];\r\n }// else empty phrase : skip\r\n }\r\n return luceneQuery;\r\n }", "@Override\r\n\t\t\tpublic boolean containsTerm(Document document, String term) {\n\t\t\t\treturn false;\r\n\t\t\t}", "private static List<SearchData> booleanSearchWord(Query query, Indexer si) {\n Tokenizer tkn = new SimpleTokenizer();\n tkn.tokenize(query.getStr(), \"[a-zA-Z]{3,}\", true, true);\n List<SearchData> searchList = new ArrayList<>();\n LinkedList<Token> wordsList = tkn.getTokens();\n Iterator<Token> wordsIt = wordsList.iterator();\n HashMap<String, LinkedList<Posting>> indexer = si.getIndexer();\n int idx;\n SearchData searched_doc;\n\n while (wordsIt.hasNext()) {\n String word = wordsIt.next().getSequence();\n if (indexer.containsKey(word)) {\n\n LinkedList<Posting> posting = indexer.get(word);\n\n for (Posting pst : posting) {\n\n SearchData sd = new SearchData(query, pst.getDocId());\n\n if (!searchList.contains(sd)) {\n sd.setScore(1);\n searchList.add(sd);\n } else {\n idx = searchList.indexOf(sd);\n searched_doc = searchList.get(idx);\n searched_doc.setScore(searched_doc.getScore() + 1);\n }\n }\n\n }\n\n\n }\n\n Collections.sort(searchList);\n\n return searchList;\n }", "List<String> searchTweets(String keywords) throws TwitterException;", "public List<String> getRelatedWords(String word) throws IOException {\n List<String> result = new ArrayList<String>();\n IDictionary dict = new Dictionary(new File(WORDNET_LOCATION));\n try {\n dict.open();\n IStemmer stemmer = new WordnetStemmer(dict);\n for (POS pos : EnumSet.of(POS.ADJECTIVE, POS.ADVERB, POS.NOUN, POS.VERB)) {\n List<String> resultForPos = new ArrayList<String>();\n List<String> stems = new ArrayList<String>();\n stems.add(word);\n for (String stem : stemmer.findStems(word, pos)) {\n if (!stems.contains(stem))\n stems.add(stem);\n }\n for (String stem : stems) {\n if (!resultForPos.contains(stem)) {\n resultForPos.add(stem);\n IIndexWord idxWord = dict.getIndexWord(stem, pos);\n if (idxWord == null) continue;\n List<IWordID> wordIDs = idxWord.getWordIDs();\n if (wordIDs == null) continue;\n IWordID wordID = wordIDs.get(0);\n IWord iword = dict.getWord(wordID);\n \n ISynset synonyms = iword.getSynset();\n List<IWord> iRelatedWords = synonyms.getWords();\n if (iRelatedWords != null) {\n for (IWord iRelatedWord : iRelatedWords) {\n String relatedWord = iRelatedWord.getLemma();\n if (!resultForPos.contains(relatedWord))\n resultForPos.add(relatedWord);\n }\n }\n \n List<ISynsetID> hypernymIDs = synonyms.getRelatedSynsets();\n if (hypernymIDs != null) {\n for (ISynsetID relatedSynsetID : hypernymIDs) {\n ISynset relatedSynset = dict.getSynset(relatedSynsetID);\n if (relatedSynset != null) {\n iRelatedWords = relatedSynset.getWords();\n if (iRelatedWords != null) {\n for (IWord iRelatedWord : iRelatedWords) {\n String relatedWord = iRelatedWord.getLemma();\n if (!resultForPos.contains(relatedWord))\n resultForPos.add(relatedWord);\n }\n }\n }\n }\n }\n }\n }\n for (String relatedWord : resultForPos) {\n if (relatedWord.length() > 3\n && !relatedWord.contains(\"-\")\n && !result.contains(relatedWord)) {\n // TODO: Hack alert!\n // The - check is to prevent lucene from interpreting hyphenated words as negative search terms\n // Fix!\n result.add(relatedWord);\n }\n }\n }\n } finally {\n dict.close();\n }\n return result;\n }", "public SearchResult search(String text, String subText);", "@Test\n\tpublic void singleWordGrepTest4() throws Exception {\n\t\t// word is 'undocumented'\n\t\tHashSet<String> grepFound = loadGrepResults(\"undocumented\");\n\t\tCollection<Page> index = queryTest.query(\"undocumented\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\t// tests set equality \n\t\tassertEquals(indexFound, grepFound);\n\t}", "public abstract int search(String[] words, String wordToFind) throws ItemNotFoundException;", "public Double[] SentiwordsMatch(String tweets) throws IOException\r\n {\r\n String[] ar=new String[100];\r\n \r\n ar=tweets.split(\" \");\r\n \r\n /* for(String splited_text:ar)\r\n System.out.println(splited_text);*/\r\n \r\n Double price[]=PriceCalculator(ar);\r\n \r\n \r\n return price;\r\n \r\n }", "PsiFile[] findFilesWithPlainTextWords( String word);", "ArrayList<String> searchWordTweet(String word) throws SQLException {\r\n //Query che seleziona il mittente e il corpo data una parola\r\n String query=\"SELECT DISTINCT mittente,corpo FROM tweet WHERE corpo LIKE '%\"+word+\"%'\";\r\n //Oggetti per interrogare il db\r\n Statement statement=null;\r\n connection=DBConnection.connect();\r\n ResultSet resultSet=null;\r\n //Lista messaggi\r\n ArrayList<String> tweetsList = new ArrayList<>();\r\n\r\n try {\r\n statement=connection.createStatement();\r\n resultSet = statement.executeQuery(query);\r\n while(resultSet.next()){\r\n String mittente = resultSet.getString(\"mittente\");\r\n String corpo = resultSet.getString(\"corpo\");\r\n tweetsList.add(mittente+\": \"+corpo);\r\n }\r\n\r\n return tweetsList;\r\n }catch (SQLException e){\r\n e.printStackTrace();\r\n }finally {\r\n if (connection!=null) connection.close();\r\n if (statement!=null) statement.close();\r\n if(resultSet!=null) resultSet.close();\r\n }\r\n return null;\r\n }", "public boolean search(String word) {\n\t\treturn startsWith(word) && cur.isWord == true;\n\t}", "public void getThesaurusMap (String wordTofind) {\r\n\t \tfor (Entry<String, List> entry : tMap.entrySet()) {\r\n\t \t\tList singleListofSynonims = entry.getValue();\r\n\t \t\tif (singleListofSynonims.contains(wordTofind)){\r\n\t \t\t\t\r\n\t \t\t\tmappedList.add(singleListofSynonims);\r\n\t \t\t\tGoogleToThesarus.put(wordTofind,singleListofSynonims);\r\n\t \t\t}\r\n\t \t\telse {\r\n\t \t\t\t//System.out.println(\"value not in map\");\r\n\t \t}\r\n\t \t}\r\n\t }", "private void wordSearch(String word, HashMap<String, SearchResult> resultMap, ArrayList<SearchResult> words) {\n\t\tfor (String path : index.get(word).keySet()) {\n\t\t\tint frequency = index.get(word).get(path).size();\n\t\t\tint initialPosition = index.get(word).get(path).first();\n\t\t\t\n\t\t\tif (!resultMap.containsKey(path)) {\n\t\t\t\tresultMap.put(path, new SearchResult(frequency, initialPosition, path));\n\t\t\t\twords.add(resultMap.get(path));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSearchResult searchResult = resultMap.get(path);\n\t\t\t\tsearchResult.addToFrequency(frequency);\n\t\t\t\tsearchResult.updateInitialPosition(initialPosition);\n\t\t\t}\n\t\t}\n\t}", "public static boolean searchWordInTemplateString(TemplateString tStr, String word) {\n\t\tString text = tStr.string;\r\n\t\tint currentIndex = 0;\r\n\t\tfor(int j = 0; j < text.length() && currentIndex < word.length(); j++) {\r\n\t\t\tchar c = text.charAt(j);\r\n\t\t\t// Check uppercase\r\n\t\t\tif(c >= 'A' && c <= 'Z') c = (char) (c + 'a' - 'A');\r\n\t\t\t// Check if equal to current word char\r\n\t\t\tif(c == word.charAt(currentIndex)) {\r\n\t\t\t\t// If last index then the word exists in template\r\n\t\t\t\tif(currentIndex == word.length() - 1) return true;\r\n\t\t\t\t// Otherwise add one to index\r\n\t\t\t\tcurrentIndex++;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif(currentIndex > 0 && ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'))) {\r\n\t\t\t\t// If the char was alphanumerical but unequal, the word train was broken..\r\n\t\t\t\tcurrentIndex = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@RequestMapping(value = \"/search-in-doc/{id}\", \n\t\t\t\t\tmethod = RequestMethod.GET)\n\tpublic ResponseEntity<?> searchInDoc(@PathVariable(\"id\") String id, \n\t\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"word\", required = true) String word) throws IOException {\n\n\t\tboolean foundFile = false; // denota si el archivo fue encontrado\n\t\t\n\t\tString pageToken = null;\n\t\tdo { // proceso de busqueda\n\t\t\tFileList result = DriveConnection.driveService.files().list() \n\t\t\t\t .setSpaces(\"drive\")\n\t\t\t .setFields(\"nextPageToken, files(id)\") \n\t\t\t .setPageToken(pageToken)\n\t\t\t .execute();\n\t\t\n\t\t\t\t for (File file : result.getFiles()) { \n\t\t\t\t\t if (file.getId().equals(id)) {\n\t\t\t\t\t\t\tfoundFile = true;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \n\t\t\t pageToken = result.getNextPageToken();\n\t\t} while (pageToken != null);\n\t\t\n\t\tif (foundFile) {\n\t\t\t\n\t\t\tFile content = DriveConnection.driveService.files().get(id).execute();\t\n\t\t\tcontent.toString().contains(word);\t\n\t\t\treturn new ResponseEntity<>(\"Found\", HttpStatus.OK); // mostramos rpta en consola\n\t\t\t\t\n\t\t} else {\t\n\t\t\t\n\t\t\treturn new ResponseEntity<>(\"Not found\", HttpStatus.NOT_FOUND); // mostramos rpta en consola\n\t\t\t\n\t\t}\n\t\n\t}", "@In String search();", "void findAllWords() {\n\t\tScanner in = new Scanner(textEditor.getText());\n\t\tint head = 0;\n\t\twhile (in.hasNext()) {\n\t\t\tString value = in.next();\n\t\t\tif (value.equals(findWord)) {\n\t\t\t\tint tail = value.length();\n\t\t\t\tfinder.add(new WordPosition(head, tail + head +1));\n\t\t\t}\n\t\t\thead += (value.length()+1);\n\t\t}\n\t\tin.close();\n\t}", "public int searchWord(File filePath, String s1) throws IOException, NullPointerException\r\n\t{\r\n\t\tint counter = 0;\r\n\t\tString data = \"\";\r\n\t\tBufferedReader bufferReader = new BufferedReader(new FileReader(filePath));\r\n\t\tString line = null;\r\n\t\twhile ((line = bufferReader.readLine()) != null)\r\n\t\t{\r\n\t\t\tdata = data + line;\r\n\t\t}\r\n\t\tbufferReader.close();\r\n\t\tString txt = data;\r\n\t\tBoyerMoore bm = new BoyerMoore(s1);\r\n\t\tint offset = 0;\r\n\t\tfor (int loc = 0; loc <= txt.length(); loc += offset + s1.length())\r\n\t\t{\r\n\t\t\t offset = bm.search(s1, txt.substring(loc));\r\n\t\t\t if ((offset + loc) < txt.length())\r\n\t\t\t { \r\n\t\t\t\t counter++; \r\n\t\t\t\t System.out.printf(\"The word '\"+s1 +\"' is present at the position \" + (offset + loc)+\"\\n\"); //printing position of word \r\n\t\t\t } \r\n\t\t}\r\n\t\tif(counter!=0)\r\n\t\t{ \r\n\t\t\t System.out.println(\" In the FILE: \"+filePath.getName()+\"\\n\");\r\n\t\t}\r\n\t\treturn counter; \r\n\t}", "public static String findMultipleOccorancesOfGivenWord(String sentence,String word)\n {\n if(sentence == null || word == null || sentence == \"\" || word == \"\"){\n return \"Please enter valid sentence and word.It should not be empty and null\";\n }\n String result = \"\";\n Pattern pattern = Pattern.compile(word);\n Matcher matcher = pattern.matcher(sentence);\n while(matcher.find()) {\n\n result = result + \"Found at:\"+ matcher.start() + \" - \" + matcher.end() + \" \";\n }\n\n return result.trim();\n\n }", "private boolean isTermAppearInQuery(String term) {\n boolean isTermAppear = false;\n query thisQuery = listDocumentRetrievedForThisQuery.getQuery();\n StringTokenizer token = new StringTokenizer(thisQuery.getQueryContent(), \" %&\\\"*#@$^_<>|`+=-1234567890'(){}[]/.:;?!,\\n\");\n while (token.hasMoreTokens()) {\n String keyTerm = token.nextToken();\n if (invertedFile.isStemmingApplied()) {\n keyTerm = StemmingPorter.stripAffixes(keyTerm);\n }\n if (term.equals(keyTerm.toLowerCase())) {\n isTermAppear = true;\n break;\n }\n }\n return isTermAppear;\n }", "public String searchTweet(String searchString) {\n\t\treturn restClient.searchTweet(searchString);\n\t}", "@Test\n public void findsByKeyword() throws Exception {\n final Base base = new DyBase(\n this.dynamo.region(), new MkSttc().counters().get(\"ttt\")\n );\n final Book book = base.books().add(\n \"@book{best2014, author=\\\"Walter\\\"}\"\n );\n final Quotes quotes = base.quotes();\n quotes.add(\n book, \"never give up and never think about bad things, Bobby\",\n \"99-101, 256-257, 315\"\n );\n MatcherAssert.assertThat(\n quotes.refine(\"bobby\").iterate(),\n Matchers.<Quote>iterableWithSize(1)\n );\n MatcherAssert.assertThat(\n quotes.refine(\"another-something\").iterate(),\n Matchers.<Quote>iterableWithSize(0)\n );\n }", "@Test\n\tpublic void phraseGrepTest1() throws Exception {\n\t\t// phrase is \"I am forced\"\n\t\tHashSet<String> grepFound = loadGrepResults(\"i+am+forced\");\n\t\tCollection<Page> index = queryTest.query(\"\\\"I am Forced\\\"\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\t// tests set equality \n\t\tassertEquals(indexFound, grepFound);\n\t}", "public boolean isNoun (String word){\n for(int i = 0; i< SynSets.length; i++){\n if(SynSets[0][1].contains(\" \"+word+\" \")) return true;\n }\n return false;\n }", "public void SearchPhrase(Object_Ord temp) {\n\tif (!Doneloading) {\r\n\t return;\r\n\t}\r\n\tif (temp == null) {\r\n\t return;\r\n\t} else if (temp.Ordet.equals(\"\")) {\r\n\t return;\r\n\t}\r\n\ttemp.Set_Searched();\r\n\t//PrintAction( this.getClass().toString() + \" Searching for phrase \" + temp.Ordet );\r\n\tThread thread = new Thread_PhraseSearcher(this, temp);\r\n\tThreadsRunning++;\r\n\tThreadsStarted++;\r\n }", "private String search_words(String word, int index){\n\t\tString found_words = \"\";\n\t\tint local_index = index +1;\n\t\t//We try to find the word within our childs\n\t\tfor(LexiNode child: childs){\n\t\t\tif(local_index > word.length()-1 || word.toLowerCase().charAt(local_index) == Character.toLowerCase(child.getRepresentative_letter()))\n\t\t\t\tfound_words += child.search_words(word, local_index);\n\t\t}\n\t\tif(current_word != null && word.length() > current_word.length())\n\t\t\treturn found_words;\n\t\tif(current_word != null && !found_words.equals(\"\"))\n\t\t\treturn current_word.toLowerCase().equals(word.toLowerCase()) ? current_word +\" & \" + definition + \"#\" + found_words +\"#\" : current_word + \"#\" + found_words;\n\t\telse if(current_word != null && found_words.equals(\"\"))\n\t\t\treturn current_word.toLowerCase().equals(word.toLowerCase()) ? current_word +\" & \" + definition + \"#\": current_word+ \"#\";\n\t\telse //current_word == null && found_words != null\n\t\t\treturn found_words;\n\t}", "public interface DocumentRelatedTermsSearcher {\n List<ScoredTerm> getDocumentRelatedTerms(int docId, String term) throws SearchException;\n}", "static void allDocumentAnalyzer() throws IOException {\n\t\tFile allFiles = new File(\".\"); // current directory\n\t\tFile[] files = allFiles.listFiles(); // file array\n\n\t\t// recurse through all documents\n\t\tfor (File doc : files) {\n\t\t\t// other files we don't need\n\t\t\tif (doc.getName().contains(\".java\") || doc.getName().contains(\"words\") || doc.getName().contains(\"names\")\n\t\t\t\t\t|| doc.getName().contains(\"phrases\") || doc.getName().contains(\".class\")\n\t\t\t\t\t|| doc.getName().contains(\"Data\") || doc.getName().contains(\".sh\") || doc.isDirectory()\n\t\t\t\t\t|| !doc.getName().contains(\".txt\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tString name = doc.getName();\n\t\t\tSystem.out.println(name);\n\t\t\tname = name.substring(0, name.length() - 11);\n\t\t\tSystem.out.println(name);\n\n\t\t\tif (!names.contains(name)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// make readers\n\t\t\tFileReader fr = new FileReader(doc);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\n\t\t\t// phrase list\n\t\t\tArrayList<String> words = new ArrayList<String>();\n\n\t\t\t// retrieve all text, trim, refine and add to phrase list\n\t\t\tString nextLine = br.readLine();\n\t\t\twhile (nextLine != null) {\n\t\t\t\tnextLine = nextLine.replace(\"\\n\", \" \");\n\t\t\t\tnextLine = nextLine.trim();\n\n\t\t\t\tif (nextLine.contains(\"no experience listed\")) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tString[] lineArray = nextLine.split(\"\\\\s+\");\n\n\t\t\t\t// recurse through every word to find phrases\n\t\t\t\tfor (int i = 0; i < lineArray.length - 1; i++) {\n\t\t\t\t\t// get the current word and refine\n\t\t\t\t\tString currentWord = lineArray[i];\n\n\t\t\t\t\tcurrentWord = currentWord.trim();\n\t\t\t\t\tcurrentWord = refineWord(currentWord);\n\n\t\t\t\t\tif (currentWord.equals(\"\") || currentWord.isEmpty()) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\twords.add(currentWord);\n\t\t\t\t}\n\t\t\t\tnextLine = br.readLine();\n\t\t\t}\n\n\t\t\tbr.close();\n\n\t\t\t// continue if empty\n\t\t\tif (words.size() == 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// otherwise, increment number of files in corpus\n\t\t\tsize++;\n\n\t\t\t// updating the phrase count map for tf\n\t\t\tString fileName = doc.getName();\n\t\t\tphraseCountMap.put(fileName, words.size());\n\n\t\t\t// recurse through every word\n\t\t\tfor (String word : words) {\n\t\t\t\t// get map from string to freq\n\t\t\t\tHashMap<String, Integer> textFreqMap = wordFreqMap.get(fileName);\n\n\t\t\t\t// if it's null, make one\n\t\t\t\tif (textFreqMap == null) {\n\t\t\t\t\ttextFreqMap = new HashMap<String, Integer>();\n\t\t\t\t\t// make freq as 1\n\t\t\t\t\ttextFreqMap.put(word, 1);\n\t\t\t\t\t// put that in wordFreq\n\t\t\t\t\twordFreqMap.put(fileName, textFreqMap);\n\t\t\t\t} else {\n\t\t\t\t\t// otherwise, get the current num\n\t\t\t\t\tInteger currentFreq = textFreqMap.get(word);\n\n\t\t\t\t\t// if it's null,\n\t\t\t\t\tif (currentFreq == null) {\n\t\t\t\t\t\t// the frequency is just 0\n\t\t\t\t\t\tcurrentFreq = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t// increment the frequency\n\t\t\t\t\tcurrentFreq++;\n\n\t\t\t\t\t// put it in the textFreqMap\n\t\t\t\t\ttextFreqMap.put(word, currentFreq);\n\n\t\t\t\t\t// put that in the wordFreqMap\n\t\t\t\t\twordFreqMap.put(fileName, textFreqMap);\n\t\t\t\t}\n\n\t\t\t\t// add this to record (map from phrases to docs with that\n\t\t\t\t// phrase)\n\t\t\t\tinvertedMap.addValue(word, doc);\n\t\t\t}\n\t\t}\n\t}", "private String keywordFound(){\r\n\t\tString rtn = \"\";\r\n\t\tString tmp = \"\";\r\n\t\tint carr_pos = getCaretPosition();\r\n\t\t//estract part of text for keyword search\r\n\t\ttry { \r\n\t\tif(carr_pos>50)\r\n\t\t\ttmp = doc.getText(carr_pos-50,50);\r\n\t\telse\r\n\t\t\ttmp = doc.getText(0,carr_pos);\r\n\t\t}catch(BadLocationException a){\r\n\t\t\tSystem.out.println(\"exception\");\r\n\t\t\treturn rtn;\r\n\t\t};\r\n\t\t//Start check\r\n\t\tint i = 0;\r\n\t\tif(tmp.length() >= 2)i = tmp.length()-2;\t\r\n\t\twhile(checkOperator(tmp.charAt(i)) && i > 0){\r\n\t\t\trtn += tmp.charAt(i);\r\n\t\t\ti--;\r\n\t\t}\r\n\t\tif(i == 0)rtn += tmp.charAt(i);\t\t\r\n\t\treturn mirrorString(rtn);\r\n\t}", "private Predicate buildOrPredicatesForWord(CriteriaBuilder builder, Root<Attendee> root, String word) {\n Predicate hasFirstName = builder.like(root.get(\"firstName\"), \"%\" + word + \"%\");\n Predicate hasLastName = builder.like(root.get(\"lastName\"), \"%\" + word + \"%\");\n Predicate hasFanName = builder.like(root.get(\"fanName\"), \"%\" + word + \"%\");\n Predicate hasLegalFirstName = builder.like(root.get(\"legalFirstName\"), \"%\" + word + \"%\");\n Predicate hasLegalLastName = builder.like(root.get(\"legalLastName\"), \"%\" + word + \"%\");\n return builder.or(hasFirstName, hasLastName, hasFanName, hasLegalFirstName, hasLegalLastName);\n }", "public static ArrayList<Result> findMatches(Query query, DataManager myVocab){\n\n\t\t//Uncomment this for logging in this class\t\n//\t\tmyLogger.setLevel(Level.INFO); \n\n\t\t// get the term we're going to search for and\n\t\t// take out any leading or trailing whitespaces\n\t\tString querystr = query.getQuery();\n\t\tquerystr = querystr.trim();\n\t\tString uncleaned = querystr;\n\t\t\n\t\t// This is in case of numeric entries. Google Refine doesn't seem\n\t\t// to have int cell types, instead it adds an invisible .0 to all\n\t\t// numbers. This fixes that issue, as it sometimes causes false negatives.\n\t\tif (querystr.endsWith(\".0\")){\n\t\t Pattern p = Pattern.compile(\"[^0-9\\\\.]+\");\n\t\t Matcher m = p.matcher(querystr);\n\t\t boolean result = m.find();\n\t\t if (!result){\n\t\t \t querystr = querystr.substring(0, querystr.length()-2);\n\t\t }\n\t\t}\n\t\t// see if it's in the synonyms map, if it is\n\t\t// replace it with the appropriate term, if it's\n\t\t// not, don't do anything. \n\n\t\tif (myVocab.subMap.get(querystr)!=null){\n\t\t\tquerystr = myVocab.subMap.get(querystr);\n\t\t\tquery.setQuery(querystr);\n\t\t}\n\t\t\n\t\t// Clean up the query string if it isn't case/punctuation sensitive\n\t\tif (!myVocab.capsSensitive()){\t\t\n\t\t\tquerystr = querystr.toLowerCase();\n\t\t}\n\t\tif (! myVocab.punctSensitive()){\t\t\n\t\t\tquerystr = querystr.replaceAll(\"[\\\\W_]\", \"\");\n\t\t}\n\t\t\n\t\t// see if it's in the synonyms map, if it is\n\t\t// replace it with the appropriate term, if it's\n\t\t// not, don't do anything. \n\t\tif(myVocab.subMap.get(querystr)!=null){\n\t\t\tquerystr = myVocab.subMap.get(querystr);\n\t\t\tquery.setQuery(querystr);\n\t\t}\n\n\t\tString type = query.getType();\n\n\t\t// This ArrayList is the results that are going to be returned. \n\t\tArrayList<Result> results = getDirectMatches(myVocab, querystr, uncleaned, type);\n\t\t\n\t\t// If there's a perfect match return it.\n\t\tif (results.size() == 1 && results.get(0).match){\n\t\t\treturn results;\n\t\t}else{\n\t\t\t// Otherwise, add the initial ones and try matching\n\t\t\t// based on distance to vocabulary terms.\n\t\t\tresults.addAll(distanceMatching(query, myVocab));\n\t\t\t\n\t\t\t// Split the original query term by space and non-alphanumeric characters \n\t\t\t// to find how many words there are.\n\t\t\t//querystr = query.getQuery().replaceAll(\"[\\\\W_]\", \" \");\n\t\t\tString [] termList = querystr.split(\" \");\n\t\t\t\n\t\t\t// if there's more than one, run bagOfWords\n\t\t\t// which tries to find a match for each of the words.\n\t\t\tif (termList.length > 1){\n\t\t\t\tresults.addAll(bagOfWords(query, myVocab));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Clean the results: no duplicates\n\t\t// no extra results to return, and sorted\n\t\t// them by score before returning them\n\t\tresults = removeDuplicates(results);\n\t\t\n\t\t// They do not need to be reduced in \n\t\t// number if there are fewer than \n\t\t// the max results.\n\t\t// The pruneResults sorts them\n\t\t// by score already.\n\t\tif(query.getLimit()!=null){\n\t\t\tresults = pruneResults(results,Integer.parseInt(query.getLimit()));\n\t\t}else{\n\t\t\tresults = pruneResults(results,MAX_RESULTS);\n\t\t}\n\t\t\t\n\t\tresults = sortByScore(results);\n\t\tfor (int i = 0; i< results.size(); i++){\n//\t\t\tmyLogger.log(Level.SEVERE,results.get(i).getScore()+ \" is bigger than 100?\");\n\t\t\tif(results.get(i).getScore() > (double)100){\n\t\t\t\tresults.get(i).setScore((double)100 - (results.get(i).getScore()-(double)100));\n//\t\t\t\tmyLogger.log(Level.SEVERE,results.get(i).getScore()+\" is bigger than 100! and was set to \"+\n//\t\t\t\t\t\t((double)100 - (results.get(i).getScore()-(double)100)));\n\t\t\t}\n\t\t}\n\t\treturn results;\n\t}", "public WordList find(String s) {\n \treturn index.get(s);\n }", "private List<Query> generateSynonymQueries(Analyzer synonymAnalyzer, SolrParams solrParams) {\n\n\tString origQuery = getQueryStringFromParser();\n\tint queryLen = origQuery.length();\n\t\n // TODO: make the token stream reusable?\n TokenStream tokenStream = synonymAnalyzer.tokenStream(Const.IMPOSSIBLE_FIELD_NAME,\n new StringReader(origQuery));\n \n SortedSetMultimap<Integer, TextInQuery> startPosToTextsInQuery = TreeMultimap.create();\n \n \n boolean constructPhraseQueries = solrParams.getBool(Params.SYNONYMS_CONSTRUCT_PHRASES, false);\n \n boolean bag = solrParams.getBool(Params.SYNONYMS_BAG, false);\n List<String> synonymBag = new ArrayList<>();\n \n try {\n tokenStream.reset();\n while (tokenStream.incrementToken()) {\n CharTermAttribute term = tokenStream.getAttribute(CharTermAttribute.class);\n OffsetAttribute offsetAttribute = tokenStream.getAttribute(OffsetAttribute.class);\n TypeAttribute typeAttribute = tokenStream.getAttribute(TypeAttribute.class);\n \n if (!typeAttribute.type().equals(\"shingle\")) {\n // ignore shingles; we only care about synonyms and the original text\n // TODO: filter other types as well\n \n String termToAdd = term.toString();\n \n if (typeAttribute.type().equals(\"SYNONYM\")) {\n synonymBag.add(termToAdd); \t\n }\n \n //Don't quote sibgle term term synonyms\n\t\t if (constructPhraseQueries && typeAttribute.type().equals(\"SYNONYM\") &&\n\t\t\ttermToAdd.contains(\" \")) \n\t\t {\n\t\t \t//Don't Quote when original is already surrounded by quotes\n\t\t \tif( offsetAttribute.startOffset()==0 || \n\t\t \t offsetAttribute.endOffset() == queryLen ||\n\t\t \t origQuery.charAt(offsetAttribute.startOffset()-1)!='\"' || \n\t\t \t origQuery.charAt(offsetAttribute.endOffset())!='\"')\n\t\t \t{\n\t\t \t // make a phrase out of the synonym\n\t\t \t termToAdd = new StringBuilder(termToAdd).insert(0,'\"').append('\"').toString();\n\t\t \t}\n\t\t }\n if (!bag) {\n // create a graph of all possible synonym combinations,\n // e.g. dog bite, hound bite, dog nibble, hound nibble, etc.\n\t TextInQuery textInQuery = new TextInQuery(termToAdd, \n\t offsetAttribute.startOffset(), \n\t offsetAttribute.endOffset());\n\t \n\t startPosToTextsInQuery.put(offsetAttribute.startOffset(), textInQuery);\n }\n }\n }\n tokenStream.end();\n } catch (IOException e) {\n throw new RuntimeException(\"uncaught exception in synonym processing\", e);\n } finally {\n try {\n tokenStream.close();\n } catch (IOException e) {\n throw new RuntimeException(\"uncaught exception in synonym processing\", e);\n }\n }\n \n List<String> alternateQueries = synonymBag;\n \n if (!bag) {\n // use a graph rather than a bag\n\t List<List<TextInQuery>> sortedTextsInQuery = new ArrayList<>(\n startPosToTextsInQuery.values().size());\n sortedTextsInQuery.addAll(startPosToTextsInQuery.asMap().values().stream().map(ArrayList::new).collect(Collectors.toList()));\n\t \n\t // have to use the start positions and end positions to figure out all possible combinations\n\t alternateQueries = buildUpAlternateQueries(solrParams, sortedTextsInQuery);\n }\n \n // save for debugging purposes\n expandedSynonyms = alternateQueries;\n \n return createSynonymQueries(solrParams, alternateQueries);\n }", "public boolean search(String word) {\n TrieNode now = root;\n for(int i = 0; i < word.length(); i++) {\n Character c = word.charAt(i);\n if (!now.children.containsKey(c)) {\n return false;\n }\n now = now.children.get(c);\n }\n return now.hasWord;\n}", "public String phraseWords(String input) {\n document = new Annotation(input);\n // run all Annotators on this text\n pipeline.annotate(document);\n String pos = document.get(CoreAnnotations.PhraseWordsTagAnnotation.class);\n\n return pos;\n }", "public String search_words(String word){\n\t\tString found_words = \"\";\n\t\t//We try to find the word within our childs\n\t\tfor(LexiNode child: childs)\n\t\t\tif(word.toLowerCase().charAt(0) == Character.toLowerCase(child.getRepresentative_letter()))\n\t\t\t\tfound_words += child.search_words(word, 0);\n\t\t\n\t\treturn found_words;\n\t}", "private void termQuerySearch(String[] terms) {\n for (String term : terms) {\n LinkedList<TermPositions> postingLists = indexMap.get(analyzeTerm(term));\n if (postingLists != null) {\n for (TermPositions matches : postingLists) {\n double score = (double) 1 + Math.log((double) matches.getPositionList().size()) *\n Math.log((double) N / (double) postingLists.size());\n resultsCollector.add(new DocCollector(matches.getDocId(), score));\n }\n }\n }\n }", "public Cursor getWordMatches(String query, String[] columns) {\n // Search over location names and abbreviations\n String selection = \n LOC_NAME + \" LIKE '%\" + query + \"%'\" + \" OR \" + \n ABBR + \" LIKE '%\" + query + \"%'\";\n\n return query(selection, columns);\n }", "@Test\n\tpublic void notPhraseGrepTest() throws Exception {\n\t\t// phrase is \"I am forced\"\n\t\tHashSet<String> grepFound = loadGrepResults(\"!i+am+forced\");\n\t\tCollection<Page> index = queryTest.query(\"! \\\"I am Forced\\\"\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\tassertEquals(grepFound, indexFound);\n\t}", "public abstract boolean isStopWord(String term);", "SpellResponse spellQuery(SearchRequest request, Map<SearchParam, String> params);", "public void searchWordToGroup(String title, String word, String groupIns) throws IOException {\r\n\t\tString line;\r\n\t\tBufferedReader in;\r\n\t\tint paragraphs = 1;\r\n\t\tint sentences = 1;\r\n\t\tfound = 0;\r\n\t\ttry {\r\n\t\t\tstatementP = SqlCon.getConnection().prepareStatement(SqlCon.PATH_ACORDING_TITLE);\r\n\t\t\tstatementP.setString(1, title);\r\n\t\t\trs = statementP.executeQuery();\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tString path = rs.getString(\"filePath\");\r\n\t\t\t\tin = new BufferedReader(new FileReader(path));\r\n\t\t\t\tline = in.readLine();\r\n\t\t\t\twhile (line != null) {\r\n\t\t\t\t\tif (line.equals(\"\")) {\r\n\t\t\t\t\t\tparagraphs++;\r\n\t\t\t\t\t\tsentences = 1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tString[] sentenceList = line.split(\"[!?.:]+\");\r\n\t\t\t\t\t\tfor (int i = 0; i < sentenceList.length; i++) {\r\n\t\t\t\t\t\t\tif (sentenceList[i].contains(word)) {\r\n\t\t\t\t\t\t\t\tint p = paragraphs;\r\n\t\t\t\t\t\t\t\tint s = sentences;\r\n\t\t\t\t\t\t\t\tint is =0;\r\n\t\t\t\t\t\t\t\tinsertTable.insertwordFunc(groupIns, word, title, p, s, is);\r\n\t\t\t\t\t\t\t\tfound = 1;\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\tsentences++;\r\n\t\t\t\t\tline = in.readLine();\r\n\t\t\t\t}\r\n\t\t\t\tparagraphs = 1;\r\n\t\t\t\tsentences = 1;\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n public String search(String word) {\n return search(word, root);\n }", "public boolean search(String word) {\n TrieTree point = root;\n for(int i = 0; i < word.length(); i++){\n char ch = word.charAt(i);\n if(point.getChild(ch - 'a') == null) return false;\n point = point.getChild(ch - 'a');\n }\n return point.getIsWord();\n }", "List<FraseEntidade> getPhrasesByAuthorName(String name);", "public void search(Indexer indexer, CityIndexer cityIndexer, Ranker ranker, String query, boolean withSemantic, ArrayList<String> chosenCities, ObservableList<String> citiesByTag, boolean withStemming, String saveInPath, String queryId, String queryDescription) {\n String[] originalQueryTerms = query.split(\" \");\n String originQuery = query;\n docsResults = new HashMap<>();\n parser = new Parse(withStemming, saveInPath, saveInPath);\n HashSet<String> docsOfChosenCities = new HashSet<>();\n query = \"\" + query + queryDescription;\n HashMap<String, Integer> queryTerms = parser.parseQuery(query);\n HashMap<String, ArrayList<Integer>> dictionary = indexer.getDictionary();\n if (!withStemming){\n setDocsInfo(saveInPath + \"\\\\docsInformation.txt\");\n }\n else{\n setDocsInfo(saveInPath + \"\\\\docsInformation_stemming.txt\");\n }\n\n\n //add semantic words of each term in query to 'queryTerms'\n if(withSemantic) {\n HashMap<String,ArrayList<String>> semanticWords = ws.connectToApi(originQuery);\n }\n\n //give an ID to query if it's a regular query (not queries file)\n if(queryId.equals(\"\")){\n queryId = \"\" + Searcher.queryID;\n Searcher.queryID++;\n }\n\n String postingDir;\n if (!withStemming) {\n postingDir = \"\\\\indexResults\\\\postingFiles\";\n } else {\n postingDir = \"\\\\indexResults\\\\postingFiles_Stemming\";\n }\n int pointer = 0;\n\n //find docs that contain the terms in the query in their text\n HashMap<String, Integer> queryTermsIgnoreCase = new HashMap<>();\n for (String term : queryTerms.keySet()) {\n String originTerm = term;\n if (!dictionary.containsKey(term.toUpperCase()) && !dictionary.containsKey(term.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(term.toLowerCase())){\n term = term.toLowerCase();\n }\n else {\n term = term.toUpperCase();\n }\n queryTermsIgnoreCase.put(term,queryTerms.get(originTerm));\n pointer = dictionary.get(term).get(2);\n String chunk = (\"\" + term.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsResults'\n if(line != null) {\n findDocsFromLine(line, term);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their text\n for (String cityTerm : chosenCities) {\n if (!dictionary.containsKey(cityTerm) && !dictionary.containsKey(cityTerm.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(cityTerm.toLowerCase())){\n cityTerm = cityTerm.toLowerCase();\n }\n pointer = dictionary.get(cityTerm).get(2);\n // char chunk = indexer.classifyToPosting(term).charAt(0);\n String chunk = (\"\" + cityTerm.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(0, line.indexOf(\"[\") - 1); //get 'docsListStr'\n String[] docsArr = docs.split(\";\");\n for (String docInfo : docsArr) {\n String doc = docInfo.substring(0, docInfo.indexOf(\": \"));\n while(doc.charAt(0) == ' '){\n doc = doc.substring(1);\n }\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their city tag\n if(!chosenCities.isEmpty()){\n for (String cityDicRec: chosenCities) {\n //get pointer to posting from cityDictionary\n try {\n pointer = cityIndexer.getCitiesDictionary().get(cityDicRec);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + \"\\\\cityIndexResults\" + \"\\\\posting_city\" + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(line.indexOf(\"[\") + 1, line.indexOf(\"]\")); //get 'docsListStr'\n String[] docsArr = docs.split(\"; \");\n for (String doc : docsArr) {\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n\n ranker.rank(docsResults, docsOfChosenCities, queryTermsIgnoreCase, dictionary, docsInfo,entities, queryId);\n }", "public WordInfo searchWord(String word) {\n\t\tSystem.out.println(\"Dic:SearchWord: \"+word);\n\n\t\tDocument doc;\n\t\ttry {\n\t\t\tdoc = Jsoup.connect(\"https://dictionary.cambridge.org/dictionary/english-vietnamese/\" + word).get();\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\n\t\tElements elements = doc.select(\".dpos-h.di-head.normal-entry\");\n\t\tif (elements.isEmpty()) {\n\t\t\tSystem.out.println(\" not found\");\n\t\t\treturn null;\n\t\t}\n\n\t\tWordInfo wordInfo = new WordInfo(word);\n\n\t\t// Word\n\t\telements = doc.select(\".tw-bw.dhw.dpos-h_hw.di-title\");\n\n\t\tif (elements.size() == 0) {\n\t\t\tSystem.out.println(\" word not found in doc!\");\n\t\t\treturn null;\n\t\t}\n\n\t\twordInfo.setWordDictionary(elements.get(0).html());\n\n\t\t// Type\n\t\telements = doc.select(\".pos.dpos\");\n\n\t\tif(elements.size() > 0) {\n\t\t\twordInfo.setType(WordInfo.getTypeShort(elements.get(0).html()));\n//\t\t\tif (wordInfo.getTypeShort().equals(\"\"))\n//\t\t\t\tSystem.out.println(\" typemis: \"+wordInfo.getType());\n\t\t}\n\n\t\t// Pronoun\n\t\telements = doc.select(\".ipa.dipa\");\n\n\t\tif (elements.size() > 0)\n\t\t\twordInfo.setAPI(\"/\"+elements.get(0).html()+\"/\");\n\n\t\t// Trans\n\t\telements = doc.select(\".trans.dtrans\");\n\n\t\tif (elements.size() > 0)\n\t\t\twordInfo.setTrans(elements.get(0).html());\n\n\t\tSystem.out.println(\" found\");\n\t\treturn wordInfo;\n\t}", "List findByFilterText(Set<String> words, boolean justIds);", "private void find(char[] m, String message, Trie cur, Trie root, int index, List<String> results) {\n // Base case 1. No match with any dictionary word. if cur == null -> no match ; return\n if (cur == null) {\n return;\n }\n // Base case 2. if out of bounds, check previously collected word and return\n if (index == message.length()) {\n // result only in case matches word\n if (cur.word != null) {\n results.add(new String(m));\n }\n return;\n }\n char c = message.charAt(index);\n if (c == SPACE) {\n // matches word or character 'e'\n // check if matches word from dictionary\n if (cur.word != null) {\n m[index] = SPACE;\n // if space - start collecting new word from beginning of Trie\n find(m, message, root, root, index + 1, results);\n }\n // otherwise ' ' -> 'e'\n c = 'e';\n }\n // considered non-space character (backtracking)\n m[index] = c;\n // get next element from try\n Trie next = cur.get(c);\n find(m, message, next, root, index + 1, results);\n }", "public boolean search(String word)\n {\n return true;\n }", "public boolean search(String word) {\n TrieNode n = root;\n for(char c : word.toCharArray()) {\n if(n.children[c]==null)\n return false;\n n = n.children[c];\n }\n if(n.isWord)\n return true;\n return false;\n }", "private List<SearchWord> getSearchWords(Long lastUpdateTime) {\n return new ArrayList<>();\n }", "public void IndexADocument(String docno, String content) throws IOException {\n\t\tdocid++;\n\t\tdoc2docid.put(docno, docid);\n\t\tdocid2doc.put(docid, docno);\n\n\t\t// Insert every term in this doc into docid2map\n\t\tString[] terms = content.trim().split(\" \");\n\t\tMap<Integer, Integer> docTerm = new HashMap<>();\n\t\tint thisTermid;\n\t\tfor(String term: terms){\n\t\t\t// get termid\n\t\t\tif(term2termid.get(term)!=null) thisTermid = term2termid.get(term);\n\t\t\telse{\n\t\t\t\tthisTermid = ++termid;\n\t\t\t\tterm2termid.put(term, thisTermid);\n\t\t\t}\n\t\t\tdocTerm.put(thisTermid, docTerm.getOrDefault(thisTermid, 0)+1);\n\t\t\t// Merge this term's information into termid2map\n\t\t\tMap<Integer, Integer> temp = termid2map.getOrDefault(thisTermid, new HashMap());\n\t\t\ttemp.put(docid, temp.getOrDefault(docid, 0)+1);\n\t\t\ttermid2map.put(thisTermid, temp);\n\t\t\ttermid2fre.put(thisTermid, termid2fre.getOrDefault(thisTermid, 0)+1);\n\t\t}\n\t\tdocid2map.put(docid, docTerm);\n\n//\t\t// Merge all the terms' information into termid2map\n//\t\tfor(Long tid: docTerm.keySet()){\n//\t\t\tMap<Long, Long> temp = termid2map.getOrDefault(tid, new HashMap());\n//\t\t\ttemp.put(docid,docTerm.get(tid));\n//\t\t\ttermid2map.put(tid, temp);\n//\t\t\t// update this term's frequency\n//\t\t\ttermid2fre.put(tid, termid2fre.getOrDefault(tid,0L)+docTerm.get(tid));\n//\t\t}\n\n\t\t// When termid2map and docid2map is big enough, put it into disk\n\t\tif(docid%blockSize==0){\n\t\t\tWritePostingFile();\n\t\t\tWriteDocFile();\n\t\t}\n\t}", "@Test\n\tpublic void singleWordGrepTest3() throws Exception {\n\t\t// word is 'mistress'\n\t\tHashSet<String> grepFound = loadGrepResults(\"mistress\");\n\t\tCollection<Page> index = queryTest.query(\"mistress\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\t// tests set equality \n\t\tassertEquals(indexFound, grepFound);\n\t}", "public Utwor search2(String query) {\n for (Utwor utwor : utwory) {\n if (utwor.getTitle().equals(query)) {\n return utwor;\n }\n }\n return null;\n }", "public ArrayList<AddressEntry> searchByNote(String text) {\r\n ArrayList<AddressEntry> textMatches = new ArrayList<AddressEntry>();\r\n text = text.toLowerCase();\r\n for (AddressEntry current : contacts) {\r\n String currentname = current.getNote().toLowerCase();\r\n if (currentname.contains(text)) {\r\n textMatches.add(current);\r\n }\r\n }\r\n return textMatches;\r\n }", "private String containingWord(String attribute, String word) {\r\n return \"contains(concat(' ',normalize-space(@\" + attribute + \"),' '),' \"\r\n + word + \" ')\";\r\n }", "private double countWordLocationScore(Page page, String[] queryWords) {\n double score = 0;\n boolean wasFound = false;\n\n for (String word : queryWords) {\n int queryWordId = this.pb.getIdForWord(word);\n for (int i = 0; i < page.getWords().size(); i++) {\n if (page.getWords().get(i) == queryWordId) {\n score += i;\n wasFound = true;\n break;\n }\n }\n\n if (!wasFound) {\n score += 100000;\n } else {\n wasFound = false;\n }\n }\n return score;\n }", "List<Integer> wordFinder(String text, String word) {\n\n List<Integer> indexes = new ArrayList<Integer>();\n String wordProper = \" \" + word + \" \";\n\n int index = 0;\n\n while (index != -1) {\n\n index = text.indexOf(wordProper, index);\n\n if (index != -1) {\n indexes.add(index);\n index++;\n }\n }\n\n return indexes;\n }", "List<DataTerm> search(String searchTerm);", "private @Nullable static String getQueryForWords(@NonNull List<String> words) {\r\n int numberOfWords = words.size();\r\n if(numberOfWords == 0) {\r\n return null;\r\n }\r\n\r\n String tableName = getTable(words.get(0));\r\n\r\n if(tableName == null) {\r\n return null;\r\n }\r\n\r\n String query = \"select * from \"+tableName+\" where\";\r\n\r\n int ctr = 0;\r\n for (String word:words) {\r\n query += \" word like '\"+word+\"'\";\r\n ctr++;\r\n if(ctr < numberOfWords) {\r\n query += \" OR\";\r\n }\r\n }\r\n\r\n return query;\r\n }", "public static void main (String[] args) {\r\n\t\tfindWords(sentence);\r\n\t}", "public boolean search(String word) {\n char [] words=word.toCharArray();\n CharTree t=root;\n for (char c : words) {\n t=t.next[c-97];\n if(t==null)return false;\n }\n if (!t.isend)return false;\n return true;\n }", "public ArrayList<String> determineSearchedWords(String userCommand) {\n\t\tif (userCommand == null || userCommand.equals(\"\")) {\n\t\t\tlogger.log(Level.WARNING, Global.MESSAGE_ILLEGAL_ARGUMENTS);\n\t\t\treturn null;\n\t\t}\n\n\t\tString userCommandWithoutCommandType = removeCommandType(userCommand);\n\n\t\tArrayList<String> searchedWords = new ArrayList<String>();\n\t\tPattern pattern = Pattern.compile(\"[^\\\\s\\\"']+|\\\"([^\\\"]*)\\\"\");\n\t\tMatcher matcher = pattern.matcher(userCommandWithoutCommandType);\n\n\t\twhile (matcher.find()) {\n\t\t\tif (matcher.group(1) != null) {\n\t\t\t\tsearchedWords.add(matcher.group(1)); // Phrase in double quotes\n\t\t\t} else {\n\t\t\t\tsearchedWords.add(matcher.group()); // Single word\n\t\t\t}\n\t\t}\n\t\treturn searchedWords;\n\t}", "private ArrayList<String> matchingWords(String word){\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tfor(int i=0; i<words.size();i++){\n\t\t\tif(oneCharOff(word,words.get(i))){\n\t\t\t\tlist.add(words.get(i));\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "public static void textQueries(List<String> sentences, List<String> queries) {\n // Write your code here\n for(String q: queries){\n boolean a = false;\n int i=0;\n for(String s: sentences){\n if(Arrays.asList(s.split(\" \")).containsAll(Arrays.asList(q.split(\" \")))){\n System.out.print(i+\" \");\n a = true;\n }\n i++;\n }\n if(!a)\n System.out.println(-1);\n else\n System.out.println(\"\");\n }\n \n }", "boolean hasWord();", "SList oddWords();", "private long getTweets(String search, String geocode, Configuration auth) {\r\n TwitterFactory tf = new TwitterFactory(auth);\r\n Twitter twitter = tf.getInstance();\r\n \r\n try {\r\n Query query = new Query(search + \" \" + geocode);\r\n query.setSinceId(starttime);\r\n QueryResult result;\r\n \r\n for (int i = 0; i < blocks; i++) {\r\n if (Abort.getInstance().abort()) {\r\n return -1;\r\n }\r\n \r\n result = twitter.search(query);\r\n \r\n synchronized (this) {\r\n if (!tweets.containsKey(search)) {\r\n tweets.put(search, new HashSet());\r\n }\r\n tweets.get(search).addAll(result.getTweets());\r\n }\r\n \r\n //updateCommon(result.getTweets());\r\n //searched.add(search.toLowerCase());\r\n query.setSinceId(starttime + i * blocks15);\r\n }\r\n } catch (TwitterException te) {\r\n System.out.println(\"Failed to search tweets: \" + te);\r\n System.out.println(\"\\nRetry at: \" + \r\n (new Date(te.getRateLimitStatus()\r\n .getResetTimeInSeconds() * 1000L)));\r\n return te.getRateLimitStatus().getSecondsUntilReset() * 1000L;\r\n }\r\n return 0;\r\n }", "public static List<String> query_intersect(List<String> queryWords) throws IOException {\n\t\tif (!initialized) initialize();\n\t\tList<PostingList> pls = new ArrayList<PostingList> ();\n\t\tfor (String queryWord : queryWords) {\n\t\t\tqueryWord = queryWord.toLowerCase();\n\t\t\tif (!termDict.containsKey(queryWord)) {\n\t\t\t\tpls.clear();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tPostingList pl = readPosting(fc, termDict.get(queryWord));\n\t\t\tif (pl == null) {\n\t\t\t\tpls.clear();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpls.add(readPosting(fc, termDict.get(queryWord)));\n\t\t}\n\t\tCollections.sort(pls, new Comparator<PostingList>(){\n\t\t public int compare(PostingList p1, PostingList p2) {\n\t\t return p1.size() - p2.size(); // assumes you want biggest to smallest\n\t\t }\n\t\t});\n\t\tif (pls.size() == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tList<Integer> current = pls.get(0).getList();\n\t\t\tfor (int i = 1; i < pls.size(); i++) {\n\t\t\t\tList<Integer> toBeAdd = pls.get(i).getList();\n\t\t\t\tcurrent = intersect(current, toBeAdd);\n\t\t\t}\n\t\t\tif (current.size() == 0) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\tList<String> result = new ArrayList<String>();\n\t\t\t\tfor (int docId : current) {\n\t\t\t\t\tresult.add(docDict.get(docId));\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}", "@GetMapping(\"/search\")\n\tpublic String search(@RequestParam(name = \"word\") String word, Model model) {\n\t\tList<Note> notes = noteRepository.search(\"%\" + word + \"%\");\n\t\tmodel.addAttribute(\"notes\", notes);\n\t\treturn \"notes\";\n\t}", "private WordRecord lookUp(String word)\n {\n int contains = 0;\n boolean check = false;\n //loops through concordance\n for(int i = 0; i < this.concordance.size();i++)\n {\n //checks to see if the words are equal\n if(word.equalsIgnoreCase(this.concordance.get(i).getWord()))\n {\n //gets location of what position the word is true\n contains = i;\n check = true;\n }\n \n }\n //checks to see if it was found in concordance\n if(check)\n return this.concordance.get(contains);\n \n return null;\n }", "WordBean getWord(String word);", "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}", "public boolean search(String word) {\n TrieNode tn = root;\n int len = word.length();\n for(int i=0; i<len; i++){\n char c = word.charAt(i);\n TrieNode temp = tn.hm.get(c);\n if(temp == null) return false;\n tn = temp;\n }\n return tn.flag;\n }", "public String showSearchSynonym(String searchWord, ArrayList<String> words) {\n StringBuilder stringBuilder = new StringBuilder(\"Your word \\\"\" + searchWord + \"\\\" has \" + words.size()\n + (words.size() == 1 ? \" synonym:\\n\" : \" synonyms:\\n\"));\n for (int i = 0; i < words.size(); i++) {\n stringBuilder.append(words.get(i) + \"\\n\");\n }\n return stringBuilder.toString();\n }", "public void makeWord(String inputText,String pageId,createIndex createindex,String contentType)\n {\n int length,i;\n char c;\n boolean linkFound=false;\n int count1,count2,count3,count4,count5,count6,count7,count8,count9;\n\n\n\n StringBuilder word=new StringBuilder();\n // String finalWord=null,stemmedWord=null;\n docId=Integer.parseInt(pageId.trim());\n\n ci=createindex;\n // Stemmer st=new Stemmer();\n //createIndex createindex=new createIndex();\n\n length=inputText.length();\n\n for(i=0;i<length;i++)\n {\n c=inputText.charAt(i);\n if(c<123 && c>96)\n {\n word.append(c);\n }\n\n else if(c=='{')\n {\n if ( i+9 < length && inputText.substring(i+1,i+9).equals(\"{infobox\") )\n {\n\n StringBuilder infoboxString = new StringBuilder();\n\n count1 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n infoboxString.append(c);\n if ( c == '{') {\n count1++;\n }\n else if ( c == '}') {\n count1--;\n }\n if ( count1 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n if ( c == '=' ) {infoboxString.deleteCharAt(infoboxString.length()-1);}\n break;\n }\n }\n\n processInfobox(infoboxString);\n\n }\n\n else if ( i+8 < length && inputText.substring(i+1,i+8).equals(\"{geobox\") )\n {\n\n StringBuilder geoboxString = new StringBuilder();\n\n count2 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n geoboxString.append(c);\n if ( c == '{') {\n count2++;\n }\n else if ( c == '}') {\n count2--;\n }\n if ( count2 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n if ( c == '=' ) {geoboxString.deleteCharAt(geoboxString.length()-1);}\n break;\n }\n }\n\n // processGeobox(geoboxString);\n }\n\n else if ( i+6 < length && inputText.substring(i+1,i+6).equals(\"{cite\") )\n {\n\n /*\n * Citations are to be removed.\n */\n\n count3 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n if ( c == '{') {\n count3++;\n }\n else if ( c == '}') {\n count3--;\n }\n if ( count3 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n break;\n }\n }\n\n }\n\n else if ( i+4 < length && inputText.substring(i+1,i+4).equals(\"{gr\") )\n {\n\n /*\n * {{GR .. to be removed\n */\n\n count4 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n if ( c == '{') {\n count4++;\n }\n else if ( c == '}') {\n count4--;\n }\n if ( count4 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n break;\n }\n }\n\n }\n else if ( i+7 < length && inputText.substring(i+1,i+7).equals(\"{coord\") )\n {\n\n /**\n * Coords to be removed\n */\n\n count5 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n\n if ( c == '{') {\n count5++;\n }\n else if ( c == '}') {\n count5--;\n }\n if ( count5 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n break;\n }\n }\n\n }\n\n //System.out.println(\"process infobox\");\n }\n else if(c=='[')\n {\n // System.out.println(\"process square brace\");\n\n if ( i+11 < length && inputText.substring(i+1,i+11).equalsIgnoreCase(\"[category:\"))\n {\n\n StringBuilder categoryString = new StringBuilder();\n\n count6 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n categoryString.append(c);\n if ( c == '[') {\n count6++;\n }\n else if ( c == ']') {\n count6--;\n }\n if ( count6 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n if ( c == '=' ) {categoryString.deleteCharAt(categoryString.length()-1);}\n break;\n }\n }\n\n // System.out.println(\"category string=\"+categoryString.toString());\n processCategories(categoryString);\n\n }\n else if ( i+8 < length && inputText.substring(i+1,i+8).equalsIgnoreCase(\"[image:\") ) {\n\n /**\n * Images to be removed\n */\n\n count7 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n if ( c == '[') {\n count7++;\n }\n else if ( c == ']') {\n count7--;\n }\n if ( count7 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n break;\n }\n }\n\n }\n else if ( i+7 < length && inputText.substring(i+1,i+7).equalsIgnoreCase(\"[file:\") ) {\n\n /**\n * File to be removed\n */\n\n count8 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n\n if ( c == '[') {\n count8++;\n }\n else if ( c == ']') {\n count8--;\n }\n if ( count8 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n break;\n }\n }\n\n }\n\n }\n else if(c=='<')\n {\n //System.out.println(\"Process < >\");\n\n if ( i+4 < length && inputText.substring(i+1,i+4).equalsIgnoreCase(\"!--\") ) {\n\n /**\n * Comments to be removed\n */\n\n int locationClose = inputText.indexOf(\"-->\" , i+1);\n if ( locationClose == -1 || locationClose+2 > length ) {\n i = length-1;\n }\n else {\n i = locationClose+2;\n }\n\n }\n else if ( i+5 < length && inputText.substring(i+1,i+5).equalsIgnoreCase(\"ref>\") ) {\n\n /**\n * References to be removed\n */\n int locationClose = inputText.indexOf(\"</ref>\" , i+1);\n if ( locationClose == -1 || locationClose+5 > length ) {\n i = length-1;\n }\n else {\n i = locationClose+5;\n }\n\n }\n else if ( i+8 < length && inputText.substring(i+1,i+8).equalsIgnoreCase(\"gallery\") ) {\n\n /**\n * Gallery to be removed\n */\n int locationClose = inputText.indexOf(\"</gallery>\" , i+1);\n if ( locationClose == -1 || locationClose+9 > length) {\n i = length-1;\n }\n else {\n i = locationClose+9;\n }\n }\n\n }\n else if ( c == '=' && i+1 < length && inputText.charAt(i+1) == '=')\n {\n\n linkFound = false;\n i+=2;\n while ( i < length && ((c = inputText.charAt(i)) == ' ' || (c = inputText.charAt(i)) == '\\t') )\n {\n i++;\n }\n\n if ( i+14 < length && inputText.substring(i , i+14 ).equals(\"external links\") )\n {\n //System.out.println(\"External link found\");\n linkFound = true;\n i+= 14;\n }\n\n }\n else if ( c == '*' && linkFound == true )\n {\n\n //System.out.println(\"Link found\");\n count9 = 0;\n boolean spaceParsed = false;\n StringBuilder link = new StringBuilder();\n while ( count9 != 2 && i < length )\n {\n c = inputText.charAt(i);\n if ( c == '[' || c == ']' )\n {\n count9++;\n }\n if ( count9 == 1 && spaceParsed == true)\n {\n link.append(c);\n }\n else if ( count9 != 0 && spaceParsed == false && c == ' ')\n {\n spaceParsed = true;\n }\n i++;\n }\n\n StringBuilder linkWord = new StringBuilder();\n for ( int j = 0 ; j < link.length() ; j++ )\n {\n char currentCharTemp = link.charAt(j);\n if ( (int)currentCharTemp >= 'a' && (int)currentCharTemp <= 'z' )\n {\n linkWord.append(currentCharTemp);\n }\n else\n {\n\n // System.out.println(\"link : \" + linkWord.toString());\n processLink(linkWord);\n linkWord.setLength(0);\n }\n }\n if ( linkWord.length() > 1 )\n {\n //System.out.println(\"link : \" + linkWord.toString());\n processLink(linkWord);\n linkWord.setLength(0);\n }\n\n }\n else\n {\n if(word.length()>1)\n filterAndAddWord(word,contentType);\n\n word.setLength(0);\n }\n }\n\n\n if(word.length()>1)\n filterAndAddWord(word,contentType);\n\n word.setLength(0);\n /*\n if(word.length()>0)\n {\n finalWord=new String(word);\n if(!(checkStopword(finalWord)))\n {\n st.add(finalWord.toCharArray(),finalWord.length());\n stemmedWord=st.stem();\n\n createindex.addToTreeSet(stemmedWord,docId);\n\n }\n\n word.delete(0, word.length());\n } */\n\n }", "public ArrayList<SearchResult> partialSearch(String[] searchWords) {\n\t\tArrayList<SearchResult> words = new ArrayList<>();\n\t\tHashMap<String, SearchResult> resultMap = new HashMap<>();\n\t\tfor (String word : searchWords) {\n\t\t\tfor (String key : index.tailMap(word, true).navigableKeySet()) {\n\t\t\t\tif (key.startsWith(word)) {\n\t\t\t\t\twordSearch(key, resultMap, words);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tCollections.sort(words);\n\t\treturn words;\n\t}", "public FindCommand(WordContainsKeywordsPredicate predicate) {\n this.predicate = predicate;\n }", "private static Query computeBooleanQueryNP(String textQuery){\n\t\tBooleanQuery query = new BooleanQuery();\n\n\t\tHmmDecoder mPosTagger = null;\n\t\tTokenizerFactory mTokenizerFactory = null;\n\t\tPhraseChunker pChunker = new PhraseChunker(mPosTagger,mTokenizerFactory);\n\t\tArrayList<String> pchuncker = new ArrayList<String>();\n\n\t\tpchuncker = pChunker.getCHunkNounPhrases(textQuery.toLowerCase());\n\n\t\tfor (int k = 0; k<= pchuncker.size()-1;k++ ){\n\t\t\tString wordInList = ((String) pchuncker.get(k));\n\t\t\twordInList = wordInList.toLowerCase().replaceAll(\"-\",\" \");\n\t\t\tString [] wordInListSplit = wordInList.split(\" \");\n\t\t\tfor (String word: wordInListSplit){\n\n\t\t\t\tquery.add(new TermQuery(new Term(\"content\", word)), Occur.SHOULD );\n\t\t\t}\n\n\t\t}\n\n\t\t/* String[] tQuery = textQuery.split(\" \");\n\t\t for(String s: tQuery )\n\t\t\t query.add(new TermQuery(new Term(\"text\", s)), Occur.SHOULD);*/\n\n\t\treturn query;\n\t}", "public byte filter(Manager m, SearchRequest q, ResultSet rs, int DocAtNumber, int DocNo)\n\t{\t\t\n\t\tString originalQuery = q.getOriginalQuery();\n\t\t//highlight query terms only for the queries, \n\t\t//which are not about finding related documents\n\t\t//this check may be removed, because the preparation of the \n\t\t//query terms for highlighting takes into account\n\t\t//the related: operator\n\t\tboolean highlightQueryTerms = true;\n\t\tif (originalQuery.matches(\"\\\\brelated:\\\\d+\\\\b\") || //check if the query uses the related: operator \n\t\t\t!enableQueryTermsHighlight || //check if the highlighting of terms is enabled\n\t\t\thighlight.pattern().equals(\"(\\\\b)()(\\\\b)\")) //check if there are no query terms to highlight\n\t\t\thighlightQueryTerms = false;\n\t\t\n\t\tString[] qTerms = q.getOriginalQuery().replaceAll(\" \\\\w+\\\\p{Punct}\\\\w+ \",\" \").toLowerCase().split(\" \");\n\t\t\n\t\tString[] metadata = null;\n\t\tint tmpSentence;\n\t\tdouble tmpScore;\n\t\tsynchronized(metaCache) {\n\t\t\ttry {\n\t\t\t\tInteger DocNoObject = new Integer(DocNo);\n\t\t\t\tif (metaCache.containsKey(DocNoObject))\n\t\t\t\t\t\tmetadata = (String[]) metaCache.get(DocNoObject);\n\t\t\t\telse {\n\t\t\t\t\tmetadata = metaIndex.getItems(keys, DocNo);\n\t\t\t\t\tmetaCache.put(DocNoObject,metadata);\n\t\t\t\t}\n\t\t\t} catch(IOException ioe) {} \n\t\t}\n\t\n\t\tif (show_snippet)\n\t\t{\n\t\t\tString extract = metadata[1];\n\t\t\tString[] sentences = sentencePattern.split(extract, 50); //use 50 sentences at most\n\t\t\tdouble[] sentenceScores = new double[sentences.length]; \n\t\t\tint frsSentence = -1;\n\t\t\tint sndSentence = -1;\n\t\t\tint top1Sentence = 0;\n\t\t\tint top2Sentence = 0;\n\t\t\tdouble max1Score = -1;\n\t\t\tdouble max2Score = 0;\n\t\t\tfinal int qTermsLength = qTerms.length;\n\t\t\tfor (int i=0; i<qTermsLength; i++) {\n\t\t\t\tqTerms[i] = removeEndings.matcher(qTerms[i]).replaceAll(\"\");\n\t\t\t}\n\t\t\tString lowerCaseSentence;\n\t\t\tint sentenceLength;\n\t\t\tfinal int sentencesLength = sentences.length;\n\n\t\t\tfor (int i=0; i<sentencesLength; i++) {\n\t\t\t\t\n\t\t\t\tlowerCaseSentence = sentences[i].toLowerCase();\n\t\t\t\tsentenceLength=sentences[i].length();\n\t\t\t\tif (sentenceLength < 20 || sentenceLength > 250) {\n\t\t\t\t\tfor (int j=0; j<qTermsLength; j++) {\n\t\t\t\t\t\tif (lowerCaseSentence.indexOf(qTerms[j])>=0) {\n\t\t\t\t\t\t\tsentenceScores[i]+=1.0d + sentenceLength / (20.0d + sentenceLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tfor (int j=0; j<qTermsLength; j++) {\n\t\t\t\t\t\tif (lowerCaseSentence.indexOf(qTerms[j])>=0) {\n\t\t\t\t\t\t\tsentenceScores[i]+=qTerms[j].length() + sentenceLength / (1.0d + sentenceLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t//do your best to get at least a second sentence for the snippet, \n\t\t\t\t//after having found the first one\n\t\t\t\tif (frsSentence > -1 && sndSentence == -1 && sentenceLength > 5) {\n\t\t\t\t\tsndSentence = i;\n\t\t\t\t}\n\n\t\t\t\t//do your best to get at least one sentence for the snippet\n\t\t\t\tif (frsSentence == -1 && sentenceLength > 5) { \n\t\t\t\t\tfrsSentence = i;\n\t\t\t\t}\n\n\t\t\t\tif (max2Score < sentenceScores[i]) {\n\t\t\t\t\tmax2Score = sentenceScores[i];\n\t\t\t\t\ttop2Sentence = i;\n\t\t\t\t\t//logger.debug(\"top 2 sentence is \" + i);\n\t\t\t\t\tif (max2Score > max1Score) {\n\t\t\t\t\t\ttmpScore = max1Score; max1Score = max2Score; max2Score = tmpScore;\n\t\t\t\t\t\ttmpSentence = top1Sentence; top1Sentence = top2Sentence; top2Sentence = tmpSentence;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tint lastIndexOfSpace = -1;\n\t\t\tString sentence=\"\";\n\t\t\tString secondSentence=\"\";\n\t\t\tString snippet = \"\";\n\t\t\tif (max1Score == -1) {\n\t\t\t\tif (frsSentence>=0) {\n\t\t\t\t\tsentence = sentences[frsSentence];\n\t\t\t\t\tif (sentence.length() > 100) {\n\t\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 100);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (sndSentence>=0) {\n\t\t\t\t\tsecondSentence = sentences[sndSentence];\n\t\t\t\t\tif (secondSentence.length() > 100) {\n\t\t\t\t\t\tlastIndexOfSpace = secondSentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\t\tsecondSentence = secondSentence.substring(0, lastIndexOfSpace>0 ? lastIndexOfSpace : 100);\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 (frsSentence >=0 && sndSentence >= 0) \n\t\t\t\t\tsnippet = sentence.trim() + \"...\" + secondSentence.trim();\n\t\t\t\telse if (frsSentence >= 0 && sndSentence<0) \n\t\t\t\t\tsnippet = sentence.trim();\n\t\t\t\t\n\t\t\t} else if (sentences[top1Sentence].length()<100 && top1Sentence!=top2Sentence) {\n\t\t\t\tsentence = sentences[top1Sentence];\n\t\t\t\tif (sentence.length() > 100) {\n\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 100);\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\tsecondSentence = sentences[top2Sentence];\n\t\t\t\tif (secondSentence.length() > 100) {\n\t\t\t\t\tlastIndexOfSpace = secondSentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\tsecondSentence = secondSentence.substring(0, lastIndexOfSpace>0 ? lastIndexOfSpace : 100);\n\t\t\t\t}\n\t\t\t\tsnippet = sentence.trim() + \"...\" + secondSentence.trim();\n\t\t\t} else {\n\t\t\t\tsentence = sentences[top1Sentence];\n\t\t\t\tif (sentence.length()>200) {\n\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 200).lastIndexOf(\" \");\n\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 200);\n\t\t\t\t}\n\t\t\t\tsnippet = sentence.trim();\n\t\t\t}\n\t\t\t\n\t\t\t//checking and removing any control characters\n\t\t\tcontrolNonVisibleCharactersMatcher.reset(snippet);\n\t\t\tsnippet = controlNonVisibleCharactersMatcher.replaceAll(\"\");\n\t\t\t\n\t\t\t//String escapedSnippet = StringEscapeUtils.escapeHtml(snippet);\n\t\t\t//if (highlightQueryTerms)\n\t\t\t//\tescapedSnippet = highlight.matcher(escapedSnippet).replaceAll(\"$1<b>$2</b>$3\");\n\t\t\tif (highlightQueryTerms)\n\t\t\t\tsnippet = highlight.matcher(snippet).replaceAll(\"$1<b>$2</b>$3\");\n\t\t\t//else \n\t\t\t//\tsnippet = StringEscapeUtils.escapeHtml(snippet);\n\t\t\t\n\t\t\t//change by Vassilis, 20/09/2006\n\t\t\t//disabling the xml escaping in order to move the data into ![CDATA[ ]]\n\t\t\t//the code was:\n\t\t\t//rs.addMetaItem(\"snippet\", DocAtNumber, StringEscapeUtils.escapeXml(snippet));\n\t\t\t//and now it is:\n\t\t\t//snippet.replaceAll(\"[^\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]\",\"\");\n\t\t\trs.addMetaItem(\"snippet\", DocAtNumber, snippet);\n\t\t\t\n\t\t}\n\t\tif (show_title)\n\t\t{\n\t\t\tString title = metadata[2];\n\t\t\t\n\t\t\t//checking and removing any control characters\n\t\t\tcontrolNonVisibleCharactersMatcher.reset(title);\n\t\t\ttitle = controlNonVisibleCharactersMatcher.replaceAll(\"\");\n\t\t\ttitle = (highlightQueryTerms)\n\t\t\t\t ? highlight.matcher(metadata[2]).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t\t : metadata[2];\n\t\t\t\n\t\t\t\n\t\t\t//String escapedTitle = StringEscapeUtils.escapeHtml(metadata[2]);\n\t\t\t//String title = (highlightQueryTerms)\n\t\t\t//\t\t\t ? highlight.matcher(escapedTitle).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t//\t\t\t : escapedTitle;\n\t\t\t//String title = (highlightQueryTerms) \n\t\t\t//\t\t? highlight.matcher(metadata[2]).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t//\t\t: metadata[2];\n\n\t\t\t//change by Vassilis, 20/09/2006\n\t\t\t//disabling the xml escaping in order to move the data into ![CDATA[ ]]\n\t\t\t//the code was:\n\t\t\t//rs.addMetaItem(\"title\", DocAtNumber, StringEscapeUtils.escapeXml(title));\n\t\t\t//and now is:\n\t\t\t//title.replaceAll(\"[^\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]\",\"\");\n\t\t\trs.addMetaItem(\"title\", DocAtNumber, title);\n\t\t\t\n\t\t}\n\t\tif (!show_docid_early && show_docid)\n\t\t{\n\t\t\trs.addMetaItem(\"docid\", DocAtNumber, docIndex.getDocumentNumber(DocNo));\n\t\t}\n\t\tif (!show_url_early && show_url)\n\t\t{\n\n\t\t\trs.addMetaItem(\"url\", DocAtNumber, StringEscapeUtils.escapeXml(metadata[0]));\n\t\t}\n\t\t\n\t\treturn FILTER_OK;\n\t}", "@Test\n\tpublic void singleWordGrepTest2() throws Exception {\n\t\t// word is 'crazy'\n\t\tHashSet<String> grepFound = loadGrepResults(\"crazy\");\n\t\tCollection<Page> index = queryTest.query(\"crazy\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\t// tests set equality \n\t\tassertEquals(indexFound, grepFound);\n\t}", "public String getSearchString() {\r\n return super.getSearchString();\r\n \r\n// String searchStr = \"\";\r\n// //put exact phrase at the very beginning\r\n// if(exactphrase != null && exactphrase.length() > 0)\r\n// {\r\n// searchStr += \"\\\"\" + exactphrase + \"\\\"\";\r\n// }\r\n//\r\n// String allwordsSearchStr = \"\";\r\n// if(allwords != null && allwords.length() > 0)\r\n// {\r\n// String [] words = allwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// allwordsSearchStr += \"+\" + words[i];\r\n// }\r\n// }\r\n// }\r\n//\r\n// String withoutwordsSearchStr = \"\";\r\n// if(withoutwords != null && withoutwords.length() > 0)\r\n// {\r\n// String [] words = withoutwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// withoutwordsSearchStr += \"+-\" + words[i];\r\n// }\r\n// }\r\n// }\r\n//\r\n// searchStr += allwordsSearchStr + withoutwordsSearchStr; //need to add other string\r\n// \r\n// String oneofwordsSearchStr = \"\";\r\n// if(oneofwords != null && oneofwords.length() > 0)\r\n// {\r\n// String [] words = oneofwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// oneofwordsSearchStr = \"(\";\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// oneofwordsSearchStr += words[i] + \" \";\r\n// }\r\n// oneofwordsSearchStr = oneofwordsSearchStr.trim();\r\n// oneofwordsSearchStr += \")\";\r\n// }\r\n// }\r\n// if(oneofwordsSearchStr.length() > 0)\r\n// {\r\n// searchStr += \"+\" + oneofwordsSearchStr;\r\n// }\r\n//\r\n// return searchStr;\r\n }", "public static void search(String word){\n if(index.containsKey(word)){\n System.out.println(\"word \" + word + \" displays in :\");\n HashSet<String> list = index.get(word);\n for(String str:list){\n System.out.println(str);\n }\n }\n else{\n System.out.println(\"word \" + word + \" doesn't found!\");\n }\n }", "public abstract Set<String> getTerms(Document doc);", "@Override\n public boolean search(final String word) {\n final TrieNode p = searchNode(word);\n if (p == null) {\n return false;\n } else {\n return p.isEnd;\n }\n\n }", "public void indexCreate()\n {\n try{\n Directory dir = FSDirectory.open(Paths.get(\"indice/\"));\n Analyzer analyzer = new StandardAnalyzer();\n IndexWriterConfig iwc = new IndexWriterConfig(analyzer);\n iwc.setOpenMode(OpenMode.CREATE);\n IndexWriter writer = new IndexWriter(dir,iwc);\n MongoConnection mongo = MongoConnection.getMongo();\n mongo.OpenMongoClient();\n DBCursor cursor = mongo.getTweets();\n Document doc = null;\n\n while (cursor.hasNext()) {\n DBObject cur = cursor.next();\n if (cur.get(\"retweet\").toString().equals(\"false\")) {\n doc = new Document();\n doc.add(new StringField(\"id\", cur.get(\"_id\").toString(), Field.Store.YES));\n doc.add(new TextField(\"text\", cur.get(\"text\").toString(), Field.Store.YES));\n doc.add(new StringField(\"analysis\", cur.get(\"analysis\").toString(), Field.Store.YES));\n //doc.add(new StringField(\"finalCountry\",cur.get(\"finalCountry\").toString(),Field.Store.YES));\n doc.add(new StringField(\"userScreenName\", cur.get(\"userScreenName\").toString(), Field.Store.YES));\n doc.add(new StringField(\"userFollowersCount\", cur.get(\"userFollowersCount\").toString(), Field.Store.YES));\n doc.add(new StringField(\"favoriteCount\", cur.get(\"favoriteCount\").toString(), Field.Store.YES));\n\n if (writer.getConfig().getOpenMode() == OpenMode.CREATE) {\n System.out.println(\"Indexando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.addDocument(doc);\n System.out.println(doc);\n } else {\n System.out.println(\"Actualizando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.updateDocument(new Term(\"text\" + cur.get(\"text\")), doc);\n System.out.println(doc);\n }\n }\n }\n cursor.close();\n writer.close();\n }\n catch(IOException ioe){\n System.out.println(\" Error en \"+ ioe.getClass() + \"\\n mensaje: \" + ioe.getMessage());\n }\n }", "public NavigableSet<Integer> findAllTextIndexes (String words,\n DialogueConstraints constraints)\n {\n\n NavigableSet<Integer> matches = new TreeSet ();\n\n for (Paragraph p : this.paragraphs)\n {\n\n for (Sentence s : p.getSentences ())\n {\n\n int st = s.getAllTextStartOffset ();\n\n // These indexes will be sentence local.\n NavigableSet<Integer> found = s.find (words,\n constraints);\n\n if (found != null)\n {\n\n for (Integer i : found)\n {\n\n matches.add (s.getWord (i).getAllTextStartOffset ());\n\n //matches.add (i + st);\n\n }\n\n }\n\n }\n\n }\n\n return matches;\n\n }", "void setVersesWithWord(Word word);", "@Override\n public List<DefinitionDTO> findWordsByWord(String query) {\n List<Word> words = wordRepository.findBySearchString(query);\n return DTOMapper.mapWordListToDefinitionDTOList(words);\n }", "public boolean search(String word) {\n TrieNode p = searchNode(word);\n if (p == null) {\n return false;\n } else {\n if (p.isEnd)\n return true;\n }\n return false;\n }", "@RequestMapping(\"/{words}\")\n\tpublic List<WordMatch> match(@PathVariable(\"words\") String words) {\n\t\tList<WordMatch> matches = new ArrayList<>();\n\t\tfor (String text : words.split(\",\")) {\n\t\t\tmatches.add(service.getMatch(text));\n\t\t}\n\t\treturn matches;\n\t}", "public void update_query(TwitterParser tweet)\r\n\t{\r\n\t\tfor(String s : tweet.get_words())\r\n\t\t\tupdate_query(s, tweet.get_date());\r\n\t}", "public boolean search(String word) {\n TrieNode tail = match(root, word.toCharArray(), 0);\n return tail != null && tail.isWord;\n }" ]
[ "0.68965036", "0.60956764", "0.59332526", "0.5928022", "0.58062935", "0.57813257", "0.57707757", "0.5745215", "0.5720394", "0.5696968", "0.5672093", "0.5598769", "0.55674994", "0.5545627", "0.551981", "0.5488837", "0.5467346", "0.5463441", "0.5459747", "0.54115915", "0.54083467", "0.53953767", "0.5391441", "0.53906476", "0.53725624", "0.5353626", "0.5352088", "0.5350505", "0.5335609", "0.5330886", "0.5328691", "0.5327778", "0.5325446", "0.5319408", "0.5317524", "0.5294895", "0.5285359", "0.5281712", "0.52505815", "0.5246937", "0.52438176", "0.52434886", "0.52383024", "0.52372134", "0.523431", "0.5232757", "0.5225849", "0.5224117", "0.52222437", "0.5219486", "0.5218335", "0.521531", "0.52151436", "0.52111137", "0.52080995", "0.5202601", "0.519827", "0.51914936", "0.51902807", "0.51823294", "0.5179358", "0.5177864", "0.51771694", "0.51712996", "0.5164564", "0.51634604", "0.5152826", "0.5144986", "0.5144545", "0.5143623", "0.51334417", "0.51252866", "0.5123423", "0.51116735", "0.51089877", "0.5108332", "0.51031905", "0.5101254", "0.5100895", "0.509325", "0.5088569", "0.5084975", "0.5077453", "0.5075403", "0.50709534", "0.50593686", "0.50579244", "0.50556076", "0.50508076", "0.5047578", "0.50396097", "0.50298953", "0.5028033", "0.50276726", "0.50243247", "0.50175154", "0.50169563", "0.5012295", "0.49946234", "0.49869072" ]
0.56311864
11
[NEW] Intersects a set of queries TODO: Skip pointer
public PostingsList intersect(Query query){ LinkedList<PostingsList> listQueriedPostings = new LinkedList<PostingsList>(); // List with postings corresponding to the queries for (int i = 0; i<query.size(); i++){ // If any query has zero matches, return 0 results //if(!(new File("postings/t"+hash(query.terms.get(i))+".json")).exists()){ if (!this.index.containsKey(query.terms.get(i))){ return null; } // Otherwise store postings in the list listQueriedPostings.add(this.getPostings(query.terms.get(i))); } // Order the posting list by increasing document frequency listQueriedPostings = sortByIncreasingFrequency(listQueriedPostings); PostingsList result = (PostingsList)listQueriedPostings.get(0); // In case only one word is queried if (listQueriedPostings.size() == 1){ return result; } // Apply algorithm as many times as words in the query for(int i = 1; i < listQueriedPostings.size(); i++){ result = intersect(result, listQueriedPostings.get(i)); if (result.isEmpty()){ return null; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\t\tpublic void testIntersection() {\n\t\t\ttestingSet = new IntegerSet(list1);\r\n\t\t\ttestingSet2= new IntegerSet(list2);\r\n\t\t\t// create 3rdset = to the intersection list \r\n\t\t\ttestingSet3= new IntegerSet(intersection);\r\n\t\t\t// create 4th set =to the intersection of set1 and set2\r\n\t\t\ttestingSet4= testingSet.intersection(testingSet, testingSet2);\r\n\t\t\t// sets 3 and set 4 should be equal \r\n\t\t\t// assertEquals for these parameters is a deprecated method \r\n\t\t\tassertArrayEquals(testingSet3.toArray(),testingSet4.toArray());\t \r\n\t\t}", "private void addQueries(String query){\n ArrayList <String> idsFullSet = new ArrayList <String>(searchIDs);\n while(idsFullSet.size() > 0){\n ArrayList <String> idsSmallSet = new ArrayList <String>(); \n if(debugMode) {\n System.out.println(\"\\t Pmids not used in query available : \" + idsFullSet.size());\n }\n idsSmallSet.addAll(idsFullSet.subList(0,Math.min(getSearchIdsLimit(), idsFullSet.size())));\n idsFullSet.removeAll(idsSmallSet);\n String idsConstrain =\"\";\n idsConstrain = idsConstrain(idsSmallSet);\n addQuery(query,idsConstrain);\n }\n }", "private static Set<Item> multiSetIntersection(List<Set<Item>> setList) {\n Set<Item> interQrels = new HashSet<>(setList.get(0));\r\n \r\n for (int i = 1; i< setList.size();i++) {\r\n interQrels.retainAll(setList.get(i)); // intersection with two (and one)\r\n }\r\n\r\n return interQrels;\r\n }", "private static Set<Dataset> findDatasets(Datasource d, String query) {\n String[] words = query.split(\"\\\\+\");\n Set<String> keyWords = new HashSet<String>();\n for (String word : words) {\n keyWords.add(word.toLowerCase());\n }\n Set<Dataset> ret = new HashSet<Dataset>();\n String tags;\n for (Dataset set : d.getDatasets()) {\n tags = set.getTags();\n if (intersects(tags, keyWords)) {\n ret.add(set);\n }\n } \n return ret;\n }", "@Test\n public void testIntersection3()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n set2.add(i);\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "protected abstract NativeSQLStatement createNativeIntersectsStatement(Geometry geom);", "protected abstract Iterable<E> getIntersecting(D lower, D upper);", "@Test\n public void testIntersection4()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n if (i != 500) {\n set2.add(i);\n expected.add(i);\n }\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n public void testIntersection6()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n for (int i = 0; i < 5; i++) {\n set1.add(i);\n }\n for (int i = 1000; i < 1005; i++) {\n set1.add(i);\n }\n\n ConciseSet set2 = new ConciseSet();\n for (int i = 800; i < 805; i++) {\n set2.add(i);\n }\n for (int i = 806; i < 1005; i++) {\n set2.add(i);\n }\n\n for (int i = 1000; i < 1005; i++) {\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n public void testIntersection5()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 200000};\n List<Integer> expected = new ArrayList<>();\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "public static List<String> query_intersect(List<String> queryWords) throws IOException {\n\t\tif (!initialized) initialize();\n\t\tList<PostingList> pls = new ArrayList<PostingList> ();\n\t\tfor (String queryWord : queryWords) {\n\t\t\tqueryWord = queryWord.toLowerCase();\n\t\t\tif (!termDict.containsKey(queryWord)) {\n\t\t\t\tpls.clear();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tPostingList pl = readPosting(fc, termDict.get(queryWord));\n\t\t\tif (pl == null) {\n\t\t\t\tpls.clear();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpls.add(readPosting(fc, termDict.get(queryWord)));\n\t\t}\n\t\tCollections.sort(pls, new Comparator<PostingList>(){\n\t\t public int compare(PostingList p1, PostingList p2) {\n\t\t return p1.size() - p2.size(); // assumes you want biggest to smallest\n\t\t }\n\t\t});\n\t\tif (pls.size() == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tList<Integer> current = pls.get(0).getList();\n\t\t\tfor (int i = 1; i < pls.size(); i++) {\n\t\t\t\tList<Integer> toBeAdd = pls.get(i).getList();\n\t\t\t\tcurrent = intersect(current, toBeAdd);\n\t\t\t}\n\t\t\tif (current.size() == 0) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\tList<String> result = new ArrayList<String>();\n\t\t\t\tfor (int docId : current) {\n\t\t\t\t\tresult.add(docDict.get(docId));\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void testIntersection1()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {33, 100000};\n List<Integer> expected = Arrays.asList(33, 100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "public ArrayList<ArrayList> intersection (ArrayList<ArrayList> data, ArrayList<ArrayList> data2)\n {\n ArrayList<Document> docs = data.get(0);\n ArrayList<Double> relevance = data.get(1);\n ArrayList<Integer> occurrence = data.get(2);\n ArrayList<Integer> popularity = data.get(3);\n \n ArrayList<Document> docs2 = data2.get(0);\n ArrayList<Double> relevance2 = data2.get(1);\n ArrayList<Integer> occurrence2 = data2.get(2);\n ArrayList<Integer> popularity2 = data2.get(3);\n \n ArrayList<Document> docs3 = new ArrayList<>();\n ArrayList<Double> relevance3 = new ArrayList<>();\n ArrayList<Integer> occurrence3 = new ArrayList<>();\n ArrayList<Integer> popularity3 = new ArrayList<>();\n \n for(Document d: docs)\n {\n if(docs2.contains(d))\n {\n docs3.add(d);\n int docIndex = docs.indexOf(d);\n int docIndex2 = docs2.indexOf(d);\n double oldRel = (double) relevance.get(docIndex);\n int oldOcc = (int) occurrence.get(docIndex);\n relevance3.add(oldRel+relevance2.get(docIndex2));\n if(oldOcc > occurrence2.get(docIndex2))\n {\n occurrence3.add(occurrence2.get(docIndex2));\n }\n else\n {\n occurrence3.add(oldOcc);\n }\n popularity3.add(d.popularity);\n }\n \n }\n data = new ArrayList<ArrayList> ();\n data.add(docs3);\n data.add(relevance3);\n data.add(occurrence3);\n data.add(popularity3);\n \n return data;\n }", "@Test\n public void testIntersection2()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 100000};\n List<Integer> expected = Collections.singletonList(100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "public ArrayList<SearchResult> partialSearch(Collection<String> queries) {\n\t\tArrayList<SearchResult> results = new ArrayList<>();\n\t\tHashMap<String, SearchResult> track = new HashMap<>();\n\n\t\tfor (String query : queries) {\n\t\t\tfor (String word : this.invertedIndex.tailMap(query).keySet()) {\n\t\t\t\tif (word.startsWith(query)) {\n\t\t\t\t\tsearchHelper(results, word, track);\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tCollections.sort(results);\n\t\treturn results;\n\t}", "public static void main(String[] args) {\n\t\tInteger[] firstArray = {0,2,4,6,8};\n\t Integer[] secondArray = {1,3,10,4,7,8,9};\n\t \n\t intersectionUsingSet(firstArray, secondArray);\n\n\t System.out.println();\n\t \n\t // Array with duplicate elements in the array\n\t Integer[] firstArray1 = {0,2,2,4,6,6,8};\n\t Integer[] secondArray2 = {1,3,10,10,4,7,8,9};\n\t \n\t intersectionUsingSet(firstArray1, secondArray2);\n\t}", "public intersection(){}", "QueryResult(Pair<Integer, String>[] queries) {\n results = new ConcurrentHashMap<>(queries.length);\n for (Pair<Integer, String> query : queries)\n results.put(query.first, new int[0]);\n }", "public static void main(String[] args) {\n\t\tint [] a = {3,4,5,6};\n\t\tint [] b = {1,2,3};\t\n\t\tint [] c = {7,8,9};\t\n\t\tint [] d = {};\n\t\tSystem.out.println(intersection(a,b)); //true\n\t\tSystem.out.println(intersection(b,c)); //false\n\t\tSystem.out.println(intersection(a,c)); //false\n\t\tSystem.out.println(intersection(a,d)); //false\n\t\t}", "public void intersect(Collection<String> ids) {\n mSelection.retainAll(ids);\n mProvisionalSelection.retainAll(ids);\n }", "@Test\n public void mapContains() {\n check(MAPCONT);\n query(MAPCONT.args(MAPNEW.args(), 1), false);\n query(MAPCONT.args(MAPENTRY.args(1, 2), 1), true);\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(Arrays.toString(intersect(new int[]{1, 2, 3, 4}, new int[]{1, 2, 3, 4, 1, 2, 3, 4})));\n\t}", "@Test(expected = NullPointerException.class)\r\n\t\tpublic void testIntersectionWithNullInput() {\r\n\t\t\ttestingSet = new IntegerSet(null);\r\n\t\t\ttestingSet2= new IntegerSet(null); \r\n\t\t\t\r\n\t\t\t// union of 2 null sets \r\n\t\t\ttestingSet3= testingSet.intersection(testingSet, testingSet2);\r\n\t\t}", "@Test\n public void testBatchedInQuery() {\n TestDataCreator creator = new TestDataCreator(getSessionFactory());\n Town town = creator.createTestTown();\n\n int n = 10;\n List<Long> ids = new ArrayList<>(n);\n for (long i=0; i < n; i++) {\n Person savedPerson = creator.createTestPerson(town, \"P\" + i);\n ids.add(savedPerson.getId());\n }\n for (long i=0; i < n; i++) {\n creator.createTestPerson(town, \"P\" + i);\n }\n\n Person person = query.from(Person.class);\n query.where(person.getId()).in(ids, 2);\n\n validate(\"from Person hobj1 where hobj1.id in (:np1)\", ids);\n assertEquals(n, doQueryResult.size());\n }", "public static void main(String[] args) {\n\t\tIntersection l5=new Intersection(5,null);\n\t\tIntersection l4=new Intersection(4,l5);\n\t\tIntersection l3=new Intersection(3,l4);\n\t\tIntersection l2=new Intersection(2,l3);\n\t\tIntersection l1=new Intersection(1,l2);\n\t\t\n\t\tIntersection m7=new Intersection(7,l3);\n\t\tIntersection m6=new Intersection(6,m7);\n\t\tint flag=0;\n\t\twhile(m6!=null && l1!=null){\n\t\t\tif(m6!=l1){\n\t\t\t\tm6=m6.next;\n\t\t\t\tl1=l1.next;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tflag=1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(flag==1){\n\t\t\tSystem.out.println(\"They Intersect!\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"They don't!\");\n\t\t}\n\t}", "public static void intersectionUsingSet(Integer[] firstArray, Integer[] secondArray)\n\t{\n\t LinkedHashSet<Integer> set = new LinkedHashSet<Integer>();\n\t \n\t set.addAll(Arrays.asList(firstArray));\n\t \n\t set.retainAll(Arrays.asList(secondArray));\n\t \n\t Integer[] intersectionArray = set.toArray(new Integer[set.size()]);\n\t \n\t System.out.println(\"Intersection of two arrays using set is : \");\n\t \n\t for(int i=0; i<intersectionArray.length; i++)\n\t {\n\t \tSystem.out.print(intersectionArray[i]+\" \");\n\t }\n\t}", "public Set intersection(Set intersect){\n Set newSet = new Set();\n for(int element = 0; element < intersect.size(); element++){\n if(elementOf(intersect.getSet()[element]))\n newSet.add(intersect.getSet()[element]);\n }\n return newSet;\n }", "private Set<String> getIntersection( Set<String> a, Set<String> b ) {\n\t\tSet<String> intersection = new HashSet<String>(a);\n\t\tintersection.retainAll(b);\n\t\treturn intersection;\n\t}", "public ZYSet<ElementType> intersection(ZYSet<ElementType> otherSet){\n ZYSet<ElementType> result = new ZYArraySet<ElementType>();\n for(ElementType e :this){\n if(otherSet.contains(e)){\n result.add(e);\n }\n }\n return result;\n }", "@Test\n\tpublic void integrationTest2() throws Exception {\n\t\tHashSet<String> mistress = loadGrepResults(\"mistress\");\n\t\tHashSet<String> undocumented = loadGrepResults(\"undocumented\");\n\t\tHashSet<String> insane = loadGrepResults(\"insane\");\n\t\tHashSet<String> crazy = loadGrepResults(\"crazy\");\n\t\tHashSet<String> forced = loadGrepResults(\"!i+am+forced\");\n\t\t\n\t\tHashSet<String> grepFound = new HashSet<String>(mistress);\n\t\tgrepFound.retainAll(undocumented);\n\t\tHashSet<String> temp = new HashSet<String>(crazy);\n\t\ttemp.retainAll(forced);\n\t\tgrepFound.addAll(temp);\n\t\tgrepFound.addAll(insane);\n\t\t\n\t\tCollection<Page> index = queryTest.query(\"insane | crazy & !\\\"I am forced\\\" | mistress & undocumented\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\tassertEquals(indexFound, grepFound);\n\t}", "public void testUsingQueriesFromQueryManger(){\n\t\tSet<String> names = testDataMap.keySet();\n\t\tUtils.prtObMess(this.getClass(), \"atm query\");\n\t\tDseInputQuery<BigDecimal> atmq = \n\t\t\t\tqm.getQuery(new AtmDiot());\n\t\tMap<String, ComplexQueryResult<BigDecimal>> bdResult = \n\t\t\t\tatmq.get(names, 1, TimeUnit.SECONDS);\n\t\tCollectionsStaticMethods.prtMapItems(bdResult);\n\n\t\tUtils.prtObMess(this.getClass(), \"vol query\");\n\t\tDseInputQuery<BigDecimal> volq = \n\t\t\t\tqm.getQuery(new VolDiotForTest());\n\t\tMap<String, ComplexQueryResult<BigDecimal>> dbResult = \n\t\t\t\tvolq.get(names, 1, TimeUnit.SECONDS);\n\t\tCollectionsStaticMethods.prtMapItems(dbResult);\n\t\n\t\tUtils.prtObMess(this.getClass(), \"integer query\");\n\t\tDseInputQuery<BigDecimal> strikeq = \n\t\t\t\tqm.getQuery(new StrikeDiotForTest());\n\t\tMap<String, ComplexQueryResult<BigDecimal>> strikeResult = \n\t\t\t\tstrikeq.get(names, 1, TimeUnit.SECONDS);\n\t\tCollectionsStaticMethods.prtMapItems(strikeResult);\n\t\n\t}", "public void getIntersection(int[] A, int[] B, ArrayList<int[]> intersections) \n {\n if (A[0] >= B[0] && A[0] <= B[1]) \n {\n if (A[1] >= B[0] && A[1] <= B[1]) \n {\n // Take the entirety of A\n intersections.add(A);\n } \n else \n {\n // Take the start of A to end of B\n int[] intersection = new int[]{A[0], B[1]};\n intersections.add(intersection);\n }\n } \n else \n {\n if (A[1] >= B[0] && A[1] <= B[1]) \n {\n // Take start of B to end of A\n int[] intersection = new int[]{B[0], A[1]};\n intersections.add(intersection);\n } \n else \n {\n if (A[0] < B[0] && A[1] > B[1]) \n {\n // Take the entirety of B\n intersections.add(B);\n } \n else \n {\n // No intersection at all\n return;\n }\n }\n }\n }", "public static void main(String[] args) {\n\t\t\n\tint[] firstArr =\t{1,2,3,4,5};\n\tint[] secondArr =\t{2,3,4,9,6,10};\n\tSet<Integer> set = new HashSet<Integer>();\n\tfor(int i=0; i<secondArr.length; i++) {\n\t\tset.add(secondArr[i]);\n\t}\n\tfor(int i=0; i<firstArr.length; i++) {\n\t\tboolean status =set.add(firstArr[i]);\n\t\tif(status==false) {\n\t\t\tSystem.out.println(\"Intersection Elements :\"+firstArr[i]);\n\t }\n\t}\n }", "public void sensibleMatches1() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n Map<String, Set<String>> mapWithoutHal = new HashMap<>(clientMap);\n mapWithoutHal.remove(\"Hal\");\n for (String eachClient : mapWithoutHal.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }", "private Set<String> intersection(Set<String> s1, Set<String> s2) {\n Set<String> intersection = new HashSet<>(s1);\n intersection.retainAll(s2);\n return intersection;\n }", "public PostingsList intersect(PostingsList l1, PostingsList l2){\n\n PostingsList intersection = new PostingsList();\n\n // Counters to iterate docIDs\n int count1 = 0;\n int count2 = 0;\n\n // First posting\n PostingsEntry p1 = l1.get(0);\n PostingsEntry p2 = l2.get(0);\n\n while(true){\n // Match - EUREKA! //\n if (p1.docID == p2.docID){\n // Add match\n intersection.insert(p1.docID);\n // Increase counters\n count1++;\n count2++;\n // Go to next postings (check for nullpointer)\n if (count1<l1.size() && count2<l2.size()){\n p1 = l1.get(count1);\n p2 = l2.get(count2);\n }\n else\n break;\n }\n // No match\n else if (p1.docID < p2.docID){\n count1++;\n if (count1<l1.size())\n p1 = l1.get(count1);\n else\n break;\n }\n // No match\n else{\n count2++;\n if (count2<l2.size())\n p2 = l2.get(count2);\n else\n break;\n }\n }\n\n return intersection;\n }", "@Override\r\n public void intersect( Ray ray, IntersectResult result ) {\n\t\r\n }", "public void matchesDemo() \n {\n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection;\n\n for (String eachClient : clientMap.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString) ;\n }\n }", "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 }", "public int[] intersection(int[] nums1, int[] nums2) {\n \n HashSet<Integer> set = new HashSet<>();\n ArrayList<Integer> inter = new ArrayList<>();\n if(nums1.length > nums2.length)\n {\n for(int i = 0; i < nums1.length ;i ++)\n set.add(nums1[i]);\n\n for(int i = 0; i < nums2.length ;i ++)\n if(set.contains(nums2[i])&& !inter.contains(nums2[i]))\n inter.add(nums2[i]);\n }\n else {\n for(int i = 0; i < nums2.length ;i ++)\n set.add(nums2[i]);\n\n for(int i = 0; i < nums1.length ;i ++)\n if(set.contains(nums1[i]) && !inter.contains(nums1[i]))\n inter.add(nums1[i]);\n }\n\n int [] arr = new int[inter.size()];\n for(int i = 0; i < arr.length ;i ++)\n arr[i] = inter.get(i);\n return arr;\n\n }", "public ArrayList<SearchResult> exactSearch(Collection<String> queries) {\n\t\tArrayList<SearchResult> results = new ArrayList<>();\n\t\tHashMap<String, SearchResult> track = new HashMap<>();\n\n\t\tfor (String query : queries) {\n\t\t\tif (invertedIndex.containsKey(query)) {\n\t\t\t\tsearchHelper(results, query, track);\n\t\t\t}\n\t\t}\n\t\tCollections.sort(results);\n\t\treturn results;\n\t}", "public void testQuery() throws Exception {\n DummyApprovalRequest req1 = new DummyApprovalRequest(reqadmin, null, caid, SecConst.EMPTY_ENDENTITYPROFILE, false);\n DummyApprovalRequest req2 = new DummyApprovalRequest(admin1, null, caid, SecConst.EMPTY_ENDENTITYPROFILE, false);\n DummyApprovalRequest req3 = new DummyApprovalRequest(admin2, null, 3, 2, false);\n\n approvalSessionRemote.addApprovalRequest(admin1, req1, gc);\n approvalSessionRemote.addApprovalRequest(admin1, req2, gc);\n approvalSessionRemote.addApprovalRequest(admin1, req3, gc);\n\n // Make som queries\n Query q1 = new Query(Query.TYPE_APPROVALQUERY);\n q1.add(ApprovalMatch.MATCH_WITH_APPROVALTYPE, BasicMatch.MATCH_TYPE_EQUALS, \"\" + req1.getApprovalType());\n\n List result = approvalSessionRemote.query(admin1, q1, 0, 3, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() >= 2 && result.size() <= 3);\n\n result = approvalSessionRemote.query(admin1, q1, 1, 3, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() >= 1 && result.size() <= 3);\n\n result = approvalSessionRemote.query(admin1, q1, 0, 1, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() == 1);\n\n Query q2 = new Query(Query.TYPE_APPROVALQUERY);\n q2.add(ApprovalMatch.MATCH_WITH_STATUS, BasicMatch.MATCH_TYPE_EQUALS, \"\" + ApprovalDataVO.STATUS_WAITINGFORAPPROVAL, Query.CONNECTOR_AND);\n q2.add(ApprovalMatch.MATCH_WITH_REQUESTADMINCERTSERIALNUMBER, BasicMatch.MATCH_TYPE_EQUALS, reqadmincert.getSerialNumber().toString(16));\n\n result = approvalSessionRemote.query(admin1, q1, 1, 3, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() >= 1 && result.size() <= 3);\n\n // Remove the requests\n int id1 = ((ApprovalDataVO) approvalSessionRemote.findApprovalDataVO(admin1, req1.generateApprovalId()).iterator().next()).getId();\n int id2 = ((ApprovalDataVO) approvalSessionRemote.findApprovalDataVO(admin1, req2.generateApprovalId()).iterator().next()).getId();\n int id3 = ((ApprovalDataVO) approvalSessionRemote.findApprovalDataVO(admin1, req3.generateApprovalId()).iterator().next()).getId();\n approvalSessionRemote.removeApprovalRequest(admin1, id1);\n approvalSessionRemote.removeApprovalRequest(admin1, id2);\n approvalSessionRemote.removeApprovalRequest(admin1, id3);\n }", "public static void main(String[] args) {\n\t\tint[] nums1 = {4,9,5};\r\n\t\tint[] nums2 = {9,4,9,8,4};\r\n\t\t//System.out.println(intersection(nums1, nums2));\r\n\t\tArrays.sort(nums1);\r\n\t\tArrays.sort(nums2);\r\n\t\tif (nums1.length>nums2.length) {\r\n\t\t\tint[] temp = nums2;\r\n\t\t\tnums2 = nums1;\r\n\t\t\tnums1 = temp;\r\n\t\t}\r\n\t\tHashSet<Integer> mSet1 = new HashSet<Integer>();\r\n\t\tHashSet<Integer> mSet2 = new HashSet<Integer>();\r\n\t\tfor (Integer i : nums2) {\r\n\t\t\tmSet1.add(i);\r\n\t\t}\r\n\t\tfor (Integer x: nums1) {\r\n\t\t\tif (mSet1.contains(x)) {\r\n\t\t\t\tmSet2.add(x);\r\n\t\t\t}\r\n\t\t}\r\n\t\tint[] r = new int[mSet2.size()];\r\n\t\tint index = 0;\r\n\t\tfor (Integer g: mSet2) {\r\n\t\t\tr[index] = g;\r\n\t\t\tindex++;\r\n\t\t}\r\n\t}", "public static int[] intersection(int[] nums1, int[] nums2) {\n if(nums1 == null || nums2 == null){\n return null;\n }\n HashSet<Integer> set = new HashSet<>();\n for (int aNubs1 : nums1) {\n set.add(aNubs1);\n }\n HashSet<Integer> result = new HashSet<>();\n for (int aNubs2 : nums2) {\n if (set.contains(aNubs2) && !result.contains(aNubs2)) {\n result.add(aNubs2);\n }\n }\n int [] intersection = new int[result.size()];\n int index = 0;\n for(int temp : result){\n intersection[index++] = temp;\n }\n return intersection;\n }", "public void sensibleMatches2() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n for (String eachClient : clientMap.keySet()) \n {\n if (!eachClient.equals(\"Hal\")) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }\n }", "protected <Ty> HashSet<Ty> intersection(HashSet<Ty> setA, HashSet<Ty> setB) {\n HashSet<Ty> retSet = new HashSet<>();\n for (Ty t : setA) {\n if (setB.contains(t)) {\n retSet.add(t);\n }\n }\n return retSet;\n }", "QueryResult(String... queries) {\n results = new ConcurrentHashMap<>(queries.length);\n for (String query : queries)\n results.put(query.hashCode(), new int[0]);\n }", "public int[] intersection1(int[] nums1, int[] nums2) {\n Set<Integer> nums1Set = new HashSet<>();\n Set<Integer> nums2Set = new HashSet<>();\n\n for (int i = 0; i < nums1.length; i++) {\n nums1Set.add(nums1[i]);\n }\n for (int i = 0; i < nums2.length; i++) {\n nums2Set.add(nums2[i]);\n }\n\n nums1Set.retainAll(nums2Set);\n\n int[] res = new int[nums1Set.size()];\n int i = 0;\n for (int s: nums1Set) {\n res[i++] = s;\n }\n return res;\n }", "public int[] intersectionUsingSets(int[] nums1, int[] nums2) {\n Set<Integer> setA = new HashSet<>();\n Set<Integer> intersection = new HashSet<>();\n for (int num : nums1) {\n setA.add(num);\n }\n\n for (int num : nums2) {\n if (setA.contains(num)) {\n intersection.add(num);\n }\n }\n\n return getIntersectionResult(intersection);\n }", "public void intersectionOf(IntegerSet set1, IntegerSet set2) {\n get = new int[0];\n for (int i : set1.get)\n if (set2.hasElement(i))\n insertElement(i);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "public void searchArea(Connection connection, String city, String state, int zip) throws SQLException {\n\n ResultSet rs = null;\n PreparedStatement pStmt = null;\n String sql1 = \"SELECT hotel_name, branch_id FROM Hotel_Address WHERE city = ?\";\n String sql2 = \"SELECT hotel_name, branch_id FROM Hotel_Address WHERE state = ?\";\n String sql3 = \"SELECT hotel_name, branch_id FROM Hotel_Address WHERE zip = ?\";\n\n // City and State combination:\n if (city != null && state != null){\n\n pStmt = connection.prepareStatement(sql1 + \" INTERSECT \" + sql2);\n pStmt.clearParameters();\n\n setCity(city);\n pStmt.setString(1, getCity());\n setState(state);\n pStmt.setString(2, getState());\n }\n\n // City and ZIP combination:\n else if (city != null){\n\n pStmt = connection.prepareStatement(sql1 + \" INTERSECT \" + sql3);\n pStmt.clearParameters();\n\n setCity(city);\n pStmt.setString(1, getCity());\n setZip(zip);\n pStmt.setInt(2, getZip());\n }\n\n // State and ZIP combination:\n else {\n\n pStmt = connection.prepareStatement(sql2 + \" INTERSECT \" + sql3);\n pStmt.clearParameters();\n\n setState(state);\n pStmt.setString(1, getState());\n setZip(zip);\n pStmt.setInt(2, getZip());\n }\n\n try {\n\n System.out.println(\" Hotels in area:\");\n System.out.println(\"+------------------------------------------------------------------------------+\");\n\n rs = pStmt.executeQuery();\n String result;\n\n while (rs.next()) {\n\n System.out.println(rs.getString(1) + \" \" + rs.getInt(2));\n }\n }\n catch (SQLException e) { throw e; }\n finally {\n pStmt.close();\n if(rs != null) { rs.close(); }\n }\n }", "public static Set<Doc> and(Set<Doc> set1, Set<Doc> set2) {\r\n \t\t\r\n \t\tif((set1 == null) || (set2 == null)) {\r\n\t\t\tSystem.err.println(\"Doc.and() returning null!\");\r\n \t\t\treturn new TreeSet<Doc>();\r\n \t\t}\r\n \t\t//set1.retainAll(set2);\r\n \t\t//return set1;\r\n \t\t\r\n \t\tTreeSet<Doc> result = new TreeSet<Doc>();\r\n \t\tIterator<Doc> op1 = set1.iterator();\r\n \t\tIterator<Doc> op2 = set2.iterator();\r\n \t\t\r\n \t\tDoc current1 = getNext(op1);\r\n \t\tDoc current2 = getNext(op2);\r\n \r\n \t\twhile(current1!=null && current2!=null) {\r\n \t\t\t//If is the same document\r\n \t\t\tif(current1.getID() == current2.getID()) {\r\n \t\t\t\tresult.add(current1);\r\n \t\t\t\tcurrent1 = getNext(op1);\r\n \t\t\t\tcurrent2 = getNext(op2);\r\n \t\t\t}\r\n \t\t\t//If op2 is ahead of op1\r\n \t\t\telse if(current1.getID() < current2.getID()) \r\n \t\t\t\tcurrent1 = getNext(op1);\r\n \t\t\t//If op1 is ahead of op2\r\n \t\t\telse\r\n \t\t\t\tcurrent2 = getNext(op2);\r\n \t\t}\r\n \t\t\r\n \t\treturn result;\r\n \t}", "@Test\n public void test1() {\n final List<String> listA = Arrays.asList(\"Fremont\", \"Dublin\", \"anamole\", \"San Jose\" , \"SFO\", \"Dublin\", \"San Jose\", \"paramount\", \"y\");\n final List<String> listB = Arrays.asList(\"Dublin\", \"san mateo\", \"los angeles\", \"san mateo\", \"fremont\", \"anamole\", \"x\", \"x\", \"Y\");\n final List<String> common = FindIntersection.findCommonLists(listA, listB);\n System.out.println(Arrays.toString(FindIntersection.findCommonLists(listA, listB).toArray()));\n\n }", "private boolean intersectsAggregate( Aggregate mprim ) throws Exception {\n boolean inter = false;\n\n int cnt = mprim.getSize();\n\n for ( int i = 0; i < cnt; i++ ) {\n if ( intersects( mprim.getObjectAt( i ) ) ) {\n inter = true;\n break;\n }\n }\n\n return inter;\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint arr1[] = {3,2,11,4,6,7};\r\n\t\tint arr2[] = {1,2,8,4,9,7};\r\n\t\t\r\n\t\tList<Integer> list1 = new ArrayList<Integer>();\r\n\t\t\r\n\t\tList<Integer> list2 = new ArrayList<Integer>();\r\n\t\t\r\n\t\tfor (int a : arr1) {\r\n\t\t\tlist1.add(a);\r\n\t\t}\r\n\t\tfor (int b : arr2) {\r\n\t\t\tlist2.add(b);\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(list1);\r\n System.out.println(list2);\r\n \r\n list1.retainAll(list2);\r\n System.out.println(\"The Intersection values : \" + list1);\r\n \r\n\t}", "public abstract boolean intersect(BoundingBox bbox);", "public static void main (String[] args) {\n System.out.println(findIntersection(new String[] {\"1, 3, 4, 7, 13\", \"1, 2, 4, 13, 15\"})); \n System.out.println(findIntersection(new String[] {\"2, 3, 4\", \"3\"})); \n System.out.println(findIntersection(new String[] {\"1, 5, 6, 7, 10, 11, 12\", \"5, 6, 8, 11, 17\"})); \n System.out.println(findIntersection(new String[] {\"1, 2, 3, 4, 5\", \"6, 7, 8, 9, 10\"})); \n System.out.println(findIntersection(new String[] {\"1, 2, 4, 5, 6, 9\", \"2, 3, 4, 8, 10\"})); \n System.out.println(findIntersection(new String[] {\"21, 22, 23, 25, 27, 28\", \"21, 24, 25, 29\"})); \n }", "void intersect(String firstSourcePath, String secondSourcePath, String resultPath) {\n log.info(\"Start intersect files: {}, {}. Result will be written to {}\", firstSourcePath, secondSourcePath, resultPath);\n\n File firstSourceFile = new File(firstSourcePath);\n File secondSourceFile = new File(secondSourcePath);\n\n if (firstSourceFile.length() == 0 || secondSourceFile.length() == 0) {\n log.info(\"Empty file in input. First source size = {}, second source size = {}\", firstSourceFile.length(), secondSourceFile.length());\n createEmptyFile(resultPath);\n return;\n }\n\n boolean sourcesSwapped = false;\n if (firstSourceFile.length() > secondSourceFile.length()) {\n sourcesSwapped = true;\n File tmp = firstSourceFile;\n firstSourceFile = secondSourceFile;\n secondSourceFile = tmp;\n }\n\n long intersectIdsNumber = 0;\n\n try (DataByIdAccessor firstSourceAccessor = new DataByIdAccessor(firstSourceFile.getAbsolutePath())) {\n try (BufferedReader secondFileReader = new BufferedReader(new FileReader(secondSourceFile))) {\n try (BufferedWriter resultWriter = new BufferedWriter(new FileWriter(resultPath))) {\n String currentId;\n\n while ((currentId = secondFileReader.readLine()) != null) {\n String parsedId = Utils.parseId(currentId);\n String secondSourceData = secondFileReader.readLine();\n\n String firstSourceData = firstSourceAccessor.getDataById(parsedId);\n if (firstSourceData != null) {\n resultWriter.write(currentId);\n resultWriter.newLine();\n\n if (sourcesSwapped) {\n writeData(resultWriter, secondSourceData, firstSourceData);\n } else {\n writeData(resultWriter, firstSourceData, secondSourceData);\n }\n\n intersectIdsNumber++;\n }\n }\n }\n }\n log.info(\"Finished intersect files {}, {}. Result file {}. Intersect ids number = {}\", firstSourcePath, secondSourcePath, resultPath, intersectIdsNumber);\n } catch (IOException e) {\n log.error(\"Intersect files error\", e);\n }\n\n }", "void include(Set<S> segments);", "@Test\n public void sharedFilterEnsuresUniqueResults() {\n Filter filter = new Filter(\"test-filter\");\n final Dataset dataset1 = new Dataset(\"TEST1\", \"sql\", filter);\n final Dataset dataset2 = new Dataset(\"TEST2\", \"sql2\", filter); // shared same filter\n\n List<String> entry1 = new ArrayList<>();\n entry1.add(\"001\");\n entry1.add(\"aaa\");\n\n List<String> entry2 = new ArrayList<>();\n entry2.add(\"002\");\n entry2.add(\"bbb\");\n\n List<String> entry3 = new ArrayList<>();\n entry3.add(\"003\");\n entry3.add(\"ccc\");\n\n List<String> entry4 = new ArrayList<>();\n entry4.add(\"004\");\n entry4.add(\"ddd\");\n\n List<List<String>> queryResults1 = new ArrayList<>();\n queryResults1.add(entry1);\n queryResults1.add(entry2);\n queryResults1.add(entry3);\n queryResults1.add(entry4);\n\n List<String> entry5 = new ArrayList<>();\n entry5.add(\"005\"); // different\n entry5.add(\"eee\");\n\n List<String> entry6 = new ArrayList<>();\n entry6.add(\"002\"); // same\n entry6.add(\"bbb\");\n\n List<String> entry7 = new ArrayList<>();\n entry7.add(\"007\"); // different\n entry7.add(\"fff\");\n\n List<String> entry8 = new ArrayList<>();\n entry8.add(\"004\"); // same\n entry8.add(\"ddd\");\n\n List<List<String>> queryResults2 = new ArrayList<>();\n queryResults2.add(entry5);\n queryResults2.add(entry6);\n queryResults2.add(entry7);\n queryResults2.add(entry8);\n\n // given\n dataset1.populateCache(queryResults1, 200L);\n dataset2.populateCache(queryResults2, 300L);\n\n // when\n final List<String> result1 = dataset1.getCachedResult();\n final List<String> result2 = dataset1.getCachedResult();\n final List<String> result3 = dataset1.getCachedResult();\n final List<String> result4 = dataset1.getCachedResult();\n final List<String> result5 = dataset2.getCachedResult();\n final List<String> result6 = dataset2.getCachedResult();\n\n // then\n assertEquals(\"Wrong result 1\", entry1, result1); // first datset is as-is\n assertEquals(\"Wrong result 2\", entry2, result2); // first datset is as-is\n assertEquals(\"Wrong result 3\", entry3, result3); // first datset is as-is\n assertEquals(\"Wrong result 4\", entry4, result4); // first datset is as-is\n assertEquals(\"Wrong result 3\", entry5, result5); // second datset, not filtered out\n assertEquals(\"Wrong result 3\", entry7, result6); // second dataset, entry6 is filtered out\n\n // and\n try {\n dataset1.getCachedResult();\n fail(\"Expected to run out of data\");\n\n } catch (IllegalStateException ex) {\n assertEquals(\"Wrong error\", \"No more data available for dataset: TEST1\", ex.getMessage());\n }\n\n try {\n // entry7 should be filtered out, resulting in no more data\n dataset2.getCachedResult();\n fail(\"Expected to run out of data\");\n\n } catch (IllegalStateException ex) {\n assertEquals(\"Wrong error\", \"No more data available for dataset: TEST2\", ex.getMessage());\n }\n\n // and\n assertEquals(\"Wrong cache size\", Optional.of(4), dataset1.getMetrics().getCacheSize());\n assertEquals(\"Wrong timing\", Optional.of(200L), dataset1.getMetrics().getTimingMilliseconds());\n assertEquals(\"Wrong cache requested\", Optional.of(5), dataset1.getMetrics().getCacheRequested());\n assertEquals(\"Wrong filtered out\", Optional.empty(), dataset1.getMetrics().getFilteredOut());\n\n // and\n assertEquals(\"Wrong cache size\", Optional.of(4), dataset2.getMetrics().getCacheSize());\n assertEquals(\"Wrong timing\", Optional.of(300L), dataset2.getMetrics().getTimingMilliseconds());\n assertEquals(\"Wrong cache requested\", Optional.of(3), dataset2.getMetrics().getCacheRequested());\n assertEquals(\"Wrong filtered out\", Optional.of(2), dataset2.getMetrics().getFilteredOut());\n }", "public void intersectRoads() {\r\n\t\tfor (Road road : this.roads) {\r\n\t\t\tfor (Integer id : road.getIntersectionIDs()) {\r\n\t\t\t\tfor (Road link : this.roads) {\r\n\t\t\t\t\tif (id == link.getID()) {\r\n\t\t\t\t\t\troad.intersectRoad(link);\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}", "Multimap<String, String> intersects(RectangleLatLng bounds);", "@Override\n public SetInterface<T> intersection(SetInterface<T> rhs) {\n //Declare return SetInterface\n SetInterface<T> result = new ArraySet();\n //If the item is in both sets, add it to the result\n //Iterate through the calling Set\n for (int i = 0; i < numItems; i++){\n //if the item is also in RHS, add it to the result\n if(rhs.contains(arr[i]))\n result.addItem(arr[i]);\n }\n return result;\n }", "protected abstract NativeSQLStatement createNativeIntersectionStatement(Geometry geom);", "public Map<Integer, Boolean> getIntersects(Geometry geom) throws SQLException {\n return retrieveExpected(createNativeIntersectsStatement(geom), BOOLEAN);\n }", "@Test\n\tpublic void testRetainAll() {\n\t Set<Integer> setA = new HashSet<>(Arrays.asList(1, 2, 3, 4, 5));\n\t\tSet<Integer> setB = new HashSet<>(Arrays.asList(9, 8, 7, 6, 5, 4, 3));\n\t setA.retainAll(setB);\n\t Set<Integer> intersection = new HashSet<>(Arrays.asList(3, 4, 5));\n\t assertEquals(setA, intersection);\n }", "protected abstract List performQuery(String[] ids);", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Boolean isIntersection();", "Pair<Boolean, List<Result>> execQuery(int matchLimit);", "public static void intersection(ArrayList<String> x, ArrayList<String> y, ArrayList<String> z, JTextArea ta) {\n\t\t\n\t\t//This is the loop to add items from list 1 to results array, if the elements are present in both the lists\n\t\tfor (int i=0; i<x.size(); i++)\n\t\t{\n\t\t\tfor (int j=0; j<y.size(); j++)\n\t\t\t{\n\t\t\t\tif (x.get(i).equals(y.get(j))&&!z.contains(x.get(i)))\n\t\t\t\t{\n\t\t\t\t\tz.add(x.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//This is the loop to print all the items of the results array list\n\t\tta.setText(\"{ \");\n\t\tfor (int i=0; i<z.size(); i++)\n\t\t{\n\t\t\tta.append(z.get(i)+\" \");\n\t\t}\n\t\tta.append(\"}\");\n\t}", "public static void main(String[] args) {\n\t\tArray6 test = new Array6();\n\t\tint[] num1 = { 3, 1, 2 };\n\t\tint[] num2 = { 1 };\n\t\ttest.intersect(num1, num2);\n\t}", "static AnalysisResult analyseQueryComponents(ArrayList<String> components) {\n if (components != null && components.size() > 0) {\n for (int i = 0; i < components.size(); i++) {\n String component = components.get(i).toLowerCase();\n for (String attack : commonAttacks) {\n attack = attack.toLowerCase();\n if (trim(component).contains(trim(attack))) {\n return new AnalysisResult(true, i, attack, false);\n }\n }\n }\n }\n return new AnalysisResult(false, null, null, false);\n }", "@Override\n public void processElement(ProcessContext c) {\n List<LdVariant> queryList = null;\n List<LdVariant> targetList = null;\n int inputListCount = 0;\n for (KV<Boolean, List<LdVariant>> vl : c.element().getValue()) {\n if (vl.getKey()) {\n queryList = vl.getValue();\n } else {\n targetList = vl.getValue();\n }\n inputListCount++;\n }\n\n if (inputListCount != 2 || queryList == null || targetList == null) {\n throw new IllegalArgumentException(\"There should be exactly two lists.\");\n }\n\n Iterator<LdVariant> targetIter = targetList.iterator();\n\n // Our working set of variants from the target shard that could be within window of variants\n // read in from the query shard.\n LinkedList<LdVariant> storedTarget = new LinkedList<>();\n\n for (LdVariant queryVar : queryList) {\n // Fill in storedTarget until we are past window from queryVar.\n while (targetIter.hasNext()\n && (storedTarget.isEmpty() || (queryVar.getInfo().getEnd() + window) > storedTarget\n .getLast().getInfo().getStart())) {\n storedTarget.add(targetIter.next());\n }\n\n ListIterator<LdVariant> storedTargetIter = storedTarget.listIterator(0);\n while (storedTargetIter.hasNext()) {\n LdVariant targetVar = storedTargetIter.next();\n\n if (queryVar.getInfo().compareTo(targetVar.getInfo()) != -1) {\n // Only do comparisons where query is before target. If query is past target then\n // we are done with target. Note: targetVar > queryVar implies targetVar start >= queryVar\n // start.\n storedTargetIter.remove();\n } else if (targetVar.getInfo().getStart() >= (queryVar.getInfo().getEnd() + window)) {\n // If the next query starts more than window from when target starts, we are done\n // with the rest of storedTarget for this query.\n break;\n } else {\n // If target starts >= query starts and target starts < window from query end, then they\n // must overlap.\n c.output(KV.of(queryVar, targetVar));\n }\n }\n }\n }", "List<ProtocolPo> queryByUnion(ProtocolPo query);", "public void intersectFromClipboard() { genericClipboard(SetOp.INTERSECT); }", "private boolean isIntersectWithSource(List<Pair<Tuple,String>> list1, List<Pair<Tuple,String>> list2) {\n\t\tboolean intersect = false;\n\t\t\n\t\tfor (Pair<Tuple,String> tuple : list1) {\n\t\t\tif (list2.contains(tuple)) {\n\t\t\t\tintersect = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn intersect;\n\t}", "public interface SearchQuerySet extends QuerySet\n{\n\n // for AbstractSearch\n public static final int STAT_MODELS = 1;\n public static final int STAT_CLUSTERS = 2;\n public static final int STAT_GENOMES = 4;\n public static final int STAT_MODEL_CLUSTERS = 8;\n\n public String getStatsById(Collection data);\n public String getStatsByQuery(String query);\n public String getStatsById(Collection data,int stats);\n public String getStatsByQuery(String query,int stats);\n \n // for BlastSearch\n public String getBlastSearchQuery(Collection dbNames, Collection keys, KeyTypeUser.KeyType keyType);\n \n //for ClusterIDSearch\n public String getClusterIDSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for ClusterNameSearch\n public String getClusterNameSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for DescriptionSearch\n public String getDescriptionSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for GoSearch \n public String getGoSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for GoTextSearch\n public String getGoTextSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for IdSearch\n public String getIdSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for QueryCompSearch\n public String getQueryCompSearchQuery(String comp_id, String status, KeyTypeUser.KeyType keyType);\n \n // for QuerySearch\n public String getQuerySearchQuery(String queries_id, KeyTypeUser.KeyType keyType); \n \n // for SeqModelSearch\n public String getSeqModelSearchQuery(Collection model_ids, KeyTypeUser.KeyType keyType);\n \n // for UnknowclusterIdSearch\n public String getUnknownClusterIdSearchQuery(int cluster_id, KeyTypeUser.KeyType keyType);\n \n // for ProbeSetSearch\n public String getProbeSetSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for ProbeSetKeySearch\n public String getProbeSetKeySearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for QueryTestSearch\n public String getQueryTestSearchQuery(String query_id, String version, String genome_id);\n \n // for QueryStatsSearch\n public String getQueryStatsSearchQuery(List query_ids,List DBs);\n \n // for PskClusterSearch\n public String getPskClusterSearchQuery(int cluster_id,KeyTypeUser.KeyType keyType);\n \n // for ClusterCorrSearch\n public String getClusterCorrSearchQuery(int cluster_id, int psk_id, KeyTypeUser.KeyType keyType);\n \n // for UnknownGenesSearch\n public String getUnknownGenesSearchQuery(Collection sources, KeyTypeUser.KeyType keyType);\n \n}", "public int[] intersect(int[] nums1, int[] nums2) {\n Arrays.sort(nums1);\n Arrays.sort(nums2);\n List<Integer> li = new ArrayList<>();\n int index=0;\n for(int num : nums1){\n int bsIndex = binarySearch(nums2, num, index, nums2.length-1);\n if(bsIndex!=-1){\n li.add(num);\n index=bsIndex+1;\n }\t\n }\n int []ar = new int[li.size()];\n for(int i=0;i<ar.length;i++){\n ar[i]=li.get(i);\n }\n return ar;\n }", "private void positionIntersects(LinkedList<TermPositions> p1, LinkedList<TermPositions> p2, int k) {\n if (p1 != null && p2 != null) {\n int df1 = p1.size();\n int df2 = p2.size();\n while (!p1.isEmpty() && !p2.isEmpty()) {\n int tf1 = p1.peek().getPositionList().size();\n int tf2 = p1.peek().getPositionList().size();\n if (p1.peek().getDocId() == p2.peek().getDocId()) {\n LinkedList<Integer> pp1 = p1.peek().getPositionList();\n while (!pp1.isEmpty()) {\n for (Integer integer : p2.peek().getPositionList()) {\n if ((pp1.peek() - integer) < 0 && Math.abs(pp1.peek() - integer) <= (k + 1)) {\n double score = (1 + Math.log(tf1) * Math.log(N / df1)) + (1 + Math.log(tf2) * Math.log(N / df2));\n resultsCollector.add(new DocCollector(p1.peek().getDocId(), score));\n break;\n }\n }\n pp1.pop();\n }\n } else if (p1.peek().getDocId() < p2.peek().getDocId())\n p1.pop();\n else\n p2.pop();\n\n p1.pop();\n p2.pop();\n\n }\n\n }\n\n\n }", "public VertexSet intersection(VertexSet ot) {\r\n\t\tVertexSet ans = new VertexSet();\r\n\t\tint i1=0,i2=0;\r\n\t\twhile(i1<this.size() & i2 < ot.size()) {\r\n\t\t\tint a1=this.at(i1), a2 = ot.at(i2);\r\n\t\t\tif(a1==a2) {\r\n\t\t\t\tans.add(a1); i1++; i2++;}\r\n\t\t\telse if(a1<a2) {i1++;}\r\n\t\t\telse i2++;\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "public static <T> Spec<T> intersect(Collection<? extends Spec<T>> specs) {\n if (specs.size() == 0) {\n return satisfyAll();\n }\n return doIntersect(specs);\n }", "public Intersection(ListExpression expr1, ListExpression expr2) {\n this.expr1 = expr1;\n this.expr2 = expr2;\n }", "private DocFile[] search (String[] queries, String[] filters, BooleanClause.Occur filterOccur) throws ParseException {\n // create a master query builder\n BooleanQuery.Builder masterQueryBuilder = new BooleanQuery.Builder();\n // loop through all queries\n for (String query : queries) {\n if (query.equals(\"\")) continue;\n // create a boolean query for the each query\n BooleanQuery.Builder queryBuilder = new BooleanQuery.Builder();\n // loop through all filters\n for (String filter : filters) {\n if (filter.equals(\"\")) continue;\n QueryParser parser = new QueryParser(filter, analyzer);\n parser.setAllowLeadingWildcard(true);\n if (!filter.equals(Constants.INDEX_KEY_OWNER)) {\n Query parsedQ = parser.parse(query);\n queryBuilder.add(parsedQ, filterOccur);\n }\n else {\n queryBuilder.add(new PhraseQuery(filter, queries), filterOccur);\n }\n }\n masterQueryBuilder.add(queryBuilder.build(), BooleanClause.Occur.SHOULD);\n }\n\n // build the masterQuery\n BooleanQuery masterQuery = masterQueryBuilder.build();\n\n return searchResponse(searchExec(masterQuery), masterQuery);\n }", "StatementChain and(ProfileStatement... statements);", "@Test\n\tpublic void integrationTest1() throws Exception {\n\t\tHashSet<String> mistress = loadGrepResults(\"mistress\");\n\t\tHashSet<String> undocumented = loadGrepResults(\"undocumented\");\n\t\tHashSet<String> forced = loadGrepResults(\"!i+am+forced\");\n\t\t\n\t\tHashSet<String> grepFound = new HashSet<String>(mistress);\n\t\tgrepFound.retainAll(undocumented);\n\t\tgrepFound.addAll(forced);\n\t\t\n\t\tCollection<Page> index = queryTest.query(\"mistress & undocumented | (!\\\"I am forced\\\")\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\tassertEquals(indexFound, grepFound);\n\t}", "private void searchHashMap(String[] searchKey, String callNumber,int startYear, int endYear) {\n\t\t/* Temporarily stores next 'values' for a title keyword */\n\t\tArrayList<Integer> tempStore = new ArrayList<Integer>();\n\t\t/* Stores only the intersection 'values' of title keywords */\n\t\tCollection<Integer> intersection = new ArrayList<Integer>();\n\t\t/* Counts number of keywords found */\n\t\tint foundKeys = 0;\n\n\t\t/* Loop to iterate through title keywords and get key-value pair intersection */\n\t\tfor (String key : searchKey) {\n\t\t\tif (titleHashMap.containsKey(key)) {\n\t\t\t\tfoundKeys = foundKeys + 1;\n\t\t\t\ttempStore.addAll((titleHashMap.get(key))); /* Stores all found values */\n\t\t\t\tif (intersection.size() == 0) {\n\t\t\t\t\tintersection.addAll(titleHashMap.get(key));\n\t\t\t\t}\n\t\t\t\tintersection.retainAll(tempStore); /* Stores only common 'values' */\n\t\t\t\ttempStore.clear(); /* Clears temporary array*/\n\t\t\t}\n\t\t}\n\n\t\t/* Checks if all keywords were found */\n\t\tif(searchKey.length == foundKeys){\n\t\t/* Performs search of other fields via the reduced list of 'values' for matched record */\n\t\tfor (Integer i : intersection) {\n\t\t\tif ((callNumber.equals(\"\") || items.get(i.intValue()).getCallNumber().equalsIgnoreCase(callNumber))\n\t\t\t\t\t&& (items.get(i.intValue()).getYear() >= startYear && items.get(i.intValue()).getYear() <= endYear)) {\n\t\t\t\tSystem.out.println(\"--------------------------------------------\");\n\t\t\t\tSystem.out.println(items.get(i.intValue())); /* Prints found records from master list 'Reference' */\n\t\t\t\tSystem.out.println(\"--------------------------------------------\");\n\t\t\t}\n\t\t}\n\t\t}\n\t}", "public void queryTaskUnionSet1() {\r\n\t\t// task 1\r\n\t\tTask task1 = new Task();\r\n\t\ttask1.setName(\"DEFECTS\");\r\n\t\ttask1.setDisplayName(\"Defects\");\r\n\t\ttask1.setDescription(\"User story to address product defects\");\r\n\t\ttask1 = (Task) aggregateService.create(task1, new Settings());\t\r\n\r\n\t\t// task 2\r\n\t\tTask task2 = new Task();\r\n\t\ttask2.setName(\"FIX_DEFECTS\");\r\n\t\ttask2.setDisplayName(\"Fix defects\");\r\n\t\ttask2.setDescription(\"Task to track the defect fixing effort\");\r\n\t\ttask2 = (Task) aggregateService.create(task2, new Settings());\r\n\r\n\t\t// task 3\r\n\t\tTask task3 = new Task();\r\n\t\ttask3.setName(\"PRIORITIZE_DEFECTS\");\r\n\t\ttask3.setDisplayName(\"Prioritize defects\");\r\n\t\ttask3.setDescription(\"Based upon the effort required for the defects prioritize them\");\r\n\t\ttask3 = (Task) aggregateService.create(task3, new Settings());\r\n\r\n\t\ttask1 = (Task) aggregateService.read(task1, getSettings());\t\t\r\n\r\n\t\t// query the task object\r\n\t\tSettings settings = new Settings();\r\n\t\tsettings.setParam(\"name1\", \"FIX_DEFECTS\");\r\n\t\tsettings.setParam(\"name2\", \"PRIORITIZE_DEFECTS\");\r\n\t\tsettings.setView(aggregateService.getView(\"TASKUNIONSET\"));\t\t\r\n\t\tList<?> toList = aggregateService.query(new Task(), settings);\r\n\r\n\t\tassert(toList.size() == 2);\r\n\r\n\t\tObject obj1 = toList.get(0);\r\n\t\tObject obj2 = toList.get(1);\r\n\r\n\t\tassert(Task.class.isAssignableFrom(obj1.getClass()));\r\n\t\tassert(Task.class.isAssignableFrom(obj2.getClass()));\r\n\t\t\r\n\t\tTask t1 = (Task) obj1;\r\n\t\tTask t2 = (Task) obj2;\t\t\r\n\t\t\r\n\t\tassert( (t1.getName().equals(\"FIX_DEFECTS\") && t2.getName().equals(\"PRIORITIZE_DEFECTS\")) ||\r\n\t\t\t\t(t2.getName().equals(\"FIX_DEFECTS\") && t1.getName().equals(\"PRIORITIZE_DEFECTS\")) );\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 void queryTaskUnionSet2() {\r\n\t\t// task 1\r\n\t\tTask task1 = new Task();\r\n\t\ttask1.setName(\"DEFECTS\");\r\n\t\ttask1.setDisplayName(\"Defects\");\r\n\t\ttask1.setDescription(\"User story to address product defects\");\r\n\t\t\r\n\t\tTask d1 = new Task();\r\n\t\td1.setName(\"DEFECT 1\");\r\n\t\td1.setDisplayName(\"Defect 1\");\r\n\t\td1.setDescription(\"First defect\");\r\n\t\tTask d2 = new Task();\r\n\t\td2.setName(\"DEFECT 2\");\r\n\t\td2.setDisplayName(\"Defect 2\");\r\n\t\td2.setDescription(\"Second defect\");\r\n\t\tSet<Task> c = new HashSet<Task>();\r\n\t\tc.add(d1);\r\n\t\tc.add(d2);\r\n\t\ttask1.setTaskChildren(c);\r\n\t\ttask1 = (Task) aggregateService.create(task1, new Settings());\r\n\r\n\t\t\tSystem.out.println(\"Name: \" + task1.getName() + \", Id: \" + task1.getId());\r\n\r\n\t\t// task 2\r\n\t\tTask task2 = new Task();\r\n\t\ttask2.setName(\"FIX_DEFECTS\");\r\n\t\ttask2.setDisplayName(\"Fix defects\");\r\n\t\ttask2.setDescription(\"Task to track the defect fixing effort\");\r\n\t\ttask2 = (Task) aggregateService.create(task2, new Settings());\r\n\r\n\t\t// task 3\r\n\t\tTask task3 = new Task();\r\n\t\ttask3.setName(\"PRIORITIZE_DEFECTS\");\r\n\t\ttask3.setDisplayName(\"Prioritize defects\");\r\n\t\ttask3.setDescription(\"Based upon the effort required for the defects prioritize them\");\r\n\t\ttask3 = (Task) aggregateService.create(task3, new Settings());\r\n\r\n\t\ttask1 = (Task) aggregateService.read(task1, getSettings());\t\t\r\n\r\n\t\t// query the task object\r\n\t\tSettings settings = new Settings();\r\n\t\tsettings.setParam(\"name1\", \"DEFECTS\");\r\n\t\tsettings.setParam(\"name2\", \"PRIORITIZE_DEFECTS\");\r\n\t\tsettings.setParam(\"name3\", \"FIX_DEFECTS\");\r\n\t\tsettings.addFunction(FunctionHandler.NE, \"name\", \"name3\");\r\n\t\tsettings.addFunction(FunctionType.ASC, \"name\");\r\n\t\tsettings.setView(aggregateService.getView(\"TASKUNIONSET\"));\t\t\r\n\t\tList<?> toList = aggregateService.query(new Task(), settings);\r\n\r\n\t\tSystem.out.println(\"SIZE : \" + toList.size());\r\n\t\tfor(Object o: toList) {\r\n\t\t\tTask t = (Task) o;\r\n\t\t\tSystem.out.println(\"Name: \" + t.getName() + \", Id: \" + t.getId());\r\n\t\t}\r\n\t\tassert(toList.size() == 2);\r\n\r\n\t\tObject obj1 = toList.get(0);\r\n\t\tObject obj2 = toList.get(1);\r\n\r\n\t\tassert(Task.class.isAssignableFrom(obj1.getClass()));\r\n\t\tassert(Task.class.isAssignableFrom(obj2.getClass()));\r\n\t\t\r\n\t\tTask t1 = (Task) obj1;\r\n\t\tTask t2 = (Task) obj2;\r\n\r\n\t\tassert ((t1.getName().equals(\"DEFECTS\") && t2.getName().equals(\"PRIORITIZE_DEFECTS\")) ||\r\n\t\t\t(t2.getName().equals(\"DEFECTS\") && t1.getName().equals(\"PRIORITIZE_DEFECTS\")));\r\n\r\n\t\tTask d = t1.getName().equals(\"DEFECTS\") ? t1 : t2;\r\n\t\tassert (d.getTaskChildren() != null && d.getTaskChildren().size() == 2);\r\n\r\n//\t\tSystem.out.println(\"Task 1: \" + t1.getName() + \", Task 2: \" + t2.getName());\r\n//\t\tassert (t1.getName().equals(\"DEFECTS\") && t2.getName().equals(\"DEFECT 1\"));\r\n//\t\tassert(t1.getTaskChildren() != null && t1.getTaskChildren().size() == 2);\r\n\t}", "public void multipleQueriesASync(List<IndexQuery> queries, APIClientListener listener) {\n TaskParams.Client params = new TaskParams.Client(listener, APIMethod.MultipleQueries, queries, \"none\");\n new ASyncClientTask().execute(params);\n }", "public static ArrayList<Integer> getIntersection(int[] array1,int[] array2){\n HashMap<Integer,Boolean> map=new HashMap<>();\n ArrayList<Integer> list=new ArrayList<>();\n for(int i=0;i<array1.length;i++){\n map.put(array1[i],false);\n }\n for(int j=0;j<array2.length;j++){\n if(map.containsKey(array2[j])){\n map.put(array2[j],true); \n }\n }\n Set<Map.Entry<Integer,Boolean>> entries=map.entrySet();\n for(Map.Entry<Integer,Boolean> entry:entries){\n if(entry.getValue()){\n list.add(entry.getKey());\n }\n }\n\n return list;\n }", "private List<Object[]> executeDayQuery(\n List<Object> segments, List<Object> workplaces,\n String Eq1startTime, String Eq1endTime,\n String Eq2startTime, String Eq2endTime,\n String Eq3startTime, String Eq3endTime) {\n try {\n //Clear all tables\n //################# Declared Harness Data #################### \n Helper.startSession();\n\n String query_str_1 = \"(SELECT 'Matin' as shift,'%s' As start_time, '%s' as end_time, \"\n + \"bh.segment AS segment, \"\n + \"bh.workplace AS workplace, \"\n + \"bh.harness_part AS harness_part, \"\n + \"bh.std_time AS std_time, \"\n + \"COUNT(bh.harness_part) AS produced_qty, \"\n + \"SUM(bh.std_time) AS produced_hours \"\n + \"FROM base_harness bh, base_container bc \"\n + \"WHERE bc.id = bh.container_id \"\n + \"AND bh.create_time BETWEEN '%s' AND '%s' \"\n + \"AND bh.segment IN (:segments) \"\n + \"AND bh.workplace IN (:workplaces) \"\n + \"GROUP BY bh.segment, bh.workplace, bh.harness_part, bh.std_time)\";\n\n query_str_1 = String.format(query_str_1, Eq1startTime, Eq1endTime, Eq1startTime, Eq1endTime);\n\n String query_str_2 = \"(SELECT 'Soir' as shift,'%s' As start_time, '%s' as end_time, \"\n + \"bh.segment AS segment, \"\n + \"bh.workplace AS workplace, \"\n + \"bh.harness_part AS harness_part, \"\n + \"bh.std_time AS std_time, \"\n + \"COUNT(bh.harness_part) AS produced_qty, \"\n + \"SUM(bh.std_time) AS produced_hours \"\n + \"FROM base_harness bh, base_container bc \"\n + \"WHERE bc.id = bh.container_id \"\n + \"AND bh.create_time BETWEEN '%s' AND '%s' \"\n + \"AND bh.segment IN (:segments) \"\n + \"AND bh.workplace IN (:workplaces) \"\n + \"GROUP BY bh.segment, bh.workplace, bh.harness_part, bh.std_time)\";\n\n query_str_2 = String.format(query_str_2, Eq2startTime, Eq2endTime, Eq2startTime, Eq2endTime);\n\n String query_str_3 = \"(SELECT 'Nuit' as shift,'%s' As start_time, '%s' as end_time, \"\n + \"bh.segment AS segment, \"\n + \"bh.workplace AS workplace, \"\n + \"bh.harness_part AS harness_part, \"\n + \"bh.std_time AS std_time, \"\n + \"COUNT(bh.harness_part) AS produced_qty, \"\n + \"SUM(bh.std_time) AS produced_hours \"\n + \"FROM base_harness bh, base_container bc \"\n + \"WHERE bc.id = bh.container_id \"\n + \"AND bh.create_time BETWEEN '%s' AND '%s' \"\n + \"AND bh.segment IN (:segments) \"\n + \"AND bh.workplace IN (:workplaces)\"\n + \"GROUP BY bh.segment, bh.workplace, bh.harness_part, bh.std_time) \";\n\n query_str_3 = String.format(query_str_3, Eq3startTime, Eq3endTime, Eq3startTime, Eq3endTime);\n\n String query_str = \"SELECT * FROM (\"\n + query_str_1 + \" UNION \"\n + query_str_2 + \" UNION \"\n + query_str_3\n + \") results ORDER BY start_time ASC, segment ASC, workplace ASC, harness_part ASC\";\n\n SQLQuery query = Helper.sess.createSQLQuery(query_str);\n\n query.addScalar(\"shift\", StandardBasicTypes.STRING)\n .addScalar(\"start_time\", StandardBasicTypes.STRING)\n .addScalar(\"end_time\", StandardBasicTypes.STRING)\n .addScalar(\"segment\", StandardBasicTypes.STRING)\n .addScalar(\"workplace\", StandardBasicTypes.STRING)\n .addScalar(\"harness_part\", StandardBasicTypes.STRING)\n .addScalar(\"std_time\", StandardBasicTypes.DOUBLE)\n .addScalar(\"produced_qty\", StandardBasicTypes.INTEGER)\n .addScalar(\"produced_hours\", StandardBasicTypes.DOUBLE)\n .setParameterList(\"segments\", segments)\n .setParameterList(\"workplaces\", workplaces);\n\n this.dataResultList = query.list();\n\n Helper.sess.getTransaction().commit();\n\n return this.dataResultList;\n\n } catch (HibernateException e) {\n if (Helper.sess.getTransaction() != null) {\n Helper.sess.getTransaction().rollback();\n }\n }\n\n return this.dataResultList;\n }", "public void test_containsII() {\n\tfinal int COUNT = 60000000;\n\t\n\tRectangle r = new Rectangle(1, 2, 3, 4);\n\n\tPerformanceMeter meter = createMeter(\"contains\");\n\tmeter.start();\n\tfor (int i = 0; i < COUNT; i++) {\n\t\tr.contains(2, 3);\t// does contain\n\t}\n\tmeter.stop();\n\t\n\tdisposeMeter(meter);\n\t\n\tmeter = createMeter(\"disjoint\");\n\tmeter.start();\n\tfor (int i = 0; i < COUNT; i++) {\n\t\tr.contains(9, 12);\t// does not contain\n\t}\n\tmeter.stop();\n\t\n\tdisposeMeter(meter);\n}", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "private <T> ArrayList<T> intersection(ArrayList<T> list1, ArrayList<T> list2) {\n ArrayList<T> list = new ArrayList<T>();\n\n for (T t : list1) {\n if (list2.contains(t)) {\n list.add(t);\n }\n }\n\n return list;\n }", "private ExampleSetBuilder performInnerJoin(ExampleSet leftExampleSet, ExampleSet rightExampleSet,\n\t\t\tList<AttributeSource> originalAttributeSources, List<Attribute> unionAttributeList,\n\t\t\tPair<Attribute[], Attribute[]> keyAttributes) throws ProcessStoppedException {\n\t\tExampleSetBuilder builder = ExampleSets.from(unionAttributeList);\n\n\t\tAttribute[] leftKeyAttributes = null;\n\t\tAttribute[] rightKeyAttributes = null;\n\t\tMap<DoubleArrayWrapper, List<Example>> rightKeyMapping = null;\n\t\tboolean useId = getParameterAsBoolean(PARAMETER_USE_ID);\n\n\t\tif (!useId) {\n\t\t\t// create key mapping for right example set\n\t\t\tleftKeyAttributes = keyAttributes.getFirst();\n\t\t\trightKeyAttributes = keyAttributes.getSecond();\n\t\t\trightKeyMapping = createKeyMapping(rightExampleSet, rightKeyAttributes, leftKeyAttributes);\n\t\t}\n\n\t\tint progressCounter = 0;\n\t\t// iterate over all example from left table and search for matching examples in right table:\n\t\tfor (Example leftExample : leftExampleSet) {\n\n\t\t\tList<Example> matchingRightExamples = getMatchingExamples(leftExampleSet, rightExampleSet, leftKeyAttributes,\n\t\t\t\t\trightKeyMapping, useId, leftExample);\n\n\t\t\tif (matchingRightExamples != null) {\n\t\t\t\tfor (Example rightExample : matchingRightExamples) {\n\t\t\t\t\taddCombinedOccurence(originalAttributeSources, unionAttributeList, builder, leftExample, rightExample);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// trigger operator progress every 100 examples\n\t\t\t++progressCounter;\n\t\t\tif (progressCounter % 100 == 0) {\n\t\t\t\tgetProgress().step(100);\n\t\t\t\tprogressCounter = 0;\n\t\t\t}\n\t\t}\n\t\treturn builder;\n\t}", "public static ArrayList<Card> intersection(ArrayList<Meld> melds) {\n\t\tArrayList<Card> intersections = new ArrayList<Card>();\n\n\t\t// check every combination of two melds\n\t\tfor (int i = 0; i < melds.size(); i++) {\n\t\t\tfor (int j = i; j < melds.size(); j++) {\n\t\t\t\tif (i != j) {\n\t\t\t\t\tMeld m1 = melds.get(i);\n\t\t\t\t\tMeld m2 = melds.get(j);\n\t\t\t\t\tfor (int k = 0; k < 3; k++) {\n\t\t\t\t\t\tCard c1 = m1.cards[k];\n\t\t\t\t\t\tfor (int l = 0; l < 3; l++) {\n\t\t\t\t\t\t\tCard c2 = m2.cards[l];\n\n\t\t\t\t\t\t\t// if the card is in both melds, add it to the list\n\t\t\t\t\t\t\tif (c1.equals(c2)) intersections.add(c1);\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 intersections;\n\t}", "private Range<Token> intersect(Range<Token> serverRange, AbstractBounds<Token> requestedRange)\n {\n if (serverRange.contains(requestedRange.left) && serverRange.contains(requestedRange.right)) {\n //case 1: serverRange fully encompasses requestedRange\n return new Range<Token>(requestedRange.left, requestedRange.right, partitioner);\n } else if (requestedRange.contains(serverRange.left) && requestedRange.contains(serverRange.right)) {\n //case 2: serverRange is fully encompasses by requestedRange\n //serverRange is already the intersection\n return new Range<Token>(serverRange.left, serverRange.right);\n } else if (serverRange.contains(requestedRange.left) && requestedRange.contains(serverRange.right)) {\n //case 3: serverRange overlaps on the left: sR.left < rR.left < sR.right < rR.right\n return new Range<Token>(requestedRange.left, serverRange.right, partitioner);\n } else if (requestedRange.contains(serverRange.left) && serverRange.contains(requestedRange.right)) {\n //case 4: serverRange overlaps on the right rR.left < sR.left < rR.right < sR.right\n return new Range<Token>(serverRange.left, requestedRange.right, partitioner);\n } else if (!serverRange.contains(requestedRange.left) && !serverRange.contains(requestedRange.right) &&\n !requestedRange.contains(serverRange.left) && !requestedRange.contains(serverRange.right)) {\n //case 5: totally disjoint\n return null;\n } else {\n assert false : \"Failed intersecting serverRange = (\" + serverRange.left + \", \" + serverRange.right + \") and requestedRange = (\" + requestedRange.left + \", \" + requestedRange.right + \")\";\n return null;\n }\n }", "private static boolean intersect(\n\t\tDateTime start1, DateTime end1,\n\t\tDateTime start2, DateTime end2)\n\t{\n\t\tif (DateTime.op_LessThanOrEqual(end2, start1) || DateTime.op_LessThanOrEqual(end1, start2))\n\t\t\treturn false;\n\n\t\treturn true;\n\t}" ]
[ "0.601857", "0.5893896", "0.575646", "0.56862754", "0.5679482", "0.5663984", "0.56257683", "0.5607326", "0.5603596", "0.5601509", "0.5576574", "0.55470616", "0.55435514", "0.5515671", "0.55070364", "0.5502553", "0.5489338", "0.54770523", "0.5475129", "0.5470427", "0.5450035", "0.54446936", "0.5408048", "0.5401522", "0.5399978", "0.53934526", "0.53848284", "0.5340105", "0.53393424", "0.53084314", "0.5287358", "0.5283747", "0.52581", "0.52568555", "0.52480286", "0.52354676", "0.52164197", "0.5213959", "0.51984346", "0.5192227", "0.5184684", "0.51771957", "0.5159704", "0.5159178", "0.5124164", "0.51218426", "0.51148605", "0.5108193", "0.5091938", "0.5091849", "0.5091172", "0.5084893", "0.5061867", "0.5058592", "0.5044699", "0.5041851", "0.5038374", "0.50355905", "0.5029191", "0.5020648", "0.50171846", "0.5014847", "0.5001266", "0.4996497", "0.4982533", "0.49779436", "0.49557963", "0.49537805", "0.49493805", "0.49421465", "0.49387473", "0.49319023", "0.49272868", "0.49214607", "0.49002063", "0.48971665", "0.48834237", "0.4882071", "0.48811847", "0.48798484", "0.48766506", "0.48754376", "0.4873489", "0.48677903", "0.4864947", "0.48630542", "0.48628417", "0.48627225", "0.48569584", "0.48557517", "0.48503733", "0.484666", "0.48458445", "0.48433658", "0.4834894", "0.48300502", "0.48300096", "0.48201352", "0.48197442", "0.48181358" ]
0.6197183
0
[NEW] Intersects two queries (represented by the postingslist)
public PostingsList intersect(PostingsList l1, PostingsList l2){ PostingsList intersection = new PostingsList(); // Counters to iterate docIDs int count1 = 0; int count2 = 0; // First posting PostingsEntry p1 = l1.get(0); PostingsEntry p2 = l2.get(0); while(true){ // Match - EUREKA! // if (p1.docID == p2.docID){ // Add match intersection.insert(p1.docID); // Increase counters count1++; count2++; // Go to next postings (check for nullpointer) if (count1<l1.size() && count2<l2.size()){ p1 = l1.get(count1); p2 = l2.get(count2); } else break; } // No match else if (p1.docID < p2.docID){ count1++; if (count1<l1.size()) p1 = l1.get(count1); else break; } // No match else{ count2++; if (count2<l2.size()) p2 = l2.get(count2); else break; } } return intersection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public PostingsList intersect(Query query){\n\n LinkedList<PostingsList> listQueriedPostings = new LinkedList<PostingsList>();\n // List with postings corresponding to the queries\n for (int i = 0; i<query.size(); i++){\n // If any query has zero matches, return 0 results\n //if(!(new File(\"postings/t\"+hash(query.terms.get(i))+\".json\")).exists()){\n if (!this.index.containsKey(query.terms.get(i))){\n return null;\n }\n // Otherwise store postings in the list\n listQueriedPostings.add(this.getPostings(query.terms.get(i)));\n }\n\n // Order the posting list by increasing document frequency\n listQueriedPostings = sortByIncreasingFrequency(listQueriedPostings);\n\n PostingsList result = (PostingsList)listQueriedPostings.get(0);\n\n // In case only one word is queried\n if (listQueriedPostings.size() == 1){\n return result;\n }\n\n // Apply algorithm as many times as words in the query\n for(int i = 1; i < listQueriedPostings.size(); i++){\n result = intersect(result, listQueriedPostings.get(i));\n if (result.isEmpty()){\n return null;\n }\n }\n return result;\n }", "public PostingsList phrase_query(PostingsList l1, PostingsList l2){\n\n PostingsList phrase = new PostingsList();\n\n // Counters to iterate docIDs\n int count1 = 0;\n int count2 = 0;\n // Counters to iterate positional indices\n int subcount1 = 0;\n int subcount2 = 0;\n\n // First posting\n PostingsEntry p1 = l1.get(0);\n PostingsEntry p2 = l2.get(0);\n\n // List of positional indices (changes at each iteration)\n LinkedList<Integer> ll1;\n LinkedList<Integer> ll2;\n\n // Used to store positional index\n int pp1;\n int pp2;\n\n while(true){\n // docID match (1/2) //\n if (p1.docID == p2.docID){\n // Obtain list of positional indices\n ll1 = p1.positions;\n ll2 = p2.positions;\n // First positional indices\n pp1 = ll1.get(0);\n pp2 = ll2.get(0);\n // Initialize counter\n subcount1 = 0;\n subcount2 = 0;\n\n // Search if the phrase exists\n while(true){\n // Match, consecutive words (2/2) - EUREKA! //\n if (pp1+1 == pp2){\n // Save found match (docID and positional index of last\n // word)\n phrase.insert(p1.docID, pp2);\n // Increase counters and pos indices if list is not finished\n subcount1++;\n subcount2++;\n if (subcount1<ll1.size() && subcount2<ll2.size()){\n pp1 = ll1.get(subcount1);\n pp2 = ll2.get(subcount2);\n }\n // If list finished, break\n else\n break;\n }\n // Not match\n else if (pp1+1 < pp2){\n subcount1++;\n if (subcount1<ll1.size())\n pp1 = ll1.get(subcount1);\n // If list finished, break\n else\n break;\n }\n // Not match\n else{\n subcount2++;\n if (subcount2<ll2.size())\n pp2 = ll2.get(subcount2);\n else\n break;\n }\n }\n\n // Once we finished looking at the list of positional indices of one\n // posting, increase counters and go to next postings (if there are)\n count1++;\n count2++;\n if (count1<l1.size() && count2<l2.size()){\n p1 = l1.get(count1);\n p2 = l2.get(count2);\n }\n else{\n break;\n }\n }\n // docID not match, increase lowest counter\n else if (p1.docID < p2.docID){\n count1++;\n if (count1<l1.size()){\n p1 = l1.get(count1);\n }\n else{\n break;\n }\n }\n // docID not match, increase lowest counter\n else{\n count2++;\n if (count2<l2.size()){\n p2 = l2.get(count2);\n }\n else{\n break;\n }\n }\n }\n\n return phrase;\n }", "@Override\n public boolean equals(Object o) {\n if(o == null){\n return false;\n }\n\n if (this == o) { return true; }\n if (getClass() != o.getClass()) { return false; }\n Query a_new = (Query) o;\n return this.requestedPosts== (a_new.getRequestedPosts()) && this.getQueryID() == a_new.getQueryID();\n }", "private void queryListings(double left, double right, double top, double bottom) {\n ParseQuery<Listing> query = ParseQuery.getQuery(Listing.class);\n query.include(Listing.KEY_AUTHOR);\n query.whereGreaterThanOrEqualTo(Listing.KEY_LONGITUDE, left);\n query.whereLessThanOrEqualTo(Listing.KEY_LONGITUDE, right);\n query.whereGreaterThanOrEqualTo(Listing.KEY_LATITUDE, bottom);\n query.whereLessThanOrEqualTo(Listing.KEY_LATITUDE, top);\n query.findInBackground(new FindCallback<Listing>() {\n @Override\n public void done(List<Listing> listings, ParseException e) {\n // Check for errors\n if (e != null) {\n Log.e(TAG, \"Issue with getting listings\", e);\n return;\n }\n // Add a marker for each listing on screen\n for (Listing listing : listings) {\n LatLng coordinates = new LatLng(listing.getLatitude(), listing.getLongitude());\n Marker marker = thisMap.addMarker(new MarkerOptions().position(coordinates).title(listing.getCategory()));\n marker.setTag(listing);\n }\n }\n });\n }", "public ArrayList<ArrayList> intersection (ArrayList<ArrayList> data, ArrayList<ArrayList> data2)\n {\n ArrayList<Document> docs = data.get(0);\n ArrayList<Double> relevance = data.get(1);\n ArrayList<Integer> occurrence = data.get(2);\n ArrayList<Integer> popularity = data.get(3);\n \n ArrayList<Document> docs2 = data2.get(0);\n ArrayList<Double> relevance2 = data2.get(1);\n ArrayList<Integer> occurrence2 = data2.get(2);\n ArrayList<Integer> popularity2 = data2.get(3);\n \n ArrayList<Document> docs3 = new ArrayList<>();\n ArrayList<Double> relevance3 = new ArrayList<>();\n ArrayList<Integer> occurrence3 = new ArrayList<>();\n ArrayList<Integer> popularity3 = new ArrayList<>();\n \n for(Document d: docs)\n {\n if(docs2.contains(d))\n {\n docs3.add(d);\n int docIndex = docs.indexOf(d);\n int docIndex2 = docs2.indexOf(d);\n double oldRel = (double) relevance.get(docIndex);\n int oldOcc = (int) occurrence.get(docIndex);\n relevance3.add(oldRel+relevance2.get(docIndex2));\n if(oldOcc > occurrence2.get(docIndex2))\n {\n occurrence3.add(occurrence2.get(docIndex2));\n }\n else\n {\n occurrence3.add(oldOcc);\n }\n popularity3.add(d.popularity);\n }\n \n }\n data = new ArrayList<ArrayList> ();\n data.add(docs3);\n data.add(relevance3);\n data.add(occurrence3);\n data.add(popularity3);\n \n return data;\n }", "public void testQuery() throws Exception {\n DummyApprovalRequest req1 = new DummyApprovalRequest(reqadmin, null, caid, SecConst.EMPTY_ENDENTITYPROFILE, false);\n DummyApprovalRequest req2 = new DummyApprovalRequest(admin1, null, caid, SecConst.EMPTY_ENDENTITYPROFILE, false);\n DummyApprovalRequest req3 = new DummyApprovalRequest(admin2, null, 3, 2, false);\n\n approvalSessionRemote.addApprovalRequest(admin1, req1, gc);\n approvalSessionRemote.addApprovalRequest(admin1, req2, gc);\n approvalSessionRemote.addApprovalRequest(admin1, req3, gc);\n\n // Make som queries\n Query q1 = new Query(Query.TYPE_APPROVALQUERY);\n q1.add(ApprovalMatch.MATCH_WITH_APPROVALTYPE, BasicMatch.MATCH_TYPE_EQUALS, \"\" + req1.getApprovalType());\n\n List result = approvalSessionRemote.query(admin1, q1, 0, 3, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() >= 2 && result.size() <= 3);\n\n result = approvalSessionRemote.query(admin1, q1, 1, 3, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() >= 1 && result.size() <= 3);\n\n result = approvalSessionRemote.query(admin1, q1, 0, 1, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() == 1);\n\n Query q2 = new Query(Query.TYPE_APPROVALQUERY);\n q2.add(ApprovalMatch.MATCH_WITH_STATUS, BasicMatch.MATCH_TYPE_EQUALS, \"\" + ApprovalDataVO.STATUS_WAITINGFORAPPROVAL, Query.CONNECTOR_AND);\n q2.add(ApprovalMatch.MATCH_WITH_REQUESTADMINCERTSERIALNUMBER, BasicMatch.MATCH_TYPE_EQUALS, reqadmincert.getSerialNumber().toString(16));\n\n result = approvalSessionRemote.query(admin1, q1, 1, 3, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() >= 1 && result.size() <= 3);\n\n // Remove the requests\n int id1 = ((ApprovalDataVO) approvalSessionRemote.findApprovalDataVO(admin1, req1.generateApprovalId()).iterator().next()).getId();\n int id2 = ((ApprovalDataVO) approvalSessionRemote.findApprovalDataVO(admin1, req2.generateApprovalId()).iterator().next()).getId();\n int id3 = ((ApprovalDataVO) approvalSessionRemote.findApprovalDataVO(admin1, req3.generateApprovalId()).iterator().next()).getId();\n approvalSessionRemote.removeApprovalRequest(admin1, id1);\n approvalSessionRemote.removeApprovalRequest(admin1, id2);\n approvalSessionRemote.removeApprovalRequest(admin1, id3);\n }", "public static List<String> query_intersect(List<String> queryWords) throws IOException {\n\t\tif (!initialized) initialize();\n\t\tList<PostingList> pls = new ArrayList<PostingList> ();\n\t\tfor (String queryWord : queryWords) {\n\t\t\tqueryWord = queryWord.toLowerCase();\n\t\t\tif (!termDict.containsKey(queryWord)) {\n\t\t\t\tpls.clear();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tPostingList pl = readPosting(fc, termDict.get(queryWord));\n\t\t\tif (pl == null) {\n\t\t\t\tpls.clear();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpls.add(readPosting(fc, termDict.get(queryWord)));\n\t\t}\n\t\tCollections.sort(pls, new Comparator<PostingList>(){\n\t\t public int compare(PostingList p1, PostingList p2) {\n\t\t return p1.size() - p2.size(); // assumes you want biggest to smallest\n\t\t }\n\t\t});\n\t\tif (pls.size() == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tList<Integer> current = pls.get(0).getList();\n\t\t\tfor (int i = 1; i < pls.size(); i++) {\n\t\t\t\tList<Integer> toBeAdd = pls.get(i).getList();\n\t\t\t\tcurrent = intersect(current, toBeAdd);\n\t\t\t}\n\t\t\tif (current.size() == 0) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\tList<String> result = new ArrayList<String>();\n\t\t\t\tfor (int docId : current) {\n\t\t\t\t\tresult.add(docDict.get(docId));\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}", "private void positionIntersects(LinkedList<TermPositions> p1, LinkedList<TermPositions> p2, int k) {\n if (p1 != null && p2 != null) {\n int df1 = p1.size();\n int df2 = p2.size();\n while (!p1.isEmpty() && !p2.isEmpty()) {\n int tf1 = p1.peek().getPositionList().size();\n int tf2 = p1.peek().getPositionList().size();\n if (p1.peek().getDocId() == p2.peek().getDocId()) {\n LinkedList<Integer> pp1 = p1.peek().getPositionList();\n while (!pp1.isEmpty()) {\n for (Integer integer : p2.peek().getPositionList()) {\n if ((pp1.peek() - integer) < 0 && Math.abs(pp1.peek() - integer) <= (k + 1)) {\n double score = (1 + Math.log(tf1) * Math.log(N / df1)) + (1 + Math.log(tf2) * Math.log(N / df2));\n resultsCollector.add(new DocCollector(p1.peek().getDocId(), score));\n break;\n }\n }\n pp1.pop();\n }\n } else if (p1.peek().getDocId() < p2.peek().getDocId())\n p1.pop();\n else\n p2.pop();\n\n p1.pop();\n p2.pop();\n\n }\n\n }\n\n\n }", "@Test\r\n\t\tpublic void testIntersection() {\n\t\t\ttestingSet = new IntegerSet(list1);\r\n\t\t\ttestingSet2= new IntegerSet(list2);\r\n\t\t\t// create 3rdset = to the intersection list \r\n\t\t\ttestingSet3= new IntegerSet(intersection);\r\n\t\t\t// create 4th set =to the intersection of set1 and set2\r\n\t\t\ttestingSet4= testingSet.intersection(testingSet, testingSet2);\r\n\t\t\t// sets 3 and set 4 should be equal \r\n\t\t\t// assertEquals for these parameters is a deprecated method \r\n\t\t\tassertArrayEquals(testingSet3.toArray(),testingSet4.toArray());\t \r\n\t\t}", "public void queryTaskUnionSet2() {\r\n\t\t// task 1\r\n\t\tTask task1 = new Task();\r\n\t\ttask1.setName(\"DEFECTS\");\r\n\t\ttask1.setDisplayName(\"Defects\");\r\n\t\ttask1.setDescription(\"User story to address product defects\");\r\n\t\t\r\n\t\tTask d1 = new Task();\r\n\t\td1.setName(\"DEFECT 1\");\r\n\t\td1.setDisplayName(\"Defect 1\");\r\n\t\td1.setDescription(\"First defect\");\r\n\t\tTask d2 = new Task();\r\n\t\td2.setName(\"DEFECT 2\");\r\n\t\td2.setDisplayName(\"Defect 2\");\r\n\t\td2.setDescription(\"Second defect\");\r\n\t\tSet<Task> c = new HashSet<Task>();\r\n\t\tc.add(d1);\r\n\t\tc.add(d2);\r\n\t\ttask1.setTaskChildren(c);\r\n\t\ttask1 = (Task) aggregateService.create(task1, new Settings());\r\n\r\n\t\t\tSystem.out.println(\"Name: \" + task1.getName() + \", Id: \" + task1.getId());\r\n\r\n\t\t// task 2\r\n\t\tTask task2 = new Task();\r\n\t\ttask2.setName(\"FIX_DEFECTS\");\r\n\t\ttask2.setDisplayName(\"Fix defects\");\r\n\t\ttask2.setDescription(\"Task to track the defect fixing effort\");\r\n\t\ttask2 = (Task) aggregateService.create(task2, new Settings());\r\n\r\n\t\t// task 3\r\n\t\tTask task3 = new Task();\r\n\t\ttask3.setName(\"PRIORITIZE_DEFECTS\");\r\n\t\ttask3.setDisplayName(\"Prioritize defects\");\r\n\t\ttask3.setDescription(\"Based upon the effort required for the defects prioritize them\");\r\n\t\ttask3 = (Task) aggregateService.create(task3, new Settings());\r\n\r\n\t\ttask1 = (Task) aggregateService.read(task1, getSettings());\t\t\r\n\r\n\t\t// query the task object\r\n\t\tSettings settings = new Settings();\r\n\t\tsettings.setParam(\"name1\", \"DEFECTS\");\r\n\t\tsettings.setParam(\"name2\", \"PRIORITIZE_DEFECTS\");\r\n\t\tsettings.setParam(\"name3\", \"FIX_DEFECTS\");\r\n\t\tsettings.addFunction(FunctionHandler.NE, \"name\", \"name3\");\r\n\t\tsettings.addFunction(FunctionType.ASC, \"name\");\r\n\t\tsettings.setView(aggregateService.getView(\"TASKUNIONSET\"));\t\t\r\n\t\tList<?> toList = aggregateService.query(new Task(), settings);\r\n\r\n\t\tSystem.out.println(\"SIZE : \" + toList.size());\r\n\t\tfor(Object o: toList) {\r\n\t\t\tTask t = (Task) o;\r\n\t\t\tSystem.out.println(\"Name: \" + t.getName() + \", Id: \" + t.getId());\r\n\t\t}\r\n\t\tassert(toList.size() == 2);\r\n\r\n\t\tObject obj1 = toList.get(0);\r\n\t\tObject obj2 = toList.get(1);\r\n\r\n\t\tassert(Task.class.isAssignableFrom(obj1.getClass()));\r\n\t\tassert(Task.class.isAssignableFrom(obj2.getClass()));\r\n\t\t\r\n\t\tTask t1 = (Task) obj1;\r\n\t\tTask t2 = (Task) obj2;\r\n\r\n\t\tassert ((t1.getName().equals(\"DEFECTS\") && t2.getName().equals(\"PRIORITIZE_DEFECTS\")) ||\r\n\t\t\t(t2.getName().equals(\"DEFECTS\") && t1.getName().equals(\"PRIORITIZE_DEFECTS\")));\r\n\r\n\t\tTask d = t1.getName().equals(\"DEFECTS\") ? t1 : t2;\r\n\t\tassert (d.getTaskChildren() != null && d.getTaskChildren().size() == 2);\r\n\r\n//\t\tSystem.out.println(\"Task 1: \" + t1.getName() + \", Task 2: \" + t2.getName());\r\n//\t\tassert (t1.getName().equals(\"DEFECTS\") && t2.getName().equals(\"DEFECT 1\"));\r\n//\t\tassert(t1.getTaskChildren() != null && t1.getTaskChildren().size() == 2);\r\n\t}", "protected void merge(Object in1, Object in2, Object out) {\n\t\tFlowSet inSet1 = (FlowSet) in1, inSet2 = (FlowSet) in2, outSet = (FlowSet) out;\n\n\t\tinSet1.intersection(inSet2, outSet);\n\t}", "public void queryTaskUnionSet1() {\r\n\t\t// task 1\r\n\t\tTask task1 = new Task();\r\n\t\ttask1.setName(\"DEFECTS\");\r\n\t\ttask1.setDisplayName(\"Defects\");\r\n\t\ttask1.setDescription(\"User story to address product defects\");\r\n\t\ttask1 = (Task) aggregateService.create(task1, new Settings());\t\r\n\r\n\t\t// task 2\r\n\t\tTask task2 = new Task();\r\n\t\ttask2.setName(\"FIX_DEFECTS\");\r\n\t\ttask2.setDisplayName(\"Fix defects\");\r\n\t\ttask2.setDescription(\"Task to track the defect fixing effort\");\r\n\t\ttask2 = (Task) aggregateService.create(task2, new Settings());\r\n\r\n\t\t// task 3\r\n\t\tTask task3 = new Task();\r\n\t\ttask3.setName(\"PRIORITIZE_DEFECTS\");\r\n\t\ttask3.setDisplayName(\"Prioritize defects\");\r\n\t\ttask3.setDescription(\"Based upon the effort required for the defects prioritize them\");\r\n\t\ttask3 = (Task) aggregateService.create(task3, new Settings());\r\n\r\n\t\ttask1 = (Task) aggregateService.read(task1, getSettings());\t\t\r\n\r\n\t\t// query the task object\r\n\t\tSettings settings = new Settings();\r\n\t\tsettings.setParam(\"name1\", \"FIX_DEFECTS\");\r\n\t\tsettings.setParam(\"name2\", \"PRIORITIZE_DEFECTS\");\r\n\t\tsettings.setView(aggregateService.getView(\"TASKUNIONSET\"));\t\t\r\n\t\tList<?> toList = aggregateService.query(new Task(), settings);\r\n\r\n\t\tassert(toList.size() == 2);\r\n\r\n\t\tObject obj1 = toList.get(0);\r\n\t\tObject obj2 = toList.get(1);\r\n\r\n\t\tassert(Task.class.isAssignableFrom(obj1.getClass()));\r\n\t\tassert(Task.class.isAssignableFrom(obj2.getClass()));\r\n\t\t\r\n\t\tTask t1 = (Task) obj1;\r\n\t\tTask t2 = (Task) obj2;\t\t\r\n\t\t\r\n\t\tassert( (t1.getName().equals(\"FIX_DEFECTS\") && t2.getName().equals(\"PRIORITIZE_DEFECTS\")) ||\r\n\t\t\t\t(t2.getName().equals(\"FIX_DEFECTS\") && t1.getName().equals(\"PRIORITIZE_DEFECTS\")) );\r\n\t}", "public PostingsList ranked_query(Query query, double w, double idf_threshold){\n long startTime = System.nanoTime();\n PostingsList result = new PostingsList();\n\n // Obtain union of terms above idf threshold if indexElimination is true\n // (Set idf_threshold to zero to disable this feature)\n Set<String> termsToConsider = this.queryTermsConsidered(query, idf_threshold);\n result = this.union_query(query, termsToConsider);\n //System.err.println(\"Size of result is \" + result.size());\n\n long estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Union took: \" + estimatedTime);\n\n\n /*\n * 2) Iterate over PostingsEntries and build the solution\n */\n startTime = System.nanoTime();\n // Required when iterating over a PostingsList\n PostingsEntry postEnt = new PostingsEntry();\n // Number of documents in the collection\n double nDocs = this.docIDs.size();\n // Weight of a query vector coefficient\n double w_query_term;\n // Document tf-idf variables\n double termFrequency_doc, documentFrequency_doc, w_doc_term;\n\n for(String term : termsToConsider){\n // Obtain idf of the term\n documentFrequency_doc = Math.log(nDocs/new Double(this.idfMap.get(term)));\n\n // Obtain weight of the term\n w_query_term = query.weights.get(term);\n // Iterate over all documents containing the term and update the score(q,d)\n Iterator<PostingsEntry> it_d = result.iterator();\n while(it_d.hasNext()){\n postEnt = it_d.next();\n if (this.tfMap.get(postEnt.docID).containsKey(term)){\n termFrequency_doc = this.tfMap.get(postEnt.docID).get(term);\n w_doc_term = documentFrequency_doc*termFrequency_doc;\n postEnt.score += w_query_term*w_doc_term;\n }\n }\n }\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Building solution took: \" + estimatedTime);\n\n /*\n * 3) Normalize the scores\n */\n startTime = System.nanoTime();\n Iterator<PostingsEntry> it = result.iterator();\n while(it.hasNext()){\n postEnt = it.next();\n postEnt.score /= (new Double(this.docLengths.get(\"\"+postEnt.docID)));//(Math.sqrt(postEnt.norm2));\n postEnt.score = w * postEnt.score + (1-w) * quality(postEnt.docID);\n }\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Normalizing took: \" + estimatedTime);\n\n /*\n * 4) Sort the resulting solution\n */\n startTime = System.nanoTime();\n result.sort();\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Sorting took: \" + estimatedTime);\n\n return result;\n }", "private boolean isIntersectWithSource(List<Pair<Tuple,String>> list1, List<Pair<Tuple,String>> list2) {\n\t\tboolean intersect = false;\n\t\t\n\t\tfor (Pair<Tuple,String> tuple : list1) {\n\t\t\tif (list2.contains(tuple)) {\n\t\t\t\tintersect = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn intersect;\n\t}", "public void mergeIn(QueryMetadata otherInstance) {\n for(QueryMetadataItem otherItem : otherInstance.items) {\n boolean alreadyExists = false;\n for(QueryMetadataItem item : items) {\n if(item.name.equals(otherItem.name)) {\n alreadyExists = true;\n }\n }\n if(!alreadyExists) {\n addItem(otherItem.name, otherItem.value);\n }\n }\n }", "private Map mergeResults(Map first, Map second) {\n/* 216 */ Iterator verb_enum = second.keySet().iterator();\n/* 217 */ Map clonedHash = new HashMap(first);\n/* */ \n/* */ \n/* 220 */ while (verb_enum.hasNext()) {\n/* 221 */ String verb = verb_enum.next();\n/* 222 */ List cmdVector = (List)clonedHash.get(verb);\n/* 223 */ if (cmdVector == null) {\n/* 224 */ clonedHash.put(verb, second.get(verb));\n/* */ continue;\n/* */ } \n/* 227 */ List oldV = (List)second.get(verb);\n/* 228 */ cmdVector = new ArrayList(cmdVector);\n/* 229 */ cmdVector.addAll(oldV);\n/* 230 */ clonedHash.put(verb, cmdVector);\n/* */ } \n/* */ \n/* 233 */ return clonedHash;\n/* */ }", "private void addQueries(String query){\n ArrayList <String> idsFullSet = new ArrayList <String>(searchIDs);\n while(idsFullSet.size() > 0){\n ArrayList <String> idsSmallSet = new ArrayList <String>(); \n if(debugMode) {\n System.out.println(\"\\t Pmids not used in query available : \" + idsFullSet.size());\n }\n idsSmallSet.addAll(idsFullSet.subList(0,Math.min(getSearchIdsLimit(), idsFullSet.size())));\n idsFullSet.removeAll(idsSmallSet);\n String idsConstrain =\"\";\n idsConstrain = idsConstrain(idsSmallSet);\n addQuery(query,idsConstrain);\n }\n }", "@Test\n public void sharedFilterEnsuresUniqueResults() {\n Filter filter = new Filter(\"test-filter\");\n final Dataset dataset1 = new Dataset(\"TEST1\", \"sql\", filter);\n final Dataset dataset2 = new Dataset(\"TEST2\", \"sql2\", filter); // shared same filter\n\n List<String> entry1 = new ArrayList<>();\n entry1.add(\"001\");\n entry1.add(\"aaa\");\n\n List<String> entry2 = new ArrayList<>();\n entry2.add(\"002\");\n entry2.add(\"bbb\");\n\n List<String> entry3 = new ArrayList<>();\n entry3.add(\"003\");\n entry3.add(\"ccc\");\n\n List<String> entry4 = new ArrayList<>();\n entry4.add(\"004\");\n entry4.add(\"ddd\");\n\n List<List<String>> queryResults1 = new ArrayList<>();\n queryResults1.add(entry1);\n queryResults1.add(entry2);\n queryResults1.add(entry3);\n queryResults1.add(entry4);\n\n List<String> entry5 = new ArrayList<>();\n entry5.add(\"005\"); // different\n entry5.add(\"eee\");\n\n List<String> entry6 = new ArrayList<>();\n entry6.add(\"002\"); // same\n entry6.add(\"bbb\");\n\n List<String> entry7 = new ArrayList<>();\n entry7.add(\"007\"); // different\n entry7.add(\"fff\");\n\n List<String> entry8 = new ArrayList<>();\n entry8.add(\"004\"); // same\n entry8.add(\"ddd\");\n\n List<List<String>> queryResults2 = new ArrayList<>();\n queryResults2.add(entry5);\n queryResults2.add(entry6);\n queryResults2.add(entry7);\n queryResults2.add(entry8);\n\n // given\n dataset1.populateCache(queryResults1, 200L);\n dataset2.populateCache(queryResults2, 300L);\n\n // when\n final List<String> result1 = dataset1.getCachedResult();\n final List<String> result2 = dataset1.getCachedResult();\n final List<String> result3 = dataset1.getCachedResult();\n final List<String> result4 = dataset1.getCachedResult();\n final List<String> result5 = dataset2.getCachedResult();\n final List<String> result6 = dataset2.getCachedResult();\n\n // then\n assertEquals(\"Wrong result 1\", entry1, result1); // first datset is as-is\n assertEquals(\"Wrong result 2\", entry2, result2); // first datset is as-is\n assertEquals(\"Wrong result 3\", entry3, result3); // first datset is as-is\n assertEquals(\"Wrong result 4\", entry4, result4); // first datset is as-is\n assertEquals(\"Wrong result 3\", entry5, result5); // second datset, not filtered out\n assertEquals(\"Wrong result 3\", entry7, result6); // second dataset, entry6 is filtered out\n\n // and\n try {\n dataset1.getCachedResult();\n fail(\"Expected to run out of data\");\n\n } catch (IllegalStateException ex) {\n assertEquals(\"Wrong error\", \"No more data available for dataset: TEST1\", ex.getMessage());\n }\n\n try {\n // entry7 should be filtered out, resulting in no more data\n dataset2.getCachedResult();\n fail(\"Expected to run out of data\");\n\n } catch (IllegalStateException ex) {\n assertEquals(\"Wrong error\", \"No more data available for dataset: TEST2\", ex.getMessage());\n }\n\n // and\n assertEquals(\"Wrong cache size\", Optional.of(4), dataset1.getMetrics().getCacheSize());\n assertEquals(\"Wrong timing\", Optional.of(200L), dataset1.getMetrics().getTimingMilliseconds());\n assertEquals(\"Wrong cache requested\", Optional.of(5), dataset1.getMetrics().getCacheRequested());\n assertEquals(\"Wrong filtered out\", Optional.empty(), dataset1.getMetrics().getFilteredOut());\n\n // and\n assertEquals(\"Wrong cache size\", Optional.of(4), dataset2.getMetrics().getCacheSize());\n assertEquals(\"Wrong timing\", Optional.of(300L), dataset2.getMetrics().getTimingMilliseconds());\n assertEquals(\"Wrong cache requested\", Optional.of(3), dataset2.getMetrics().getCacheRequested());\n assertEquals(\"Wrong filtered out\", Optional.of(2), dataset2.getMetrics().getFilteredOut());\n }", "public ArrayList<Posting> mergeTwoPostingList(ArrayList<Posting> a, ArrayList<Posting> b) { \r\n\t\tfor (Posting postingA : a) {\r\n\t\t\tint indexInB = b.indexOf(postingA);\r\n\t\t\tif (indexInB == -1)\r\n\t\t\t\tb.add(postingA);\r\n\t\t\telse\r\n\t\t\t\tb.get(indexInB).increaseTermFrequecyBy(postingA.getTermFrequency());\r\n\t\t}\r\n\t\treturn b;\r\n\t}", "public void searchArea(Connection connection, String city, String state, int zip) throws SQLException {\n\n ResultSet rs = null;\n PreparedStatement pStmt = null;\n String sql1 = \"SELECT hotel_name, branch_id FROM Hotel_Address WHERE city = ?\";\n String sql2 = \"SELECT hotel_name, branch_id FROM Hotel_Address WHERE state = ?\";\n String sql3 = \"SELECT hotel_name, branch_id FROM Hotel_Address WHERE zip = ?\";\n\n // City and State combination:\n if (city != null && state != null){\n\n pStmt = connection.prepareStatement(sql1 + \" INTERSECT \" + sql2);\n pStmt.clearParameters();\n\n setCity(city);\n pStmt.setString(1, getCity());\n setState(state);\n pStmt.setString(2, getState());\n }\n\n // City and ZIP combination:\n else if (city != null){\n\n pStmt = connection.prepareStatement(sql1 + \" INTERSECT \" + sql3);\n pStmt.clearParameters();\n\n setCity(city);\n pStmt.setString(1, getCity());\n setZip(zip);\n pStmt.setInt(2, getZip());\n }\n\n // State and ZIP combination:\n else {\n\n pStmt = connection.prepareStatement(sql2 + \" INTERSECT \" + sql3);\n pStmt.clearParameters();\n\n setState(state);\n pStmt.setString(1, getState());\n setZip(zip);\n pStmt.setInt(2, getZip());\n }\n\n try {\n\n System.out.println(\" Hotels in area:\");\n System.out.println(\"+------------------------------------------------------------------------------+\");\n\n rs = pStmt.executeQuery();\n String result;\n\n while (rs.next()) {\n\n System.out.println(rs.getString(1) + \" \" + rs.getInt(2));\n }\n }\n catch (SQLException e) { throw e; }\n finally {\n pStmt.close();\n if(rs != null) { rs.close(); }\n }\n }", "public ArrayList<ArrayList> union(ArrayList<ArrayList> data, ArrayList<ArrayList> data2)\n {\n if(data == null || data2 == null)\n {\n return null;\n }\n ArrayList<Document> docs = data.get(0);\n ArrayList<Double> relevance = data.get(1);\n ArrayList<Integer> occurrence = data.get(2);\n ArrayList<Integer> popularity = data.get(3);\n \n ArrayList<Document> docs2 = data2.get(0);\n ArrayList<Double> relevance2 = data2.get(1);\n ArrayList<Integer> occurrence2 = data2.get(2);\n ArrayList<Integer> popularity2 = data2.get(3);\n \n ArrayList<Document> docs3 = new ArrayList<>();\n ArrayList<Double> relevance3 = new ArrayList<>();\n ArrayList<Integer> occurrence3 = new ArrayList<>();\n ArrayList<Integer> popularity3 = new ArrayList<>();\n \n for(int i = 0; i < docs.size(); i++)\n {\n docs3.add(docs.get(i));\n relevance3.add(relevance.get(i));\n occurrence3.add(occurrence.get(i));\n popularity3.add(popularity.get(i));\n }\n \n for(Document d: docs2)\n {\n if(!docs3.contains(d))\n {\n docs3.add(d);\n int docIndex = docs2.indexOf(d);\n relevance3.add(relevance2.get(docIndex));\n occurrence3.add(occurrence2.get(docIndex));\n popularity3.add(d.popularity);\n }\n else\n {\n int docIndex = docs3.indexOf(d);\n int docIndex2 = docs2.indexOf(d);\n double oldRel = (double) relevance3.get(docIndex);\n int oldOcc = (int) occurrence3.get(docIndex);\n relevance3.set(docIndex, oldRel+relevance2.get(docIndex2));\n if(oldOcc > occurrence2.get(docIndex2))\n {\n occurrence3.set(docIndex, occurrence2.get(docIndex2));\n }\n } \n }\n ArrayList<ArrayList> data3 = new ArrayList();\n data3.add(docs3);\n data3.add(relevance3);\n data3.add(occurrence3);\n data3.add(popularity3);\n return data3; \n }", "private Set<String> getIntersection( Set<String> a, Set<String> b ) {\n\t\tSet<String> intersection = new HashSet<String>(a);\n\t\tintersection.retainAll(b);\n\t\treturn intersection;\n\t}", "@Override\n\tpublic IPredicate intersection(final IPredicate state1, final IPredicate state2) {\n\n\t\tfinal Set<HcPredicateSymbol> state1PredSymbols = new HashSet<>();\n\t\tstate1PredSymbols.addAll(((HCPredicate) state1).getHcPredicateSymbols());\n//\t\tassert state1PredSymbols.size() == 1 : \"what does this mean??\";\n\n//\t\tfinal Term conjoinedFormula = mSimplifier.getSimplifiedTerm(\n//\t\t\t\tSmtUtils.and(mBackendSmtSolverScript.getScript(), state1.getFormula(), state2.getFormula()));\n\t\tfinal IPredicate conjoinedPred = mPredicateFactory.and(state1, state2);\n\n\t\tif (mPredicateFactory.isDontCare(conjoinedPred)) {\n\t\t\treturn mPredicateFactory.newPredicate(state1PredSymbols, conjoinedPred.getFormula(),\n\t\t\t\tCollections.emptyList());\n//\t\t\treturn conjoinedPred;\n\t\t}\n\n\t\tfinal Term conjoinedFormula = new CommuhashNormalForm(mServices, mMgdScript.getScript())\n\t\t\t\t.transform(conjoinedPred.getFormula());\n\n//\t\tfinal Set<IPredicate> ps = new HashSet<>();\n//\t\tps.add(state1);\n//\t\tps.add(state2);\n\n\t\treturn mPredicateFactory.newPredicate(state1PredSymbols, conjoinedFormula,\n\t\t\t\tArrays.asList(state1.getFormula().getFreeVars()));\n\t}", "ResponseEntity<Response> placesInCommon(String userId1, String listName1, String userId2, String listName2);", "public static <T extends Comparable<? super T>>\n void intersection(SLL<T> list1, SLL<T> list2, SLL<T> result) {\n\n SLLNode<T> iterlist1 = list1.head;\n SLLNode<T> iterlist2 = list2.head;\n\n T itemlist1=null, itemlist2=null;\n\n // get first item in each list\n if ( iterlist1 != null && iterlist2 != null ) {\n itemlist1 = iterlist1.info;\n itemlist2 = iterlist2.info;\n }\n\n while ( itemlist1 != null && itemlist2 != null ) {\n int compareResult = itemlist1.compareTo(itemlist2);\n \n if ( compareResult == 0 ) {\n result.addToTail(itemlist1); //append to result list\n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n \n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n } \n }\n else if ( compareResult < 0 ) { \n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n }\n else {\n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n }\n }\n }\n }", "private static Set<Item> multiSetIntersection(List<Set<Item>> setList) {\n Set<Item> interQrels = new HashSet<>(setList.get(0));\r\n \r\n for (int i = 1; i< setList.size();i++) {\r\n interQrels.retainAll(setList.get(i)); // intersection with two (and one)\r\n }\r\n\r\n return interQrels;\r\n }", "private <T> ArrayList<T> intersection(ArrayList<T> list1, ArrayList<T> list2) {\n ArrayList<T> list = new ArrayList<T>();\n\n for (T t : list1) {\n if (list2.contains(t)) {\n list.add(t);\n }\n }\n\n return list;\n }", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\tprivate static List<Object> mergeResult(List<Object> list1, List<Object> list2) {\n\t\tList<Object> result = new ArrayList<Object>();\n\t\tfor (int i = 0; i < list1.size(); i++) {\n\t\t\tfor (int j = 0; j < list2.size(); j++) {\n\t\t\t\tif (Integer.parseInt(((Map) list1.get(i)).get(MongoDBConstants.DOCUMENT_ID).toString()) == Integer\n\t\t\t\t\t\t.parseInt(((Map) list2.get(j)).get(MongoDBConstants.DOCUMENT_ID).toString())) {\n\t\t\t\t\tMap data = new HashMap();\n\t\t\t\t\tint hour = (Integer.parseInt(((Map) list1.get(i)).get(MongoDBConstants.DOCUMENT_ID).toString()) + 8) % 24;\n\t\t\t\t\tdata.put(MongoDBConstants.DOCUMENT_ID, hour + \"\");\n\t\t\t\t\tdata.put(\"value\", Integer.parseInt(((Map) list1.get(i)).get(\"value\").toString())\n\t\t\t\t\t\t\t+ Integer.parseInt(((Map) list2.get(j)).get(\"value\").toString()));\n\t\t\t\t\tresult.add(data);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "@Override\n public void processElement(ProcessContext c) {\n List<LdVariant> queryList = null;\n List<LdVariant> targetList = null;\n int inputListCount = 0;\n for (KV<Boolean, List<LdVariant>> vl : c.element().getValue()) {\n if (vl.getKey()) {\n queryList = vl.getValue();\n } else {\n targetList = vl.getValue();\n }\n inputListCount++;\n }\n\n if (inputListCount != 2 || queryList == null || targetList == null) {\n throw new IllegalArgumentException(\"There should be exactly two lists.\");\n }\n\n Iterator<LdVariant> targetIter = targetList.iterator();\n\n // Our working set of variants from the target shard that could be within window of variants\n // read in from the query shard.\n LinkedList<LdVariant> storedTarget = new LinkedList<>();\n\n for (LdVariant queryVar : queryList) {\n // Fill in storedTarget until we are past window from queryVar.\n while (targetIter.hasNext()\n && (storedTarget.isEmpty() || (queryVar.getInfo().getEnd() + window) > storedTarget\n .getLast().getInfo().getStart())) {\n storedTarget.add(targetIter.next());\n }\n\n ListIterator<LdVariant> storedTargetIter = storedTarget.listIterator(0);\n while (storedTargetIter.hasNext()) {\n LdVariant targetVar = storedTargetIter.next();\n\n if (queryVar.getInfo().compareTo(targetVar.getInfo()) != -1) {\n // Only do comparisons where query is before target. If query is past target then\n // we are done with target. Note: targetVar > queryVar implies targetVar start >= queryVar\n // start.\n storedTargetIter.remove();\n } else if (targetVar.getInfo().getStart() >= (queryVar.getInfo().getEnd() + window)) {\n // If the next query starts more than window from when target starts, we are done\n // with the rest of storedTarget for this query.\n break;\n } else {\n // If target starts >= query starts and target starts < window from query end, then they\n // must overlap.\n c.output(KV.of(queryVar, targetVar));\n }\n }\n }\n }", "@Test\n public void testSqlExistsBasedJoin() {\n Query<Car> carsQuery = and(\n in(Car.FEATURES, \"sunroof\", \"convertible\"),\n existsIn(garages,\n Car.NAME,\n Garage.BRANDS_SERVICED,\n equal(Garage.LOCATION, \"Dublin\")\n )\n );\n\n Map<Car, Set<Garage>> results = new LinkedHashMap<Car, Set<Garage>>();\n for (Car car : cars.retrieve(carsQuery)) {\n Query<Garage> garagesWhichServiceThisCarInDublin\n = and(equal(Garage.BRANDS_SERVICED, car.name), equal(Garage.LOCATION, \"Dublin\"));\n for (Garage garage : garages.retrieve(garagesWhichServiceThisCarInDublin)) {\n Set<Garage> garagesWhichCanServiceThisCar = results.get(car);\n if (garagesWhichCanServiceThisCar == null) {\n garagesWhichCanServiceThisCar = new LinkedHashSet<Garage>();\n results.put(car, garagesWhichCanServiceThisCar);\n }\n garagesWhichCanServiceThisCar.add(garage);\n }\n }\n\n assertEquals(\"join results should contain 2 cars\", 2, results.size());\n Assert.assertTrue(\"join results should contain car1\", results.containsKey(car1));\n Assert.assertTrue(\"join results should contain car4\", results.containsKey(car4));\n\n assertEquals(\"join results for car1\", asSet(garage3, garage4), results.get(car1));\n assertEquals(\"join results for car4\", asSet(garage2), results.get(car4));\n }", "public static void main(String[] args) {\n String[] data ={\"cars\",\"clothes\",\"jewelry\",\"women\"};\r\n List<String> list1 = Arrays.asList(data);\r\n \r\n ArrayList<String> list2 = new ArrayList<String>();\r\n list2.add(\"youtube\");\r\n list2.add(\"snapchat\");\r\n list2.add(\"instagram\");\r\n \r\n for(String x : list2)\r\n System.out.printf(\"%s \", x);\r\n \r\n Collections.addAll(list2, data);\r\n \r\n System.out.println();\r\n for(String x : list2)\r\n System.out.printf(\"%s \", x);\r\n System.out.println();\r\n \r\n System.out.println(Collections.frequency(list2, \"cars\"));\r\n \r\n boolean tof = Collections.disjoint(list1, list2);\r\n System.out.println(tof);\r\n \r\n if(tof)\r\n System.out.println(\"these list do not have anything in common\");\r\n else \r\n System.out.println(\"these list do have something in common!\");\r\n \r\n }", "public static void main(String[] args) {\n\t\tint[] nums1 = {4,9,5};\r\n\t\tint[] nums2 = {9,4,9,8,4};\r\n\t\t//System.out.println(intersection(nums1, nums2));\r\n\t\tArrays.sort(nums1);\r\n\t\tArrays.sort(nums2);\r\n\t\tif (nums1.length>nums2.length) {\r\n\t\t\tint[] temp = nums2;\r\n\t\t\tnums2 = nums1;\r\n\t\t\tnums1 = temp;\r\n\t\t}\r\n\t\tHashSet<Integer> mSet1 = new HashSet<Integer>();\r\n\t\tHashSet<Integer> mSet2 = new HashSet<Integer>();\r\n\t\tfor (Integer i : nums2) {\r\n\t\t\tmSet1.add(i);\r\n\t\t}\r\n\t\tfor (Integer x: nums1) {\r\n\t\t\tif (mSet1.contains(x)) {\r\n\t\t\t\tmSet2.add(x);\r\n\t\t\t}\r\n\t\t}\r\n\t\tint[] r = new int[mSet2.size()];\r\n\t\tint index = 0;\r\n\t\tfor (Integer g: mSet2) {\r\n\t\t\tr[index] = g;\r\n\t\t\tindex++;\r\n\t\t}\r\n\t}", "public PostingsList search( Query query, int queryType, int rankingType,\n int structureType ) {\n double idf_threshold = new Double(0);\n double index_elimination = new Double(0.008);\n // System.err.println(pageRank[docNumber.get(\"121\")]);\n\n if (query.size()>0){\n switch (queryType){\n case Index.INTERSECTION_QUERY:\n System.err.println(\"Intersection query\");\n return intersect(query);\n case Index.PHRASE_QUERY:\n System.err.println(\"Phrase query\");\n return phrase_query(query);\n case Index.RANKED_QUERY:\n System.err.println(\"Ranked query\");\n switch(rankingType){\n case Index.TF_IDF: return ranked_query(query, 1, idf_threshold);\n case Index.PAGERANK: return ranked_query(query, 0, idf_threshold);//ranked_query(query, 0, idf_threshold);//ranked_query2(query, 0);\n case Index.COMBINATION: return ranked_query(query, index_elimination, idf_threshold);\n }\n default:\n System.out.println(\"not valid query\");\n return null;\n }\n }\n else\n // Query was empty\n return null;\n }", "public static void main(String[] args) {\n\n\t\tCollection<String> collection1 = new ArrayList<String>();\n\t\tcollection1.add(\"Toronto\");\n\t\tcollection1.add(\"Hamilton\");\n\t\tcollection1.add(\"London\");\n\t\tcollection1.add(\"Ottawa\");\n\t\tcollection1.add(\"Toronto\");\n\t\tSystem.out.println(\"A list of cities in c1 is \" + collection1);\n\t\tSystem.out.println(\" Is hamilton in c1? \" + collection1.contains(\"Hamilton\"));\n\t\tSystem.out.println(\"Size of collection c1 is \" + collection1.size());\n\t\tCollection<String> collection2 = new ArrayList<String>();\n\t\tcollection1.add(\"Vancouver\");\n\t\tcollection1.add(\"Delhi\");\n\t\tcollection1.add(\"chd\");\n\t\tcollection1.add(\"Toronto\");\n\t\tcollection1.addAll(collection2);\n\t\tSystem.out.println(\"combined list is : \" + collection1);\n//\t\tCollection<String> c1 = new ArrayList<String>(collection1);\n//\t\tc1.retainAll(collection2);\n//\t\tSystem.out.println(\"A list of cities in c1 is \" + c1);\n//\t\tc1.removeAll(collection2);\n//\t\tSystem.out.println(\"A list of cities in c1 is \" + c1);\n\t\t\n\t}", "@Override\n public List<Auction> meetCriteria(List<Auction> auctions) \n {\n List<Auction> firstCriteriaItems = criteria1.meetCriteria(auctions);\n List<Auction> otherCriteriaItems = criteria2.meetCriteria(auctions);\n // if an item b is in Collection B but is not in Collection A,\n // add item b to collection A. This yields unique elements b and a\n // in the new collection C.\n for (Auction auction : otherCriteriaItems) \n {\n if(!firstCriteriaItems.contains(auction))\n {\n firstCriteriaItems.add(auction);\n }\n }\t\n return firstCriteriaItems;\n }", "private static boolean intersect(\n\t\tDateTime start1, DateTime end1,\n\t\tDateTime start2, DateTime end2)\n\t{\n\t\tif (DateTime.op_LessThanOrEqual(end2, start1) || DateTime.op_LessThanOrEqual(end1, start2))\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "abstract protected Object joinClause(Object o1, Object o2);", "public static Set<Doc> and(Set<Doc> set1, Set<Doc> set2) {\r\n \t\t\r\n \t\tif((set1 == null) || (set2 == null)) {\r\n\t\t\tSystem.err.println(\"Doc.and() returning null!\");\r\n \t\t\treturn new TreeSet<Doc>();\r\n \t\t}\r\n \t\t//set1.retainAll(set2);\r\n \t\t//return set1;\r\n \t\t\r\n \t\tTreeSet<Doc> result = new TreeSet<Doc>();\r\n \t\tIterator<Doc> op1 = set1.iterator();\r\n \t\tIterator<Doc> op2 = set2.iterator();\r\n \t\t\r\n \t\tDoc current1 = getNext(op1);\r\n \t\tDoc current2 = getNext(op2);\r\n \r\n \t\twhile(current1!=null && current2!=null) {\r\n \t\t\t//If is the same document\r\n \t\t\tif(current1.getID() == current2.getID()) {\r\n \t\t\t\tresult.add(current1);\r\n \t\t\t\tcurrent1 = getNext(op1);\r\n \t\t\t\tcurrent2 = getNext(op2);\r\n \t\t\t}\r\n \t\t\t//If op2 is ahead of op1\r\n \t\t\telse if(current1.getID() < current2.getID()) \r\n \t\t\t\tcurrent1 = getNext(op1);\r\n \t\t\t//If op1 is ahead of op2\r\n \t\t\telse\r\n \t\t\t\tcurrent2 = getNext(op2);\r\n \t\t}\r\n \t\t\r\n \t\treturn result;\r\n \t}", "@Override\n protected DataSet<GraphHead> computeNewGraphHeads() {\n return firstCollection.getGraphHeads()\n .union(secondCollection.getGraphHeads())\n .groupBy(new Id<GraphHead>())\n .reduceGroup(new GroupCountEquals<GraphHead>(2));\n }", "public static void main(String[] args) {\n\t\tIntersection l5=new Intersection(5,null);\n\t\tIntersection l4=new Intersection(4,l5);\n\t\tIntersection l3=new Intersection(3,l4);\n\t\tIntersection l2=new Intersection(2,l3);\n\t\tIntersection l1=new Intersection(1,l2);\n\t\t\n\t\tIntersection m7=new Intersection(7,l3);\n\t\tIntersection m6=new Intersection(6,m7);\n\t\tint flag=0;\n\t\twhile(m6!=null && l1!=null){\n\t\t\tif(m6!=l1){\n\t\t\t\tm6=m6.next;\n\t\t\t\tl1=l1.next;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tflag=1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(flag==1){\n\t\t\tSystem.out.println(\"They Intersect!\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"They don't!\");\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tLL l1 = new LL();\n\t\tLL l2 = new LL();\n\t\tl1.insert(15);\n\t\tl1.insert(25);\n\t\tl1.insert(35);\n\t\tl1.insert(45);\n\t\tl1.insert(55);\n\t\t\n\t\tl2.insert(10);\n\t\tl2.insert(17);\n\t\tl2.insert(35);\n\t\tl2.insert(47);\n\t\tl2.insert(11);\n\t \t\n\t\t\n//\t\tl1.print();\n//\t\tl2.print();\n\t\t\n\t\tSystem.out.println(getIntersection(l1.head,l2.head));\n\t\t\n\t}", "public void testUsingQueriesFromQueryManger(){\n\t\tSet<String> names = testDataMap.keySet();\n\t\tUtils.prtObMess(this.getClass(), \"atm query\");\n\t\tDseInputQuery<BigDecimal> atmq = \n\t\t\t\tqm.getQuery(new AtmDiot());\n\t\tMap<String, ComplexQueryResult<BigDecimal>> bdResult = \n\t\t\t\tatmq.get(names, 1, TimeUnit.SECONDS);\n\t\tCollectionsStaticMethods.prtMapItems(bdResult);\n\n\t\tUtils.prtObMess(this.getClass(), \"vol query\");\n\t\tDseInputQuery<BigDecimal> volq = \n\t\t\t\tqm.getQuery(new VolDiotForTest());\n\t\tMap<String, ComplexQueryResult<BigDecimal>> dbResult = \n\t\t\t\tvolq.get(names, 1, TimeUnit.SECONDS);\n\t\tCollectionsStaticMethods.prtMapItems(dbResult);\n\t\n\t\tUtils.prtObMess(this.getClass(), \"integer query\");\n\t\tDseInputQuery<BigDecimal> strikeq = \n\t\t\t\tqm.getQuery(new StrikeDiotForTest());\n\t\tMap<String, ComplexQueryResult<BigDecimal>> strikeResult = \n\t\t\t\tstrikeq.get(names, 1, TimeUnit.SECONDS);\n\t\tCollectionsStaticMethods.prtMapItems(strikeResult);\n\t\n\t}", "public ArrayList<Object> intersect(ArrayList<Object> list1, ArrayList<Object> list2)\r\n {\r\n ArrayList<Object> retList = new ArrayList<Object>();\r\n for(Object o : list1)\r\n if(list2.contains(o))\r\n retList.add(o);\r\n return retList;\r\n }", "private void twoDateOccupancyQuery(String startDate, String endDate){\n List<String> emptyRooms = findEmptyRoomsInRange(startDate, endDate);\n List<String> fullyOccupiedRooms = findOccupiedRoomsInRange(startDate, endDate, emptyRooms);\n List<String> partiallyOccupiedRooms = \n (generateListOfAllRoomIDS().removeAll(emptyRooms)).removeAll(fullyOccupiedRooms);\n\n occupancyColumns = new Vector<String>();\n occupancyData = new Vector<Vector<String>>();\n occupancyColumns.addElement(\"RoomId\");\n occupancyColumns.addElement(\"Occupancy Status\");\n\n for(String room: emptyRooms) {\n Vector<String> row = new Vector<String>();\n row.addElement(room);\n row.addElement(\"Empty\");\n occupancyData.addElement(row);\n }\n for(String room: fullyOccupiedRooms) {\n Vector<String> row = new Vector<String>();\n row.addElement(room);\n row.addElement(\"Fully Occupied\");\n occupancyData.addElement(row);\n }\n for(String room: partiallyOccupiedRooms) {\n Vector<String> row = new Vector<String>();\n row.addElement(room);\n row.addElement(\"Partially Occupied\");\n occupancyData.addElement(row);\n }\n return;\n}", "public static void main(String[] args) {\n List<Integer> list1 = new ArrayList<>();\n List<Integer> list2 = new ArrayList<>();\n list1.add(2);\n list1.add(3);\n list1.add(4);\n list2.add(1);\n list2.add(5);\n list2.add(6);\n merge(list1, list2).forEach(item -> System.out.print(item + \" \"));\n }", "private boolean isIntersect(List<Tuple> list1, List<Tuple> list2) {\n\t\tboolean intersect = false;\n\t\tfor (Tuple tuple : list1) {\n\t\t\tif (list2.contains(tuple)) {\n\t\t\t\tintersect = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn intersect;\n\t}", "@Test\n public void test1() {\n final List<String> listA = Arrays.asList(\"Fremont\", \"Dublin\", \"anamole\", \"San Jose\" , \"SFO\", \"Dublin\", \"San Jose\", \"paramount\", \"y\");\n final List<String> listB = Arrays.asList(\"Dublin\", \"san mateo\", \"los angeles\", \"san mateo\", \"fremont\", \"anamole\", \"x\", \"x\", \"Y\");\n final List<String> common = FindIntersection.findCommonLists(listA, listB);\n System.out.println(Arrays.toString(FindIntersection.findCommonLists(listA, listB).toArray()));\n\n }", "boolean overlap(Reservation other);", "@Test\n\tpublic void integrationTest2() throws Exception {\n\t\tHashSet<String> mistress = loadGrepResults(\"mistress\");\n\t\tHashSet<String> undocumented = loadGrepResults(\"undocumented\");\n\t\tHashSet<String> insane = loadGrepResults(\"insane\");\n\t\tHashSet<String> crazy = loadGrepResults(\"crazy\");\n\t\tHashSet<String> forced = loadGrepResults(\"!i+am+forced\");\n\t\t\n\t\tHashSet<String> grepFound = new HashSet<String>(mistress);\n\t\tgrepFound.retainAll(undocumented);\n\t\tHashSet<String> temp = new HashSet<String>(crazy);\n\t\ttemp.retainAll(forced);\n\t\tgrepFound.addAll(temp);\n\t\tgrepFound.addAll(insane);\n\t\t\n\t\tCollection<Page> index = queryTest.query(\"insane | crazy & !\\\"I am forced\\\" | mistress & undocumented\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\tassertEquals(indexFound, grepFound);\n\t}", "public ArrayList<Integer> intersect(final List<Integer> a, final List<Integer> b) {\n\t ArrayList<Integer> res = new ArrayList<>();\n\t \n\t int i1 = 0, i2 = 0;\n\t while (i1 < a.size() && i2 < b.size()) {\n\t //System.out.println(i1 + \" \" + i2 + \" \" + a.get(i1) + \" \" + b.get(i2));\n\t if (a.get(i1).equals(b.get(i2))) {\n\t res.add(a.get(i1));\n\t i1++;\n\t i2++;\n\t } else if (a.get(i1) < b.get(i2)) {\n\t i1++;\n\t } else if (a.get(i1) > b.get(i2)) {\n\t i2++;\n\t }\n\t }\n\t \n\t return res;\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 }", "protected boolean query() {\r\n\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()) + processQueryAuthor(queryBk.getCreator())\r\n\t\t\t\t+ processQueryPublisher(queryBk.getPublisher()));\r\n\t\tSystem.out.println(queryStr);\r\n\t\t// if edition is 'lastest' (coded '0'), no query is performed; and\r\n\t\t// return false.\r\n\t\tif (queryBk.parseEdition() == 0) {\r\n\t\t\treturn false;\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * The following section adds edition info to the query string if edition no. is\r\n\t\t * greater than one. By cataloging practice, for the first edition, probably\r\n\t\t * there is NO input on the associated MARC field. Considering this, edition\r\n\t\t * query string to Primo is NOT added if querying for the first edition or no\r\n\t\t * edition is specified.\r\n\t\t */\r\n\t\tif (queryBk.parseEdition() > 1) {\r\n\t\t\tqueryStr += processQueryEdition(queryBk.parseEdition());\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * Querying the Primo X-service; and invoking the matching processes (all done\r\n\t\t * by remoteQuery()).\r\n\t\t */\r\n\t\tif (strHandle.hasSomething(queryBk.getPublisher())) {\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * For various reasons, there are possibilities that the first query fails while\r\n\t\t * a match should be found. The follow work as remedy queries to ensure the\r\n\t\t * accuracy.\r\n\t\t */\r\n\r\n\t\tif (!match && strHandle.hasSomething(queryBk.getPublisher())) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryPublisher(queryBk.getPublisher()) + processQueryAuthor(queryBk.getCreator()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()) + processQueryAuthor(queryBk.getCreator()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match && strHandle.hasSomething(queryBk.getPublishYear())) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryAuthor(queryBk.getCreator()) + processQueryYear(queryBk.getPublishYear()));\r\n\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryAuthor(queryBk.getCreator()) + processQueryTitleShort(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t// Additional query for Chinese titles\r\n\r\n\t\tif (!match && (CJKStringHandling.isCJKString(queryBk.getTitle())\r\n\t\t\t\t|| CJKStringHandling.isCJKString(queryBk.getCreator())\r\n\t\t\t\t|| CJKStringHandling.isCJKString(queryBk.getPublisher()))) {\r\n\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\r\n\t\t\tif (!match && queryBk.parseEdition() != -1) {\r\n\t\t\t\tqueryStr = new String(\r\n\t\t\t\t\t\tprocessQueryTitle(queryBk.getTitle()) + processQueryEdition2(queryBk.parseEdition()));\r\n\t\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t\tsetBookInfo();\r\n\t\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t} // end if\r\n\r\n\t\t\t\tif (!match && queryBk.parseEdition() != -1) {\r\n\t\t\t\t\tqueryStr = new String(\r\n\t\t\t\t\t\t\tprocessQueryTitle(queryBk.getTitle()) + processQueryEdition3(queryBk.parseEdition()));\r\n\t\t\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\t\t\tmatch = true;\r\n\t\t\t\t\t\tsetBookInfo();\r\n\t\t\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tmatch = false;\r\n\t\t\t\t\t} // end if\r\n\t\t\t\t} // end if\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t// Additional check for ISO Document number in <search> <genernal> PNX\r\n\t\t// tag\r\n\t\tif (!match && !CJKStringHandling.isCJKString(queryBk.getTitle())) {\r\n\t\t\tqueryStr = new String(processQueryTitleISODoc(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t\terrMsg += \"Query: No record found on Primo.\" + Config.QUERY_SETTING;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\t\treturn false;\r\n\t}", "protected <Ty> HashSet<Ty> intersection(HashSet<Ty> setA, HashSet<Ty> setB) {\n HashSet<Ty> retSet = new HashSet<>();\n for (Ty t : setA) {\n if (setB.contains(t)) {\n retSet.add(t);\n }\n }\n return retSet;\n }", "List<ProtocolPo> queryByUnion(ProtocolPo query);", "protected abstract NativeSQLStatement createNativeIntersectsStatement(Geometry geom);", "private void queryPosts() {\n ParseQuery<OutfitPost> query = ParseQuery.getQuery(OutfitPost.class);\n // only include data referred by user key\n query.include(OutfitPost.KEY_USER);\n query.whereEqualTo(OutfitPost.KEY_USER, ParseUser.getCurrentUser());\n // limit query to latest 20 items\n query.setLimit(20);\n // order posts by creation date (newest first)\n query.addDescendingOrder(OutfitPost.KEY_CREATED_KEY);\n // start an asynchronous call for posts\n query.findInBackground(new FindCallback<OutfitPost>() {\n @Override\n public void done(List<OutfitPost> posts, ParseException e) {\n // check for errors\n if (e != null) {\n Log.e(TAG, \"Issue with getting posts\", e);\n return;\n }\n // Save oldest post in query for loading more posts\n if (posts.size() > 0) {\n oldestPost = posts.get(posts.size() - 1).getCreatedAt();\n }\n // update adapter with posts list\n adapter.clear();\n adapter.addAll(posts);\n }\n });\n }", "public void sensibleMatches1() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n Map<String, Set<String>> mapWithoutHal = new HashMap<>(clientMap);\n mapWithoutHal.remove(\"Hal\");\n for (String eachClient : mapWithoutHal.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }", "public void reflectRelationOnUnionQuery(ConditionQuery bqs, ConditionQuery uqs) {\n }", "public void reflectRelationOnUnionQuery(ConditionQuery bqs, ConditionQuery uqs) {\n }", "public void reflectRelationOnUnionQuery(ConditionQuery bqs, ConditionQuery uqs) {\n }", "public Intersection(ListExpression expr1, ListExpression expr2) {\n this.expr1 = expr1;\n this.expr2 = expr2;\n }", "@Test\n public void testIntersection2()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 100000};\n List<Integer> expected = Collections.singletonList(100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "public void getIntersection(int[] A, int[] B, ArrayList<int[]> intersections) \n {\n if (A[0] >= B[0] && A[0] <= B[1]) \n {\n if (A[1] >= B[0] && A[1] <= B[1]) \n {\n // Take the entirety of A\n intersections.add(A);\n } \n else \n {\n // Take the start of A to end of B\n int[] intersection = new int[]{A[0], B[1]};\n intersections.add(intersection);\n }\n } \n else \n {\n if (A[1] >= B[0] && A[1] <= B[1]) \n {\n // Take start of B to end of A\n int[] intersection = new int[]{B[0], A[1]};\n intersections.add(intersection);\n } \n else \n {\n if (A[0] < B[0] && A[1] > B[1]) \n {\n // Take the entirety of B\n intersections.add(B);\n } \n else \n {\n // No intersection at all\n return;\n }\n }\n }\n }", "private List<Object[]> executeDayQuery(\n List<Object> segments, List<Object> workplaces,\n String Eq1startTime, String Eq1endTime,\n String Eq2startTime, String Eq2endTime,\n String Eq3startTime, String Eq3endTime) {\n try {\n //Clear all tables\n //################# Declared Harness Data #################### \n Helper.startSession();\n\n String query_str_1 = \"(SELECT 'Matin' as shift,'%s' As start_time, '%s' as end_time, \"\n + \"bh.segment AS segment, \"\n + \"bh.workplace AS workplace, \"\n + \"bh.harness_part AS harness_part, \"\n + \"bh.std_time AS std_time, \"\n + \"COUNT(bh.harness_part) AS produced_qty, \"\n + \"SUM(bh.std_time) AS produced_hours \"\n + \"FROM base_harness bh, base_container bc \"\n + \"WHERE bc.id = bh.container_id \"\n + \"AND bh.create_time BETWEEN '%s' AND '%s' \"\n + \"AND bh.segment IN (:segments) \"\n + \"AND bh.workplace IN (:workplaces) \"\n + \"GROUP BY bh.segment, bh.workplace, bh.harness_part, bh.std_time)\";\n\n query_str_1 = String.format(query_str_1, Eq1startTime, Eq1endTime, Eq1startTime, Eq1endTime);\n\n String query_str_2 = \"(SELECT 'Soir' as shift,'%s' As start_time, '%s' as end_time, \"\n + \"bh.segment AS segment, \"\n + \"bh.workplace AS workplace, \"\n + \"bh.harness_part AS harness_part, \"\n + \"bh.std_time AS std_time, \"\n + \"COUNT(bh.harness_part) AS produced_qty, \"\n + \"SUM(bh.std_time) AS produced_hours \"\n + \"FROM base_harness bh, base_container bc \"\n + \"WHERE bc.id = bh.container_id \"\n + \"AND bh.create_time BETWEEN '%s' AND '%s' \"\n + \"AND bh.segment IN (:segments) \"\n + \"AND bh.workplace IN (:workplaces) \"\n + \"GROUP BY bh.segment, bh.workplace, bh.harness_part, bh.std_time)\";\n\n query_str_2 = String.format(query_str_2, Eq2startTime, Eq2endTime, Eq2startTime, Eq2endTime);\n\n String query_str_3 = \"(SELECT 'Nuit' as shift,'%s' As start_time, '%s' as end_time, \"\n + \"bh.segment AS segment, \"\n + \"bh.workplace AS workplace, \"\n + \"bh.harness_part AS harness_part, \"\n + \"bh.std_time AS std_time, \"\n + \"COUNT(bh.harness_part) AS produced_qty, \"\n + \"SUM(bh.std_time) AS produced_hours \"\n + \"FROM base_harness bh, base_container bc \"\n + \"WHERE bc.id = bh.container_id \"\n + \"AND bh.create_time BETWEEN '%s' AND '%s' \"\n + \"AND bh.segment IN (:segments) \"\n + \"AND bh.workplace IN (:workplaces)\"\n + \"GROUP BY bh.segment, bh.workplace, bh.harness_part, bh.std_time) \";\n\n query_str_3 = String.format(query_str_3, Eq3startTime, Eq3endTime, Eq3startTime, Eq3endTime);\n\n String query_str = \"SELECT * FROM (\"\n + query_str_1 + \" UNION \"\n + query_str_2 + \" UNION \"\n + query_str_3\n + \") results ORDER BY start_time ASC, segment ASC, workplace ASC, harness_part ASC\";\n\n SQLQuery query = Helper.sess.createSQLQuery(query_str);\n\n query.addScalar(\"shift\", StandardBasicTypes.STRING)\n .addScalar(\"start_time\", StandardBasicTypes.STRING)\n .addScalar(\"end_time\", StandardBasicTypes.STRING)\n .addScalar(\"segment\", StandardBasicTypes.STRING)\n .addScalar(\"workplace\", StandardBasicTypes.STRING)\n .addScalar(\"harness_part\", StandardBasicTypes.STRING)\n .addScalar(\"std_time\", StandardBasicTypes.DOUBLE)\n .addScalar(\"produced_qty\", StandardBasicTypes.INTEGER)\n .addScalar(\"produced_hours\", StandardBasicTypes.DOUBLE)\n .setParameterList(\"segments\", segments)\n .setParameterList(\"workplaces\", workplaces);\n\n this.dataResultList = query.list();\n\n Helper.sess.getTransaction().commit();\n\n return this.dataResultList;\n\n } catch (HibernateException e) {\n if (Helper.sess.getTransaction() != null) {\n Helper.sess.getTransaction().rollback();\n }\n }\n\n return this.dataResultList;\n }", "public PostingsList phrase_query(Query query){\n\n LinkedList<PostingsList> listQueriedPostings = new LinkedList<PostingsList>();\n // List with postings corresponding to the queries\n for (int i = 0; i<query.size(); i++){\n // If any query has zero matches, return 0 results\n //if(!(new File(\"postings/t\"+hash(query.terms.get(i))+\".json\")).exists()){\n if (!this.index.containsKey(query.terms.get(i))){\n return null;\n }\n // Otherwise store postings in the list\n listQueriedPostings.add(this.getPostings(query.terms.get(i)));\n }\n\n PostingsList result = new PostingsList();\n result = listQueriedPostings.get(0);\n\n // In case only one word is queried\n if (listQueriedPostings.size() == 1){\n return result;\n }\n\n // Apply algorithm as many times as words in the query\n for(int i = 1; i < listQueriedPostings.size(); i++){\n result = phrase_query(result, listQueriedPostings.get(i));\n if (result.isEmpty()){\n return null;\n }\n }\n return result;\n }", "private static boolean availabilityQuery(String roomid, String date1, String date2)\n {\n String query = \"SELECT status\"\n + \" FROM (\"\n + \" SELECT DISTINCT ro.RoomId, 'occupied' AS status\"\n + \" FROM myReservations re JOIN myRooms ro ON (re.Room = ro.RoomId)\"\n + \" WHERE (DATEDIFF(CheckIn, DATE(\" + date1 + \")) <= 0\"\n + \" AND DATEDIFF(CheckOut, DATE(\" + date2 + \")) > 0)\" \n + \" OR (DATEDIFF(CheckIn, DATE(\" + date1 + \")) > 0\" \n + \" AND DATEDIFF(CheckIn, DATE(\" + date2 + \")) <= 0)\" \n + \" OR (DATEDIFF(CheckOut, DATE(\" + date1 + \")) > 0\" \n + \" AND DATEDIFF(CheckOut, DATE(\" + date2 + \")) < 0)\"\n + \" UNION\"\n + \" SELECT DISTINCT RoomId, 'empty' AS status\"\n + \" FROM myRooms\"\n + \" WHERE RoomId NOT IN (\"\n + \" SELECT DISTINCT re.Room\"\n + \" FROM myReservations re JOIN myRooms ro ON (re.Room = ro.RoomId)\"\n + \" WHERE (DATEDIFF(CheckIn, DATE(\" + date1 + \")) <= 0\"\n + \" AND DATEDIFF(CheckOut, DATE(\" + date2 + \")) > 0)\"\n + \" OR (DATEDIFF(CheckIn, DATE(\" + date1 + \")) > 0\"\n + \" AND DATEDIFF(CheckIn, DATE(\" + date2 + \")) <= 0)\" \n + \" OR (DATEDIFF(CheckOut, DATE(\" + date1 + \")) > 0\" \n + \" AND DATEDIFF(CheckOut, DATE(\" + date2 + \")) < 0)\" \n + \" )) AS tb\"\n + \" WHERE RoomId = '\" + roomid + \"'\";\n\n PreparedStatement stmt = null;\n ResultSet rset = null;\n\n try\n {\n stmt = conn.prepareStatement(query);\n rset = stmt.executeQuery();\n rset.next();\n if(rset.getString(\"status\").equals(\"empty\"))\n return true;\n }\n catch (Exception ex){\n ex.printStackTrace();\n }\n finally {\n try {\n stmt.close();\n }\n catch (Exception ex) {\n ex.printStackTrace( ); \n } \t\n }\n \n return false;\n\n }", "private void link(String sourceInstance, String targetInstance, Tuple<String, String> queries) {\n\t\t// Adapt queries to sample instances\n\t\tTuple<String,String> newQueries = queries;\n\t\tif(sourceInstance!=null && targetInstance!=null) {\n\t\t\t// if sourceInstance and targetInstance are not null, add the clauses:\n\t\t\t//\t\t\"WHERE source.id = sourceInstance\" to queries.getFirstElement()\n\t\t\t//\t\t\"WHERE target.id = targetInstance\" to queries.getSecondElement()\n\t\t}\n\t\texecuteSourceQuery(newQueries.getFirstElement(), newQueries.getSecondElement());\n\t}", "private static <Item extends Comparable> List<Item> catenate(List<Item> q1, List<Item> q2) {\n List<Item> catenated = new ArrayList<>();\n for (Item item : q1) {\n catenated.add(item);\n }\n for (Item item: q2) {\n catenated.add(item);\n }\n return catenated;\n }", "private ExampleSetBuilder performInnerJoin(ExampleSet leftExampleSet, ExampleSet rightExampleSet,\n\t\t\tList<AttributeSource> originalAttributeSources, List<Attribute> unionAttributeList,\n\t\t\tPair<Attribute[], Attribute[]> keyAttributes) throws ProcessStoppedException {\n\t\tExampleSetBuilder builder = ExampleSets.from(unionAttributeList);\n\n\t\tAttribute[] leftKeyAttributes = null;\n\t\tAttribute[] rightKeyAttributes = null;\n\t\tMap<DoubleArrayWrapper, List<Example>> rightKeyMapping = null;\n\t\tboolean useId = getParameterAsBoolean(PARAMETER_USE_ID);\n\n\t\tif (!useId) {\n\t\t\t// create key mapping for right example set\n\t\t\tleftKeyAttributes = keyAttributes.getFirst();\n\t\t\trightKeyAttributes = keyAttributes.getSecond();\n\t\t\trightKeyMapping = createKeyMapping(rightExampleSet, rightKeyAttributes, leftKeyAttributes);\n\t\t}\n\n\t\tint progressCounter = 0;\n\t\t// iterate over all example from left table and search for matching examples in right table:\n\t\tfor (Example leftExample : leftExampleSet) {\n\n\t\t\tList<Example> matchingRightExamples = getMatchingExamples(leftExampleSet, rightExampleSet, leftKeyAttributes,\n\t\t\t\t\trightKeyMapping, useId, leftExample);\n\n\t\t\tif (matchingRightExamples != null) {\n\t\t\t\tfor (Example rightExample : matchingRightExamples) {\n\t\t\t\t\taddCombinedOccurence(originalAttributeSources, unionAttributeList, builder, leftExample, rightExample);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// trigger operator progress every 100 examples\n\t\t\t++progressCounter;\n\t\t\tif (progressCounter % 100 == 0) {\n\t\t\t\tgetProgress().step(100);\n\t\t\t\tprogressCounter = 0;\n\t\t\t}\n\t\t}\n\t\treturn builder;\n\t}", "private Set<String> intersection(Set<String> s1, Set<String> s2) {\n Set<String> intersection = new HashSet<>(s1);\n intersection.retainAll(s2);\n return intersection;\n }", "private ClusterCombination checkAndDoJoinMultiPearson(ClusterCombination CC1, ClusterCombination CC2) {\n boolean doJoin = true;\r\n ArrayList<Cluster> CCList = new ArrayList<>(CC1.getClusters().size()+1); //list of output clusters for new CC if join is succesfull\r\n\r\n ArrayList<Cluster> CC1Clusters = CC1.getClusters();\r\n ArrayList<Cluster> CC2Clusters = CC2.getClusters();\r\n\r\n ArrayList<Cluster> LHS1 = CC1.getLHS();\r\n ArrayList<Cluster> LHS2 = CC2.getLHS();\r\n\r\n ArrayList<Cluster> RHS1 = CC1.getRHS();\r\n ArrayList<Cluster> RHS2 = CC2.getRHS();\r\n\r\n for(int i =0; i<CC1Clusters.size()-1; i++) {\r\n Cluster C1 = CC1Clusters.get(i);\r\n Cluster C2 = CC2Clusters.get(i);\r\n\r\n boolean overlap = checkClusterOverlap(C1, C2); // check if there is some overlap\r\n\r\n\r\n\r\n if(!overlap){ //the cluster in this position does not overlap, we don't need to join\r\n doJoin=false;\r\n break;\r\n }else{ // there is overlap, add the intersection of C1 and C2\r\n if(C1.getNPoints() <= C2.getNPoints()){\r\n CCList.add(C1);\r\n }else{\r\n CCList.add(C2);\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n if(doJoin){ // each cluster in the candidate (except the last) does overlap\r\n // so, according to apriori, we join -> return the overlapping clusters + the last clusters of CC1 and CC2\r\n Cluster lastCC1 = CC1Clusters.get(CC1Clusters.size()-1);\r\n Cluster lastCC2 = CC2Clusters.get(CC2Clusters.size()-1);\r\n if(lastCC1.getClusterId() <= lastCC2.getClusterId()){ // make sure to respect ordering of clusters within a candidate by ID. otherwise this could be designated as a duplicate\r\n CCList.add(lastCC1); CCList.add(lastCC2);\r\n }else{\r\n CCList.add(lastCC2); CCList.add(lastCC1);\r\n }\r\n\r\n ArrayList<Cluster> newLHS = new ArrayList<>();\r\n ArrayList<Cluster> newRHS = new ArrayList<>();\r\n for(int i = 0; i<LHS1.size(); i++){\r\n newLHS.add(CCList.get(i));\r\n }\r\n for(int i = LHS1.size(); i<CCList.size(); i++){\r\n newRHS.add(CCList.get(i));\r\n }\r\n\r\n ClusterCombination newCC = new MultiPearsonClusterCombination(newLHS, newRHS);\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC1.getLB(), CC1.getMaxLowerBoundSubset()));\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC2.getLB(), CC2.getMaxLowerBoundSubset()));\r\n\r\n return newCC;\r\n\r\n }else{\r\n return null;\r\n }\r\n }", "public boolean query(int a, int b) {\n\t\treturn find(a) == find(b);\n }", "@Test\n\tpublic void orGrepTest() throws Exception {\n\t\t// | for 'insane' and 'mistress'\n\t\tHashSet<String> grep1 = loadGrepResults(\"mistress\");\n\t\tHashSet<String> grepFound = loadGrepResults(\"insane\");\n\t\tgrepFound.addAll(grep1);\n\n\t\tCollection<Page> index = queryTest.query(\"mistress | insane\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\n\t\tassertEquals(indexFound, grepFound);\n\n\t}", "public static void intersection(ArrayList<String> x, ArrayList<String> y, ArrayList<String> z, JTextArea ta) {\n\t\t\n\t\t//This is the loop to add items from list 1 to results array, if the elements are present in both the lists\n\t\tfor (int i=0; i<x.size(); i++)\n\t\t{\n\t\t\tfor (int j=0; j<y.size(); j++)\n\t\t\t{\n\t\t\t\tif (x.get(i).equals(y.get(j))&&!z.contains(x.get(i)))\n\t\t\t\t{\n\t\t\t\t\tz.add(x.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//This is the loop to print all the items of the results array list\n\t\tta.setText(\"{ \");\n\t\tfor (int i=0; i<z.size(); i++)\n\t\t{\n\t\t\tta.append(z.get(i)+\" \");\n\t\t}\n\t\tta.append(\"}\");\n\t}", "private boolean overlaps(ThingTimeTriple a, ThingTimeTriple b)\r\n/* 227: */ {\r\n/* 228:189 */ return (a.from < b.to) && (a.to > b.from);\r\n/* 229: */ }", "@Override\n public int hashCode() {\n return Objects.hash(requestedPosts, this.getQueryID());\n }", "public ArrayList<Integer> intersect(\n final List<Integer> A, final List<Integer> B) {\n ArrayList<Integer> res = new ArrayList<Integer>();\n int M = A.size();\n int N = B.size();\n if (M == 0 || N == 0) {\n return res;\n }\n int i = 0;\n int j = 0;\n while (i < M && j < N) {\n int a = A.get(i);\n int b = B.get(j);\n if (a == b) {\n res.add(a);\n i++;\n j++;\n } else if (a < b) {\n i++;\n } else {// a > b\n j++;\n }\n }\n return res;\n }", "public PostingsList search( Query query, int queryType, int rankingType, int structureType ) {\r\n switch(queryType){\r\n case Index.INTERSECTION_QUERY : \r\n return searchIntersection( query, rankingType, structureType);\r\n\r\n case Index.PHRASE_QUERY :\r\n return searchPhrase( query, rankingType, structureType);\r\n default:\r\n break;\r\n }\r\n\r\n return null;\r\n }", "public void sensibleMatches2() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n for (String eachClient : clientMap.keySet()) \n {\n if (!eachClient.equals(\"Hal\")) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }\n }", "private Range<Token> intersect(Range<Token> serverRange, AbstractBounds<Token> requestedRange)\n {\n if (serverRange.contains(requestedRange.left) && serverRange.contains(requestedRange.right)) {\n //case 1: serverRange fully encompasses requestedRange\n return new Range<Token>(requestedRange.left, requestedRange.right, partitioner);\n } else if (requestedRange.contains(serverRange.left) && requestedRange.contains(serverRange.right)) {\n //case 2: serverRange is fully encompasses by requestedRange\n //serverRange is already the intersection\n return new Range<Token>(serverRange.left, serverRange.right);\n } else if (serverRange.contains(requestedRange.left) && requestedRange.contains(serverRange.right)) {\n //case 3: serverRange overlaps on the left: sR.left < rR.left < sR.right < rR.right\n return new Range<Token>(requestedRange.left, serverRange.right, partitioner);\n } else if (requestedRange.contains(serverRange.left) && serverRange.contains(requestedRange.right)) {\n //case 4: serverRange overlaps on the right rR.left < sR.left < rR.right < sR.right\n return new Range<Token>(serverRange.left, requestedRange.right, partitioner);\n } else if (!serverRange.contains(requestedRange.left) && !serverRange.contains(requestedRange.right) &&\n !requestedRange.contains(serverRange.left) && !requestedRange.contains(serverRange.right)) {\n //case 5: totally disjoint\n return null;\n } else {\n assert false : \"Failed intersecting serverRange = (\" + serverRange.left + \", \" + serverRange.right + \") and requestedRange = (\" + requestedRange.left + \", \" + requestedRange.right + \")\";\n return null;\n }\n }", "public static List<StringMeeting> calendarMatching(\n List<StringMeeting> calendar1,\n StringMeeting dailyBounds1,\n List<StringMeeting> calendar2,\n StringMeeting dailyBounds2,\n int meetingDuration) {\n\n\n List<Meeting> updatedCaleandr1 = updateCalendar(calendar1, dailyBounds1);\n System.out.println(updatedCaleandr1);\n List<Meeting> updatedCaleandr2 = updateCalendar(calendar2, dailyBounds2);\n\n\n\n List<Meeting> mergedCalendar = mergeCalendars(updatedCaleandr1, updatedCaleandr2);\n mergedCalendar.forEach(k-> System.out.println(k.toString()));\n List<Meeting> flattencalendr = flattenCalenedars(mergedCalendar);\n// flattencalendr.forEach(k-> System.out.println(k.toString()));\n System.out.println();\n\n return getMatchingAvailabilities(flattencalendr, meetingDuration);\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint arr1[] = {3,2,11,4,6,7};\r\n\t\tint arr2[] = {1,2,8,4,9,7};\r\n\t\t\r\n\t\tList<Integer> list1 = new ArrayList<Integer>();\r\n\t\t\r\n\t\tList<Integer> list2 = new ArrayList<Integer>();\r\n\t\t\r\n\t\tfor (int a : arr1) {\r\n\t\t\tlist1.add(a);\r\n\t\t}\r\n\t\tfor (int b : arr2) {\r\n\t\t\tlist2.add(b);\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(list1);\r\n System.out.println(list2);\r\n \r\n list1.retainAll(list2);\r\n System.out.println(\"The Intersection values : \" + list1);\r\n \r\n\t}", "public static void main(String[] args) {\n\t\tInteger[] firstArray = {0,2,4,6,8};\n\t Integer[] secondArray = {1,3,10,4,7,8,9};\n\t \n\t intersectionUsingSet(firstArray, secondArray);\n\n\t System.out.println();\n\t \n\t // Array with duplicate elements in the array\n\t Integer[] firstArray1 = {0,2,2,4,6,6,8};\n\t Integer[] secondArray2 = {1,3,10,10,4,7,8,9};\n\t \n\t intersectionUsingSet(firstArray1, secondArray2);\n\t}", "@Test\n\tpublic void andGrepTest() throws Exception {\n\t\t// & for 'undocumented' and 'mistress'\n\t\tHashSet<String> grepFound = loadGrepResults(\"undocumented\");\n\t\tHashSet<String> grep1 = loadGrepResults(\"mistress\");\n\t\tgrepFound.retainAll(grep1);\n\t\t\n\t\tCollection<Page> index = queryTest.query(\"mistress & undocumented\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\tassertEquals(indexFound, grepFound);\n\t}", "public void matchesDemo() \n {\n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection;\n\n for (String eachClient : clientMap.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString) ;\n }\n }", "public ZYSet<ElementType> intersection(ZYSet<ElementType> otherSet){\n ZYSet<ElementType> result = new ZYArraySet<ElementType>();\n for(ElementType e :this){\n if(otherSet.contains(e)){\n result.add(e);\n }\n }\n return result;\n }", "public void run(){\n\t\tif(searchHow==0){\n\t\t\tint isbnCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestIsbn = new SearchRequest(db, searchForThis, isbnCount, db.size());\n\t\t\t\t\tdb.searchByISBN(requestIsbn);\n\t\t\t\t\tisbnCount = requestIsbn.foundPos;\n\t\t\t\t\tif (requestIsbn.foundPos >= 0) {\n\t\t\t\t\t\tisbnCount++;\n\t\t\t\t\t\tString formatThis = \"Matched ISBN at position: \" + requestIsbn.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestIsbn.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==1){\n\t\t\tint titleCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestTitle = new SearchRequest(db, searchForThis, titleCount, db.size());\n\t\t\t\t\tdb.searchByTitle(requestTitle);\n\t\t\t\t\ttitleCount = requestTitle.foundPos;\n\t\t\t\t\tif (requestTitle.foundPos >= 0) {\n\t\t\t\t\t\ttitleCount++;\n\t\t\t\t\t\tString formatThis = \"Matched title at position: \" + requestTitle.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestTitle.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==2){\n\t\t\tint authorCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestAuthor = new SearchRequest(db, searchForThis, authorCount, db.size());\n\t\t\t\t\tdb.searchByAuthor(requestAuthor);\n\t\t\t\t\tauthorCount = requestAuthor.foundPos;\n\t\t\t\t\tif (requestAuthor.foundPos >= 0) {\n\t\t\t\t\t\tauthorCount++;\n\t\t\t\t\t\tString formatThis = \"Matched author at position: \" + requestAuthor.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestAuthor.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==3){\n\t\t\tint pageCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestPage = new SearchRequest(db, searchForThis, pageCount, db.size());\n\t\t\t\t\tdb.searchByNumPages(requestPage);\n\t\t\t\t\tpageCount = requestPage.foundPos;\n\t\t\t\t\tif (requestPage.foundPos >= 0) {\n\t\t\t\t\t\tpageCount++;\n\t\t\t\t\t\tString formatThis = \"Matched pages at position: \" + requestPage.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestPage.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==4){\n\t\t\tint yearCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestYear = new SearchRequest(db, searchForThis, yearCount, db.size());\n\t\t\t\t\tdb.searchByYear(requestYear);\n\t\t\t\t\tyearCount = requestYear.foundPos;\n\t\t\t\t\tif (requestYear.foundPos >= 0) {\n\t\t\t\t\t\tyearCount++;\n\t\t\t\t\t\tString formatThis = \"Matched year at position: \" + requestYear.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestYear.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t}", "public interface SearchQuerySet extends QuerySet\n{\n\n // for AbstractSearch\n public static final int STAT_MODELS = 1;\n public static final int STAT_CLUSTERS = 2;\n public static final int STAT_GENOMES = 4;\n public static final int STAT_MODEL_CLUSTERS = 8;\n\n public String getStatsById(Collection data);\n public String getStatsByQuery(String query);\n public String getStatsById(Collection data,int stats);\n public String getStatsByQuery(String query,int stats);\n \n // for BlastSearch\n public String getBlastSearchQuery(Collection dbNames, Collection keys, KeyTypeUser.KeyType keyType);\n \n //for ClusterIDSearch\n public String getClusterIDSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for ClusterNameSearch\n public String getClusterNameSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for DescriptionSearch\n public String getDescriptionSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for GoSearch \n public String getGoSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for GoTextSearch\n public String getGoTextSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for IdSearch\n public String getIdSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for QueryCompSearch\n public String getQueryCompSearchQuery(String comp_id, String status, KeyTypeUser.KeyType keyType);\n \n // for QuerySearch\n public String getQuerySearchQuery(String queries_id, KeyTypeUser.KeyType keyType); \n \n // for SeqModelSearch\n public String getSeqModelSearchQuery(Collection model_ids, KeyTypeUser.KeyType keyType);\n \n // for UnknowclusterIdSearch\n public String getUnknownClusterIdSearchQuery(int cluster_id, KeyTypeUser.KeyType keyType);\n \n // for ProbeSetSearch\n public String getProbeSetSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for ProbeSetKeySearch\n public String getProbeSetKeySearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for QueryTestSearch\n public String getQueryTestSearchQuery(String query_id, String version, String genome_id);\n \n // for QueryStatsSearch\n public String getQueryStatsSearchQuery(List query_ids,List DBs);\n \n // for PskClusterSearch\n public String getPskClusterSearchQuery(int cluster_id,KeyTypeUser.KeyType keyType);\n \n // for ClusterCorrSearch\n public String getClusterCorrSearchQuery(int cluster_id, int psk_id, KeyTypeUser.KeyType keyType);\n \n // for UnknownGenesSearch\n public String getUnknownGenesSearchQuery(Collection sources, KeyTypeUser.KeyType keyType);\n \n}", "public static SiftKnnContainer mergetosizeofboth(SiftKnnContainer a, SiftKnnContainer b) {\n SiftKnnContainer ret = new SiftKnnContainer( a.getK() + b.getK() );\n ret.SetQueryPoint(a.getQueryPoint());\n\n knnPair[] knn = a.getknnPairArray();\n for (int i = 0; i < knn.length ; i++) {\n if (knn[i].distance != Integer.MAX_VALUE) {\n ret.addNoDuplicateIDs(knn[i].pointID, knn[i].distance);\n }\n }\n knn = b.getknnPairArray();\n for (int i = 0; i < knn.length ; i++) {\n if (knn[i].distance != Integer.MAX_VALUE) {\n ret.addNoDuplicateIDs(knn[i].pointID, knn[i].distance);\n }\n }\n return ret;\n }", "public static final void computeSortedIntersection(ArrayList<MediaItem> firstList, final ArrayList<MediaItem> secondList,\n int maxSize, ArrayList<MediaItem> intersectionList, MediaItem[] hash) {\n int mask = hash.length - 1;\n int numItemsToHash = Math.min(secondList.size(), 2 * hash.length);\n for (int i = 0; i < numItemsToHash; ++i) {\n MediaItem item = secondList.get(i);\n if (item != null) {\n hash[item.hashCode() & mask] = item;\n }\n }\n\n // Build the intersection array.\n int firstListSize = firstList.size();\n for (int i = 0; i < firstListSize; ++i) {\n MediaItem firstListItem = firstList.get(i);\n if (firstListItem == null)\n continue;\n MediaItem hashItem = (hash != null) ? hash[firstListItem.hashCode() & mask] : null;\n if (hashItem != null\n && ((hashItem.mId != Shared.INVALID && hashItem.hashCode() == firstListItem.hashCode()) || contains(secondList, firstListItem))) {\n intersectionList.add(firstListItem);\n if (--maxSize == 0) {\n break;\n }\n }\n }\n\n // Clear the hash table.\n Arrays.fill(hash, null);\n }", "private void findIntersection(Node head1, Node head2) {\n if (head1 == null || head2 == null) {\n System.out.println(\"No intersection found\");\n return;\n }\n Set<Node> set = new HashSet<Node>();\n boolean flag = false;\n\n for (Node temp = head1; temp != null; temp = temp.next)\n set.add(temp);\n for (Node temp = head2; temp != null; temp = temp.next)\n if (!set.add(temp)) {\n System.out.println(\"Intersection found at \" + temp.data);\n flag = true;\n break;\n }\n if (!flag) {\n System.out.println(\"No intersection found\");\n }\n }", "public static <T extends Comparable<? super T>> \n void union(SLL<T> list1, SLL<T> list2,\n SLL<T> result) {\n \n SLLNode<T> iterlist1 = list1.head;\n SLLNode<T> iterlist2 = list2.head;\n \n T itemlist1=null, itemlist2=null;\n \n // get first item in each list\n if ( iterlist1 != null )\n itemlist1 = iterlist1.info;\n if( iterlist2 != null )\n itemlist2 = iterlist2.info;\n \n while ( itemlist1 != null || itemlist2 != null ) {\n\n int compareResult;\n if( itemlist1 == null ) {\n compareResult = 1;\n } else if ( itemlist2 == null ) {\n compareResult = -1;\n } else {\n compareResult = itemlist1.compareTo(itemlist2);\n }\n \n if ( compareResult == 0 ) {\n result.addToTail(itemlist1); //appending to result list \n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n \n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n } \n }\n else if ( compareResult < 0 ) { \n result.addToTail(itemlist1); //appending to result list\n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n }\n else {\n result.addToTail(itemlist2);\n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n }\n }\n } \n }", "public void testRange() throws IOException, InvalidGeoException\r\n {\n LgteIndexSearcherWrapper searcher = new LgteIndexSearcherWrapper(path);\r\n\r\n //try find Jorge and Bruno documents last year\r\n // In this case the closest one will be in 2007\r\n String query = \"contents:(Jorge Bruno)\";\r\n\r\n LgteQuery lgteQueryResult1;\r\n LgteQuery lgteQueryResult1and2;\r\n try\r\n {\r\n lgteQueryResult1 = LgteQueryParser.parseQuery(query);\r\n lgteQueryResult1and2 = LgteQueryParser.parseQuery(query);\r\n\r\n MyCalendar c1Aux = new MyCalendar(2005,11,20,9,0,10);\r\n MyCalendar c2Aux = new MyCalendar(2007,1,12,20,45,15);\r\n long dif = c2Aux.getTimeInMillis() - c1Aux.getTimeInMillis();\r\n\r\n lgteQueryResult1.getQueryParams().setTimeMiliseconds(c1Aux.getTimeInMillis());\r\n lgteQueryResult1.getQueryParams().setRadiumMiliseconds(dif -1);\r\n lgteQueryResult1and2.getQueryParams().setTimeMiliseconds(c1Aux.getTimeInMillis());\r\n lgteQueryResult1and2.getQueryParams().setRadiumMiliseconds(dif+1);\r\n }\r\n catch (ParseException e)\r\n {\r\n fail(e.toString());\r\n return;\r\n }\r\n\r\n //Lets use aos Time Sorter to dont worry about distances and stuff like that, he will do the job\r\n TimeDistanceSortSource dsort1 = new TimeDistanceSortSource();\r\n LgteSort sort1 = new LgteSort(new SortField(\"foo\", dsort1));\r\n\r\n //LgteHits give you Documents and time with unecessary lines of boring code\r\n LgteHits lgteHits1;\r\n LgteHits lgteHits1and2;\r\n lgteHits1 = searcher.search(lgteQueryResult1, sort1);\r\n assertTrue(lgteHits1.length() == 1);\r\n\r\n lgteHits1and2 = searcher.search(lgteQueryResult1and2, sort1);\r\n assertTrue(lgteHits1and2.length() == 2);\r\n\r\n\r\n long time1_0 = lgteHits1.doc(0).getTime().getTime();\r\n long time1and2_0 = lgteHits1and2.doc(0).getTime().getTime();\r\n long time1and2_1 = lgteHits1and2.doc(1).getTime().getTime();\r\n assertTrue(time1_0 == new MyCalendar(2005,11,20,9,0,10).getTimeInMillis());\r\n assertTrue(time1and2_0 == new MyCalendar(2005,11,20,9,0,10).getTimeInMillis());\r\n assertTrue(time1and2_1 == new MyCalendar(2007,1,12,20,45,15).getTimeInMillis());\r\n\r\n\r\n searcher.close();\r\n }", "protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, ConditionQuery unionQueryAsSuper) {\r\n }", "public ArrayList<String> combineDataOpsAndIntents(String p1, String p2) {\n\t\tArrayList<String> logics1 = QueryStream.getLogic(p1);\n\t\tArrayList<String> terms1 = QueryStream.getTerms(p1);\n\t\t//Get logic statements from p2\n\t\tArrayList<String> logics2 = QueryStream.getLogic(p2);\n\t\tArrayList<String> terms2 = QueryStream.getTerms(p2);\n\t\t\n\t\tArrayList<String> result_logics = new ArrayList<String>();\n\t\tArrayList<String> result_terms = new ArrayList<String>();\n\t\t\n\t\t//Iterate through logic for p1. If it matches anything in p2,\n\t\t// we add the terms from p1 and p2 together.\n\t\tfor(int i = 0; i < logics1.size(); ++i) {\n\t\t\t\n\t\t\tString result_term = \"\";\n\t\t\t//If any logic matches, we combine the corresponding terms together\n\t\t\tif(logics2.contains(logics1.get(i))) {\n\t\t\t\tresult_term = terms1.get(i) + \" \" + terms2.get(i);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tresult_term = terms1.get(i);\n\t\t\t}\n\t\t\tresult_logics.add(logics1.get(i));\n\t\t\tresult_terms.add(result_term);\n\t\t}\n\t\t//Iterate through the logic for p2. If it includes any logic not\n\t\t// in the results, then add it in.\n\t\tfor(int i = 0; i < logics2.size(); ++i) {\n\t\t\t\n\t\t\tString result_term = \"\";\n\t\t\t//If any logic matches, we combine the corresponding terms together\n\t\t\tif(!result_logics.contains(logics2.get(i))) {\n\t\t\t\tresult_logics.add(logics2.get(i));\n\t\t\t\tresult_term = terms2.get(i);\n\t\t\t\tresult_terms.add(result_term);\n\t\t\t}\n\t\t}\n\t\t\n//\t\tfor(String l : result_logics) {\n//\t\t\tSystem.out.println(l);\n//\t\t}\n\t\t\n\t\t//Now we can create a new policy given the two strings\n\t\treturn produceDataOpsIntentsPolicy(result_logics, result_terms);\n\t}", "public static void findIntersection(int[] ip1, int[] ip2) {\n int[] smaller, bigger;\n if (ip1.length <= ip2.length) {\n smaller = ip1;\n bigger = ip2;\n } else {\n smaller = ip2;\n bigger = ip1;\n }\n\n\n //O(n)\n for (int i = 0; i < smaller.length; ) {\n for (int j = 0; j < bigger.length; ) {\n\n if (smaller[i] == bigger[j]) {\n System.out.print(smaller[i]+\" \");\n i++;\n j++;\n } else if (smaller[i] < bigger[j]) {\n i++;\n } else {\n j++;\n }\n\n\n }\n }\n\n\n }", "public void splitQuery(){\n for (int i=0;i<stemmed_query.size();i++){\n String stemmed_term = stemmed_query.get(i);\n for (int j=0;j<num_slave_client_threads;j++){\n if (stemmed_term.compareTo(ServerThread.start_terms[j]) >= 0 && stemmed_term.compareTo(ServerThread.end_terms[j]) <= 0){\n slave_queries.set(j, slave_queries.get(j)+\" \"+stemmed_term);\n break;\n }\n }\n }\n }", "public int[] intersection(int[] nums1, int[] nums2) {\n \n HashSet<Integer> set = new HashSet<>();\n ArrayList<Integer> inter = new ArrayList<>();\n if(nums1.length > nums2.length)\n {\n for(int i = 0; i < nums1.length ;i ++)\n set.add(nums1[i]);\n\n for(int i = 0; i < nums2.length ;i ++)\n if(set.contains(nums2[i])&& !inter.contains(nums2[i]))\n inter.add(nums2[i]);\n }\n else {\n for(int i = 0; i < nums2.length ;i ++)\n set.add(nums2[i]);\n\n for(int i = 0; i < nums1.length ;i ++)\n if(set.contains(nums1[i]) && !inter.contains(nums1[i]))\n inter.add(nums1[i]);\n }\n\n int [] arr = new int[inter.size()];\n for(int i = 0; i < arr.length ;i ++)\n arr[i] = inter.get(i);\n return arr;\n\n }", "private double intersection(HardClustering hard1, int comm1,\n HardClustering hard2, int comm2) {\n final TIntArrayList duplicate = new TIntArrayList(hard1.members(comm1));\n duplicate.retainAll(hard2.members(comm2));\n\n return duplicate.size();\n }", "private MetaSparqlRequest createQueryMT2() {\n\t\treturn createQueryMT1();\n\t}" ]
[ "0.69769245", "0.6333911", "0.5428158", "0.5357878", "0.530351", "0.5271801", "0.51897854", "0.51882815", "0.51229084", "0.50980556", "0.5068206", "0.50642776", "0.506333", "0.5041754", "0.502724", "0.5019483", "0.5001322", "0.49797273", "0.49742696", "0.4948692", "0.49297482", "0.49296632", "0.49152625", "0.4902071", "0.48992515", "0.4899249", "0.48972848", "0.4883559", "0.4882021", "0.4875533", "0.48731148", "0.48700714", "0.48564497", "0.4843899", "0.48435736", "0.48327523", "0.4831181", "0.48270538", "0.48237234", "0.48167416", "0.4814523", "0.48048198", "0.47797883", "0.47787896", "0.47694135", "0.47526503", "0.47478363", "0.4747363", "0.47392878", "0.47233588", "0.47124588", "0.47023365", "0.4699569", "0.46981785", "0.4698125", "0.46893966", "0.4688012", "0.46839514", "0.46839514", "0.46839514", "0.46827263", "0.467099", "0.4662867", "0.46601397", "0.46526662", "0.4639742", "0.463964", "0.46331403", "0.46272334", "0.46251887", "0.46240312", "0.46211112", "0.46203515", "0.46168703", "0.46087405", "0.46031943", "0.45942703", "0.4590699", "0.45890477", "0.4579803", "0.45760468", "0.45689905", "0.45682594", "0.45636377", "0.4560762", "0.4559033", "0.4556336", "0.45493516", "0.45457223", "0.4544857", "0.45397946", "0.45373127", "0.45368826", "0.45359004", "0.4534447", "0.45327792", "0.45292738", "0.45257157", "0.45240524", "0.4520284" ]
0.6708024
1
[NEW] Sorts a set of postings list according to the document frequency
public LinkedList<PostingsList> sortByIncreasingFrequency(LinkedList<PostingsList> l){ Collections.sort(l, new Comparator<PostingsList>(){ @Override public int compare(PostingsList p1, PostingsList p2){ if(p1.size() < p2.size()){ return -1; } if(p1.size() > p2.size()){ return 1; } return 0; } }); return l; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sort() {\n documents.sort();\n }", "public void sortDocumentsByDocnos() {\n order = new int[mDocSet.length];\n mDocSet_tmp = new double[mDocSet.length];\n accumulated_scores_tmp = new float[mDocSet.length];\n\n for (int i = 0; i < order.length; i++) {\n order[i] = i;\n mDocSet_tmp[i] = mDocSet[i];\n accumulated_scores_tmp[i] = accumulated_scores[i];\n }\n\n ivory.smrf.model.constrained.ConstraintModel.Quicksort(mDocSet_tmp, order, 0, order.length - 1);\n\n for (int i = 0; i < order.length; i++) {\n mDocSet[i] = (int) mDocSet_tmp[i];\n accumulated_scores[i] = accumulated_scores_tmp[order[i]];\n }\n }", "private void buildPostingList(){\n boolean isEndOfList = false;\n// boolean moveToNextDoc = false;\n ArrayList<Integer> tempList = new ArrayList<>(); // tempList to hold doc wise posting List\n\n while(!isEndOfList){\n boolean skipDoc = false;\n int doc = children.get(0).nextCandidate();\n if(doc == -1) {\n // End of list. No more windows to collect. Exit.\n isEndOfList = true; break;\n }\n int distance = super.getDiskReader().getRetrievedDocToLengthMap().get(doc);\n // Check if doc exists in all other children.\n // If it exists, skip to that Document.\n for(QueryNode child : children){\n /* skipToDoc skips the pointer in child node to the current doc.\n */\n if(!child.skipToDoc(doc)) {\n skipDoc = true;\n break;\n }\n\n }\n if(!skipDoc) {\n /* From here, all nodes have the document. Proceed to calculating number of windows in doc */\n\n tempList.clear();\n tempList.add(doc); //\n tempList.add(0); // doc term frequency. We will update this later.\n int fkid = 0; // doc term frequency tracker\n// int i = startTermIndex+1;\n int minPosIndex = 0; // holds the index of the node which has current minimum Pos\n int minPos = children.get(minPosIndex).nextPos(); // initialize min Pos.\n boolean isEndOfDoc = false;\n while(!isEndOfDoc) {\n if(minPos == -1) break; // End of document. Move to next doc\n for (int i = 0; i < children.size(); i++) {\n int pos = children.get(i).nextPos();\n if(pos == -1){\n isEndOfDoc = true;\n break;\n }\n if (pos < minPos) {\n minPos = pos;\n minPosIndex = i;\n }\n }\n if(isEndOfDoc) break;\n /* Check for window size against min pos */\n for (int i = 0; i < children.size(); i++) {\n int pos = children.get(i).nextPos();\n\n if (pos - minPos < distance) {\n // Valid candidate so far.\n // check if last term.\n if (i == children.size() - 1) {\n tempList.add(children.get(minPosIndex).nextPos());\n fkid++;\n // update all the child node pointers to next position. No double dipping\n for(QueryNode child : children)\n child.updatePos();\n\n\n }\n\n } else {\n // Candidate failed.\n // update minimum position to next pos and repeat process\n children.get(minPosIndex).updatePos();\n minPos = children.get(minPosIndex).nextPos();\n break;\n\n }\n }\n\n }\n\n\n /* The document has been consumed. If the temp List size is > 2, we have collected windows.\n Add them to the posting list.\n */\n if (tempList.size() > 2) {\n tempList.set(1, fkid);\n cqi += fkid;\n postingList.addAll(new ArrayList<>(tempList));\n }\n }\n// if(moveToNextDoc) continue;\n children.get(0).updateToNextDoc();\n }\n }", "public List<DictionaryData> frequencyOrderedList() {\n List<DictionaryData> wordlist = alphabeticalList();\r\n\r\n //using insertion sort\r\n int j;\r\n DictionaryData k;\r\n for (int i = 1; i < wordlist.size(); i++) {\r\n j = i;\r\n\r\n while (j > 0 && compare_dictdata(wordlist.get(j), wordlist.get(j - 1))) {\r\n k = wordlist.get(j);\r\n wordlist.set(j, wordlist.get(j - 1));\r\n wordlist.set(j - 1, k);\r\n j--;\r\n\r\n }\r\n //i++;\r\n }\r\n return wordlist;\r\n }", "public PostingList(int df, int N)\n {\n documentFrequency = df;\n totalNoOfDocuments = N;\n }", "public void sortCount() {\n\t\tfor(Entry<String, TreeMap<String, Integer>> entry:map.entrySet()){\r\n\t\t\tTreeMap<String, Integer> tmap = entry.getValue();\r\n\t\t\tList<Entry<String, Integer>> sorttmap = MapSort.sortMapByIntegerValue(tmap);\r\n\t\t\t int flag=0;\r\n for(Entry<String, Integer> word:sorttmap){ \r\n \tflag++;\r\n \tkeyword.add(word.getKey());\r\n// System.out.println(mapping.getKey()+\":\"+mapping.getValue()); \r\n \tif(flag==5)\r\n \t\tbreak;\r\n } \r\n\t\t}\r\n\t\r\n\t}", "public static WordFrq[] sort(WordFrq b[]){\n WordFrq temp;\n int i=0;\n while (i < 3) {\n for (i = 1; i < 3; i++) {\n if (b[i-1].count > b[i].count) {\n temp = b[i];\n b[i] = b[i-1];\n b[i-1] = temp;\n break;\n }\n }\n }\n\n\n return b;\n\n\n\n\n\n }", "private static void sortSlidesByNumberTags() {\n\t\tCollections.sort(slideList, new Comparator<Slide>() {\n\t\t\tpublic int compare(Slide s1, Slide s2) {\n\n\t\t\t\tInteger sS1 = s1.getTagList().size();\n\t\t\t\tInteger sS2 = s2.getTagList().size();\n\n\t\t\t\tint sComp = sS1.compareTo(sS2);\n\n\t\t\t\treturn -1 * sComp;\n\t\t\t}\n\t\t});\n\t}", "public void sortWordTokens (String [] list, int count){\n \n String[] sortedWordsCopy = new String[count];\n \n \n //Makes a copy of list and stores it in sortedWordsCopy\n for (int i = 0; i < count; i++)\n sortedWordsCopy[i] = list[i];\n \n //Sorts sortedWordsCopy which is a copy of list\n Arrays.sort(sortedWordsCopy);\n \n //Copies the sorted list back out to list\n for (int i = 0; i < count; i++)\n list[i] = sortedWordsCopy[i];\n \n }", "public void sortGivenArray_popularity() { \n int i, j, k; \n for(i = movieList.size()/2; i > 0; i /= 2) {\n for(j = i; j < movieList.size(); j++) {\n Movie key = movieList.get(j);\n for(k = j; k >= i; k -= i) {\n if(key.rents > movieList.get(k-i).rents) {\n movieList.set(k, movieList.get(k-i));\n } else {\n break; \n }\n }\n movieList.set(k, key);\n }\n } \n }", "private static void sortPhotosByNumberTags() {\n\t\tCollections.sort(photoList, new Comparator<Photo>() {\n\t\t\tpublic int compare(Photo p1, Photo p2) {\n\n\t\t\t\tInteger s1 = p1.getTagList().size();\n\t\t\t\tInteger s2 = p2.getTagList().size();\n\n\t\t\t\tint sComp = s1.compareTo(s2);\n\n\t\t\t\treturn -1 * sComp;\n\t\t\t}\n\t\t});\n\t}", "private void sortMedApts(List<MedicationAppointment> medApts2) {\n \t}", "public void sortByQnNum() {\r\n\t\tfor (int j = 0; j < displayingList.size() - 1; j++) {\r\n\t\t\tfor (int i = 0; i < displayingList.size() - j - 1; i++) {\r\n\t\t\t\tif (displayingList.get(i).getQnNum() > displayingList.get(i + 1).getQnNum()) {\r\n\t\t\t\t\tswapPosition(displayingList, i, i + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static PriorityQueue<WordCount> sortWords(HashMap<String, Integer> counts){\n\t\tPriorityQueue<WordCount> words = new PriorityQueue<WordCount>(99999, new wordCountComparator());\n\t\tWordCount wc = null;\n\t\tfor(Map.Entry<String, Integer> entry : counts.entrySet()){\n\t\t\twc = new WordCount(entry.getKey(), entry.getValue());\n\t\t\twords.add(wc);\n\t\t}\n\t\treturn words;\n\t}", "private static void sortNoun() throws Exception{\r\n\t\tBufferedReader[] brArray = new BufferedReader[ actionNumber ];\r\n\t\tBufferedWriter[] bwArray = new BufferedWriter[ actionNumber ];\r\n\t\tString line = null;\r\n\t\tfor(int i = 0; i < actionNameArray.length; ++i){\r\n\t\t\tSystem.out.println(\"sorting for \" + actionNameArray[ i ]);\r\n\t\t\tbrArray[ i ] = new BufferedReader( new FileReader(TFIDF_URL + actionNameArray[ i ] + \".tfidf\"));\r\n\t\t\tHashMap<String, Double> nounTFIDFMap = new HashMap<String, Double>();\r\n\t\t\tint k = 0;\r\n\t\t\t// 1. Read tfidf data\r\n\t\t\twhile((line = brArray[ i ].readLine())!=null){\r\n\t\t\t\tnounTFIDFMap.put(nounList.get(k), Double.parseDouble(line));\r\n\t\t\t\tk++;\r\n\t\t\t}\r\n\t\t\tbrArray[ i ].close();\r\n\t\t\t// 2. Rank according to tfidf\r\n\t\t\tValueComparator bvc = new ValueComparator(nounTFIDFMap);\r\n\t\t\tTreeMap<String, Double> sortedMap = new TreeMap<String, Double>(bvc);\r\n\t\t\tsortedMap.putAll(nounTFIDFMap);\r\n\t\t\t\r\n\t\t\t// 3. Write to disk\r\n\t\t\tbwArray[ i ] = new BufferedWriter(new FileWriter( SORTED_URL + actionNameArray[ i ] + \".sorted\"));\r\n\t\t\tfor(String nounKey : sortedMap.keySet()){\r\n\t\t\t\tbwArray[ i ].append(nounKey + \"\\t\" + nounTFIDFMap.get(nounKey) + \"\\n\");\r\n\t\t\t}\r\n\t\t\tbwArray[ i ].close();\r\n\t\t}\r\n\t}", "static void sortByFreq(int arr[], int n){\n Map<Integer, Integer> map = new HashMap<>(); \n List<Integer> outputArray = new ArrayList<>(); \n \n // Assign elements and their count in the list and map \n for (int current : arr) { \n int count = map.getOrDefault(current, 0); \n map.put(current, count + 1); \n outputArray.add(current); \n } \n \n // Compare the map by value \n SortComparator comp = new SortComparator(map); \n \n // Sort the map using Collections CLass \n Collections.sort(outputArray, comp); \n \n // Final Output \n for (Integer i : outputArray) { \n System.out.print(i + \" \"); \n }\n }", "private List<Article> orderArticles(List<Article> things){\n\t\t Comparator<Article> comparatorPrizes = new Comparator<Article>() {\n\t public int compare(Article x, Article y) {\n\t return (int) (x.getPrize() - y.getPrize());\n\t }\n\t };\n\t Collections.sort(things,comparatorPrizes); \n\t Collections.reverse(things);\n\t return things;\n\t }", "public void sortByTagCount() {\r\n this.addSortField(\"\", \"*\", SORT_DESCENDING, \"count\");\r\n }", "public void sort() {\n\t\tArrays.sort(contactList, 0, contactCounter);\n\t}", "public static void sortByPlaceCount(List<Apartment> apartments) {\n Collections.sort(apartments, SORT_BY_PLACE_COUNT);\n }", "public String frequencySort(String s) {\n\n\t\t// prepare a frequency map\n\t\tMap<Character, Integer> m = new HashMap<Character, Integer>();\n\t\tfor (char c : s.toCharArray())\n\t\t\tm.put(c, m.getOrDefault(c, 0) + 1);\n\n\t\tPriorityQueue<CKEntry1> pq = new PriorityQueue<>();\n\t\tfor (Entry<Character, Integer> e : m.entrySet()) {\n\t\t\tpq.add(new CKEntry1(e.getKey(), e.getValue()));\n\t\t}\n\t\t\n\t\t// prepare the output now\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile(!pq.isEmpty()) {\n\t\t\tCKEntry1 temp = pq.poll();\n\t\t\tchar[] tempC = new char[temp.count];\n\t\t\tArrays.fill(tempC, temp.c); // repeat c count' times\n\t\t\tsb.append(tempC);\n\t\t}\n\t\t\n\t\treturn sb.toString();\n\n\t}", "protected HashMap<String,Double> rank(ArrayList<String> queryPostingLines, ArrayList<String> query){\n HashMap<String,HashMap<String,Integer>> queryWordsTFPerDoc = computeTFForQueryWords(queryPostingLines);\n ArrayList<String> retrievedDocuments = new ArrayList<>(queryWordsTFPerDoc.keySet());\n HashMap<String,Double> rankedDocs = new HashMap<>();\n\n for(String doc : retrievedDocuments){\n HashMap<String,Integer> docTFs = queryWordsTFPerDoc.get(doc);\n double rank = 0.3*rankByBM25(query,doc,docTFs) + 0.7*rankByPosition(query,doc,queryPostingLines);// - rankByCosSim(query,doc,docTFs);\n rankedDocs.put(doc,rank);\n }\n rankedDocs = sortByValue(rankedDocs);\n ArrayList<String> docsAfterSort = new ArrayList<>(rankedDocs.keySet());\n HashMap<String,Double> docsToRetrieve = new HashMap<>();\n int i=0;\n for(String doc: docsAfterSort){\n docsToRetrieve.put(documentDetails.get(doc)[0],rankedDocs.get(doc));\n i++;\n if(i == 50)\n break;\n }\n return docsToRetrieve;\n }", "private static void SortHash(HashMap<String,ArrayList<input>> hashMap,Distribution list)\n\t{\n\t\tCollections.sort(list.First, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Second, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Third, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fourth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fifth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.reverse(list.First);\n\t\tCollections.reverse(list.Second);\n\t\tCollections.reverse(list.Third);\n\t\tCollections.reverse(list.Fourth);\n\t\tCollections.reverse(list.Fifth);\n\t\tputInHashMap(hashMap,list);\n\t}", "protected void sort() {\n\n\t\tCollections.sort(this.myRRList);\n\t}", "public static void main(String[] args) {\n\r\n\t\tint arr[]={2, 3, 2, 4, 5, 12, 2, 3, 3, 3, 12};\r\n\t\tMap<Integer,Data> map = new HashMap<>();\r\n\t\tfor(int a :arr)\r\n\t\t{\r\n\t\t\tif(map.containsKey(a))\r\n\t\t\t{\r\n\t\t\t\tmap.get(a).incrementFrequency();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tmap.put(a, new Data(a));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tSet<Data> sortedData = new TreeSet<>(map.values());\r\n\t\tList<Integer> result = new ArrayList<>();\r\n\t\tfor(Data d : sortedData)\r\n\t\t{\r\n\t\t\tfor(int i=0;i<d.frequency;i++)\r\n\t\t\t\tresult.add(d.number);\r\n\t\t}\r\n\t\tSystem.out.println(result);\r\n\t}", "public void sortAppointments() {\n reminders = sort(reminders);\n followup = sort(followup);\n }", "public static void rankFiles(Hashtable<?, Integer> fname, int numberOfOccurrences) \r\n\t{\n\t\tArrayList<Map.Entry<?, Integer>> arrayList = new ArrayList(fname.entrySet());\r\n\r\n\t\tCollections.sort(arrayList, new Comparator<Map.Entry<?, Integer>>() \r\n\t\t{\r\n\t\t\tpublic int compare(Map.Entry<?, Integer> obj1, Map.Entry<?, Integer> obj2) \r\n\t\t\t{\r\n\t\t\t\treturn obj1.getValue().compareTo(obj2.getValue());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tCollections.reverse(arrayList);\r\n\r\n\t\tif (numberOfOccurrences > 0) \r\n\t\t{\r\n\t\t\tSystem.out.println(\"\\n------Top 10 search results-----\\n\");\r\n\r\n\t\t\tint my_number = 10;\r\n\t\t\tint j = 1;\r\n\t\t\twhile (arrayList.size() > j && my_number > 0) \r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"(\" + j + \") \" + arrayList.get(j) + \" times \");\r\n\t\t\t\tj++;\r\n\t\t\t\tmy_number--;\r\n\t\t\t}\r\n\t\t} \r\n\t}", "public String[] topHotWords( int count ){\r\n //If the number put in the arguments is greater than the number of distinct hotwords\r\n //in the document, limit it to distinctCount\r\n if (count > distinctCount()){\r\n count = distinctCount();\r\n }\r\n //Creating the array that will hold all the hotwords in order of number of appearances \r\n String[] topWord = new String[words.size()];\r\n //This is the subset of the array above that will return the amount specified by the count argument\r\n String[] output = new String[count];\r\n //Fills the array with blank strings\r\n Arrays.fill(topWord, \"\");\r\n //Iterator for moving through topWord for assignment\r\n int iterator = 0;\r\n //Loop through every hotword in words and puts those words in topWord\r\n for(String key: words.keySet()){\r\n topWord[iterator] = key;\r\n iterator++;\r\n }\r\n //Sorts the words in topword\r\n for(int i = 0; i < words.size(); i++){\r\n for(int j = words.size()-1; j > 0; j-- ){\r\n \r\n if(count(topWord[j]) > count(topWord[i])){\r\n String temp = topWord[i];\r\n topWord[i] = topWord[j];\r\n topWord[j] = temp;\r\n }\r\n \r\n }\r\n }\r\n //Does a secondary check to be certain all words are in proper appearance number order\r\n for(int i = words.size()-1; i >0; i--){\r\n if(count(topWord[i]) > count(topWord[i-1])){\r\n String temp = topWord[i];\r\n topWord[i] = topWord[i-1];\r\n topWord[i-1] = temp;\r\n }\r\n }\r\n //Orders the words with the same number of appearances by order of appearance in the document\r\n for (int i = 0; i < words.size(); i++){\r\n for(int j = i+1; j < words.size(); j++){\r\n if (count(topWord[i]) == count(topWord[j])){\r\n if (consec.indexOf(topWord[j]) < consec.indexOf(topWord[i])){\r\n String temp = topWord[i];\r\n topWord[i] = topWord[j];\r\n topWord[j] = temp;\r\n }\r\n }\r\n }\r\n }\r\n //Gets the subset requested for return\r\n for (int i = 0; i < count; i++){\r\n output[i] = topWord[i];\r\n }\r\n return output;\r\n\t}", "public void getWordFrequency(ArrayList<String> out_words, ArrayList<Integer> out_counts) {\n //... Put in ArrayList so sort entries by frequency\n ArrayList<Map.Entry<String, MutableInteger>> entries =\n new ArrayList<Map.Entry<String, MutableInteger>>(wordFrequency.entrySet());\n Collections.sort(entries, new ComparatorFrequency());\n\n //... Add word and frequency to parallel output ArrayLists.\n for (Map.Entry<String, MutableInteger> ent : entries) {\n out_words.add(ent.getKey());\n out_counts.add(ent.getValue().getValue());\n }\n }", "@Override\n public void sort() {\n\n List<Doctor> unsortedDocs = this.doctors;\n\n Collections.sort(unsortedDocs, new Comparator<Doctor>() {\n @Override\n public int compare(Doctor a, Doctor b) {\n //Compare first name for doctors and re-arrange list\n return a.getFirstName().compareTo(b.getFirstName());\n }\n });\n \n this.doctors = unsortedDocs;\n\n }", "private List<List<Record>> sortRecordsBy(List<Record> unsortedRecords, RankingType rankingType) {\n Comparator<Long> comparator = rankingType.isDescending()\n ? Comparator.reverseOrder()\n : Comparator.naturalOrder();\n SortedMap<Long, List<Record>> scoreGroups = new TreeMap<>(comparator);\n for (Record record : unsortedRecords) {\n Long score = rankingType.getScoreFunction().apply(record);\n if (scoreGroups.containsKey(score)) {\n scoreGroups.get(score).add(record);\n } else {\n scoreGroups.put(score, new LinkedList<>());\n scoreGroups.get(score).add(record);\n }\n }\n\n return new ArrayList<>(scoreGroups.values());\n }", "Results sortResults(FilterSpecifier.ListBy listBy, SortSpecifier sortspec) throws SearchServiceException;", "void documentFrequncy(Set<String> features,\n int index,\n int troush\n ) {\n for (String str : features) {\n switch (index) {\n case 1:\n for (int i = 0; i < count1; i++) {\n if (economydocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyeco.put(str, e);\n }\n e = 0;\n break;\n case 2:\n for (int i = 0; i < count2; i++) {\n if (educationdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyedu.put(str, e);\n }\n e = 0;\n break;\n case 3:\n for (int i = 0; i < count3; i++) {\n if (sportdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyspo.put(str, e);\n }\n e = 0;\n break;\n case 4:\n for (int i = 0; i < count4; i++) {\n if (culturedocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencycul.put(str, e);\n }\n e = 0;\n break;\n case 5:\n for (int i = 0; i < count5; i++) {\n if (accedentdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyaccid.put(str, e);\n }\n e = 0;\n break;\n case 6:\n for (int i = 0; i < count6; i++) {\n if (environmntaldocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyenv.put(str, e);\n }\n e = 0;\n break;\n case 7:\n for (int i = 0; i < count7; i++) {\n if (foreign_affairdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencydep.put(str, e);\n }\n e = 0;\n break;\n case 8:\n for (int i = 0; i < count8; i++) {\n if (law_justicedocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencylaw.put(str, e);\n }\n e = 0;\n break;\n case 9:\n for (int i = 0; i < count9; i++) {\n if (agriculture[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyagri.put(str, e);\n }\n e = 0;\n break;\n case 10:\n for (int i = 0; i < count10; i++) {\n if (politicsdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencypoltics.put(str, e);\n }\n e = 0;\n break;\n// case 11:\n//\n// for (int i = 0; i < count11; i++) {\n// if (social_affairsdocument[i].contains(str)) {\n// e++;\n// }\n// }\n// if (e > troush) {\n// documntfrequencysocial.put(str, e);\n// }\n// e = 0;\n// break;\n case 11:\n for (int i = 0; i < count12; i++) {\n if (science_technologydocument[i].contains(str)) {\n e++;\n }\n }\n\n if (e > troush) {\n documntfrequencysci.put(str, e);\n }\n e = 0;\n break;\n case 12:\n for (int i = 0; i < count13; i++) {\n if (healthdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyhel.put(str, e);\n }\n e = 0;\n break;\n case 13:\n for (int i = 0; i < count14; i++) {\n if (army[i].contains(str)) {\n e++;\n }\n }\n\n if (e > troush) {\n documntfrequencyarmy.put(str, e);\n }\n e = 0;\n break;\n default:\n break;\n }\n\n }\n }", "public void sortKnowledgeBase()\n {\n int i;\n Random random;\n String aPredicate;\n StringTokenizer tokenizer;\n //------------\n random = new Random();\n i = 0;\n while (i < knowledgeBase.size())\n {\n aPredicate = knowledgeBase.get(i).commitments.get(0).predicate;\n tokenizer = new StringTokenizer(aPredicate,\"(), \");\n if(tokenizer.nextToken().equals(\"secuencia\"))\n knowledgeBase.get(i).priority = random.nextInt(100);\n //end if\n else\n knowledgeBase.get(i).priority = random.nextInt(10000);\n //end else\n i = i + 1;\n }//end while\n Collections.sort(knowledgeBase);\n }", "public static void DocumentFrequencies() throws FileNotFoundException {\n for (Entry<String, List<Integer>> entry : dictionary.entrySet()) {\n List<Integer> termfrequency = new ArrayList<>();\n\n termfrequency = entry.getValue();\t// getting each word's termfrequency list\n int i = 0;\n termfrequency.add(0); \t\t\t//maintaining documentfrequency at the 57th index\n Integer documentFrequency = termfrequency.get(totaldocument+1);\n while(i<56) { //iterate 0 to 55 all speeches term frequency\n if(termfrequency.get(i)>0) {\t\t//increment document frequency of that word if termfrequency is greater than 0.0\n documentFrequency++;\t\t\t//increment document frequency\n }\n i++;\t\t//increment index\n }\n termfrequency.set(57, documentFrequency);\t//re-set the documentfrequency and save the current maintained document frequency from 0 to calculated value\n dictionary.put(entry.getKey(), termfrequency);\t\t// place the incremented final value of that word back to the same list in dictionary hashmap\n }\n //save();\n }", "private static String frequencySort(String s) {\n if (s == null || s.isEmpty()) { return s; }\n\n int[] freq = new int[256];\n for (char c : s.toCharArray()) {\n freq[c]++;\n }\n\n PriorityQueue<Pair<Character, Integer>> pq = new PriorityQueue<>((a, b) -> b.getValue() - a.getValue());\n for (int i = 0; i < freq.length; i++) {\n if (freq[i] == 0) { continue; }\n Pair<Character, Integer> pair = new Pair<>((char) (i), freq[i]);\n pq.offer(pair);\n }\n\n StringBuilder sb = new StringBuilder();\n while (!pq.isEmpty()) {\n Pair<Character, Integer> pair = pq.poll();\n for (int i = 0; i < pair.getValue(); i++) {\n sb.append(pair.getKey());\n }\n }\n return sb.toString();\n }", "public void sortByTopic() {\r\n\t\tfor (int i = 1; i < displayingList.size(); i++) {\r\n\t\t\tQuestion temp = displayingList.get(i);\r\n\t\t\tfor (int j = i - 1; j >= 0; j--) {\r\n\t\t\t\tif (String.CASE_INSENSITIVE_ORDER.compare(temp.getTopic(), displayingList.get(j).getTopic()) < 0) {\r\n\t\t\t\t\tdisplayingList.set(j + 1, displayingList.get(j));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdisplayingList.set(j + 1, temp);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tdisplayingList.set(j, temp);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void sort() {\n ScoreComparator comparator = new ScoreComparator();\n Collections.sort(scores, comparator);\n }", "private void updateDocPostingList(int docId){\n int i = getIndexForDocument(docId);\n if(i==-1){\n // document does not exist in posting list. Error out.\n System.err.println(\"Document not in List\");\n updateDocPostingList(this.postingList.get(0));\n }\n int size = this.postingList.get(i+1);\n this.docPostingList = new int[size];\n int k = 0;\n for(int j = i+2; j<size+i+2;j++)\n this.docPostingList[k++] = this.postingList.get(j);\n this.pos = 0;\n\n }", "private List<? extends Publication> sortPublicationsAfterTitle(Collection<? extends Publication> publicationList) {\n\n return publicationList.stream().sorted(Comparator.comparing(Publication::getTitle)).collect(Collectors.toList());\n }", "void comparatorSort() {\n Collections.sort(vendor, Vendor.sizeVendor); // calling collection sort method and passing list and comparator variables\r\n for (HDTV item : vendor) { //looping arraylist\r\n System.out.println(\"Brand: \" + item.brandname + \" Size: \" + item.size);\r\n }\r\n }", "private void sort() {\n Collections.sort(mEntries, new Comparator<BarEntry>() {\n @Override\n public int compare(BarEntry o1, BarEntry o2) {\n return o1.getX() > o2.getX() ? 1 : o1.getX() < o2.getX() ? -1 : 0;\n }\n });\n }", "public HashMap<Integer, Integer> readFreqPosting(IndexReader indexReader, String fieldName, String term) throws IOException {\n\n\t\tHashMap<Integer, Integer> listOfFreqSortedByDocID = new HashMap<>();\n\t\tSystem.out.printf( \"%-10s%-15s%-6s\\n\", \"DOCID\", \"URL\", \"FREQ\" );//Reads the posting list of the term in a specific index field. You need to encode the term into a BytesRef object, which is the internal representation of a term used by Lucene.\n\t\tPostingsEnum posting = MultiFields.getTermDocsEnum( indexReader, fieldName, new BytesRef( term ), PostingsEnum.FREQS );\n\n\t\tif ( posting != null ) { // if the term does not appear in any document, the posting object may be null\n\t\t\tint docid;\n\t\t\twhile ( ( docid = posting.nextDoc() ) != PostingsEnum.NO_MORE_DOCS ) {//Each time you call posting.nextDoc(), it moves the cursor of the posting list to the next position and returns the docid of the current entry (document). Note that this is an internal Lucene docid. It returns PostingsEnum.NO_MORE_DOCS if you have reached the end of the posting list.\n\t\t\t\tString url = getDocno( indexReader, \"url\", docid );\n\t\t\t\tint freq = posting.freq(); // get the frequency of the term in the current document\n\t\t\t\tlistOfFreqSortedByDocID.put(docid, freq);\n\t\t\t\tSystem.out.printf( \"%-10d%-15s%-6d\\n\", docid, url, freq );\n\t\t\t}\n\t\t}\n\n\t\treturn listOfFreqSortedByDocID;\n\t}", "public static void main(String args[]){\r\n\t\t\r\n\t\t\r\n\t\tint arr[] = {2,5,2,8,5,6,8,8};\r\n\t\t\r\n\t\tMap<Integer, Integer> freqMap = new LinkedHashMap<Integer,Integer>();\r\n\t\t\r\n\t\tfor(int i = 0; i< arr.length;i++){\r\n\t\t\tif(freqMap.containsKey(arr[i])){\r\n\t\t\t\tint count = freqMap.get(arr[i]);\r\n\t\t\t\tfreqMap.put(arr[i],count + 1);\r\n\t\t\t}else{\r\n\t\t\t\tfreqMap.put(arr[i], 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//2-2,5-2,6-1,8-3\r\n\t\t\r\n\t\tMap<Integer,ArrayList<Integer>> sortedList = new TreeMap<Integer, ArrayList<Integer>>(new Comparator<Integer>(){\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(Integer arg0, Integer arg1) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\treturn arg1.compareTo(arg0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tfor(Entry<Integer, Integer> entry : freqMap.entrySet()){\r\n\t\t\tint key = entry.getKey();\r\n\t\t\tint val = entry.getValue();\r\n\t\t\tif(sortedList.containsKey(val)){\r\n\t\t\t\tArrayList<Integer> list = sortedList.get(val);\r\n\t\t\t\tfor(int j = 0; j<val ; j++)\r\n\t\t\t\t\tlist.add(key);\r\n\t\t\t}else{\r\n\t\t\t\tArrayList<Integer> list = new ArrayList<Integer>();\r\n\t\t\t\tfor(int j = 0; j<val ; j++)\r\n\t\t\t\t\tlist.add(key);\r\n\t\t\t\tsortedList.put(val, list);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(sortedList.values());\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public static String Sorts(Map<Integer,Double> docsInfo) {\n Map<Integer, Double> sorted = docsInfo.entrySet().stream().sorted(Map.Entry.comparingByValue()).collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue(), (e1, e2) -> e2,\n LinkedHashMap::new));\n String ans = \"\";\n sorted = docsInfo\n .entrySet()\n .stream()\n .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))\n .collect(\n Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,\n LinkedHashMap::new));\n for(Map.Entry<Integer, Double> en : sorted.entrySet()) {\n ans = ans + (\"doc.Id ---> \" + en.getKey() +\"\\n\");\n }\n GUI.count = String.valueOf(sorted.size());\n return ans;\n }", "public CountryList sortByCount() {\n\t\tCountryList sorted = new CountryList();\n\t\tfor (int i = 0; i < this.nextAvailable; i++)\n\t\t\tsorted.binInsert(new Country(this.countries.get(i)));\n\t\tsorted.totalCount = this.totalCount;\n\t\treturn sorted;\n\t}", "SortComparator(Map<Integer, Integer> tFreqMap) { \n this.freqMap = tFreqMap; \n }", "public static List<String> sortUniqueWords(HashMap<String, Integer> tracker, List<String> allWords) {\n List<Integer> frequency = new ArrayList<>(tracker.values());\n frequency.sort(Collections.reverseOrder());\n List<String> result = new ArrayList<>();\n\n while(!tracker.isEmpty()){\n for (String key : allWords) {\n if(frequency.size()!= 0 && frequency.get(0) == tracker.get(key)){\n frequency.remove(0);\n\n result.add(key + \" \" + tracker.get(key));\n tracker.remove(key);\n }\n\n }\n }\n return result;\n\n\n }", "private List<StringCountDto> getSortedStatistics() {\n return STRING_STATISTICS.entrySet()\n .stream()\n .sorted(Map.Entry.<String, CounterInfo>comparingByValue().reversed())\n .map(entry -> new StringCountDto(entry.getKey(), entry.getValue().getCount()))\n .collect(Collectors.toList());\n }", "public static void main(String[] args) {\n String s = \"9988777yyhhgfvvvvvvddsseeeeww3344\";\n System.out.println(frequencySort(s));\n }", "private static HashMap<String,Integer> sortByEditDistance(String keyword, PreSearch ps) {\r\n\t\tHashMap<String, Integer> indexDistance = new HashMap<String,Integer>();\r\n\t\tIterator<Entry<String,HashSet<Integer>>> iterator = ps.index.entrySet().iterator();\r\n\t\twhile(iterator.hasNext()) \r\n\t\t{ \t\t\t\r\n\t\t\tMap.Entry<String, HashSet<Integer>> me = (Map.Entry<String, HashSet<Integer>>)iterator.next();\r\n\t\t\tString word = me.getKey().toString();\t\t\t\r\n\t\t\tint distance = Sequences.editDistance(word, keyword);\r\n\t\t\tif(distance<3 && distance!=0) {\r\n\t\t\t\tindexDistance.put(word, distance);\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tHashMap<String,Integer> sortedDistance = SortResultsByRank.sortValues(indexDistance);\r\n\t\treturn sortedDistance;\r\n\t}", "public static void getHotItems(int k) throws IOException {\r\n\t\twlist = new ArrayList();\r\n\t\twlist.clear();\r\n\t\tBufferedReader input = new BufferedReader(new FileReader(\r\n\t\t\t\t\"frequency.txt\"));\r\n\t\tString buff = input.readLine();\r\n\t\t// \"sssss#xxx\\n\"\r\n\t\twhile (buff != null) {\r\n\t\t\tString str[] = buff.split(\"#\");\r\n\t\t\tWord w = new Word(str[0]);\r\n\t\t\tw.setfreq(Integer.parseInt(str[1]));\r\n\t\t\twlist.add(w);\r\n\t\t\tbuff = input.readLine();\r\n\t\t}\r\n\t\tinput.close();\r\n\t\tsort(k);\r\n\t\tfor (int i = 0; i < k; i++) {\r\n\t\t\tSystem.out.print(wlist.get(i).getval() + \"|\");\r\n\t\t}\r\n\t}", "public void sortElements(){\n\t\tgetInput();\n\t\tPeople[] all = countAndSort(people, 0, people.length-1);\n\t\t//PrintArray(all);\n\t\tSystem.out.println(InversionCount);\n\t}", "public static void main(String[] args) {\n\n\t\tList<String> list = Arrays.asList(\"I\", \"Love\", \"Word\", \"I\", \"Love\");\n\t\tMap<String, Long> map = list.stream()\n\t\t\t\t.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));\n\t\t//map.entrySet().stream().sorted(Comparator.(Entry.comparingByValue()).thenComparing(Entry.comparingByKey()))\n\t\t// I - 2, \"Word\" -1, \"Love\"- 2\n\t\t\n\t}", "private static void performSort(TestApp testApp) {\n testApp.testPartition();\n\n /*\n Date end = new Date();\n System.out.println(\"Sort ended @ \" + end.getTime());\n System.out.println(\"Total time = \" + (end.getTime() - start.getTime())/1000.0 + \" seconds...\");\n */\n }", "public void sortMarkers() {\n\t\tCollections.sort(getMarkerSet().getMarkers(),\r\n\t\t\t\tnew MarkerTimeComparator());\r\n\t\t// log.debug(\"[sortMarkers]after: \" + getMarkerSet().getMarkers());\r\n\r\n\t}", "private void printingSearchResults() {\n HashMap<Integer, Double> resultsMap = new HashMap<>();\n for (DocCollector collector : resultsCollector) {\n if (resultsMap.containsKey(collector.getDocId())) {\n double score = resultsMap.get(collector.getDocId()) + collector.getTermScore();\n resultsMap.put(collector.getDocId(), score);\n } else {\n resultsMap.put(collector.getDocId(), collector.getTermScore());\n }\n }\n List<Map.Entry<Integer, Double>> list = new LinkedList<>(resultsMap.entrySet());\n Collections.sort(list, new Comparator<Map.Entry<Integer, Double>>() {\n public int compare(Map.Entry<Integer, Double> o1,\n Map.Entry<Integer, Double> o2) {\n return (o2.getValue()).compareTo(o1.getValue());\n }\n });\n if (list.isEmpty())\n System.out.println(\"no match\");\n else {\n DecimalFormat df = new DecimalFormat(\".##\");\n for (Map.Entry<Integer, Double> each : list)\n System.out.println(\"docId: \" + each.getKey() + \" score: \" + df.format(each.getValue()));\n }\n\n }", "private static void sortingArrayList() {\n Collections.sort(allMapData, new Comparator<MapDataModel>() {\n public int compare(MapDataModel d1, MapDataModel d2) {\n return valueOf(d1.getDateTime().compareTo(d2.getDateTime()));\n }\n });\n }", "public void sort() {\r\n // sort the process variables\r\n Arrays.sort(pvValues, categoryComparator);\r\n fireTableDataChanged();\r\n }", "private void sortDate()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getReleaseDate().compareTo(b.getReleaseDate());\n if( result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "private void sortByDate(List<Entry> entries) {\n\t\t\n\t\tCollections.sort(entries, new Comparator<Entry>() {\n\t\t\tpublic int compare(Entry o1, Entry o2) {\n\t\t\t if (o1.getTimestamp() == null || o2.getTimestamp() == null)\n\t\t\t return 0;\n\t\t\t return o1.getTimestamp().compareTo(o2.getTimestamp());\n\t\t\t }\n\t\t\t});\n\t}", "public void sort()\n {\n\tstrack.sort((Node n1, Node n2) ->\n\t{\n\t if (n1.getCost() < n2.getCost()) return -1;\n\t if (n1.getCost() > n2.getCost()) return 1;\n\t return 0;\n\t});\n }", "public Map<String, Integer> getWordFrequencies(SortOrder sortBy) {\n ArrayList<Map.Entry<String, MutableInteger>> entries =\n new ArrayList<Map.Entry<String, MutableInteger>>(wordFrequency.entrySet());\n if (sortBy == SortOrder.ALPHABETICALLY_ASCENDING) {\n Collections.sort(entries, SORT_ALPHABETICALLY_ASCENDING);\n } else {\n Collections.sort(entries, SORT_BY_FREQUENCY_DESCENDING);\n }\n \n Map<String, Integer> wordFrequencies = new HashMap<String, Integer>();\n ValueComparator bvc = new ValueComparator(wordFrequencies);\n TreeMap<String, Integer> sorted_map = new TreeMap(bvc);\n \n for (Map.Entry<String, MutableInteger> entry : entries) {\n wordFrequencies.put(entry.getKey(), entry.getValue().getInteger());\n }\n \n sorted_map.putAll(wordFrequencies);\n\n return sorted_map;\n }", "public void listSort() {\n\t\tCollections.sort(cd);\n\t}", "private static void sort(MongoCollection mongoCollection) {\n mongoCollection.find().sort(eq(\"name\", 1)).forEach(new Block<Document>() {\n public void apply(Document document) {\n System.out.println(document.toJson());\n }\n });\n }", "void sort();", "void sort();", "public static void pageRankmain() {\n\t\t\t\n\t\t\tstopWordStore();\n\t\t\t//File[] file_read= dir.listFiles();\n\t\t\t//textProcessor(file_read);// Will be called from LinkCrawler\n\t\t\t//queryProcess();\n\t\t\t//System.out.println(\"docsave \"+ docsave);\n\t\t\t/*for ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t List<String> values = entry.getValue();\n\t\t\t System.out.print(\"Key = \" + key);\n\t\t\t System.out.println(\" , Values = \"+ values);\n\t\t\t}*/\n\t\t\t//########## RESPOINSIBLE FOR CREATING INVERTED INDEX OF TERMS ##########\n\t\t\tfor(int i=0;i<vocabulary.size();i++) {\n\t\t\t\tint count=1;\n\t\t\t\tMap<String, Integer> nestMap = new HashMap<String, Integer>();\n\t\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t\t String keyMain = entry.getKey();\n\t\t\t\t List<String> values = entry.getValue();\n\t\t\t\t if(values.contains(vocabulary.get(i)))\n\t\t\t\t \t{\n\t\t\t\t \tentryDf.put(vocabulary.get(i), count);//entryDf stores documents frequency of vocabulary word \\\\it increase the count value for specific key\n\t\t\t\t \tcount++;\n\t\t\t\t \t}\n\t\t\t\t \n\t\t\t\t nestMap.put(keyMain, Collections.frequency(values,vocabulary.get(i)));\n\t\t\t \t\n\t\t\t \t//System.out.println(\"VOC \"+ vocabulary.get(i)+ \" KeyMain \" +keyMain+ \" \"+ Collections.frequency(values,vocabulary.get(i)));\n\t\t\t\t\t}\n\t\t\t\t\ttfList.put(vocabulary.get(i), nestMap);\n\t\t\t}\n\t\t\t//########## RESPOINSIBLE FOR CREATING A MAP \"storeIdf\" TO STORE IDF VALUES OF TERMS ##########\n\t\t\tfor ( Map.Entry<String, Integer> endf : entryDf.entrySet()) {\n\t\t\t\tString keydf = endf.getKey();\n\t\t\t\tint valdf = endf.getValue();\n\t\t\t\t//System.out.print(\"Key = \" + \"'\"+keydf+ \"'\");\n\t\t\t //System.out.print(\" , Values = \"+ valdf);\n\t\t\t double Hudai = (double) (docsave.size())/valdf;\n\t\t\t //System.out.println(\"docsave size \"+docsave.size()+ \" valdf \"+ valdf + \" Hudai \"+ Hudai+ \" log Value1 \"+ Math.log(Hudai)+ \" log Value2 \"+ Math.log(2));\n\t\t\t double idf= Math.log(Hudai)/Math.log(2);\n\t\t\t storeIdf.put(keydf, idf);\n\t\t\t //System.out.print(\" idf-> \"+ idf);\n\t\t\t //System.out.println();\n\t\t\t} \n\t\t\t\n\t\t\t//############ Just for Printing ##########NO WORK HERE########\n\t\t\tfor (Map.Entry<String, Map<String, Integer>> tokTf : tfList.entrySet()) {\n\t\t\t\tString keyTf = tokTf.getKey();\n\t\t\t\tMap<String, Integer> valTF = tokTf.getValue();\n\t\t\t\tSystem.out.println(\"Inverted Indexing by Key Word = \" + \"'\"+keyTf+ \"'\");\n\t\t\t\tfor (Map.Entry<String, Integer> nesTf : valTF.entrySet()) {\n\t\t\t\t\tString keyTF = nesTf.getKey();\n\t\t\t\t\tInteger valTf = nesTf.getValue();\n\t\t\t\t\tSystem.out.print(\" Document Consists This Key Word = \" + \"'\"+ keyTF+ \"'\");\n\t\t\t\t\tSystem.out.println(\" , Term Frequencies in This Doc = \"+ valTf);\n\t\t\t\t} \n\t\t\t}\n\t\t\t//########### FOR CALCULATING DOCUMENT LENTH #############//\n\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry_new : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t{\n\t\t\t\tString keyMain_new = entry_new.getKey();\n\t\t\t\t//int countStop=0;\n\t\t\t\tdouble sum=0;\n\t\t\t\t for(Map.Entry<String, Map<String, Integer>> tokTf_new : tfList.entrySet()) // Iterating through the vocabulary\n\t\t\t\t { \n\t\t\t\t\t Map<String, Integer> valTF_new = tokTf_new.getValue();\n\t\t\t\t\t for (Map.Entry<String, Integer> nesTf_new : valTF_new.entrySet()) // Iterating Through the Documents\n\t\t\t\t\t {\n\t\t\t\t\t\t if(keyMain_new.equals(nesTf_new.getKey())) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t double val = nesTf_new.getValue()* (Double) storeIdf.get(tokTf_new.getKey());\n\t\t\t\t\t\t\t sum = sum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t //countStop++;\n\t\t\t\t }\n\t\t\t\t docLength.put(keyMain_new, Math.sqrt(sum));\n\t\t\t\t sum=0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Document Length \"+ docLength);\n\t\t\t//System.out.println(\"tfList \"+tfList);\n\t\t\t\n\t\t\t //########### FOR CALCULATING QUERY LENTH #############///\n\t\t\t\tdouble qrySum=0;\n\t\t\t\t for(String qryTerm: queryList) // Iterating through the vocabulary\n\t\t\t\t {\n\t\t\t\t\t//entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));// VUl ase\n\t\t\t\t\t \n\t\t\t\t\t\t if(storeIdf.get(qryTerm) != null) \n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));\n\t\t\t\t\t\t\t double val = entryQf.get(qryTerm)* (Double) storeIdf.get(qryTerm);\n\t\t\t\t\t\t\t qrySum = qrySum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t System.out.println(qryTerm+\" \"+entryQf.get(qryTerm)+ \" \"+ (Double) storeIdf.get(qryTerm));\n\t\t\t\t }\n\t\t\t\t qrySum=Math.sqrt(qrySum);\n\t\t\t\t System.out.println(\"qrySum \" + qrySum);\n\t\t\t\t \n\t\t\t\t//########### FOR CALCULATING COSINE SIMILARITY #############///\n\t\t\t\t for ( Map.Entry<String, ArrayList<String>> entry_dotP : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble sumProduct=0;\n\t\t\t\t\t\tdouble productTfIdf=0;\n\t\t\t\t\t\tString keyMain_new = entry_dotP.getKey(); //Geting Doc Name\n\t\t\t\t\t\t for(Map.Entry<String, Integer> qryTermItr : entryQf.entrySet()) // Iterating through the vocabulary\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t Map<String, Integer> matchTerm = tfList.get(qryTermItr.getKey()); // Getting a map of doc Names by a Query Term as value of tfList\n\n\t\t\t\t\t\t\t\t if(matchTerm.containsKey(keyMain_new)) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t //System.out.println(\"Test \"+ matchTerm.get(keyMain_new) +\" keyMain_new \" + keyMain_new);\n\t\t\t\t\t\t\t\t\t double docTfIdf= matchTerm.get(keyMain_new) * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t double qryTfIdf= qryTermItr.getValue() * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t productTfIdf = docTfIdf * qryTfIdf;\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t sumProduct= sumProduct+productTfIdf;\n\t\t\t\t\t\t\t //System.out.println(\"productTfIdf \"+productTfIdf+\" sumProduct \"+ sumProduct);\n\t\t\t\t\t\t\t productTfIdf=0;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t cosineProd.put(entry_dotP.getKey(), sumProduct/(docLength.get(entry_dotP.getKey())*qrySum));\n\t\t\t\t\t\t sumProduct=0;\n\t\t\t\t\t\t //System.out.println(entry_dotP.getKey()+ \" \" + docLength.get(entry_dotP.getKey()));\n\t\t\t\t\t}\n\t\t\t\t System.out.println(\"cosineProd \"+ cosineProd);\n\t\t\t\t \n\t\t\t\t System.out.println(\"Number of Top Pages you want to see\");\n\t\t\t\t int topRank = Integer.parseInt(scan.nextLine());\n\t\t\t\t Map<String, Double> result = cosineProd.entrySet().stream()\n\t\t\t .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).limit(topRank)\n\t\t\t .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,\n\t\t\t (oldValue, newValue) -> oldValue, LinkedHashMap::new));\n\n\t\t\t\t scan.close();\n\t\t\t //Alternative way\n\t\t\t //Map<String, Double> result2 = new LinkedHashMap<>();\n\t\t\t //cosineProd.entrySet().stream().sorted(Map.Entry.<String, Double>comparingByValue().reversed()).limit(2).forEachOrdered(x -> result2.put(x.getKey(), x.getValue()));\n\n\t\t\t System.out.println(\"Sorted...\");\n\t\t\t System.out.println(result);\n\t\t\t //System.out.println(result2);\n\t}", "public void sort() {\r\n\t\tCollections.sort(parts);\r\n\t}", "public ArrayList<String> top5search(String kw1, String kw2) {\n\t\t/** COMPLETE THIS METHOD **/\n\t\tArrayList<String> results = new ArrayList<String>();\n\t\tArrayList<Occurrence> ocArr1 = new ArrayList<Occurrence>();\n\t\tArrayList<Occurrence> ocArr2 = new ArrayList<Occurrence>();\n\t\tArrayList<Occurrence> combined = new ArrayList<Occurrence>();\n\t\t\n\t\tif (keywordsIndex.containsKey(kw1))\n\t\t\tocArr1 = keywordsIndex.get(kw1);\n\t\t\n\t\tif (keywordsIndex.containsKey(kw2))\n\t\t\tocArr2 = keywordsIndex.get(kw2);\n\t\t\n\t\tcombined.addAll(ocArr1);\n\t\tcombined.addAll(ocArr2);\n\t\t\n\t\tif (!(ocArr1.isEmpty()) && !(ocArr2.isEmpty()))\n\t\t{\n\t\t\t// Sort with preference for ocArr1\n\t\t\tfor (int x = 0; x < combined.size()-1; x++)\n\t\t\t{\n\t\t\t\tfor (int y = 1; y < combined.size()-x; y++)\n\t\t\t\t{\n\t\t\t\t\tif (combined.get(y-1).frequency < combined.get(y).frequency)\n\t\t\t\t\t{\n\t\t\t\t\t\tOccurrence temp = combined.get(y-1);\n\t\t\t\t\t\tcombined.set(y-1, combined.get(y));\n\t\t\t\t\t\tcombined.set(y, temp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove duplicates\n\t\t\tfor (int x = 0; x < combined.size()-1; x++)\n\t\t\t{\n\t\t\t\tfor (int y = x + 1; y < combined.size(); y++)\n\t\t\t\t{\n\t\t\t\t\tif (combined.get(x).document == combined.get(y).document)\n\t\t\t\t\t\tcombined.remove(y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Top 5\n\t\twhile (combined.size() > 5)\n\t\t\tcombined.remove(combined.size()-1);\n\t\t\n\t\t//System.out.println(combined);\n\t\t\n\t\tfor (Occurrence oc : combined)\n\t\t\tresults.add(oc.document);\n\n\t\treturn results;\n\t\n\t\t\n\t\t// following line is a placeholder to make the program compile\n\t\t// you should modify it as needed when you write your code\n\t\n\t}", "public PostingsList ranked_query(Query query, double w, double idf_threshold){\n long startTime = System.nanoTime();\n PostingsList result = new PostingsList();\n\n // Obtain union of terms above idf threshold if indexElimination is true\n // (Set idf_threshold to zero to disable this feature)\n Set<String> termsToConsider = this.queryTermsConsidered(query, idf_threshold);\n result = this.union_query(query, termsToConsider);\n //System.err.println(\"Size of result is \" + result.size());\n\n long estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Union took: \" + estimatedTime);\n\n\n /*\n * 2) Iterate over PostingsEntries and build the solution\n */\n startTime = System.nanoTime();\n // Required when iterating over a PostingsList\n PostingsEntry postEnt = new PostingsEntry();\n // Number of documents in the collection\n double nDocs = this.docIDs.size();\n // Weight of a query vector coefficient\n double w_query_term;\n // Document tf-idf variables\n double termFrequency_doc, documentFrequency_doc, w_doc_term;\n\n for(String term : termsToConsider){\n // Obtain idf of the term\n documentFrequency_doc = Math.log(nDocs/new Double(this.idfMap.get(term)));\n\n // Obtain weight of the term\n w_query_term = query.weights.get(term);\n // Iterate over all documents containing the term and update the score(q,d)\n Iterator<PostingsEntry> it_d = result.iterator();\n while(it_d.hasNext()){\n postEnt = it_d.next();\n if (this.tfMap.get(postEnt.docID).containsKey(term)){\n termFrequency_doc = this.tfMap.get(postEnt.docID).get(term);\n w_doc_term = documentFrequency_doc*termFrequency_doc;\n postEnt.score += w_query_term*w_doc_term;\n }\n }\n }\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Building solution took: \" + estimatedTime);\n\n /*\n * 3) Normalize the scores\n */\n startTime = System.nanoTime();\n Iterator<PostingsEntry> it = result.iterator();\n while(it.hasNext()){\n postEnt = it.next();\n postEnt.score /= (new Double(this.docLengths.get(\"\"+postEnt.docID)));//(Math.sqrt(postEnt.norm2));\n postEnt.score = w * postEnt.score + (1-w) * quality(postEnt.docID);\n }\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Normalizing took: \" + estimatedTime);\n\n /*\n * 4) Sort the resulting solution\n */\n startTime = System.nanoTime();\n result.sort();\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Sorting took: \" + estimatedTime);\n\n return result;\n }", "private static ArrayList<Quest> sortAfterTimestamp(ArrayList<Quest> questListToSort) {\n\t\tfor (int i = 0; i < questListToSort.size() - 1; i++) {\n\t\t\tint index = i;\n\t\t\tfor (int j = i + 1; j < questListToSort.size(); j++) {\n\t\t\t\tif (questListToSort.get(j).getTimestamp() > questListToSort.get(index).getTimestamp()) {\n\t\t\t\t\tindex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tCollections.swap(questListToSort, index, i);\n\t\t}\n\t\treturn questListToSort;\n\t}", "private void sortRating()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getRating().compareTo(b.getRating());\n if(result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "public List<String> getSortedResults() {\r\n\t\tList<String> subset;\r\n\t\tif (filter == null) {\r\n\t\t\tsubset = allWords;\r\n\t\t} else {\r\n\t\t\tsubset = getFilteredWords();\r\n\t\t}\r\n\t\tsortResults(subset);\r\n\t\tint wordCount = Math.min(subset.size(), wordLimit);\r\n\t\tArrayList<String> result = new ArrayList<String>(wordCount);\t\r\n\t\tresult.addAll(subset.subList(0, wordCount));\r\n\t\treturn result;\r\n\t}", "public void sortMatches();", "public static ArrayList<JsonNode> sortData(ArrayList<JsonNode> wordList) {\n Collections.sort( wordList, new Comparator<JsonNode>() {\n @Override\n public int compare(JsonNode a, JsonNode b) {\n int valA = Integer.parseInt(a.get(\"weight\").asText());\n int valB = Integer.parseInt(b.get(\"weight\").asText());\n return valB - valA; //Sort in order of largest to smallest\n }\n });\n\n return wordList;\n }", "private void sortByKeys(LazyMap<ProcessorDistributionKey, Collection<Geometry>> keyToGeoms,\n Collection<? extends Geometry> sortGeoms, Collection<Geometry> unprocessed)\n {\n final ProcessorDistributionKey hull = new ProcessorDistributionKey();\n for (final Geometry geom : sortGeoms)\n {\n sortByKeys(keyToGeoms, geom, unprocessed, hull);\n }\n }", "private static void printTable(int numberOfDocs) {\n \n Gson gs = new Gson();\n String json = gs.toJson(wor);\n // System.out.println(json);\n \n List<String> queryWords = new ArrayList();\n //to test it for other query word you can change the following two words\n //queryWords.add(\"carpet\");\n //queryWords.add(\"hous\");\n queryWords.add(\"the\");\n queryWords.add(\"crystallin\");\n queryWords.add(\"len\");\n queryWords.add(\"vertebr\");\n queryWords.add(\"includ\");\n \n \n FrequencySummary frequencySummary = new FrequencySummary();\n frequencySummary.getSummary(json,docName, queryWords);\n \n System.exit(0);\n \n Hashtable<Integer,Integer> g = new Hashtable<>();\n \n /* wor.entrySet().forEach((wordToDocument) -> {\n String currentWord = wordToDocument.getKey();\n Map<String, Integer> documentToWordCount = wordToDocument.getValue();\n freq.set(0);\n df.set(0);\n documentToWordCount.entrySet().forEach((documentToFrequency) -> {\n String document = documentToFrequency.getKey();\n Integer wordCount = documentToFrequency.getValue();\n freq.addAndGet(wordCount);\n System.out.println(\"Word \" + currentWord + \" found \" + wordCount +\n \" times in document \" + document);\n \n if(g.getOrDefault(currentWord.hashCode(), null)==null){\n g.put(currentWord.hashCode(),1);\n \n }else {\n System.out.println(\"Hello\");\n \n int i = g.get(currentWord.hashCode());\n System.out.println(\"i \"+i);\n g.put(currentWord.hashCode(), i++);\n }\n // System.out.println(currentWord+\" \"+ g.get(currentWord.hashCode()));\n // g.put(currentWord.hashCode(), g.getOrDefault(currentWord.hashCode(), 0)+wordCount);\n \n });\n // System.out.println(freq.doubleValue());\n \n // System.out.println(\"IDF for this word: \"+Math.log10( (double)(counter/freq.doubleValue())));\n });\n // System.out.println(g.get(\"plai\".hashCode()));\n //System.out.println(\"IDF for this word: \"+Math.log10( (double)(counter/(double)g.get(\"plai\".hashCode()))));\n */\n }", "static void countSort(List<List<String>> arr) {\n StringBuilder rs = new StringBuilder(\"\");\n int len = arr.size();\n StringBuilder[] sList = new StringBuilder[100];\n for (int i = 0; i < 100; i++) {\n sList[i] = new StringBuilder(\"\");\n }\n for (int i = 0; i < len; i++) {\n int n = Integer.parseInt(arr.get(i).get(0));\n if (i < len / 2) {\n sList[n].append(\"- \");\n } else {\n sList[n].append(arr.get(i).get(1) + \" \");\n }\n }\n for (StringBuilder ls : sList) {\n rs.append(ls);\n }\n System.out.println(rs.toString());\n }", "public void createSummary(){\n\n for(int j=0;j<=noOfParagraphs;j++){\n int primary_set = paragraphs.get(j).sentences.size()/5;\n\n //Sort based on score (importance)\n Collections.sort(paragraphs.get(j).sentences,new SentenceComparator());\n for(int i=0;i<=primary_set;i++){\n contentSummary.add(paragraphs.get(j).sentences.get(i));\n }\n }\n\n //To ensure proper ordering\n Collections.sort(contentSummary,new SentenceComparatorForSummary());\n printSummary();\n }", "public void sort() {\n }", "public void sort() {\n\t\t\tfor (int j = nowLength - 1; j > 1; j--) {\n\t\t\t\tfor (int i = 0; i < j; i++) {\n\t\t\t\t\tif (ray[i] > ray[i+1]) {\n\t\t\t\t\t\tint tmp = ray [i];\n\t\t\t\t\t\tray[i] = ray[i+1];\n\t\t\t\t\t\tray[i+1] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprint();\n\t\t\t}\n\t}", "private static void RankedQueryMode(DiskIndexWriter diskWriter, DiskPositionalIndex disk_posIndex) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {\n\n if (query.equals(\"q\")) {\n\n System.exit(0);\n }\n\n List<String> word = new ArrayList();\n String[] query_array = query.split(\"\\\\s+\");\n TokenProcessor processor = new NewTokenProcessor();\n\n for (int i = 0; i < query_array.length; i++) {\n word.add(processor.processToken(query_array[i]).get(0));\n }\n\n StrategyFactory sf = new StrategyFactory();\n StrategyInterface strategy = sf.execute(rankedOption);\n\n //maps postings to accumulator value\n HashMap<Integer, Doc_accum> postingMap = new HashMap<Integer, Doc_accum>();\n\n PriorityQueue<Doc_accum> queue = new PriorityQueue<>(Collections.reverseOrder());\n\n List<Posting> postings = new ArrayList<>();\n List<Doc_accum> results = new ArrayList<>();\n\n for (String term : word) {\n\n postings = disk_posIndex.getPosting_noPos(term);\n for (Posting p : postings) { //for each document in the postings list\n double t_fd = p.getT_fd();\n double d_ft = p.getD_ft();\n double w_qt = strategy.calculate_wqt(N, d_ft);\n double accum = 0;\n double w_dt = strategy.get_wdt(t_fd, disk_posIndex, p.getDocumentId());\n\n //pairs (Ranked_posting, accumulator factor)\n if (postingMap.containsKey(p.getDocumentId())) {\n accum = postingMap.get(p.getDocumentId()).getAccumulator();\n accum += (w_qt * w_dt);\n postingMap.replace(p.getDocumentId(), new Doc_accum(p, accum)); //replaces old accum value\n\n } else {\n accum += (w_qt * w_dt);\n postingMap.put(p.getDocumentId(), new Doc_accum(p, accum));\n }\n }\n\n }\n\n for (Integer p : postingMap.keySet()) {\n Doc_accum doc_temp = postingMap.get(p);\n double accum = doc_temp.getAccumulator(); //gets accum associated with doc\n\n if (accum > 0) {\n //search for each p's Ld factor in docWeights.bin\n double l_d = strategy.calculate_Ld(disk_posIndex, doc_temp.getPosting().getDocumentId());\n\n accum /= l_d;\n doc_temp.setAccumulator(accum);\n }\n\n queue.add(postingMap.get(p));\n\n }\n\n //returns top K=10 results \n int topK = 50;\n\n while ((results.size() < topK) && queue.size() > 0) {\n\n results.add(queue.poll()); //gets the posting acc pair and returns only posting\n\n }\n\n display_RankedResults(results);\n\n }", "public Iterator rankOrdering(Iterator pages)\n\t{\n\t\t//Iterator allWebNode = ind.retrievePages(keyword);\n\t\tIterator allWebNode = pages;\n\t\tif(allWebNode.hasNext()){\n\t\t\tWebNode wb = (WebNode) allWebNode.next();\n\t\t\tint score = wb.getInDegree() * wb.getWordFreq(keyword);\n\t\t\twb.keywordScore = score;\n\t\t\taL.add(wb); \n\t\t}\n\t\t\n\t\twhile (allWebNode.hasNext()) {\n\t\t\tWebNode nwb = (WebNode) allWebNode.next();\n\t\t\tint nscore = nwb.getInDegree() * nwb.getWordFreq(keyword);\n\t\t\tnwb.keywordScore = nscore;\n\t\t\tint i = 0; \n\t\t\twhile(i<aL.size()){\n\t\t\t\tif (nwb.keywordScore < ((WebNode) aL.get(i)).keywordScore)\n\t\t\t \ti++;\n\t\t\t else\n\t\t\t \taL.add(i,nwb);\n\t\t\t} \n\t\t}\n\t\t\n\t\treturn aL.iterator();\n\t}", "public void sortManlist(){\r\n\t\tCollections.sort(Manlist, new MySort());\r\n\t}", "static void sortByFreq(int arr[], int n)\r\n {\n int[] hash = new int[61];\r\n for (int x : arr) {\r\n hash[x]++;\r\n }\r\n HashMap<Integer, ArrayList<Integer>> valueHash = new HashMap<Integer, ArrayList<Integer>>();\r\n \r\n for (int i = 0; i<hash.length; i++) {\r\n int x = hash[i];\r\n if (x != 0) {\r\n if (valueHash.containsKey(x)) {\r\n valueHash.get(x).add(i);\r\n } else {\r\n ArrayList<Integer> list = new ArrayList<>();\r\n list.add(i);\r\n valueHash.put(x, list);\r\n }\r\n }\r\n }\r\n Set<Integer> keys = valueHash.keySet();\r\n List<Integer> list = new ArrayList<Integer>(keys); \r\n Collections.sort(list, new Comparator<Integer>()\r\n\t\t{\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(Integer o1, Integer o2)\r\n\t\t\t{\r\n\t\t\t\tif (o1 > o2) return -1;\r\n\t\t\t\t\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t});\r\n StringBuffer buff = new StringBuffer();\r\n for (int x : list) {\r\n \tArrayList<Integer> numList = valueHash.get(x);\r\n \tCollections.sort(numList);\r\n \tfor (int num : numList) {\r\n \t\tint y = x;\r\n \t\twhile (y > 0) {\r\n \t\t\tbuff.append(num + \" \");\r\n \t\t\ty--;\r\n \t\t}\r\n \t}\r\n }\r\n System.out.print(buff);\r\n }", "private static void sortingMemo() {\n\t\t\n\t}", "private List<Article> sortTopics(Article queryTopic, List<Article>relatedTopics) throws Exception {\n for (Article art:relatedTopics) \n art.setWeight(_comparer.getRelatedness(art, queryTopic)) ;\n\n //Now that the weight attribute is set, sorting will be in descending order of weight.\n //If weight was not set, it would be in ascending order of id. \n Collections.sort(relatedTopics) ;\n return relatedTopics ;\n }", "public void sort() {\n compares = 0;\n shuttlesort((int[]) indexes.clone(), indexes, 0, indexes.length);\n }", "private static List<MoneyLoss> sortLosses(Collection<MoneyLoss> unsortedLosses)\n {\n //Sort budget items first on frequency and then alphabetically\n ArrayList<MoneyLoss> oneTimeItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> dailyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> weeklyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> biweeklyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> monthlyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> yearlyItems = new ArrayList<MoneyLoss>();\n\n for (MoneyLoss loss : unsortedLosses)\n {\n switch (loss.lossFrequency())\n {\n case oneTime:\n {\n oneTimeItems.add(loss);\n break;\n }\n case daily:\n {\n dailyItems.add(loss);\n break;\n }\n case weekly:\n {\n weeklyItems.add(loss);\n break;\n }\n case biWeekly:\n {\n biweeklyItems.add(loss);\n break;\n }\n case monthly:\n {\n monthlyItems.add(loss);\n break;\n }\n case yearly:\n {\n yearlyItems.add(loss);\n break;\n }\n }\n }\n\n Comparator<MoneyLoss> comparator = new Comparator<MoneyLoss>() {\n @Override\n public int compare(MoneyLoss lhs, MoneyLoss rhs) {\n return lhs.expenseDescription().compareTo(rhs.expenseDescription());\n }\n };\n\n Collections.sort(oneTimeItems, comparator);\n Collections.sort(dailyItems, comparator);\n Collections.sort(weeklyItems, comparator);\n Collections.sort(biweeklyItems, comparator);\n Collections.sort(monthlyItems, comparator);\n Collections.sort(yearlyItems, comparator);\n\n ArrayList<MoneyLoss> sortedItems = new ArrayList<MoneyLoss>();\n BadBudgetApplication.appendItems(sortedItems, oneTimeItems);\n BadBudgetApplication.appendItems(sortedItems, dailyItems);\n BadBudgetApplication.appendItems(sortedItems, weeklyItems);\n BadBudgetApplication.appendItems(sortedItems, biweeklyItems);\n BadBudgetApplication.appendItems(sortedItems, monthlyItems);\n BadBudgetApplication.appendItems(sortedItems, yearlyItems);\n\n return sortedItems;\n }", "public void sortTree(TreeNode root){\r\n\t\tArrayList<TreeNode> newChildrenlist = new ArrayList<TreeNode>();\r\n\t\tIterator<TreeNode> it = root.children();\r\n\t\tTreeNode child;\r\n\t\tint i, j, l, freq;\r\n\t\twhile(it.hasNext()){\r\n\t\t\tchild = it.next();\r\n\t\t\tfreq = child.getFrequency();\r\n\t\t\tif(newChildrenlist.size() == 0){\r\n\t\t\t\tnewChildrenlist.add(child);\r\n\t\t\t}\t\t\t\r\n\t\t\telse if(newChildrenlist.get(0).getFrequency() <= freq){\r\n\t\t\t\tnewChildrenlist.add(0, child);\r\n\t\t\t}\r\n\t\t\telse if(newChildrenlist.get(newChildrenlist.size()-1).getFrequency()\r\n\t\t\t\t\t>= freq){\r\n\t\t\t\tnewChildrenlist.add(child);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\ti = 0;\r\n\t\t\t\tj = newChildrenlist.size() - 1;\r\n\t\t\t\twhile(i < j){\r\n\t\t\t\t\tl = (i+j)/2;\r\n\t\t\t\t\tif(freq == newChildrenlist.get(l).getFrequency()){\r\n\t\t\t\t\t\tnewChildrenlist.add(l, child);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(freq < newChildrenlist.get(l).getFrequency()){\r\n\t\t\t\t\t\ti = Math.max(l, i+1);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tj = Math.min(l, j-1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(newChildrenlist.get(i).getFrequency() > freq){\r\n\t\t\t\t\tnewChildrenlist.add(i+1, child);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tnewChildrenlist.add(i, child);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\troot.setChildren(newChildrenlist);\r\n\t\tit = root.children();\r\n\t\twhile(it.hasNext()){\r\n\t\t\tchild = it.next();\r\n\t\t\tsortTree(child);\r\n\t\t}\r\n\t}", "public TreeMap<GenericDocument, LinkedList<Posting>> getDocumentBasedIndex(Collection collection) { \r\n\t\tTreeMap<GenericDocument, LinkedList<Posting>> result = new TreeMap<GenericDocument, LinkedList<Posting>>();\r\n\t\t\r\n\t\tfor(java.util.Collection<Posting> bag : map.values()) {\r\n\t\t\tfor (Posting posting : bag) {\r\n\t\t\t\tGenericDocument doc = collection.findArticle(posting.getDocumentID());\r\n\t\t\t\tif (doc != null) {\r\n\t\t\t\t\tif (result.containsKey(doc))\r\n\t\t\t\t\t\tresult.get(doc).add(posting);\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tLinkedList<Posting> list = new LinkedList<Posting>();\r\n\t\t\t\t\t\tlist.add(posting);\r\n\t\t\t\t\t\tresult.put(doc, list);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t \r\n\t\t}\r\n\t\t \r\n\t\tSystem.out.println(\"Document based indexing complete.\");\r\n\t\treturn result;\r\n\t}", "@Override\r\n\tpublic void addSort() {\n\t\t\r\n\t}", "private List<Score> order(List<Score> s)\n {\n Collections.sort(s, new Comparator<Score>()\n {\n\n @Override\n public int compare(Score o1, Score o2) {\n // TODO Auto-generated method stub\n\n return o1.getSentId() - o2.getSentId();\n }\n });\n return s;\n }", "public void ArtistAndSource() throws IOException{\r\n List<String> ArrangersAndTheirSongs=new ArrayList<>();\r\n HashMap <String,Integer> SongCountMap= new HashMap<>();\r\n String allsongs=\"\";\r\n String sourcesong=\"\";\r\n for(int id: ArrangersMap.keySet()){\r\n String ArrangerName=ArrangersMap.get(id);\r\n for(String song:ArrangerLinesList){\r\n String perform[];\r\n perform=song.split(\"/\");\r\n int arrangeid=Integer.parseInt(perform[1]);\r\n if(id==arrangeid){\r\n int songid= Integer.parseInt(perform[0]);\r\n String songname=test.getsongName(songid);\r\n sourcesong=test.SongToSource(songname);\r\n allsongs+=sourcesong+\",\";\r\n if (SongCountMap.get(sourcesong) !=null){ \r\n SongCountMap.put(sourcesong, SongCountMap.get(sourcesong)+1);\r\n }\r\n else{\r\n SongCountMap.put(sourcesong, 1);\r\n }\r\n } \r\n }\r\n for(String song:SongCountMap.keySet()){\r\n //System.out.println(song);\r\n }\r\n HashMap <String,Integer> SortedMap= sortByValues(SongCountMap);\r\n SongCountMap.clear();\r\n String allsongs2=\"\";\r\n for(String song:SortedMap.keySet()){\r\n //System.out.println(\"Number\"+SortedMap.get(song)+\"The song is\"+song);\r\n allsongs2+=\"#occurences:\"+SortedMap.get(song)+\"The song is\"+song+\"\\n\";\r\n //System.out.println(\"Number of times:\"+SortedMap.get(song)+\"The song is\"+song);\r\n }\r\n //System.out.println(allsongs2);\r\n // ArrangersAndTheirSongs.add(\"The Arrangers Name is:\"+ArrangerName+ \" Their songs are:\"+allsongs);\r\n ArrangersAndTheirSongs.add(\"The Arrangers Name is:\"+ArrangerName+ \" Their songs are: \"\r\n + \"\"+allsongs2);\r\n allsongs=\"\";\r\n SortedMap.clear();\r\n allsongs2=\"\";\r\n }\r\n //method is broken\r\n writeListToTextFile(\"d:\\\\documents\\\\textfiles\\\\ArrangersAndTheirSources.txt\",ArrangersAndTheirSongs);\r\n System.out.println(\"The size of the list is:\"+ArrangersAndTheirSongs.size());\r\n System.out.println(\"Artist and Their Source Complete\");\r\n }", "private void sort() {\n setFiles(getFileStreamFromView());\n }", "@Override\n \tpublic void sort() {\n \t\tArrays.sort(data);\n \t}", "public HashMap<String, Integer> getOrder(){\n\t\t\n\t\tHashMap<String, Integer> hm2 = getHashMap();\n\t\n\t\tArrayList fq = new ArrayList<>();\n\t\t\n\t\tHashMap<String, Integer> top10 = new HashMap<String, Integer>();\n\t\t\n\t\tfor(String key : hm2.keySet()){\n\t\t\t\n\t\t\tfq.add(hm2.get(key));\n\t\t}\n\t\t// use Collection to get the order of frequency\n\t\tCollections.sort(fq);\n \tCollections.reverse(fq);\n \t\n \tfor(int i = 0; i<11; i++){\n \t\t\n \t\tfor(String key : hm2.keySet()){\n \t\t// make sure the word not equals to balck space\n \t\tif(hm2.get(key) == fq.get(i) && !key.equals(\"\") ){\n \t\t\t\n \t\t top10.put(key, hm2.get(key));\n \t\t\t\t\n \t\t}\n \t}\t\n\t}\n\t\treturn top10;\n\t}", "public static void main(String[] args) {\n\n List<String> animals = new ArrayList <String>();\n\n animals.add(\"Elephatn\");\n animals.add(\"snake\");\n animals.add(\"Lion\");\n animals.add(\"Mongoose\");\n animals.add(\"Cat\");\n\n\n\n// Collections.sort(animals, new StringLengthComparator());\n// Collections.sort(animals, new AlphabeticalComparator());\n Collections.sort(animals, new ReverseAlphabeticalComparator());\n for(String animal:animals){\n System.out.println(animal);\n }\n\n//////////////Sorting Numbers ///////////\n List<Integer> numbers = new ArrayList <Integer>();\n\n numbers.add(54);\n numbers.add(1);\n numbers.add(36);\n numbers.add(73);\n numbers.add(9);\n\n Collections.sort(numbers, new Comparator <Integer>() {\n @Override\n public int compare(Integer num1, Integer num2) {\n return num1.compareTo(num2);\n }\n });\n\n for(Integer number: numbers){\n System.out.println(number);\n }\n\n\n///////////////Sorting Arbitrary objects////////\n\n\n List<Person> people = new ArrayList <Person>();\n\n people.add(new Person(1,\"Joe\"));\n people.add(new Person(5,\"Harry\"));\n people.add(new Person(2,\"Hermoine\"));\n people.add(new Person(4,\"Muffet\"));\n\n// Sort in order of ID\n Collections.sort(people, new Comparator <Person>() {\n @Override\n public int compare(Person p1, Person p2) {\n\n if(p1.getId()>p2.getId()){\n return 1;\n }else if(p1.getId()<p2.getId()){\n return -1;\n }\n return 0;\n\n }\n });\n\n\n // Sort in order of Name\n Collections.sort(people, new Comparator <Person>() {\n @Override\n public int compare(Person p1, Person p2) {\n\n return p1.getName().compareTo(p2.getName());\n\n\n }\n });\n\n for(Person person: people){\n System.out.println(person);\n\n }\n\n }", "public void sort()\n\t{\n\t\tfor(int i=0;i<bowlers.size()-1;i++)\n\t\t{\n\t\t\tfor(int j=i+1;j<bowlers.size();j++)\n\t\t\t{\n\t\t\t\tif(bowlers.get(i).getBall()<bowlers.get(j).getBall())\n\t\t\t\t{\n\t\t\t\t\tBowler bowler=bowlers.get(i);\n\t\t\t\t\tbowlers.set(i,bowlers.get(j));\n\t\t\t\t\tbowlers.set(j,bowler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<bowlers.size();i++)\n\t\t{\n\t\tSystem.out.println(bowlers.get(i).getBall());\n\t\t}\n\t}" ]
[ "0.67374855", "0.63989174", "0.6172652", "0.5989494", "0.59094334", "0.5851778", "0.57968163", "0.57893056", "0.5646224", "0.5625188", "0.5610343", "0.56095076", "0.559386", "0.55909723", "0.5517896", "0.5515005", "0.5512062", "0.5501602", "0.54893845", "0.54655427", "0.54344296", "0.53687227", "0.5365804", "0.5350844", "0.5309958", "0.5294334", "0.5292904", "0.5288388", "0.52836674", "0.5283448", "0.5254197", "0.5241266", "0.52408475", "0.52305454", "0.5199939", "0.5193841", "0.5191041", "0.51904106", "0.5167683", "0.5158811", "0.5153203", "0.51495206", "0.51388747", "0.51360935", "0.5134825", "0.5129145", "0.51217264", "0.5108417", "0.51052976", "0.509054", "0.5083371", "0.5078876", "0.50775975", "0.50693953", "0.50582904", "0.5050032", "0.5039735", "0.5029067", "0.50277025", "0.502086", "0.50188714", "0.5014433", "0.5007968", "0.50066066", "0.5006377", "0.5003297", "0.5003297", "0.49968514", "0.49889508", "0.49878192", "0.49824104", "0.497999", "0.49757186", "0.49733847", "0.49708334", "0.49705762", "0.49686417", "0.49683836", "0.49678463", "0.49619532", "0.49613643", "0.49573746", "0.49569228", "0.49538016", "0.4952879", "0.49333644", "0.49332356", "0.49259087", "0.4917477", "0.49140754", "0.49116108", "0.49075755", "0.4903684", "0.48996446", "0.48970988", "0.4890063", "0.48888302", "0.48862502", "0.48789436", "0.48740909" ]
0.6929145
0
OTHERS [MODIFIED] Returns all the words in the index.
public Set<String> keySet() { return this.index.keySet(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Set<String> getWords() {\n\t\treturn Collections.unmodifiableSet(this.invertedIndex.keySet());\n\t}", "public Iterator words() {\n return index.keySet().iterator();\n }", "public void showAllWords() {//out\n System.out.println(\"No\\t|English\\t|Vietnamese\");\n ArrayList<Word> fullDictionary = dictionaryManagement.getDictionary().getWords();\n for (int i = 0; i < fullDictionary.size(); i++) {\n String aWord = String.valueOf(i + 1) + \"\\t|\" + fullDictionary.get(i).getWordTarget()\n + \"\\t|\" + fullDictionary.get(i).getWordExplain();\n System.out.println(aWord);\n }\n }", "private List<String> getFilteredWords() {\r\n\t\tArrayList<String> filteredWords = new ArrayList<String>(16);\r\n\t\t\r\n\t\tfor (String word : allWords) {\r\n\t\t\tif (matchesFilter(word) == true) {\r\n\t\t\t\tfilteredWords.add(word);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn filteredWords;\r\n\t}", "public List<String> getAllWords() {\n List<String> words = new ArrayList<>();\n // get the words to the list\n getAllWords(root, \"\", 0, words);\n // and return the list of words\n return words;\n }", "public ArrayList<String> getWords() {\n return new ArrayList<>(words);\n }", "public Set<String> getWords() {\n return wordMap.keySet();\n }", "static void allDocumentAnalyzer() throws IOException {\n\t\tFile allFiles = new File(\".\"); // current directory\n\t\tFile[] files = allFiles.listFiles(); // file array\n\n\t\t// recurse through all documents\n\t\tfor (File doc : files) {\n\t\t\t// other files we don't need\n\t\t\tif (doc.getName().contains(\".java\") || doc.getName().contains(\"words\") || doc.getName().contains(\"names\")\n\t\t\t\t\t|| doc.getName().contains(\"phrases\") || doc.getName().contains(\".class\")\n\t\t\t\t\t|| doc.getName().contains(\"Data\") || doc.getName().contains(\".sh\") || doc.isDirectory()\n\t\t\t\t\t|| !doc.getName().contains(\".txt\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tString name = doc.getName();\n\t\t\tSystem.out.println(name);\n\t\t\tname = name.substring(0, name.length() - 11);\n\t\t\tSystem.out.println(name);\n\n\t\t\tif (!names.contains(name)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// make readers\n\t\t\tFileReader fr = new FileReader(doc);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\n\t\t\t// phrase list\n\t\t\tArrayList<String> words = new ArrayList<String>();\n\n\t\t\t// retrieve all text, trim, refine and add to phrase list\n\t\t\tString nextLine = br.readLine();\n\t\t\twhile (nextLine != null) {\n\t\t\t\tnextLine = nextLine.replace(\"\\n\", \" \");\n\t\t\t\tnextLine = nextLine.trim();\n\n\t\t\t\tif (nextLine.contains(\"no experience listed\")) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tString[] lineArray = nextLine.split(\"\\\\s+\");\n\n\t\t\t\t// recurse through every word to find phrases\n\t\t\t\tfor (int i = 0; i < lineArray.length - 1; i++) {\n\t\t\t\t\t// get the current word and refine\n\t\t\t\t\tString currentWord = lineArray[i];\n\n\t\t\t\t\tcurrentWord = currentWord.trim();\n\t\t\t\t\tcurrentWord = refineWord(currentWord);\n\n\t\t\t\t\tif (currentWord.equals(\"\") || currentWord.isEmpty()) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\twords.add(currentWord);\n\t\t\t\t}\n\t\t\t\tnextLine = br.readLine();\n\t\t\t}\n\n\t\t\tbr.close();\n\n\t\t\t// continue if empty\n\t\t\tif (words.size() == 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// otherwise, increment number of files in corpus\n\t\t\tsize++;\n\n\t\t\t// updating the phrase count map for tf\n\t\t\tString fileName = doc.getName();\n\t\t\tphraseCountMap.put(fileName, words.size());\n\n\t\t\t// recurse through every word\n\t\t\tfor (String word : words) {\n\t\t\t\t// get map from string to freq\n\t\t\t\tHashMap<String, Integer> textFreqMap = wordFreqMap.get(fileName);\n\n\t\t\t\t// if it's null, make one\n\t\t\t\tif (textFreqMap == null) {\n\t\t\t\t\ttextFreqMap = new HashMap<String, Integer>();\n\t\t\t\t\t// make freq as 1\n\t\t\t\t\ttextFreqMap.put(word, 1);\n\t\t\t\t\t// put that in wordFreq\n\t\t\t\t\twordFreqMap.put(fileName, textFreqMap);\n\t\t\t\t} else {\n\t\t\t\t\t// otherwise, get the current num\n\t\t\t\t\tInteger currentFreq = textFreqMap.get(word);\n\n\t\t\t\t\t// if it's null,\n\t\t\t\t\tif (currentFreq == null) {\n\t\t\t\t\t\t// the frequency is just 0\n\t\t\t\t\t\tcurrentFreq = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t// increment the frequency\n\t\t\t\t\tcurrentFreq++;\n\n\t\t\t\t\t// put it in the textFreqMap\n\t\t\t\t\ttextFreqMap.put(word, currentFreq);\n\n\t\t\t\t\t// put that in the wordFreqMap\n\t\t\t\t\twordFreqMap.put(fileName, textFreqMap);\n\t\t\t\t}\n\n\t\t\t\t// add this to record (map from phrases to docs with that\n\t\t\t\t// phrase)\n\t\t\t\tinvertedMap.addValue(word, doc);\n\t\t\t}\n\t\t}\n\t}", "public ArrayList<String> AIwords(){\n return wordsToDisplay;\n }", "public Cursor getWords() \n\t{\n\t\tString query = String.format(_select, getDate()) +\n\t\t\t\t\t\t_havingDataContraint +\n\t\t\t\t\t\t\" ORDER BY \" + DBConstants.WordTable.WORD_KEY;\n\t\t\n\t\treturn _db.rawQuery(query, null);\t\n }", "public String get_all_words(){\n\t\tString found_words = \"\";\n\t\t//We try to find the word within our childs\n\t\tfor(LexiNode child: childs){\n\t\t\t\tfound_words += child.get_all_words();\n\t\t}\n\t\tif(current_word != null && !found_words.equals(\"\"))\n\t\t\treturn current_word + \"#\" + found_words;\n\t\telse if(current_word != null && found_words.equals(\"\"))\n\t\t\treturn current_word+ \"#\";\n\t\telse //current_word == null && found_words != null\n\t\t\treturn found_words;\n\t}", "public Set<String> getWords() {\n return wordsOccurrences.keySet();\n }", "public ArrayList<String> getWords() {\n return words;\n }", "public List<OOV> getOOVWords() {\n return this.OOVWords;\n }", "private List<SearchWord> getSearchWords(Long lastUpdateTime) {\n return new ArrayList<>();\n }", "@Override\r\n\t\t\tpublic Set<String> getStopWords() {\n\t\t\t\treturn null;\r\n\t\t\t}", "public abstract Set<String> getTerms(Document doc);", "SList oddWords();", "public List<Word> getRelatedWordsOtherLanguage() {\n if (this._relatedOppositeLanguage == null) {\n this._relatedOppositeLanguage = MainActivity.db.getRelatedWordsByIdAndLanguage(this._id, this.getOppositeLanguage());\n }\n return this._relatedOppositeLanguage;\n }", "private void addCustomWords() {\r\n\r\n }", "public JTextPane getWords() {\n\t\treturn words;\n\t}", "public final ArrayList<String> GetStringsForCurrentUnit(boolean otherStringsToo)\n {\n return MethodsUnitP.GetStringsUnitCommon(Unit, otherStringsToo);\n }", "public List<String> getRelatedWords(String word) throws IOException {\n List<String> result = new ArrayList<String>();\n IDictionary dict = new Dictionary(new File(WORDNET_LOCATION));\n try {\n dict.open();\n IStemmer stemmer = new WordnetStemmer(dict);\n for (POS pos : EnumSet.of(POS.ADJECTIVE, POS.ADVERB, POS.NOUN, POS.VERB)) {\n List<String> resultForPos = new ArrayList<String>();\n List<String> stems = new ArrayList<String>();\n stems.add(word);\n for (String stem : stemmer.findStems(word, pos)) {\n if (!stems.contains(stem))\n stems.add(stem);\n }\n for (String stem : stems) {\n if (!resultForPos.contains(stem)) {\n resultForPos.add(stem);\n IIndexWord idxWord = dict.getIndexWord(stem, pos);\n if (idxWord == null) continue;\n List<IWordID> wordIDs = idxWord.getWordIDs();\n if (wordIDs == null) continue;\n IWordID wordID = wordIDs.get(0);\n IWord iword = dict.getWord(wordID);\n \n ISynset synonyms = iword.getSynset();\n List<IWord> iRelatedWords = synonyms.getWords();\n if (iRelatedWords != null) {\n for (IWord iRelatedWord : iRelatedWords) {\n String relatedWord = iRelatedWord.getLemma();\n if (!resultForPos.contains(relatedWord))\n resultForPos.add(relatedWord);\n }\n }\n \n List<ISynsetID> hypernymIDs = synonyms.getRelatedSynsets();\n if (hypernymIDs != null) {\n for (ISynsetID relatedSynsetID : hypernymIDs) {\n ISynset relatedSynset = dict.getSynset(relatedSynsetID);\n if (relatedSynset != null) {\n iRelatedWords = relatedSynset.getWords();\n if (iRelatedWords != null) {\n for (IWord iRelatedWord : iRelatedWords) {\n String relatedWord = iRelatedWord.getLemma();\n if (!resultForPos.contains(relatedWord))\n resultForPos.add(relatedWord);\n }\n }\n }\n }\n }\n }\n }\n for (String relatedWord : resultForPos) {\n if (relatedWord.length() > 3\n && !relatedWord.contains(\"-\")\n && !result.contains(relatedWord)) {\n // TODO: Hack alert!\n // The - check is to prevent lucene from interpreting hyphenated words as negative search terms\n // Fix!\n result.add(relatedWord);\n }\n }\n }\n } finally {\n dict.close();\n }\n return result;\n }", "public Term[] getStopWords() {\n List<Term> allStopWords = new ArrayList<Term>();\n for (String fieldName : stopWordsPerField.keySet()) {\n Set<String> stopWords = stopWordsPerField.get(fieldName);\n for (String text : stopWords) {\n allStopWords.add(new Term(fieldName, text));\n }\n }\n return allStopWords.toArray(new Term[allStopWords.size()]);\n\t}", "public ArrayList<Word> getNewWords() {\n\t\tArrayList<Word> newWords = new ArrayList<>();\n\t\tint index = 0;\n\t\twhile (index < m__vocabs.size() && newWords.size() <= m__numberOfNewVocabularies) {\n\t\t\tWord word = (Word)m__vocabs.get(index);\n\t\t\tif (word.getNumberOfRepetitions() == 0) {\n\t\t\t\tnewWords.add(word);\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\t\treturn newWords;\n\t}", "public Set<String> hyponyms(String word) {\n Set<String> toReturn = new HashSet<String>();\n Set<Integer> wordIndexes = new HashSet<Integer>();\n wordIndexes = wnetsi.get(word);\n Set<Integer> toReturnInt = GraphHelper.descendants(g, wordIndexes);\n Object[] returnArray = toReturnInt.toArray();\n for (int i = 0; i < returnArray.length; i += 1) {\n Set<String> stringReturn = wnetis.get(returnArray[i]);\n Iterator<String> strIter = stringReturn.iterator();\n while (strIter.hasNext()) {\n toReturn.add(strIter.next());\n }\n }\n return toReturn;\n }", "public void addAll(InvertedIndex other) {\n\t\tfor (String word : other.index.keySet()) {\n\t\t\tif (!this.index.containsKey(word)) {\n\t\t\t\tthis.index.put(word, other.index.get(word));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfor (String path : other.index.get(word).keySet()) {\n\t\t\t\t\tif (!this.index.get(word).containsKey(path)) {\n\t\t\t\t\t\tthis.index.get(word).put(path, other.index.get(word).get(path));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.index.get(word).get(path).addAll(other.index.get(word).get(path));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public Set<String> getAllKnownWords() throws IOException {\n log.info(\"Reading all data to build known words set.\");\n Set<String> words = new HashSet<>();\n if (this.hasTrain()) {\n for (AnnoSentence sent : getTrainInput()) {\n words.addAll(sent.getWords());\n }\n }\n if (this.hasDev()) {\n for (AnnoSentence sent : getDevInput()) {\n words.addAll(sent.getWords());\n }\n }\n if (this.hasTest()) {\n for (AnnoSentence sent : getTestInput()) {\n words.addAll(sent.getWords());\n }\n }\n return words;\n }", "@Override\n public int getNumberOfWords() {\n return 0;\n }", "@Test\n\tpublic void singleWordGrepTest4() throws Exception {\n\t\t// word is 'undocumented'\n\t\tHashSet<String> grepFound = loadGrepResults(\"undocumented\");\n\t\tCollection<Page> index = queryTest.query(\"undocumented\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\t// tests set equality \n\t\tassertEquals(indexFound, grepFound);\n\t}", "@Override\r\n\t@CacheCable(key=\"'wfx:SensitiveWord'\" ,value=\"value\",expiration=24*60*60)\r\n\tpublic List<String> getAllSensitiveWord() {\n\t\treturn shopMapper.getAllSensitiveWord();\r\n\r\n\t}", "String[] getReservedWords();", "public Set<String> getWordsNotFoundByUser(){\n\n Set<String> validWordsOnBoardCopy = new HashSet<String>();\n validWordsOnBoardCopy.addAll(validWordsOnBoard);\n validWordsOnBoardCopy.removeAll(validWordsFoundByUser);\n\n return validWordsOnBoardCopy;\n }", "public ArrayList <String> getWordList () {\r\n return words;\r\n }", "public ArrayList<ArrayList> simpleQuery(String word)\n {\n ArrayList<ArrayList> data = new ArrayList();\n\n IndexObject obj = myIndex.get(word.hashCode());\n if(obj == null)\n {\n errorMsg();\n return null;\n }\n data.add(new ArrayList<Document>(obj.getDocuments()));\n data.add(new ArrayList<Double>(obj.getRelevance()));\n data.add(new ArrayList<Integer>(obj.getOccurrence()));\n data.add(new ArrayList<Integer>(obj.getPopularity()));\n return data;\n }", "@Override\n\tpublic Set<String> getWordSet() {\n\t\tlock.lockReadOnly();\n\t\ttry {\n\t\t\treturn super.getWordSet();\n\t\t} finally {\n\t\t\tlock.unlockReadOnly();\n\t\t}\n\t}", "default List<String> interestingConcepts(int topK, UnitLocation located,\n Set<Location> irrelevantSet){\n // collect frequent words outside the blacklist of locations\n final TokenIterator extractor = new TokenIterator(irrelevantSet);\n located.getUnitNode().accept(extractor);\n\n final WordCounter wordCounter = new WordCounter(extractor.getItems());\n\n return wordCounter.mostFrequent(topK);\n }", "public abstract String[][] getTopWords();", "public List<String> analogyWords(String w1,String w2,String w3) {\n TreeSet<VocabWord> analogies = analogy(w1, w2, w3);\n List<String> ret = new ArrayList<>();\n for(VocabWord w : analogies) {\n String w4 = cache.wordAtIndex(w.getIndex());\n ret.add(w4);\n }\n return ret;\n }", "public Collection<String> words() {\n Collection<String> words = new ArrayList<String>();\n TreeSet<Integer> keyset = new TreeSet<Integer>();\n keyset.addAll(countToWord.keySet());\n for (Integer count : keyset) {\n words.addAll(this.countToWord.get(count));\n }\n return words;\n }", "private void setWordsOnly() throws IOException {\n this.wordsOnly = new HashSet<>();\n new InputAnalyzer().removePunctuation(inputText, wordsOnly::add);\n }", "public void highLightWords(){\n }", "public Iterator<String> words();", "public final ArrayList<String> GetStringsForCurrentType(boolean otherStringsToo)\n {\n return MethodsUnitP.GetStringsTypeCommon(UnitType, otherStringsToo);\n }", "@Override\r\n public String wordsOriginal(char[] arrayOfword) {\n String origalWord = \"\";//define a String for save the word orignal\r\n try {\r\n for (int i = 0; i < arrayOfword.length; i++) {\r\n origalWord += arrayOfword[i];//each charater put in the string origalWord\r\n }\r\n } catch (Exception e) {\r\n JOptionPane.showMessageDialog(null, \"An error has occured!\");\r\n }\r\n return origalWord;\r\n }", "@Override\r\n\tpublic List getAllOtherList() {\n\t\tString HQL = \"\";\r\n\t\tHQL += \" from XzfyOtherSuggest x\";\r\n\t\tHQL += \" where 1 = 1 \";\t\r\n\t\treturn super.find(HQL);\r\n\t}", "String getANY_OTHER();", "public Vector<Word> allKeyValue(){\n\n\tVector<Word> words = new Vector<Word>();\n\tfor(int w = 0; w < theTable.length; w++){\n\t // System.out.println(\"w: \" + w);\n\t // System.out.println(\"theTable[w]: \" + theTable[w]);\n\t if(theTable[w] != null){\n\t\twords.addElement(theTable[w]);\n\t }\n\t}\n\treturn words;\n }", "private StopWords() {\r\n\t\tPath source = Paths.get(\"./dat/zaustavne_rijeci.txt\");\r\n\t\ttry {\r\n\t\t\tbody = new String(Files.readAllBytes(source),\r\n\t\t\t\t\tStandardCharsets.UTF_8);\r\n\t\t} catch (IOException ignorable) {\r\n\t\t}\r\n\t\twords = new LinkedHashSet<>();\r\n\t\tfillSet();\r\n\t}", "SList evenWords();", "List<T> getWord();", "@Override\n public List<DefinitionDTO> findAllWords() {\n List<Word> words = wordRepository.findAll();\n return DTOMapper.mapWordListToDefinitionDTOList(words);\n }", "String getSynonyms();", "private List<String> getContextWords(Tree tree) {\r\n List<String> words = null;\r\n if (op.trainOptions.useContextWords) {\r\n words = Generics.newArrayList();\r\n List<Label> leaves = tree.yield();\r\n for (Label word : leaves) {\r\n words.add(word.value());\r\n }\r\n }\r\n return words;\r\n }", "public String getOthers() {\n return others;\n }", "public String getOthers() {\n return others;\n }", "private void displayWords() {\r\n\t\tList<String> words = results.getSortedResults();\r\n\t\tif (words.size() == 0) {\r\n\t\t\tSystem.out.println(\"NO results to display.\");\r\n\t\t} else {\r\n\t\t\tfor (String word : words) {\r\n\t\t\t\tSystem.out.println(word);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@SuppressWarnings({ \"deprecation\", \"unchecked\", \"rawtypes\" })\n\tpublic String generateWordlists(Corpus co) {\n\t\tlong startTime = System.currentTimeMillis();\n\t\t// Set up weka word vector\n\t\tFastVector attributes;\n\t\tInstances dataSet;\n\t\tattributes = new FastVector();\n\n\t\tattributes.addElement(new Attribute(\"aspect_id\", (FastVector) null));\n\t\tattributes.addElement(new Attribute(\"tokens\", (FastVector) null));\n\n\t\tdataSet = new Instances(\"BeerAspects\", attributes, 0);\n\n\t\tCorpus topReviews;\n\t\tCorpus lowReviews;\n\n\t\t// Do top and low for all aspects\n\t\tfor (Aspect aspect : Aspect.values()) {\n\n\t\t\t// Only for actual aspects\n\t\t\tif (aspect.equals(Aspect.NONE) || aspect.equals(Aspect.OVERALL))\n\t\t\t\tcontinue;\n\n\t\t\ttopReviews = co.getTopReviews(aspect);\n\t\t\ttopReviews.analyze();\n\t\t\tString tokens = topReviews.getTokenConcatenation(aspect);\n\n\t\t\tInstance instance = new SparseInstance(2);\n\t\t\tinstance.setValue((Attribute) attributes.elementAt(0), aspect.name() + \"_TOP\");\n\t\t\tinstance.setValue((Attribute) attributes.elementAt(1), tokens);\n\n\t\t\tdataSet.add(instance);\n\n\t\t\tlowReviews = co.getLowReviews(aspect);\n\t\t\tlowReviews.analyze();\n\t\t\ttokens = lowReviews.getTokenConcatenation(aspect);\n\t\t\t// System.out.println(tokens);\n\n\t\t\tinstance = new SparseInstance(2);\n\t\t\tinstance.setValue((Attribute) attributes.elementAt(0), aspect.name() + \"_LOW\");\n\t\t\tinstance.setValue((Attribute) attributes.elementAt(1), tokens);\n\n\t\t\tdataSet.add(instance);\n\t\t}\n\n\t\t// System.out.println(dataSet.toString());\n\t\tInstances dataFiltered = transformToWordVector(dataSet, co.getProps());\n\n\t\t// System.out.println(dataFiltered.toString());\n\t\tString pathsToLists = writeWordlists(dataFiltered);\n\n\t\twriteArffFile(dataFiltered, this.outputDir+\"wordvector.arff\");\n\n\t\tlong stopTime = System.currentTimeMillis();\n\t\tlong elapsedTime = stopTime - startTime;\n\t\tSystem.out.println(\"Generated wordlists in: \" + elapsedTime / 1000 + \" s\");\n\t\treturn pathsToLists;\n\t}", "public int deleteAllWords()\n\t{\n\t\t_db.delete(DBConstants.StatsTable.TABLENAME, null, null);\n\n\t\t//delete all words\n\t\treturn _db.delete(DBConstants.WordTable.TABLENAME, null, null);\n\t}", "public List<Map.Entry<String, Integer>> getWordList(){\n\t\treturn new ArrayList<>(GeneralWordCounter.entrySet());\n\t}", "public Set<String> getLocations(String word) {\n\t\tif (this.invertedIndex.get(word) == null) {\n\t\t\treturn Collections.emptySet();\n\t\t} else {\n\t\t\treturn Collections.unmodifiableSet(this.invertedIndex.get(word).keySet());\n\t\t}\n\t}", "public synchronized Set<String> getStopWords() throws Exception {\r\n\t\t\r\n\t\tif(stopWords == null){\r\n\t\t\tMTDArquivoEnum enumerado = MTDArquivoEnum.STOP_WORDS;\r\n\t\t\tstopWords = new HashSet<String>();\r\n\t\t\tMTDIterator<String> it = enumerado.lineIterator();\r\n\t\t\twhile (it.hasNext()) {\r\n\t\t\t\tstopWords.add(it.next());\r\n\t\t\t}\r\n\t\t\tit.close();\r\n\t\t}\r\n \r\n return stopWords;\r\n }", "@Override\r\n\t\t\tpublic String[] getTerms(Document doc) {\n\t\t\t\treturn null;\r\n\t\t\t}", "private void addWords(){\n wordList.add(\"EGE\");\n wordList.add(\"ABBAS\");\n wordList.add(\"KAZIM\");\n }", "public List<Query> similarTerms() {\n return this.similarTerms;\n }", "public void getWord() {\n\t\t\n\t}", "@Test\n\tpublic void singleWordGrepTest3() throws Exception {\n\t\t// word is 'mistress'\n\t\tHashSet<String> grepFound = loadGrepResults(\"mistress\");\n\t\tCollection<Page> index = queryTest.query(\"mistress\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\t// tests set equality \n\t\tassertEquals(indexFound, grepFound);\n\t}", "private void allWordsListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_allWordsListMouseClicked\n \n String selectedWord = this.getAllWordsList().getSelectedValue();\n char firstLetterOfWord = selectedWord.charAt(0);\n \n // find the index of the corresponding tree tot he first letter of the word\n int index = -1;\n for(int i = 0 ; i < lexiNodeTrees.size() ; i++)\n {\n if(lexiNodeTrees.get(i).getCurrentCharacter() == firstLetterOfWord)\n {\n index = i;\n i = lexiNodeTrees.size();\n }\n }\n \n // find the word in the tree\n WordDefinition wordQuery = lexiNodeTrees.get(index).searchWord(selectedWord, true).get(0);\n \n // update definition field\n this.getDefinitionTextArea().setText(wordQuery.getDefinition());\n \n // display the word in the search field as well\n this.getSearchField().setText(selectedWord);\n \n // get search suggestion too\n searchWord();\n \n // select the same word in the search suggestion list \n ListModel<String> modelList = getSearchSuggestionList().getModel();\n \n for(int i = 0 ; i < modelList.getSize() ; i++)\n {\n if(modelList.getElementAt(i).equals(selectedWord))\n {\n getSearchSuggestionList().setSelectedIndex(i);\n i = modelList.getSize();\n }\n }\n \n }", "public static Set<String> getEnglishWords()\n{\n return english_words;\n}", "public static String getStopWords() throws IOException{\n\t\tString filepath1 = \"C:/Naveen/CCS/IR/AP89_DATA/AP_DATA/stoplist.txt\";\n\t\tPath path1 = Paths.get(filepath1);\n\t\tScanner scanner1 = new Scanner(path1);\n\t\tStringBuffer stopWords = new StringBuffer();\n\t\t\n\t\twhile (scanner1.hasNextLine()){\n\t\t\tString line = scanner1.nextLine();\n\t\t\tstopWords.append(line);\n\t\t\tstopWords.append(\"|\");\n\t } \n\t\t\n\t\tstopWords.append(\"document|discuss|identify|report|describe|predict|cite\");\n\t\tString allStopwords = stopWords.toString();\n\t\t//System.out.println(\"\"+allStopwords);\n\t\treturn allStopwords;\n\t}", "@Override\n\tpublic List<Affectation> getAllAfByKeyWord(String keString) {\n\t\treturn dao.getAllAfByKeyWord(keString);\n\t}", "@Test\n\tpublic void singleWordGrepTest1() throws Exception {\n\t\t// word is 'insane'\n\t\tHashSet<String> grepFound = loadGrepResults(\"insane\");\n\t\tCollection<Page> index = queryTest.query(\"insane\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\t// tests set equality with cardinality and one subset\n\t\tassertEquals(indexFound.size(), grepFound.size());\n\t\t\n\t\tHashSet<String> difference = new HashSet<String>(grepFound);\n\t\tdifference.removeAll(indexFound);\n\t\tassertEquals(0, difference.size());\n\t}", "private static void splitWord() {\n\t\tint i = 1;\r\n\t\tfor(String doc : DocsTest) {\r\n\t\t\tArrayList<String> wordAll = new ArrayList<String>();\r\n\t\t\tfor (String word : doc.split(\"[,.() ; % : / \\t -]\")) {\r\n\t\t\t\tword = word.toLowerCase();\r\n\t\t\t\tif(word.length()>1 && !mathMethod.isNumeric(word)) {\r\n\t\t\t\t\twordAll.add(word);\r\n\t\t\t\t\tif(!wordList.contains(word)) {\r\n\t\t\t\t\t\twordList.add(word);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\twordAll.removeAll(stopword);\r\n\t\t\tDoclist.put(i, wordAll);\r\n\t\t\ti++;\r\n\t\t}\r\n\t\twordList.removeAll(stopword);\r\n\t}", "public final ArrayList<String> GetStringsForCurrentTypeAndSystem(boolean otherStringsToo)\n {\n return MethodsUnitP.GetStringsTypeAndSystemCommon\n (\n \tUnitType, UnitSystem, otherStringsToo\n );\n }", "public static List<String> GetWordsOnly(String pathToAnnFile) throws FileNotFoundException {\r\n\r\n\r\n List<String> originalList = GetFullAnnotations(pathToAnnFile);\r\n List<String> finalList = new ArrayList<>();\r\n\r\n for (String anno : originalList) {\r\n String[] split_anno = anno.split(\"\\t\"); // split each line\r\n String annoWord = split_anno[2]; // extract word\r\n finalList.add(annoWord); // append word to list\r\n }\r\n return finalList;\r\n }", "public void computeWords(){\n\n loadDictionary();\n\n CharacterGrid characterGrid = readCharacterGrid();\n\n Set<String> wordSet = characterGrid.findWordMatchingDictionary(dictionary);\n\n System.out.println(wordSet.size());\n for (String word : wordSet) {\n\t System.out.println(word);\n }\n\n // System.out.println(\"Finish scanning character grid in \" + (System.currentTimeMillis() - startTime) + \" ms\");\n }", "@Override\n protected FilterResults performFiltering(CharSequence arg0) {\n String[] tmp = API.it().getKeywords(arg0.toString());\n FilterResults results = new FilterResults();\n results.values = tmp;\n results.count = tmp.length;\n return results;\n }", "private static void demonstrateListOperation(IndexWord word) throws JWNLException {\n PointerTargetNodeList hypernyms = PointerUtils.getInstance().getDirectHypernyms(word.getSense(1));\n System.out.println(\"Direct hypernyms of \\\"\" + word.getLemma() + \"\\\":\");\n for(int idx = 0; idx < hypernyms.size(); idx++){\n PointerTargetNode nn = (PointerTargetNode)hypernyms.get(idx);\n for(int wrdIdx = 0; wrdIdx < nn.getSynset().getWordsSize(); wrdIdx++){\n System.out.println(\"Syn\" + idx + \" of direct hypernyms of\\\"\" + word.getLemma() + \"\\\" : \" +\n nn.getSynset().getWord(wrdIdx).getLemma());\n }\n }\n hypernyms.print();\n }", "public List<BasicString> getTermsAlternative() {\n return termsAlternative;\n }", "@Test\n\tpublic void singleWordGrepTest2() throws Exception {\n\t\t// word is 'crazy'\n\t\tHashSet<String> grepFound = loadGrepResults(\"crazy\");\n\t\tCollection<Page> index = queryTest.query(\"crazy\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\t// tests set equality \n\t\tassertEquals(indexFound, grepFound);\n\t}", "public void addWords(int i) \n\t{\n\t\tFile myFile = new File(i);\n\t\tallWords.addAll(myFile.getAllWords());\n\t\tSystem.out.println(allWords);\n\t}", "public static List<Synset> getAllHyponymSynset(IndexWord word) throws JWNLException {\n List<Synset> result=new ArrayList<>();\n\n for(Synset wordSynset:word.getSenses()){\n PointerTargetTree hyponyms = PointerUtils.getInstance().getHyponymTree(wordSynset,4);\n PointerTargetTreeNode rootnode = hyponyms.getRootNode();\n LinkedList<PointerTargetTreeNode> stack = new LinkedList<>();\n if(rootnode==null){\n return result;\n }\n stack.add(rootnode);\n while(!stack.isEmpty()){\n PointerTargetTreeNode node = stack.pollLast();\n result.add(node.getSynset());\n PointerTargetTreeNodeList childList = node.getChildTreeList();\n if(childList!=null){\n for(int i=0;i<childList.size();i++){\n stack.add((PointerTargetTreeNode)childList.get(i));\n }\n }\n\n }\n\n }\n\n return result;\n }", "public ArrayList<String> getOther(HashMap<String, String> simplePOSTagged) {\n ArrayList other = new ArrayList();\n for(String word: simplePOSTagged.keySet()){\n if (simplePOSTagged.get(word).equals(\"other\")){\n other.add(word);\n }\n }\n return other;\n }", "public Set<String> getCommonTerms(Collection<String> main, Collection<String> searcher, Collection<String> stopwords, boolean lemmatised) {\n Set<String> result = new HashSet();\n\n List<String> newMain = new ArrayList();\n // Remove stopwords in new list\n for (String word : main) {\n if (!stopwords.contains(word.toLowerCase()))\n newMain.add(lemmatise(word.trim()));\n }\n // Get common words\n for (String word : searcher) {\n String nextWord = lemmatise(word.trim());\n if (newMain.contains(nextWord)) {\n if (lemmatised) result.add(nextWord.trim());\n else result.add(word.trim());\n }\n }\n\n return result;\n }", "public Collection<Term> getAll() {\n\t\treturn terms.values();\n\t}", "public List<String> getRandomWords(int numWords) throws Exception {\n\n List<String> randomWords = new ArrayList();\n\n List<Word> words = WordsApi.randomWords(true, null, null, 2, 0, 2, 0, 0, 0, null, null, numWords);\n\n for (Word word : words) {\n randomWords.add(word.getWord());\n }\n\n return randomWords;\n\n }", "@Override\n\tpublic List<Literature> searchKeywords() {\n\t\treturn null;\n\t}", "public DynamicArray<String> redactText()\n\t{\n\t\tfor (int i = 0; i < text.length(); i++)\n\t\t{\n\t\t\tif(!checkWord(text.get(i))) // checks if the word is listed to be redacted\n\t\t\t{\n\t\t\t\ttext.set(i, redact(text.get(i))); // Redacts word\n\t\t\t}\n\t\t\telse if (isNoun(i)) // Given the index this checks if the word is a noun, but ignores it if there is a full stop.\n\t\t\t{\n\t\t\t\twords.add(text.get(i)); // Since this is a noun, it is added to the list of redacted words\n\t\t\t\ttext.set(i, redact(text.get(i))); // Word is then redacted\n\t\t\t}\n\t\t}\n\t\t\n\t\tint i = 0;\n\t\tint check;\n\t\twhile (i < fullStops.length()) // Loops through full stop points and checks the word that follows it\n\t\t{\n\t\t\tcheck = fullStops.get(i);\n\t\t\tif(!checkWord(text.get(check)))\n\t\t\t{\n\t\t\t\ttext.set(check, redact(text.get(check)));\n\t\t\t}\n\t\t\ti++;\n\t\t\t\t\n\t\t}\n\t\treturn text;\n\t}", "public String [] get_word_array(){\n\t\treturn word_array;\n\t}", "public static LinkedList<Word> getPracticedWords() {\n return favWords;\n }", "public ArrayList<SearchResult> partialSearch(String[] searchWords) {\n\t\tArrayList<SearchResult> words = new ArrayList<>();\n\t\tHashMap<String, SearchResult> resultMap = new HashMap<>();\n\t\tfor (String word : searchWords) {\n\t\t\tfor (String key : index.tailMap(word, true).navigableKeySet()) {\n\t\t\t\tif (key.startsWith(word)) {\n\t\t\t\t\twordSearch(key, resultMap, words);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tCollections.sort(words);\n\t\treturn words;\n\t}", "private List<String> whitespaceSuggestions(String givenWord) {\n List<String> whitespaceWords = new ArrayList<>();\n for (int i = 1; i < givenWord.length() - 1; i++) {\n if (corpus.contains(givenWord.substring(0, i) + \" \"\n + givenWord.substring(i))) {\n whitespaceWords.add(givenWord.substring(0, i) + \" \"\n + givenWord.substring(i));\n } else if (corpus.contains(givenWord.substring(0, i))) {\n whitespaceWords.add(givenWord.substring(0, i));\n } else if (corpus.contains(givenWord.substring(i))) {\n whitespaceWords.add(givenWord.substring(i));\n }\n\n if (shortenings.contains(givenWord.substring(0, i))) {\n String fullWord = courseMappings.get(givenWord.substring(0, i));\n if (!givenWord.contains(fullWord)) {\n whitespaceWords.add(fullWord + \" \" + givenWord.substring(i));\n }\n\n }\n\n }\n\n return whitespaceWords;\n }", "private String[] mixedWords(String[] words)\n {\n String[] output = new String[words.length];\n for(int i = 0; i < words.length; i++){\n if(i%2==0){\n output[i] = recombine(words[i], words[i+1]);\n } else {\n output[i] = recombine(words[i], words[i-1]);\n }\n }\n return output;\n }", "public PorterStopWords()\r\n\t{\r\n\t\tstopWordsSet.addAll( porterStopWordsSet );\r\n\t}", "public static List<Synset> getAllMeronymSynset(IndexWord word) throws JWNLException {\n List<Synset> result=new ArrayList<>();\n\n for(Synset wordSynset:word.getSenses()){\n PointerTargetTree hyponyms = PointerUtils.getInstance().getInheritedMeronyms(wordSynset,4,4);\n PointerTargetTreeNode rootnode = hyponyms.getRootNode();\n LinkedList<PointerTargetTreeNode> stack = new LinkedList<>();\n if(rootnode==null){\n return result;\n }\n stack.add(rootnode);\n while(!stack.isEmpty()){\n PointerTargetTreeNode node = stack.pollLast();\n result.add(node.getSynset());\n PointerTargetTreeNodeList childList = node.getChildTreeList();\n if(childList!=null){\n for(int i=0;i<childList.size();i++){\n stack.add((PointerTargetTreeNode)childList.get(i));\n }\n }\n\n }\n\n }\n\n return result;\n }", "public void set_graph() throws ParseException, IOException {\n \tg = new WeightedUndirectedGraph(words.length);\n //g = new WeightedUndirectedGraph(most_important_terms.size());\n \n Directory dir = new SimpleFSDirectory(new File(\".\\\\data\\\\lucene_index_r_r\"));\n Analyzer analyzer = new StandardAnalyzer(LUCENE_41);\n \n // creat a map that stores, for each word (in the cluster), a set of all the documents that contain that word\n HashMap<String,HashSet<Integer>> word_to_docs_map = new HashMap<String,HashSet<Integer>>();\n int n_strings = words.length; \n \n // for each word...\n for (int idx = 0; idx < n_strings; idx++) {\n // query the index with that given word and retrieve all the documents that contains that word\n String query = words[idx]; \n QueryParser parser = new QueryParser(Version.LUCENE_41, \"text\", analyzer); \n Query q = parser.parse(query); \n\n IndexReader reader = DirectoryReader.open(dir);\n IndexSearcher searcher = new IndexSearcher(reader);\n TopDocs docs = searcher.search(q, reader.numDocs());\n ScoreDoc[] hits = docs.scoreDocs;\n \n // update map from word to docs it appears in \n //HashSet<Integer> tmp = null;\n // tmp is the set of all the document ids in which the current word is contained\n HashSet<Integer> tmp = new HashSet<>();\n //word_to_docs_map.put(query, tmp);\n \n // for each document, retrieved from the query\n for(Integer i=0;i<hits.length;i++) {\n Integer docId = hits[i].doc;\n // tmp = word_to_docs_map.get(query); \n // if the document is a document written by an user of interest \n if(indices.contains(docId)) {\n tmp.add(docId);\n }\n //word_to_docs_map.put(query, tmp); \n }\n word_to_docs_map.put(query, tmp);\n\t }\n\t \n\t // add edges: iterate over possible term pairs ...\n\t for(int idx_1 = 0; idx_1 < n_strings - 1; idx_1++) {\n\t \n\t for(int idx_2 = idx_1 + 1 ; idx_2 < n_strings ; idx_2 ++ ) {\n\t \n\t // extract document sets associated with the considered terms \n\t HashSet<Integer> set_a = word_to_docs_map.get(words[idx_1]); \n\t HashSet<Integer> set_b = word_to_docs_map.get(words[idx_2]); \n\t \n\t // compute set intersection \n\t int n = intersectionSize(set_a, set_b);\n\t \n\t // if the terms appear in at least one common document\n\t if(n>0) {\n\t // add edge \n\t g.testAndAdd(idx_1, idx_2 , n); \n\t }\n\t } \n\t }\n\t}", "private ArrayList<WordDocument> executeAdvancedQuery(){\n ArrayList<WordDocument> documents = customDijkstrasTwoStack(this.query.split(\" \"));\n ArrayList<WordDocument> result = new ArrayList<WordDocument>();\n\n try{\n String[] orderByPart = query.substring(query.indexOf(\"ORDERBY\")).trim().toLowerCase().split(\" \");\n if(isOrderByCommand(orderByPart[0]))\n result = orderBy(documents, orderByPart[1], orderByPart[2]);\n }catch (StringIndexOutOfBoundsException ex){\n result = documents;\n }\n\n return result;\n }", "@Test\n public void printAllWords() {\n // TODO\n }", "public static ArrayList<String> findWords(TrieNode root) {\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\tgetWords(root, \"\", result);\n\t\treturn result;\n\t}", "public Collection<T> getOthers() {\n return others;\n }", "List<VocabWord> document(int index);" ]
[ "0.6683834", "0.63288605", "0.60075307", "0.5970147", "0.5862826", "0.5859984", "0.58519155", "0.5818616", "0.57877696", "0.57772887", "0.57062596", "0.5672519", "0.5668082", "0.56145406", "0.5612684", "0.5563824", "0.55119944", "0.550613", "0.54892987", "0.5488961", "0.54867476", "0.5484216", "0.5478647", "0.5477962", "0.5467526", "0.54585654", "0.54574835", "0.5407511", "0.5400108", "0.53965956", "0.5380105", "0.53677", "0.5366047", "0.5360735", "0.5359129", "0.53370553", "0.53344905", "0.5329311", "0.5322003", "0.5297501", "0.5297448", "0.5294027", "0.5292795", "0.52726495", "0.5249178", "0.5241796", "0.5237376", "0.52354527", "0.52325404", "0.5229205", "0.52278227", "0.52264744", "0.522249", "0.5214448", "0.5213645", "0.5213645", "0.52132887", "0.52065766", "0.52062374", "0.5201753", "0.5194637", "0.5172482", "0.5158054", "0.514881", "0.51451224", "0.5143833", "0.51387954", "0.5137619", "0.51346004", "0.51320964", "0.5126617", "0.51226324", "0.5114986", "0.50959784", "0.5095697", "0.50912124", "0.50835204", "0.5083114", "0.5078823", "0.50551194", "0.5053635", "0.5044055", "0.5039378", "0.50331753", "0.5032151", "0.502768", "0.502248", "0.5021816", "0.5011882", "0.50062335", "0.500186", "0.5000975", "0.49871063", "0.49844384", "0.4979746", "0.49788868", "0.4976851", "0.49605525", "0.49602985", "0.49561593", "0.4947553" ]
0.0
-1
[NEW] Hashes the string to unique int representation
public static String hash(String token){ return Integer.toString( token.hashCode() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int toHashKey(String s)\n\t{\n\t\tint A = 1952786893;\n\t\tint B = 367257;\n\t\tint v = B;\n\t\tfor (int j = 0; j < s.length(); j++)\n\t\t{\n\t\t\tchar c = s.charAt(j);\n\t\t\tv = A * (v + (int) c + j) + B;\n\t\t}\n\n\t\tif (v < 0) v = -v;\n\t\treturn v;\n\t}", "private int hash(String string) {\n\t\tint hash = 0;\n\t\tint temp = 0;\n\n\t\tfor (byte b : string.toLowerCase().getBytes(StandardCharsets.US_ASCII)) {\n\t\t\thash = (hash << 4) + b;\n\t\t\ttemp = hash & 0xF0000000;\n\n\t\t\tif (temp != 0) {\n\t\t\t\thash = hash ^ (temp >>> 24);\n\t\t\t\thash = hash ^ temp;\n\t\t\t}\n\t\t}\n\n\t\treturn hash;\n\t}", "public static long stringHashCode(String string){\r\n\t\t// return number value if number, otherwise use string hash code\r\n\t\tboolean isNumber = true;\r\n\t\tfor(int i = 0; i < string.length(); i++){\r\n\t\t\tif(i == 0 && string.charAt(i) == '-') continue;\r\n\t\t\tif(Character.isDigit(string.charAt(i)) == false){\r\n\t\t\t\tisNumber = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(isNumber){\r\n\t\t\ttry{\r\n\t\t\t\treturn Long.parseLong(string);\r\n\t\t\t} catch(NumberFormatException ex){\r\n\t\t\t\t// not a number, do nothing\r\n\t\t\t}\r\n\t\t}\r\n\t\tlong h = 0;\r\n\t\tfor (int i = 0; i < string.length(); i++) {\r\n\t\t\th = 31*h + string.charAt(i);\r\n\t\t}\r\n\t\treturn h;\r\n\t}", "public int hashCode(String str) {\n\t\tchar[] s = str.toCharArray();\n\t\tint total = 1;\n\t\tfor (char value : s) {\n\t\t\ttotal = 34 * total + value;\n\t\t}\n\t\ttotal = Math.abs(total);\n\t\tif(HashTester.useJavaAPIForHashCodeFunction)\n\t\t\ttotal = Math.abs(str.hashCode());\n\t\twhile (total > HashTester.hashTableSize) {\n\t\t\ttotal %= HashTester.hashTableSize;\n\t\t}\n\t\treturn total;\n\t}", "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 }", "@Override\n\tpublic int hash(String str) {\n\t\tint result = 0;\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tint temp = (int) str.charAt(i);\n\t\t\tresult += (temp * (Math.pow(37, i)));\n\t\t}\n\t\treturn result;\n\t}", "public long JSHash(String str) {\n\t\tlong hash = 1315423911;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash ^= ((hash << 5) + str.charAt(i) + (hash >> 2));\n\t\t}\n\n\t\treturn hash;\n\t}", "public int hashCode(String s){\r\n int length = s.length();\r\n int h = 0;\r\n for(int i = 0; i < length; i++){\r\n h = h + ((int)s.indexOf(i))*(37^(length - 1));\r\n }\r\n return h;\r\n }", "@Override\n\tpublic int hash(String item) {\n\t\tlong hashCode = 0l;\n\t\tchar[] c = item.toCharArray();\n\t\tfor (int i = 0; i < c.length; i++) {\n\t\t\thashCode += c[i] * Math.pow(31, c.length - (i + 1));\n\t\t}\n\t\tint i = (int) hashCode % 2147483647;\n\n\t\n\t\treturn Math.abs(i);\n\t\t\n\t}", "private static String normalizeID(String id) {\r\n\t\tint hashcode = id.hashCode();\r\n\t\tboolean positive = hashcode >= 0;\r\n\t\tlong longcode = positive ? (long) hashcode : -(long) hashcode;\r\n\t\tStringBuffer hexstring = new StringBuffer(Long.toHexString(longcode));\r\n\t\twhile (hexstring.length() < 8) {\r\n\t\t\thexstring.insert(0, '0');\r\n\t\t}\r\n\t\tif (positive) {\r\n\t\t\thexstring.insert(0, '0');\r\n\t\t} else {\r\n\t\t\thexstring.insert(0, '1');\r\n\t\t}\r\n\t\treturn hexstring.toString();\r\n\t}", "private static int initHash() {\n return 0x811c9DC5; // unsigned 2166136261\n }", "public static int hash(String key) {\n int result = 1;\n\n for (int i=0; i<key.length(); ++i) {\n char c = key.charAt(i);\n int c_int = (int) c; //Gjør om ved å bruke ascii-tabellen ('A' = 65, ...\n\n result = (result*31) + c_int;\n }\n\n if (result < 0) {\n result = result * -1;\n }\n\n return result;\n }", "private int hashFunc(String input) {\n\t\tBigInteger value = BigInteger.valueOf(0);\n\t\tBigInteger k2 = new BigInteger(\"27\");\n\t\tchar c = input.charAt(0);\n\t\tlong i1 = (int) c - 96;\n\t\tBigInteger k1 = new BigInteger(\"0\");\n\t\tk1 = k1.add(BigInteger.valueOf(i1));\n\t\tvalue = k1;\n\n\t\tfor (int i = 1; i < input.length(); i++) {\n\n\t\t\tchar c2 = input.charAt(i);\n\n\t\t\tvalue = value.multiply(k2);\n\n\t\t\tlong i2 = (int) c2 - 96;\n\t\t\tBigInteger k3 = new BigInteger(\"0\");\n\t\t\tk3 = k3.add(BigInteger.valueOf(i2));\n\n\t\t\tvalue = value.add(k3);\n\n\t\t}\n\t\tBigInteger size = new BigInteger(\"0\");\n\t\tsize = size.add(BigInteger.valueOf(this.size));\n\t\tvalue = value.mod(size);\n\n\t\treturn value.intValue();\n\t}", "public long APHash(String str) {\n\t\tlong hash = 0xAAAAAAAA;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tif ((i & 1) == 0) {\n\t\t\t\thash ^= ((hash << 7) ^ str.charAt(i) * (hash >> 3));\n\t\t\t} else {\n\t\t\t\thash ^= (~((hash << 11) + str.charAt(i) ^ (hash >> 5)));\n\t\t\t}\n\t\t}\n\n\t\treturn hash;\n\t}", "public static int stringToDictId(String str) {\n try {\n byte[] bytes = str.getBytes(\"ISO-8859-1\");\n return BytesUtil.readUnsigned(bytes, 0, bytes.length);\n } catch (UnsupportedEncodingException e) {\n // never happen\n return 0;\n }\n }", "public int stringIntegerEncoding(String str) {\n if (!str.matches(\"[0-9-]+\"))\n return -1;\n\n char[] strArr = str.toCharArray();\n int number = (strArr[0] != '-') ? Character.getNumericValue(strArr[0]) : 0;\n for (int i =1; i < strArr.length; i++) {\n number = 10*number + Character.getNumericValue(strArr[i]);\n }\n return (strArr[0] == '-')? -number : number;\n }", "public long BPHash(String str) {\n\t\tlong hash = 0;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = hash << 7 ^ str.charAt(i);\n\t\t}\n\n\t\treturn hash;\n\t}", "public static int stringToInt(String aKey){\r\n\t\t\r\n\t\tint pseudoKey = 0;\r\n\t\tint n = 1;\r\n\t\tint cn = 0;\r\n\t\tchar c[] = aKey.toCharArray();\r\n\t\tint grouping = 0;\r\n\t\t\r\n\t\twhile(cn < aKey.length()){\r\n\t\t\t\r\n\t\t\tgrouping = grouping << 8;\r\n\t\t\tgrouping += c[cn];\r\n\t\t\tcn++;\r\n\t\t\t\r\n\t\t\tif(n == 4 || cn == aKey.length()){\r\n\t\t\t\tpseudoKey += grouping;\r\n\t\t\t\tn = 0;\r\n\t\t\t\tgrouping = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tn++;\r\n\t\t\t\r\n\t\t}// End of while loop\r\n\t\treturn Math.abs(pseudoKey);\r\n\t\t\r\n\t}", "public String doHash2(String str) {\n if(str.length() == 1) return \"-1\";\n\n String key = \"\";\n for (int i = 0; i < str.length() - 1; i++) {\n int val = str.charAt(i + 1) - str.charAt(i);\n if (val < 0) val = 26 + val;\n key += val + \"_\";\n }\n return key;\n }", "public int hash(String w){\n return (Math.abs(w.hashCode()) % hashTable.length);\n }", "private int getHash(String word){\n\t\tif (word == null){\n\t\t\treturn INVALID;\n\t\t}\n\n\t\tint hash = 52;\n\t\tif ((word.charAt(0) >= 'a') && (word.charAt(0) <= 'z')){\n\t\t\thash = word.charAt(0) - 'a';\n\t\t}\n\t\telse if ((word.charAt(0) >= 'A') && (word.charAt(0) <= 'Z')){\n\t\t\thash = word.charAt(0) - 'A' + 26;\n\t\t}\n\t\treturn hash;\n\t}", "private int hasher() {\n int i = 0;\n int hash = 0;\n while (i != length) {\n hash += hashableKey.charAt(i++);\n hash += hash << 10;\n hash ^= hash >> 6;\n }\n hash += hash << 3;\n hash ^= hash >> 11;\n hash += hash << 15;\n return getHash(hash);\n }", "private int hash(String str, int h){\n int v=0;\n\n /* FILL IN HERE */\n v = Math.floorMod(MurmurHash.hash32(str, seeds[h]) >>> h, 1 << logNbOfBuckets);\n\n return v;\n }", "public static int stringHash(String str) {\r\n return str.hashCode();\r\n }", "@Override\n\tpublic long getHashCode(String key) {\n\t\tlong hash = 0;\n\t\tlong b = 378551;\n\t\tlong a = 63689;\n\t\tint tmp = 0;\n\t\tfor (int i = 0; i < key.length(); i++) {\n\t\t\ttmp = key.charAt(i);\n\t\t\thash = hash * a + tmp;\n\t\t\ta *= b;\n\t\t}\n\t\treturn hash;\n\t}", "private String generateId(String input) {\n\t\treturn StringUtil.hashSHA256(input);\n\t}", "public static final int hash32(String key)\r\n {\n return hash32(key.getBytes());\r\n //So pre JDK7 could try suggestion from here: http://blog.rapleaf.com/dev/2010/04/26/faster-string-to-utf-8-encoding-in-java/\r\n // return hash32(fastStringToBytes(key));\r\n }", "public static int m2197ao(String str) {\n try {\n return Integer.valueOf(str).intValue();\n } catch (Exception e) {\n return -1;\n }\n }", "public void encodeInt() {\n charToInt = new int[uniqueChars.size()];\n Iterator<Character> mover = uniqueChars.iterator();\n for(int b = 0; b < uniqueChars.size(); b++) {\n charToInt[b] = mover.next();\n }\n System.out.print(\"\\nEncoding integer value to its ASCII characters:\\n\");\n intToChars = new char[uniqueChars.size()];\n for(int c = 0; c < uniqueChars.size(); c++) {\n intToChars[c] = (char)charToInt[c];\n charToInt[c] = charToInt[c] / charToInt[c] + c - 1;\n System.out.print(charToInt[c] + \" : \" + intToChars[c] + \", \");\n }\n\n }", "public long SDBMHash(String str) {\n\t\tlong hash = 0;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = str.charAt(i) + (hash << 6) + (hash << 16) - hash;\n\t\t}\n\n\t\treturn hash;\n\t}", "public static String getCheckNumber(String paramString){\n int i =paramString.substring(0, 1).getBytes()[0];\n for(int j=1;;j++){\n if(j>=paramString.length())\n return intToHex(Integer.valueOf(i));\n i=(byte)(i^paramString.substring(j, j+1).getBytes()[0]);\n\n }\n }", "public int hash(String item);", "public String doHash(String str) {\n String key = \"\";\n int offset = str.charAt(0) - 'a';\n for (int i=0; i<str.length(); i++) {\n char res = str.charAt(i) - offset;\n if (res < 'a') res += 26;\n key += res;\n }\n return key;\n }", "public long ELFHash(String str) {\n\t\tlong hash = 0;\n\t\tlong x = 0;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = (hash << 4) + str.charAt(i);\n\n\t\t\tif ((x = hash & 0xF0000000L) != 0) {\n\t\t\t\thash ^= (x >> 24);\n\t\t\t}\n\t\t\thash &= ~x;\n\t\t}\n\n\t\treturn hash;\n\t}", "public static final String hash(final String string) {\n\t\treturn Hex.fromByteArray(digest(string));\n\t}", "private int calculateHash(int id, String uri) {\n\t\treturn uri.hashCode() * Constants.HASH_PRIMES[0]\n\t\t\t\t+ Integer.toString(id).hashCode() * Constants.HASH_PRIMES[1];\n\t}", "@Override\r\n public int hashCode() {\n return id % 10;\r\n }", "public static long hashName(String name) {\n\t\t\tlong res = 123;\n\t\t\tfor (int i = 0; i < name.length(); ++i) {\n\t\t\t\tres = (res << 8) | (res >>> 56);\n\t\t\t\tres += name.charAt(i);\n\t\t\t\tif ((res & 1) == 0) {\n\t\t\t\t\tres ^= 0x00000000feabfeabL; // Some kind of feedback\n\t\t\t\t}\n\t\t\t}\n\t\t\tres |= 0x8000000000000000L; // Make sure the hash is negative (to distinguish it from database id's)\n\t\t\treturn res;\n\t\t}", "public static int convertStringToInt(String input){\n\t if(input.length()==0)\n\t return 0;\n\t \n\t int m=(int)input.charAt(0)-48;\n\t int n=input.length();\n\t \n\t while(n!=1)\n\t {\n\t m*=10;\n\t n--;\n\t }\n\t \n\t return m+convertStringToInt(input.substring(1,input.length()));\n\t \n\t \n\t\t\n\t}", "int hash(String makeHash, int mod);", "private static int getIntValue(String s) {\n try {\n return Integer.parseInt(s, 16);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n return -1;\n }\n }", "public static String hash(String st) {\r\n MessageDigest messageDigest = null;\r\n byte[] digest = new byte[0];\r\n\r\n try {\r\n messageDigest = MessageDigest.getInstance(\"SHA-256\");\r\n messageDigest.reset();\r\n messageDigest.update(st.getBytes());\r\n digest = messageDigest.digest();\r\n } catch (NoSuchAlgorithmException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n BigInteger bigInt = new BigInteger(1, digest);\r\n StringBuilder hex = new StringBuilder(bigInt.toString(16));\r\n\r\n while (hex.length() < 32) {\r\n hex.insert(0, \"0\");\r\n }\r\n\r\n return hex.toString();\r\n }", "private int hashOf(String key) {\n return key.length();\n }", "public int hashCode() {\n/* 389 */ return this.m_str.hashCode();\n/* */ }", "private static int letterToNumber(String str) {\n return (\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\".indexOf(str))%26+1;\n }", "public static String m106643a(String str) {\n try {\n return m106642a(Integer.valueOf(str));\n } catch (Exception unused) {\n return \"\";\n }\n }", "@Override\n\tpublic int hashCode() {\n\t\treturn Integer.parseInt(sid);\n\t}", "public static String hash(String in) {\r\n\t\treturn DigestUtils.md5Hex(in.getBytes());\r\n\t}", "public int hash2 ( String key )\n {\n int hashVal = 0;\n if(key != null){\n for( int i = 0; i < key.length(); i++ )\n hashVal = (37 * hashVal) + key.charAt(i);\n //if(hashVal != 0)\n return hashVal % tableSize;\n //else\n // return 0;\n }\n else{\n //System.out.println(\"Key is null\");\n return 0;\n }\n }", "public int hashcode();", "int decodeInt();", "public static int intFromHexString(CharSequence str) {\n\t\tint n = 0;\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tchar c = str.charAt(i);\n\t\t\tint v = c <= '9' ? c - '0' : c - 'a' + 10;\n\t\t\tn <<= 4;\n\t\t\tn |= (v & 0x0f);\n\t\t}\n\t\treturn n;\n\t}", "public long DEKHash(String str) {\n\t\tlong hash = str.length();\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = ((hash << 5) ^ (hash >> 27)) ^ str.charAt(i);\n\t\t}\n\n\t\treturn hash;\n\t}", "@Test\n public void testHashCode() {\n LOGGER.info(\"testHashCode\");\n final String value = \"Hello\";\n final int actual = new AtomString(value).hashCode();\n final int expected = 61 * 7 + Objects.hashCode(value);\n assertEquals(expected, actual);\n }", "String getIntegerEncoding();", "public int hashCode() {\n\t\treturn hashString.hashCode();\n\t}", "public static int randomHashOfString(String s)\r\n\t{\r\n\t\tBigInteger hash=FNV64INIT;\r\n\t\tfor(int j=0;j<s.length();j++)\r\n\t\t{\r\n\t\t\thash=hash.xor(BigInteger.valueOf(s.charAt(j)));\r\n\t\t\thash=hash.multiply(FNV64PRIME).mod(TWO.pow(64));\r\n\t\t}\r\n\t\treturn hash.intValue();\r\n\t}", "public long DJBHash(String str) {\n\t\tlong hash = 5381;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = ((hash << 5) + hash) + str.charAt(i);\n\t\t}\n\n\t\treturn hash;\n\t}", "public int hash(String key){\r\n\t\tint i;\r\n\t\tint v = 0;\r\n\t\tfor(i = 0; i < key.length(); i++)\r\n\t\t\tv += key.charAt(i);\r\n\t\treturn v % M;\r\n\t}", "public long BKDRHash(String str) {\n\t\tlong seed = 131; // 31 131 1313 13131 131313 etc..\n\t\tlong hash = 0;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = (hash * seed) + str.charAt(i);\n\t\t}\n\n\t\treturn hash;\n\t}", "public int numDecodings(String s) {\n if(s==null||s.length()==0){\n return 0;\n }\n\n int n=s.length();\n int[] mem=new int[n+1];\n\n mem[n]=1;\n if(Integer.parseInt(s.substring(n-1))!=0){\n mem[n-1]=1;\n }\n\n for(int i=n-2;i>=0;i--){\n if(Integer.parseInt(s.substring(i,i+1))==0){\n continue;\n }\n if(Integer.parseInt(s.substring(i,i+2))<26){\n mem[i]=mem[i+1]+mem[i+2];\n }else{\n mem[i]=mem[i+1];\n }\n }\n\n return mem[0];\n }", "int toInt(String a){\n\t\tint name=0;\r\n\t\tfor(int i=0;i<a.length();i++){\r\n\t\t\tname+=(int)a.charAt(i);\r\n\t\t}\r\n\t\treturn name;\r\n\t}", "public int hashCode(){\n\t\treturn toString().hashCode();\n\t}", "@Override\r\n public int hashCode() {\n int key=(Integer)(this.capsule.get(0)); // Get the key\r\n Integer bkey=Integer.parseInt(Integer.toBinaryString(key)); // Convert into binary \r\n int n=setcount(bkey); //counts the number of 1's in the binary\r\n key=key*n + Objects.hashCode(this.capsule.get(0)); //multiplies that with the hashcode of the pId\r\n return key;\r\n }", "public int mo29670a(String str) {\n int length = str.length();\n int i = this.f19526c;\n for (int i2 = 0; i2 < length; i2++) {\n i = (i * 33) + str.charAt(i2);\n }\n if (i == 0) {\n return 1;\n }\n return i;\n }", "public static int toInt(String str){\r\n\t\tInteger i = toInteger(str);\r\n\t\treturn i==null?0:i;\r\n\t}", "@Override\n public int hashCode() {\n int result = 42;\n int prime = 37;\n for (char ch : key.toCharArray()) {\n result = prime * result + (int) ch;\n }\n result = prime * result + summary.length();\n result = prime * result + value;\n return result;\n }", "public static long hash(String stringToHash) {\n byte[] data;\n try {\n data = stringToHash.getBytes(\"UTF-8\");\n long h = HSTART;\n final long hmult = HMULT;\n final long[] ht = byteTable;\n for (int len = data.length, i = 0; i < len; i++) {\n h = (h * hmult) ^ ht[data[i] & 0xff];\n }\n return h;\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n throw new AssertionError(\"Hash failures on encoding\");\n }\n }", "String toStringAsInt();", "@Override\r\n\tpublic int hashCode() {\n\t\tint result = 17;\r\n\t\tresult = 37*result+(int) (id ^ (id>>>32));\r\n\t\t//result = 37*result+(name==null?0:name.hashCode());\r\n\t\t//result = 37*result+displayOrder;\r\n\t\t//result = 37*result+(this.url==null?0:url.hashCode());\r\n\t\treturn result;\r\n\t}", "static int sherlockAndAnagrams(String s) {\n HashTable hashTable = new HashTable(s.length() * s.length() * 4);\n substrings(s).map(Solution::ordered).forEach(hashTable::insert);\n return substrings(s).map(Solution::ordered).mapToInt(s1 -> {\n hashTable.remove(s1);\n return hashTable.count(s1);\n }).sum();\n }", "public long PJWHash(String str) {\n\t\tlong BitsInUnsignedInt = (long) (4 * 8);\n\t\tlong ThreeQuarters = (long) ((BitsInUnsignedInt * 3) / 4);\n\t\tlong OneEighth = (long) (BitsInUnsignedInt / 8);\n\t\tlong HighBits = (long) (0xFFFFFFFF) << (BitsInUnsignedInt - OneEighth);\n\t\tlong hash = 0;\n\t\tlong test = 0;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = (hash << OneEighth) + str.charAt(i);\n\n\t\t\tif ((test = hash & HighBits) != 0) {\n\t\t\t\thash = ((hash ^ (test >> ThreeQuarters)) & (~HighBits));\n\t\t\t}\n\t\t}\n\n\t\treturn hash;\n\t}", "protected static final int getUnitId(String inputHex) {\r\n\t\t\r\n\t\tString msb = inputHex.substring(0, 2);\r\n\t\tString lsb = inputHex.substring(2, 4);\r\n\r\n\t\tint val = ( Integer.parseInt(msb, 16) * 256 ) + ( Integer.parseInt(lsb, 16) * 1 );\r\n//\t\tGQDKPMConstants.logger.debug(\"incoming lsb = \" + lsb +\" lsb hex-dec = \"+Integer.parseInt(lsb, 16) * 1 +\r\n//\t\t\t\t\" , msb = \"+ msb + \" msb hex-dec = \"+Integer.parseInt(msb, 16) * 256 + \" , val = \" + val );\r\n\t\treturn val;\r\n\t}", "public String intToString(String s) {\r\n int x = s.length();\r\n char[] bytes = new char[4];\r\n for(int i = 3; i > -1; --i) {\r\n bytes[3 - i] = (char) (x >> (i * 8) & 0xff);\r\n }\r\n return new String(bytes);\r\n }", "@SuppressWarnings(\"WeakerAccess\")\n abstract public int hash(char c);", "public static int hashCode(String str, int b) {\n\tint result = 0;\n\tfor(int i = 0; i < str.length(); i++) {\n\t\tresult += (str.charAt(i)) * (int)Math.pow(b, str.length() - (1+i));\n\t\t}\n\treturn result;\n\t}", "@Override\n public int hashCode() {\n return String.valueOf(this).hashCode();\n }", "public int hash3 ( String key )\n {\n int hashVal = 0;\n if(key != null){\n for( int i = 0; i < key.length(); i++ ){\n hashVal = (37 * hashVal) + key.charAt(i);}\n hashVal %= tableSize;\n if(hashVal<0)\n hashVal += tableSize; \n if(hashVal != 0)\n return hashVal;\n else\n return 0;\n }\n else\n {\n //System.out.println(\"Key is null\");\n return 0;\n }\n }", "public static String uniqueChar(String str){\n\n char[] ch=str.toCharArray();\n str=\"\";\n HashMap<Character,Integer> map=new HashMap<>();\n for(int i=0;i<ch.length;i++)\n {\n if(map.containsKey(ch[i]));\n else\n {\n str+=ch[i];\n map.put(ch[i],1);\n }\n }\n \n return str;\n\t}", "@Override\n public int hashCode() {\n if (!(uuid instanceof String)) {\n uuid = UUID.randomUUID().toString();\n }\n\n return uuid.hashCode();\n }", "public static int hashCodeForStrings(String... strings) {\n\t\tint hash = 0;\n\t\tfor(String str : strings) {\n\t\t\tfor(int i=0;i<str.length();++i) {\n\t\t\t\thash = 31 * hash + str.charAt(i);\n\t\t\t}\n\t\t}\n\t\treturn hash;\n\t}", "public int firstUniqChar2(String s) {\r\n \r\n char[] arr= s.toCharArray();\r\n int index = -1;\r\n HashMap<Character, Integer> map = new HashMap<>();\r\n \r\n for (int i=0;i<arr.length;i++){\r\n if (map.containsKey(arr[i])){\r\n map.put(arr[i], -1);\r\n } else {\r\n map.put(arr[i],i);\r\n }\r\n }\r\n \r\n for (int i : map.values()){\r\n if (i >-1){\r\n if (index == -1){\r\n index = i;\r\n } else if (i<index) {\r\n index = i; \r\n }\r\n \r\n }\r\n }\r\n \r\n return index;\r\n }", "public boolean isUnique(String s){\n // int[] visited = new int[256]; // O:256\n int[] visited = new int[8]; // int = 4 bytes = 32 bits, 8 ints = 32 bytes = 256 bits\n char[] array = s.toCharArray();\n for(char c:array){\n // for a value c in range of 0 - 256\n // it maps to the int at c/32 as index\n // it also maps the c%32 as the index of bits\n if(((visited[c/32] >>> (c%32)) & 1) != 0){\n // bit-tester of the k-th bits, k = c%32\n return false;\n }\n // bit-setter to 1 in the k-th bits\n visited[c/32] |= 1 << (c%32);\n }\n return true;\n }", "private static int firstUniqChar2(String s) {\n Map<Character, Integer> seen = new HashMap<>();\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n seen.put(c, seen.getOrDefault(c, 0) + 1);\n }\n\n int uniqueIdx = -1;\n for (int i = 0; i < s.length(); i++) {\n if (seen.get(s.charAt(i)) == 1) {\n uniqueIdx = i;\n break;\n }\n }\n\n return uniqueIdx;\n }", "static int getKey(String raw) {\n\t\tint key = 0;\n\t\tfor (int i = 0; i < raw.length(); i++) {\n\t\t\tkey = key * HASH_VALUE + raw.charAt(i);\n\t\t}\n\t\tif (key < 0) {\n\t\t\tkey = -key;\n\t\t}\n\t\treturn key % HASH_SIZE;\n\t}", "int getHash();", "public static String generateId(String s){\n\t\tString date = LocalDate.now().format(DateTimeFormatter.ofPattern(\"yyMMdd\"));\n\t\tString key = s +\"_\" + date;\n\t\t//com.incr(key);\n\t\tredisTemplate.opsForValue().increment(key);\n\t\tInteger num = redisTemplate.opsForValue().get(key);\n\t\treturn date + \"-\" + String.format(\"%08d\",num);\n\t}", "public int hash1 ( String key )\n {\n int hashVal = 0;\n if(key != null){\n for( int i = 0; i < key.length(); i++ )\n hashVal += key.charAt(i);\n \n //if(hashVal != 0)\n return hashVal % tableSize;\n //else\n // return 0;\n }\n else{\n //System.out.println(\"Key is null\");\n return 0 ;\n }\n\n }", "public BigInteger hash(String element)\n\t{ \n\t\treturn (BigInteger.valueOf(element.hashCode())).mod(modulus);\n\t}", "@Override\n public int hexToInt(String source) {\n try {\n return Integer.parseInt(source, 16);\n } catch (NumberFormatException nfe) {\n return 0;\n }\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 static String toAscii(String s){\r\n StringBuilder sb = new StringBuilder();\r\n long asciiInt;\r\n // loop through all values in the string, including blanks\r\n for (int i = 0; i < s.length(); i++){\r\n //getting Ascii value of character and adding it to the string.\r\n char c = s.charAt(i);\r\n asciiInt = (int)c; \r\n sb.append(asciiInt);\r\n }\r\n return String.valueOf(sb);\r\n }", "private static int hashCode(byte key) {\n return (int) key;\n }", "public int titleToNumber(String s) {\n int val = 0;\n //go thru string\n for (int i = 0; i < s.length(); i++){\n \t//26 letts of alph add the int val of that character \n val = val * 26 + (int) s.charAt(i) - (int) 'A' + 1;\n }\n return val;\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 }", "public static int firstUniqChar(String s) {\n\n HashMap<String, Integer> hm = new HashMap<>();\n\n for(int i = 0; i < s.length(); i++) {\n if(hm.containsKey(s.substring(i, i+1))) {\n hm.put(s.substring(i,i+1), hm.get(s.substring(i,i+1))+1);\n }\n else {\n hm.put(s.substring(i,i+1), 1);\n }\n }\n\n for(int i = 0; i< s.length(); i++) {\n if(hm.get(s.substring(i,i+1)) == 1) {\n return i;\n }\n }\n //this means all the string is repeating\n return -1;\n }", "@Override\n\tpublic int hashValue(String value) {\n\t\treturn hashFunc(value);\n\t}", "public static String GetHash(String input)\n {\n String hash = DigestUtils.sha1Hex(input);\n System.out.println(hash);\n return hash;\n }", "private String intChecker(String s) {\n\t\tString newS = \"\";\n\t\tfor(int i = 0; i < s.length(); i++) {\n\t\t\tif(s.charAt(i) > 47 && s.charAt(i) < 58) {\n\t\t\t\tnewS += s.charAt(i);\n\t\t\t}\n\t\t}\n\t\treturn newS;\n\t}", "private static int parseInt(String sn) {\n\t\treturn Integer.parseInt(sn.substring(2), 16);\n\t}" ]
[ "0.7137949", "0.6897674", "0.6708983", "0.6634139", "0.6602896", "0.6580906", "0.6529667", "0.6447881", "0.64134866", "0.64026445", "0.6386157", "0.6376087", "0.6344094", "0.6320488", "0.6314912", "0.6302626", "0.62619746", "0.62537754", "0.62481886", "0.62098116", "0.6183987", "0.61695445", "0.61648166", "0.6151573", "0.6118675", "0.610952", "0.6062072", "0.6049026", "0.6041182", "0.601919", "0.59589964", "0.59352666", "0.5933174", "0.59162694", "0.5915166", "0.59013146", "0.5899446", "0.58977044", "0.5892935", "0.58910304", "0.58871675", "0.58836824", "0.58672094", "0.5863218", "0.5855458", "0.58538884", "0.5852898", "0.5835477", "0.5825108", "0.5822998", "0.5820961", "0.58193785", "0.58154017", "0.5813452", "0.58017397", "0.57987857", "0.5786249", "0.57729685", "0.5770759", "0.5769217", "0.57676256", "0.5761375", "0.5757552", "0.57561576", "0.574713", "0.5737351", "0.57352346", "0.57240844", "0.57240236", "0.5717949", "0.5714614", "0.5714337", "0.57105243", "0.570995", "0.5697737", "0.56914055", "0.56810874", "0.56795025", "0.5662679", "0.56610316", "0.56572944", "0.56481045", "0.5643867", "0.5643672", "0.564038", "0.5634936", "0.563335", "0.5626031", "0.56197244", "0.561072", "0.56103605", "0.5608213", "0.5600049", "0.5597365", "0.55969185", "0.5595143", "0.55853474", "0.5579451", "0.55745256", "0.55616313" ]
0.5671831
78
[NEW] Strings the map containing all postingslist and tokens
public String toString(){ String s = " "; for (Map.Entry<String, PostingsList> entry : this.index.entrySet()) { s += entry.getKey()+" - " + entry.getValue().toString() + "\n"; } return s;//this.indexInMemory.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Map<String, String> getTokens();", "@Override\r\n public String toString() {\r\n String s = new String();\r\n for (String t : tokenList)\r\n s = s + \"~\" + t;\r\n return s;\r\n }", "@Override\n public String toString() {\n StringJoiner sj = new StringJoiner(\", \", \"{\", \"}\\n\");\n wordMap.forEach((k, v) -> sj.add(String.format(\"%s -> %s\", k, v)));\n return sj.toString();\n }", "public static HashMap<String, String> simplifiedTags(List<List<TaggedWord>> taggedList) {\n HashMap<String, String> simplePOSTagged = new HashMap<>();\n for (List<TaggedWord> tags : taggedList) { // iterate over list\n for (TaggedWord taggedWord : tags) {//for each word in the sentence\n String word = taggedWord.toString().replaceFirst(\"/\\\\w+\", \"\");\n if (taggedWord.tag().equals(\"NN\") | taggedWord.tag().equals(\"NNS\") |\n taggedWord.tag().equals(\"NNP\") | taggedWord.tag().equals(\"NNPS\")) {\n simplePOSTagged.put(word, \"noun\");\n } else if (taggedWord.tag().equals(\"MD\") | taggedWord.tag().equals(\"VB\") |\n taggedWord.tag().equals(\"VBD\") | taggedWord.tag().equals(\"VBG\") |\n taggedWord.tag().equals(\"VBN\") | taggedWord.tag().equals(\"VBP\")\n | taggedWord.tag().equals(\"VBZ\")) {\n simplePOSTagged.put(word, \"verb\");\n } else if (taggedWord.tag().equals(\"JJ\") | taggedWord.tag().equals(\"JJR\") |\n taggedWord.tag().equals(\"JJS\")) {\n simplePOSTagged.put(word, \"adj\");\n } else if (taggedWord.tag().equals(\"PRP\") | taggedWord.tag().equals(\"PRP$\")) {\n simplePOSTagged.put(word, \"pron\");\n } else if (taggedWord.tag().equals(\"RB\") | taggedWord.tag().equals(\"RBR\") |\n taggedWord.tag().equals(\"RBS\")) {\n simplePOSTagged.put(word, \"adv\");\n } else if (taggedWord.tag().equals(\"CD\") | taggedWord.tag().equals(\"LS\")) {\n simplePOSTagged.put(word, \"num\");\n } else if (taggedWord.tag().equals(\"WDT\") | taggedWord.tag().equals(\"WP\") |\n taggedWord.tag().equals(\"WP$\") | taggedWord.tag().equals(\"WRB\")) {\n simplePOSTagged.put(word, \"wh\");\n } else if (taggedWord.tag().equals(\"DT\") | taggedWord.tag().equals(\"PDT\")) {\n simplePOSTagged.put(word, \"det\");\n } else if (taggedWord.tag().equals(\"CC\") | taggedWord.tag().equals(\"IN\")) {\n simplePOSTagged.put(word, \"prepconj\");\n } else {\n simplePOSTagged.put(word, \"other\");\n }\n }\n }\n return simplePOSTagged;\n }", "List<String> getTokens();", "public Map<String, String> getTokens() {\n return tokens;\n }", "@Override\n public String toString() {\n return token.toString();\n }", "private static Map<String, Integer> getWords(){\n\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\t\n\t\tfor(Status status : statusList){\n\t\t\tStringTokenizer tokens = new StringTokenizer(status.getText());\n\t\t\twhile(tokens.hasMoreTokens()){\n\t\t\t\tString token = tokens.nextToken();\n\t\t\t\tif(!token.equals(\"RT\")){\n\t\t\t\t\tif(map.containsKey(token)){\n\t\t\t\t\t\tint count = map.get(token);\n\t\t\t\t\t\tmap.put(token, ++count);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmap.put(token, 1);\n\t\t\t\t\t}\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn map;\n\t}", "@Override\n\t\tprotected void map(Object key, Text value, Context context)\n\t\t\t\tthrows IOException, InterruptedException {\n\t\t\tStringTokenizer str=new StringTokenizer(value.toString());\n//\t\t\tString[]str=new String(value.toString()).split(\"a\");\n\t\t\twhile(str.hasMoreTokens()){\n\t\t\t\tword.set(str.nextToken());\n\t\t\t\tcontext.write(word, one);\n\t\t\t\t}\n//\t\t\tfor(String b:str){\n//\t\t\t\tword.set(b);\n//\t\t\t\tcontext.write(word, one);\n//\t\t\t\t\n//\t\t\t}\n\t\t\t\n\t\t}", "String getTokenString();", "public void buildMap()\n {\n for(int letterNum=0; letterNum < myText.length()-myNum; letterNum++) {\n String key = myText.substring(letterNum,letterNum+myNum);\n String nextLetter = String.valueOf(myText.charAt(letterNum + myNum));\n if (!map.containsKey(key)) {\n ArrayList<String> lettersArray = new ArrayList<String>();\n lettersArray.add(nextLetter);\n map.put(key,lettersArray);\n }else\n {\n map.get(key).add(nextLetter);\n }\n }\n }", "public MapToken() {\n\t\tmData = new FastMap<String, Object>();\n\t}", "private List<String> getSubstitutes(String postScriptName) {\n/* 218 */ List<String> subs = this.substitutes.get(postScriptName.replaceAll(\" \", \"\"));\n/* 219 */ if (subs != null)\n/* */ {\n/* 221 */ return subs;\n/* */ }\n/* */ \n/* */ \n/* 225 */ return Collections.emptyList();\n/* */ }", "@Override\n\tpublic String toString()\n\t{\n\t\tfinal AppendingStringBuffer buffer = new AppendingStringBuffer();\n\t\tboolean first = true;\n\t\tfor (Map.Entry<String, Object> entry : entrySet())\n\t\t{\n\t\t\tif (first == false)\n\t\t\t{\n\t\t\t\tbuffer.append(' ');\n\t\t\t}\n\t\t\tfirst = false;\n\n\t\t\tbuffer.append(entry.getKey());\n\t\t\tbuffer.append(\" = \\\"\");\n\t\t\tfinal Object value = entry.getValue();\n\t\t\tif (value == null)\n\t\t\t{\n\t\t\t\tbuffer.append(\"null\");\n\t\t\t}\n\t\t\telse if (value.getClass().isArray())\n\t\t\t{\n\t\t\t\tbuffer.append(Arrays.asList((Object[])value));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbuffer.append(value);\n\t\t\t}\n\n\t\t\tbuffer.append('\\\"');\n\t\t}\n\t\treturn buffer.toString();\n\t}", "public String toString() {\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tsb.append(\"Tokens:\\n\");\r\n\t\tfor (int i = 0; i < tokens.size(); i++) {\r\n\t\t\tsb.append(tokens.get(i)).append('\\n');\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}", "private Map<String, String> locationListToString(List<Element> locations) {\r\n Map<String, String> locMap = new LinkedHashMap<String, String>();\r\n for (Element location : locations) {\r\n String fileName = location.attributeValue(\"filename\");\r\n String lineNumber = location.attributeValue(\"line\");\r\n String current = locMap.get(fileName);\r\n locMap.put(fileName, null == current ? lineNumber : current + \", \" + lineNumber);\r\n }\r\n return locMap;\r\n }", "public PostingsList getPostings( String token ) {\n PostingsList post = new PostingsList();\n if(this.index.containsKey(token))\n post = (this.index.get(token)).clone();\n /*System.err.println(\"start search...\");\n // Read JSON file associated to token and return it as a postingslist\n String filename = \"postings/t\"+hash(token)+\".json\";\n PostingsList post = new PostingsList();\n try(Reader reader = new FileReader(filename)){\n post = (new Gson()).fromJson(reader, PostingsList.class);\n } catch (IOException e) {\n e.printStackTrace();\n }*/\n return post;\n }", "public String getTokenString() {\n String tokenString = \"\";\n\n for (int i = 0; i < clueTokens.size(); i++) {\n tokenString += clueTokens.get(i).getName();\n if (i < clueTokens.size() - 1)\n tokenString += \", \";\n }\n\n return tokenString;\n }", "Map<String, String> tags();", "Map<String, String> tags();", "Map<String, String> tags();", "Map<String, String> tags();", "Map<String, String> tags();", "Map<String, String> tags();", "Map<String, String> tags();", "Map<String, String> tags();", "public Map<String, List<String>> genericsTokens() {\n return genericsTokens;\n }", "public PostingsList getPostings( String token ) {\r\n PostingsList element = index.get(token) ;\r\n if (element != null)\r\n {\r\n return element;\r\n }\r\n return null;\r\n }", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "protected String getTokenString (int token) {\r\n switch (token) {\r\n case START:\r\n return \"START\";\r\n case STRING:\r\n return \"STRING\";\r\n case SQSTRING:\r\n return \"SQSTRING\";\r\n case DQSTRING:\r\n return \"DQSTRING\";\r\n case SINGELQUOTE:\r\n return \"SINGELQUOTE\";\r\n case DOUBLEQUOTE:\r\n return \"DOUBLEQUOTE\";\r\n case LT:\r\n return \"LT\";\r\n case MT:\r\n return \"MT\";\r\n case EQUALS:\r\n return \"EQUALS\";\r\n case COMMENT:\r\n return \"COMMENT\";\r\n case END:\r\n return \"END\";\r\n case UNKNOWN:\r\n return \"UNKNOWN\";\r\n default:\r\n return \"unknown\";\r\n }\r\n }", "private static Map<String, String> parseInstanceValues(String data) {\r\n \t\tMap<String, String> responseMap = new HashMap<String, String>();\r\n \t\tif (data != null) {\r\n \t\t\tStringTokenizer strTok = new StringTokenizer(data, \",\\n\");\r\n \t\t\twhile (strTok.hasMoreTokens()) {\r\n \t\t\t\tString key = strTok.nextToken();\r\n \t\t\t\tString val = strTok.nextToken();\r\n \t\t\t\tString oldVal = responseMap.get(key);\r\n \t\t\t\tif (oldVal != null) {\r\n \t\t\t\t\tif (val != null) {\r\n \t\t\t\t\t\tif (oldVal.trim().length() < val.trim().length()) {\r\n \t\t\t\t\t\t\tresponseMap.put(key, val);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponseMap.put(key, val);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn responseMap;\r\n \t}", "private static String listOfTokensToString(List<Token> tokenList) {\n\n StringBuilder stringBuilder = new StringBuilder();\n for (Token token : tokenList) {\n stringBuilder.append(String.format(\"%s\", token.getPattern()));\n }\n return stringBuilder.toString().trim();\n }", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "public static String string() {\n\t\t\tString s = \"\";\n\t\t\ts += \"Locaux :\\n\";\n\t\t\tfor(String key : locaux.keySet()) {\n\t\t\t\tIdent i = locaux.get(key);\n\t\t\t\ts += key+\", \"+i.toString()+\"\\n\";\n\t\t\t}\n\t\t\ts += \"Globaux :\\n\";\n\t\t\tfor(String key : globaux.keySet()) {\n\t\t\t\tIdent i = globaux.get(key);\n\t\t\t\ts += key+\", \"+i.toString()+\"\\n\";\n\t\t\t}\n\n\t\t\treturn s;\n\t\t}", "@Override\n public String mapping() {\n return StringUtils.lines(\n \"foo.bar.Baz -> foo.bar.Baz:\", \" java.lang.Object f1 -> a\", \" java.lang.String f2 -> a\");\n }", "@Override\n\tpublic String toString() {\n\t\tStringBuilder buf = new StringBuilder();\n\t\t\n\t\tCIntMap termsFrequencies = null;\n\t\tfor( String tag : keySet()) {\n\t\t\tbuf.append(tag);\n\t\t\tbuf.append(\"\\n\");\n\t\t\ttermsFrequencies = get(tag);\n\t\t\tbuf.append(termsFrequencies);\n\t\t}\n\t\t\n\t\treturn buf.toString();\n\t}", "@Override\n public String toString() {\n if (this.map.getMap().isEmpty()) return \"\";\n final StringBuilder param = new StringBuilder(this.map.getMap().size() * 40);\n for (final Map.Entry<String, String> entry: entrySet()) {\n param.append(MultiProtocolURL.escape(entry.getKey()))\n .append('=')\n .append(MultiProtocolURL.escape(entry.getValue()))\n .append('&');\n }\n param.setLength(param.length() - 1);\n return param.toString();\n }", "private static Map<String, Integer> getHashTags(){\n\t\t\n\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\t\n\t\tfor(Status status : statusList){\n\t\t\tHashtagEntity[] entitles = status.getHashtagEntities();\n\t\t\tfor(HashtagEntity entity : entitles){\n\t\t\t\tString str = entity.getText();\n\t\t\t\t\n\t\t\t\tif(map.containsKey(str)){\n\t\t\t\t\tint count = map.get(str);\n\t\t\t\t\tmap.put(str, ++count);\n\t\t\t\t}else{\n\t\t\t\t\tmap.put(str, 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}", "@Override\r\n\tpublic Map<Integer, String> getMakingMtList() {\n\t\treturn null;\r\n\t}", "Iterator<String> getTokenIterator();", "@Override public String toString(){\r\n StringBuilder output = new StringBuilder();\r\n for (Iterator<NoteToken> i = NotesList.iterator(); i.hasNext();){\r\n output.append(i.next().toString());\r\n output.append(\" \");\r\n \r\n }\r\n return output.toString();\r\n }", "public Map<String, Set<String>> getSubStringAlias(Set<String> enSet){\n EntityUtils alias = new EntityUtils();\n Map<String, Set<String>> mentions_map = alias.getAliasMapFromSet(enSet);\n return mentions_map;\n\n }", "public String toString (Token T);", "private Map<String, String> processPostRequest(String content) {\n Map<String, String> store = new HashMap<String, String>();\n\n // Split the post data by &\n for (String entry : content.split(\"&\")) {\n // Split it by =\n String[] data = entry.split(\"=\");\n\n // Check that there is sufficient data in the data array\n if (data.length != 2) {\n continue;\n }\n\n // decode the data\n String key = URLUtils.decode(data[0]);\n String value = URLUtils.decode(data[1]);\n\n // Add it to the store\n store.put(key, value);\n }\n\n return store;\n }", "public String valuesFromMap() {\n\t\thashMap = createSimpleMap(\"Breakfast\", \"Eggs\");\n\t\treturn hashMap.get(\"Breakfast\");\n\t}", "public String toString() {\n return PARSER_KEY;\n }", "private String toString(String pre) {\n StringBuilder sb = new StringBuilder();\n\n sb.append(key);\n if (values1 != null) {\n sb.append(\" \");\n sb.append(values1);\n sb.append(\", \");\n sb.append(values2);\n }\n sb.append(\"\\n\");\n\n String newpre = pre + \" \";\n if (!son.empty) {\n sb.append(newpre);\n sb.append(\"son: \");\n sb.append(son.toString(newpre));\n }\n if (!left.empty) {\n sb.append(newpre);\n sb.append(\"left: \");\n sb.append(left.toString(newpre));\n }\n if (!right.empty) {\n sb.append(newpre);\n sb.append(\"right: \");\n sb.append(right.toString(newpre));\n }\n return sb.toString();\n }", "private void setupTokenHashTable() {\n this.tokenHashTable = new Hashtable<>();\n \t\n /* Identifier Token */\n this.getTokenHashTable().put(1001, \"idTK\");\n this.getTokenHashTable().put(1002, \"integerTK\");\n \t\n /* Operators and Delimiters */\n this.getTokenHashTable().put(1003, \"equalsTK\");\n this.getTokenHashTable().put(1004, \"lessThanTK\");\n this.getTokenHashTable().put(1005, \"greaterThanTK\");\n this.getTokenHashTable().put(1006, \"compareEqualTK\");\n this.getTokenHashTable().put(1007, \"colonTK\");\n this.getTokenHashTable().put(1008, \"plusTK\");\n this.getTokenHashTable().put(1009, \"minusTK\");\n this.getTokenHashTable().put(1010, \"multiplyTK\");\n this.getTokenHashTable().put(1011, \"divideTK\");\n this.getTokenHashTable().put(1012, \"modulusTK\");\n this.getTokenHashTable().put(1013, \"periodTK\");\n this.getTokenHashTable().put(1014, \"leftParenTK\");\n this.getTokenHashTable().put(1015, \"rightParenTK\");\n this.getTokenHashTable().put(1016, \"commaTK\");\n this.getTokenHashTable().put(1017, \"leftBraceTK\");\n this.getTokenHashTable().put(1018, \"rightBraceTK\");\n this.getTokenHashTable().put(1019, \"semicolonTK\");\n this.getTokenHashTable().put(1020, \"leftBracketTK\");\n this.getTokenHashTable().put(1021, \"rightBracketTK\");\n \n /* Extra Tokens */\n this.getTokenHashTable().put(1022, \"EofTK\");\n this.getTokenHashTable().put(-2, \"Invalid Character\");\n this.getTokenHashTable().put(-3, \"Invalid Comment\");\n }", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "@Override\n\tpublic String toString()\n\t{\n\t\treturn CommonNames.PARSER.CORE.TOKENS.TOKENIZER_STATE.WHITE_SPACE;\n\t}", "private static void readWordsIntoMap(SimpleReader in,\n Map<String, Integer> wordMap, char[] seps) {\n String line = \"\";\n wordMap.clear();\n\n while (!in.atEOS()) {\n line = in.nextLine();\n for (char sep : seps) {\n line = line.replace(sep, ':');\n }\n\n String[] words = line.split(\":\");\n\n for (String word : words) {\n if (!wordMap.hasKey(word) && word != \" \") {\n wordMap.add(word, 1);\n } else {\n int count = wordMap.value(word);\n count++;\n wordMap.replaceValue(word, count);\n }\n }\n }\n\n }", "private Map<String, String> interpretStyle(StringTokenizer st) {\n Map<String, String> map = new HashMap<String, String>();\n String name;\n String value;\n\n while (st.hasMoreElements()) {\n String namevaluepair = st.nextToken();\n int equalsPos = namevaluepair.indexOf('=');\n if (equalsPos < 0) {\n name = namevaluepair;\n value = \"true\";\n } else {\n name = namevaluepair.substring(0, equalsPos);\n value = namevaluepair.substring(equalsPos + 1);\n }\n\n map.put(name, value);\n }\n return map;\n }", "public Map<String, List<List<String>>> otherTags() {\n return otherTags;\n }", "private String getTokenizedUrl() {\n SharedPreferences sharedPreferences = getSharedPreferences();\n String tokenKey = MainActivity.sharedPrefKeys.TOKENIZED_URL.toString();\n\n if (sharedPreferences.contains(tokenKey)) {\n return sharedPreferences.getString(tokenKey, \"\");\n }\n return \"\";\n }", "private String getUsersToString()\n {\n ArrayList<String> list = new ArrayList<>();\n Iterator iterator = userList.entrySet().iterator();\n while (iterator.hasNext())\n {\n Map.Entry mapEntry = (Map.Entry) iterator.next();\n list.add(\"\" + mapEntry.getKey());\n }\n \n String returnString = \"\";\n if(list.size() > 0)\n {\n returnString = list.get(0);\n for(int i = 1; i < list.size(); i++)\n {\n returnString = returnString + \",\" + list.get(i);\n }\n }\n return returnString;\n }", "public String EventMapStringRepresentation(){\n ArrayList<String> lines = new ArrayList<String>();\n ArrayList<String> idsSorted = sort(eventIdsList);\n for(String id : idsSorted){\n String line = toStringEvent(id);\n lines.add(line);\n }\n String totalString = \"\";\n Integer i = 1;\n for(String line: lines){\n totalString += i + \") \" + line + System.lineSeparator();\n i++;\n }\n return totalString;\n }", "List<Object> getTokens()\r\n\t{\r\n\t\treturn appearanceTokens;\r\n\t}", "default Map<String, String> get() {\n Map<String, String> tags = new HashMap<>();\n tags.put(\"application\", serviceInfo().getServiceName());\n tags.put(\"host\", serviceInfo().getHost());\n tags.put(\"environment\", serviceInfo().getEnvironment());\n return tags;\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"{\" + Strings.join(\",\", keyValuePair) + \"}\";\n\t}", "public void buildTokenIdentifierArrayList() {\n\t\t/**\n\t\t * Maintain the order while adding. Give it in a greedy way. The most specific to most common. Eg: DECIMAL Should \n\t\t * be added first then INTEGER else INTEGER will be matched first and '.' will be matched as a TOKEN and then\n\t\t * the succeeding number will be parsed as an INTEGER\n\t\t */\n\t\tlistTokenIdentifier.add(new TokenIdentifier(Pattern.compile(RegularExpression.DECIMAL), TokenType.DECIMAL_LITERAL));\n\t\tlistTokenIdentifier.add(new TokenIdentifier(Pattern.compile(RegularExpression.IDENTIFIER), TokenType.IDENTIFIER));\n\t\tlistTokenIdentifier.add(new TokenIdentifier(Pattern.compile(RegularExpression.INTEGER), TokenType.INTEGER_LITERAL));\n\t\tlistTokenIdentifier.add(new TokenIdentifier(Pattern.compile(RegularExpression.STRING), TokenType.STRING_LITERAL));\n\n\t\tfor (String t: new String[] {\"=\", \"\\\\(\",\"\\\\)\", \"\\\\.\",\"\\\\,\"}) {\n\t\t\tlistTokenIdentifier.add(new TokenIdentifier(Pattern.compile(\"^(\" + t + \")\"), TokenType.TOKEN));\t\n\t\t}\n\t}", "@Override\n\tpublic String toString()\n\t{\n\t\tStringBuilder buffer = new StringBuilder(128);\n\t\tIterator<Map.Entry<String, AbstractNode>> it = pairs.entrySet().iterator();\n\t\twhile (it.hasNext())\n\t\t{\n\t\t\tMap.Entry<String, AbstractNode> pair = it.next();\n\t\t\tbuffer.append(keyToString(pair.getKey()));\n\t\t\tbuffer.append(KEY_VALUE_SEPARATOR_CHAR);\n\t\t\tbuffer.append(' ');\n\t\t\tbuffer.append(pair.getValue());\n\t\t\tif (it.hasNext())\n\t\t\t{\n\t\t\t\tbuffer.append(PAIR_SEPARATOR_CHAR);\n\t\t\t\tbuffer.append(' ');\n\t\t\t}\n\t\t}\n\t\treturn buffer.toString();\n\t}", "public String toString() {\n\tStringBuffer buf = new StringBuffer();\n\tfor (int i = 0; i < tokens.length; i++) {\n\t\tif (i > 0) {\n\t\t\tbuf.append(\" \");\n\t\t}\t\n\t\tbuf.append(tokens[i]);\n\t}\n\treturn buf.toString();\n}", "private String string(Token t) {\n\n return expansionString.substring(t.start, t.end);\n\n }", "public static Map<String, String> listTokenFromCSP()\r\n\t\t\tthrows BkavSignaturesException {\r\n\t\tMap<String, String> result = new HashMap<>();\r\n\t\ttry {\r\n\t\t\tSunMSCAPI providerMSCAPI = new SunMSCAPI();\r\n\t\t\tSecurity.addProvider(providerMSCAPI);\r\n\t\t\tKeyStore ks = KeyStore.getInstance(CSP_KEYSTORE);\r\n\t\t\tks.load(null, null);\r\n\r\n\t\t\tEnumeration<String> aliases = ks.aliases();\r\n\t\t\tString alias = null;\r\n\r\n\t\t\twhile (aliases.hasMoreElements()) {\r\n\t\t\t\talias = aliases.nextElement();\r\n\t\t\t\tCertificate cert = ks.getCertificate(alias);\r\n\t\t\t\tif (cert instanceof X509Certificate) {\r\n\t\t\t\t\tX509Certificate x509Cert = (X509Certificate) cert;\r\n\t\t\t\t\tString certSerial = x509Cert.getSerialNumber().toString(16);\r\n\r\n\t\t\t\t\tString subjectDN = x509Cert.getSubjectDN().getName();\r\n\t\t\t\t\tString author = \"\";\r\n\t\t\t\t\tLdapName ldap;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tldap = new LdapName(subjectDN);\r\n\t\t\t\t\t\tfor (Rdn rdn : ldap.getRdns()) {\r\n\t\t\t\t\t\t\tif (\"CN\".equalsIgnoreCase(rdn.getType())) {\r\n\t\t\t\t\t\t\t\tauthor = rdn.getValue().toString();\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (InvalidNameException e) {\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult.put(certSerial, author);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (KeyStoreException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"KeyStoreException\", e);\r\n\t\t} catch (NoSuchAlgorithmException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"NoSuchAlgorithmException\", e);\r\n\t\t} catch (CertificateException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"CertificateException\", e);\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"IOException\", e);\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "@Override\n public String toString() {\n return gateAdr + \", \" + postNr + \" \" + postSted;\n }", "String getBShortToken();", "public Map<CharSequence, CharSequence> getReplacableNames();", "private String createCustomInfoString() {\r\n String CustomInfo = \"\";\r\n Iterator<String> iterator = mCustomParameters.keySet().iterator();\r\n while (iterator.hasNext()) {\r\n String CurrentKey = iterator.next();\r\n String CurrentVal = mCustomParameters.get(CurrentKey);\r\n CustomInfo += CurrentKey + \" = \" + CurrentVal + \"\\n\";\r\n }\r\n return CustomInfo;\r\n }", "public void display() {\n\tString tm = \"{ \";\n\tIterator it = entrySet().iterator();\n\twhile(it.hasNext()) {\n\t\ttm += it.next() + \" ,\";\n\t}\n\ttm = tm.substring(0, tm.length() - 2) + \" }\";\n\tSystem.out.println(tm);\n }", "@Override\n\tpublic String toString()\n\t{\n\t\tStringBuilder s = new StringBuilder();\n\t\tjava.util.Iterator<java.util.Map.Entry<String, Object>> iterator = entrySet().iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tjava.util.Map.Entry<String, Object> entry = iterator.next();\n\n\t\t\ts.append('\\n');\n\t\t\ts.append(\"\\t\");\n\t\t\ts.append(entry.getKey());\n\t\t\ts.append(':');\n\t\t\ts.append(' ');\n\t\t\ts.append(entry.getValue().toString());\n\t\t}\n\t\treturn s.toString();\n\t}", "public static String[] gatherTokenStrings (Document doc, Span span) {\n\t\tAnnotation[] tokens = gatherTokens(doc, span);\n\t\tint length = tokens.length;\n\t\tString[] stgs = new String[length];\n\t\tfor (int i=0; i<length; i++)\n\t\t\tstgs[i] = doc.text(tokens[i]).trim();\n\t\treturn stgs;\n\t}", "@Override\r\n public String encodeAll(List<LinkedHashMap<String, String>> dataList) {\n StringBuilder str = new StringBuilder();\r\n\r\n for (LinkedHashMap<String, String> dataMap : dataList) {\r\n Collection<String> value = dataMap.values();\r\n\r\n for (Iterator<String> itr = value.iterator(); itr.hasNext();) {\r\n str = str.append(\"\\\"\").append(itr.next()).append(\"\\\"\").append(\",\");\r\n\r\n }\r\n str = str.deleteCharAt(str.length() - 1);\r\n str = str.append(\"\\n\");\r\n }\r\n\r\n return str.toString();\r\n\r\n }", "void Create(){\n map = new TreeMap<>();\r\n\r\n // Now we split the words up using punction and spaces\r\n String wordArray[] = wordSource.split(\"[{ \\n\\r.,]}}?\");\r\n\r\n // Now we loop through the array\r\n for (String wordArray1 : wordArray) {\r\n String key = wordArray1.toLowerCase();\r\n // If this word is not present in the map then add it\r\n // and set the word count to 1\r\n if (key.length() > 0){\r\n if (!map.containsKey(map)){\r\n map.put(key, 1);\r\n }\r\n else {\r\n int wordCount = map.get(key);\r\n wordCount++;\r\n map.put(key, wordCount);\r\n }\r\n }\r\n } // end of for loop\r\n \r\n // Get all entries into a set\r\n // I think that before this we just have key-value pairs\r\n entrySet = map.entrySet();\r\n \r\n }", "@Override\n\tpublic Map<String, Integer> parseWordCountMap(String text, List<String> delimeter) {\n\t\treturn new HashMap<>();\n\t}", "@Override\n\tpublic String toString() {\n\t\tStringBuffer buf = new StringBuffer(\"Dictionary contents:\\n\");\n\t\tfor (Iterator iter = entrySet().iterator(); iter.hasNext();) {\n\t\t\tMap.Entry entry = (Map.Entry) iter.next();\n\t\t\tbuf.append(\" \").append(entry.getKey()).append(\" = \").append(\n\t\t\t\t\tentry.getValue()).append(\"\\n\");\n\t\t}\n\t\treturn buf.toString();\n\t}", "private HashMap<String,HashMap<String,Integer>> computeTFForQueryWords(ArrayList<String> queryPostingLines) {\n HashMap<String,HashMap<String,Integer>> queryWordsTF = new HashMap<>();\n HashMap<String,HashMap<String,Integer>> queryWordsTFPerDoc = new HashMap<>();\n String docID,term;\n Integer tf;\n HashSet<String> docIDs = new HashSet<>();\n for(String postingLine : queryPostingLines){\n HashMap<String,Integer> frequenciesInDocuments = new HashMap<>();\n term = postingLine.substring(0,postingLine.indexOf(\"|\"));\n postingLine = postingLine.substring(postingLine.indexOf(\"|\")+1);\n while(!postingLine.equals(\"\")) {\n docID = postingLine.substring(0, postingLine.indexOf(\":\"));\n docIDs.add(docID);\n postingLine = postingLine.substring(postingLine.indexOf(\"_\") + 1);\n tf = Integer.valueOf(postingLine.substring(0, postingLine.indexOf(\"_\")));\n postingLine = postingLine.substring(postingLine.indexOf(\"_\") + 1);\n frequenciesInDocuments.put(docID,tf);\n }\n queryWordsTF.put(term,frequenciesInDocuments);\n }\n\n ArrayList<String> allTermsInQuery = new ArrayList<>(queryWordsTF.keySet());\n for(String doc : docIDs){\n HashMap<String,Integer> tfsInDoc = new HashMap<>();\n for(String termInQuery : allTermsInQuery){\n HashMap<String,Integer> termsTFInDoc = queryWordsTF.get(termInQuery);\n if(termsTFInDoc.containsKey(doc)){\n tfsInDoc.put(termInQuery,termsTFInDoc.get(doc));\n }\n }\n queryWordsTFPerDoc.put(doc,tfsInDoc);\n }\n return queryWordsTFPerDoc;\n }", "private void initRegs(){\n\n keyWordReg = \"\";\n\n for (String seg: keyWordMap.keySet()){\n\n keyWordReg += seg + \"|\";\n\n }\n\n symbolReg = \"[\\\\&\\\\*\\\\+\\\\(\\\\)\\\\.\\\\/\\\\,\\\\-\\\\]\\\\;\\\\~\\\\}\\\\|\\\\{\\\\>\\\\=\\\\[\\\\<]\";\n intReg = \"[0-9]+\";\n strReg = \"\\\"[^\\\"\\n]*\\\"\";\n idReg = \"[a-zA-Z_]\\\\w*\";\n\n tokenPatterns = Pattern.compile(idReg + \"|\" + keyWordReg + symbolReg + \"|\" + intReg + \"|\" + strReg);\n }", "private static String[] getMapStrings(boolean desc) {\n\n\n\n ArrayList list = new ArrayList();\n Locale locale = Locale.getDefault();\n String name = locale.toString();\n if (desc)\n name = \"locale=\" + name;\n list.add(0, name);\n\n String os = \"-\" + getOSType();\n if (desc)\n os = \" (os=\" + System.getProperty(\"os.name\")\n + \", \" + System.getProperty(\"os.version\") + \")\";\n name += os;\n list.add(0, name);\n\n // Allow the invoker to override the keyStrokeMap to support\n // case where you are working on a remote machine with a different\n // local or platform.\n \n String override = System.getProperty(\"abbot.keyStrokeMap\");\n if (override!=null) {\n list.add(0, override);\n }\n \n \n /*\n String vm = System.getProperty(\"java.version\");\n name += \" vm=\" + vm;\n list.add(0, name);\n String version = System.getProperty(\"os.version\");\n name += \" version=\" + version;\n list.add(0, name);\n String arch = System.getProperty(\"os.arch\");\n name += \" arch=\" + arch;\n list.add(0, name);\n */\n return (String[])list.toArray(new String[list.size()]);\n }", "public String getPostingText() {\n return postingText;\n }", "@Override\n\tpublic Map<String, Object> getGradeMyStu(String token) {\n\t\treturn null;\n\t}", "public void printMap() {\n String s = \"\";\n Stack st = new Stack();\n st.addAll(map.entrySet());\n while (!st.isEmpty()) {\n s += st.pop().toString() + \"\\n\";\n }\n window.getDHTText().setText(s);\n }", "public String toString()\n {\n String ret = \"\";\n String s = adjMaps.toString();\n String[] parts = s.split(\"},\");\n for(int i=0; i< parts.length; i++){\n ret += parts[i] + \"}\\n\";\n }\n return ret;\n }" ]
[ "0.6758433", "0.58897084", "0.5630534", "0.5508794", "0.5503969", "0.54728544", "0.5447173", "0.53018135", "0.5263845", "0.5251088", "0.5191312", "0.51761514", "0.51590157", "0.51570046", "0.5153402", "0.5152076", "0.51318806", "0.5107668", "0.51008123", "0.51008123", "0.51008123", "0.51008123", "0.51008123", "0.51008123", "0.51008123", "0.51008123", "0.5055568", "0.50479263", "0.503786", "0.503786", "0.503786", "0.503786", "0.503786", "0.50339925", "0.49792716", "0.49732354", "0.4948449", "0.4948449", "0.4948449", "0.4948449", "0.4948449", "0.4948449", "0.49290907", "0.49272466", "0.4926927", "0.49177918", "0.48872748", "0.4882073", "0.4875693", "0.4872941", "0.48675936", "0.48646176", "0.48546845", "0.48535758", "0.4837421", "0.4833374", "0.48333004", "0.48302263", "0.48302263", "0.48302263", "0.48302263", "0.48302263", "0.48302263", "0.48302263", "0.48302263", "0.48302263", "0.48302263", "0.48260513", "0.4821346", "0.48115867", "0.48032847", "0.4792706", "0.4786155", "0.47853503", "0.47852436", "0.4784183", "0.47662842", "0.47626793", "0.47597602", "0.47591612", "0.4757793", "0.4757347", "0.47521752", "0.47454002", "0.47441196", "0.47393447", "0.47368416", "0.4733769", "0.47319713", "0.47301406", "0.47205356", "0.47153443", "0.47133312", "0.47094762", "0.47070792", "0.4705306", "0.47011784", "0.4697039", "0.46943098", "0.46827918" ]
0.5571595
3
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); txtNombre = new javax.swing.JTextField(); txtPuesto = new javax.swing.JTextField(); txtDepartamento = new javax.swing.JTextField(); btnInsertar = new javax.swing.JButton(); btnAyudas = new javax.swing.JButton(); btnReportes = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel1.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N jLabel1.setText("Nombre"); jLabel2.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N jLabel2.setText("Puesto"); jLabel3.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N jLabel3.setText("Departamento"); txtNombre.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N txtPuesto.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N txtDepartamento.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N btnInsertar.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N btnInsertar.setText("Ingresar"); btnInsertar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnInsertarActionPerformed(evt); } }); btnAyudas.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N btnAyudas.setText("Ayudas"); btnAyudas.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnAyudasActionPerformed(evt); } }); btnReportes.setText("Reportes"); btnReportes.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnReportesActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(33, 33, 33) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3) .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(txtNombre, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE) .addComponent(txtPuesto) .addComponent(txtDepartamento)) .addGap(49, 81, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(btnInsertar, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnAyudas, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnReportes, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(43, 43, 43)))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(35, 35, 35) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(txtPuesto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(txtDepartamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(38, 38, 38) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnInsertar, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnAyudas, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(btnReportes, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(64, Short.MAX_VALUE)) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public PatientUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public Oddeven() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Magasin() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public kunde() {\n initComponents();\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\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 .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public frmVenda() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\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 .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\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 .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\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 .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public CovidGUI(){\n initComponents();\n }" ]
[ "0.73206544", "0.7291311", "0.7291311", "0.7291311", "0.7286492", "0.7249181", "0.7213362", "0.72085494", "0.71965617", "0.7190475", "0.7184897", "0.7159234", "0.71483016", "0.7094075", "0.7081491", "0.70579433", "0.6987627", "0.69776064", "0.69552463", "0.69549114", "0.69453007", "0.69439274", "0.69369227", "0.6932056", "0.6927733", "0.6925948", "0.69254535", "0.69121534", "0.6911907", "0.6894101", "0.6892413", "0.68919593", "0.6891924", "0.6889863", "0.6884052", "0.6883223", "0.688166", "0.68787736", "0.68764126", "0.68745583", "0.68721986", "0.68595314", "0.685675", "0.68565613", "0.6855288", "0.6854687", "0.6854457", "0.685303", "0.685303", "0.68448347", "0.6837389", "0.6837193", "0.6829965", "0.6829964", "0.68275386", "0.68249714", "0.6823691", "0.6818224", "0.68173605", "0.6811417", "0.6809674", "0.680964", "0.6809329", "0.68085754", "0.6802194", "0.67955625", "0.67938477", "0.6793322", "0.679176", "0.67900634", "0.6789749", "0.67888486", "0.6781942", "0.6767308", "0.6766431", "0.6765252", "0.67573947", "0.6756327", "0.6753509", "0.67520833", "0.6741834", "0.6740361", "0.6737793", "0.67370224", "0.6734898", "0.6727867", "0.6727453", "0.67214817", "0.6716735", "0.67162156", "0.6715855", "0.6709997", "0.6707508", "0.67042965", "0.6702483", "0.67014945", "0.67007315", "0.6699097", "0.669545", "0.6692102", "0.6690473" ]
0.0
-1
TODO Autogenerated method stub
public void addUser(User user) { userMapper.insert(user); }
{ "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