{"action":"created","comment":{"url":"https://api.github.com/repos/abansal4032/CNUassignment/pulls/comments/69740072","id":69740072,"diff_hunk":"@@ -0,0 +1,79 @@\n+package com.cnu2016.assignment02;\n+import java.io.*;\n+import java.util.*;\n+\n+enum status { ON, OFF };\n+\n+class Appliance {\n+    \n+    private status CurrStatus;\n+    \n+    public Appliance(status stat) {\n+        this.CurrStatus = stat;\n+    }\n+    \n+    public status getStatus() {\n+        return this.CurrStatus;\n+    }\n+    \n+    public void setStatus(status stat) {\n+        this.CurrStatus = stat;\n+    }\n+    \n+}\n+\n+public class SmartClient {\n+        public static void main(String[] argvs) {\n+        try{\n+            ArrayList<String> CommandArray = new ArrayList<String>();\n+            FileInputStream fstream = new FileInputStream(\"textfile.txt\");\n+            // Get the object of DataInputStream\n+            DataInputStream in = new DataInputStream(fstream);\n+            BufferedReader br = new BufferedReader(new InputStreamReader(in));\n+            String strLine;\n+            //Read File Line By Line\n+            while ((strLine = br.readLine()) != null)   {\n+                \n+                CommandArray.add(strLine);\n+            }\n+        Collections.sort(CommandArray.subList(1, CommandArray.size()));\n+        //Get an instance for each Appliance\n+        final Appliance AC = new Appliance(status.OFF);\n+        final Appliance WH = new Appliance(status.OFF);\n+        final Appliance CO = new Appliance(status.OFF);\n+        \n+        for (String s: CommandArray) {\n+            Timer timer = new Timer();\n+            String[] Command = s.split(\",\"); \n+            final long time = Long.valueOf(Command[0]).longValue();\n+            final String device = Command[1];\n+            final String stat = Command[2];\n+            final status StatusToBe;\n+            if(stat.equals(\"ON\"))\n+                StatusToBe = status.ON;\n+            else\n+                StatusToBe = status.OFF;\n+            timer.schedule(new TimerTask() {\n+                @Override\n+                //Check and display only if there is an actual change in status\n+                public void run() {\n+                if(device.equals(\"AC\"))\n+                    AC.setStatus(StatusToBe);\n+                if(device.equals(\"WH\"))\n+                    WH.setStatus(StatusToBe);\n+                if(device.equals(\"CO\"))\n+                    CO.setStatus(StatusToBe);\n+                System.out.println(\"At time \" + time);","path":"SmartClient/src/main/java/com/cnu2016/assignment02/SmartClient.java","position":66,"original_position":66,"commit_id":"1ce35ed1ae9c9395dd9733be36f12bb3c48d5651","original_commit_id":"1ce35ed1ae9c9395dd9733be36f12bb3c48d5651","user":{"login":"hkhurana","id":4414209,"avatar_url":"https://avatars.githubusercontent.com/u/4414209?v=3","gravatar_id":"","url":"https://api.github.com/users/hkhurana","html_url":"https://github.com/hkhurana","followers_url":"https://api.github.com/users/hkhurana/followers","following_url":"https://api.github.com/users/hkhurana/following{/other_user}","gists_url":"https://api.github.com/users/hkhurana/gists{/gist_id}","starred_url":"https://api.github.com/users/hkhurana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkhurana/subscriptions","organizations_url":"https://api.github.com/users/hkhurana/orgs","repos_url":"https://api.github.com/users/hkhurana/repos","events_url":"https://api.github.com/users/hkhurana/events{/privacy}","received_events_url":"https://api.github.com/users/hkhurana/received_events","type":"User","site_admin":false},"body":"Good stuff!","created_at":"2016-07-06T14:25:19Z","updated_at":"2016-07-06T14:25:19Z","html_url":"https://github.com/abansal4032/CNUassignment/pull/1#discussion_r69740072","pull_request_url":"https://api.github.com/repos/abansal4032/CNUassignment/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/abansal4032/CNUassignment/pulls/comments/69740072"},"html":{"href":"https://github.com/abansal4032/CNUassignment/pull/1#discussion_r69740072"},"pull_request":{"href":"https://api.github.com/repos/abansal4032/CNUassignment/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/abansal4032/CNUassignment/pulls/1","id":76299899,"html_url":"https://github.com/abansal4032/CNUassignment/pull/1","diff_url":"https://github.com/abansal4032/CNUassignment/pull/1.diff","patch_url":"https://github.com/abansal4032/CNUassignment/pull/1.patch","issue_url":"https://api.github.com/repos/abansal4032/CNUassignment/issues/1","number":1,"state":"open","locked":false,"title":"Assignment 2 Milestone 1 Done","user":{"login":"abansal4032","id":20282242,"avatar_url":"https://avatars.githubusercontent.com/u/20282242?v=3","gravatar_id":"","url":"https://api.github.com/users/abansal4032","html_url":"https://github.com/abansal4032","followers_url":"https://api.github.com/users/abansal4032/followers","following_url":"https://api.github.com/users/abansal4032/following{/other_user}","gists_url":"https://api.github.com/users/abansal4032/gists{/gist_id}","starred_url":"https://api.github.com/users/abansal4032/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abansal4032/subscriptions","organizations_url":"https://api.github.com/users/abansal4032/orgs","repos_url":"https://api.github.com/users/abansal4032/repos","events_url":"https://api.github.com/users/abansal4032/events{/privacy}","received_events_url":"https://api.github.com/users/abansal4032/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-05T16:03:25Z","updated_at":"2016-07-06T14:25:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"43702f4e0e63538f983a07f81900a67b6518d9fa","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/abansal4032/CNUassignment/pulls/1/commits","review_comments_url":"https://api.github.com/repos/abansal4032/CNUassignment/pulls/1/comments","review_comment_url":"https://api.github.com/repos/abansal4032/CNUassignment/pulls/comments{/number}","comments_url":"https://api.github.com/repos/abansal4032/CNUassignment/issues/1/comments","statuses_url":"https://api.github.com/repos/abansal4032/CNUassignment/statuses/1ce35ed1ae9c9395dd9733be36f12bb3c48d5651","head":{"label":"abansal4032:assignment02","ref":"assignment02","sha":"1ce35ed1ae9c9395dd9733be36f12bb3c48d5651","user":{"login":"abansal4032","id":20282242,"avatar_url":"https://avatars.githubusercontent.com/u/20282242?v=3","gravatar_id":"","url":"https://api.github.com/users/abansal4032","html_url":"https://github.com/abansal4032","followers_url":"https://api.github.com/users/abansal4032/followers","following_url":"https://api.github.com/users/abansal4032/following{/other_user}","gists_url":"https://api.github.com/users/abansal4032/gists{/gist_id}","starred_url":"https://api.github.com/users/abansal4032/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abansal4032/subscriptions","organizations_url":"https://api.github.com/users/abansal4032/orgs","repos_url":"https://api.github.com/users/abansal4032/repos","events_url":"https://api.github.com/users/abansal4032/events{/privacy}","received_events_url":"https://api.github.com/users/abansal4032/received_events","type":"User","site_admin":false},"repo":{"id":62649487,"name":"CNUassignment","full_name":"abansal4032/CNUassignment","owner":{"login":"abansal4032","id":20282242,"avatar_url":"https://avatars.githubusercontent.com/u/20282242?v=3","gravatar_id":"","url":"https://api.github.com/users/abansal4032","html_url":"https://github.com/abansal4032","followers_url":"https://api.github.com/users/abansal4032/followers","following_url":"https://api.github.com/users/abansal4032/following{/other_user}","gists_url":"https://api.github.com/users/abansal4032/gists{/gist_id}","starred_url":"https://api.github.com/users/abansal4032/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abansal4032/subscriptions","organizations_url":"https://api.github.com/users/abansal4032/orgs","repos_url":"https://api.github.com/users/abansal4032/repos","events_url":"https://api.github.com/users/abansal4032/events{/privacy}","received_events_url":"https://api.github.com/users/abansal4032/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abansal4032/CNUassignment","description":null,"fork":false,"url":"https://api.github.com/repos/abansal4032/CNUassignment","forks_url":"https://api.github.com/repos/abansal4032/CNUassignment/forks","keys_url":"https://api.github.com/repos/abansal4032/CNUassignment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abansal4032/CNUassignment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abansal4032/CNUassignment/teams","hooks_url":"https://api.github.com/repos/abansal4032/CNUassignment/hooks","issue_events_url":"https://api.github.com/repos/abansal4032/CNUassignment/issues/events{/number}","events_url":"https://api.github.com/repos/abansal4032/CNUassignment/events","assignees_url":"https://api.github.com/repos/abansal4032/CNUassignment/assignees{/user}","branches_url":"https://api.github.com/repos/abansal4032/CNUassignment/branches{/branch}","tags_url":"https://api.github.com/repos/abansal4032/CNUassignment/tags","blobs_url":"https://api.github.com/repos/abansal4032/CNUassignment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abansal4032/CNUassignment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abansal4032/CNUassignment/git/refs{/sha}","trees_url":"https://api.github.com/repos/abansal4032/CNUassignment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abansal4032/CNUassignment/statuses/{sha}","languages_url":"https://api.github.com/repos/abansal4032/CNUassignment/languages","stargazers_url":"https://api.github.com/repos/abansal4032/CNUassignment/stargazers","contributors_url":"https://api.github.com/repos/abansal4032/CNUassignment/contributors","subscribers_url":"https://api.github.com/repos/abansal4032/CNUassignment/subscribers","subscription_url":"https://api.github.com/repos/abansal4032/CNUassignment/subscription","commits_url":"https://api.github.com/repos/abansal4032/CNUassignment/commits{/sha}","git_commits_url":"https://api.github.com/repos/abansal4032/CNUassignment/git/commits{/sha}","comments_url":"https://api.github.com/repos/abansal4032/CNUassignment/comments{/number}","issue_comment_url":"https://api.github.com/repos/abansal4032/CNUassignment/issues/comments{/number}","contents_url":"https://api.github.com/repos/abansal4032/CNUassignment/contents/{+path}","compare_url":"https://api.github.com/repos/abansal4032/CNUassignment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abansal4032/CNUassignment/merges","archive_url":"https://api.github.com/repos/abansal4032/CNUassignment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abansal4032/CNUassignment/downloads","issues_url":"https://api.github.com/repos/abansal4032/CNUassignment/issues{/number}","pulls_url":"https://api.github.com/repos/abansal4032/CNUassignment/pulls{/number}","milestones_url":"https://api.github.com/repos/abansal4032/CNUassignment/milestones{/number}","notifications_url":"https://api.github.com/repos/abansal4032/CNUassignment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abansal4032/CNUassignment/labels{/name}","releases_url":"https://api.github.com/repos/abansal4032/CNUassignment/releases{/id}","deployments_url":"https://api.github.com/repos/abansal4032/CNUassignment/deployments","created_at":"2016-07-05T15:47:10Z","updated_at":"2016-07-05T15:47:10Z","pushed_at":"2016-07-06T12:38:52Z","git_url":"git://github.com/abansal4032/CNUassignment.git","ssh_url":"git@github.com:abansal4032/CNUassignment.git","clone_url":"https://github.com/abansal4032/CNUassignment.git","svn_url":"https://github.com/abansal4032/CNUassignment","homepage":null,"size":159,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"abansal4032:master","ref":"master","sha":"159872c785a65f5e068b2ae412344df7d893593a","user":{"login":"abansal4032","id":20282242,"avatar_url":"https://avatars.githubusercontent.com/u/20282242?v=3","gravatar_id":"","url":"https://api.github.com/users/abansal4032","html_url":"https://github.com/abansal4032","followers_url":"https://api.github.com/users/abansal4032/followers","following_url":"https://api.github.com/users/abansal4032/following{/other_user}","gists_url":"https://api.github.com/users/abansal4032/gists{/gist_id}","starred_url":"https://api.github.com/users/abansal4032/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abansal4032/subscriptions","organizations_url":"https://api.github.com/users/abansal4032/orgs","repos_url":"https://api.github.com/users/abansal4032/repos","events_url":"https://api.github.com/users/abansal4032/events{/privacy}","received_events_url":"https://api.github.com/users/abansal4032/received_events","type":"User","site_admin":false},"repo":{"id":62649487,"name":"CNUassignment","full_name":"abansal4032/CNUassignment","owner":{"login":"abansal4032","id":20282242,"avatar_url":"https://avatars.githubusercontent.com/u/20282242?v=3","gravatar_id":"","url":"https://api.github.com/users/abansal4032","html_url":"https://github.com/abansal4032","followers_url":"https://api.github.com/users/abansal4032/followers","following_url":"https://api.github.com/users/abansal4032/following{/other_user}","gists_url":"https://api.github.com/users/abansal4032/gists{/gist_id}","starred_url":"https://api.github.com/users/abansal4032/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abansal4032/subscriptions","organizations_url":"https://api.github.com/users/abansal4032/orgs","repos_url":"https://api.github.com/users/abansal4032/repos","events_url":"https://api.github.com/users/abansal4032/events{/privacy}","received_events_url":"https://api.github.com/users/abansal4032/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abansal4032/CNUassignment","description":null,"fork":false,"url":"https://api.github.com/repos/abansal4032/CNUassignment","forks_url":"https://api.github.com/repos/abansal4032/CNUassignment/forks","keys_url":"https://api.github.com/repos/abansal4032/CNUassignment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abansal4032/CNUassignment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abansal4032/CNUassignment/teams","hooks_url":"https://api.github.com/repos/abansal4032/CNUassignment/hooks","issue_events_url":"https://api.github.com/repos/abansal4032/CNUassignment/issues/events{/number}","events_url":"https://api.github.com/repos/abansal4032/CNUassignment/events","assignees_url":"https://api.github.com/repos/abansal4032/CNUassignment/assignees{/user}","branches_url":"https://api.github.com/repos/abansal4032/CNUassignment/branches{/branch}","tags_url":"https://api.github.com/repos/abansal4032/CNUassignment/tags","blobs_url":"https://api.github.com/repos/abansal4032/CNUassignment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abansal4032/CNUassignment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abansal4032/CNUassignment/git/refs{/sha}","trees_url":"https://api.github.com/repos/abansal4032/CNUassignment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abansal4032/CNUassignment/statuses/{sha}","languages_url":"https://api.github.com/repos/abansal4032/CNUassignment/languages","stargazers_url":"https://api.github.com/repos/abansal4032/CNUassignment/stargazers","contributors_url":"https://api.github.com/repos/abansal4032/CNUassignment/contributors","subscribers_url":"https://api.github.com/repos/abansal4032/CNUassignment/subscribers","subscription_url":"https://api.github.com/repos/abansal4032/CNUassignment/subscription","commits_url":"https://api.github.com/repos/abansal4032/CNUassignment/commits{/sha}","git_commits_url":"https://api.github.com/repos/abansal4032/CNUassignment/git/commits{/sha}","comments_url":"https://api.github.com/repos/abansal4032/CNUassignment/comments{/number}","issue_comment_url":"https://api.github.com/repos/abansal4032/CNUassignment/issues/comments{/number}","contents_url":"https://api.github.com/repos/abansal4032/CNUassignment/contents/{+path}","compare_url":"https://api.github.com/repos/abansal4032/CNUassignment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abansal4032/CNUassignment/merges","archive_url":"https://api.github.com/repos/abansal4032/CNUassignment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abansal4032/CNUassignment/downloads","issues_url":"https://api.github.com/repos/abansal4032/CNUassignment/issues{/number}","pulls_url":"https://api.github.com/repos/abansal4032/CNUassignment/pulls{/number}","milestones_url":"https://api.github.com/repos/abansal4032/CNUassignment/milestones{/number}","notifications_url":"https://api.github.com/repos/abansal4032/CNUassignment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abansal4032/CNUassignment/labels{/name}","releases_url":"https://api.github.com/repos/abansal4032/CNUassignment/releases{/id}","deployments_url":"https://api.github.com/repos/abansal4032/CNUassignment/deployments","created_at":"2016-07-05T15:47:10Z","updated_at":"2016-07-05T15:47:10Z","pushed_at":"2016-07-06T12:38:52Z","git_url":"git://github.com/abansal4032/CNUassignment.git","ssh_url":"git@github.com:abansal4032/CNUassignment.git","clone_url":"https://github.com/abansal4032/CNUassignment.git","svn_url":"https://github.com/abansal4032/CNUassignment","homepage":null,"size":159,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/abansal4032/CNUassignment/pulls/1"},"html":{"href":"https://github.com/abansal4032/CNUassignment/pull/1"},"issue":{"href":"https://api.github.com/repos/abansal4032/CNUassignment/issues/1"},"comments":{"href":"https://api.github.com/repos/abansal4032/CNUassignment/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/abansal4032/CNUassignment/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/abansal4032/CNUassignment/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/abansal4032/CNUassignment/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/abansal4032/CNUassignment/statuses/1ce35ed1ae9c9395dd9733be36f12bb3c48d5651"}}}}
{"actor":{"display_login":"hkhurana"}}