id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
11309044_16 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2FloatOpenHashMapWritableTest.java",
"identifier": "Int2FloatOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIncrement() throws IOException {\n Int2FloatOpenHashMapWritable m = new Int2FloatOpenHashMapWritable();\n\n m.put(2, 7.0f);\n m.put(1, 29.0f);\n\n assertEquals(7, m.get(2), 10e-6);\n assertEquals(29, m.get(1), 10e-6);\n\n m.increment(2);\n m.increment(1);\n ... | {
"fields": [
{
"declarator": "serialVersionUID = 674980125439241L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 674980125439241L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_DECODE =... | {
"body": "public void increment(int key) {\n increment(key, 1.0f);\n }",
"class_method_signature": "Int2FloatOpenHashMapWritable.increment(int key)",
"constructor": false,
"full_signature": "public void increment(int key)",
"identifier": "increment",
"invocations": [
"increment"
],
"modifiers":... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_112 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIDWTest.java",
"identifier": "HMapIDWTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBasic() throws IOException {\n HMapIDW m = new HMapIDW();\n\n m.put(2, 5.0);\n m.put(1, 22.0);\n\n double value;\n\n assertEquals(m.size(), 2);\n\n value = m.get(2);\n assertTrue(value == 5.0);\n\n value = m.remove(2);\n assertEquals(m.size(), 1);\n\n ... | {
"fields": [
{
"declarator": "LazyDecode = false",
"modifier": "private static",
"original_string": "private static boolean LazyDecode = false;",
"type": "boolean",
"var_name": "LazyDecode"
},
{
"declarator": "serialVersionUID = 4760032853L",
"modifier": "private... | {
"body": "@Override\n public int size() {\n if (!isDecoded()) {\n return keys.length;\n }\n\n return super.size();\n }",
"class_method_signature": "HMapIDW.size()",
"constructor": false,
"full_signature": "@Override public int size()",
"identifier": "size",
"invocations": [
"isDecoded",... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_82 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "short neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "short",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testIterable() {\n int size = 1000;\n Random r = new Random();\n short[] shorts = new short[size];\n\n ArrayListOfShorts list = new ArrayListOfShorts();\n for (int i = 0; i < size; i++) {\n short k = (short) r.nextInt(size);\n list.add(k);\n shorts[i] = k;... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient short[] array;",
"type": "short[]",
"var_name": "array"
},
{
"declarator": "size",
"modifier": "protected",
"original_string": "protected int si... | {
"body": "public ArrayListOfShorts add(short e) {\n ensureCapacity(size + 1); // Increments modCount!!\n array[size++] = e;\n return this;\n }",
"class_method_signature": "ArrayListOfShorts.add(short e)",
"constructor": false,
"full_signature": "public ArrayListOfShorts add(short e)",
"identifier":... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_104 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIITest.java",
"identifier": "HMapIITest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIncrement() {\n HMapII m = new HMapII();\n // When we put a value, we should get back the old value.\n\n assertEquals(0, m.get(1));\n m.increment(1);\n\n assertEquals(1, m.get(1));\n m.increment(1, 5);\n m.increment(2, 0);\n m.increment(3, 2);\n\n assertE... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void increment(int key) {\n if (this.containsKey(key)) {\n this.put(key, this.get(key) + 1);\n } else {\n this.put(key, 1);\n }\n }",
"class_method_signature": "HMapII.increment(int key)",
"constructor": false,
"full_signature": "@Override public void increment... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_94 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "long neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "long",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/te... | {
"body": "@Test\n public void testSort() {\n ArrayListOfLongs a = new ArrayListOfLongs();\n assertEquals(0, a.size());\n\n a.add(5).add(6).add(1).add(4);\n assertEquals(4, a.size());\n\n a.sort();\n assertEquals(4, a.size());\n\n assertEquals(1, a.get(0));\n assertEquals(4, a.get(1));\n a... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient long[] array;",
"type": "long[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected int ... | {
"body": "public void sort() {\n trimToSize();\n Arrays.sort(getArray());\n }",
"class_method_signature": "ArrayListOfLongs.sort()",
"constructor": false,
"full_signature": "public void sort()",
"identifier": "sort",
"invocations": [
"trimToSize",
"sort",
"getArray"
],
"modifiers": "... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_95 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "long neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "long",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/te... | {
"body": "@Test\n public void testSubList() {\n ArrayListOfLongs a = new ArrayListOfLongs(new long[] { 1, 2, 3, 4, 5, 6, 7 });\n ArrayListOfLongs b = a.subList(1, 5);\n assertEquals(5, b.size());\n assertEquals(2, b.get(0));\n assertEquals(3, b.get(1));\n assertEquals(4, b.get(2));\n assertEqua... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient long[] array;",
"type": "long[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected int ... | {
"body": "public ArrayListOfLongs subList(int start, int end) {\n ArrayListOfLongs sublst = new ArrayListOfLongs(end - start + 1);\n for (int i = start; i <= end; i++) {\n sublst.add(get(i));\n }\n return sublst;\n }",
"class_method_signature": "ArrayListOfLongs.subList(int start, int end)",
"c... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_105 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIITest.java",
"identifier": "HMapIITest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortedEntries4() {\n HMapII m = new HMapII();\n\n MapII.Entry[] e = m.getEntriesSortedByValue();\n assertTrue(e == null);\n }",
"class_method_signature": "HMapIITest.testSortedEntries4()",
"constructor": false,
"full_signature": "@Test public void testSortedEntries4... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "public MapII.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n // for storing the entries\n MapII.Entry[] entries = new Entry[this.size()];\n int i = 0;\n Entry next = null;\n\n int index = 0;\n // advance to first entry\n while (index < table.lengt... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_83 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "short neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "short",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testSetSize() {\n ArrayListOfShorts list = new ArrayListOfShorts();\n\n list.add((short) 5);\n assertEquals(1, list.size);\n assertEquals(5, list.get(0));\n\n list.setSize(5);\n assertEquals(5, list.size);\n assertEquals(0, list.get(1));\n assertEquals(0, list.g... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient short[] array;",
"type": "short[]",
"var_name": "array"
},
{
"declarator": "size",
"modifier": "protected",
"original_string": "protected int si... | {
"body": "public void setSize(int sz) {\n ensureCapacity(sz);\n size = sz;\n }",
"class_method_signature": "ArrayListOfShorts.setSize(int sz)",
"constructor": false,
"full_signature": "public void setSize(int sz)",
"identifier": "setSize",
"invocations": [
"ensureCapacity"
],
"modifiers": "p... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_113 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapKITest.java",
"identifier": "HMapKITest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPlus() throws IOException {\n HMapKI<Text> m1 = new HMapKI<Text>();\n\n m1.put(new Text(\"hi\"), 5);\n m1.put(new Text(\"there\"), 22);\n\n HMapKI<Text> m2 = new HMapKI<Text>();\n\n m2.put(new Text(\"hi\"), 4);\n m2.put(new Text(\"test\"), 5);\n\n m1.plus(m2);\... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void plus(MapKI<K> m) {\n for (MapKI.Entry<K> e : m.entrySet()) {\n K key = e.getKey();\n\n if (this.containsKey(key)) {\n this.put(key, this.get(key) + e.getValue());\n } else {\n this.put(key, e.getValue());\n }\n }\n }",
"class_method_signat... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_17 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2FloatOpenHashMapWritableTest.java",
"identifier": "Int2FloatOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPlus() throws IOException {\n Int2FloatOpenHashMapWritable m1 = new Int2FloatOpenHashMapWritable();\n\n m1.put(1, 5.0f);\n m1.put(2, 22.0f);\n\n Int2FloatOpenHashMapWritable m2 = new Int2FloatOpenHashMapWritable();\n\n m2.put(1, 4.0f);\n m2.put(3, 5.0f);\n\n m1... | {
"fields": [
{
"declarator": "serialVersionUID = 674980125439241L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 674980125439241L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_DECODE =... | {
"body": "public void plus(Int2FloatOpenHashMapWritable m) {\n for (Int2FloatMap.Entry e : m.int2FloatEntrySet()) {\n int key = e.getKey();\n float value = e.getValue();\n\n if (this.containsKey(key)) {\n this.put(key, this.get(key) + value);\n } else {\n this.put(key, value);\n ... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_40 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "float neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "float",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testInitialSize() {\n ArrayListOfFloats a = new ArrayListOfFloats();\n assertEquals(0, a.size());\n }",
"class_method_signature": "ArrayListOfFloatsTest.testInitialSize()",
"constructor": false,
"full_signature": "@Test public void testInitialSize()",
"identifier": "test... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient float[] array;",
"type": "float[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected in... | {
"body": "public int size() {\n return size;\n }",
"class_method_signature": "ArrayListOfFloats.size()",
"constructor": false,
"full_signature": "public int size()",
"identifier": "size",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int size()",
... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_56 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "int neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "int",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/test... | {
"body": "@Test\n public void testArrayConstructor() {\n int[] arr = new int[] { 1, 2, 3, 4, 5 };\n assertEquals(5, arr.length);\n\n ArrayListOfInts list = new ArrayListOfInts(arr);\n list.remove(2);\n\n // Make sure the original array remains untouched.\n assertEquals(1, arr[0]);\n assertEqual... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient int[] array;",
"type": "int[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected int si... | {
"body": "public int remove(int index) {\n if (index >= size) {\n throw new ArrayIndexOutOfBoundsException();\n }\n int oldValue = array[index];\n\n int numMoved = size - index - 1;\n if (numMoved > 0) {\n System.arraycopy(array, index + 1, array, index, numMoved);\n }\n\n size--;\n ... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_129 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIDTest.java",
"identifier": "HMapIDTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortedEntries4() {\n HMapID m = new HMapID();\n\n MapID.Entry[] e = m.getEntriesSortedByValue();\n assertTrue(e == null);\n }",
"class_method_signature": "HMapIDTest.testSortedEntries4()",
"constructor": false,
"full_signature": "@Test public void testSortedEntries4... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "public MapID.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n // for storing the entries\n MapID.Entry[] entries = new Entry[this.size()];\n int i = 0;\n Entry next = null;\n\n int index = 0;\n // advance to first entry\n while (index < table.lengt... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_109 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapKSTest.java",
"identifier": "HMapKSTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPlus() throws IOException {\n HMapKS<Text> m1 = new HMapKS<Text>();\n\n m1.put(new Text(\"hi\"), (short) 5);\n m1.put(new Text(\"there\"), (short) 22);\n\n HMapKS<Text> m2 = new HMapKS<Text>();\n\n m2.put(new Text(\"hi\"), (short) 4);\n m2.put(new Text(\"test\"), ... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void plus(MapKS<K> m) {\n for (MapKS.Entry<K> e : m.entrySet()) {\n K key = e.getKey();\n\n if (this.containsKey(key)) {\n this.put(key, (short) (this.get(key) + e.getValue()));\n } else {\n this.put(key, e.getValue());\n }\n }\n }",
"class_met... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_99 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "short neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "short",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testCompare2() {\n // [1, 3, 6]\n ArrayListOfShortsWritable a = new ArrayListOfShortsWritable();\n a.add(one).add(three).add(six);\n\n // [1, 3, 4]\n ArrayListOfShortsWritable b = new ArrayListOfShortsWritable();\n b.add(one).add(three).add(four);\n assertTrue(a.co... | {
"fields": [],
"file": "lintools-datatypes/src/main/java/tl/lin/data/array/ArrayListOfShortsWritable.java",
"identifier": "ArrayListOfShortsWritable",
"interfaces": "implements\n WritableComparable<ArrayListOfShortsWritable>",
"methods": [
{
"class_method_signature": "ArrayListOfShortsWritable.A... | {
"body": "@Override\n public int compareTo(ArrayListOfShortsWritable obj) {\n ArrayListOfShortsWritable other = (ArrayListOfShortsWritable) obj;\n if (isEmpty()) {\n if (other.isEmpty()) {\n return 0;\n } else {\n return -1;\n }\n }\n\n for (int i = 0; i < size(); i++) {\n ... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_76 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "float neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "float",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testCompare2() {\n // [1, 3, 6]\n ArrayListOfFloatsWritable a = new ArrayListOfFloatsWritable();\n a.add(one).add(three).add(six);\n\n // [1, 3, 4]\n ArrayListOfFloatsWritable b = new ArrayListOfFloatsWritable();\n b.add(one).add(three).add(four);\n assertTrue(a.co... | {
"fields": [],
"file": "lintools-datatypes/src/main/java/tl/lin/data/array/ArrayListOfFloatsWritable.java",
"identifier": "ArrayListOfFloatsWritable",
"interfaces": "implements\n WritableComparable<ArrayListOfFloatsWritable>",
"methods": [
{
"class_method_signature": "ArrayListOfFloatsWritable.A... | {
"body": "@Override\n public int compareTo(ArrayListOfFloatsWritable obj) {\n ArrayListOfFloatsWritable other = (ArrayListOfFloatsWritable) obj;\n if (isEmpty()) {\n if (other.isEmpty()) {\n return 0;\n } else {\n return -1;\n }\n }\n\n for (int i = 0; i < size(); i++) {\n ... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_21 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2FloatOpenHashMapWritableTest.java",
"identifier": "Int2FloatOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortedEntries2() {\n Int2FloatOpenHashMapWritable m = new Int2FloatOpenHashMapWritable();\n\n m.put(1, 5.0f);\n m.put(2, 2.0f);\n m.put(3, 3.0f);\n m.put(4, 3.0f);\n m.put(5, 1.0f);\n\n Int2FloatMap.Entry[] e = m.getEntriesSortedByValue(2);\n\n assertEquals(... | {
"fields": [
{
"declarator": "serialVersionUID = 674980125439241L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 674980125439241L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_DECODE =... | {
"body": "public Int2FloatMap.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n Int2FloatMap.Entry[] entries = new Int2FloatMap.Entry[this.size()];\n entries = this.int2FloatEntrySet().toArray(entries);\n\n // Sort the entries.\n Arrays.sort(entries, new Comparator<In... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_37 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "long neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "long",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/te... | {
"body": "@Test\n public void testToString() {\n assertEquals(\"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", new ArrayListOfLongsWritable(1, 11).toString());\n assertEquals(\"[1, 2, 3, 4, 5 ... (5 more) ]\", new ArrayListOfLongsWritable(1, 11).toString(5));\n\n assertEquals(\"[1, 2, 3, 4, 5]\", new ArrayListOfLongsW... | {
"fields": [],
"file": "lintools-datatypes/src/main/java/tl/lin/data/array/ArrayListOfLongsWritable.java",
"identifier": "ArrayListOfLongsWritable",
"interfaces": "implements\n WritableComparable<ArrayListOfLongsWritable>",
"methods": [
{
"class_method_signature": "ArrayListOfLongsWritable.Array... | {
"body": "@Override\n public String toString() {\n return toString(size());\n }",
"class_method_signature": "ArrayListOfLongsWritable.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"invocations": [
"toString",
"size"
],
... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_60 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "int neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "int",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/test... | {
"body": "@Test\n public void testIterable() {\n int size = 1000;\n Random r = new Random();\n int[] ints = new int[size];\n\n ArrayListOfInts list = new ArrayListOfInts();\n for (int i = 0; i < size; i++) {\n int k = r.nextInt(size);\n list.add(k);\n ints[i] = k;\n }\n\n int i =... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient int[] array;",
"type": "int[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected int si... | {
"body": "public ArrayListOfInts add(int e) {\n ensureCapacity(size + 1); // Increments modCount!!\n array[size++] = e;\n return this;\n }",
"class_method_signature": "ArrayListOfInts.add(int e)",
"constructor": false,
"full_signature": "public ArrayListOfInts add(int e)",
"identifier": "add",
"i... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_133 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapISTest.java",
"identifier": "HMapISTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortedEntries4() {\n HMapIS m = new HMapIS();\n\n MapIS.Entry[] e = m.getEntriesSortedByValue();\n assertTrue(e == null);\n }",
"class_method_signature": "HMapISTest.testSortedEntries4()",
"constructor": false,
"full_signature": "@Test public void testSortedEntries4... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "public MapIS.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n // for storing the entries\n MapIS.Entry[] entries = new Entry[this.size()];\n int i = 0;\n Entry next = null;\n\n int index = 0;\n // advance to first entry\n while (index < table.lengt... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_3 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2IntOpenHashMapWritableTest.java",
"identifier": "Int2IntOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDot() throws IOException {\n Int2IntOpenHashMapWritable m1 = new Int2IntOpenHashMapWritable();\n\n m1.put(1, 2);\n m1.put(2, 1);\n m1.put(3, 3);\n\n Int2IntOpenHashMapWritable m2 = new Int2IntOpenHashMapWritable();\n\n m2.put(1, 1);\n m2.put(2, 4);\n m2.put(... | {
"fields": [
{
"declarator": "serialVersionUID = 1255879065743242L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1255879065743242L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_DECODE... | {
"body": "public long dot(Int2IntOpenHashMapWritable m) {\n int s = 0;\n\n for (Int2IntMap.Entry e : m.int2IntEntrySet()) {\n int key = e.getIntKey();\n\n if (this.containsKey(key)) {\n s += this.get(key) * e.getIntValue();\n }\n }\n\n return s;\n }",
"class_method_signature": "I... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_125 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapKFTest.java",
"identifier": "HMapKFTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIncrement() {\n HMapKF<String> m = new HMapKF<String>();\n assertEquals(0.0f, m.get(\"one\"), 10E-6);\n\n m.increment(\"one\", 0.5f);\n assertEquals(0.5f, m.get(\"one\"), 10E-6);\n\n m.increment(\"one\", 1.0f);\n m.increment(\"two\", 0.0f);\n m.increment(\"thre... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void increment(K key) {\n if (this.containsKey(key)) {\n this.put(key, (float) this.get(key) + 1.0f);\n } else {\n this.put(key, 1.0f);\n }\n }",
"class_method_signature": "HMapKF.increment(K key)",
"constructor": false,
"full_signature": "@Override public void... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_8 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2LongOpenHashMapWritableTest.java",
"identifier": "Int2LongOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIncrement() throws IOException {\n Int2LongOpenHashMapWritable m = new Int2LongOpenHashMapWritable();\n\n m.put(2, 7L);\n m.put(1, 29L);\n\n assertEquals(7L, m.get(2));\n assertEquals(29L, m.get(1));\n\n m.increment(2);\n m.increment(1);\n m.increment(3);\n\... | {
"fields": [
{
"declarator": "serialVersionUID = 1029363828020488531L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1029363828020488531L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_... | {
"body": "public void increment(int key) {\n increment(key, 1);\n }",
"class_method_signature": "Int2LongOpenHashMapWritable.increment(int key)",
"constructor": false,
"full_signature": "public void increment(int key)",
"identifier": "increment",
"invocations": [
"increment"
],
"modifiers": "pu... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_51 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "int neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "int",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/test... | {
"body": "@Test\n public void testCompare() {\n ArrayListOfIntsWritable a = new ArrayListOfIntsWritable();\n a.add(one).add(three).add(five);\n\n ArrayListOfIntsWritable b = new ArrayListOfIntsWritable();\n\n // [1,3,5] < [1,3,5,7]\n b.add(one).add(three).add(five).add(seven);\n assertTrue(b.compa... | {
"fields": [],
"file": "lintools-datatypes/src/main/java/tl/lin/data/array/ArrayListOfIntsWritable.java",
"identifier": "ArrayListOfIntsWritable",
"interfaces": "implements\n WritableComparable<ArrayListOfIntsWritable>",
"methods": [
{
"class_method_signature": "ArrayListOfIntsWritable.ArrayList... | {
"body": "@Override\n public int compareTo(ArrayListOfIntsWritable obj) {\n ArrayListOfIntsWritable other = (ArrayListOfIntsWritable) obj;\n if (isEmpty()) {\n if (other.isEmpty()) {\n return 0;\n } else {\n return -1;\n }\n }\n\n for (int i = 0; i < size(); i++) {\n if... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_138 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIFTest.java",
"identifier": "HMapIFTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDot() throws IOException {\n HMapIF m1 = new HMapIF();\n\n m1.put(1, 2.3f);\n m1.put(2, 1.9f);\n m1.put(3, 3.0f);\n\n HMapIF m2 = new HMapIF();\n\n m2.put(1, 1.2f);\n m2.put(2, 4.3f);\n m2.put(4, 5.0f);\n\n assertEquals(10.93, m1.dot(m2), 10e-6);\n }",
... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public double dot(MapIF m) {\n double s = 0.0f;\n\n for (MapIF.Entry e : m.entrySet()) {\n int key = e.getKey();\n\n if (this.containsKey(key)) {\n s += this.get(key) * e.getValue();\n }\n }\n\n return s;\n }",
"class_method_signature": "HMapIF.dot(MapIF m)... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_47 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "float neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "float",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testSort() {\n ArrayListOfFloats a = new ArrayListOfFloats();\n assertEquals(0, a.size());\n\n a.add(5.2f).add(6f).add(5.9f).add(4.1f);\n assertEquals(4, a.size());\n\n a.sort();\n assertEquals(4, a.size());\n\n assertTrue(Math.abs(a.get(0) - 4.1) < 0.0001);\n a... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient float[] array;",
"type": "float[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected in... | {
"body": "public void sort() {\n trimToSize();\n Arrays.sort(getArray());\n }",
"class_method_signature": "ArrayListOfFloats.sort()",
"constructor": false,
"full_signature": "public void sort()",
"identifier": "sort",
"invocations": [
"trimToSize",
"sort",
"getArray"
],
"modifiers": ... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_10 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2LongOpenHashMapWritableTest.java",
"identifier": "Int2LongOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testLazyPlus() throws IOException {\n Int2LongOpenHashMapWritable m1 = new Int2LongOpenHashMapWritable();\n\n m1.put(1, 5L);\n m1.put(2, 22L);\n\n Int2LongOpenHashMapWritable m2 = new Int2LongOpenHashMapWritable();\n\n m2.put(1, 4L);\n m2.put(3, 5L);\n\n Int2LongOp... | {
"fields": [
{
"declarator": "serialVersionUID = 1029363828020488531L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1029363828020488531L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_... | {
"body": "public void lazyplus(Int2LongOpenHashMapWritable m) {\n int[] k = m.getKeys();\n long[] v = m.getValues();\n\n for (int i = 0; i < k.length; i++) {\n if (this.containsKey(k[i])) {\n this.put(k[i], this.get(k[i]) + v[i]);\n } else {\n this.put(k[i], v[i]);\n }\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_114 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapKITest.java",
"identifier": "HMapKITest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDot() throws IOException {\n HMapKI<Text> m1 = new HMapKI<Text>();\n\n m1.put(new Text(\"hi\"), 5);\n m1.put(new Text(\"there\"), 2);\n m1.put(new Text(\"empty\"), 3);\n\n HMapKI<Text> m2 = new HMapKI<Text>();\n\n m2.put(new Text(\"hi\"), 4);\n m2.put(new Text(... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public long dot(MapKI<K> m) {\n int s = 0;\n\n for (MapKI.Entry<K> e : m.entrySet()) {\n K key = e.getKey();\n\n if (this.containsKey(key)) {\n s += this.get(key) * e.getValue();\n }\n }\n\n return s;\n }",
"class_method_signature": "HMapKI.dot(MapKI<K> m)"... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_84 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "short neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "short",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testSort() {\n ArrayListOfShorts a = new ArrayListOfShorts();\n assertEquals(0, a.size());\n\n a.add((short) 5);\n a.add((short) 6);\n a.add((short) 1);\n a.add((short) 4);\n assertEquals(4, a.size());\n\n a.sort();\n assertEquals(4, a.size());\n\n assertE... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient short[] array;",
"type": "short[]",
"var_name": "array"
},
{
"declarator": "size",
"modifier": "protected",
"original_string": "protected int si... | {
"body": "public void sort() {\n trimToSize();\n Arrays.sort(getArray());\n }",
"class_method_signature": "ArrayListOfShorts.sort()",
"constructor": false,
"full_signature": "public void sort()",
"identifier": "sort",
"invocations": [
"trimToSize",
"sort",
"getArray"
],
"modifiers": ... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_102 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIITest.java",
"identifier": "HMapIITest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPlus() throws IOException {\n HMapII m1 = new HMapII();\n\n m1.put(1, 5);\n m1.put(2, 22);\n\n HMapII m2 = new HMapII();\n\n m2.put(1, 4);\n m2.put(3, 5);\n\n m1.plus(m2);\n\n assertEquals(m1.size(), 3);\n assertTrue(m1.get(1) == 9);\n assertTrue(m1.ge... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void plus(MapII m) {\n for (MapII.Entry e : m.entrySet()) {\n int key = e.getKey();\n\n if (this.containsKey(key)) {\n this.put(key, this.get(key) + e.getValue());\n } else {\n this.put(key, e.getValue());\n }\n }\n }",
"class_method_signature"... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_92 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "long neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "long",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/te... | {
"body": "@Test\n public void testIterable() {\n int size = 1000;\n Random r = new Random();\n long[] longs = new long[size];\n\n ArrayListOfLongs list = new ArrayListOfLongs();\n for (int i = 0; i < size; i++) {\n long k = r.nextLong();\n list.add(k);\n longs[i] = k;\n }\n\n int... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient long[] array;",
"type": "long[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected int ... | {
"body": "public ArrayListOfLongs add(long e) {\n ensureCapacity(size + 1); // Increments modCount!!\n array[size++] = e;\n return this;\n }",
"class_method_signature": "ArrayListOfLongs.add(long e)",
"constructor": false,
"full_signature": "public ArrayListOfLongs add(long e)",
"identifier": "add"... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_4 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2IntOpenHashMapWritableTest.java",
"identifier": "Int2IntOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortedEntries1() {\n Int2IntOpenHashMapWritable m = new Int2IntOpenHashMapWritable();\n\n m.put(1, 5);\n m.put(2, 2);\n m.put(3, 3);\n m.put(4, 3);\n m.put(5, 1);\n\n Int2IntMap.Entry[] e = m.getEntriesSortedByValue();\n assertEquals(5, e.length);\n\n ass... | {
"fields": [
{
"declarator": "serialVersionUID = 1255879065743242L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1255879065743242L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_DECODE... | {
"body": "public Int2IntMap.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n Int2IntMap.Entry[] entries = new Int2IntMap.Entry[this.size()];\n entries = this.int2IntEntrySet().toArray(entries);\n\n // sort the entries\n Arrays.sort(entries, new Comparator<Int2IntMap.... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_122 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapILTest.java",
"identifier": "HMapILTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortedEntries4() {\n HMapIL m = new HMapIL();\n\n MapIL.Entry[] e = m.getEntriesSortedByValue();\n assertTrue(e == null);\n }",
"class_method_signature": "HMapILTest.testSortedEntries4()",
"constructor": false,
"full_signature": "@Test public void testSortedEntries4... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "public MapIL.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n // for storing the entries\n MapIL.Entry[] entries = new Entry[this.size()];\n int i = 0;\n Entry next = null;\n\n int index = 0;\n // advance to first entry\n while (index < table.lengt... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_134 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapKLTest.java",
"identifier": "HMapKLTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPlus() throws IOException {\n HMapKL<String> m1 = new HMapKL<String>();\n\n m1.put(\"1\", Integer.MAX_VALUE + 5L);\n m1.put(\"2\", Integer.MAX_VALUE + 22L);\n m1.put(\"\" + Integer.MAX_VALUE, Integer.MAX_VALUE);\n\n HMapKL<String> m2 = new HMapKL<String>();\n\n m2... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void plus(MapKL<K> m) {\n for (MapKL.Entry<K> e : m.entrySet()) {\n K key = e.getKey();\n\n if (this.containsKey(key)) {\n this.put(key, (long) (this.get(key) + e.getValue()));\n } else {\n this.put(key, e.getValue());\n }\n }\n }",
"class_meth... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_88 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "long neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "long",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/te... | {
"body": "@Test\n public void testArrayConstructor() {\n long[] arr = new long[] { 1, 2, 3, 4, 5 };\n assertEquals(5, arr.length);\n\n ArrayListOfLongs list = new ArrayListOfLongs(arr);\n list.remove(2);\n\n // Make sure the original array remains untouched.\n assertEquals(1, arr[0]);\n assertE... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient long[] array;",
"type": "long[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected int ... | {
"body": "public long remove(int index) {\n if (index >= size) {\n throw new ArrayIndexOutOfBoundsException();\n }\n long oldValue = array[index];\n\n int numMoved = size - index - 1;\n if (numMoved > 0) {\n System.arraycopy(array, index + 1, array, index, numMoved);\n }\n\n size--;\n ... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_67 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "double neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "double",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/sr... | {
"body": "@Test\n public void testRemove() {\n ArrayListOfDoubles list = new ArrayListOfDoubles();\n for (int i = 0; i < 10; i++) {\n list.add((double) i);\n }\n\n list.remove(list.indexOf(5.0));\n assertEquals(9, list.size());\n assertEquals(0.0, list.get(0), 10e-6);\n assertEquals(1.0, l... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient double[] array;",
"type": "double[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected ... | {
"body": "public double remove(int index) {\n if (index >= size) {\n throw new ArrayIndexOutOfBoundsException();\n }\n double oldValue = array[index];\n\n int numMoved = size - index - 1;\n if (numMoved > 0) {\n System.arraycopy(array, index + 1, array, index, numMoved);\n }\n\n size--... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_118 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIIWTest.java",
"identifier": "HMapIIWTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBasic() throws IOException {\n HMapIIW m = new HMapIIW();\n\n m.put(2, 5);\n m.put(1, 22);\n\n int value;\n\n assertEquals(m.size(), 2);\n\n value = m.get(2);\n assertEquals(5, value);\n\n value = m.remove(2);\n assertEquals(m.size(), 1);\n\n value = m... | {
"fields": [
{
"declarator": "LazyDecode = false",
"modifier": "private static",
"original_string": "private static boolean LazyDecode = false;",
"type": "boolean",
"var_name": "LazyDecode"
},
{
"declarator": "serialVersionUID = 3801790315L",
"modifier": "private... | {
"body": "@Override\n public int size() {\n if (!isDecoded()) {\n return keys.length;\n }\n\n return super.size();\n }",
"class_method_signature": "HMapIIW.size()",
"constructor": false,
"full_signature": "@Override public int size()",
"identifier": "size",
"invocations": [
"isDecoded",... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_30 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/pair/PairOfStringsTest.java",
"identifier": "PairOfStringsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testHashCode() throws IOException {\n // Confirm that we can add both (x, y) and (y, x)\n PairOfStrings pair1 = new PairOfStrings(\"hi\", \"there\");\n PairOfStrings pair2 = new PairOfStrings(\"there\", \"hi\");\n PairOfStrings pair3 = new PairOfStrings(\"hello\", \"world\"... | {
"fields": [
{
"declarator": "leftElement",
"modifier": "private",
"original_string": "private String leftElement, rightElement;",
"type": "String",
"var_name": "leftElement"
}
],
"file": "lintools-datatypes/src/main/java/tl/lin/data/pair/PairOfStrings.java",
"identifier":... | {
"body": "public int hashCode() {\n // Make sure we can add both (x, y) and (y, x)\n return Objects.hash(leftElement, rightElement);\n }",
"class_method_signature": "PairOfStrings.hashCode()",
"constructor": false,
"full_signature": "public int hashCode()",
"identifier": "hashCode",
"invocations": [... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_26 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/pair/PairOfStringFloatTest.java",
"identifier": "PairOfStringFloatTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testComparison2() throws IOException {\n WritableComparator comparator = new PairOfStringFloat.Comparator();\n\n PairOfStringFloat pair1 = new PairOfStringFloat(\"hi\", 1.0f);\n PairOfStringFloat pair2 = new PairOfStringFloat(\"hi\", 1.0f);\n PairOfStringFloat pair3 = new P... | {
"fields": [
{
"declarator": "leftElement",
"modifier": "private",
"original_string": "private String leftElement;",
"type": "String",
"var_name": "leftElement"
},
{
"declarator": "rightElement",
"modifier": "private",
"original_string": "private float righ... | {
"body": "@Override\n public boolean equals(Object obj) {\n PairOfStringFloat pair = (PairOfStringFloat) obj;\n return leftElement.equals(pair.getLeftElement()) && rightElement == pair.getRightElement();\n }",
"class_method_signature": "PairOfStringFloat.equals(Object obj)",
"constructor": false,
"full... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_71 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "double neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "double",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/sr... | {
"body": "@Test\n public void testSetSize() {\n ArrayListOfDoubles list = new ArrayListOfDoubles();\n\n list.add(5);\n assertEquals(1, list.size);\n assertEquals(5, list.get(0), 10e-6);\n\n list.setSize(5);\n assertEquals(5, list.size);\n assertEquals(0, list.get(1), 10e-6);\n assertEquals(0... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient double[] array;",
"type": "double[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected ... | {
"body": "public void setSize(int sz) {\n ensureCapacity(sz);\n size = sz;\n }",
"class_method_signature": "ArrayListOfDoubles.setSize(int sz)",
"constructor": false,
"full_signature": "public void setSize(int sz)",
"identifier": "setSize",
"invocations": [
"ensureCapacity"
],
"modifiers": "... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_70 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "double neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "double",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/sr... | {
"body": "@Test\n public void testIterable() {\n int size = 1000;\n Random r = new Random();\n double[] doubles = new double[size];\n\n ArrayListOfDoubles list = new ArrayListOfDoubles();\n for (int i = 0; i < size; i++) {\n double k = r.nextDouble();\n list.add(k);\n doubles[i] = k;\n... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient double[] array;",
"type": "double[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected ... | {
"body": "public ArrayListOfDoubles add(double e) {\n ensureCapacity(size + 1); // Increments modCount!!\n array[size++] = e;\n return this;\n }",
"class_method_signature": "ArrayListOfDoubles.add(double e)",
"constructor": false,
"full_signature": "public ArrayListOfDoubles add(double e)",
"identi... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_27 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/pair/PairOfStringLongTest.java",
"identifier": "PairOfStringLongTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testComparison2() throws IOException {\n WritableComparator comparator = new PairOfStringLong.Comparator();\n\n PairOfStringLong pair1 = new PairOfStringLong(\"hi\", 1L);\n PairOfStringLong pair2 = new PairOfStringLong(\"hi\", 1L);\n PairOfStringLong pair3 = new PairOfStrin... | {
"fields": [
{
"declarator": "leftElement",
"modifier": "private",
"original_string": "private String leftElement;",
"type": "String",
"var_name": "leftElement"
},
{
"declarator": "rightElement",
"modifier": "private",
"original_string": "private long right... | {
"body": "public boolean equals(Object obj) {\n PairOfStringLong pair = (PairOfStringLong) obj;\n return leftElement.equals(pair.getLeftElement()) && rightElement == pair.getRightElement();\n }",
"class_method_signature": "PairOfStringLong.equals(Object obj)",
"constructor": false,
"full_signature": "pu... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_31 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/JsonWritableTest.java",
"identifier": "JsonWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSerialize() throws Exception {\n JsonWritable w = new JsonWritable();\n JsonObject obj = w.getJsonObject();\n\n obj.addProperty(\"firstName\", \"John\");\n obj.addProperty(\"lastName\", \"Smith\");\n\n JsonObject address = new JsonObject();\n address.addProperty(\... | {
"fields": [
{
"declarator": "GSON = new Gson()",
"modifier": "private static final",
"original_string": "private static final Gson GSON = new Gson();",
"type": "Gson",
"var_name": "GSON"
},
{
"declarator": "PARSER = new JsonParser()",
"modifier": "private static... | {
"body": "public byte[] serialize() throws IOException {\n ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();\n DataOutputStream dataOut = new DataOutputStream(bytesOut);\n write(dataOut);\n\n return bytesOut.toByteArray();\n }",
"class_method_signature": "JsonWritable.serialize()",
"cons... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_119 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapILTest.java",
"identifier": "HMapILTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPlus() throws IOException {\n HMapIL m1 = new HMapIL();\n\n m1.put(1, Integer.MAX_VALUE + 5L);\n m1.put(2, Integer.MAX_VALUE + 22L);\n m1.put(Integer.MAX_VALUE, Integer.MAX_VALUE);\n\n HMapIL m2 = new HMapIL();\n\n m2.put(1, 4L);\n m2.put(3, Integer.MAX_VALUE +... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void plus(MapIL m) {\n for (MapIL.Entry e : m.entrySet()) {\n int key = e.getKey();\n\n if (this.containsKey(key)) {\n this.put(key, this.get(key) + e.getValue());\n } else {\n this.put(key, e.getValue());\n }\n }\n }",
"class_method_signature"... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_89 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "long neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "long",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/te... | {
"body": "@Test\n public void testRemove() {\n ArrayListOfLongs list = new ArrayListOfLongs();\n for (int i = 0; i < 10; i++) {\n list.add(i);\n }\n\n list.remove(list.indexOf(5));\n assertEquals(9, list.size());\n assertEquals(0, list.get(0));\n assertEquals(1, list.get(1));\n assertEq... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient long[] array;",
"type": "long[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected int ... | {
"body": "public long remove(int index) {\n if (index >= size) {\n throw new ArrayIndexOutOfBoundsException();\n }\n long oldValue = array[index];\n\n int numMoved = size - index - 1;\n if (numMoved > 0) {\n System.arraycopy(array, index + 1, array, index, numMoved);\n }\n\n size--;\n ... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_66 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "double neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "double",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/sr... | {
"body": "@Test\n public void testArrayConstructor() {\n double[] arr = new double[] { 1.0, 2.0, 3.0, 4.0, 5.0 };\n assertEquals(5, arr.length);\n\n ArrayListOfDoubles list = new ArrayListOfDoubles(arr);\n list.remove(2);\n\n // Make sure the original array remains untouched.\n assertEquals(1.0, a... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient double[] array;",
"type": "double[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected ... | {
"body": "public double remove(int index) {\n if (index >= size) {\n throw new ArrayIndexOutOfBoundsException();\n }\n double oldValue = array[index];\n\n int numMoved = size - index - 1;\n if (numMoved > 0) {\n System.arraycopy(array, index + 1, array, index, numMoved);\n }\n\n size--... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_135 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapKLTest.java",
"identifier": "HMapKLTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDot() throws IOException {\n HMapKL<String> m1 = new HMapKL<String>();\n\n m1.put(\"1\", 2L);\n m1.put(\"2\", 1L);\n m1.put(\"3\", 3L);\n m1.put(\"\" + Integer.MAX_VALUE, (long) Integer.MAX_VALUE);\n\n HMapKL<String> m2 = new HMapKL<String>();\n\n m2.put(\"1\",... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public long dot(MapKL<K> m) {\n long s = 0;\n\n for (MapKL.Entry<K> e : m.entrySet()) {\n K key = e.getKey();\n\n if (this.containsKey(key)) {\n s += this.get(key) * e.getValue();\n }\n }\n\n return s;\n }",
"class_method_signature": "HMapKL.dot(MapKL<K> m)... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_5 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2IntOpenHashMapWritableTest.java",
"identifier": "Int2IntOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortedEntries2() {\n Int2IntOpenHashMapWritable m = new Int2IntOpenHashMapWritable();\n\n m.put(1, 5);\n m.put(2, 2);\n m.put(3, 3);\n m.put(4, 3);\n m.put(5, 1);\n\n Int2IntMap.Entry[] e = m.getEntriesSortedByValue(2);\n\n assertEquals(2, e.length);\n\n ... | {
"fields": [
{
"declarator": "serialVersionUID = 1255879065743242L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1255879065743242L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_DECODE... | {
"body": "public Int2IntMap.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n Int2IntMap.Entry[] entries = new Int2IntMap.Entry[this.size()];\n entries = this.int2IntEntrySet().toArray(entries);\n\n // sort the entries\n Arrays.sort(entries, new Comparator<Int2IntMap.... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_123 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapKFTest.java",
"identifier": "HMapKFTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPlus() throws IOException {\n HMapKF<Text> m1 = new HMapKF<Text>();\n\n m1.put(new Text(\"hi\"), 5.0f);\n m1.put(new Text(\"there\"), 22.0f);\n\n HMapKF<Text> m2 = new HMapKF<Text>();\n\n m2.put(new Text(\"hi\"), 4.0f);\n m2.put(new Text(\"test\"), 5.0f);\n\n m... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void plus(MapKF<K> m) {\n for (MapKF.Entry<K> e : m.entrySet()) {\n K key = e.getKey();\n\n if (this.containsKey(key)) {\n this.put(key, this.get(key) + e.getValue());\n } else {\n this.put(key, e.getValue());\n }\n }\n }",
"class_method_signat... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_93 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "long neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "long",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/te... | {
"body": "@Test\n public void testSetSize() {\n ArrayListOfLongs list = new ArrayListOfLongs();\n\n list.add(5L);\n assertEquals(1, list.size);\n assertEquals(5L, list.get(0));\n\n list.setSize(5);\n assertEquals(5L, list.size);\n assertEquals(0, list.get(1));\n assertEquals(0, list.get(2));... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient long[] array;",
"type": "long[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected int ... | {
"body": "public void setSize(int sz) {\n ensureCapacity(sz);\n size = sz;\n }",
"class_method_signature": "ArrayListOfLongs.setSize(int sz)",
"constructor": false,
"full_signature": "public void setSize(int sz)",
"identifier": "setSize",
"invocations": [
"ensureCapacity"
],
"modifiers": "pu... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_103 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIITest.java",
"identifier": "HMapIITest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDot() throws IOException {\n HMapII m1 = new HMapII();\n\n m1.put(1, 2);\n m1.put(2, 1);\n m1.put(3, 3);\n\n HMapII m2 = new HMapII();\n\n m2.put(1, 1);\n m2.put(2, 4);\n m2.put(4, 5);\n\n assertEquals(6, m1.dot(m2));\n }",
"class_method_signature": "H... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public long dot(MapII m) {\n int s = 0;\n\n for (MapII.Entry e : m.entrySet()) {\n int key = e.getKey();\n\n if (this.containsKey(key)) {\n s += this.get(key) * e.getValue();\n }\n }\n\n return s;\n }",
"class_method_signature": "HMapII.dot(MapII m)",
"co... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_85 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "short neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "short",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testSubList() {\n ArrayListOfShorts a = new ArrayListOfShorts(new short[] { 1, 2, 3, 4, 5, 6, 7 });\n ArrayListOfShorts b = a.subList(1, 5);\n assertEquals(5, b.size());\n assertEquals(2, b.get(0));\n assertEquals(3, b.get(1));\n assertEquals(4, b.get(2));\n assert... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient short[] array;",
"type": "short[]",
"var_name": "array"
},
{
"declarator": "size",
"modifier": "protected",
"original_string": "protected int si... | {
"body": "public ArrayListOfShorts subList(int start, int end) {\n ArrayListOfShorts sublst = new ArrayListOfShorts(end - start + 1);\n for (int i = start; i <= end; i++) {\n sublst.add(get(i));\n }\n return sublst;\n }",
"class_method_signature": "ArrayListOfShorts.subList(int start, int end)",
... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_115 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapKITest.java",
"identifier": "HMapKITest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIncrement() {\n HMapKI<String> m = new HMapKI<String>();\n assertEquals(0, m.get(\"one\"));\n\n m.increment(\"one\");\n assertEquals(1, m.get(\"one\"));\n\n m.increment(\"one\", 5);\n m.increment(\"two\", 0);\n m.increment(\"three\", 2);\n\n assertEquals(6, ... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void increment(K key) {\n if (this.containsKey(key)) {\n this.put(key, this.get(key) + 1);\n } else {\n this.put(key, 1);\n }\n }",
"class_method_signature": "HMapKI.increment(K key)",
"constructor": false,
"full_signature": "@Override public void increment(K k... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_11 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2LongOpenHashMapWritableTest.java",
"identifier": "Int2LongOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDot() throws IOException {\n Int2LongOpenHashMapWritable m1 = new Int2LongOpenHashMapWritable();\n\n m1.put(1, 2L);\n m1.put(2, 1L);\n m1.put(3, 3L);\n\n Int2LongOpenHashMapWritable m2 = new Int2LongOpenHashMapWritable();\n\n m2.put(1, 1L);\n m2.put(2, 4L);\n ... | {
"fields": [
{
"declarator": "serialVersionUID = 1029363828020488531L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1029363828020488531L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_... | {
"body": "public long dot(Int2LongOpenHashMapWritable m) {\n int s = 0;\n\n for (Int2LongMap.Entry e : m.int2LongEntrySet()) {\n int key = e.getIntKey();\n\n if (this.containsKey(key)) {\n s += this.get(key) * e.getLongValue();\n }\n }\n\n return s;\n }",
"class_method_signature"... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_46 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "float neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "float",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testSetSize() {\n ArrayListOfFloats list = new ArrayListOfFloats();\n\n list.add(5.0f);\n assertEquals(1, list.size);\n assertEquals(5.0f, list.get(0), 10e-6);\n\n list.setSize(5);\n assertEquals(5, list.size);\n assertEquals(0.0f, list.get(1), 10e-6);\n assertE... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient float[] array;",
"type": "float[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected in... | {
"body": "public void setSize(int sz) {\n ensureCapacity(sz);\n size = sz;\n }",
"class_method_signature": "ArrayListOfFloats.setSize(int sz)",
"constructor": false,
"full_signature": "public void setSize(int sz)",
"identifier": "setSize",
"invocations": [
"ensureCapacity"
],
"modifiers": "p... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_139 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIFTest.java",
"identifier": "HMapIFTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIncrement() {\n HMapIF m = new HMapIF();\n assertEquals(0.0f, m.get(1), 10E-6);\n\n m.increment(1, 0.5f);\n assertEquals(0.5f, m.get(1), 10E-6);\n\n m.increment(1);\n m.increment(2, 0.0f);\n m.increment(3, -0.5f);\n\n assertEquals(1.5f, m.get(1), 10E-6);\n ... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void increment(int key) {\n if (this.containsKey(key)) {\n this.put(key, (float) this.get(key) + 1.0f);\n } else {\n this.put(key, 1.0f);\n }\n }",
"class_method_signature": "HMapIF.increment(int key)",
"constructor": false,
"full_signature": "@Override public ... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_50 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "int neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "int",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/test... | {
"body": "@Test\n public void testToString() {\n assertEquals(\"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", new ArrayListOfIntsWritable(1, 11).toString());\n assertEquals(\"[1, 2, 3, 4, 5 ... (5 more) ]\", new ArrayListOfIntsWritable(1, 11).toString(5));\n\n assertEquals(\"[1, 2, 3, 4, 5]\", new ArrayListOfIntsWrit... | {
"fields": [],
"file": "lintools-datatypes/src/main/java/tl/lin/data/array/ArrayListOfIntsWritable.java",
"identifier": "ArrayListOfIntsWritable",
"interfaces": "implements\n WritableComparable<ArrayListOfIntsWritable>",
"methods": [
{
"class_method_signature": "ArrayListOfIntsWritable.ArrayList... | {
"body": "@Override\n public String toString() {\n return toString(size());\n }",
"class_method_signature": "ArrayListOfIntsWritable.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"invocations": [
"toString",
"size"
],
"... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_9 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2LongOpenHashMapWritableTest.java",
"identifier": "Int2LongOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPlus() throws IOException {\n Int2LongOpenHashMapWritable m1 = new Int2LongOpenHashMapWritable();\n\n m1.put(1, 5L);\n m1.put(2, 22L);\n\n Int2LongOpenHashMapWritable m2 = new Int2LongOpenHashMapWritable();\n\n m2.put(1, 4L);\n m2.put(3, 5L);\n\n m1.plus(m2);\n... | {
"fields": [
{
"declarator": "serialVersionUID = 1029363828020488531L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1029363828020488531L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_... | {
"body": "public void plus(Int2LongOpenHashMapWritable m) {\n for (Int2LongMap.Entry e : m.int2LongEntrySet()) {\n int key = e.getIntKey();\n long value = e.getLongValue();\n\n if (this.containsKey(key)) {\n this.put(key, this.get(key) + value);\n } else {\n this.put(key, value);... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_90 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "long neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "long",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/te... | {
"body": "@Test\n public void testClone() {\n int size = 100000;\n Random r = new Random();\n long[] longs = new long[size];\n\n ArrayListOfLongs list1 = new ArrayListOfLongs();\n for (int i = 0; i < size; i++) {\n long k = r.nextLong();\n list1.add(k);\n longs[i] = k;\n }\n\n Ar... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient long[] array;",
"type": "long[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected int ... | {
"body": "public ArrayListOfLongs clone() {\n return new ArrayListOfLongs(Arrays.copyOf(array, this.size()));\n }",
"class_method_signature": "ArrayListOfLongs.clone()",
"constructor": false,
"full_signature": "public ArrayListOfLongs clone()",
"identifier": "clone",
"invocations": [
"copyOf",
... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_100 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/array/ArrayListWritableTest.java",
"identifier": "ArrayListWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBasic() throws IOException {\n ArrayListWritable<Text> list = new ArrayListWritable<Text>();\n\n list.add(new Text(\"hi\"));\n list.add(new Text(\"there\"));\n\n assertEquals(list.get(0).toString(), \"hi\");\n assertEquals(list.get(1).toString(), \"there\");\n }",
... | {
"fields": [
{
"declarator": "serialVersionUID = 4911321393319821791L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 4911321393319821791L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "lintools-datatype... | {
"body": "public String toString() {\n StringBuffer sb = new StringBuffer();\n sb.append(\"[\");\n for (int i = 0; i < this.size(); i++) {\n if (i != 0)\n sb.append(\", \");\n sb.append(this.get(i));\n }\n sb.append(\"]\");\n\n return sb.toString();\n }",
"class_method_signature... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_28 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/pair/PairOfLongStringTest.java",
"identifier": "PairOfLongStringTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testComparison2() throws IOException {\n WritableComparator comparator = new PairOfLongString.Comparator();\n\n PairOfLongString pair1 = new PairOfLongString(1L, \"hi\");\n PairOfLongString pair2 = new PairOfLongString(1L, \"hi\");\n PairOfLongString pair3 = new PairOfLongS... | {
"fields": [
{
"declarator": "leftElement",
"modifier": "private",
"original_string": "private long leftElement;",
"type": "long",
"var_name": "leftElement"
},
{
"declarator": "rightElement",
"modifier": "private",
"original_string": "private String rightEl... | {
"body": "@Override\n public boolean equals(Object obj) {\n PairOfLongString pair = (PairOfLongString) obj;\n return rightElement.equals(pair.getRightElement()) && leftElement == pair.getLeftElement();\n }",
"class_method_signature": "PairOfLongString.equals(Object obj)",
"constructor": false,
"full_si... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_69 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "double neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "double",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/sr... | {
"body": "@Test\n public void testToString() {\n int size = 10;\n Random r = new Random();\n\n ArrayListOfDoubles list = new ArrayListOfDoubles();\n for (int i = 0; i < size; i++) {\n list.add(r.nextDouble());\n }\n\n String out = list.toString();\n for (int i = 0; i < size; i++) {\n ... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient double[] array;",
"type": "double[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected ... | {
"body": "public String toString(int n) {\n StringBuilder s = new StringBuilder();\n\n s.append(\"[\");\n int sz = size() > n ? n : size;\n\n for (int i = 0; i < sz; i++) {\n s.append(get(i));\n if (i < sz - 1) {\n s.append(\", \");\n }\n }\n\n s.append(size() > n ? String.for... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_86 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "short neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "short",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testAddUnique() {\n ArrayListOfShorts a = new ArrayListOfShorts(new short[] { 1, 2, 3, 4, 5, 6, 7 });\n a.addUnique(new short[] { 8, 0, 2, 5, -1, 11, 9 });\n assertEquals(12, a.size());\n assertEquals(0, a.get(8));\n assertEquals(-1, a.get(9));\n assertEquals(11, a.ge... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient short[] array;",
"type": "short[]",
"var_name": "array"
},
{
"declarator": "size",
"modifier": "protected",
"original_string": "protected int si... | {
"body": "public void addUnique(short[] arr) {\n for (int i = 0; i < arr.length; i++) {\n short elt = arr[i];\n if (!contains(elt)) {\n add(elt);\n }\n }\n }",
"class_method_signature": "ArrayListOfShorts.addUnique(short[] arr)",
"constructor": false,
"full_signature": "public void... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_116 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapKITest.java",
"identifier": "HMapKITest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToString() throws IOException {\n HMapKI<String> m1 = new HMapKI<String>();\n\n m1.put(\"hi\", 5);\n m1.put(\"there\", 22);\n\n assertEquals(\"{there=22, hi=5}\", m1.toString());\n }",
"class_method_signature": "HMapKITest.testToString()",
"constructor": false,
"... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public String toString() {\n Iterator<MapKI.Entry<K>> i = entrySet().iterator();\n if (!i.hasNext())\n return \"{}\";\n\n StringBuilder sb = new StringBuilder();\n sb.append('{');\n for (;;) {\n MapKI.Entry<K> e = i.next();\n K key = e.getKey();\n int value =... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_12 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2LongOpenHashMapWritableTest.java",
"identifier": "Int2LongOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortedEntries1() {\n Int2LongOpenHashMapWritable m = new Int2LongOpenHashMapWritable();\n\n m.put(1, 5L);\n m.put(2, 2L);\n m.put(3, 3L);\n m.put(4, 3L);\n m.put(5, 1L);\n\n Int2LongMap.Entry[] e = m.getEntriesSortedByValue();\n assertEquals(5, e.length);\n\... | {
"fields": [
{
"declarator": "serialVersionUID = 1029363828020488531L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1029363828020488531L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_... | {
"body": "public Int2LongMap.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n Int2LongMap.Entry[] entries = new Int2LongMap.Entry[this.size()];\n entries = this.int2LongEntrySet().toArray(entries);\n\n // sort the entries\n Arrays.sort(entries, new Comparator<Int2Lon... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_45 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "float neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "float",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testIterable() {\n int size = 1000;\n Random r = new Random();\n float[] floats = new float[size];\n\n ArrayListOfFloats list = new ArrayListOfFloats();\n for (int i = 0; i < size; i++) {\n float k = r.nextFloat();\n list.add(k);\n floats[i] = k;\n }\n\... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient float[] array;",
"type": "float[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected in... | {
"body": "public ArrayListOfFloats add(float e) {\n ensureCapacity(size + 1); // Increments modCount!!\n array[size++] = e;\n return this;\n }",
"class_method_signature": "ArrayListOfFloats.add(float e)",
"constructor": false,
"full_signature": "public ArrayListOfFloats add(float e)",
"identifier":... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_53 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "double neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "double",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/sr... | {
"body": "@Test\n public void testCompare() {\n ArrayListOfDoublesWritable a = new ArrayListOfDoublesWritable();\n a.add(one).add(three).add(five);\n\n ArrayListOfDoublesWritable b = new ArrayListOfDoublesWritable();\n\n // [1,3,5] < [1,3,5,7]\n b.add(one).add(three).add(five).add(seven);\n assert... | {
"fields": [],
"file": "lintools-datatypes/src/main/java/tl/lin/data/array/ArrayListOfDoublesWritable.java",
"identifier": "ArrayListOfDoublesWritable",
"interfaces": "implements\n WritableComparable<ArrayListOfDoublesWritable>",
"methods": [
{
"class_method_signature": "ArrayListOfDoublesWritab... | {
"body": "@Override\n public int compareTo(ArrayListOfDoublesWritable obj) {\n ArrayListOfDoublesWritable other = (ArrayListOfDoublesWritable) obj;\n if (isEmpty()) {\n if (other.isEmpty()) {\n return 0;\n } else {\n return -1;\n }\n }\n\n for (int i = 0; i < size(); i++) {\... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_73 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "double neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "double",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/sr... | {
"body": "@Test\n public void testSubList() {\n ArrayListOfDoubles a = new ArrayListOfDoubles(new double[] { 1, 2, 3, 4, 5, 6, 7 });\n ArrayListOfDoubles c = a.subList(1, 5);\n assertEquals(5, c.size());\n assertTrue(Math.abs(2 - c.get(0)) < 0.0001);\n assertTrue(Math.abs(3 - c.get(1)) < 0.0001);\n ... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient double[] array;",
"type": "double[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected ... | {
"body": "public ArrayListOfDoubles subList(int start, int end) {\n ArrayListOfDoubles sublst = new ArrayListOfDoubles(end - start + 1);\n for (int i = start; i <= end; i++) {\n sublst.add(get(i));\n }\n return sublst;\n }",
"class_method_signature": "ArrayListOfDoubles.subList(int start, int end... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_24 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/pair/PairOfStringIntTest.java",
"identifier": "PairOfStringIntTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testComparison2() throws IOException {\n WritableComparator comparator = new PairOfStringInt.Comparator();\n\n PairOfStringInt pair1 = new PairOfStringInt(\"hi\", 1);\n PairOfStringInt pair2 = new PairOfStringInt(\"hi\", 1);\n PairOfStringInt pair3 = new PairOfStringInt(\"h... | {
"fields": [
{
"declarator": "leftElement",
"modifier": "private",
"original_string": "private String leftElement;",
"type": "String",
"var_name": "leftElement"
},
{
"declarator": "rightElement",
"modifier": "private",
"original_string": "private int rightE... | {
"body": "public boolean equals(Object obj) {\n PairOfStringInt pair = (PairOfStringInt) obj;\n return leftElement.equals(pair.getLeftElement()) && rightElement == pair.getRightElement();\n }",
"class_method_signature": "PairOfStringInt.equals(Object obj)",
"constructor": false,
"full_signature": "publi... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_32 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/array/ArrayListWritableComparableTest.java",
"identifier": "ArrayListWritableComparableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBasic() throws IOException {\n ArrayListWritableComparable<Text> list = new ArrayListWritableComparable<Text>();\n\n list.add(new Text(\"hi\"));\n list.add(new Text(\"there\"));\n\n assertEquals(list.get(0).toString(), \"hi\");\n assertEquals(list.get(1).toString(), ... | {
"fields": [
{
"declarator": "serialVersionUID = 4911321393319821792L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 4911321393319821792L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "lintools-datatype... | {
"body": "public String toString() {\n StringBuffer sb = new StringBuffer();\n sb.append(\"[\");\n for (int i = 0; i < this.size(); i++) {\n if (i != 0)\n sb.append(\", \");\n sb.append(this.get(i));\n }\n sb.append(\"]\");\n\n return sb.toString();\n }",
"class_method_signature... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_65 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "double neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "double",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/sr... | {
"body": "@Test\n public void testInitialSize() {\n ArrayListOfDoubles a = new ArrayListOfDoubles();\n assertEquals(0, a.size());\n }",
"class_method_signature": "ArrayListOfDoublesTest.testInitialSize()",
"constructor": false,
"full_signature": "@Test public void testInitialSize()",
"identifier": "t... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient double[] array;",
"type": "double[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected ... | {
"body": "public int size() {\n return size;\n }",
"class_method_signature": "ArrayListOfDoubles.size()",
"constructor": false,
"full_signature": "public int size()",
"identifier": "size",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int size()",
... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_136 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapKLTest.java",
"identifier": "HMapKLTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIncrement() {\n HMapKL<String> m = new HMapKL<String>();\n assertEquals(0L, m.get(\"1\"));\n\n m.increment(\"1\", 1L);\n assertEquals(1L, m.get(\"1\"));\n\n m.increment(\"1\", 1L);\n m.increment(\"2\", 0L);\n m.increment(\"3\", -1L);\n\n assertEquals(2L, m.g... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void increment(K key) {\n if (this.containsKey(key)) {\n this.put(key, (long) this.get(key) + 1L);\n } else {\n this.put(key, (long) 1L);\n }\n }",
"class_method_signature": "HMapKL.increment(K key)",
"constructor": false,
"full_signature": "@Override public vo... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_49 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "float neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "float",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testAddUnique() {\n ArrayListOfFloats a = new ArrayListOfFloats(new float[] { 1, 2, 3, 4, 5, 6, 7 });\n a.addUnique(new int[] { 8, 0, 2, 5, -1, 11, 9 });\n\n assertEquals(12, a.size());\n assertTrue(Math.abs(0 - a.get(8)) < 0.0001);\n assertTrue(Math.abs(-1 - a.get(9)) <... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient float[] array;",
"type": "float[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected in... | {
"body": "public void addUnique(int[] arr) {\n for (int i = 0; i < arr.length; i++) {\n int elt = arr[i];\n if (!contains(elt)) {\n add(elt);\n }\n }\n }",
"class_method_signature": "ArrayListOfFloats.addUnique(int[] arr)",
"constructor": false,
"full_signature": "public void addUn... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_120 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapILTest.java",
"identifier": "HMapILTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDot() throws IOException {\n HMapIL m1 = new HMapIL();\n\n m1.put(1, 2L);\n m1.put(2, 1L);\n m1.put(3, 3L);\n m1.put(Integer.MAX_VALUE, (long) Integer.MAX_VALUE);\n\n HMapIL m2 = new HMapIL();\n\n m2.put(1, 1L);\n m2.put(2, 4L);\n m2.put(4, 5L);\n m2.p... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public long dot(MapIL m) {\n long s = 0;\n\n for (MapIL.Entry e : m.entrySet()) {\n int key = e.getKey();\n\n if (this.containsKey(key)) {\n s += this.get(key) * e.getValue();\n }\n }\n\n return s;\n }",
"class_method_signature": "HMapIL.dot(MapIL m)",
"c... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_6 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2IntOpenHashMapWritableTest.java",
"identifier": "Int2IntOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortedEntries3() {\n Int2IntOpenHashMapWritable m = new Int2IntOpenHashMapWritable();\n\n m.put(1, 5);\n m.put(2, 2);\n\n Int2IntMap.Entry[] e = m.getEntriesSortedByValue(5);\n\n assertEquals(2, e.length);\n\n assertEquals(1, e[0].getIntKey());\n assertEquals(5... | {
"fields": [
{
"declarator": "serialVersionUID = 1255879065743242L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1255879065743242L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_DECODE... | {
"body": "public Int2IntMap.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n Int2IntMap.Entry[] entries = new Int2IntMap.Entry[this.size()];\n entries = this.int2IntEntrySet().toArray(entries);\n\n // sort the entries\n Arrays.sort(entries, new Comparator<Int2IntMap.... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_121 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapILTest.java",
"identifier": "HMapILTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIncrement() {\n HMapIL m = new HMapIL();\n assertEquals(0L, m.get(1));\n\n m.increment(1, 1L);\n assertEquals(1L, m.get(1));\n\n m.increment(1, 1L);\n m.increment(2, 0L);\n m.increment(3, -1L);\n\n assertEquals(2L, m.get(1));\n assertEquals(0L, m.get(2));... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void increment(int key) {\n if (this.containsKey(key)) {\n this.put(key, (long) (this.get(key) + 1));\n } else {\n this.put(key, (long) 1);\n }\n }",
"class_method_signature": "HMapIL.increment(int key)",
"constructor": false,
"full_signature": "@Override publi... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_7 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2IntOpenHashMapWritableTest.java",
"identifier": "Int2IntOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortedEntries4() {\n Int2IntOpenHashMapWritable m = new Int2IntOpenHashMapWritable();\n\n Int2IntMap.Entry[] e = m.getEntriesSortedByValue();\n assertTrue(e == null);\n }",
"class_method_signature": "Int2IntOpenHashMapWritableTest.testSortedEntries4()",
"constructor":... | {
"fields": [
{
"declarator": "serialVersionUID = 1255879065743242L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1255879065743242L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_DECODE... | {
"body": "public Int2IntMap.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n Int2IntMap.Entry[] entries = new Int2IntMap.Entry[this.size()];\n entries = this.int2IntEntrySet().toArray(entries);\n\n // sort the entries\n Arrays.sort(entries, new Comparator<Int2IntMap.... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_48 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "float neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "float",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testSubList() {\n ArrayListOfFloats a = new ArrayListOfFloats(new float[] { 1, 2, 3, 4, 5, 6, 7 });\n ArrayListOfFloats c = a.subList(1, 5);\n assertEquals(5, c.size());\n assertTrue(Math.abs(2 - c.get(0)) < 0.0001);\n assertTrue(Math.abs(3 - c.get(1)) < 0.0001);\n as... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient float[] array;",
"type": "float[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected in... | {
"body": "public ArrayListOfFloats subList(int start, int end) {\n ArrayListOfFloats sublst = new ArrayListOfFloats(end - start + 1);\n for (int i = start; i <= end; i++) {\n sublst.add(get(i));\n }\n return sublst;\n }",
"class_method_signature": "ArrayListOfFloats.subList(int start, int end)",
... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_137 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIFTest.java",
"identifier": "HMapIFTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPlus() throws IOException {\n HMapIF m1 = new HMapIF();\n\n m1.put(1, 5.0f);\n m1.put(2, 22.0f);\n\n HMapIF m2 = new HMapIF();\n\n m2.put(1, 4.0f);\n m2.put(3, 5.0f);\n\n m1.plus(m2);\n\n assertEquals(m1.size(), 3);\n assertTrue(m1.get(1) == 9);\n asse... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void plus(MapIF m) {\n for (MapIF.Entry e : m.entrySet()) {\n int key = e.getKey();\n\n if (this.containsKey(key)) {\n this.put(key, this.get(key) + e.getValue());\n } else {\n this.put(key, e.getValue());\n }\n }\n }",
"class_method_signature"... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_64 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "int neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "int",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/test... | {
"body": "@Test\n public void testAddUnique() {\n ArrayListOfInts a = new ArrayListOfInts(new int[] { 1, 2, 3, 4, 5, 6, 7 });\n a.addUnique(new int[] { 8, 0, 2, 5, -1, 11, 9 });\n assertEquals(12, a.size());\n assertEquals(0, a.get(8));\n assertEquals(-1, a.get(9));\n assertEquals(11, a.get(10));\... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient int[] array;",
"type": "int[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected int si... | {
"body": "public void addUnique(int[] arr) {\n for (int i = 0; i < arr.length; i++) {\n int elt = arr[i];\n if (!contains(elt)) {\n add(elt);\n }\n }\n }",
"class_method_signature": "ArrayListOfInts.addUnique(int[] arr)",
"constructor": false,
"full_signature": "public void addUniq... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_33 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/array/ArrayListWritableComparableTest.java",
"identifier": "ArrayListWritableComparableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToString() {\n ArrayListWritableComparable<Text> list = new ArrayListWritableComparable<Text>();\n\n list.add(new Text(\"hi\"));\n list.add(new Text(\"there\"));\n\n assertEquals(list.toString(), \"[hi, there]\");\n }",
"class_method_signature": "ArrayListWritableCom... | {
"fields": [
{
"declarator": "serialVersionUID = 4911321393319821792L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 4911321393319821792L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "lintools-datatype... | {
"body": "public String toString() {\n StringBuffer sb = new StringBuffer();\n sb.append(\"[\");\n for (int i = 0; i < this.size(); i++) {\n if (i != 0)\n sb.append(\", \");\n sb.append(this.get(i));\n }\n sb.append(\"]\");\n\n return sb.toString();\n }",
"class_method_signature... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_25 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/pair/PairOfFloatStringTest.java",
"identifier": "PairOfFloatStringTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testComparison2() throws IOException {\n WritableComparator comparator = new PairOfFloatString.Comparator();\n\n PairOfFloatString pair1 = new PairOfFloatString(1.0f, \"hi\");\n PairOfFloatString pair2 = new PairOfFloatString(1.0f, \"hi\");\n PairOfFloatString pair3 = new P... | {
"fields": [
{
"declarator": "leftElement",
"modifier": "private",
"original_string": "private float leftElement;",
"type": "float",
"var_name": "leftElement"
},
{
"declarator": "rightElement",
"modifier": "private",
"original_string": "private String right... | {
"body": "@Override\n public boolean equals(Object obj) {\n PairOfFloatString pair = (PairOfFloatString) obj;\n return rightElement.equals(pair.getRightElement()) && leftElement == pair.getLeftElement();\n }",
"class_method_signature": "PairOfFloatString.equals(Object obj)",
"constructor": false,
"full... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_72 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "double neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "double",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/sr... | {
"body": "@Test\n public void testSort() {\n ArrayListOfDoubles a = new ArrayListOfDoubles();\n assertEquals(0, a.size());\n\n a.add(5.2f).add(6f).add(5.9f).add(4.1f);\n assertEquals(4, a.size());\n\n a.sort();\n assertEquals(4, a.size());\n\n assertTrue(Math.abs(a.get(0) - 4.1) < 0.0001);\n ... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient double[] array;",
"type": "double[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected ... | {
"body": "public void sort() {\n trimToSize();\n Arrays.sort(getArray());\n }",
"class_method_signature": "ArrayListOfDoubles.sort()",
"constructor": false,
"full_signature": "public void sort()",
"identifier": "sort",
"invocations": [
"trimToSize",
"sort",
"getArray"
],
"modifiers":... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_52 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "int neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "int",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/test... | {
"body": "@Test\n public void testCompare2() {\n // [1, 3, 6]\n ArrayListOfIntsWritable a = new ArrayListOfIntsWritable();\n a.add(one).add(three).add(six);\n\n // [1, 3, 4]\n ArrayListOfIntsWritable b = new ArrayListOfIntsWritable();\n b.add(one).add(three).add(four);\n assertTrue(a.compareTo(... | {
"fields": [],
"file": "lintools-datatypes/src/main/java/tl/lin/data/array/ArrayListOfIntsWritable.java",
"identifier": "ArrayListOfIntsWritable",
"interfaces": "implements\n WritableComparable<ArrayListOfIntsWritable>",
"methods": [
{
"class_method_signature": "ArrayListOfIntsWritable.ArrayList... | {
"body": "@Override\n public int compareTo(ArrayListOfIntsWritable obj) {\n ArrayListOfIntsWritable other = (ArrayListOfIntsWritable) obj;\n if (isEmpty()) {\n if (other.isEmpty()) {\n return 0;\n } else {\n return -1;\n }\n }\n\n for (int i = 0; i < size(); i++) {\n if... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_44 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "float neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "float",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testToString() {\n int size = 10;\n Random r = new Random();\n\n ArrayListOfFloats list = new ArrayListOfFloats();\n for (int i = 0; i < size; i++) {\n list.add(r.nextFloat());\n }\n\n String out = list.toString();\n for (int i = 0; i < size; i++) {\n flo... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient float[] array;",
"type": "float[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected in... | {
"body": "public String toString(int n) {\n StringBuilder s = new StringBuilder();\n\n s.append(\"[\");\n int sz = size() > n ? n : size;\n\n for (int i = 0; i < sz; i++) {\n s.append(get(i));\n if (i < sz - 1) {\n s.append(\", \");\n }\n }\n\n s.append(size() > n ? String.for... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_13 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2LongOpenHashMapWritableTest.java",
"identifier": "Int2LongOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortedEntries2() {\n Int2LongOpenHashMapWritable m = new Int2LongOpenHashMapWritable();\n\n m.put(1, 5);\n m.put(2, 2);\n m.put(3, 3);\n m.put(4, 3);\n m.put(5, 1);\n\n Int2LongMap.Entry[] e = m.getEntriesSortedByValue(2);\n\n assertEquals(2, e.length);\n\n ... | {
"fields": [
{
"declarator": "serialVersionUID = 1029363828020488531L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1029363828020488531L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_... | {
"body": "public Int2LongMap.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n Int2LongMap.Entry[] entries = new Int2LongMap.Entry[this.size()];\n entries = this.int2LongEntrySet().toArray(entries);\n\n // sort the entries\n Arrays.sort(entries, new Comparator<Int2Lon... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_117 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIVTest.java",
"identifier": "HMapIVTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortedEntries4() {\n HMapIV<String> m = new HMapIV<String>();\n\n MapIV.Entry<String>[] e = m.getEntriesSortedByValue();\n assertTrue(e == null);\n }",
"class_method_signature": "HMapIVTest.testSortedEntries4()",
"constructor": false,
"full_signature": "@Test public... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@SuppressWarnings(\"unchecked\")\n public MapIV.Entry<V>[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n // for storing the entries\n MapIV.Entry<V>[] entries = new Entry[this.size()];\n int i = 0;\n Entry<V> next = null;\n\n int index = 0;\n // advance t... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_68 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "double neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "double",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/sr... | {
"body": "@Test\n public void testClone() {\n int size = 100000;\n Random r = new Random();\n double[] doubles = new double[size];\n\n ArrayListOfDoubles list1 = new ArrayListOfDoubles();\n for (int i = 0; i < size; i++) {\n double k = r.nextDouble();\n list1.add(k);\n doubles[i] = k;\... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient double[] array;",
"type": "double[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected ... | {
"body": "public ArrayListOfDoubles clone() {\n return new ArrayListOfDoubles(Arrays.copyOf(array, this.size()));\n }",
"class_method_signature": "ArrayListOfDoubles.clone()",
"constructor": false,
"full_signature": "public ArrayListOfDoubles clone()",
"identifier": "clone",
"invocations": [
"copyO... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_87 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "long neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "long",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/te... | {
"body": "@Test\n public void testInitialSize() {\n ArrayListOfLongs a = new ArrayListOfLongs();\n assertEquals(0, a.size());\n }",
"class_method_signature": "ArrayListOfLongsTest.testInitialSize()",
"constructor": false,
"full_signature": "@Test public void testInitialSize()",
"identifier": "testIni... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient long[] array;",
"type": "long[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected int ... | {
"body": "public int size() {\n return size;\n }",
"class_method_signature": "ArrayListOfLongs.size()",
"constructor": false,
"full_signature": "public int size()",
"identifier": "size",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int size()",
... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_140 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIFTest.java",
"identifier": "HMapIFTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortedEntries4() {\n HMapIF m = new HMapIF();\n\n MapIF.Entry[] e = m.getEntriesSortedByValue();\n assertTrue(e == null);\n }",
"class_method_signature": "HMapIFTest.testSortedEntries4()",
"constructor": false,
"full_signature": "@Test public void testSortedEntries4... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "public MapIF.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n // for storing the entries\n MapIF.Entry[] entries = new Entry[this.size()];\n int i = 0;\n Entry next = null;\n\n int index = 0;\n // advance to first entry\n while (index < table.lengt... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_29 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/pair/PairOfStringsTest.java",
"identifier": "PairOfStringsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testComparison2() throws IOException {\n WritableComparator comparator = new PairOfStrings.Comparator();\n\n PairOfStrings pair1 = new PairOfStrings(\"hi\", \"there\");\n PairOfStrings pair2 = new PairOfStrings(\"hi\", \"there\");\n PairOfStrings pair3 = new PairOfStrings(\... | {
"fields": [
{
"declarator": "leftElement",
"modifier": "private",
"original_string": "private String leftElement, rightElement;",
"type": "String",
"var_name": "leftElement"
}
],
"file": "lintools-datatypes/src/main/java/tl/lin/data/pair/PairOfStrings.java",
"identifier":... | {
"body": "public boolean equals(Object obj) {\n PairOfStrings pair = (PairOfStrings) obj;\n return leftElement.equals(pair.getLeftElement()) && rightElement.equals(pair.getRightElement());\n }",
"class_method_signature": "PairOfStrings.equals(Object obj)",
"constructor": false,
"full_signature": "public... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_101 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/array/ArrayListWritableTest.java",
"identifier": "ArrayListWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToString() {\n ArrayListWritable<Text> list = new ArrayListWritable<Text>();\n\n list.add(new Text(\"hi\"));\n list.add(new Text(\"there\"));\n\n assertEquals(list.toString(), \"[hi, there]\");\n }",
"class_method_signature": "ArrayListWritableTest.testToString()",
... | {
"fields": [
{
"declarator": "serialVersionUID = 4911321393319821791L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 4911321393319821791L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "lintools-datatype... | {
"body": "public String toString() {\n StringBuffer sb = new StringBuffer();\n sb.append(\"[\");\n for (int i = 0; i < this.size(); i++) {\n if (i != 0)\n sb.append(\", \");\n sb.append(this.get(i));\n }\n sb.append(\"]\");\n\n return sb.toString();\n }",
"class_method_signature... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_91 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "long neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "long",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/te... | {
"body": "@Test\n public void testToString1() {\n assertEquals(\"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", new ArrayListOfLongs(1, 11).toString());\n assertEquals(\"[1, 2, 3, 4, 5 ... (5 more) ]\", new ArrayListOfLongs(1, 11).toString(5));\n\n assertEquals(\"[1, 2, 3, 4, 5]\", new ArrayListOfLongs(1, 6).toString(... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient long[] array;",
"type": "long[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected int ... | {
"body": "public String toString(int n) {\n StringBuilder s = new StringBuilder();\n\n s.append(\"[\");\n int sz = size() > n ? n : size;\n\n for (int i = 0; i < sz; i++) {\n s.append(get(i));\n if (i < sz - 1) {\n s.append(\", \");\n }\n }\n\n s.append(size() > n ? String.for... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_75 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "float neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;",
"type": "float",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/... | {
"body": "@Test\n public void testCompare() {\n ArrayListOfFloatsWritable a = new ArrayListOfFloatsWritable();\n a.add(one).add(three).add(five);\n\n ArrayListOfFloatsWritable b = new ArrayListOfFloatsWritable();\n\n // [1,3,5] < [1,3,5,7]\n b.add(one).add(three).add(five).add(seven);\n assertTrue... | {
"fields": [],
"file": "lintools-datatypes/src/main/java/tl/lin/data/array/ArrayListOfFloatsWritable.java",
"identifier": "ArrayListOfFloatsWritable",
"interfaces": "implements\n WritableComparable<ArrayListOfFloatsWritable>",
"methods": [
{
"class_method_signature": "ArrayListOfFloatsWritable.A... | {
"body": "@Override\n public int compareTo(ArrayListOfFloatsWritable obj) {\n ArrayListOfFloatsWritable other = (ArrayListOfFloatsWritable) obj;\n if (isEmpty()) {\n if (other.isEmpty()) {\n return 0;\n } else {\n return -1;\n }\n }\n\n for (int i = 0; i < size(); i++) {\n ... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_22 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2FloatOpenHashMapWritableTest.java",
"identifier": "Int2FloatOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortedEntries3() {\n Int2FloatOpenHashMapWritable m = new Int2FloatOpenHashMapWritable();\n\n m.put(1, 5.0f);\n m.put(2, 2.0f);\n\n Int2FloatMap.Entry[] e = m.getEntriesSortedByValue(5);\n\n assertEquals(2, e.length);\n\n assertEquals(1, e[0].getIntKey());\n as... | {
"fields": [
{
"declarator": "serialVersionUID = 674980125439241L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 674980125439241L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_DECODE =... | {
"body": "public Int2FloatMap.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n Int2FloatMap.Entry[] entries = new Int2FloatMap.Entry[this.size()];\n entries = this.int2FloatEntrySet().toArray(entries);\n\n // Sort the entries.\n Arrays.sort(entries, new Comparator<In... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_34 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/array/ArrayListWritableComparableTest.java",
"identifier": "ArrayListWritableComparableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSorting1() {\n ArrayListWritableComparable<Text> list1 = new ArrayListWritableComparable<Text>();\n ArrayListWritableComparable<Text> list2 = new ArrayListWritableComparable<Text>();\n\n list1.add(new Text(\"a\"));\n\n assertTrue(list1.compareTo(list2) > 0);\n }",
"c... | {
"fields": [
{
"declarator": "serialVersionUID = 4911321393319821792L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 4911321393319821792L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "lintools-datatype... | {
"body": "public int compareTo(ArrayListWritableComparable<E> obj) {\n ArrayListWritableComparable<E> that = (ArrayListWritableComparable<E>) obj;\n\n // iterate through the fields\n for (int i = 0; i < this.size(); i++) {\n // sort shorter list first\n if (i >= that.size())\n return 1;\n\n... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_63 | {
"fields": [
{
"declarator": "neg_one = -1",
"modifier": "",
"original_string": "int neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;",
"type": "int",
"var_name": "neg_one"
}
],
"file": "lintools-datatypes/src/test... | {
"body": "@Test\n public void testSubList() {\n ArrayListOfInts a = new ArrayListOfInts(new int[] { 1, 2, 3, 4, 5, 6, 7 });\n ArrayListOfInts b = a.subList(1, 5);\n assertEquals(5, b.size());\n assertEquals(2, b.get(0));\n assertEquals(3, b.get(1));\n assertEquals(4, b.get(2));\n assertEquals(5... | {
"fields": [
{
"declarator": "array",
"modifier": "protected transient",
"original_string": "protected transient int[] array;",
"type": "int[]",
"var_name": "array"
},
{
"declarator": "size = 0",
"modifier": "protected",
"original_string": "protected int si... | {
"body": "public ArrayListOfInts subList(int start, int end) {\n ArrayListOfInts sublst = new ArrayListOfInts(end - start + 1);\n for (int i = start; i <= end; i++) {\n sublst.add(get(i));\n }\n return sublst;\n }",
"class_method_signature": "ArrayListOfInts.subList(int start, int end)",
"const... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_18 | {
"fields": [],
"file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2FloatOpenHashMapWritableTest.java",
"identifier": "Int2FloatOpenHashMapWritableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testLazyPlus() throws IOException {\n Int2FloatOpenHashMapWritable m1 = new Int2FloatOpenHashMapWritable();\n\n m1.put(1, 5.0f);\n m1.put(2, 22.0f);\n\n Int2FloatOpenHashMapWritable m2 = new Int2FloatOpenHashMapWritable();\n\n m2.put(1, 4.0f);\n m2.put(3, 5.0f);\n\n ... | {
"fields": [
{
"declarator": "serialVersionUID = 674980125439241L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 674980125439241L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LAZY_DECODE =... | {
"body": "public void lazyplus(Int2FloatOpenHashMapWritable m) {\n int[] keys = m.getKeys();\n float[] values = m.getValues();\n\n for (int i = 0; i < keys.length; i++) {\n if (this.containsKey(keys[i])) {\n this.put(keys[i], this.get(keys[i]) + values[i]);\n } else {\n this.put(keys... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_130 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapISTest.java",
"identifier": "HMapISTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPlus() throws IOException {\n HMapIS m1 = new HMapIS();\n\n m1.put(1, (short) 5);\n m1.put(2, (short) 22);\n\n HMapIS m2 = new HMapIS();\n\n m2.put(1, (short) 4);\n m2.put(3, (short) 5);\n\n m1.plus(m2);\n\n assertEquals(m1.size(), 3);\n assertTrue(m1.get... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void plus(MapIS m) {\n for (MapIS.Entry e : m.entrySet()) {\n int key = e.getKey();\n\n if (this.containsKey(key)) {\n this.put(key, (short) (this.get(key) + e.getValue()));\n } else {\n this.put(key, e.getValue());\n }\n }\n }",
"class_method_... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
11309044_126 | {
"fields": [],
"file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIDTest.java",
"identifier": "HMapIDTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPlus() throws IOException {\n HMapID m1 = new HMapID();\n\n m1.put(1, 5.0);\n m1.put(2, 22.0);\n\n HMapID m2 = new HMapID();\n\n m2.put(1, 4.0);\n m2.put(3, 5.0);\n\n m1.plus(m2);\n\n assertEquals(m1.size(), 3);\n assertTrue(m1.get(1) == 9);\n assertTr... | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_CAPACITY = 1024",
"modifier": "static final",
"original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;",
"type": "int",
"var_name": "DEFAULT_INITIAL_CAPACITY"
},
{
"declarator": "MAXIMUM_CAPACITY = 1 << 30",
... | {
"body": "@Override\n public void plus(MapID m) {\n for (MapID.Entry e : m.entrySet()) {\n int key = e.getKey();\n\n if (this.containsKey(key)) {\n this.put(key, this.get(key) + e.getValue());\n } else {\n this.put(key, e.getValue());\n }\n }\n }",
"class_method_signature"... | {
"created": null,
"fork": null,
"fork_count": 31,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11309044,
"size": 575,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/lintool/tools"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.