{"action":"created","comment":{"url":"https://api.github.com/repos/git-afsantos/jTuples/pulls/comments/29995374","id":29995374,"diff_hunk":"@@ -0,0 +1,108 @@\n+/*\n+ * Copyright (c) 2015 git-afsantos\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"Software\"), to deal\n+ * in the Software without restriction, including without limitation the rights\n+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ * copies of the Software, and to permit persons to whom the Software is\n+ * furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in\n+ * all copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+ * THE SOFTWARE.\n+ */\n+package org.jtuples;\n+\n+import java.util.List;\n+import java.util.Objects;\n+\n+/**\n+ * Represents a mathematical tuple.\n+ * This is a fixed-length, immutable container of elements.\n+ * The number and type of its members are determined by the implementing\n+ * classes.\n+ *\n+ * @author Andre Santos <contact.andre.santos@gmail.com>\n+ */\n+public interface Tuple {\n+    /**\n+     * Returns the arity of this tuple.\n+     * The arity of a tuple is the number of elements it contains.\n+     * @return the arity of this tuple\n+     */\n+    int arity();\n+\n+    /**\n+     * Returns a new tuple, with the same elements, in reverse order.\n+     * @return a tuple in reverse order\n+     */\n+    Tuple invert();\n+\n+    /**\n+     * Returns a {@code List} view of the elements in this tuple.\n+     * The returned list is immutable.\n+     * @return a list representation of this tuple\n+     */\n+    List<?> asList();\n+\n+    /**\n+     * Returns an array containing the elements in this tuple.\n+     * @return an array containing the elements in this tuple\n+     */\n+    Object[] toArray();\n+\n+    /**\n+     * Compares the specified object with this tuple for equality.\n+     * Returns {@code true} if the specified object is also a tuple,\n+     * the two tuples have the same arity, and all corresponding pairs of\n+     * elements in the two tuples are equal.\n+     * (Two elements {@code e1} and {@code e2} are equal if\n+     * {@code (e1 == null ? e2 == null : e1.equals(e2))}.)\n+     * In other words, two tuples are defined to be equal if they contain\n+     * the same elements in the same order.\n+     * This definition ensures that the {@code equals} method works properly\n+     * across different implementations of the {@code Tuple} interface.\n+     * @param obj object to be compared for equality with this tuple\n+     * @return true if the specified object is equal to this tuple\n+     */\n+    @Override\n+    boolean equals(Object obj);\n+\n+    /**\n+     * Returns the hash code value for this tuple.\n+     * The hash code of a tuple is defined to be the result of the following\n+     * calculation.\n+     * <pre>{@code\n+     *     int hashCode = 1;\n+     *     for (Object e: tuple.asList())\n+     *         hashCode = 31*hashCode + (e==null ? 0 : e.hashCode());}","path":"jtuples/src/main/java/org/jtuples/Tuple.java","position":86,"original_position":86,"commit_id":"29543f6fcc9656feeb56b018a3af694622e8b87e","original_commit_id":"fa92436b4dd0b7f2d4496c2dddbbc8cc33847a06","user":{"login":"bsonntag","id":6205451,"avatar_url":"https://avatars.githubusercontent.com/u/6205451?v=3","gravatar_id":"","url":"https://api.github.com/users/bsonntag","html_url":"https://github.com/bsonntag","followers_url":"https://api.github.com/users/bsonntag/followers","following_url":"https://api.github.com/users/bsonntag/following{/other_user}","gists_url":"https://api.github.com/users/bsonntag/gists{/gist_id}","starred_url":"https://api.github.com/users/bsonntag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsonntag/subscriptions","organizations_url":"https://api.github.com/users/bsonntag/orgs","repos_url":"https://api.github.com/users/bsonntag/repos","events_url":"https://api.github.com/users/bsonntag/events{/privacy}","received_events_url":"https://api.github.com/users/bsonntag/received_events","type":"User","site_admin":false},"body":"If it's common for hash codes then it's ok, I guess.","created_at":"2015-05-09T19:01:00Z","updated_at":"2015-05-09T19:01:00Z","html_url":"https://github.com/git-afsantos/jTuples/pull/3#discussion_r29995374","pull_request_url":"https://api.github.com/repos/git-afsantos/jTuples/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/git-afsantos/jTuples/pulls/comments/29995374"},"html":{"href":"https://github.com/git-afsantos/jTuples/pull/3#discussion_r29995374"},"pull_request":{"href":"https://api.github.com/repos/git-afsantos/jTuples/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/git-afsantos/jTuples/pulls/3","id":35070181,"html_url":"https://github.com/git-afsantos/jTuples/pull/3","diff_url":"https://github.com/git-afsantos/jTuples/pull/3.diff","patch_url":"https://github.com/git-afsantos/jTuples/pull/3.patch","issue_url":"https://api.github.com/repos/git-afsantos/jTuples/issues/3","number":3,"state":"open","locked":false,"title":"Implementations for Tuple, AbstractTuple, Pair and Triple","user":{"login":"git-afsantos","id":5166824,"avatar_url":"https://avatars.githubusercontent.com/u/5166824?v=3","gravatar_id":"","url":"https://api.github.com/users/git-afsantos","html_url":"https://github.com/git-afsantos","followers_url":"https://api.github.com/users/git-afsantos/followers","following_url":"https://api.github.com/users/git-afsantos/following{/other_user}","gists_url":"https://api.github.com/users/git-afsantos/gists{/gist_id}","starred_url":"https://api.github.com/users/git-afsantos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/git-afsantos/subscriptions","organizations_url":"https://api.github.com/users/git-afsantos/orgs","repos_url":"https://api.github.com/users/git-afsantos/repos","events_url":"https://api.github.com/users/git-afsantos/events{/privacy}","received_events_url":"https://api.github.com/users/git-afsantos/received_events","type":"User","site_admin":false},"body":"This branch provides base implementations for the `Tuple` interface, the `AbstractTuple` abstract class, and the `Pair` and `Triple` classes.\r\nIt includes some configuration commits, changing the _pom_ and _gitignore_.","created_at":"2015-05-09T17:42:31Z","updated_at":"2015-05-09T19:01:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"15484cc1c7fe25fdd6e1ad9f7728289c0babadf7","assignee":{"login":"bsonntag","id":6205451,"avatar_url":"https://avatars.githubusercontent.com/u/6205451?v=3","gravatar_id":"","url":"https://api.github.com/users/bsonntag","html_url":"https://github.com/bsonntag","followers_url":"https://api.github.com/users/bsonntag/followers","following_url":"https://api.github.com/users/bsonntag/following{/other_user}","gists_url":"https://api.github.com/users/bsonntag/gists{/gist_id}","starred_url":"https://api.github.com/users/bsonntag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsonntag/subscriptions","organizations_url":"https://api.github.com/users/bsonntag/orgs","repos_url":"https://api.github.com/users/bsonntag/repos","events_url":"https://api.github.com/users/bsonntag/events{/privacy}","received_events_url":"https://api.github.com/users/bsonntag/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/git-afsantos/jTuples/pulls/3/commits","review_comments_url":"https://api.github.com/repos/git-afsantos/jTuples/pulls/3/comments","review_comment_url":"https://api.github.com/repos/git-afsantos/jTuples/pulls/comments{/number}","comments_url":"https://api.github.com/repos/git-afsantos/jTuples/issues/3/comments","statuses_url":"https://api.github.com/repos/git-afsantos/jTuples/statuses/29543f6fcc9656feeb56b018a3af694622e8b87e","head":{"label":"git-afsantos:as-implement-tuple-pair-triple","ref":"as-implement-tuple-pair-triple","sha":"29543f6fcc9656feeb56b018a3af694622e8b87e","user":{"login":"git-afsantos","id":5166824,"avatar_url":"https://avatars.githubusercontent.com/u/5166824?v=3","gravatar_id":"","url":"https://api.github.com/users/git-afsantos","html_url":"https://github.com/git-afsantos","followers_url":"https://api.github.com/users/git-afsantos/followers","following_url":"https://api.github.com/users/git-afsantos/following{/other_user}","gists_url":"https://api.github.com/users/git-afsantos/gists{/gist_id}","starred_url":"https://api.github.com/users/git-afsantos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/git-afsantos/subscriptions","organizations_url":"https://api.github.com/users/git-afsantos/orgs","repos_url":"https://api.github.com/users/git-afsantos/repos","events_url":"https://api.github.com/users/git-afsantos/events{/privacy}","received_events_url":"https://api.github.com/users/git-afsantos/received_events","type":"User","site_admin":false},"repo":{"id":35178869,"name":"jTuples","full_name":"git-afsantos/jTuples","owner":{"login":"git-afsantos","id":5166824,"avatar_url":"https://avatars.githubusercontent.com/u/5166824?v=3","gravatar_id":"","url":"https://api.github.com/users/git-afsantos","html_url":"https://github.com/git-afsantos","followers_url":"https://api.github.com/users/git-afsantos/followers","following_url":"https://api.github.com/users/git-afsantos/following{/other_user}","gists_url":"https://api.github.com/users/git-afsantos/gists{/gist_id}","starred_url":"https://api.github.com/users/git-afsantos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/git-afsantos/subscriptions","organizations_url":"https://api.github.com/users/git-afsantos/orgs","repos_url":"https://api.github.com/users/git-afsantos/repos","events_url":"https://api.github.com/users/git-afsantos/events{/privacy}","received_events_url":"https://api.github.com/users/git-afsantos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/git-afsantos/jTuples","description":"Java gets a Pair.","fork":false,"url":"https://api.github.com/repos/git-afsantos/jTuples","forks_url":"https://api.github.com/repos/git-afsantos/jTuples/forks","keys_url":"https://api.github.com/repos/git-afsantos/jTuples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/git-afsantos/jTuples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/git-afsantos/jTuples/teams","hooks_url":"https://api.github.com/repos/git-afsantos/jTuples/hooks","issue_events_url":"https://api.github.com/repos/git-afsantos/jTuples/issues/events{/number}","events_url":"https://api.github.com/repos/git-afsantos/jTuples/events","assignees_url":"https://api.github.com/repos/git-afsantos/jTuples/assignees{/user}","branches_url":"https://api.github.com/repos/git-afsantos/jTuples/branches{/branch}","tags_url":"https://api.github.com/repos/git-afsantos/jTuples/tags","blobs_url":"https://api.github.com/repos/git-afsantos/jTuples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/git-afsantos/jTuples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/git-afsantos/jTuples/git/refs{/sha}","trees_url":"https://api.github.com/repos/git-afsantos/jTuples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/git-afsantos/jTuples/statuses/{sha}","languages_url":"https://api.github.com/repos/git-afsantos/jTuples/languages","stargazers_url":"https://api.github.com/repos/git-afsantos/jTuples/stargazers","contributors_url":"https://api.github.com/repos/git-afsantos/jTuples/contributors","subscribers_url":"https://api.github.com/repos/git-afsantos/jTuples/subscribers","subscription_url":"https://api.github.com/repos/git-afsantos/jTuples/subscription","commits_url":"https://api.github.com/repos/git-afsantos/jTuples/commits{/sha}","git_commits_url":"https://api.github.com/repos/git-afsantos/jTuples/git/commits{/sha}","comments_url":"https://api.github.com/repos/git-afsantos/jTuples/comments{/number}","issue_comment_url":"https://api.github.com/repos/git-afsantos/jTuples/issues/comments{/number}","contents_url":"https://api.github.com/repos/git-afsantos/jTuples/contents/{+path}","compare_url":"https://api.github.com/repos/git-afsantos/jTuples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/git-afsantos/jTuples/merges","archive_url":"https://api.github.com/repos/git-afsantos/jTuples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/git-afsantos/jTuples/downloads","issues_url":"https://api.github.com/repos/git-afsantos/jTuples/issues{/number}","pulls_url":"https://api.github.com/repos/git-afsantos/jTuples/pulls{/number}","milestones_url":"https://api.github.com/repos/git-afsantos/jTuples/milestones{/number}","notifications_url":"https://api.github.com/repos/git-afsantos/jTuples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/git-afsantos/jTuples/labels{/name}","releases_url":"https://api.github.com/repos/git-afsantos/jTuples/releases{/id}","created_at":"2015-05-06T19:34:17Z","updated_at":"2015-05-08T09:23:09Z","pushed_at":"2015-05-09T18:41:54Z","git_url":"git://github.com/git-afsantos/jTuples.git","ssh_url":"git@github.com:git-afsantos/jTuples.git","clone_url":"https://github.com/git-afsantos/jTuples.git","svn_url":"https://github.com/git-afsantos/jTuples","homepage":"","size":0,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"git-afsantos:master","ref":"master","sha":"bcb5ee726f3573b9cda851b8f12379370f119222","user":{"login":"git-afsantos","id":5166824,"avatar_url":"https://avatars.githubusercontent.com/u/5166824?v=3","gravatar_id":"","url":"https://api.github.com/users/git-afsantos","html_url":"https://github.com/git-afsantos","followers_url":"https://api.github.com/users/git-afsantos/followers","following_url":"https://api.github.com/users/git-afsantos/following{/other_user}","gists_url":"https://api.github.com/users/git-afsantos/gists{/gist_id}","starred_url":"https://api.github.com/users/git-afsantos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/git-afsantos/subscriptions","organizations_url":"https://api.github.com/users/git-afsantos/orgs","repos_url":"https://api.github.com/users/git-afsantos/repos","events_url":"https://api.github.com/users/git-afsantos/events{/privacy}","received_events_url":"https://api.github.com/users/git-afsantos/received_events","type":"User","site_admin":false},"repo":{"id":35178869,"name":"jTuples","full_name":"git-afsantos/jTuples","owner":{"login":"git-afsantos","id":5166824,"avatar_url":"https://avatars.githubusercontent.com/u/5166824?v=3","gravatar_id":"","url":"https://api.github.com/users/git-afsantos","html_url":"https://github.com/git-afsantos","followers_url":"https://api.github.com/users/git-afsantos/followers","following_url":"https://api.github.com/users/git-afsantos/following{/other_user}","gists_url":"https://api.github.com/users/git-afsantos/gists{/gist_id}","starred_url":"https://api.github.com/users/git-afsantos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/git-afsantos/subscriptions","organizations_url":"https://api.github.com/users/git-afsantos/orgs","repos_url":"https://api.github.com/users/git-afsantos/repos","events_url":"https://api.github.com/users/git-afsantos/events{/privacy}","received_events_url":"https://api.github.com/users/git-afsantos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/git-afsantos/jTuples","description":"Java gets a Pair.","fork":false,"url":"https://api.github.com/repos/git-afsantos/jTuples","forks_url":"https://api.github.com/repos/git-afsantos/jTuples/forks","keys_url":"https://api.github.com/repos/git-afsantos/jTuples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/git-afsantos/jTuples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/git-afsantos/jTuples/teams","hooks_url":"https://api.github.com/repos/git-afsantos/jTuples/hooks","issue_events_url":"https://api.github.com/repos/git-afsantos/jTuples/issues/events{/number}","events_url":"https://api.github.com/repos/git-afsantos/jTuples/events","assignees_url":"https://api.github.com/repos/git-afsantos/jTuples/assignees{/user}","branches_url":"https://api.github.com/repos/git-afsantos/jTuples/branches{/branch}","tags_url":"https://api.github.com/repos/git-afsantos/jTuples/tags","blobs_url":"https://api.github.com/repos/git-afsantos/jTuples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/git-afsantos/jTuples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/git-afsantos/jTuples/git/refs{/sha}","trees_url":"https://api.github.com/repos/git-afsantos/jTuples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/git-afsantos/jTuples/statuses/{sha}","languages_url":"https://api.github.com/repos/git-afsantos/jTuples/languages","stargazers_url":"https://api.github.com/repos/git-afsantos/jTuples/stargazers","contributors_url":"https://api.github.com/repos/git-afsantos/jTuples/contributors","subscribers_url":"https://api.github.com/repos/git-afsantos/jTuples/subscribers","subscription_url":"https://api.github.com/repos/git-afsantos/jTuples/subscription","commits_url":"https://api.github.com/repos/git-afsantos/jTuples/commits{/sha}","git_commits_url":"https://api.github.com/repos/git-afsantos/jTuples/git/commits{/sha}","comments_url":"https://api.github.com/repos/git-afsantos/jTuples/comments{/number}","issue_comment_url":"https://api.github.com/repos/git-afsantos/jTuples/issues/comments{/number}","contents_url":"https://api.github.com/repos/git-afsantos/jTuples/contents/{+path}","compare_url":"https://api.github.com/repos/git-afsantos/jTuples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/git-afsantos/jTuples/merges","archive_url":"https://api.github.com/repos/git-afsantos/jTuples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/git-afsantos/jTuples/downloads","issues_url":"https://api.github.com/repos/git-afsantos/jTuples/issues{/number}","pulls_url":"https://api.github.com/repos/git-afsantos/jTuples/pulls{/number}","milestones_url":"https://api.github.com/repos/git-afsantos/jTuples/milestones{/number}","notifications_url":"https://api.github.com/repos/git-afsantos/jTuples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/git-afsantos/jTuples/labels{/name}","releases_url":"https://api.github.com/repos/git-afsantos/jTuples/releases{/id}","created_at":"2015-05-06T19:34:17Z","updated_at":"2015-05-08T09:23:09Z","pushed_at":"2015-05-09T18:41:54Z","git_url":"git://github.com/git-afsantos/jTuples.git","ssh_url":"git@github.com:git-afsantos/jTuples.git","clone_url":"https://github.com/git-afsantos/jTuples.git","svn_url":"https://github.com/git-afsantos/jTuples","homepage":"","size":0,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/git-afsantos/jTuples/pulls/3"},"html":{"href":"https://github.com/git-afsantos/jTuples/pull/3"},"issue":{"href":"https://api.github.com/repos/git-afsantos/jTuples/issues/3"},"comments":{"href":"https://api.github.com/repos/git-afsantos/jTuples/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/git-afsantos/jTuples/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/git-afsantos/jTuples/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/git-afsantos/jTuples/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/git-afsantos/jTuples/statuses/29543f6fcc9656feeb56b018a3af694622e8b87e"}}}}