GitHub PullRequestReviewCommentEvent at 2014-03-07 12:23:56
Repository: Wikidata-Toolkit
Actor: mkroetzsch
Payload: {"comment":{"url":"https://api.github.com/repos/Wikidata/Wikidata-Toolkit/pulls/comments/10381366","id":10381366,"diff_hunk":"@@ -0,0 +1,212 @@\n+package org.wikidata.wdtk.storage.datastructure.impl;\n+\n+/*\n+ * #%L\n+ * Wikidata Toolkit Data Model\n+ * %%\n+ * Copyright (C) 2014 Wikidata Toolkit Developers\n+ * %%\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ * \n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ * \n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ * #L%\n+ */\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+import org.wikidata.wdtk.storage.datastructure.intf.BitVector;\n+\n+/**\n+ * This class keeps the count of occurrences of <code>true</code> values in a\n+ * bit vector. This implementation divides the bit vector in blocks of equal\n+ * size. It keeps an array with the count of <code>true</code> values present in\n+ * each block. <br />\n+ * For example, given the bit vector: 10010 (0 is <code>false</code>, 1 is\n+ * <code>true</code>), with a block size of 2, the array contains: [1, 2, 2].\n+ * The first block contains 1 <code>true</code> value, the second block contains\n+ * 1 more <code>true</code> value, in total 2. The third block is incomplete,\n+ * since it has only one bit, and it does not contain more <code>true</code>\n+ * values. <br />\n+ * For efficiency reasons, this class assumes that the bit vector is unmodified.\n+ * Any modification of the bit vector needs to be notified in\n+ * {@link FindPositionArray#update(BitVector)}.\n+ * \n+ * @see RankedBitVectorImpl\n+ * \n+ * @author Julian Mendez\n+ */\n+class CountBitsArray {","path":"wdtk-storage/src/main/java/org/wikidata/wdtk/storage/datastructure/impl/CountBitsArray.java","position":47,"original_position":47,"commit_id":"30849bc563cd0492759f31d862c93aed8428b1a9","original_commit_id":"30849bc563cd0492759f31d862c93aed8428b1a9","user":{"login":"mkroetzsch","id":110881,"avatar_url":"https://gravatar.com/avatar/3f2be903b01407e2725ba14c4c9577de?d=https%3A%2F%2Fidenticons.github.com%2Fc5614468881117cf5944b61244bfabe4.png&r=x","gravatar_id":"3f2be903b01407e2725ba14c4c9577de","url":"https://api.github.com/users/mkroetzsch","html_url":"https://github.com/mkroetzsch","followers_url":"https://api.github.com/users/mkroetzsch/followers","following_url":"https://api.github.com/users/mkroetzsch/following{/other_user}","gists_url":"https://api.github.com/users/mkroetzsch/gists{/gist_id}","starred_url":"https://api.github.com/users/mkroetzsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkroetzsch/subscriptions","organizations_url":"https://api.github.com/users/mkroetzsch/orgs","repos_url":"https://api.github.com/users/mkroetzsch/repos","events_url":"https://api.github.com/users/mkroetzsch/events{/privacy}","received_events_url":"https://api.github.com/users/mkroetzsch/received_events","type":"User","site_admin":false},"body":"There is a lot of very similar code/structure in CountBitsArray and FindPositionArray. The main difference is the concrete method used for counting. Could we use a common abstract superclass for both?","created_at":"2014-03-07T12:23:56Z","updated_at":"2014-03-07T12:23:56Z","html_url":"https://github.com/Wikidata/Wikidata-Toolkit/pull/32#discussion_r10381366","pull_request_url":"https://api.github.com/repos/Wikidata/Wikidata-Toolkit/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/Wikidata/Wikidata-Toolkit/pulls/comments/10381366"},"html":{"href":"https://github.com/Wikidata/Wikidata-Toolkit/pull/32#discussion_r10381366"},"pull_request":{"href":"https://api.github.com/repos/Wikidata/Wikidata-Toolkit/pulls/32"}}}}