{"action":"created","comment":{"url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/pulls/comments/200315117","pull_request_review_id":134603723,"id":200315117,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDMxNTExNw==","diff_hunk":"@@ -0,0 +1,40 @@\n+package lotto.values;\n+\n+import lotto.LottoGame;\n+\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+\n+public class LottoStatistics {\n+    private final Map<Rank, Integer> statistics = new HashMap<>();\n+\n+    public LottoStatistics(List<Lotto> lottoList, Lotto winLotto) {\n+        for (Rank rank : Rank.values()) {\n+            statistics.put(rank, 0);\n+        }\n+\n+        Rank rank;\n+        for (Lotto lotto : lottoList) {\n+            rank = Rank.valueOf(winLotto.match(lotto));\n+            statistics.put(rank, statistics.get(rank) + 1);\n+        }\n+    }\n+\n+    public double getYield() {\n+        // 상금 / 투자금 * 100\n+        int totalLottoCount = 0;\n+        int totalPrice = 0;\n+        for (Rank rank : Rank.values()) {\n+            int count = statistics.get(rank);\n+            totalPrice += count * rank.getPrice();\n+            totalLottoCount += count;\n+        }\n+        return (double) totalPrice / (totalLottoCount * LottoGame.LOTTO_PRICE) * 100;\n+    }\n+\n+    public int getCount(Rank rank) {\n+        return statistics.get(rank);\n+    }","path":"src/main/java/lotto/values/LottoStatistics.java","position":38,"original_position":38,"commit_id":"929ad13d84e05386b856a9883ba95dd1b1cd1af9","original_commit_id":"929ad13d84e05386b856a9883ba95dd1b1cd1af9","user":{"login":"javajigi","id":520500,"node_id":"MDQ6VXNlcjUyMDUwMA==","avatar_url":"https://avatars2.githubusercontent.com/u/520500?v=4","gravatar_id":"","url":"https://api.github.com/users/javajigi","html_url":"https://github.com/javajigi","followers_url":"https://api.github.com/users/javajigi/followers","following_url":"https://api.github.com/users/javajigi/following{/other_user}","gists_url":"https://api.github.com/users/javajigi/gists{/gist_id}","starred_url":"https://api.github.com/users/javajigi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javajigi/subscriptions","organizations_url":"https://api.github.com/users/javajigi/orgs","repos_url":"https://api.github.com/users/javajigi/repos","events_url":"https://api.github.com/users/javajigi/events{/privacy}","received_events_url":"https://api.github.com/users/javajigi/received_events","type":"User","site_admin":false},"body":"이 메소드가 외부에서 사용될 필요가 있나?","created_at":"2018-07-05T11:11:41Z","updated_at":"2018-07-05T11:14:25Z","html_url":"https://github.com/wwh-techcamp-2018/java-lotto/pull/9#discussion_r200315117","pull_request_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/pulls/9","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/pulls/comments/200315117"},"html":{"href":"https://github.com/wwh-techcamp-2018/java-lotto/pull/9#discussion_r200315117"},"pull_request":{"href":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/pulls/9","id":199429780,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NDI5Nzgw","html_url":"https://github.com/wwh-techcamp-2018/java-lotto/pull/9","diff_url":"https://github.com/wwh-techcamp-2018/java-lotto/pull/9.diff","patch_url":"https://github.com/wwh-techcamp-2018/java-lotto/pull/9.patch","issue_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/issues/9","number":9,"state":"open","locked":false,"title":"[Team5 Pair 1] 로또 step 1 완료","user":{"login":"ffaass","id":3901276,"node_id":"MDQ6VXNlcjM5MDEyNzY=","avatar_url":"https://avatars3.githubusercontent.com/u/3901276?v=4","gravatar_id":"","url":"https://api.github.com/users/ffaass","html_url":"https://github.com/ffaass","followers_url":"https://api.github.com/users/ffaass/followers","following_url":"https://api.github.com/users/ffaass/following{/other_user}","gists_url":"https://api.github.com/users/ffaass/gists{/gist_id}","starred_url":"https://api.github.com/users/ffaass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ffaass/subscriptions","organizations_url":"https://api.github.com/users/ffaass/orgs","repos_url":"https://api.github.com/users/ffaass/repos","events_url":"https://api.github.com/users/ffaass/events{/privacy}","received_events_url":"https://api.github.com/users/ffaass/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-05T10:43:26Z","updated_at":"2018-07-05T11:14:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7f54f61d78f15541a92c33117658b6be9212b272","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/pulls/9/commits","review_comments_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/pulls/9/comments","review_comment_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/issues/9/comments","statuses_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/statuses/929ad13d84e05386b856a9883ba95dd1b1cd1af9","head":{"label":"ffaass:step1","ref":"step1","sha":"929ad13d84e05386b856a9883ba95dd1b1cd1af9","user":{"login":"ffaass","id":3901276,"node_id":"MDQ6VXNlcjM5MDEyNzY=","avatar_url":"https://avatars3.githubusercontent.com/u/3901276?v=4","gravatar_id":"","url":"https://api.github.com/users/ffaass","html_url":"https://github.com/ffaass","followers_url":"https://api.github.com/users/ffaass/followers","following_url":"https://api.github.com/users/ffaass/following{/other_user}","gists_url":"https://api.github.com/users/ffaass/gists{/gist_id}","starred_url":"https://api.github.com/users/ffaass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ffaass/subscriptions","organizations_url":"https://api.github.com/users/ffaass/orgs","repos_url":"https://api.github.com/users/ffaass/repos","events_url":"https://api.github.com/users/ffaass/events{/privacy}","received_events_url":"https://api.github.com/users/ffaass/received_events","type":"User","site_admin":false},"repo":{"id":139694246,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk2OTQyNDY=","name":"java-lotto","full_name":"ffaass/java-lotto","owner":{"login":"ffaass","id":3901276,"node_id":"MDQ6VXNlcjM5MDEyNzY=","avatar_url":"https://avatars3.githubusercontent.com/u/3901276?v=4","gravatar_id":"","url":"https://api.github.com/users/ffaass","html_url":"https://github.com/ffaass","followers_url":"https://api.github.com/users/ffaass/followers","following_url":"https://api.github.com/users/ffaass/following{/other_user}","gists_url":"https://api.github.com/users/ffaass/gists{/gist_id}","starred_url":"https://api.github.com/users/ffaass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ffaass/subscriptions","organizations_url":"https://api.github.com/users/ffaass/orgs","repos_url":"https://api.github.com/users/ffaass/repos","events_url":"https://api.github.com/users/ffaass/events{/privacy}","received_events_url":"https://api.github.com/users/ffaass/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ffaass/java-lotto","description":"로또 게임 구현을 관리하는 저장소","fork":true,"url":"https://api.github.com/repos/ffaass/java-lotto","forks_url":"https://api.github.com/repos/ffaass/java-lotto/forks","keys_url":"https://api.github.com/repos/ffaass/java-lotto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ffaass/java-lotto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ffaass/java-lotto/teams","hooks_url":"https://api.github.com/repos/ffaass/java-lotto/hooks","issue_events_url":"https://api.github.com/repos/ffaass/java-lotto/issues/events{/number}","events_url":"https://api.github.com/repos/ffaass/java-lotto/events","assignees_url":"https://api.github.com/repos/ffaass/java-lotto/assignees{/user}","branches_url":"https://api.github.com/repos/ffaass/java-lotto/branches{/branch}","tags_url":"https://api.github.com/repos/ffaass/java-lotto/tags","blobs_url":"https://api.github.com/repos/ffaass/java-lotto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ffaass/java-lotto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ffaass/java-lotto/git/refs{/sha}","trees_url":"https://api.github.com/repos/ffaass/java-lotto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ffaass/java-lotto/statuses/{sha}","languages_url":"https://api.github.com/repos/ffaass/java-lotto/languages","stargazers_url":"https://api.github.com/repos/ffaass/java-lotto/stargazers","contributors_url":"https://api.github.com/repos/ffaass/java-lotto/contributors","subscribers_url":"https://api.github.com/repos/ffaass/java-lotto/subscribers","subscription_url":"https://api.github.com/repos/ffaass/java-lotto/subscription","commits_url":"https://api.github.com/repos/ffaass/java-lotto/commits{/sha}","git_commits_url":"https://api.github.com/repos/ffaass/java-lotto/git/commits{/sha}","comments_url":"https://api.github.com/repos/ffaass/java-lotto/comments{/number}","issue_comment_url":"https://api.github.com/repos/ffaass/java-lotto/issues/comments{/number}","contents_url":"https://api.github.com/repos/ffaass/java-lotto/contents/{+path}","compare_url":"https://api.github.com/repos/ffaass/java-lotto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ffaass/java-lotto/merges","archive_url":"https://api.github.com/repos/ffaass/java-lotto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ffaass/java-lotto/downloads","issues_url":"https://api.github.com/repos/ffaass/java-lotto/issues{/number}","pulls_url":"https://api.github.com/repos/ffaass/java-lotto/pulls{/number}","milestones_url":"https://api.github.com/repos/ffaass/java-lotto/milestones{/number}","notifications_url":"https://api.github.com/repos/ffaass/java-lotto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ffaass/java-lotto/labels{/name}","releases_url":"https://api.github.com/repos/ffaass/java-lotto/releases{/id}","deployments_url":"https://api.github.com/repos/ffaass/java-lotto/deployments","created_at":"2018-07-04T08:42:53Z","updated_at":"2018-07-04T08:42:55Z","pushed_at":"2018-07-05T10:41:52Z","git_url":"git://github.com/ffaass/java-lotto.git","ssh_url":"git@github.com:ffaass/java-lotto.git","clone_url":"https://github.com/ffaass/java-lotto.git","svn_url":"https://github.com/ffaass/java-lotto","homepage":null,"size":100,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wwh-techcamp-2018:team5_pair1","ref":"team5_pair1","sha":"a65d5488454827037bcfaa8e46f75d6a255235a3","user":{"login":"wwh-techcamp-2018","id":40353008,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMzUzMDA4","avatar_url":"https://avatars1.githubusercontent.com/u/40353008?v=4","gravatar_id":"","url":"https://api.github.com/users/wwh-techcamp-2018","html_url":"https://github.com/wwh-techcamp-2018","followers_url":"https://api.github.com/users/wwh-techcamp-2018/followers","following_url":"https://api.github.com/users/wwh-techcamp-2018/following{/other_user}","gists_url":"https://api.github.com/users/wwh-techcamp-2018/gists{/gist_id}","starred_url":"https://api.github.com/users/wwh-techcamp-2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwh-techcamp-2018/subscriptions","organizations_url":"https://api.github.com/users/wwh-techcamp-2018/orgs","repos_url":"https://api.github.com/users/wwh-techcamp-2018/repos","events_url":"https://api.github.com/users/wwh-techcamp-2018/events{/privacy}","received_events_url":"https://api.github.com/users/wwh-techcamp-2018/received_events","type":"Organization","site_admin":false},"repo":{"id":137728834,"node_id":"MDEwOlJlcG9zaXRvcnkxMzc3Mjg4MzQ=","name":"java-lotto","full_name":"wwh-techcamp-2018/java-lotto","owner":{"login":"wwh-techcamp-2018","id":40353008,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMzUzMDA4","avatar_url":"https://avatars1.githubusercontent.com/u/40353008?v=4","gravatar_id":"","url":"https://api.github.com/users/wwh-techcamp-2018","html_url":"https://github.com/wwh-techcamp-2018","followers_url":"https://api.github.com/users/wwh-techcamp-2018/followers","following_url":"https://api.github.com/users/wwh-techcamp-2018/following{/other_user}","gists_url":"https://api.github.com/users/wwh-techcamp-2018/gists{/gist_id}","starred_url":"https://api.github.com/users/wwh-techcamp-2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwh-techcamp-2018/subscriptions","organizations_url":"https://api.github.com/users/wwh-techcamp-2018/orgs","repos_url":"https://api.github.com/users/wwh-techcamp-2018/repos","events_url":"https://api.github.com/users/wwh-techcamp-2018/events{/privacy}","received_events_url":"https://api.github.com/users/wwh-techcamp-2018/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wwh-techcamp-2018/java-lotto","description":"로또 게임 구현을 관리하는 저장소","fork":false,"url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto","forks_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/forks","keys_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/teams","hooks_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/hooks","issue_events_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/issues/events{/number}","events_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/events","assignees_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/assignees{/user}","branches_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/branches{/branch}","tags_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/tags","blobs_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/git/refs{/sha}","trees_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/statuses/{sha}","languages_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/languages","stargazers_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/stargazers","contributors_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/contributors","subscribers_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/subscribers","subscription_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/subscription","commits_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/commits{/sha}","git_commits_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/git/commits{/sha}","comments_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/comments{/number}","issue_comment_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/issues/comments{/number}","contents_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/contents/{+path}","compare_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/merges","archive_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/downloads","issues_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/issues{/number}","pulls_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/pulls{/number}","milestones_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/milestones{/number}","notifications_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/labels{/name}","releases_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/releases{/id}","deployments_url":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/deployments","created_at":"2018-06-18T08:44:38Z","updated_at":"2018-06-20T06:11:49Z","pushed_at":"2018-07-05T11:05:07Z","git_url":"git://github.com/wwh-techcamp-2018/java-lotto.git","ssh_url":"git@github.com:wwh-techcamp-2018/java-lotto.git","clone_url":"https://github.com/wwh-techcamp-2018/java-lotto.git","svn_url":"https://github.com/wwh-techcamp-2018/java-lotto","homepage":null,"size":100,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":19,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/pulls/9"},"html":{"href":"https://github.com/wwh-techcamp-2018/java-lotto/pull/9"},"issue":{"href":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/issues/9"},"comments":{"href":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/wwh-techcamp-2018/java-lotto/statuses/929ad13d84e05386b856a9883ba95dd1b1cd1af9"}},"author_association":"NONE"}}
{"actor":{"display_login":"javajigi"}}