Dataset Viewer
Auto-converted to Parquet
query_id
stringlengths
32
32
query
stringlengths
7
129k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
8cf037279b20765300987030fd57b56f
optional string bunho = 4;
[ { "docid": "8999c54f98a5d3f5d1eb144975f50255", "score": "0.0", "text": "public com.google.protobuf.ByteString\n getBunhoBytes() {\n java.lang.Object ref = bunho_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n bunho_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "title": "" } ]
[ { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948962", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948962", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948962", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948962", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69487983", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69487983", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69487983", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69487625", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69484305", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69484305", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69484305", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.6948222", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69481695", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69481695", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69481695", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69481385", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69481385", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69481015", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69481015", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69481015", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69481015", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "6d82de299f9a16ea60dc663cd99ef7ec", "score": "0.69474024", "text": "java.lang.String getBunho();", "title": "" }, { "docid": "1a27d20fc14df3ca92a84551a471a606", "score": "0.6791465", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000100;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "2e9f9d1ecca0a1b20547e1a47c62b0b2", "score": "0.67745674", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000010;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "2e9f9d1ecca0a1b20547e1a47c62b0b2", "score": "0.6774283", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000010;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "2e9f9d1ecca0a1b20547e1a47c62b0b2", "score": "0.6774283", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000010;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "2e9f9d1ecca0a1b20547e1a47c62b0b2", "score": "0.67738146", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000010;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "2e9f9d1ecca0a1b20547e1a47c62b0b2", "score": "0.6773439", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000010;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6772375", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6772375", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6772375", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6772375", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6772375", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6772338", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.67715895", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.67715895", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6771525", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6771334", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6771334", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6771204", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.67710996", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6770988", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6770988", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.6770976", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.67709583", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.67709583", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.67709583", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.6770841", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.6770798", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.6770769", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.6770769", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6770724", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6770724", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "417fdd1bc990e75052d909825cdd2496", "score": "0.6770724", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.677033", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.67702454", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.67702454", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.67702454", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" }, { "docid": "700a7950ce73a964db5577d5519407a5", "score": "0.67702454", "text": "public Builder setBunho(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n bunho_ = value;\n onChanged();\n return this;\n }", "title": "" } ]
c90ebdc03ba31d4150a2b8ce87710c68
///////////////////////////////////////////////////////////////////////// Test insertions across serializations
[ { "docid": "65c1bb7be42b5308fe874b3e7b36777f", "score": "0.5428707", "text": "@Test\n \tpublic void testUnflushedSessionSerialization() throws Exception {\n \t\tSession s = sessionFactory().openSession();\n \t\ts.setFlushMode(FlushMode.MANUAL);\n \t\ts.beginTransaction();\n \n \t\tSimple simple = new Simple( Long.valueOf(10) );\n \t\tsimple.setAddress(\"123 Main St. Anytown USA\");\n \t\tsimple.setCount(1);\n \t\tsimple.setDate( new Date() );\n \t\tsimple.setName(\"My UnflushedSessionSerialization Simple\");\n \t\tsimple.setPay( Float.valueOf(5000) );\n \t\ts.save( simple );\n \n \t\t// Now, try to serialize session without flushing...\n \t\ts.getTransaction().commit();\n \t\tSession s2 = spoofSerialization(s);\n \t\ts.close();\n \t\ts = s2;\n \t\ts.beginTransaction();\n \n \t\tsimple = (Simple) s.load( Simple.class, new Long(10) );\n \t\tSimple other = new Simple( Long.valueOf(11) );\n \t\tother.init();\n \t\ts.save( other );\n \n \t\tsimple.setOther(other);\n \t\ts.flush();\n \n \t\ts.getTransaction().commit();\n \t\ts.close();\n \t\tSimple check = simple;\n \n \t\t///////////////////////////////////////////////////////////////////////////\n \t\t// Test updates across serializations\n \t\ts = sessionFactory().openSession();\n \t\ts.setFlushMode(FlushMode.MANUAL);\n \t\ts.beginTransaction();\n \n \t\tsimple = (Simple) s.get( Simple.class, Long.valueOf(10) );\n \t\tassertTrue(\"Not same parent instances\", check.getName().equals( simple.getName() ) );\n \t\tassertTrue(\"Not same child instances\", check.getOther().getName().equals( other.getName() ) );\n \n \t\tsimple.setName(\"My updated name\");\n \n \t\ts.getTransaction().commit();\n \t\ts2 = spoofSerialization(s);\n \t\ts.close();\n \t\ts = s2;\n \t\ts.beginTransaction();\n \t\ts.flush();\n \n \t\ts.getTransaction().commit();\n \t\ts.close();\n \t\tcheck = simple;\n \n \t\t///////////////////////////////////////////////////////////////////////////\n \t\t// Test deletions across serializations\n \t\ts = sessionFactory().openSession();\n \t\ts.setFlushMode(FlushMode.MANUAL);\n \t\ts.beginTransaction();\n \n \t\tsimple = (Simple) s.get( Simple.class, Long.valueOf( 10 ) );\n \t\tassertTrue(\"Not same parent instances\", check.getName().equals( simple.getName() ) );\n \t\tassertTrue(\"Not same child instances\", check.getOther().getName().equals( other.getName() ) );\n \n \t\t// Now, lets delete across serialization...\n \t\ts.delete(simple);\n \n \t\ts.getTransaction().commit();\n \t\ts2 = spoofSerialization(s);\n \t\ts.close();\n \t\ts = s2;\n \t\ts.beginTransaction();\n \t\ts.flush();\n \n \t\ts.getTransaction().commit();\n \t\ts.close();\n \n \t\t///////////////////////////////////////////////////////////////////////////\n \t\t// Test collection actions across serializations\n \t\ts = sessionFactory().openSession();\n \t\ts.setFlushMode(FlushMode.MANUAL);\n \t\ts.beginTransaction();\n \n \t\tFum fum = new Fum( fumKey(\"uss-fum\") );\n \t\tfum.setFo( new Fum( fumKey(\"uss-fo\") ) );\n \t\tfum.setFum(\"fo fee fi\");\n \t\tfum.getFo().setFum(\"stuff\");\n \t\tFum fr = new Fum( fumKey(\"uss-fr\") );\n \t\tfr.setFum(\"goo\");\n \t\tFum fr2 = new Fum( fumKey(\"uss-fr2\") );\n \t\tfr2.setFum(\"soo\");\n \t\tfum.setFriends( new HashSet() );\n \t\tfum.getFriends().add(fr);\n \t\tfum.getFriends().add(fr2);\n \t\ts.save(fr);\n \t\ts.save(fr2);\n \t\ts.save( fum.getFo() );\n \t\ts.save(fum);\n \n \t\ts.getTransaction().commit();\n \t\ts2 = spoofSerialization(s);\n \t\ts.close();\n \t\ts = s2;\n \t\ts.beginTransaction();\n \t\ts.flush();\n \n \t\ts.getTransaction().commit();\n \t\ts.close();\n \n \t\ts = sessionFactory().openSession();\n \t\ts.setFlushMode(FlushMode.MANUAL);\n \t\ts.beginTransaction();\n \t\tfum = (Fum) s.load( Fum.class, fum.getId() );\n \n \t\tassertTrue(\"the Fum.friends did not get saved\", fum.getFriends().size() == 2);\n \n \t\tfum.setFriends(null);\n \t\ts.getTransaction().commit();\n \t\ts2 = spoofSerialization(s);\n \t\ts.close();\n \t\t\n \t\ts = s2;\n \t\ts.beginTransaction();\n \t\ts.flush();\n \n \t\ts.getTransaction().commit();\n \t\ts.close();\n \n \t\ts = sessionFactory().openSession();\n \t\ts.beginTransaction();\n \t\ts.setFlushMode(FlushMode.MANUAL);\n \t\tfum = (Fum) s.load( Fum.class, fum.getId() );\n \t\tassertTrue(\"the Fum.friends is not empty\", fum.getFriends() == null || fum.getFriends().size() == 0);\n \t\ts.getTransaction().commit();\n \t\ts.close();\n \t}", "title": "" } ]
[ { "docid": "7755356b7e6584c90accc797294001ed", "score": "0.62633324", "text": "@Test\n public void coderTest() {\n Pipeline p = GATKTestPipeline.create();\n List<ReferenceShard> refShards = Lists.newArrayList(new ReferenceShard(0, \"1\"), new ReferenceShard(1, \"2\"), new ReferenceShard(0, \"2\"));\n DataflowTestUtils.pCollectionCreateAndVerify(p, refShards, SerializableCoder.of(ReferenceShard.class));\n p.run();\n }", "title": "" }, { "docid": "3f7e4fadd67aa8cbe0770378b8170b60", "score": "0.62384784", "text": "@Test\n public void testSerialize() {\n }", "title": "" }, { "docid": "e7d4af173c71cf39964c4fbff356c40c", "score": "0.60862327", "text": "public void testResolveExtensions() {\n\t\tComplexSerialization ser1 = new ComplexSerialization();\n\t\tser1.setWriteEmpty(Boolean.TRUE);\n\t\tSerialization ser1Attr = new AttributeSerialization();\n\t\tSerialization ser1Element = new ValueSerialization();\n\t\tser1.setAttributes(Arrays.asList(ser1Attr));\n\t\tser1.setElements(Arrays.asList(ser1Element));\n\t\tComplexSerialization ser2 = new ComplexSerialization();\n\t\tComplexSerialization ser3 = new ComplexSerialization();\n\t\tSerialization ser3Attr = new AttributeSerialization();\n\t\tser3.setAttributes(Arrays.asList(ser3Attr));\n\t\tComplexSerialization ser4 = new ComplexSerialization();\n\t\tSerialization ser4Element = new ValueSerialization();\n\t\tser4.setWriteEmpty(Boolean.FALSE);\n\t\tser4.setElements(Arrays.asList(ser4Element));\n\t\tMap<ComplexSerialization, String> extensions = new HashMap<ComplexSerialization, String>(); \n\t\textensions.put(ser1, \"2\");\n\t\textensions.put(ser2, \"3\");\n\t\textensions.put(ser3, \"4\");\n\t\tMap<String, ComplexSerialization> parents = new HashMap<String, ComplexSerialization>();\n\t\tparents.put(\"2\", ser2);\n\t\tparents.put(\"3\", ser3);\n\t\tparents.put(\"4\", ser4);\n\n\t\treplay(element);\n\t\tSet<String> invalid = SerializationElementHandler.resolveExtensions(extensions, parents);\n\t\tverify(element);\n\t\t\n\t\tassertTrue(CollectionUtils.isEmpty(invalid));\n\t\tassertFalse(ser4.isWriteEmpty());\n\t\tassertTrue(CollectionUtils.isEmpty(ser4.getAttributes()));\n\t\tassertEquals(Arrays.asList(ser4Element), ser4.getElements());\n\t\tassertFalse(ser3.isWriteEmpty());\n\t\tassertEquals(Arrays.asList(ser3Attr), ser3.getAttributes());\n\t\tassertEquals(Arrays.asList(ser4Element), ser3.getElements());\n\t\tassertFalse(ser2.isWriteEmpty());\n\t\tassertEquals(Arrays.asList(ser3Attr), ser2.getAttributes());\n\t\tassertEquals(Arrays.asList(ser4Element), ser2.getElements());\n\t\tassertTrue(ser1.isWriteEmpty());\n\t\tassertEquals(Arrays.asList(ser3Attr, ser1Attr), ser1.getAttributes());\n\t\tassertEquals(Arrays.asList(ser4Element, ser1Element), ser1.getElements());\n\t}", "title": "" }, { "docid": "3107650ae8903082f9cad8881fb8e34d", "score": "0.60024107", "text": "@Test\n public void genInsert() {\n TrieSequence<Integer> seq = TrieSequence.empty();\n for(int i = 0; i < 1234; i++) {\n assertEquals(\"Sequence size\", i, seq.size());\n seq = seq.add(i);\n }\n for(int i = 0; i < 1234; i++) assertEquals((Integer) i, seq.get(i));\n }", "title": "" }, { "docid": "c3d225e69e72cc26b572b56b46df0392", "score": "0.59872395", "text": "@Test\n void test01_after_insert_one_size_is_one() {\n dataStructureInstance.insert(\"testKey\", \"testValue\");\n if (dataStructureInstance.size() != 1) {\n fail(\"data structure should be with size = 1, but size = \" + dataStructureInstance.size());\n }\n }", "title": "" }, { "docid": "0b9171f0162f43b9ba8062ef74969fb5", "score": "0.598392", "text": "@Test\n void test07_more_tests_on_inserting_duplicate_keys() {\n dataStructureInstance.insert(\"testKey1\", \"testValue1\");\n dataStructureInstance.insert(\"testKey2\", \"testValue2\");\n dataStructureInstance.insert(\"testKey3\", \"testValue3\");\n dataStructureInstance.insert(\"testKey4\", \"testValue4\");\n try {\n dataStructureInstance.insert(\"testKey1\", \"testValue5\");\n } catch (RuntimeException e) {\n // Do nothing\n } finally {\n if(dataStructureInstance.size() != 4) {\n fail(\"didn't take care of duplicate keys well\");\n }\n try {\n dataStructureInstance.insert(\"testKey5\", \"testValue1\");\n dataStructureInstance.insert(\"testKey6\", \"testValue2\");\n dataStructureInstance.insert(\"testKey7\", \"testValue3\");\n dataStructureInstance.insert(\"testKey2\", \"testValue4\");\n } catch (RuntimeException e) {\n // Do nothing\n } finally {\n if(dataStructureInstance.size() != 7) {\n fail(\"didn't take care of duplicate keys well\");\n }\n }\n }\n }", "title": "" }, { "docid": "34f7a4894040b19eb5931e5605735fbf", "score": "0.5933459", "text": "public void testSerialization() {\n BlockContainer c1 = new BlockContainer();\n c1.add(new EmptyBlock(1.2, 3.4));\n BlockContainer c2 = (BlockContainer) TestUtilities.serialised(c1);\n }", "title": "" }, { "docid": "ad6654b1e6b6d3919921c5a18381609c", "score": "0.5912529", "text": "@Test\r\n\tpublic void testInsert() {\n\t}", "title": "" }, { "docid": "2b62ca64332e6cd2dec7b8a44cf924a8", "score": "0.58760744", "text": "public void testSerialization() {\n VectorSeries s1 = new VectorSeries(\"Series\");\n s1.add(1.0, 1.1, 1.2, 1.3);\n VectorSeriesCollection c1 = new VectorSeriesCollection();\n c1.addSeries(s1);\n VectorSeriesCollection c2 = (VectorSeriesCollection) TestUtilities.serialised(c1);\n }", "title": "" }, { "docid": "59051c53e6b74ae1aac61311dfbc56c6", "score": "0.5852291", "text": "@org.junit.Test\n public void insert() {\n mytest1.insert(\"add\");\n assertTrue(mytest1.contains(\"add\"));\n mytest1.insert(\"syeehyn\");\n assertTrue(mytest1.contains(\"syeehyn\"));\n mytest1.insert(\"sq\");\n assertTrue(mytest1.contains(\"sq\"));\n mytest1.insert(\"sw\");\n assertTrue(mytest1.contains(\"sw\"));\n mytest1.insert(\"sr\");\n mytest1.insert(\"sy\");\n mytest1.insert(\"st\");\n mytest1.insert(\"a\");\n assertEquals(8, mytest1.getSize());\n mytest1.insert(\"b\");\n mytest1.insert(\"c\");\n mytest1.insert(\"ab\");\n mytest1.insert(\"aa\");\n mytest1.insert(\"dd\");\n mytest1.insert(\"dq\");\n assertEquals(14, mytest1.getSize());\n }", "title": "" }, { "docid": "436022e62012b6819e3201a03cf12e55", "score": "0.58415455", "text": "public void testSerialization() {\n TaskSeries s1 = new TaskSeries(\"Series\");\n s1.add(new Task(\"Task 1\", new Date(0L), new Date(1L)));\n TaskSeriesCollection u1 = new TaskSeriesCollection();\n u1.add(s1);\n SlidingGanttCategoryDataset d1 = new SlidingGanttCategoryDataset(u1, 0, 5);\n SlidingGanttCategoryDataset d2 = (SlidingGanttCategoryDataset) TestUtilities.serialised(d1);\n s1.add(new Task(\"Task 2\", new Date(10L), new Date(11L)));\n TaskSeriesCollection u2 = (TaskSeriesCollection) d2.getUnderlyingDataset();\n TaskSeries s2 = u2.getSeries(\"Series\");\n s2.add(new Task(\"Task 2\", new Date(10L), new Date(11L)));\n }", "title": "" }, { "docid": "1301857462e360a58e927bc53587d07f", "score": "0.5830492", "text": "@Override\n\tpublic void preInsert() {\n\t\t\n\t}", "title": "" }, { "docid": "20b6737ec38f7ddba9df1a15cf9e2c0a", "score": "0.57881504", "text": "@Test\n public void testXmlSerialization() throws Exception {\n testXmllSerialization(list, list2, c1, c2);\n }", "title": "" }, { "docid": "a8a597a3b20cc20805da25476dd789fa", "score": "0.5774702", "text": "public void testSerializability() throws IOException, ClassNotFoundException {\n FileBatchJob f1 = new ConcreteFileBatchJob();\n f1.processOnlyFileNamed(\"helloWorld\");\n FileBatchJob f2 = (FileBatchJob) Serial.serial(f1);\n assertEquals(\"Should have the same state before and after \" +\n \"serialization \", significantState(f1), significantState(f2));\n }", "title": "" }, { "docid": "1b83e305f5d8bc0b0fed82c81d7860ad", "score": "0.57709825", "text": "@Test\n public void testInsert() {\n Product product = new Product(\"a\", \"b\", \"AB-000001-0N\");\n ProductService.insert(conn, product);\n InventoryRecordService.insert(conn, inventoryRecords.get(0));\n assertEquals(inventoryRecords.get(0), InventoryRecordService.getById(conn, inventoryRecords.get(0).getSku()));\n }", "title": "" }, { "docid": "80ef16bc1dc918030d1262ccf97c2026", "score": "0.57644457", "text": "public void testInsert01() {\r\n\r\n\t\ttry {\r\n\t\t\tint ITERATIONS = 100000;\r\n\r\n\t\t\twords = TestUtils.randomWords(ITERATIONS, 31);\r\n\r\n\t\t\tlong before = System.currentTimeMillis();\r\n\r\n\t\t\tfor (int i = 0; i < ITERATIONS; i++) {\r\n\t\t\t\tstore.add(words.get(i), words.get(ITERATIONS - i - 1), 1.0F, null);\r\n\t\t\t}\r\n\r\n\t\t\tlong time = System.currentTimeMillis() - before;\r\n\r\n\t\t\tSystem.err.println((ITERATIONS * 1000 / (time + 1)) + \" inserts per sec\");\r\n\t\t\tSystem.err.println(((double) store.getStorageFile().length() / 1024 / 1.024 / time)\r\n\t\t\t\t\t+ \" Mb/s\");\r\n\t\t} catch (AssociationStoreException e) {\r\n\t\t\tthrow new AssertionError(e);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "f1dfd0c19b036db094cbd525abeb1ba1", "score": "0.5757364", "text": "@Override public void testSerializable() throws SeedException {\n SerializableTester.reserialize(createRng()).nextInt();\n }", "title": "" }, { "docid": "2e15b5e11aad4e96fb8a6c5c008f2516", "score": "0.57573605", "text": "@Override\n public void preInsert()\n {\n \n }", "title": "" }, { "docid": "530f4f9361df3b62adbef0e3da6c5665", "score": "0.5714841", "text": "public void testIdentity1() throws Exception {\n TestBeanA tb1 = new TestBeanA();\n tb1.s1 = \"john\";\n TestBeanA tb2 = tb1;\n \n CharArrayWriter caw = new CharArrayWriter();\n SerializationContext sci = new SerializationContext(caw);\n sci.setDoMultiRefs(true);\n sci.serialize(new QName(\"someLocalPart\"), null, tb1);\n sci.serialize(new QName(\"someOtherLocalPart\"), null, tb2);\n \n String s = caw.toString();\n \n // Cheap but fragile.\n int first = s.indexOf(\"#id0\");\n int last = s.lastIndexOf(\"#id0\");\n assertTrue(s, first >= 0);\n assertTrue(s, last >= 0 && last != first);\n }", "title": "" }, { "docid": "b31692a8aa6929534c678863ca1f8a31", "score": "0.5700569", "text": "@Test\n void writeGame0() throws Exception{\n GameSerializer serializer = new GameSerializer(\"./game.ser\");\n serializer.writeGame(game);\n Game newGame = serializer.readGame();\n assertEquals(game, newGame);\n }", "title": "" }, { "docid": "1c19ba295e31d113bc07ce081e834483", "score": "0.56707567", "text": "public void testEquality3() throws Exception {\n TestBeanB tb1 = new TestBeanB();\n tb1.s1 = \"john\";\n TestBeanB tb2 = new TestBeanB();\n tb2.s1 = \"john\";\n \n CharArrayWriter caw = new CharArrayWriter();\n SerializationContext sci = new SerializationContext(caw);\n sci.setDoMultiRefs(true);\n sci.serialize(new QName(\"someLocalPart\"), null, tb1);\n sci.serialize(new QName(\"someOtherLocalPart\"), null, tb2);\n \n String s = caw.toString();\n \n // Cheap but fragile.\n int first = s.indexOf(\"#id0\");\n int last = s.lastIndexOf(\"#id1\");\n assertTrue(s,first >= 0);\n assertTrue(s,last >= 0 && last != first);\n }", "title": "" }, { "docid": "891402ae5c463290b50fa90ac30e0013", "score": "0.5666907", "text": "@Test\n\tpublic void testInsertMemberBaseInfo(){\n\n\t}", "title": "" }, { "docid": "6ac759d0fcb56a8ff47a10bf3f668a3c", "score": "0.56482774", "text": "public void testEquality1() throws Exception {\n TestBeanA tb1 = new TestBeanA();\n tb1.s1 = \"john\";\n TestBeanA tb2 = new TestBeanA();\n tb2.s1 = \"gregg\";\n \n CharArrayWriter caw = new CharArrayWriter();\n SerializationContext sci = new SerializationContext(caw);\n sci.setDoMultiRefs(true);\n sci.serialize(new QName(\"someLocalPart\"), null, tb1);\n sci.serialize(new QName(\"someOtherLocalPart\"), null, tb2);\n \n String s = caw.toString();\n \n // Cheap but fragile.\n int first = s.indexOf(\"#id0\");\n int last = s.lastIndexOf(\"#id1\");\n assertTrue(s,first >= 0);\n assertTrue(s,last >= 0);\n }", "title": "" }, { "docid": "478d54315146041b7089af082a21107a", "score": "0.56416017", "text": "@Test\n public void testAddingEntities() throws Exception {\n List<Entity> expected = Lists.newArrayList(\n Entity.newBuilder().setKey(DatastoreHelper.makeKey(\"bird\", \"jay\").build()).build(),\n Entity.newBuilder().setKey(DatastoreHelper.makeKey(\"bird\", \"condor\").build()).build(),\n Entity.newBuilder().setKey(DatastoreHelper.makeKey(\"bird\", \"robin\").build()).build());\n\n List<Entity> allEntities = new ArrayList<>();\n allEntities.addAll(expected);\n Collections.shuffle(allEntities);\n\n DatastoreWriter writer = new DatastoreIO.DatastoreWriter(null, mockDatastore);\n writer.open(\"test_id\");\n for (Entity entity : allEntities) {\n writer.write(entity);\n }\n\n assertEquals(expected.size(), writer.entities.size());\n assertThat(writer.entities, containsInAnyOrder(expected.toArray()));\n }", "title": "" }, { "docid": "5d60cc0ff9815ca77ae3ea64c20ff5ef", "score": "0.5638747", "text": "public void testPrintSerializedDataModel(){\r\n\r\n }", "title": "" }, { "docid": "63ba0c153ee6f787262560144465abff", "score": "0.56287456", "text": "@Test\n @Override\n public void transactionInsertTest() throws Exception {\n super.transactionInsertTest();\n\n }", "title": "" }, { "docid": "d37481490bdb783e749717842bc10cdf", "score": "0.5618437", "text": "public void testInterStorageSerDe(SchemaTupleFactory tf) throws Exception {\n int sz = 4096;\n List<Tuple> written = new ArrayList<Tuple>(sz);\n\n File temp = File.createTempFile(\"tmp\", \"tmp\");\n temp.deleteOnExit();\n FileOutputStream fos = new FileOutputStream(temp);\n FSDataOutputStream dos = new FSDataOutputStream(fos, null);\n\n InterRecordWriter writer = new InterRecordWriter(dos,\n PigConfiguration.PIG_INTERSTORAGE_SYNCMARKER_SIZE_DEFAULT,\n PigConfiguration.PIG_INTERSTORAGE_SYNCMARKER_INTERVAL_DEFAULT);\n\n // This test does not cover the case of overlapping record bytes that may be present at the\n // beginning of a split, for that see org.apache.pig.test.TestBinInterSedes#testInterStorageSyncMarker()\n\n for (int i = 0; i < sz; i++) {\n SchemaTuple<?> st = (SchemaTuple<?>)tf.newTuple();\n fillWithData(st);\n writer.write(null, st);\n written.add(st);\n }\n writer.close(null);\n\n Configuration conf = new Configuration();\n conf.set(\"fs.defaultFS\", \"file:///\");\n\n TaskAttemptID taskId = HadoopShims.createTaskAttemptID(\"jt\", 1, true, 1, 1);\n conf.set(MRConfiguration.TASK_ID, taskId.toString());\n\n InputSplit is = new FileSplit(new Path(temp.getAbsolutePath()), 0, temp.length(), null);\n\n InterRecordReader reader = new InterRecordReader(PigConfiguration.PIG_INTERSTORAGE_SYNCMARKER_SIZE_DEFAULT,\n PigConfiguration.PIG_INTERSTORAGE_SYNCMARKER_INTERVAL_DEFAULT);\n reader.initialize(is, HadoopShims.createTaskAttemptContext(conf, taskId));\n\n for (int i = 0; i < sz; i++) {\n assertTrue(reader.nextKeyValue());\n SchemaTuple<?> st = (SchemaTuple<?>)reader.getCurrentValue();\n assertEquals(written.get(i), st);\n }\n reader.close();\n\n }", "title": "" }, { "docid": "7ee42448c790d6bd360d8628714170f9", "score": "0.5616648", "text": "public void testEquality2() throws Exception {\n TestBeanA tb1 = new TestBeanA();\n tb1.s1 = \"john\";\n TestBeanA tb2 = new TestBeanA();\n tb2.s1 = \"john\";\n \n CharArrayWriter caw = new CharArrayWriter();\n SerializationContext sci = new SerializationContext(caw);\n sci.setDoMultiRefs(true);\n sci.serialize(new QName(\"someLocalPart\"), null, tb1);\n sci.serialize(new QName(\"someOtherLocalPart\"), null, tb2);\n \n String s = caw.toString();\n \n // Cheap but fragile.\n int first = s.indexOf(\"#id0\");\n int last = s.lastIndexOf(\"#id1\");\n assertTrue(s,first >= 0);\n assertTrue(s,last >= 0);\n }", "title": "" }, { "docid": "c8fdd50648d281c667f3d66af1b29aa2", "score": "0.560619", "text": "@Test\n public void testInsert() {\n User user = buildUser(3L);\n\n int rows = mapper.insert(user);\n\n assertThat(rows).isEqualTo(1);\n\n User loaded = mapper.selectByPrimaryKey(user.getId());\n\n assertThat(user).isEqualToIgnoringGivenFields(loaded, \"registerDate\");\n\n // insert with null field\n user = buildUser(4L);\n user.setRoles(null);\n\n rows = mapper.insert(user);\n\n assertThat(rows).isEqualTo(1);\n\n loaded = mapper.selectByPrimaryKey(user.getId());\n\n assertThat(user).isEqualToIgnoringGivenFields(loaded, \"registerDate\");\n }", "title": "" }, { "docid": "1248020213154b6f62048ba47639de26", "score": "0.5603309", "text": "public void testIdentity2() throws Exception {\n TestBeanB tb1 = new TestBeanB();\n tb1.s1 = \"john\";\n TestBeanB tb2 = tb1;\n \n CharArrayWriter caw = new CharArrayWriter();\n SerializationContext sci = new SerializationContext(caw);\n sci.setDoMultiRefs(true);\n sci.serialize(new QName(\"someLocalPart\"), null, tb1);\n sci.serialize(new QName(\"someOtherLocalPart\"), null, tb2);\n \n String s = caw.toString();\n \n // Cheap but fragile.\n int first = s.indexOf(\"#id0\");\n int last = s.lastIndexOf(\"#id0\");\n assertTrue(s,first >= 0);\n assertTrue(s,last >= 0 && last != first);\n }", "title": "" }, { "docid": "3eb0e73332adcb5e24781c801527d8bc", "score": "0.55973476", "text": "@Test\n void insert19Test(){\n tree.insert(19);\n assertTrue(tree.contains(19));\n }", "title": "" }, { "docid": "4b2fd7de32beb2d6db73af9acc793c57", "score": "0.55907905", "text": "public void test_18_124_writeObject() {\n\n\t\tObject objToSave = null;\n\t\tObject objLoaded;\n\n\t\ttry {\n\t\t\tobjToSave = new Object[] { Integer.class, new Integer(1) };\n\t\t\tif (DEBUG)\n\t\t\t\tSystem.out.println(\"Obj = \" + objToSave);\n\t\t\tobjLoaded = dumpAndReload(objToSave);\n\t\t\t// Classes with the same name are unique, so test for ==\n\t\t\tassertTrue(MSG_TEST_FAILED + objToSave,\n\t\t\t\t\t((Object[]) objLoaded)[0] == ((Object[]) objToSave)[0]\n\t\t\t\t\t\t\t&& ((Object[]) objLoaded)[1]\n\t\t\t\t\t\t\t\t\t.equals(((Object[]) objToSave)[1]));\n\n\t\t} catch (IOException e) {\n\t\t\tfail(\"IOException serializing \" + objToSave + \" : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tfail(\"ClassNotFoundException reading Object type : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (Error err) {\n\t\t\tSystem.out.println(\"Error when obj = \" + objToSave);\n\t\t\t// err.printStackTrace();\n\t\t\tthrow err;\n\t\t}\n\t}", "title": "" }, { "docid": "13a85bda68f6c48dd3367a9003f76cb8", "score": "0.55787784", "text": "@Test\n public void testInsert() {\n\t\thitchhikerMatchmaker.insert(mockRouteData);\n\t\tassertEquals(mockRouteData, hitchhikerMatchmaker.getRouteData());\n\t}", "title": "" }, { "docid": "83ca836941c21064a136417a70599d03", "score": "0.55723405", "text": "@Test @Override\n\tpublic void t6_existing_add() {\n\t\t\n\t}", "title": "" }, { "docid": "b67ec6c5da13c2e385823758d45f3dd3", "score": "0.55709434", "text": "@Test\n void test06_insert_and_remove_many_elements_should_give_correct_size() {\n dataStructureInstance.insert(\"testKey1\", \"testValue1\");\n dataStructureInstance.insert(\"testKey2\", \"testValue2\");\n dataStructureInstance.insert(\"testKey3\", \"testValue3\");\n dataStructureInstance.insert(\"testKey4\", \"testValue4\");\n dataStructureInstance.insert(\"testKey5\", \"testValue5\");\n dataStructureInstance.insert(\"testKey6\", \"testValue6\");\n dataStructureInstance.insert(\"testKey7\", \"testValue1\");\n dataStructureInstance.remove(\"testKey2\");\n if (dataStructureInstance.size() != 6) {\n fail(\"data structure didn't give correct size while inserting and removing some elements\");\n }\n }", "title": "" }, { "docid": "1acc01a6d3fb94de4a0f8c8c16c8f98d", "score": "0.55642086", "text": "@Test\n public void serializeAndDeserialize() throws IOException, ClassNotFoundException {\n String put[] = {\"abcd\", \"efgh\", \"ijkl\", \"abdf\", \"a\", \"\"};\n Trie tr = new Trie();\n for (String s : put) {\n tr.add(s);\n }\n\n ByteArrayOutputStream outStream = new ByteArrayOutputStream();\n tr.serialize(outStream);\n byte[] data = outStream.toByteArray();\n\n ByteArrayInputStream inStream = new ByteArrayInputStream(data);\n Trie dsr = new Trie();\n dsr.deserialize(inStream);\n\n assertEquals(put.length, dsr.size());\n for (String s : put) {\n assertTrue(dsr.contains(s));\n }\n }", "title": "" }, { "docid": "cf9152f2a0c515acf697aa5a82c9bf78", "score": "0.5558049", "text": "@Test\n void duplicateNftSerials() {\n\n writableAccountStore = newWritableStoreWithAccounts(Account.newBuilder()\n .accountId(ACCOUNT_1339)\n .numberTreasuryTitles(1)\n .numberPositiveBalances(1)\n .build());\n writableTokenStore = newWritableStoreWithTokens(Token.newBuilder()\n .tokenId(TOKEN_123)\n .tokenType(TokenType.NON_FUNGIBLE_UNIQUE)\n .treasuryAccountId(ACCOUNT_1339)\n .supplyKey(TOKEN_SUPPLY_KT.asPbjKey())\n .totalSupply(10)\n .build());\n writableTokenRelStore = newWritableStoreWithTokenRels(TokenRelation.newBuilder()\n .accountId(ACCOUNT_1339)\n .tokenId(TOKEN_123)\n .balance(3)\n .build());\n writableNftStore = newWritableStoreWithNfts(\n Nft.newBuilder()\n .nftId(NftID.newBuilder()\n .tokenId(TOKEN_123)\n .serialNumber(1L)\n .build())\n // do not set ownerId - default to null\n .build(),\n Nft.newBuilder()\n .nftId(NftID.newBuilder()\n .tokenId(TOKEN_123)\n .serialNumber(2L)\n .build())\n // do not set ownerId - default to null\n .build(),\n Nft.newBuilder()\n .nftId(NftID.newBuilder()\n .tokenId(TOKEN_123)\n .serialNumber(3L)\n .build())\n // do not set ownerId - default to null\n .build());\n final var txn = newBurnTxn(TOKEN_123, 0, 1L, 2L, 3L, 1L, 2L, 3L, 3L, 1L, 1L, 2L);\n final var context = mockContext(txn);\n\n subject.handle(context);\n final var treasuryAcct = writableAccountStore.get(ACCOUNT_1339);\n Assertions.assertThat(treasuryAcct).isNotNull();\n Assertions.assertThat(treasuryAcct.numberTreasuryTitles()).isEqualTo(1);\n // The treasury no longer owns any NFTs, so its positive balances should decrease by 1\n Assertions.assertThat(treasuryAcct.numberPositiveBalances()).isZero();\n final var treasuryRel = writableTokenRelStore.get(ACCOUNT_1339, TOKEN_123);\n Assertions.assertThat(treasuryRel).isNotNull();\n Assertions.assertThat(treasuryRel.balance()).isZero();\n Assertions.assertThat(writableNftStore.get(TOKEN_123, 1L)).isNull();\n Assertions.assertThat(writableNftStore.get(TOKEN_123, 2L)).isNull();\n Assertions.assertThat(writableNftStore.get(TOKEN_123, 3L)).isNull();\n }", "title": "" }, { "docid": "a3df8dbda0641d1b6fcc6f414940f54f", "score": "0.5544742", "text": "public void testInsert02() {\r\n\r\n\t\ttry {\r\n\t\t\tint ITERATIONS = 100000;\r\n\r\n\t\t\twords = TestUtils.randomWords(ITERATIONS, 31);\r\n\r\n\t\t\tlong before = System.currentTimeMillis();\r\n\r\n\t\t\tfor (int i = 0; i < ITERATIONS; i++) {\r\n\t\t\t\tstore.add(\"alma\", words.get(i), 1.0F, null);\r\n\t\t\t}\r\n\r\n\t\t\tlong time = System.currentTimeMillis() - before;\r\n\r\n\t\t\tSystem.err.println((ITERATIONS * 1000 / (time + 1)) + \" same subject inserts per sec\");\r\n\t\t\tSystem.err.println(((double) store.getStorageFile().length() / 1024 / 1.024 / time)\r\n\t\t\t\t\t+ \" Mb/s\");\r\n\t\t} catch (AssociationStoreException e) {\r\n\t\t\tthrow new AssertionError(e);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "4750760cb41e202c6708db31f69a6f80", "score": "0.55446273", "text": "public void testinsert()\r\n {\r\n l1.insert(\"hello\");\r\n assertEquals(l1.head.getNext().getData(), \"hello\");\r\n l1.insert(\"d2\");\r\n assertEquals(l1.head.getNext().getData(), \"d2\");\r\n assertEquals(l1.head.getNext().getNext().getData(), \"hello\");\r\n l1.addOrPromo(\"goodbye\");\r\n assertEquals(l1.head.getNext().getData(), \"goodbye\");\r\n assertEquals(l1.head.getNext().getNext().getData(), \"d2\");\r\n l1.remove(\"goodbye\");\r\n l1.remove(\"hello\");\r\n assertEquals(l1.head.getNext().getData(), \"d2\");\r\n }", "title": "" }, { "docid": "1f0ec2aeed0b3b6288a74dd15d81e70e", "score": "0.5538268", "text": "@Test\n public void testSerialization() {\n Function<UUID, Long> getValue = id -> id.getMostSignificantBits() + id.getLeastSignificantBits();\n Function<UUID, Long> getVersion = id -> id.getLeastSignificantBits() - id.getMostSignificantBits();\n val values = ATTRIBUTE_IDS.stream()\n .map(id -> (Map.Entry<UUID, VersionedValue>) new AbstractMap.SimpleImmutableEntry<>(id, new VersionedValue(getVersion.apply(id), getValue.apply(id))))\n .collect(Collectors.toList());\n val expectedValues = ImmutableMap.<UUID, VersionedValue>builder().putAll(values).build();\n\n // Serialize the data.\n byte[] buffer = new byte[ATTRIBUTE_IDS.size() * 1000];\n val data = CacheEntryLayout.setValues(buffer, values.iterator(), values.size());\n Assert.assertSame(\"New buffer was created when none was expected.\", buffer, data);\n\n // Verify the count was correctly encoded, even if we passed a larger than needed array.\n val l = CacheEntryLayout.wrap(data);\n Assert.assertEquals(\"Unexpected number of attributes encoded.\", values.size(), l.getCount());\n\n // Verify we can get all the values back.\n val actualData = l.getAllValues();\n AssertExtensions.assertMapEquals(\"Unexpected values returned\", expectedValues, actualData);\n\n // Verify that the values were encoded in order.\n for (int i = 0; i < values.size(); i++) {\n val expected = values.get(i);\n val actualId = l.getKey(i);\n val actualValue = l.getValue(i);\n Assert.assertEquals(\"Attribute Ids out of order.\", expected.getKey(), actualId);\n Assert.assertEquals(\"Attribute Values out of order.\", expected.getValue().value, (long) actualValue);\n }\n }", "title": "" }, { "docid": "5a879c765750d55d894067cc3f7c5fa8", "score": "0.5518893", "text": "@Order(4)\n @RepeatedTest(50)\n void testDuplicateInstrCreate() {\n\n Assertions.assertThrows(\n MongoWriteException.class,\n () ->\n realDbms.createInstructor(\n generator.nextInt(19), expectedFullData.getJSONObject(generator.nextInt(19))));\n }", "title": "" }, { "docid": "d163fa5c5cdced7fd37c5c0794cacc0a", "score": "0.55114543", "text": "public void test_18_104_writeObject() {\n\n\t\tObject objToSave = null;\n\t\tObject objLoaded;\n\n\t\ttry {\n\t\t\tObject col = Collections.synchronizedSortedMap(TREE);\n\t\t\tobjToSave = col;\n\t\t\tif (DEBUG)\n\t\t\t\tSystem.out.println(\"Obj = \" + objToSave);\n\t\t\tobjLoaded = dumpAndReload(objToSave);\n\t\t\t// Has to have worked\n\t\t\tassertTrue(MSG_TEST_FAILED + objToSave, col.equals(objLoaded));\n\n\t\t} catch (IOException e) {\n\t\t\tfail(\"IOException serializing \" + objToSave + \" : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tfail(\"ClassNotFoundException reading Object type : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (Error err) {\n\t\t\tSystem.out.println(\"Error when obj = \" + objToSave);\n\t\t\t// err.printStackTrace();\n\t\t\tthrow err;\n\t\t}\n\t}", "title": "" }, { "docid": "9334911d73c4ad441b8515fd92c08384", "score": "0.5510476", "text": "@Test\r\n\tpublic void deserializeSerialized() {\r\n\t\tRandom random = new Random();\r\n\t\t\r\n\t\tfor (int i = 0; i < NUMBER_OF_TESTS; i++) {\r\n\t\t\tAddress adresa = new Address(random.nextInt(CLIENT_ID_LIMIT), random.nextInt(NODE_ID_LIMIT));\r\n\t\t\tAssert.assertEquals(\"Adrese nisu iste!\", adresa, Address.parseGID(adresa.getGID()));\r\n\t\t}\t\t\r\n\t}", "title": "" }, { "docid": "367e865a023625ead6ce9334271566f4", "score": "0.5509606", "text": "@Test\n public void testInsertType() {\n ClientUtils.callTest(\"/test/InsertIT.testInsertType\");\n }", "title": "" }, { "docid": "2aed60861059b47713044d8a3d184c16", "score": "0.55014765", "text": "@Test\n\tvoid test4() {\n\t\t\n\t\tTST<Integer> other = new TST<>();\n\t\tother.put(\"key\", 0);\n\t\t\n\t\tassertEquals(false,i.equals(other));\n\t\t\n\t}", "title": "" }, { "docid": "fa3fcc65f1dd474177b6589e464acd58", "score": "0.5494515", "text": "@Test\n public void serialisation() {\n SerializableModel serializedModel = new SerializableModel(modelUpdated);\n Model deserializedModel = new Model(serializedModel);\n\n // Test for serialization correctness\n assertEquals(modelUpdated, deserializedModel);\n }", "title": "" }, { "docid": "be025ac01dba6019e5d06cc42ad4bfab", "score": "0.5488969", "text": "public void beforeInsert0B11( )\n {\n }", "title": "" }, { "docid": "92d730ef42c46617d8a4726889466b1f", "score": "0.54874665", "text": "public void testInsert() {\n // insert the records & check to see if the inserts reported successful insertion\n SuspensionsDao suspensionsDao = new SuspensionsDao(false);\n assertTrue(suspensionsDao.insert(suspension1_));\n assertTrue(suspensionsDao.insert(suspension2_));\n suspensionsDao.close();\n \n \n // validate the inserts were successful\n suspensionsDao = new SuspensionsDao(false);\n \n Suspension suspension1 = suspensionsDao.getSuspensionByName(suspension1_.getName());\n if (suspension1.getId() == -1) fail(\"suspension1.getId() == -1\");\n else suspension1.setId(-1);\n assertTrue(suspension1.isEqual(suspension1_));\n assertFalse(suspension1.isEqual(suspension2_));\n \n Suspension suspension2 = suspensionsDao.getSuspensionByName(suspension2_.getName());\n if (suspension2.getId() == -1) fail(\"suspension2.getId() == -1\");\n else suspension2.setId(-1);\n assertFalse(suspension2.isEqual(suspension1_));\n assertTrue(suspension2.isEqual(suspension2_));\n suspensionsDao.close();\n }", "title": "" }, { "docid": "98d6f84d248e7f1f7079384067e5ce18", "score": "0.54873997", "text": "private void createTestSerializedDataModel(){\r\n theSerializedDataModel = new SerializedDataModel();\r\n }", "title": "" }, { "docid": "5b417a1b01cafbaa63d7df898136ca1d", "score": "0.5483419", "text": "public void testSerializable() throws IOException, ClassNotFoundException {\n Pair<?, ?> item1 = Pair.of(5, \"bla\");\n ByteArrayOutputStream bout = new ByteArrayOutputStream();\n ObjectOutputStream out = new ObjectOutputStream(bout);\n out.writeObject(item1);\n ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bout.toByteArray()));\n Assert.assertEquals(item1, in.readObject());\n }", "title": "" }, { "docid": "b53d2400d404ebe083b2c81fc98d0937", "score": "0.547385", "text": "@Test\n void test08_insert_500_items_and_remove_them() {\n String key = \"\";\n String value = \"\";\n // Insertion\n for (int i = 1; i <= 500; i++) {\n key = (\"testKey\" + Integer.toString(i));\n value = (\"testValue\" + Integer.toString(i));\n dataStructureInstance.insert(key, value);\n }\n if(dataStructureInstance.size() != 500) {\n fail(\"Failed to insert 500 items.\" + \"It only has \" \n + dataStructureInstance.size() + \" items added.\");\n }\n \n // Removal\n for (int i = 1; i <= 500; i++) {\n key = (\"testKey\" + Integer.toString(i));\n dataStructureInstance.remove(key);\n }\n if(dataStructureInstance.size() != 0) {\n fail(\"Failed to remove 500 items. \" + \"It has \"\n + dataStructureInstance.size() + \" items remaining.\");\n }\n }", "title": "" }, { "docid": "65fc0c18fce2cc521b35e31fbc7b9819", "score": "0.547343", "text": "public void testInsert(){\n }", "title": "" }, { "docid": "6c133582ee26c532f4e205c57141f5cb", "score": "0.54524523", "text": "@Test\n public void testIncrementalWrite() throws Exception {\n XMLInputFactory xmlInputFactory = XMLInputFactory.newFactory();\n XMLOutputFactory xmlOutputFactory = XMLOutputFactory.newFactory();\n StringWriter out = new StringWriter();\n XMLStreamWriter sw = xmlOutputFactory.createXMLStreamWriter(out);\n\n // then Jackson components\n XmlMapper mapper = new XmlMapper(xmlInputFactory);\n\n sw.writeStartDocument();\n sw.writeStartElement(\"root\");\n\n // Write whatever content POJOs...\n // SomePojo value1 = ...;\n // OtherPojo value2 = ...;\n // mapper.writeValue(sw, value1);\n // mapper.writeValue(sw, value2);\n\n // and/or regular Stax output\n sw.writeComment(\"Some insightful commentary here\");\n sw.writeEndElement();\n sw.writeEndDocument();\n }", "title": "" }, { "docid": "8a6e40731d9bc3717ab487c738b05cc0", "score": "0.5451043", "text": "@Test\n\tpublic void storedUuidObjectSetTest() throws Exception {\n\t\tList<String> names = runner.returnUuidObjectNames();\n\t\tList<String> ln = list(\"Mike\", \"Sobolewski\");\n\t\tCollections.sort(names);\n\t\tlogger.info(\"names: \" + names);\n\n assertEquals(ln, names);\n\t}", "title": "" }, { "docid": "6d2c5650a5c207f042de5167f8f2ec77", "score": "0.545023", "text": "private void testSerialization(Drs expected) throws IOException {\n DrsJsonMapper jsonMapper = new DrsJsonMapper();\n String json = jsonMapper.writeValueAsString(expected);\n LOGGER.debug(\"DRS JSON serialization: \\n{}\", json);\n Drs actualJson = jsonMapper.readValue(json, Drs.class);\n Assert.assertEquals(expected, actualJson);\n\n DrsYamlMapper yamlMapper = new DrsYamlMapper();\n String yaml = yamlMapper.writeValueAsString(expected);\n LOGGER.debug(\"DRS YAML serialization: \\n{}\", yaml);\n Drs actualYaml = yamlMapper.readValue(yaml, Drs.class);\n Assert.assertEquals(expected, actualYaml);\n }", "title": "" }, { "docid": "b9e5e1fea4f1c6e10eaf5f3d5e0b3c28", "score": "0.54382455", "text": "@Test\n void insertSuccess() {\n Report newReport = new Report(0, \"TestReport\", new Date(2018, 12, 18), 0, 0, \"test\");\n int newId = genericDAO.insert(newReport);\n assertNotEquals(0, newId);\n Report insertedReport = (Report) genericDAO.getById(newId);\n //the id's are expected to be different, so can't test if equal on entire entity\n assertEquals(newReport.getName(), insertedReport.getName());\n\n }", "title": "" }, { "docid": "093758333b808dbed23bdf114cc387a8", "score": "0.5435649", "text": "public void test_18_101_writeObject() {\n\n\t\tObject objToSave = null;\n\t\tObject objLoaded;\n\n\t\ttry {\n\t\t\tObject col = Collections.synchronizedSet(SET);\n\t\t\tobjToSave = col;\n\t\t\tif (DEBUG)\n\t\t\t\tSystem.out.println(\"Obj = \" + objToSave);\n\t\t\tobjLoaded = dumpAndReload(objToSave);\n\t\t\t// Has to have worked\n\t\t\tassertTrue(MSG_TEST_FAILED + objToSave, col.equals(objLoaded));\n\n\t\t} catch (IOException e) {\n\t\t\tfail(\"IOException serializing \" + objToSave + \" : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tfail(\"ClassNotFoundException reading Object type : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (Error err) {\n\t\t\tSystem.out.println(\"Error when obj = \" + objToSave);\n\t\t\t// err.printStackTrace();\n\t\t\tthrow err;\n\t\t}\n\t}", "title": "" }, { "docid": "24d04dea6dc2d1c5270ccc56d3377434", "score": "0.54342735", "text": "@Test\n\tpublic void insertTest() {\n\t\tLOGGER.debug(\"Start insertTest method\");\n\t\tservice.saveContract(instance_1);\n\t\tinstance_1FromDb = service.getContract(instance_1.getId());\n\n\t\tAssert.notNull(instance_1FromDb, \"instance must be saved\");\n\n\t\tAssert.isTrue(\n\t\t\t\t(instance_1FromDb.getCreated() != null) && (instance_1FromDb.getContractStatus() != null)\n\t\t\t\t\t\t&& (instance_1FromDb.getPayForm() != null) && (instance_1FromDb.getPayStatus() != null)\n\t\t\t\t\t\t&& (instance_1FromDb.getCustomerId() != null) && (instance_1FromDb.getTotalPrice() != null),\n\t\t\t\t\"columns values must not by empty\");\n\n\t\tAssert.isTrue(instance_1FromDb.equals(instance_1), \"values of the corresponding columns must by eq.\");\n\t\tLOGGER.debug(\"Finish insertTest method\");\n\n\t}", "title": "" }, { "docid": "4cb7a72cf1eab66562f0c2d75563678f", "score": "0.5433086", "text": "@Test\n public void testMerge() {\n System.out.println(\"test --> merge\");\n Contatto c = new Contatto();\n Contatto result = instance.merge(new PersistenceClass(Contatto.class),c);\n\n assertEquals(c, result);\n \n }", "title": "" }, { "docid": "48015904fb078f7badeceb606add488e", "score": "0.5430869", "text": "public void testInterfaceMethods() throws Exception\n {\n List columns = new ArrayList();\n columns.add(new PSCatalogResultColumn(\n \"Name\", PSCatalogResultColumn.TYPE_TEXT));\n columns.add(new PSCatalogResultColumn(\n \"Number\", PSCatalogResultColumn.TYPE_NUMERIC)); \n columns.add(new PSCatalogResultColumn(\n \"Created Date\", PSCatalogResultColumn.TYPE_DATE)); \n \n PSCatalogResultColumn[] columnMeta = \n (PSCatalogResultColumn[])columns.toArray(new PSCatalogResultColumn[0]);\n PSCatalogResultSet resultSet = new PSCatalogResultSet(columnMeta);\n \n PSCatalogResult result = \n new PSCatalogResult(\"ArchiveLogID1\", \"testArchive1\");\n result.addTextColumn(\"testArchive1\");\n result.addNumericColumn(5);\n result.addDateColumn(System.currentTimeMillis());\n resultSet.addResult(result); \n \n result = new PSCatalogResult(\"ArchiveLogID2\", \"testArchive2\");\n result.addTextColumn(\"testArchive2\");\n result.addNumericColumn(6);\n result.addDateColumn(System.currentTimeMillis());\n resultSet.addResult(result); \n\n Document doc = PSXmlDocumentBuilder.createXmlDocument();\n Element srcEl = resultSet.toXml(doc);\n PSCatalogResultSet otherSet = new PSCatalogResultSet(srcEl);\n assertTrue(resultSet.equals(otherSet));\n \n PSCatalogResult oneMore = \n new PSCatalogResult(\"ArchiveLogID3\", \"testArchive3\");\n oneMore.addTextColumn(\"testArchive3\");\n oneMore.addNumericColumn(7);\n oneMore.addDateColumn(System.currentTimeMillis()); \n resultSet.addResult(oneMore);\n assertTrue(!resultSet.equals(otherSet));\n \n otherSet.copyFrom(resultSet);\n \n assertTrue(resultSet.equals(otherSet));\n assertTrue(resultSet.hashCode() == otherSet.hashCode());\n \n //The result column objects are not in the order of column meta\n //so the validation should return false\n PSCatalogResult testWrongColumns = \n new PSCatalogResult(\"ArchiveLogID3\", \"testArchive3\");\n testWrongColumns.addDateColumn(System.currentTimeMillis()); \n testWrongColumns.addTextColumn(\"testArchive3\");\n testWrongColumns.addNumericColumn(7); \n assertTrue(!resultSet.validateResultToAdd(testWrongColumns));\n \n //Tests validation to add a result with columns to the result set which\n //does not support columns.\n PSCatalogResultSet set = new PSCatalogResultSet();\n //should fail as result has columns but set does not support\n assertTrue(!set.validateResultToAdd(oneMore));\n }", "title": "" }, { "docid": "646917525e6072f39cd97c47a2fcbbd7", "score": "0.5430111", "text": "@Disabled(\"Should work because they are the same...\")\n\t@Test\n\tpublic void testInsert() {\n\t\tBST bst = new BST();\n\t\tbst.insert(8);\t\t\t\t\t\n\t\tbst.insert(6); \n\t\tbst.insert(7);\n\t\tbst.insert(2);\n\t\tbst.insert(3);\n\t\tbst.insert(5);\n\t\tbst.insert(1);\n\t\tbst.insert(4);\n\t\tbst.insert(9);\n\t\tbst.insert(10);\n\t\toutputPrint = cP.consoleText(bst);\n\t\tassertEquals(\"8 6 2 1 3 5 4 7 9 1 0\", outputPrint);\n\t}", "title": "" }, { "docid": "dc32e6aa9f7ce32baeaff182de746e85", "score": "0.54263955", "text": "public void testSerialization() {\n\n // Serialize the test bean\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\n try {\n final ObjectOutputStream oos = new ObjectOutputStream(baos);\n oos.writeObject(bean);\n oos.flush();\n oos.close();\n } catch (final Exception e) {\n fail(\"Exception during serialization: \" + e);\n }\n\n // Deserialize the test bean\n try {\n bean = null;\n final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());\n final ObjectInputStream ois = new ObjectInputStream(bais);\n bean = (DynaBean) ois.readObject();\n bais.close();\n } catch (final Exception e) {\n fail(\"Exception during deserialization: \" + e);\n }\n\n // Confirm property values\n testGetDescriptorArguments();\n testGetDescriptorBoolean();\n testGetDescriptorDouble();\n testGetDescriptorFloat();\n testGetDescriptorInt();\n testGetDescriptorLong();\n testGetDescriptorSecond();\n testGetDescriptorShort();\n testGetDescriptorString();\n testGetDescriptors();\n testGetIndexedArguments();\n testGetIndexedValues();\n testGetMappedArguments();\n testGetMappedValues();\n testGetSimpleArguments();\n testGetSimpleBoolean();\n testGetSimpleDouble();\n testGetSimpleFloat();\n testGetSimpleInt();\n testGetSimpleLong();\n testGetSimpleShort();\n testGetSimpleString();\n testMappedContains();\n testMappedRemove();\n\n // Ensure that we can create a new instance of the same DynaClass\n try {\n bean = bean.getDynaClass().newInstance();\n } catch (final Exception e) {\n fail(\"Exception creating new instance: \" + e);\n }\n testGetDescriptorArguments();\n testGetDescriptorBoolean();\n testGetDescriptorDouble();\n testGetDescriptorFloat();\n testGetDescriptorInt();\n testGetDescriptorLong();\n testGetDescriptorSecond();\n testGetDescriptorShort();\n testGetDescriptorString();\n testGetDescriptors();\n\n }", "title": "" }, { "docid": "2b635dd7d73a55454c6a9b8cfa0f4049", "score": "0.5424211", "text": "@Test\n public void testStoreMultilpleWrites() throws Exception {\n AccountStatsMySqlStore mySqlStore = createAccountStatsMySqlStore(clusterName1, hostname1, port1);\n HostAccountStorageStatsWrapper stats1 =\n generateHostAccountStorageStatsWrapper(10, 10, 1, StatsReportType.ACCOUNT_REPORT);\n mySqlStore.storeHostAccountStorageStats(stats1);\n\n HostAccountStorageStats hostAccountStorageStatsCopy = new HostAccountStorageStats(stats1.getStats());\n Map<Long, Map<Short, Map<Short, ContainerStorageStats>>> newStorageStats =\n new HashMap<>(hostAccountStorageStatsCopy.getStorageStats());\n ContainerStorageStats origin = newStorageStats.get((long) 0).get((short) 0).get((short) 0);\n newStorageStats.get((long) 0)\n .get((short) 0)\n .put((short) 0,\n new ContainerStorageStats.Builder(origin).logicalStorageUsage(origin.getLogicalStorageUsage() + 1).build());\n\n HostAccountStorageStatsWrapper stats2 = new HostAccountStorageStatsWrapper(new StatsHeader(stats1.getHeader()),\n new HostAccountStorageStats(newStorageStats));\n mySqlStore.storeHostAccountStorageStats(stats2);\n HostAccountStorageStatsWrapper obtainedStats = mySqlStore.queryHostAccountStorageStatsByHost(hostname1, port1);\n assertEquals(stats2.getStats().getStorageStats(), obtainedStats.getStats().getStorageStats());\n\n hostAccountStorageStatsCopy = new HostAccountStorageStats(stats1.getStats());\n newStorageStats = new HashMap<>(hostAccountStorageStatsCopy.getStorageStats());\n origin = newStorageStats.get((long) 0).get((short) 0).get((short) 0);\n newStorageStats.get((long) 0)\n .get((short) 0)\n .put((short) 0,\n new ContainerStorageStats.Builder(origin).physicalStorageUsage(origin.getPhysicalStorageUsage() + 1)\n .build());\n\n HostAccountStorageStatsWrapper stats3 = new HostAccountStorageStatsWrapper(new StatsHeader(stats1.getHeader()),\n new HostAccountStorageStats(newStorageStats));\n mySqlStore.storeHostAccountStorageStats(stats3);\n obtainedStats = mySqlStore.queryHostAccountStorageStatsByHost(hostname1, port1);\n assertEquals(stats3.getStats().getStorageStats(), obtainedStats.getStats().getStorageStats());\n\n hostAccountStorageStatsCopy = new HostAccountStorageStats(stats1.getStats());\n newStorageStats = new HashMap<>(hostAccountStorageStatsCopy.getStorageStats());\n origin = newStorageStats.get((long) 0).get((short) 0).get((short) 0);\n newStorageStats.get((long) 0)\n .get((short) 0)\n .put((short) 0, new ContainerStorageStats.Builder(origin).numberOfBlobs(origin.getNumberOfBlobs() + 1).build());\n\n HostAccountStorageStatsWrapper stats4 = new HostAccountStorageStatsWrapper(new StatsHeader(stats1.getHeader()),\n new HostAccountStorageStats(newStorageStats));\n mySqlStore.storeHostAccountStorageStats(stats4);\n obtainedStats = mySqlStore.queryHostAccountStorageStatsByHost(hostname1, port1);\n assertEquals(stats4.getStats().getStorageStats(), obtainedStats.getStats().getStorageStats());\n\n mySqlStore.shutdown();\n }", "title": "" }, { "docid": "1fbfd8fca0559178703b42ac310b48aa", "score": "0.5402445", "text": "@Test\n \tpublic void testReachability() throws Exception {\n \t\tSession s = openSession();\n \t\ts.beginTransaction();\n \t\tBaz baz1 = new Baz();\n \t\ts.save(baz1);\n \t\tBaz baz2 = new Baz();\n \t\ts.save(baz2);\n \t\tbaz1.setIntArray( new int[] {1 ,2, 3, 4} );\n \t\tbaz1.setFooSet( new HashSet() );\n \t\tFoo foo = new Foo();\n \t\ts.save(foo);\n \t\tbaz1.getFooSet().add(foo);\n \t\ts.getTransaction().commit();\n \t\ts.close();\n \n \t\ts = openSession();\n \t\ts.beginTransaction();\n \t\tbaz2 = (Baz) s.load( Baz.class, baz2.getCode() );\n \t\tbaz1 = (Baz) s.load( Baz.class, baz1.getCode() );\n \t\tbaz2.setFooSet( baz1.getFooSet() ); baz1.setFooSet(null);\n \t\tbaz2.setIntArray( baz1.getIntArray() ); baz1.setIntArray(null);\n \t\ts.getTransaction().commit();\n \t\ts.close();\n \n \t\ts = openSession();\n \t\ts.beginTransaction();\n \t\tbaz2 = (Baz) s.load( Baz.class, baz2.getCode() );\n \t\tbaz1 = (Baz) s.load( Baz.class, baz1.getCode() );\n \t\tassertTrue( \"unkeyed reachability\", baz2.getIntArray().length==4 );\n \t\tassertTrue( \"unkeyed reachability\", baz2.getFooSet().size()==1 );\n \t\tassertTrue( \"unkeyed reachability\", baz1.getIntArray().length==0 );\n \t\tassertTrue( \"unkeyed reachability\", baz1.getFooSet().size()==0 );\n \t\t//System.out.println( s.print(baz1) + s.print(baz2) );\n \t\tFooProxy fp = (FooProxy) baz2.getFooSet().iterator().next();\n \t\ts.delete(fp);\n \t\ts.delete(baz1);\n \t\ts.delete(baz2);\n \t\ts.getTransaction().commit();\n \t\ts.close();\n \n \t\t//now for collections of collections\n \t\ts = openSession();\n \t\ts.beginTransaction();\n \t\tbaz1 = new Baz();\n \t\ts.save(baz1);\n \t\tbaz2 = new Baz();\n \t\ts.save(baz2);\n \t\ts.getTransaction().commit();\n \t\ts.close();\n \n \t\ts = openSession();\n \t\ts.beginTransaction();\n \t\tbaz2 = (Baz) s.load( Baz.class, baz2.getCode() );\n \t\tbaz1 = (Baz) s.load( Baz.class, baz1.getCode() );\n \t\ts.getTransaction().commit();\n \t\ts.close();\n \n \t\ts = openSession();\n \t\ts.beginTransaction();\n \t\tbaz2 = (Baz) s.load( Baz.class, baz2.getCode() );\n \t\ts.getTransaction().commit();\n \t\ts.close();\n \n \t\ts = openSession();\n \t\ts.beginTransaction();\n \t\tbaz2 = (Baz) s.load( Baz.class, baz2.getCode() );\n \t\tbaz1 = (Baz) s.load( Baz.class, baz1.getCode() );\n \t\ts.delete(baz1);\n \t\ts.delete(baz2);\n \t\ts.getTransaction().commit();\n \t\ts.close();\n \n \t\t//now for keyed collections\n \t\ts = openSession();\n \t\ts.beginTransaction();\n \t\tbaz1 = new Baz();\n \t\ts.save(baz1);\n \t\tbaz2 = new Baz();\n \t\ts.save(baz2);\n \t\tFoo foo1 = new Foo();\n \t\tFoo foo2 = new Foo();\n \t\ts.save(foo1); s.save(foo2);\n \t\tbaz1.setFooArray( new Foo[] { foo1, null, foo2 } );\n \t\tbaz1.setStringDateMap( new TreeMap() );\n \t\tbaz1.getStringDateMap().put(\"today\", new Date( System.currentTimeMillis() ) );\n \t\tbaz1.getStringDateMap().put(\"tomorrow\", new Date( System.currentTimeMillis() + 86400000 ) );\n \t\ts.getTransaction().commit();\n \t\ts.close();\n \n \t\ts = openSession();\n \t\ts.beginTransaction();\n \t\tbaz2 = (Baz) s.load( Baz.class, baz2.getCode() );\n \t\tbaz1 = (Baz) s.load( Baz.class, baz1.getCode() );\n \t\tbaz2.setFooArray( baz1.getFooArray() ); baz1.setFooArray(null);\n \t\tbaz2.setStringDateMap( baz1.getStringDateMap() ); baz1.setStringDateMap(null);\n \t\ts.getTransaction().commit();\n \t\ts.close();\n \n \t\ts = openSession();\n \t\ts.beginTransaction();\n \t\tbaz2 = (Baz) s.load( Baz.class, baz2.getCode() );\n \t\tbaz1 = (Baz) s.load( Baz.class, baz1.getCode() );\n \t\tassertTrue( \"reachability\", baz2.getStringDateMap().size()==2 );\n \t\tassertTrue( \"reachability\", baz2.getFooArray().length==3 );\n \t\tassertTrue( \"reachability\", baz1.getStringDateMap().size()==0 );\n \t\tassertTrue( \"reachability\", baz1.getFooArray().length==0 );\n \t\tassertTrue( \"null element\", baz2.getFooArray()[1]==null );\n \t\tassertTrue( \"non-null element\", baz2.getStringDateMap().get(\"today\")!=null );\n \t\tassertTrue( \"non-null element\", baz2.getStringDateMap().get(\"tomorrow\")!=null );\n \t\tassertTrue( \"null element\", baz2.getStringDateMap().get(\"foo\")==null );\n \t\ts.delete( baz2.getFooArray()[0] );\n \t\ts.delete( baz2.getFooArray()[2] );\n \t\ts.delete(baz1);\n \t\ts.delete(baz2);\n \t\ts.flush();\n \t\tassertTrue( s.createQuery( \"from java.lang.Object\" ).list().size()==0 );\n \t\ts.getTransaction().commit();\n \t\ts.close();\n \t}", "title": "" }, { "docid": "27b4df349cf07c07abbe581b0843911e", "score": "0.5402176", "text": "public void test50967() {\n byte[] bytes = HexRead.readFromString(data_50967);\n\n RecordInputStream in = TestcaseRecordInputStream.create(bytes);\n assertEquals(ExtSSTRecord.sid, in.getSid());\n ExtSSTRecord src = new ExtSSTRecord(in);\n assertEquals(12386, src.getDataSize());\n ExtSSTRecord.InfoSubRecord[] sub1 = src.getInfoSubRecords();\n\n byte[] serialized = src.serialize();\n\n in = TestcaseRecordInputStream.create(serialized);\n assertEquals(ExtSSTRecord.sid, in.getSid());\n ExtSSTRecord dst = new ExtSSTRecord(in);\n assertEquals(12386, dst.getDataSize());\n ExtSSTRecord.InfoSubRecord[] sub2 = src.getInfoSubRecords();\n assertEquals(sub1.length, sub2.length);\n\n for(int i = 0; i < sub1.length; i++){\n ExtSSTRecord.InfoSubRecord s1 = sub1[i];\n ExtSSTRecord.InfoSubRecord s2 = sub2[i];\n\n assertEquals(s1.getBucketSSTOffset(), s2.getBucketSSTOffset());\n assertEquals(s1.getStreamPos(), s2.getStreamPos());\n\n }\n }", "title": "" }, { "docid": "f1049878eae2f2cad2e4a0f89c43d6cb", "score": "0.539371", "text": "public void test_18_106_writeObject() {\n\n\t\tObject objToSave = null;\n\t\tObject objLoaded;\n\n\t\ttry {\n\t\t\tobjToSave = SORTSET;\n\t\t\tif (DEBUG)\n\t\t\t\tSystem.out.println(\"Obj = \" + objToSave);\n\t\t\tobjLoaded = dumpAndReload(objToSave);\n\t\t\t// Has to have worked\n\t\t\tassertTrue(MSG_TEST_FAILED + objToSave, SET.equals(objLoaded));\n\n\t\t} catch (IOException e) {\n\t\t\tfail(\"IOException serializing \" + objToSave + \" : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tfail(\"ClassNotFoundException reading Object type : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (Error err) {\n\t\t\tSystem.out.println(\"Error when obj = \" + objToSave);\n\t\t\t// err.printStackTrace();\n\t\t\tthrow err;\n\t\t}\n\t}", "title": "" }, { "docid": "88dc0568e9bb3aedbffa5e4e2c22382a", "score": "0.5388091", "text": "private static void testDeduplication() {\n\t\t\n\t}", "title": "" }, { "docid": "c3f6d3f4f17be20aaeae5b9d67a1c758", "score": "0.5382123", "text": "@SuppressWarnings(\"unchecked\")\n @Test\n public void storageTest() {\n final ActivityEntryDTO actE = new ActivityEntryDTO(this.fEntryMap);\n\n // modify data\n final ActivityEntry modActE = new ActivityEntryImpl();\n modActE.setContent(actE.getContent() + \" mod\");\n modActE.setPublished(actE.getPublished() + \" mod\");\n modActE.setTitle(actE.getTitle() + \" mod\");\n modActE.setUpdated(actE.getUpdated() + \" mod\");\n modActE.setUrl(actE.getUrl() + \" mod\");\n modActE.setVerb(actE.getVerb() + \" mod\");\n\n ActivityObject actor = actE.getActor();\n actor = modifyObject(actor);\n modActE.setActor(actor);\n\n ActivityObject object = actE.getObject();\n object = modifyObject(object);\n modActE.setObject(object);\n\n ActivityObject target = actE.getTarget();\n target = modifyObject(target);\n modActE.setTarget(target);\n\n ActivityObject generator = actE.getGenerator();\n generator = modifyObject(generator);\n modActE.setGenerator(generator);\n\n ActivityObject provider = actE.getProvider();\n provider = modifyObject(provider);\n modActE.setProvider(provider);\n\n // set data\n actE.setData(modActE);\n\n // check result\n Assert.assertEquals(ActivityEntryDTOTest.CONTENT + \" mod\",\n this.fEntryMap.get(ActivityEntry.Field.CONTENT.toString()));\n Assert.assertEquals(ActivityEntryDTOTest.PUBLISHED + \" mod\",\n this.fEntryMap.get(ActivityEntry.Field.PUBLISHED.toString()));\n Assert.assertEquals(ActivityEntryDTOTest.TITLE + \" mod\",\n this.fEntryMap.get(ActivityEntry.Field.TITLE.toString()));\n Assert.assertEquals(ActivityEntryDTOTest.UPDATED + \" mod\",\n this.fEntryMap.get(ActivityEntry.Field.UPDATED.toString()));\n Assert.assertEquals(ActivityEntryDTOTest.URL + \" mod\",\n this.fEntryMap.get(ActivityEntry.Field.URL.toString()));\n Assert.assertEquals(ActivityEntryDTOTest.VERB + \" mod\",\n this.fEntryMap.get(ActivityEntry.Field.VERB.toString()));\n\n validateObject((Map<String, Object>) this.fEntryMap.get(ActivityEntry.Field.ACTOR.toString()));\n validateObject((Map<String, Object>) this.fEntryMap.get(ActivityEntry.Field.OBJECT.toString()));\n validateObject((Map<String, Object>) this.fEntryMap.get(ActivityEntry.Field.TARGET.toString()));\n validateObject((Map<String, Object>) this.fEntryMap.get(ActivityEntry.Field.GENERATOR\n .toString()));\n validateObject((Map<String, Object>) this.fEntryMap\n .get(ActivityEntry.Field.PROVIDER.toString()));\n }", "title": "" }, { "docid": "b92e3e50694a0644af11a0e3cfe158fa", "score": "0.5379508", "text": "@Test\n public void testSaveAddedServices() {\n Subsystem originalSub = subsystemRepository.findOne(8L);\n Member originalMember = originalSub.getMember();\n Service originalService5 = serviceRepository.findOne(5L);\n Service originalService6 = serviceRepository.findOne(6L);\n Service originalRemovedService8 = serviceRepository.findOne(8L);\n Service originalRemovedService9 = serviceRepository.findOne(9L);\n // detach, so we dont modify those objects in the next steps\n testUtil.entityManagerClear();\n\n Subsystem savedSub = new Subsystem();\n testUtil.shallowCopyFields(originalSub, savedSub);\n savedSub.setMember(originalMember);\n Service savedService5 = new Service();\n Service savedService6 = new Service();\n testUtil.shallowCopyFields(originalService5, savedService5);\n testUtil.shallowCopyFields(originalService6, savedService6);\n Service newService = new Service();\n newService.setServiceCode(\"foocode-asddsa-ads\");\n newService.setServiceVersion(\"v6\");\n Service newServiceNullVersion = new Service();\n newServiceNullVersion.setServiceCode(\"foocode-asddsa-ads-null\");\n newServiceNullVersion.setServiceVersion(null);\n Service newServiceEmptyVersion = new Service();\n newServiceEmptyVersion.setServiceCode(\"foocode-asddsa-ads-empty\");\n newServiceEmptyVersion.setServiceVersion(\"\");\n\n catalogService.saveServices(savedSub.createKey(),\n Lists.newArrayList(savedService5, savedService6, newService,\n newServiceNullVersion, newServiceEmptyVersion));\n testUtil.entityManagerFlush();\n long newId = newService.getId();\n long newIdNull = newServiceNullVersion.getId();\n long newIdEmpty = newServiceEmptyVersion.getId();\n testUtil.entityManagerClear();\n\n // read back and verify\n Subsystem checkedSub = subsystemRepository.findOne(8L);\n testUtil.assertAllSame(originalSub.getStatusInfo(), checkedSub.getStatusInfo());\n Service checkedService5 = (Service) testUtil.getEntity(checkedSub.getAllServices(), 5L).get();\n Service checkedService6 = (Service) testUtil.getEntity(checkedSub.getAllServices(), 6L).get();\n Service checkedService8 = (Service) testUtil.getEntity(checkedSub.getAllServices(), 8L).get();\n Service checkedService9 = (Service) testUtil.getEntity(checkedSub.getAllServices(), 9L).get();\n Service checkedNewService = (Service) testUtil.getEntity(checkedSub.getAllServices(), newId).get();\n Service checkedNewServiceNull = (Service) testUtil.getEntity(checkedSub.getAllServices(), newIdNull).get();\n Service checkedNewServiceEmpty = (Service) testUtil.getEntity(checkedSub.getAllServices(), newIdEmpty).get();\n\n assertNewService(checkedNewService);\n assertNewService(checkedNewServiceNull);\n assertNewService(checkedNewServiceEmpty);\n\n assertFalse(checkedService5.getStatusInfo().isRemoved());\n assertFalse(checkedService6.getStatusInfo().isRemoved());\n assertTrue(checkedService8.getStatusInfo().isRemoved());\n assertTrue(checkedService9.getStatusInfo().isRemoved());\n testUtil.assertFetchedIsOnlyDifferent(originalService5.getStatusInfo(), checkedService5.getStatusInfo());\n testUtil.assertFetchedIsOnlyDifferent(originalService6.getStatusInfo(), checkedService6.getStatusInfo());\n testUtil.assertAllSame(originalRemovedService8.getStatusInfo(), checkedService8.getStatusInfo());\n testUtil.assertAllSame(originalRemovedService9.getStatusInfo(), checkedService9.getStatusInfo());\n }", "title": "" }, { "docid": "3535ee3a5a9a6121a02472f97387b312", "score": "0.53719634", "text": "public void testSopInsert_nokey_04() throws Exception {\n assertFalse(insertToSucceed(key, false, false, \"some value\"));\n }", "title": "" }, { "docid": "5fa64bde8ab8d251e37e3e8be53e6a60", "score": "0.5358984", "text": "@Test\n public void testInsertWithOrderMapping() {\n Pokemon pokemon = new Pokemon(BASE_ID + 1, \"Articuno\", TYPES.get(3), TYPES.get(15));\n long result = dbClient.execute()\n .createNamedInsert(\"insert-pokemon-order-arg-rev\")\n .indexedParam(pokemon)\n .execute();\n verifyInsertPokemon(dbClient, result, pokemon);\n }", "title": "" }, { "docid": "15551b76f819a4495059672ba5b7a329", "score": "0.5357025", "text": "@Test\r\n public void serializationEmptyTest() {\r\n BinaryTree<String> mt = new BinaryTree<String>();\r\n assertNotNull(mt);\r\n assertEquals(0, mt.numberOfNodes());\r\n // Test the save(filename) method.\r\n try {\r\n boolean saveStatus = mt.save(SER_FILENAME);\r\n assertTrue(saveStatus);\r\n } catch (java.io.IOException e) {\r\n fail(\"serializationEmptyTest save IOException: \" + e);\r\n return;\r\n } catch (Exception e) {\r\n fail(\"serializationEmptyTest save exception: \" + e);\r\n return;\r\n }\r\n // Test the restore(filename) method.\r\n BinaryTree<String> sbt = new BinaryTree<String>(\"ROOT\");\r\n assertNotNull(sbt);\r\n assertEquals(1, sbt.numberOfNodes());\r\n assertEquals(false, compareTrees(mt, sbt));\r\n try {\r\n boolean restoreStatus = sbt.restore(SER_FILENAME);\r\n assertTrue(restoreStatus);\r\n } catch (java.io.IOException e) {\r\n fail(\"serializationEmptyTest restore IOException: \" + e);\r\n return;\r\n } catch (Exception e) {\r\n fail(\"serializationEmptyTest restore exception: \" + e);\r\n return;\r\n }\r\n // Compare original and restored trees.\r\n assertTrue(compareTrees(mt, sbt));\r\n }", "title": "" }, { "docid": "6022e3069603c7dd799c10080a90b608", "score": "0.5356493", "text": "public void testXml1() throws Exception { \n // make base comparison objects \n InsertRequest insert = new InsertRequest();\n \n insert.setHandle(\"insert 1\");\n insert.addFeature(testFeature);\n TransactionRequest baseRequest = new TransactionRequest();\n baseRequest.addSubRequest(insert);\n baseRequest.setHandle(\"my insert\");\n // run test \n assertTrue(runXmlTest( baseRequest, \"insert1\", true));\n }", "title": "" }, { "docid": "ba8eff79d34438aabac877669a239379", "score": "0.5356382", "text": "@Test\n public void testInsertInHashMapShouldOverWriteForSameData() {\n Person vivek = new Person(\"Swamiji\", 3);\n HashMap<Person, Person> peopleMap = new HashMap<Person, Person>();\n peopleMap.put(swamiji, swamiji);\n peopleMap.put(vivek, vivek);\n assertEquals(1, peopleMap.size());\n }", "title": "" }, { "docid": "2d8572b048ac1d4d0a2ece41c921583e", "score": "0.535599", "text": "public void preMarshal();", "title": "" }, { "docid": "15b11761222481cfb22bc6c37b519d69", "score": "0.5348809", "text": "public void testSopInsert_nokey_05() throws Exception {\n assertTrue(insertToSucceed(key, true, true, \"some value\"));\n }", "title": "" }, { "docid": "afff22ff661649b846029e73a93b61f2", "score": "0.5346762", "text": "@Test\r\n\tpublic void testInsertAt01() {\r\n\r\n\t\tClass1 class1;\r\n\t\tclass1 = new Class1();\r\n\r\n\t\tList<Object> orderedSet01;\r\n\t\torderedSet01 = new ArrayList<Object>();\r\n\t\torderedSet01.add(1);\r\n\t\torderedSet01.add(2);\r\n\t\torderedSet01.add(3);\r\n\r\n\t\tassertEquals(3, class1.testOrderedSetInsertAt(orderedSet01, 1, 1)\r\n\t\t\t\t.size());\r\n\t\tassertEquals(4, class1.testOrderedSetInsertAt(orderedSet01, 1, 0)\r\n\t\t\t\t.size());\r\n\t}", "title": "" }, { "docid": "cb5711b4ddf5e61e088a5d2ee7e48830", "score": "0.5346645", "text": "private void checkSerialization(Element element) throws Exception {\n ElementData eternalElementData = valueModeHandler.createElementData(element);\n serialize(\"eternalElement\", eternalElementData);\n\n // Deserialize elemenData and create new Element\n Serializable deserialized = deserialize(\"eternalElement\");\n Element deserializedElement = valueModeHandler.createElement(KEY, deserialized);\n\n // Assert deserialized Element is equal to original Element\n assertElementsAreEqual(element, deserializedElement);\n }", "title": "" }, { "docid": "3d9943f371c2b5437f24c2765670b706", "score": "0.5343312", "text": "int insert(Spec record);", "title": "" }, { "docid": "35a11b778ebc05a135e4d13ebd58be22", "score": "0.53432506", "text": "public void testJackson354Serialization() throws IOException\n {\n assertEquals(\"{\\\"name\\\":\\\"foo\\\"}\", MAPPER.writeValueAsString(new Bean354()));\n }", "title": "" }, { "docid": "c6b9a84566426c7f4d03135ad14c9ad8", "score": "0.5339936", "text": "@Override\n public void DataIsInserted() {\n }", "title": "" }, { "docid": "e7540c26ee3921265a7ef23c5955f17c", "score": "0.53391284", "text": "public void testEquals()\n {\n /*\n * see testEquals() in InsertElementTest\n */\n }", "title": "" }, { "docid": "82b47f2445b0d8daa6a1ca27deb2ca3c", "score": "0.5337189", "text": "public void test_18_105_writeObject() {\n\n\t\tObject objToSave = null;\n\t\tObject objLoaded;\n\n\t\ttry {\n\t\t\tObject col = Collections.unmodifiableSortedMap(TREE);\n\t\t\tobjToSave = col;\n\t\t\tif (DEBUG)\n\t\t\t\tSystem.out.println(\"Obj = \" + objToSave);\n\t\t\tobjLoaded = dumpAndReload(objToSave);\n\t\t\t// Has to have worked\n\t\t\tassertTrue(MSG_TEST_FAILED + objToSave, col.equals(objLoaded));\n\n\t\t} catch (IOException e) {\n\t\t\tfail(\"IOException serializing \" + objToSave + \" : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tfail(\"ClassNotFoundException reading Object type : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (Error err) {\n\t\t\tSystem.out.println(\"Error when obj = \" + objToSave);\n\t\t\t// err.printStackTrace();\n\t\t\tthrow err;\n\t\t}\n\t}", "title": "" }, { "docid": "2e40b9f4e22414abaf975ec7695ee3de", "score": "0.5336504", "text": "@Test\n public void testRollBackInsertDuplicate()\n throws DatabaseException {\n\n /* Transactional dups, 3 two-keys. */\n openAndInit(true, true);\n\n /* Add datum 2 for key 0, cursor appears on BIN. */\n Transaction txn = env.beginTransaction(null, null);\n Cursor cursor = db.openCursor(txn, null);\n cursor.put(entry0, entry2);\n checkBinEntriesAndCursors(bin, 4, 1);\n\n /* Closing the cursor without abort does not compress. */\n cursor.close();\n env.compress();\n checkBinEntriesAndCursors(bin, 4, 0);\n\n /* Checkpoint to preserve internal nodes through recovery. */\n env.checkpoint(forceConfig);\n\n /* Abort without calling compress does not compress. */\n txn.abort();\n checkBinEntriesAndCursors(bin, 4, 0);\n\n /*\n * Shutdown and reopen to run recovery. The checkpoint will not\n * compress because deltas are logged.\n */\n db.close();\n closeNoCheckpoint(env);\n env = null;\n openEnv(true, true);\n initInternalNodes();\n\n /* \n * In replicated tests, we expect 64 BINs. In non-replicated tests, \n * there should be 2.\n */\n if (isReplicatedTest(getClass())) {\n checkBinEntriesAndCursors(bin, 64, 0);\n } else {\n checkBinEntriesAndCursors(bin, 4, 0);\n }\n\n /* Lazy compression finally occurs during a full sync (no delta). */\n bin.setDirty(true);\n bin.setProhibitNextDelta(true);\n env.sync();\n checkBinEntriesAndCursors(bin, 3, 0);\n\n /* Should be no change in parent nodes. */\n assertEquals(2, in.getNEntries());\n\n closeEnv();\n }", "title": "" }, { "docid": "2bf8e0e8c215a089ef67b2921bec0d9f", "score": "0.53357536", "text": "public void test_18_90_writeObject() {\n\n\t\tObject objToSave = null;\n\t\tObject objLoaded;\n\n\t\ttry {\n\t\t\tobjToSave = TABLE;\n\t\t\tif (DEBUG)\n\t\t\t\tSystem.out.println(\"Obj = \" + objToSave);\n\t\t\tobjLoaded = dumpAndReload(objToSave);\n\t\t\t// Has to have worked\n\t\t\tassertTrue(MSG_TEST_FAILED + objToSave, TABLE.equals(objLoaded));\n\n\t\t} catch (IOException e) {\n\t\t\tfail(\"IOException serializing \" + objToSave + \" : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tfail(\"ClassNotFoundException reading Object type : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (Error err) {\n\t\t\tSystem.out.println(\"Error when obj = \" + objToSave);\n\t\t\t// err.printStackTrace();\n\t\t\tthrow err;\n\t\t}\n\t}", "title": "" }, { "docid": "94547b94eac9a3fa676dbc3d42fce44b", "score": "0.5334201", "text": "public void testImportIdentity() {\n \t}", "title": "" }, { "docid": "0fae98c6b920498bd42f0135bf6712b6", "score": "0.53317595", "text": "public void test_18_91_writeObject() {\n\n\t\tObject objToSave = null;\n\t\tObject objLoaded;\n\n\t\ttry {\n\t\t\tObject col = Collections.synchronizedMap(TABLE);\n\t\t\tobjToSave = col;\n\t\t\tif (DEBUG)\n\t\t\t\tSystem.out.println(\"Obj = \" + objToSave);\n\t\t\tobjLoaded = dumpAndReload(objToSave);\n\t\t\t// Has to have worked\n\t\t\tassertTrue(MSG_TEST_FAILED + objToSave, col.equals(objLoaded));\n\n\t\t} catch (IOException e) {\n\t\t\tfail(\"IOException serializing \" + objToSave + \" : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tfail(\"ClassNotFoundException reading Object type : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (Error err) {\n\t\t\tSystem.out.println(\"Error when obj = \" + objToSave);\n\t\t\t// err.printStackTrace();\n\t\t\tthrow err;\n\t\t}\n\t}", "title": "" }, { "docid": "faf9f09189661e1959f61e893cc21542", "score": "0.5328014", "text": "@Test\n public void testKeepOrderInsertWithSameTimestampAndDifferentVersion() throws IOException {\n List<TsFileResource> seqResources = new ArrayList<>();\n seqResources.add(\n new TsFileResource(\n new File(\n TsFileNameGenerator.generateNewTsFilePath(\n TestConstant.BASE_OUTPUT_PATH, 1, 1, 0, 0))));\n seqResources.add(\n new TsFileResource(\n new File(\n TsFileNameGenerator.generateNewTsFilePath(\n TestConstant.BASE_OUTPUT_PATH, 1, 5, 0, 0))));\n seqResources.add(\n new TsFileResource(\n new File(\n TsFileNameGenerator.generateNewTsFilePath(\n TestConstant.BASE_OUTPUT_PATH, 1, 6, 0, 0))));\n seqResources.add(\n new TsFileResource(\n new File(\n TsFileNameGenerator.generateNewTsFilePath(\n TestConstant.BASE_OUTPUT_PATH, 2, 4, 0, 0))));\n seqResources.add(\n new TsFileResource(\n new File(\n TsFileNameGenerator.generateNewTsFilePath(\n TestConstant.BASE_OUTPUT_PATH, 3, 3, 0, 0))));\n seqResources.add(\n new TsFileResource(\n new File(\n TsFileNameGenerator.generateNewTsFilePath(\n TestConstant.BASE_OUTPUT_PATH, 4, 7, 0, 0))));\n seqResources.add(\n new TsFileResource(\n new File(\n TsFileNameGenerator.generateNewTsFilePath(\n TestConstant.BASE_OUTPUT_PATH, 4, 9, 0, 0))));\n seqResources.add(\n new TsFileResource(\n new File(\n TsFileNameGenerator.generateNewTsFilePath(\n TestConstant.BASE_OUTPUT_PATH, 5, 8, 0, 0))));\n\n TsFileResourceList tsFileResourceList = new TsFileResourceList();\n tsFileResourceList.keepOrderInsert(seqResources.get(4));\n tsFileResourceList.keepOrderInsert(seqResources.get(3));\n tsFileResourceList.keepOrderInsert(seqResources.get(5));\n tsFileResourceList.keepOrderInsert(seqResources.get(1));\n tsFileResourceList.keepOrderInsert(seqResources.get(0));\n tsFileResourceList.keepOrderInsert(seqResources.get(2));\n tsFileResourceList.keepOrderInsert(seqResources.get(6));\n tsFileResourceList.keepOrderInsert(seqResources.get(7));\n Assert.assertEquals(seqResources, tsFileResourceList.getArrayList());\n\n for (TsFileResource resource : seqResources) {\n tsFileResourceList.remove(resource);\n }\n tsFileResourceList.keepOrderInsert(seqResources.get(0));\n tsFileResourceList.keepOrderInsert(seqResources.get(4));\n tsFileResourceList.keepOrderInsert(seqResources.get(5));\n tsFileResourceList.keepOrderInsert(seqResources.get(7));\n tsFileResourceList.keepOrderInsert(seqResources.get(2));\n tsFileResourceList.keepOrderInsert(seqResources.get(1));\n tsFileResourceList.keepOrderInsert(seqResources.get(3));\n tsFileResourceList.keepOrderInsert(seqResources.get(6));\n Assert.assertEquals(seqResources, tsFileResourceList.getArrayList());\n\n for (TsFileResource resource : seqResources) {\n tsFileResourceList.remove(resource);\n }\n tsFileResourceList.keepOrderInsert(seqResources.get(7));\n tsFileResourceList.keepOrderInsert(seqResources.get(1));\n tsFileResourceList.keepOrderInsert(seqResources.get(5));\n tsFileResourceList.keepOrderInsert(seqResources.get(6));\n tsFileResourceList.keepOrderInsert(seqResources.get(2));\n tsFileResourceList.keepOrderInsert(seqResources.get(4));\n tsFileResourceList.keepOrderInsert(seqResources.get(3));\n tsFileResourceList.keepOrderInsert(seqResources.get(0));\n Assert.assertEquals(seqResources, tsFileResourceList.getArrayList());\n\n for (TsFileResource resource : seqResources) {\n tsFileResourceList.remove(resource);\n }\n tsFileResourceList.keepOrderInsert(seqResources.get(0));\n tsFileResourceList.keepOrderInsert(seqResources.get(1));\n tsFileResourceList.keepOrderInsert(seqResources.get(2));\n tsFileResourceList.keepOrderInsert(seqResources.get(3));\n tsFileResourceList.keepOrderInsert(seqResources.get(4));\n tsFileResourceList.keepOrderInsert(seqResources.get(5));\n tsFileResourceList.keepOrderInsert(seqResources.get(6));\n tsFileResourceList.keepOrderInsert(seqResources.get(7));\n Assert.assertEquals(seqResources, tsFileResourceList.getArrayList());\n\n for (TsFileResource resource : seqResources) {\n tsFileResourceList.remove(resource);\n }\n tsFileResourceList.keepOrderInsert(seqResources.get(7));\n tsFileResourceList.keepOrderInsert(seqResources.get(6));\n tsFileResourceList.keepOrderInsert(seqResources.get(5));\n tsFileResourceList.keepOrderInsert(seqResources.get(4));\n tsFileResourceList.keepOrderInsert(seqResources.get(3));\n tsFileResourceList.keepOrderInsert(seqResources.get(2));\n tsFileResourceList.keepOrderInsert(seqResources.get(1));\n tsFileResourceList.keepOrderInsert(seqResources.get(0));\n Assert.assertEquals(seqResources, tsFileResourceList.getArrayList());\n }", "title": "" }, { "docid": "73ed9d2b84392d52374a2edab7ad1bbb", "score": "0.5327147", "text": "@Test\n public void insert_contains() throws Exception{\n for(int i = 0; i < 1000; i++){\n assertTrue(ht.contains(input.get(i).key.toString()));\n }\n }", "title": "" }, { "docid": "6a4c6cb85710542a262770ba60f8406a", "score": "0.53191435", "text": "boolean supportsOuputOnInsert();", "title": "" }, { "docid": "4ee208c12ae5e1d1a69a4cda216e9efd", "score": "0.53158176", "text": "public void testAddDup()\n {\n NavigableSet q = DBMaker.newMemoryDB().make().getTreeSet( \"test\" );\n assertTrue( q.add( zero ) );\n assertFalse( q.add( zero ) );\n }", "title": "" }, { "docid": "71f17b6f9a37a83dfe1621121b5f1164", "score": "0.53156894", "text": "@Test\n public void test004() {\n doTest(SerializeTestUtils.CONST_004);\n }", "title": "" }, { "docid": "3e396690c691d86fb7539ccf02d17491", "score": "0.53149307", "text": "public void test_18_96_writeObject() {\n\n\t\tObject objToSave = null;\n\t\tObject objLoaded;\n\n\t\ttry {\n\t\t\tobjToSave = ALIST;\n\t\t\tif (DEBUG)\n\t\t\t\tSystem.out.println(\"Obj = \" + objToSave);\n\t\t\tobjLoaded = dumpAndReload(objToSave);\n\t\t\t// Has to have worked\n\t\t\tassertTrue(MSG_TEST_FAILED + objToSave, ALIST.equals(objLoaded));\n\n\t\t} catch (IOException e) {\n\t\t\tfail(\"IOException serializing \" + objToSave + \" : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tfail(\"ClassNotFoundException reading Object type : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t} catch (Error err) {\n\t\t\tSystem.out.println(\"Error when obj = \" + objToSave);\n\t\t\t// err.printStackTrace();\n\t\t\tthrow err;\n\t\t}\n\t}", "title": "" }, { "docid": "93644d18d5754edecb5fb552e96eec5a", "score": "0.5310464", "text": "@SuppressWarnings(\"unchecked\")\n\t@Test\n\tpublic void persist() {\n\t\tMap<String, Object> serial = test.serialize();\n\t\t\n\t\tassertTrue(serial.get(\"items\") instanceof List<?>);\n\t\t\n\t\t// We need to simulate Bukkit's automatic deserializing of objects.\n\t\tList<Map<String, Object>> itemdata = (List<Map<String, Object>>) serial.get(\"items\");\n\t\tIterator<Map<String, Object>> i = itemdata.iterator();\n\t\tList<ItemStack> newlist = new ArrayList<ItemStack>();\n\t\twhile(i.hasNext()) {\n\t\t\tnewlist.add(ItemStack.deserialize(i.next()));\n\t\t}\n\t\tserial.put(\"items\", newlist);\n\t\t\n\t\t// Deserialize as a new object.\n\t\tTradeOffer test2;\n\t\ttry {\n\t\t\ttest2 = new TradeOffer(serial);\n\t\t} catch (InstantiationException e) {\n\t\t\tfail(\"Deserialization failed\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Check if they match.\n\t\tassertTrue(\"TradeOffer.equals() says the deserialized object doesn't equal the original.\",\n\t\t\t\ttest.equals(test2));\n\t}", "title": "" }, { "docid": "cd4964d5aa10ba54c7ae84cd632d2bae", "score": "0.5308459", "text": "@Override\n\tpublic void insert() {\n\n\t}", "title": "" }, { "docid": "41c88fe7f550dad06357b05eec5b1077", "score": "0.5306003", "text": "public void testSopInsert_nokey_02() throws Exception {\n assertFalse(insertToSucceed(key, false, true, \"some value\"));\n }", "title": "" }, { "docid": "aab8733a1f8e0d53ebf17afe4f8d3f86", "score": "0.5299639", "text": "@Test\n\tpublic void testSerialize(@Mocked final JsonSerializer jsonizer) throws IOException {\n\t\tassertNull(RFUtils.serialize(null));\n\t\t\n\t\t/*\n\t\t * Test: \n\t\t * \t- serialize is called with a TagData object\n\t\t * Expected:\n\t\t * \t- JsonSerializer's serialize method is called once \n\t\t */\n\t\tfinal TagData td = new TagData();\t\t\n\t\tRFUtils.serialize(td);\n\t\t\n\t\tnew Verifications() {{ \n\t\t\tjsonizer.serialize(withSameInstance(td));\n\t\t}};\n\t\t\n\t\t/*\n\t\t * Test:\n\t\t * \t- serializeList is called with a TagData object\n\t\t * \t- JsonSerializer's serialize method throws an IOException\n\t\t * Expected:\n\t\t * \t- the string \"FAILED_TO_SERIALIZE\" is returned \n\t\t */\n\t\tnew NonStrictExpectations() {{\n\t\t\tjsonizer.serialize(any);\n\t\t\tresult = new IOException();\n\t\t}};\n\t\t\n\t\tassertEquals(\"FAILED_TO_SERIALIZE\", RFUtils.serialize(td));\t\t\n\t\t\n\t}", "title": "" }, { "docid": "c94c572ed0ee5f3f135c39c64dc970a3", "score": "0.5296437", "text": "@BeforeClass\n\tpublic final static void loadSampleData() throws SolrServerException, IOException {\n\t\tfinal Model memoryModel = ModelFactory.createDefaultModel();\n\t\tmemoryModel.read(TEST_DATA_URI, DUMMY_BASE_URI, \"N-TRIPLES\");\n \n\t\tDATASET.add(memoryModel);\n\t\t\n\t\tcommitChanges();\n\t\t\n\t\tfinal Model model = DATASET.getModel();\n\t\t \n\t\tassertFalse(model.isEmpty());\n\t\tassertTrue(model.isIsomorphicWith(memoryModel));\n\t}", "title": "" }, { "docid": "5e7bda4b052c985eae8d1cb9d48a397d", "score": "0.5291691", "text": "int insert(TestFun record);", "title": "" }, { "docid": "da6e752f041be731988aad2dd339ff17", "score": "0.52864534", "text": "@Test(dataProvider = PROVIDER)\n public void test_fastMoney(SerializationFramework alreadySet) {\n /*\n * Average size? But we use a reference called \"EXACT_SIZE\"? Kryo and\n * FST both write variable-length primites. So it doesn't matter if we'd\n * like to think of a long as having an \"exact size\". If we use\n * constantSize() instead of averageSize(), then you shall find that\n * this method crash at a point where Chronicle Map would like to use\n * 2 chunks of data blocks where just 1 was expected.\n */\n \n new TestSpecification<>(FastMoneyPrice.class)\n .averageSize(FastMoneyPrice.EXACT_SIZE)\n .converter(FastMoneyPrice::ofJson)\n .run();\n }", "title": "" } ]
d11fde2be6de10be530acc3ddb68e203
Similar to addBlock, but a Player's orientation is always HORIZONTAL and its position on the y axis always equal to Board's exit.
[ { "docid": "ca27dada2df54d13c79c82299606785c", "score": "0.0", "text": "public Player addPlayer(final int x, int length) {\n\t\tif (redCar != null) {\n\t\t\tthrow new IllegalArgumentException(\"Player already exists.\");\n\t\t}\n\n\t\tif (length > size || length < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Length must belong to [1,\" + size + \"]\");\n\t\t}\n\n\t\tif (x < 0 || x >= size) {\n\t\t\tthrow new IllegalArgumentException(\"Coordinate x must belong to [0,\" + (size - 1) + \"]\");\n\t\t}\n\t\tif (x + length > size) {\n\t\t\tthrow new IllegalArgumentException(\"Red car doesn't fit the grid\");\n\t\t}\n\n\t\tif (isOccupied(new Point(x, exit), length, HORIZONTAL)) {\n\t\t\tthrow new IllegalArgumentException(\"One of the block's positions is occupied\");\n\t\t}\n\n\t\tPoint playerPosition = new Point(x, exit);\n\t\tPlayer player = new Player(playerPosition, length);\n\n\t\tblocks.add(player);\n\t\tplaceBlock(player, playerPosition);\n\t\tredCar = player;\n\n\t\treturn player;\n\t}", "title": "" } ]
[ { "docid": "abc01acca1f2bcacd3c2feaa672da23b", "score": "0.54429585", "text": "@Override\r\n\tpublic void update() {\n\t\tsuper.getBlock().setY(super.getBlock().getY() + 1.0);\r\n\t}", "title": "" }, { "docid": "e3741fbc2a2805b4d2b6c205b313bcda", "score": "0.53336805", "text": "private void initializeBoard(){\n\tfor (int r = 0; r < this.height; r++) {\n\t for (int c = 0; c < this.width; c++) {\n\t\t// Set the bottom rows\n\t\tif (r > this.height - STARTING_ROWS - 1) {\n\t\t this.board[r][c] = BlockType.PLATTFORM;\n\t\t}\n\t\t// Create the player on the board\n\t\telse if (r == height - STARTING_ROWS - 1 && c == 0) {\n\t\t this.board[r][c] = BlockType.PLAYER;\n\t\t this.playerPos = new BlockPoint(c, r);\n\t\t}\n\n\t\t// Generates a downwards slope of plattforms, most easily\n\t\t// visualized as a discrete y = kx + m line, where:\n\t\t// r == c is comparable to y = x\n\t\t// r == 2c is comparable to y = 2x\n\t\t// r == (width - c) is comparable to y = -x\n\n\t\t// Ignore comment about identical branches because:\n\t\t// 1 - Order matters, spawning the player has higher priority than creating this nice looking pattern\n\t\t// 2 - The if statements do different things (creating the bottom rows to stand on versus a \"stair\" upwards)\n\t\t// and collapsing them will create an unneccesarily complex if statement with two purposes\n\t\telse if (r < height - STARTING_ROWS - 2 && (r == 2*(width - c) || r == 2*(width - c) - 1)) {\n\t\t this.board[r][c] = BlockType.PLATTFORM;\n\t\t}\n\n\n\t\t// Create a ceiling of plattforms near the top of the initialized board,\n\t\t// this allows for more random positions to be created in the upcoming chunk.\n\t\telse if (r == 1 && c < width - 5) {\n\t\t this.board[r][c] = BlockType.PLATTFORM;\n\t\t} else {\n\t\t this.board[r][c] = BlockType.AIR;\n\t\t}\n\t }\n\t}\n }", "title": "" }, { "docid": "174931a35f76f019052429eee77f8249", "score": "0.52707267", "text": "public void frameCreation() {\r\n pBlocks.add(new Block(GameLevel.ORIGIN, GameLevel.ORIGIN + GameLevel.BORDER_SIZE,\r\n width, GameLevel.BORDER_SIZE, // upperBorder\r\n Color.GRAY.darker()));\r\n this.fcnt++;\r\n pBlocks.add(new Block(width - GameLevel.BORDER_SIZE, GameLevel.ORIGIN,\r\n GameLevel.BORDER_SIZE, height, Color.GRAY.darker()));\r\n this.fcnt++;\r\n pBlocks.add(new Block(GameLevel.ORIGIN, GameLevel.ORIGIN, GameLevel.BORDER_SIZE,\r\n height, Color.GRAY.darker()));\r\n this.fcnt++;\r\n pBlocks.add(new Block(GameLevel.ORIGIN, height, width,\r\n GameLevel.BORDER_SIZE)); // DeathBlock\r\n this.fcnt++;\r\n // Corner Checkers.\r\n pBlocks.add(new Block(GameLevel.ORIGIN, GameLevel.ORIGIN, GameLevel.BORDER_SIZE,\r\n GameLevel.BORDER_SIZE, Color.RED.darker()));\r\n this.fcnt++;\r\n pBlocks.add(new Block(GameLevel.ORIGIN, height - GameLevel.BORDER_SIZE,\r\n GameLevel.BORDER_SIZE, GameLevel.BORDER_SIZE, Color.RED.darker()));\r\n this.fcnt++;\r\n pBlocks.add(new Block(width - GameLevel.BORDER_SIZE, GameLevel.ORIGIN,\r\n GameLevel.BORDER_SIZE, GameLevel.BORDER_SIZE, Color.RED.darker()));\r\n this.fcnt++;\r\n pBlocks.add(new Block(width - GameLevel.BORDER_SIZE, height\r\n - GameLevel.BORDER_SIZE, GameLevel.BORDER_SIZE, GameLevel.BORDER_SIZE, Color.RED.darker()));\r\n this.fcnt++;\r\n pBlocks.add(new Block(GameLevel.ORIGIN, GameLevel.ORIGIN, width,\r\n GameLevel.BORDER_SIZE, // Information\r\n Color.WHITE));\r\n this.fcnt++;\r\n }", "title": "" }, { "docid": "db7b31b0bcb045b6fd198718de80fe55", "score": "0.52075404", "text": "private void placeBlock(Block block, final Point position) {\n\t\tint length = block.getLength();\n\t\tint x = position.x;\n\t\tint y = position.y;\n\n\t\twhile (length-- > 0) {\n\t\t\tsetGridSquare(block, x, y);\n\t\t\tif (block.getOrientation() == VERTICAL) {\n\t\t\t\ty++;\n\t\t\t} else {\n\t\t\t\tx++;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "aee0bd60efcaca9c16a2cbebb1aa209b", "score": "0.5202522", "text": "private void placePlayerWithDefaultLocation() {\n int optimalDistance = Utils.getOptimalDistance(grid.getSize(), Main.TOTAL_PLAYERS);\n int index = Main.FIRST_POSITION_SHIFT;\n ArrayList<Square> borderSquare = new ArrayList<Square>(Utils.getBorderSquare(this));\n Main.PLAYER_LOCATION = new Coordinates2D[Main.TOTAL_PLAYERS];\n\n int column = 0;\n int line = 0;\n for (int i = 0; i < Main.TOTAL_PLAYERS; i++) {\n if (index >= borderSquare.size()) {\n index -= borderSquare.size();\n }\n column = borderSquare.get(index).getColumn();\n line = borderSquare.get(index).getLine();\n PlayerBot player = new PlayerBot(column, line, Main.PLAYER_ORDERING[i], playerList.size());\n Main.PLAYER_LOCATION[i] = new Coordinates2D(column, line);\n\n playerList.add(player);\n grid.changeState(column, line, player);\n numberOfMemberByCoalition\n .put(player.getCoalition(), numberOfMemberByCoalition.get(player.getCoalition()) + 1);\n index += optimalDistance;\n }\n }", "title": "" }, { "docid": "2dee9c21421a56713d8923e4400ce371", "score": "0.5188249", "text": "private ISABlock addExitBlock()\n {\n ISABlock dummyBlock = new ISABlock(0, nextBlockId++);\n dummyBlock.setExit(true);\n dummyBlock.addLine(new ISALine(0,\n \"func_exit\",\n \"\",\n true,\n null,\n 0,\n Instruction.FUNC_EXIT,\n InstructionType.OTHER));\n dummyBlock.setEdges(dummyBlock.getLastLine().getBranchTargets());\n blocks.add(dummyBlock);\n\n return dummyBlock;\n }", "title": "" }, { "docid": "5626c52b1f57427041c7fdf5426af485", "score": "0.51860684", "text": "public void onBlockPlaced() {\n if (isPart(xCoord, yCoord + 1, zCoord) && !isPart(xCoord, yCoord - 1, zCoord) && !isPart(xCoord, yCoord + 2, zCoord)) {\n MultiPart mstr = new MultiPart(xCoord, yCoord, zCoord);\n ArrayList<MultiPart> parts = new ArrayList<MultiPart>();\n parts.add(setAsSlave(mstr, xCoord, yCoord + 1, zCoord));\n setAsMaster(mstr, parts);\n }\n\n if (isPart(xCoord, yCoord - 1, zCoord) && !isPart(xCoord, yCoord + 1, zCoord) && !isPart(xCoord, yCoord - 2, zCoord)) {\n MultiPart mstr = new MultiPart(xCoord, yCoord - 1, zCoord);\n ArrayList<MultiPart> parts = new ArrayList<MultiPart>();\n parts.add(setAsSlave(mstr, xCoord, yCoord, zCoord));\n setAsMaster(mstr, parts);\n }\n\n worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);\n }", "title": "" }, { "docid": "4190de1dc8e102923ca141625528a481", "score": "0.5147944", "text": "Block create(int xpos, int ypos);", "title": "" }, { "docid": "4190de1dc8e102923ca141625528a481", "score": "0.5147944", "text": "Block create(int xpos, int ypos);", "title": "" }, { "docid": "bf2e73c8b06bf9848fca70a1504d7f51", "score": "0.5141247", "text": "public void placeBlock() {\n\t\tArrayList<Square> squares = fallingBlock.getSquares();\n\t\t//System.out.println(grid.length);\n\t\t//System.out.println(grid[0].length);\n\t\tfor (int i = 0; i < squares.size(); i++) {\n\t\t\tgrid[(int)(squares.get(i).getY()/30)][(int)(squares.get(i).getX()/30)] = squares.get(i);\n\t\t}\n\t}", "title": "" }, { "docid": "2c1a4cf330f5330d28a8c7b219fead30", "score": "0.51298046", "text": "public void heroWrap() {\n if (this.y < (HEIGHT * -1) ) {\n this.y = Gdx.graphics.getHeight();\n }\n if (this.y > Gdx.graphics.getHeight()) {\n this.y = (0 - HEIGHT);\n }\n if (this.x < (WIDTH * -1)) {\n this.x = Gdx.graphics.getWidth();\n }\n if ( this.x > Gdx.graphics.getWidth()) {\n this.x = (0 - WIDTH);\n }\n }", "title": "" }, { "docid": "1041aaf544a906f725f633747b2e7635", "score": "0.51225364", "text": "private void placePlayerWithCustomLocation() {\n int column;\n int line;\n for (int i = 0; i < Main.TOTAL_PLAYERS; i++) {\n\n column = Main.PLAYER_LOCATION[i].getColumn();\n line = Main.PLAYER_LOCATION[i].getLine();\n PlayerBot player = new PlayerBot(column, line, Main.PLAYER_ORDERING[i], playerList.size());\n\n playerList.add(player);\n grid.changeState(column, line, player);\n numberOfMemberByCoalition\n .put(player.getCoalition(), numberOfMemberByCoalition.get(player.getCoalition()) + 1);\n }\n }", "title": "" }, { "docid": "d24985c8bb8abb2e52268946b310ec8b", "score": "0.50832516", "text": "@Override\n\tpublic void breakBackBlock(ServerUpdate update, EntityPlayer player, int x,\n\t\t\tint y) {\n\t\t\n\t}", "title": "" }, { "docid": "e5aca7c0824490cfdede50dd39054c5e", "score": "0.5061679", "text": "private void createFrame() {\n Color frameColor = createColor();\n Block upperBlock = new Block(new Rectangle(new Point(0, 0),\n WIDTH, FRAME_HEIGHT), frameColor, COUNTER);\n Block rightBlock = new Block(new Rectangle(new Point(\n WIDTH - FRAME_HEIGHT, 0), FRAME_HEIGHT, HEIGHT),\n frameColor, COUNTER);\n Block leftBlock = new Block(new Rectangle(\n new Point(0, 0), FRAME_HEIGHT, HEIGHT), frameColor, COUNTER);\n Block lowerBlock = new Block(new Rectangle(\n new Point(0, HEIGHT - FRAME_HEIGHT), WIDTH, FRAME_HEIGHT),\n frameColor, COUNTER);\n upperBlock.addToGame(this);\n rightBlock.addToGame(this);\n leftBlock.addToGame(this);\n lowerBlock.addToGame(this);\n }", "title": "" }, { "docid": "f68662db344e467a82ccf97819b832b8", "score": "0.50486106", "text": "@Override\n public void placePiece(String col, String player) {\n int c = Integer.parseInt(col);\n\n set(emptyRow[c - 1], c - 1, player);\n emptyRow[c - 1] = emptyRow[c - 1] - 1;\n }", "title": "" }, { "docid": "ef614887300e5e239cfc5fecb5184411", "score": "0.5034146", "text": "public Block addBlock(final Point position, int length, int orientation) {\n\t\tif (position == null) {\n\t\t\tthrow new IllegalArgumentException(\"Position is null\");\n\t\t}\n\n\t\tif (length > size || length < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Length must belong to [1,size]\");\n\t\t}\n\n\t\tif (position.x < 0 || position.y < 0 || position.x >= size || position.y >= size) {\n\t\t\tthrow new IllegalArgumentException(\"Coordiantes must belong to [0,size-1]\");\n\t\t}\n\n\t\tif (orientation == HORIZONTAL) {\n\t\t\tif (position.x + length > size) {\n\t\t\t\tthrow new IllegalArgumentException(\"Horizontal block doesn't fit the grid\");\n\t\t\t}\n\t\t} else if (orientation == VERTICAL) {\n\t\t\tif (position.y + length > size) {\n\t\t\t\tthrow new IllegalArgumentException(\"Vertical block doesn't fit the grid\");\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new IllegalArgumentException(\"Illegal orientation\");\n\t\t}\n\n\t\tif (isOccupied(position, length, orientation)) {\n\t\t\tthrow new IllegalArgumentException(\"One or all of the block's positions are occupied\");\n\t\t}\n\n\t\tBlock block = new Block(position, length, orientation);\n\t\tblocks.add(block);\n\t\tplaceBlock(block, position);\n\t\treturn block;\n\t}", "title": "" }, { "docid": "545452d39387d18f42799c4cb2567453", "score": "0.5018219", "text": "void flipBlock(IBlock block, boolean horizontal);", "title": "" }, { "docid": "3e8ffcee6c543dfc60e41497e53f7545", "score": "0.50010663", "text": "public void addPlayer(Player player) {\n this.blocks[player.getPosY()][player.getPosX()].setGameObject(player);\n }", "title": "" }, { "docid": "8b7063c7cc863672e56724590deca919", "score": "0.49773973", "text": "@Override\n\tpublic int getWorldCenterBlock() {\n\t\treturn 0;\n\t}", "title": "" }, { "docid": "1924809f96750f783abeca9184e5e167", "score": "0.49759164", "text": "Block create(int x, int y);", "title": "" }, { "docid": "8864750fd2bdc535ea54ea5010b4c19a", "score": "0.4962611", "text": "private static void createSouth(Vec3i location, Quaternion rotation, ChunkMesh chunkMesh, float blockScale, Function<Direction, TextureCoordinates> textureCoordinatesFunction) {\n int offset = chunkMesh.getPositions().size();\n // vertices\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(0.5f, -0.5f, 0.5f)), location, blockScale));\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(0.5f, 0.5f, 0.5f)), location, blockScale));\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(-0.5f, -0.5f, 0.5f)), location, blockScale));\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(-0.5f, 0.5f, 0.5f)), location, blockScale));\n // indices\n chunkMesh.getIndices().add(offset);\n chunkMesh.getIndices().add(offset + 1);\n chunkMesh.getIndices().add(offset + 2);\n chunkMesh.getIndices().add(offset + 1);\n chunkMesh.getIndices().add(offset + 3);\n chunkMesh.getIndices().add(offset + 2);\n\n if (!chunkMesh.isCollisionMesh()) {\n // normals and tangents\n for (int i = 0; i < 4; i++) {\n chunkMesh.getNormals().add(rotation.mult(new Vector3f(0.0f, 0.0f, 1.0f)));\n Matrix4f rotationMatrix = rotation.toRotationMatrix(new Matrix4f());\n chunkMesh.getTangents().add(rotationMatrix.mult(new Vector4f(1.0f, 0.0f, 0.0f, 1.0f)));\n }\n // uvs\n TextureCoordinates textureCoordinates = textureCoordinatesFunction.apply(Direction.SOUTH);\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMax().x, textureCoordinates.getMin().y));\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMax().x, textureCoordinates.getMax().y));\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMin().x, textureCoordinates.getMin().y));\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMin().x, textureCoordinates.getMax().y));\n }\n }", "title": "" }, { "docid": "14fab6e964d0be458a8b4cc121067ee8", "score": "0.4952368", "text": "public void displayWorld(WorldMap world) throws TooLowException {\n this.NewWorld = world;\n String blockname[] = new String[NewWorld.getTiles().size()];\n blockname[0] = null;\n blockname[0] = NewWorld.getTile(NewWorld.getStartPosition()).getTopBlock().getBlockType();\n\n System.out.println(getGridPos(NewWorld.getStartPosition().getX()));\n System.out.println(\"Y:\"+getGridPos(NewWorld.getStartPosition().getY()*50));\n\n System.out.println(NewWorld.getTiles().get(0).getExits().toString());\n\n switch (blockname[0]){\n case \"soil\": drawSoilBlock(getGridPos(NewWorld.getStartPosition().getX()),\n getGridPos(NewWorld.getStartPosition().getY()));\n break;\n case \"grass\": drawGrassBlock(getGridPos(NewWorld.getStartPosition().getX()),\n getGridPos(NewWorld.getStartPosition().getY()));\n break;\n case \"stone\": drawStoneBlock(getGridPos(NewWorld.getStartPosition().getX()),\n getGridPos(NewWorld.getStartPosition().getY()));\n break;\n case \"wood\": drawWoodBlock(getGridPos(NewWorld.getStartPosition().getX()),\n getGridPos(NewWorld.getStartPosition().getY()));\n break;\n }\n\n for (int i=0;i<=NewWorld.getTiles().get(0).getExits().size();i++){\n if (NewWorld.getTile(NewWorld.getStartPosition()).getExits().get(\"east\")==\n NewWorld.getTiles().get(i)){\n System.out.println(NewWorld.getTiles().get(i).getTopBlock().getBlockType());\n blockname[1] = NewWorld.getTiles().get(i).getTopBlock().getBlockType();\n switch (blockname[1]){\n case \"soil\": drawSoilBlock(getGridPos(NewWorld.getStartPosition().getX()+1),\n getGridPos(NewWorld.getStartPosition().getY()));\n break;\n case \"grass\": drawGrassBlock(getGridPos(NewWorld.getStartPosition().getX()+1),\n getGridPos(NewWorld.getStartPosition().getY()));\n break;\n case \"stone\": drawStoneBlock(getGridPos(NewWorld.getStartPosition().getX()+1),\n getGridPos(NewWorld.getStartPosition().getY()));\n break;\n case \"wood\": drawWoodBlock(getGridPos(NewWorld.getStartPosition().getX()+1),\n getGridPos(NewWorld.getStartPosition().getY()));\n break;\n }\n }\n if (NewWorld.getTile(NewWorld.getStartPosition()).getExits().get(\"west\")==\n NewWorld.getTiles().get(i)){\n System.out.println(NewWorld.getTiles().get(i).getTopBlock().getBlockType());\n blockname[1] = NewWorld.getTiles().get(i).getTopBlock().getBlockType();\n switch (blockname[1]){\n case \"soil\": drawSoilBlock(getGridPos(NewWorld.getStartPosition().getX()-1),\n getGridPos(NewWorld.getStartPosition().getY()));\n break;\n case \"grass\": drawGrassBlock(getGridPos(NewWorld.getStartPosition().getX()-1),\n getGridPos(NewWorld.getStartPosition().getY()));\n break;\n case \"stone\": drawStoneBlock(getGridPos(NewWorld.getStartPosition().getX()-1),\n getGridPos(NewWorld.getStartPosition().getY()));\n break;\n case \"wood\": drawWoodBlock(getGridPos(NewWorld.getStartPosition().getX()-1),\n getGridPos(NewWorld.getStartPosition().getY()));\n break;\n }\n }\n if (NewWorld.getTile(NewWorld.getStartPosition()).getExits().get(\"north\")==\n NewWorld.getTiles().get(i)){\n System.out.println(NewWorld.getTiles().get(i).getTopBlock().getBlockType());\n blockname[1] = NewWorld.getTiles().get(i).getTopBlock().getBlockType();\n switch (blockname[1]){\n case \"soil\": drawSoilBlock(getGridPos(NewWorld.getStartPosition().getX()),\n getGridPos(NewWorld.getStartPosition().getY()-1));\n break;\n case \"grass\": drawGrassBlock(getGridPos(NewWorld.getStartPosition().getX()),\n getGridPos(NewWorld.getStartPosition().getY()-1));\n break;\n case \"stone\": drawStoneBlock(getGridPos(NewWorld.getStartPosition().getX()),\n getGridPos(NewWorld.getStartPosition().getY()-1));\n break;\n case \"wood\": drawWoodBlock(getGridPos(NewWorld.getStartPosition().getX()),\n getGridPos(NewWorld.getStartPosition().getY()-1));\n break;\n }\n }\n if (NewWorld.getTile(NewWorld.getStartPosition()).getExits().get(\"south\")==\n NewWorld.getTiles().get(i)){\n System.out.println(NewWorld.getTiles().get(i).getTopBlock().getBlockType());\n blockname[1] = NewWorld.getTiles().get(i).getTopBlock().getBlockType();\n switch (blockname[1]){\n case \"soil\": drawSoilBlock(getGridPos(NewWorld.getStartPosition().getX()),\n getGridPos(NewWorld.getStartPosition().getY()+1));\n break;\n case \"grass\": drawGrassBlock(getGridPos(NewWorld.getStartPosition().getX()),\n getGridPos(NewWorld.getStartPosition().getY()+1));\n break;\n case \"stone\": drawStoneBlock(getGridPos(NewWorld.getStartPosition().getX()),\n getGridPos(NewWorld.getStartPosition().getY()+1));\n break;\n case \"wood\": drawWoodBlock(getGridPos(NewWorld.getStartPosition().getX()),\n getGridPos(NewWorld.getStartPosition().getY()+1));\n break;\n }\n }\n }\n\n\n drawBuilder((int)canvasX/2,(int)canvasY/2);\n\n showInv();\n\n }", "title": "" }, { "docid": "99d08ec789a31cf9b06d48da18eec1f0", "score": "0.4941545", "text": "@Override\n public void nextOrientation()\n {\n mAbove = !mAbove;\n TemplatePeg last = mCenter;\n if (mAbove)\n {\n while(last.bottom != null)\n last = last.bottom.mLeftBottom;\n while(last.right != null)\n last = last.right.mRightTop;\n mCenter = last;\n }\n else\n {\n while(last.top != null)\n last = last.top.mRightTop;\n while(last.left != null)\n last = last.left.mLeftBottom;\n mCenter = last;\n }\n }", "title": "" }, { "docid": "eef62366a7397437f41a9e71f4026cd5", "score": "0.49381462", "text": "@SubscribeEvent\n\tpublic void onPlayerPlaceBlock(PlayerPlaceBlockEvent e)\n\t{\n\t\tif (SwitchFile.protection)\n\t\t{\n\t\t\tLocation location = e.blockLocation;\n\t\t\tBlock block = Server.getWorld(location.dimension).getBlock((int) location.x, (int) location.height, (int) location.y);\n\n\t\t\tfor (ClaimedArea area : Protection.instance.areas)\n\t\t\t{\n\t\t\t\tif (area.isInside(location) && !area.checkAcess(new Player(e.entityPlayer), Access.Edit_Block))\n\t\t\t\t{\n\t\t\t\t\tIChatComponent warning = new ChatText(\"You don't have access to place block in \").setChatStyle(new WarningStyle());\n\t\t\t\t\twarning.appendSibling(new ChatText(\"[\" + area.name + \"]\").setChatStyle(new ClaimedAreaStyle(area)));\n\t\t\t\t\te.entityPlayer.addChatComponentMessage(warning);\n\t\t\t\t\te.setCanceled(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "88c3c725d10377cae11b40cf2d46a606", "score": "0.4898169", "text": "public void wrapAroundWorld() {\r\n if(getX() + getWidth() < 0)\r\n setX(worldBounds.width);\r\n if(getX() > worldBounds.width)\r\n setX(-getWidth());\r\n if(getY() + getHeight() < 0)\r\n setY(worldBounds.height);\r\n if(getY() > worldBounds.height)\r\n setY(-getHeight());\r\n \r\n //System.out.println(getHeight() + \" \" + getWidth());\r\n }", "title": "" }, { "docid": "87ca483433a8e1896bb7538faa4dcc6b", "score": "0.48964766", "text": "@Override\n\tpublic void setBackBlock(Block block, int x, int y) {\n\t\t\n\t}", "title": "" }, { "docid": "7c31afe437988b1e16351b2f35daa48b", "score": "0.4882956", "text": "public void drawPlayer(){\n\n Coordinate one = new Coordinate(25, 17);\n Coordinate two = new Coordinate(24, 17);\n Coordinate three = new Coordinate(23, 17);\n\n surface.drawPlayerSquare(one);\n surface.drawPlayerSquare(two);\n surface.drawPlayerSquare(three);\n\n control.playerCoordinates.add(three);\n control.playerCoordinates.add(two);\n control.playerCoordinates.add(one);\n\n }", "title": "" }, { "docid": "4f8c155844b041695a1eb8a868e4d444", "score": "0.4882217", "text": "public GameBlock(Context myCont, int coordX, int coordY, RelativeLayout myRL){\n super(myCont);\n //USes the parent class to set the gameblock\n this.setImageResource(R.drawable.gameblock);\n this.setPivotX(0);\n this.setPivotY(0);\n this.setScaleX(IMAGE_SCALE);\n this.setScaleY(IMAGE_SCALE);\n this.setX(coordX);\n this.setY(coordY);\n\n //Stets the starting position and speed of the block\n //And any other variables\n velocityX = 20;\n velocityY = 20;\n positionX = coordX;\n positionY = coordY;\n targetCoordY = coordY / (int)SLOT_ISOLATION; //Want to coordinates\n targetCoordX = coordX / (int)SLOT_ISOLATION; //Want to coordinates\n removedBlock = false;\n createBlock = false;\n\n\n myDir = GameLoopTask.GameDirection.UNDETERMINED;\n\n Random randomStartInteger = new Random();\n blockValue = (randomStartInteger.nextInt(2)+ 1) * 2; //Generates a radnom number 2, 4 on each spawn\n myRelativeLayout = myRL;\n myRelativeLayout.addView(this); //Adds the bloack to the layout\n blockNumber = new TextView(myCont); //creates a text view for the bloack values\n blockNumber.setX(positionX + (int)(SLOT_ISOLATION / 4.7)); //positions the text view to be aligned with the blaock\n blockNumber.setY(positionY + (int)(SLOT_ISOLATION / 4.8)); //positions the text view to be aligned with the blaock\n\n blockNumber.setText(Integer.toString(blockValue)); //Sets the block value on the textView\n blockNumber.setTextSize(64f);\n blockNumber.setTextColor(BLACK);\n blockNumber.bringToFront(); //Brings the textview in front of the block\n myRelativeLayout.addView(blockNumber); //Ads the btext to the layout\n }", "title": "" }, { "docid": "8800fd8539db1b059189c5984c10ff8b", "score": "0.48717222", "text": "public void onBlockPlacedBase(int x, int y, int z) {\n if (isBase(x, y, z) && isBase(x + 1, y, z) && isTop(x, y + 1, z) && isTop(x + 1, y + 1, z)) {\n MultiPart mstr = new MultiPart(x, y, z);\n ArrayList<MultiPart> parts = new ArrayList<MultiPart>();\n parts.add(setAsSlave(mstr, x + 1, y, z, ForgeDirection.WEST));\n parts.add(setAsSlave(mstr, x + 1, y + 1, z, ForgeDirection.WEST));\n parts.add(setAsSlave(mstr, x, y + 1, z, ForgeDirection.EAST));\n setAsMaster(mstr, parts, ForgeDirection.EAST);\n }\n\n if (isBase(x, y, z) && isBase(x - 1, y, z) && isTop(x, y + 1, z) && isTop(x - 1, y + 1, z)) {\n MultiPart mstr = new MultiPart(x - 1, y, z);\n ArrayList<MultiPart> parts = new ArrayList<MultiPart>();\n parts.add(setAsSlave(mstr, x, y, z, ForgeDirection.WEST));\n parts.add(setAsSlave(mstr, x - 1, y + 1, z, ForgeDirection.EAST));\n parts.add(setAsSlave(mstr, x, y + 1, z, ForgeDirection.WEST));\n setAsMaster(mstr, parts, ForgeDirection.EAST);\n }\n\n if (isBase(x, y, z) && isBase(x, y, z + 1) && isTop(x, y + 1, z) && isTop(x, y + 1, z + 1)) {\n MultiPart mstr = new MultiPart(x, y, z);\n ArrayList<MultiPart> parts = new ArrayList<MultiPart>();\n parts.add(setAsSlave(mstr, x, y, z + 1, ForgeDirection.SOUTH));\n parts.add(setAsSlave(mstr, x, y + 1, z + 1, ForgeDirection.SOUTH));\n parts.add(setAsSlave(mstr, x, y + 1, z, ForgeDirection.NORTH));\n setAsMaster(mstr, parts, ForgeDirection.NORTH);\n }\n\n if (isBase(x, y, z) && isBase(x, y, z - 1) && isTop(x, y + 1, z) && isTop(x, y + 1, z - 1)) {\n MultiPart mstr = new MultiPart(x, y, z - 1);\n ArrayList<MultiPart> parts = new ArrayList<MultiPart>();\n parts.add(setAsSlave(mstr, x, y, z, ForgeDirection.SOUTH));\n parts.add(setAsSlave(mstr, x, y + 1, z - 1, ForgeDirection.NORTH));\n parts.add(setAsSlave(mstr, x, y + 1, z, ForgeDirection.SOUTH));\n setAsMaster(mstr, parts, ForgeDirection.NORTH);\n }\n }", "title": "" }, { "docid": "e2ec947964bd30960e969c7371552334", "score": "0.48672724", "text": "private void createBlocks() {\n for (int i = 1; i <= MAX_ROWS; i++) {\n Color color = createColor();\n int counter = 1;\n for (int j = 1; j <= MAX_BLOCKS - i; j++) {\n if (i == 1) {\n // only top row has counter of 2. all other rows - 1\n counter = 2;\n }\n Point startingPoint =\n new Point(WIDTH - FRAME_HEIGHT - (BLOCK_WIDTH * j),\n START_OF_ROWS_Y + (BLOCK_HEIGHT * i));\n Block block = new Block(new Rectangle(startingPoint,\n BLOCK_WIDTH, BLOCK_HEIGHT), color, counter);\n block.addToGame(this);\n }\n }\n }", "title": "" }, { "docid": "11ddf1487cbc6473827a0de1edb1bc46", "score": "0.4861926", "text": "int getBlocksStartY();", "title": "" }, { "docid": "f0acc0ad34a21fa63c9a0cb87522ce3d", "score": "0.48556614", "text": "public void wrapAroundWorld()\n {\n if (getX() + getWidth() < 0)\n setX( worldBounds.width );\n\n if (getX() > worldBounds.width) \n setX( -getWidth());\n\n if (getY() + getHeight() < 0)\n setY( worldBounds.height );\n\n if (getY() > worldBounds.height)\n setY( -getHeight() );\n }", "title": "" }, { "docid": "1191fbf28f6c0d9a60fabd75949b7635", "score": "0.48544806", "text": "BlockUnit createBlockUnit();", "title": "" }, { "docid": "5bbc491f983f5a364e34b092e530395a", "score": "0.48322013", "text": "@Override\n public void enterTile(Player player)\n {\n }", "title": "" }, { "docid": "0e4775ffe933ccbb36b54aadd3691e98", "score": "0.48314092", "text": "@Override\n\tpublic void breakBlock(ServerUpdate update, EntityPlayer player, int x,\n\t\t\tint y) {\n\t\t\n\t}", "title": "" }, { "docid": "a166209e5e334854a32eb949c0d0ca97", "score": "0.48189116", "text": "@Override\n public abstract BaseBlock create(int xPos, int yPos);", "title": "" }, { "docid": "915219e68e19b0e4e199b1c85cbd8e05", "score": "0.4815042", "text": "@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled=true)\n public void onPlayerMove(PlayerMoveEvent event) {\n \tPlayer player = event.getPlayer();\n String worldname = player.getWorld().getName();\n Material m = player.getLocation().getBlock().getType();\n \n if ((m != Material.STATIONARY_WATER) && (m != Material.WATER)) return;\n \n Block block = player.getWorld().getBlockAt(player.getLocation());\n String data = \",\" + String.valueOf(block.getX()) + \"#\" + String.valueOf(block.getY()) + \"#\" + String.valueOf(block.getZ()) + \",\";\n \n \n if (worldname.equals(\"plotworld\")) {\n if (wplotworld2.contains(data)) {\n \t\n \tif(player.hasPermission(\"use.plotworld2\")) {\n \tLocation ar1 = new Location(Bukkit.getWorld(\"plotworld2\"),x1,y1,z1,p1,0);\n \tplayer.teleport(ar1);\n \tplayer.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1.0F, 1.0F);\n \tplayer.getWorld().playEffect(player.getLocation(), Effect.ENDER_SIGNAL, 30, 2);\n \t}\n \t\n \telse {\n \t\t getServer().dispatchCommand(getServer().getConsoleSender(), \"spawn \" + player.getName());\n\t\t player.sendMessage(\"Map disponible à partir du grade Maçon.\");\n \t\t\n \t}\n \t\n }\n \n if (wplotworld3.contains(data)) {\n \t\n \tif(player.hasPermission(\"use.plotworld3\")) {\n \tLocation ar2 = new Location(Bukkit.getWorld(\"plotworld3\"),x2,y2,z2,p2,0);\n \tplayer.teleport(ar2);\n \tplayer.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1.0F, 1.0F);\n \tplayer.getWorld().playEffect(player.getLocation(), Effect.ENDER_SIGNAL, 30, 2);\n \t}\n \t\n \telse {\n \t\t getServer().dispatchCommand(getServer().getConsoleSender(), \"spawn \" + player.getName());\n \t\t player.sendMessage(\"Map disponible à partir du grade Décorateur.\");\n \t\t\n \t}\n \t\n }\n \n \n \n if (wpixelart.contains(data)) {\n \t\n \tif(player.hasPermission(\"use.pixelart\")) {\n \tLocation ar4 = new Location(Bukkit.getWorld(\"pixelart\"),x4,y4,z4,p4,0);\n \tplayer.teleport(ar4);\n \tplayer.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1.0F, 1.0F);\n \tplayer.getWorld().playEffect(player.getLocation(), Effect.ENDER_SIGNAL, 30, 2);\n \t}\n \t\n \telse {\n \t\t getServer().dispatchCommand(getServer().getConsoleSender(), \"spawn \" + player.getName());\n \t\t player.sendMessage(\"Map disponible à partir du grade Apprenti.\");\n \t\t\n \t}\n \t\n }\n \n \n \n if (lobby.contains(data)) {\n \t\n Bukkit.getMessenger().registerOutgoingPluginChannel(this, \"BungeeCord\");\n ByteArrayOutputStream b = new ByteArrayOutputStream();\n \tDataOutputStream out = new DataOutputStream(b);\n \t\n \tLocation ar3 = new Location(Bukkit.getWorld(\"plotworld\"),x3,y3,z3,p3,0);\n \tplayer.teleport(ar3);\n \t\n \t\n\n \t try {\n \t out.writeUTF(\"Connect\");\n \t out.writeUTF(\"lobby\");\n \t } catch (IOException ex) { }\n \t player.sendPluginMessage(this, \"BungeeCord\", b.toByteArray());\n }\n \n \n }//fin if world\n \n \n if (worldname.equals(\"plotworld2\")) {\n if (plotworld2.contains(data)) {\n \tLocation ar1 = new Location(Bukkit.getWorld(\"plotworld\"),x1a,y1a,z1a,p1a,0);\n \tplayer.teleport(ar1);\n \tplayer.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1.0F, 1.0F);\n \tplayer.getWorld().playEffect(player.getLocation(), Effect.ENDER_SIGNAL, 30, 2);\n\n } \n }\n \n \n if (worldname.equals(\"plotworld3\")) {\n if (plotworld3.contains(data)) {\n \tLocation ar2= new Location(Bukkit.getWorld(\"plotworld\"),x2a,y2a,z2a,p2a,0);\n \tplayer.teleport(ar2);\n \tplayer.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1.0F, 1.0F);\n \tplayer.getWorld().playEffect(player.getLocation(), Effect.ENDER_SIGNAL, 30, 2);\n } \n }\n \n \n if (worldname.equals(\"pixelart\")) {\n if (plotworld3.contains(data)) {\n \tLocation ar2= new Location(Bukkit.getWorld(\"plotworld\"),x3a,y3a,z3a,p3a,0);\n \tplayer.teleport(ar2);\n \tplayer.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1.0F, 1.0F);\n \tplayer.getWorld().playEffect(player.getLocation(), Effect.ENDER_SIGNAL, 30, 2);\n } \n }\n \n }", "title": "" }, { "docid": "92564adc566cb587cb2aaf7d6558d716", "score": "0.48081455", "text": "@Override\n\tpublic boolean isBlockPlacedByPlayer(PS ps)\n\t{\n\t\treturn false;\n\t}", "title": "" }, { "docid": "479b8f6443b8fd912067fbcbe9349b7c", "score": "0.48066375", "text": "public ReversiPiece(int player) {\n t = new Translate();\n piece = new Ellipse();\n piece.getTransforms().add(t);\n setPiece(player);\n getChildren().add(piece);\n }", "title": "" }, { "docid": "785fa6f152e156295aef3f8d65c4252f", "score": "0.47972545", "text": "public void outsideWorld() {\n\t\tsetPosition(0, -290);\n\t}", "title": "" }, { "docid": "4e86749f1e4e8c198b399ec46da0fafa", "score": "0.47946316", "text": "WorldImage makeWallVertical() {\n return new LineImage(new Posn(0, SIZE), Color.BLACK);\n }", "title": "" }, { "docid": "c16a9bfab2ce2c549e0d773baecb0628", "score": "0.47714072", "text": "public void endOfRound() {\n\n\n topPlayer.update(true);\n bottomPlayer.update(true);\n leftPlayer.update(true);\n rightPlayer.update(true);\n boardArea.update();\n }", "title": "" }, { "docid": "5c9d1223b87027008714425fb0a1716f", "score": "0.47663072", "text": "public void onBlockPlacedTop(int x, int y, int z) {\n if (isBase(x, y - 1, z) && isBase(x + 1, y - 1, z) && isTop(x, y, z) && isTop(x + 1, y, z)) {\n MultiPart mstr = new MultiPart(x, y - 1, z);\n ArrayList<MultiPart> parts = new ArrayList<MultiPart>();\n parts.add(setAsSlave(mstr, x, y, z, ForgeDirection.EAST));\n parts.add(setAsSlave(mstr, x + 1, y, z, ForgeDirection.WEST));\n parts.add(setAsSlave(mstr, x + 1, y - 1, z, ForgeDirection.WEST));\n setAsMaster(mstr, parts, ForgeDirection.EAST);\n }\n\n if (isBase(x, y - 1, z) && isBase(x - 1, y - 1, z) && isTop(x, y, z) && isTop(x - 1, y, z)) {\n MultiPart mstr = new MultiPart(x - 1, y - 1, z);\n ArrayList<MultiPart> parts = new ArrayList<MultiPart>();\n parts.add(setAsSlave(mstr, x, y, z, ForgeDirection.WEST));\n parts.add(setAsSlave(mstr, x - 1, y, z, ForgeDirection.EAST));\n parts.add(setAsSlave(mstr, x, y - 1, z, ForgeDirection.WEST));\n setAsMaster(mstr, parts, ForgeDirection.EAST);\n }\n\n if (isBase(x, y - 1, z) && isBase(x, y - 1, z + 1) && isTop(x, y, z) && isTop(x, y, z + 1)) {\n MultiPart mstr = new MultiPart(x, y - 1, z);\n ArrayList<MultiPart> parts = new ArrayList<MultiPart>();\n parts.add(setAsSlave(mstr, x, y, z + 1, ForgeDirection.SOUTH));\n parts.add(setAsSlave(mstr, x, y, z, ForgeDirection.NORTH));\n parts.add(setAsSlave(mstr, x, y - 1, z + 1, ForgeDirection.SOUTH));\n setAsMaster(mstr, parts, ForgeDirection.NORTH);\n }\n\n if (isBase(x, y - 1, z) && isBase(x, y - 1, z - 1) && isTop(x, y, z) && isTop(x, y, z - 1)) {\n MultiPart mstr = new MultiPart(x, y - 1, z - 1);\n ArrayList<MultiPart> parts = new ArrayList<MultiPart>();\n parts.add(setAsSlave(mstr, x, y, z, ForgeDirection.SOUTH));\n parts.add(setAsSlave(mstr, x, y, z - 1, ForgeDirection.NORTH));\n parts.add(setAsSlave(mstr, x, y - 1, z, ForgeDirection.SOUTH));\n setAsMaster(mstr, parts, ForgeDirection.NORTH);\n }\n }", "title": "" }, { "docid": "e008af195c74e1bc77f7fa44936d2a7b", "score": "0.4758894", "text": "protected Block getNextBlock(Directions direction) {\n int x = actor.getCurrentPosition().getX(), y = actor.getCurrentPosition().getY();\n\n switch (direction) {\n case EAST:\n y++;\n break;\n case WEST:\n y--;\n break;\n case NORTH:\n x--;\n break;\n case SOUTH:\n x++;\n break;\n }\n return maze.getBlocks().get(new Coordinates(x, y));\n }", "title": "" }, { "docid": "71b77bb5184afab02b6f69ed40479a9b", "score": "0.47567984", "text": "public lineEnemyVertical(int x, int y, char direction) {\n\t\tsetImage(new Image(\"/lineenemy.png\"));\n\t\tsetLocationX(x);\n\t\tsetLocationY(y);\n\t\tif (direction == 'u') {\n\t\t\tmovingUp = true;\n\t\t} else {\n\t\t\tmovingUp = false;\n\t\t}\n\t}", "title": "" }, { "docid": "e33d669319c43df57969b8f265700d3e", "score": "0.47537053", "text": "public void insertCoin(int player_value, int column) {\n b.setGrid(rowToInsert[column], column, player_value); // (fila, columna, valor) \n ++columnTop[column];\n --rowToInsert[column];\n }", "title": "" }, { "docid": "768906509b205e35f5f8bfe120369cb3", "score": "0.47532284", "text": "private WorldBuilder addExitStairs() {\n\t\tint x = -1;\n\t\tint y = -1;\n\t\tdo {\n\t\t\tx = (int) (Math.random() * width);\n\t\t\ty = (int) (Math.random() * height);\n\t\t} while (tiles[x][y][0] != Tile.FLOOR);\n\n\t\ttiles[x][y][0] = Tile.STAIRS_UP;\n\t\treturn this;\n\t}", "title": "" }, { "docid": "3fa42d36f19a2c254e41fa71c159e5a1", "score": "0.47450662", "text": "@Override\r\n\tBlock createBlock();", "title": "" }, { "docid": "e039d4bf1c2309497106d96147cbc7e6", "score": "0.47438532", "text": "private void finalOrient() {\n\t\tturnAround();\n\t\twhile (noBeepersPresent()) {\n\t\t\tmove();\n\t\t}\n\t\tpickBeeper();\n\t\tif (frontIsClear()) {\n\t\t\tmove();\n\t\t}\n\t\tturnAround();\n\t}", "title": "" }, { "docid": "837c601e9a073af023672a2178c97545", "score": "0.47348464", "text": "@Override\n\tpublic void onBlockAdded(World world, int x, int y, int z) {\n\t\tworld.setBlockTileEntity(x, y, z, createNewTileEntity(world));\n\t\tsuper.onBlockAdded(world, x, y, z);\n\t}", "title": "" }, { "docid": "a1e85ffbd870bf7aa4a5418ed6679bb1", "score": "0.47329974", "text": "public Block(int x, int y, char block, Grid grid){\r\n this.x = x;\r\n this.y = y;\r\n this.block = block;\r\n this.grid = grid;\r\n }", "title": "" }, { "docid": "9f8a6829610dd209485faaeb2adf6efd", "score": "0.47233942", "text": "public Pawn(String name, Block block, String color, Player player){\r\n\t\tsuper(name, block, color, player);\r\n\t}", "title": "" }, { "docid": "681a3dded4eaf1c1ed3bacefd362ae7a", "score": "0.4719508", "text": "private void makePlayerAreas() {\n int x = 7;\n int y = 9;\n int nameLabelSize =2;\n if (fields.length<=32) {\n y = 8;\n nameLabelSize = 1;\n }\n if (fields.length<=28) {\n x=0;\n nameLabelSize = 1;\n }\n for(int i = 0; i < MAX_PLAYER_COUNT; i++) {\n int ycalc = y - i;\n \n JLabel iconLabel = new JLabel();\n this.factory.setSize(iconLabel, 1 * GUI_Field.FIELDWIDTH, 1 * GUI_Field.FIELDWIDTH);\n this.base.setLayer(iconLabel, 1);\n this.base.add(iconLabel, this.factory.createGridBagConstraints(x, ycalc));\n this.iconLabels[i] = iconLabel;\n \n JLabel playerLabel = new JLabel();\n this.factory.setSize(playerLabel, nameLabelSize * GUI_Field.FIELDWIDTH, 1 * GUI_Field.FIELDWIDTH);\n this.base.setLayer(playerLabel, 1);\n this.base.add(playerLabel, this.factory.createGridBagConstraints(x + 1, ycalc, nameLabelSize, 1));\n this.playerLabels[i] = playerLabel;\n }\n }", "title": "" }, { "docid": "a5400f6934abbbba180f10142e2bb7d0", "score": "0.47159308", "text": "private static void createUp(Vec3i location, Quaternion rotation, ChunkMesh chunkMesh, float blockScale, Function<Direction, TextureCoordinates> textureCoordinatesFunction) {\n int offset = chunkMesh.getPositions().size();\n // vertices\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(0.5f, 0.5f, -0.5f)), location, blockScale));\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(-0.5f, 0.5f, -0.5f)), location, blockScale));\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(0.5f, 0.5f, 0.5f)), location, blockScale));\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(-0.5f, 0.5f, 0.5f)), location, blockScale));\n // indices\n chunkMesh.getIndices().add(offset);\n chunkMesh.getIndices().add(offset + 1);\n chunkMesh.getIndices().add(offset + 2);\n chunkMesh.getIndices().add(offset + 1);\n chunkMesh.getIndices().add(offset + 3);\n chunkMesh.getIndices().add(offset + 2);\n\n if (!chunkMesh.isCollisionMesh()) {\n // normals and tangents\n for (int i = 0; i < 4; i++) {\n chunkMesh.getNormals().add(rotation.mult(new Vector3f(0.0f, 1.0f, 0.0f)));\n Matrix4f rotationMatrix = rotation.toRotationMatrix(new Matrix4f());\n chunkMesh.getTangents().add(rotationMatrix.mult(new Vector4f(1.0f, 0.0f, 0.0f, 1.0f)));\n }\n // uvs\n TextureCoordinates textureCoordinates = textureCoordinatesFunction.apply(Direction.UP);\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMax().x, textureCoordinates.getMax().y));\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMin().x, textureCoordinates.getMax().y));\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMax().x, textureCoordinates.getMin().y));\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMin().x, textureCoordinates.getMin().y));\n }\n }", "title": "" }, { "docid": "68b16352e0dc449090e1f9bad8d9a2ed", "score": "0.47146496", "text": "@Override\n public void AfterBuilding(StructureConfiguration configuration, ServerWorld world, BlockPos originalPos, Direction assumedNorth, PlayerEntity player) {\n BasicStructureConfiguration config = (BasicStructureConfiguration) configuration;\n\n if (this.customBlockPos != null) {\n if (config.basicStructureName.getName().equals(EnumBasicStructureName.AdvancedCoop.getName())) {\n // For the advanced chicken coop, spawn 4 chickens above the hopper.\n for (int i = 0; i < 4; i++) {\n ChickenEntity entity = new ChickenEntity(EntityType.CHICKEN, world);\n entity.setPos(this.customBlockPos.getX(), this.customBlockPos.up().getY(), this.customBlockPos.getZ());\n world.spawnEntity(entity);\n }\n } else if (config.basicStructureName.getName().equals(EnumBasicStructureName.ChickenCoop.getName())) {\n // For the advanced chicken coop, spawn 4 chickens above the hopper.\n ChickenEntity entity = new ChickenEntity(EntityType.CHICKEN, world);\n entity.setPos(this.customBlockPos.getX(), this.customBlockPos.down().getY(), this.customBlockPos.getZ());\n world.spawnEntity(entity);\n } else if (config.basicStructureName.getName().equals(EnumBasicStructureName.MineshaftEntrance.getName())\n || config.basicStructureName.getName().equals(BasicStructureConfiguration.EnumBasicStructureName.WorkShop.getName())) {\n // Build the mineshaft where the trap door exists.\n BuildingMethods.PlaceMineShaft(world, this.customBlockPos.down(), configuration.houseFacing, true);\n }\n\n this.customBlockPos = null;\n }\n\n if (this.bedPositions.size() > 0) {\n for (Tuple<BlockPos, BlockPos> bedPosition : this.bedPositions) {\n BuildingMethods.PlaceColoredBed(world, bedPosition.getFirst(), bedPosition.getSecond(), config.bedColor);\n }\n }\n\n if (config.basicStructureName.getName().equals(EnumBasicStructureName.AquaBase.getName())\n || config.basicStructureName.getName().equals(EnumBasicStructureName.AdvancedAquaBase.getName())) {\n // Replace the entrance area with air blocks.\n BlockPos airPos = originalPos.up(4).offset(configuration.houseFacing.getOpposite(), 1);\n\n // This is the first wall.\n world.removeBlock(airPos.offset(configuration.houseFacing.rotateYClockwise()), false);\n world.removeBlock(airPos, false);\n world.removeBlock(airPos.offset(configuration.houseFacing.rotateYCounterclockwise()), false);\n\n airPos = airPos.down();\n world.removeBlock(airPos.offset(configuration.houseFacing.rotateYClockwise()), false);\n world.removeBlock(airPos, false);\n world.removeBlock(airPos.offset(configuration.houseFacing.rotateYCounterclockwise()), false);\n\n airPos = airPos.down();\n world.removeBlock(airPos.offset(configuration.houseFacing.rotateYClockwise()), false);\n world.removeBlock(airPos, false);\n world.removeBlock(airPos.offset(configuration.houseFacing.rotateYCounterclockwise()), false);\n\n airPos = airPos.down();\n world.removeBlock(airPos.offset(configuration.houseFacing.rotateYClockwise()), false);\n world.removeBlock(airPos, false);\n world.removeBlock(airPos.offset(configuration.houseFacing.rotateYCounterclockwise()), false);\n\n // Second part of the wall.\n airPos = airPos.offset(configuration.houseFacing.getOpposite()).up();\n world.removeBlock(airPos.offset(configuration.houseFacing.rotateYClockwise()), false);\n world.removeBlock(airPos, false);\n world.removeBlock(airPos.offset(configuration.houseFacing.rotateYCounterclockwise()), false);\n\n airPos = airPos.up();\n world.removeBlock(airPos.offset(configuration.houseFacing.rotateYClockwise()), false);\n world.removeBlock(airPos, false);\n world.removeBlock(airPos.offset(configuration.houseFacing.rotateYCounterclockwise()), false);\n\n airPos = airPos.up();\n world.removeBlock(airPos, false);\n }\n }", "title": "" }, { "docid": "bd12ec59e020dbb4fec296970ca4736f", "score": "0.47140115", "text": "public void onPostBlockPlaced(World p_149714_1_, int p_149714_2_, int p_149714_3_, int p_149714_4_, int p_149714_5_)\n {\n this.func_150136_a(p_149714_1_, p_149714_2_, p_149714_3_, p_149714_4_, false, p_149714_5_, false, -1, 0);\n }", "title": "" }, { "docid": "77fca5ffeff66657cd72d538b5a39f7c", "score": "0.47004554", "text": "public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)\n {\n int var6 = MathHelper.floor((double)(par5EntityLiving.yaw * 4.0F / 360.0F) + 0.5D) & 3;\n\n if (var6 == 0)\n {\n par1World.setData(par2, par3, par4, 2);\n }\n\n if (var6 == 1)\n {\n par1World.setData(par2, par3, par4, 5);\n }\n\n if (var6 == 2)\n {\n par1World.setData(par2, par3, par4, 3);\n }\n\n if (var6 == 3)\n {\n par1World.setData(par2, par3, par4, 4);\n }\n }", "title": "" }, { "docid": "27d3c3d9673e09676710040dd43955e4", "score": "0.46990588", "text": "void setBlocksStartY(int blocksStartY);", "title": "" }, { "docid": "83da544be53532ea284133a3b648f29e", "score": "0.46964392", "text": "public Block rotateRight() { \n \tif (currentBlock == shape.SquareBlock) {\n \t\treturn this;\n \t}\n \tBlock rotated = new Block();\n \trotated.currentBlock = this.currentBlock;\n \tfor (int i = 0; i < 4; i++) {\n \t\trotated.blockInCoord[i][0] = this.blockInCoord[i][1];\n \t\trotated.blockInCoord[i][1] = -this.blockInCoord[i][0];\n \t}\n \treturn rotated;\n }", "title": "" }, { "docid": "7f87ef4083f54e03379af63006179ba9", "score": "0.46958148", "text": "Block createBlock();", "title": "" }, { "docid": "7f87ef4083f54e03379af63006179ba9", "score": "0.46958148", "text": "Block createBlock();", "title": "" }, { "docid": "38aff86e9b98d61efbb46eadb212bc00", "score": "0.46936506", "text": "public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_)\n {\n \tif(!this.field_150004_a){\n \t\tint l = MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;\n \t\tboolean isUpper=p_149689_1_.getBlockMetadata(p_149689_2_, p_149689_3_, p_149689_4_)>=8;\n \t\tp_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, l+(isUpper?8:0), 2);\n \t}\n }", "title": "" }, { "docid": "8cf293cb78afc602c765d7a7bca668a1", "score": "0.4687587", "text": "private void renderPlayer() {\n\t\tplayer.setCenterX(jeu.player.y*jeu.player.size*MULTI);\n\t\tplayer.setCenterY(jeu.player.x*jeu.player.size*MULTI);\n\t}", "title": "" }, { "docid": "62ef6e8afe1ec599ce7aca3bd5819d7c", "score": "0.46788752", "text": "public void spawn() {\n int xCoordinate = new Random().nextInt(getCollisionLayer().getWidth() - 8);\n int yCoordinate = new Random().nextInt(getCollisionLayer().getHeight() - 2);\n setPlayerPosition(xCoordinate, yCoordinate);\n isFrozen = false;\n isSwapped = false;\n isDead = false;\n }", "title": "" }, { "docid": "d876c80139b5122ac3dcc56434a344d4", "score": "0.46780038", "text": "private void addToWorld() {\n\t\t(world.add(\"wall1a\", 0f, 1f, 0f)).setColor(\r\n\t\t\t\t0.25f + 0.5f * (float) Math.random(),\r\n\t\t\t\t0.25f + 0.5f * (float) Math.random(),\r\n\t\t\t\t0.25f + 0.5f * (float) Math.random(), 1f);\r\n\t\t(world.add(\"wall1b\", 0f, 1f, 0f)).setColor(\r\n\t\t\t\t0.25f + 0.5f * (float) Math.random(),\r\n\t\t\t\t0.25f + 0.5f * (float) Math.random(),\r\n\t\t\t\t0.25f + 0.5f * (float) Math.random(), 1f);\r\n\r\n//\t\t Add the ground\r\n\t\t(ground = world.add(\"ground\", 0f, 0f, 0f)).setColor(\r\n\t\t\t\t0.25f + 0.5f * (float) Math.random(),\r\n\t\t\t\t0.25f + 0.5f * (float) Math.random(),\r\n\t\t\t\t0.25f + 0.5f * (float) Math.random(), 1f);\r\n//\t\tadd the terrain\r\n//\t\tworld.add(\"wall1c\",0,0,0);\r\n\t\t\r\n//\t\t Create some boxes to play with\r\n\t\tfor (int x = 0; x < BOXCOUNT_X; x++) {\r\n\t\t\tfor (int y = 0; y < BOXCOUNT_Y; y++) {\r\n\t\t\t\tfor (int z = 0; z < BOXCOUNT_Z; z++) {\r\n\t\t\t\t\tworld.add(\"box\", BOXOFFSET_X + x, BOXOFFSET_Y + 20 + y,\r\n\t\t\t\t\t\t\tBOXOFFSET_Z + z).setColor(\r\n\t\t\t\t\t\t\t0.5f + 0.5f * (float) Math.random(),\r\n\t\t\t\t\t\t\t0.5f + 0.5f * (float) Math.random(),\r\n\t\t\t\t\t\t\t0.5f + 0.5f * (float) Math.random(), 1f);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcharacter = world.add(\"capsule\", 0f, 20f, 0f);\r\n\t\tcharacter.transform.setTranslation(0, 5f, 0);\r\n\t\tsetCharacter();\r\n\t\t\r\n\t}", "title": "" }, { "docid": "35d94b67a3bb842cd23b23d4f7e91502", "score": "0.4676482", "text": "public void wraparound() {\r\n if (Asteroids.BlackholeList.isEmpty()){\r\n if (xposition < 0) {\r\n xposition = 900;\r\n }\r\n if (xposition > 900) {\r\n xposition = 0;\r\n }\r\n if (yposition < 0) {\r\n yposition = 600;\r\n }\r\n if (yposition > 600) {\r\n yposition = 0;\r\n }\r\n }\r\n if (!Asteroids.BlackholeList.isEmpty()){\r\n if (xposition < 0) {\r\n xposition = 0;\r\n xspeed=0;\r\n yspeed=0;\r\n Thrust=0;\r\n }\r\n if (xposition > 900) {\r\n xposition = 900;\r\n xspeed=0;\r\n yspeed=0;\r\n Thrust=0;\r\n }\r\n if (yposition < 0) {\r\n yposition = 0;\r\n xspeed=0;\r\n yspeed=0;\r\n Thrust=0;\r\n }\r\n if (yposition > 600) {\r\n yposition = 600;\r\n xspeed=0;\r\n yspeed=0;\r\n Thrust=0;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "3e3e1dd49b07dbda349d0dd2b8b2e373", "score": "0.46748385", "text": "private void initUpperHalf() {\r\n\t\t// upper half\r\n\t\tthis.upperHalf = new JPanel();\r\n\t\tthis.upperHalf.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));\r\n\t\tthis.upperHalf.setOpaque(false);\r\n\r\n\t\tthis.currentPlayerArea = new JPanel();\r\n\t\tthis.currentPlayerArea.setOpaque(false);\r\n\r\n\t\tthis.allocateButton = new JButton(\r\n\t\t\t\tGAME_PANEL_CONTROLBAR_BUTTON_SET_ARMIES);\r\n\t\tthis.allocatableArmies = new JLabel(\"0\");\r\n\t\tthis.allocatableArmies.setForeground(new Color(187, 186, 187));\r\n\r\n\t\tthis.cardButton = new JButton(\r\n\t\t\t\tGAME_PANEL_CONTROLBAR_BUTTON_TURN_CARDS_IN);\r\n\t\tthis.attackButton = new JButton(GAME_PANEL_CONTROLBAR_BUTTON_ATTACK);\r\n\t\tthis.moveButton = new JButton(\r\n\t\t\t\tGAME_PANEL_CONTROLBAR_BUTTON_ALLOCATE_ARMIES);\r\n\t\tthis.finishTurnButton = new JButton(\r\n\t\t\t\tGAME_PANEL_CONTROLBAR_BUTTON_FINISH_TURN);\r\n\r\n\t\tthis.upperHalf.add(this.currentPlayerArea);\r\n\r\n\t\tthis.upperHalf.add(this.cardButton);\r\n\t\tthis.upperHalf.add(this.allocateButton);\r\n\t\tthis.upperHalf.add(this.allocatableArmies);\r\n\t\tthis.upperHalf.add(this.attackButton);\r\n\t\tthis.upperHalf.add(this.moveButton);\r\n\t\tthis.upperHalf.add(this.finishTurnButton);\r\n\t}", "title": "" }, { "docid": "52ea99237598488f8969d172d60c4bba", "score": "0.4674569", "text": "private static void createNorth(Vec3i location, Quaternion rotation, ChunkMesh chunkMesh, float blockScale, Function<Direction, TextureCoordinates> textureCoordinatesFunction) {\n int offset = chunkMesh.getPositions().size();\n // vertices\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(-0.5f, -0.5f, -0.5f)), location, blockScale));\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(-0.5f, 0.5f, -0.5f)), location, blockScale));\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(0.5f, -0.5f, -0.5f)), location, blockScale));\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(0.5f, 0.5f, -0.5f)), location, blockScale));\n // indices\n chunkMesh.getIndices().add(offset);\n chunkMesh.getIndices().add(offset + 1);\n chunkMesh.getIndices().add(offset + 2);\n chunkMesh.getIndices().add(offset + 1);\n chunkMesh.getIndices().add(offset + 3);\n chunkMesh.getIndices().add(offset + 2);\n\n if (!chunkMesh.isCollisionMesh()) {\n // normals and tangents\n for (int i = 0; i < 4; i++) {\n chunkMesh.getNormals().add(rotation.mult(new Vector3f(0.0f, 0.0f, -1.0f)));\n Matrix4f rotationMatrix = rotation.toRotationMatrix(new Matrix4f());\n chunkMesh.getTangents().add(rotationMatrix.mult(new Vector4f(-1.0f, 0.0f, 0.0f, 1.0f)));\n }\n // uvs\n TextureCoordinates textureCoordinates = textureCoordinatesFunction.apply(Direction.NORTH);\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMax().x, textureCoordinates.getMin().y));\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMax().x, textureCoordinates.getMax().y));\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMin().x, textureCoordinates.getMin().y));\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMin().x, textureCoordinates.getMax().y));\n }\n }", "title": "" }, { "docid": "4207be7e961357fbd9ab295081f1a45b", "score": "0.46679208", "text": "@Test\n public void WallTest3() {\n // Create a Boulder and a Wall to the right of the player.\n Boulder b = new Boulder(5, 4, dungeon);\n dungeon.addEntity(b);\n Wall w = new Wall(6, 4, dungeon);\n dungeon.addEntity(w);\n\n // Try and make the Player push the Boulder into the Wall.\n player.move(Direction.RIGHT);\n\n // Check that the Boulder remains in the same spot.\n assertEquals(5, b.getX());\n assertEquals(4, b.getY());\n\n // Check that the Player remains in the same spot.\n assertEquals(4, player.getX());\n assertEquals(4, player.getY());\n\n }", "title": "" }, { "docid": "f8c6b24f70bd85817308d453745fbe8a", "score": "0.46673688", "text": "public void setBlockDirection(GameLoopTask.GameDirection newDir){\n //Only change the directions when the bloack is in a corner\n myDir = newDir;\n }", "title": "" }, { "docid": "fd84fdbc6da9132c2537e4650b702326", "score": "0.46574342", "text": "Thing(int screenHeight) {\r\n posy = screenHeight / 11; // spawn the thing at the horizon\r\n }", "title": "" }, { "docid": "a64d7d61dcb011ef8dc90294443d2e53", "score": "0.46541703", "text": "@Override\r\n public void onUpdate() {\r\n\r\n super.onUpdate();\r\n\r\n if (this._ticksInAir > this._maxTicksInAir)\r\n this.setDead();\r\n\r\n if (this._shootingEntity == null) {\r\n\r\n List players = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(posX - 1, posY - 1, posZ - 1, posX + 1, posY + 1, posZ + 1));\r\n Iterator i = players.iterator();\r\n double closestDistance = Double.MAX_VALUE;\r\n EntityPlayer closestPlayer = null;\r\n\r\n while (i.hasNext()) {\r\n\r\n EntityPlayer e = (EntityPlayer)i.next();\r\n double distance = e.getDistanceToEntity(this);\r\n\r\n if (distance < closestDistance)\r\n closestPlayer = e;\r\n }\r\n\r\n if (closestPlayer != null)\r\n this._shootingEntity = closestPlayer;\r\n }\r\n\r\n if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) {\r\n\r\n float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);\r\n\r\n this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);\r\n this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(this.motionY, var1) * 180.0D / Math.PI);\r\n }\r\n\r\n IBlockState state = this.worldObj.getBlockState(new BlockPos(this._xTile, this._yTile, this._zTile));\r\n Block var16 = state.getBlock();\r\n\r\n if (var16 != null) {\r\n\r\n var16.setBlockBoundsBasedOnState(this.worldObj, new BlockPos(this._xTile, this._yTile, this._zTile));\r\n\r\n AxisAlignedBB var2 = var16.getCollisionBoundingBox(worldObj, new BlockPos(this._xTile, this._yTile, this._zTile), state);\r\n\r\n if (var2 != null && var2.isVecInside(new Vec3(this.posX, this.posY, this.posZ)))\r\n this._inGround = true;\r\n }\r\n\r\n if (!this._inGround) {\r\n\r\n ++this._ticksInAir;\r\n\r\n if (this._ticksInAir > 1 && this._ticksInAir < 3) {\r\n\r\n for (int particles = 0; particles < 3; particles++) {\r\n this.doFiringParticles();\r\n }\r\n }\r\n\r\n Vec3 var17 = new Vec3(this.posX, this.posY, this.posZ);\r\n Vec3 var3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);\r\n MovingObjectPosition var4 = this.worldObj.rayTraceBlocks(var17, var3, true, false, false);\r\n var17 = new Vec3(this.posX, this.posY, this.posZ);\r\n var3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);\r\n\r\n if (var4 != null)\r\n var3 = new Vec3(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord);\r\n\r\n Entity var5 = null;\r\n List var6 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, getBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));\r\n double var7 = 0.0D;\r\n Iterator var9 = var6.iterator();\r\n float var11;\r\n boolean scheduledForDeath = false;\r\n\r\n while (var9.hasNext()) {\r\n\r\n Entity var10 = (Entity) var9.next();\r\n\r\n if (var10.canBeCollidedWith() && (var10 != this._shootingEntity || this._ticksInAir >= 5)) {\r\n\r\n var11 = 0.3F;\r\n\r\n AxisAlignedBB var12 = var10.getBoundingBox().expand(var11, var11, var11);\r\n MovingObjectPosition var13 = var12.calculateIntercept(var17, var3);\r\n\r\n if (var13 != null) {\r\n\r\n double var14 = var17.distanceTo(var13.hitVec);\r\n\r\n if (var14 < var7 || var7 == 0.0D) {\r\n\r\n var5 = var10;\r\n var7 = var14;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (var5 != null)\r\n var4 = new MovingObjectPosition(var5);\r\n\r\n if (var4 != null) {\r\n\r\n this.onImpact(var4);\r\n\r\n if (scheduledForDeath)\r\n this.setDead();\r\n }\r\n\r\n this.posX += this.motionX;\r\n this.posY += this.motionY;\r\n this.posZ += this.motionZ;\r\n MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);\r\n this.setPosition(this.posX, this.posY, this.posZ);\r\n }\r\n }", "title": "" }, { "docid": "d6abcb0e0eb79ac0e9b9c5c51446077e", "score": "0.46479163", "text": "private void setY(){\n double pos = enemy.getYPos() + enemy.getHeight();\n\n if(pos >= levelHeight){\n if(!enemy.getJump() && enemy.getFall()){\n enemy.setInitialPos(enemy.getXPos(), levelHeight - enemy.getHeight());\n enemy.setFall(false);\n enemy.setJump(false);\n }\n }\n else if(pos < levelHeight){\n if(!enemy.getFall() && !enemy.getJump()){\n enemy.setFall(true);\n enemy.setJump(false);\n enemy.setInitialPos(enemy.getXPos(),enemy.getYPos() +1);\n }\n else if(enemy.getFall() && !enemy.getJump()){\n if(pos < levelHeight){\n enemy.setInitialPos(enemy.getXPos(),enemy.getYPos() +1);\n\n }\n }\n }\n }", "title": "" }, { "docid": "b5f41312a400849dc7b332090ff150d3", "score": "0.4646733", "text": "public void placeBlock(BlockPos blockPos) {\n void position;\n if (BlockUtils.isPositionPlaceable((BlockPos)position, true, true, false) && this.placements < blocks.getValue().intValue()) {\n BlockUtils.placeBlock((BlockPos)position, EnumHand.MAIN_HAND, true);\n ++this.placements;\n }\n }", "title": "" }, { "docid": "bf57b3c8fe4bec402f46fc373d6e6cc9", "score": "0.46429214", "text": "public void checkVertical(int row, int column, int player) {\n // Only checks for win if possible (if column is full)\n if (lowestOpen[column] == 0) {\n for (int i = dims - 1; i >= 0; i--) {\n if (board[row][i] != player) {\n return;\n }\n }\n\n win();\n }\n }", "title": "" }, { "docid": "f88c0f85f8a83fa26e139e010a983e9f", "score": "0.46379834", "text": "@Override\n\t\t\t\tpublic void OnPlayerNotColideWithFloor() {\n\t\t\t\t\tplayer.canBeAppliedVerticalForce(false);\n\t\t\t\t}", "title": "" }, { "docid": "2d3002eff5b7991119c0fad1f205f126", "score": "0.4630579", "text": "private static GridDirection initialOrientation() { return UP; }", "title": "" }, { "docid": "d6abc58370039481fd729656f4b96fa4", "score": "0.46198583", "text": "public interface WorldServerAdapter {\n\n /**\n * @param type The type of world.\n * @return The world of this type.\n */\n World getWorld(WorldType type);\n\n /**\n * @param world The world.\n * @param x The X coordinate.\n * @param y The Y coordinate.\n * @param z The Z coordinate.\n * @return The block in the given world at the specified coordinates.\n */\n Block getBlockAt(WorldType world, int x, int y, int z);\n\n /**\n * @param world The world.\n * @param x The X coordinate.\n * @param z The Y coordinate.\n * @return The highest non-air block in the given world at the specified coordinates.\n */\n Block getHighestBlockAt(WorldType world, int x, int z);\n\n /**\n * @param block The block to update. Can not be null.\n */\n void setBlock(Block block);\n\n /**\n * @param block The block to update. Can not be null.\n * @param type The new type. Can not be null.\n */\n void setBlockType(Block block, BlockType type);\n\n /**\n * @param sign The sign to update. Can not be null.\n * @param lines The new lines. Can not be null.\n */\n void setSignLines(Sign sign, String[] lines);\n\n /**\n * @param items The items to drop. Can not be null, but can be empty. Items can not be null.\n * @param location The location to drop at. Can not be null.\n */\n void dropItemsAt(List<Item> items, Location location);\n\n void spoofBlock(Block fakeBlock, UUID playerId);\n\n void playSound(Location location, Sound sound, SoundCategory category, float volume, float pitch);\n\n void strikeLightning(Location location, boolean ambient);\n\n void createExplosion(Location location, boolean ambient);\n\n UUID createArrow(UUID shooterId, Location location, Vector3f direction, float speed, float spread);\n}", "title": "" }, { "docid": "93035a3444a43e910e94fd31f1565ff9", "score": "0.46186095", "text": "private static void createWest(Vec3i location, Quaternion rotation, ChunkMesh chunkMesh, float blockScale, Function<Direction, TextureCoordinates> textureCoordinatesFunction) {\n int offset = chunkMesh.getPositions().size();\n // vertices\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(-0.5f, -0.5f, 0.5f)), location, blockScale));\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(-0.5f, 0.5f, 0.5f)), location, blockScale));\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(-0.5f, -0.5f, -0.5f)), location, blockScale));\n chunkMesh.getPositions().add(Shape.createVertex(rotation.mult(new Vector3f(-0.5f, 0.5f, -0.5f)), location, blockScale));\n // indices\n chunkMesh.getIndices().add(offset);\n chunkMesh.getIndices().add(offset + 1);\n chunkMesh.getIndices().add(offset + 2);\n chunkMesh.getIndices().add(offset + 1);\n chunkMesh.getIndices().add(offset + 3);\n chunkMesh.getIndices().add(offset + 2);\n\n if (!chunkMesh.isCollisionMesh()) {\n // normals and tangents\n for (int i = 0; i < 4; i++) {\n chunkMesh.getNormals().add(rotation.mult(new Vector3f(-1.0f, 0.0f, 0.0f)));\n Matrix4f rotationMatrix = rotation.toRotationMatrix(new Matrix4f());\n chunkMesh.getTangents().add(rotationMatrix.mult(new Vector4f(0.0f, 0.0f, 1.0f, 1.0f)));\n }\n // uvs\n TextureCoordinates textureCoordinates = textureCoordinatesFunction.apply(Direction.WEST);\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMax().x, textureCoordinates.getMin().y));\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMax().x, textureCoordinates.getMax().y));\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMin().x, textureCoordinates.getMin().y));\n chunkMesh.getUvs().add(new Vector2f(textureCoordinates.getMin().x, textureCoordinates.getMax().y));\n }\n }", "title": "" }, { "docid": "1a11f9f77da9c4da6f9006d1b5d1dad8", "score": "0.46133947", "text": "void rotateBlock(IBlock block);", "title": "" }, { "docid": "7326ffd083dd40f1645ebf7e61ae0c3b", "score": "0.46117827", "text": "@Override\n public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float j, float k, float l) {\n return true;\n }", "title": "" }, { "docid": "9f84ccfd9f00dc828ffe12dd18131743", "score": "0.46111125", "text": "public GameArea() {\n super();\n\n\n player = new Player(50, 0);\n\n xPerSec = 0;\n yPerSec = 0;\n\n moveRight = false;\n moveLeft = false;\n moveUp = false;\n moveDown = false;\n\n bonuses = new LinkedList<>();\n bonusImages = new LinkedList<>();\n pointedLines = new LinkedList<>();\n\n setPreferredSize(new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGHT));\n setDoubleBuffered(true);\n setBackground(Color.CYAN);\n currentLevel = new Level(0, 0, 0, 0, 0);\n\n playerImg = player.playerImage.getScaledInstance(Player.SHIP_SIZE*DEFAULT_WIDTH/100, Player.SHIP_SIZE*DEFAULT_HEIGHT/100, Image.SCALE_DEFAULT);\n\n\n //creating initial terrain\n for (Line line : currentLevel.getLines()) {\n polyx.add(line.x1);\n polyy.add(line.y1);\n }\n polyg.reset();\n for(int i =0; i < polyx.size(); i++){\n polyg.addPoint((int)polyx.get(i)*this.getWidth()/100, (int)polyy.get(i)*this.getHeight()/100);\n }\n polyx.clear();\n polyy.clear();\n\n addComponentListener(this);\n\n winInfo = new JLabel(\"\");\n winInfo.setFont(new Font(this.getFont().getName(), Font.PLAIN, 40));\n winInfo.setForeground(Color.RED);\n\n this.setLayout(new BorderLayout());\n add(winInfo);\n\n setMinimumSize(new Dimension(50, 50));\n\n }", "title": "" }, { "docid": "1fa74caba2d84ab6fc3415b810e97634", "score": "0.46039608", "text": "public boolean shiftDown(){\n if(playerPos.y == this.height -1) {\n \t return false;\n \t}\n\n \tBlockType[][] newBoard = new BlockType[height][];\n\tfor(int i = height-1; i >= 0; i--){\n\t if(i == 0){\n\t newBoard[i] = nextChunk[nextChunkIndex];\n\t }\n\t else {\n\t\tnewBoard[i] = board[i - 1];\n\t }\n\t}\n\n \tplayerPos.y++;\n\tthis.board = newBoard;\n\tnotifyListeners();\n\n\t// Update the nextchunk traverse index and ask for a new chunk if\n\t// the last row of the chunk was used.\n \tif(nextChunkIndex + 1 == nextChunk.length){\n \t try {\n\t\tnextChunk = chunkHandler.getNextChunk();\n\t } catch(IllegalStateException e){\n \t e.printStackTrace();\n \t System.out.println(\"No available chunk in ChunkHandler\");\n \t System.exit(1);\n\t }\n \t nextChunkIndex = 0;\n \t}\n \telse{\n \t nextChunkIndex++;\n\t}\n \treturn true;\n }", "title": "" }, { "docid": "96415c171eb9aa74b418a1ddc1aa458d", "score": "0.45993248", "text": "void spawnPlayer(PlayerColor player, TilePosition tile);", "title": "" }, { "docid": "f4ea9774277da95410659b1708505b70", "score": "0.45979762", "text": "@EventHandler\n public void onBlockPlace(BlockPlaceEvent event){\n\n if(event.getBlockAgainst().getType().equals(Material.IRON_BLOCK) && event.getBlock().getType().equals(Material.CRAFTING_TABLE)){\n // We check if the block that it is placed against is one block below it so that it doesn't happen unless it is placed on top the block.\n if(event.getBlockAgainst().getLocation().getY() == (event.getBlock().getLocation().getY() - 1)) {\n // https://www.youtube.com/watch?v=XMeck_nTdVA\n // I ended up trying this one since the above one didn't really work:\n // https://www.youtube.com/watch?v=1IfimW0_1_M\n\n event.getPlayer().getWorld().playSound(event.getBlock().getLocation().add(0.5, 0, 0.5), Sound.BLOCK_AMETHYST_BLOCK_CHIME, 8f, 1);\n\n new BukkitRunnable() {\n double var = 0;\n Location loc, first, second;\n Block placedBlock = event.getBlock();\n\n @Override\n public void run() {\n var += Math.PI / 16;\n\n // https://christopherchudzicki.github.io/MathBox-Demos/parametric_curves_3D.html\n // This ^ allows you to plug in the equations for the first and second variables and then you can see it before you\n // run the game. Theoretically you could then use it to create new ones that you then put in to get cool new animations.\n // Must add 0.5 to the x and z coords so that the location is the center of the block.\n loc = placedBlock.getLocation().add(0.5, 0, 0.5);\n first = loc.clone().add(Math.cos(var), Math.sin(var) + 1, Math.sin(var));\n second = loc.clone().add(Math.cos(var + Math.PI), Math.sin(var) + 1, Math.sin(var + Math.PI));\n\n placedBlock.getWorld().spawnParticle(Particle.SOUL_FIRE_FLAME, first, 0);\n placedBlock.getWorld().spawnParticle(Particle.FLAME, second, 0);\n\n if (var > Math.PI * 4) {\n this.cancel();\n }\n }\n }.runTaskTimer(plugin, 0, 1);\n }\n }\n }", "title": "" }, { "docid": "27c5e31792fce193250c3229149888fb", "score": "0.45920062", "text": "public Block(){\n\t\tisObstacle = false;\n\t\trow = -1;\n\t\tcol = -1;\n\t}", "title": "" }, { "docid": "49482e93106303d3db7403be45409b92", "score": "0.4590243", "text": "public void reposition() {\r\n spawnInterface.reposition();\r\n }", "title": "" }, { "docid": "5fc174801d1992e77258205651902587", "score": "0.45889732", "text": "boolean checkPushableBlock(Orientation orientation, float x, float y);", "title": "" }, { "docid": "84bf6c1f33f2b5adf13bc643ae97ec67", "score": "0.45822394", "text": "public GameWorldPositiveYUp() {\n\t\t\tcreateViewports();\n\t\t\tloadAndPositionPlatforms();\n\t\t}", "title": "" }, { "docid": "07bc9133044ece8ec35e85f3ea8d23f7", "score": "0.45793995", "text": "private void moveToNextSquare(final Player player) {\r\n player.setPosition(player.getPosition() - locations.size());\r\n player.setBalance(player.getBalance() + b);\r\n }", "title": "" }, { "docid": "afe5814f2c9bdc8f9621ea74bc6b92b2", "score": "0.456961", "text": "@Override\n public void faceSouth() {\n\n }", "title": "" }, { "docid": "a00db476de1db54b8184847ac0a062df", "score": "0.45667872", "text": "public void generateTerrain()\n\t{\n\t\tint rand;\n\t\tint starting=(int)(blocksWide*0.15);//Choose the first grass block\n\t\tblocksTall=(int)(blocksWide*0.6);\n\t\tfor(int i=0;i<blocksWide;i++)\n\t\t{\n\t\t\t//Determine whether the next block will go up a level, down a level or stay the same (55% chance of staying the same)\n\t\t\trand=ThreadLocalRandom.current().nextInt(0,3);\t\n\t\t\tif(rand!=0)\n\t\t\t{\n\t\t\t\trand=ThreadLocalRandom.current().nextInt(-1,2);\n\t\t\t}\n\t\t\tif(starting+rand<blocksTall-2 && starting+rand>2)\t//Make sure new position isn't too close to the top or bottom\n\t\t\t{\n\t\t\t\tstarting+=rand;\n\t\t\t}\n\t\t\tplatforms.add(new Platform((double)i/blocksWide,(double)starting/blocksTall,1.0/blocksWide,1.0/blocksTall));\n\t\t}\n\t\tplatforms.add(new Platform(0.0,0.0,0.0,0.0));\n\t}", "title": "" }, { "docid": "de66f15f9c7063b3452c5aee2a590fca", "score": "0.45656842", "text": "public void initialize() {\r\n\r\n // Create background.\r\n this.background.addToGame(this);\r\n // the upper block.\r\n Rectangle upRectBlock = new Rectangle(0, 0, BOARD_WIDE, BLOCK_LEN * 2);\r\n Block upperBlock = new Block(upRectBlock, Color.pink);\r\n Rectangle lowRectBlock = new Rectangle(0, BOARD_LENGHT - 0.999, BOARD_WIDE, BLOCK_LEN);\r\n // the lower block.\r\n Block lowerBlock = new Block(lowRectBlock, Color.gray);\r\n Rectangle leftRectBlock = new Rectangle(0, BLOCK_LEN, BLOCK_LEN, BOARD_LENGHT - BLOCK_LEN);\r\n // the left block.\r\n Block leftBlock = new Block(leftRectBlock, Color.pink);\r\n Rectangle rigthRectBlock = new Rectangle(BOARD_WIDE - BLOCK_LEN, BLOCK_LEN, BLOCK_LEN,\r\n BOARD_LENGHT - BLOCK_LEN);\r\n // the right block.\r\n Block rightBlock = new Block(rigthRectBlock, Color.pink);\r\n // add the borders to the game.\r\n upperBlock.addToGame(this);\r\n lowerBlock.addToGame(this);\r\n leftBlock.addToGame(this);\r\n rightBlock.addToGame(this);\r\n lowerBlock.addHitListener(ballRemover);\r\n // adding the paddle.\r\n paddle.addToGame(this);\r\n //add blocks\r\n\r\n for (Block block : this.blockList) {\r\n block.addToGame(this);\r\n block.addHitListener(this.blockRemover);\r\n block.addHitListener(this.scoreTracking);\r\n }\r\n this.counterBlocks.increase(this.level.numberOfBlocksToRemove());\r\n\r\n Rectangle answerRect = new Rectangle(0, 0, BOARD_WIDE, BLOCK_LEN);\r\n Block scoreBlock = new Block(answerRect, Color.WHITE);\r\n this.scoreIndicator = new ScoreIndicator(answerRect, counterScore);\r\n this.livesIndicator = new LivesIndicator(answerRect, counterLives);\r\n this.levelName = new LevelName(answerRect, this.level.levelName());\r\n scoreBlock.addToGame(this);\r\n this.scoreIndicator.addToGame(this);\r\n this.livesIndicator.addToGame(this);\r\n this.levelName.addToGame(this);\r\n }", "title": "" }, { "docid": "94d9412f5b5b2a53983ec5cd4bb223d8", "score": "0.4564976", "text": "@Override\n\tpublic void setBlockGenerate(Block block, int x, int y) {\n\t\t\n\t}", "title": "" }, { "docid": "721925b3b1547dc0fde0d0127817395e", "score": "0.45648435", "text": "private void eraseBlock(Block block) {\n\t\tint length = block.getLength();\n\t\tint x = block.getPosition().x;\n\t\tint y = block.getPosition().y;\n\n\t\twhile (length-- > 0) {\n\t\t\tsetGridSquare(null, x, y);\n\t\t\tif (block.getOrientation() == VERTICAL) {\n\t\t\t\ty++;\n\t\t\t} else {\n\t\t\t\tx++;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "73fe60ee191acd8fcfe92539e094664d", "score": "0.45611706", "text": "public void newBlock() {\n SymbolTableEntry block = new SymbolTableEntry(NONAME, Kind.ANONYMOUSBLOCK, Type.VOID, 0, 0, currLevel);\n addBlockNode(block);\n }", "title": "" }, { "docid": "d28017163b9be392e3f61a250ac05a71", "score": "0.45607543", "text": "public void addBlock(BlockFunction block)\n {\n if (extrudeMode != BO3Settings.ExtrudeMode.None)\n {\n if (extrudeMode == BO3Settings.ExtrudeMode.BottomDown && block.y < blockExtrusionY)\n {\n blocksToExtrude.clear();\n blockExtrusionY = block.y;\n } else if (extrudeMode == BO3Settings.ExtrudeMode.TopUp && block.y > blockExtrusionY)\n {\n blocksToExtrude.clear();\n blockExtrusionY = block.y;\n }\n if (block.y == blockExtrusionY)\n {\n blocksToExtrude.add(block);\n }\n }\n }", "title": "" }, { "docid": "0d578a1355b5c81bc37022fd424117ad", "score": "0.4558377", "text": "public ExitTile(Point location) {\r\n\t\tboardLocation = location;\r\n\t\ttileChar = \"%\";\r\n\t}", "title": "" }, { "docid": "cce48b08275ae56caa0c1e51ee8883fa", "score": "0.45561412", "text": "private PsiPlayerListFooterExpressionImpl(@NotNull PsiElement<?> player, int lineNumber) {\n super(player, lineNumber);\n }", "title": "" }, { "docid": "500261df65c486947a5f7195ebdb1710", "score": "0.4551599", "text": "private void singleBlock(int x, int y, TETile surrounding, TETile center) {\n\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n this.spaces[x + i][y + j] = surrounding;\n }\n }\n\n this.spaces[x + 1][y + 1] = center;\n }", "title": "" }, { "docid": "a310fedb14e6f970ed7c6085be99328f", "score": "0.45489573", "text": "public Player (){\n//\t\txPlayerLoc = setPlayerXStart();\n\t\tyPlayerLoc = 100;\n\t\tplayerImage = new Texture(\"Universal/PlayerImage-Right.png\");\n\t\tplayerScale = .25f;\n\t\tdiffSett = 0;\n\t\tsetPlayerMoveImages();\n\t}", "title": "" } ]
aedf8a6fbc704ec93573090f81e2d6e9
This method returns how many times a certain character appears within a given string.
[{"docid":"7bf4d16f4f668d6b238f7948a424c01f","score":"0.6935934","text":"public static int countChar(...TRUNCATED)
[{"docid":"3315bec9738790eae1b319b91483f71d","score":"0.8052447","text":"public static int findNumbe(...TRUNCATED)
f77363ef76cc5efd6abb5507e78c9cd0
"you can call this method in your teleop or autonsteps because append is false, it will write over a(...TRUNCATED)
[{"docid":"257616217bac4aa0f0cfd924873fb8fc","score":"0.0","text":"public void newDriverAssist(Array(...TRUNCATED)
[{"docid":"e2b2683aef70cd05791172f32b5779dc","score":"0.6472098","text":"@Override\n //code block(...TRUNCATED)
d0baba1a1d552bb8c0d807adce622a7d
PUT /robots => update the robot
[{"docid":"4aa959284e2570a61459f991b829b733","score":"0.7214156","text":"@RequestMapping(value = \"/(...TRUNCATED)
[{"docid":"317744bbcd846633c35cd1d48dce6a8b","score":"0.6413801","text":"public void updateRobots(Se(...TRUNCATED)
0c894c50b580240958b6344533a9d0d6
Default constructor which sets up data arrays.
[{"docid":"ae1f6275ae53f35a58182f4433a51349","score":"0.60884273","text":"public Calibrator()\n {(...TRUNCATED)
[{"docid":"f8ee81772be70c62cba74bbb4f183146","score":"0.71281177","text":"public DataSet() {\r\n\t\t(...TRUNCATED)
95c899f1dcb79c11f5184699bddcae49
Removes events with an _id <= last_id from table
[{"docid":"cc0859700328adcd716528c06b606e5d","score":"0.70771825","text":"public void cleanupEvents((...TRUNCATED)
[{"docid":"26dff0af1d938d71d2277facbec83814","score":"0.59065723","text":"public int cleanupEvents(S(...TRUNCATED)
c5781670423ae4c19ffd8a70796896b0
This adds a property descriptor for the Maximum Redelivery Delay feature.
[{"docid":"26a861febfcafc059472a035f59f754c","score":"0.80435836","text":"protected void addMaximumR(...TRUNCATED)
[{"docid":"59547d8ad038546c57eeca38e907c209","score":"0.7387544","text":"protected void addRedeliver(...TRUNCATED)
c8a63ed0cfa65fef80adcbed90e8e0c4
Open user file user.
[{"docid":"6dd908b916e6cb54246a74a819f0f6fd","score":"0.70396715","text":"public User openUserFile(S(...TRUNCATED)
[{"docid":"4a6111751139f5b2bcfb9feb46ede3a4","score":"0.7160219","text":"private void openFile() thr(...TRUNCATED)
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
57