{"action":"created","issue":{"url":"https://api.github.com/repos/sjgilbert/Unanimus/issues/6","labels_url":"https://api.github.com/repos/sjgilbert/Unanimus/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/sjgilbert/Unanimus/issues/6/comments","events_url":"https://api.github.com/repos/sjgilbert/Unanimus/issues/6/events","html_url":"https://github.com/sjgilbert/Unanimus/pull/6","id":93491893,"number":6,"title":"Settings","user":{"login":"Izzette","id":7987724,"avatar_url":"https://avatars.githubusercontent.com/u/7987724?v=3","gravatar_id":"","url":"https://api.github.com/users/Izzette","html_url":"https://github.com/Izzette","followers_url":"https://api.github.com/users/Izzette/followers","following_url":"https://api.github.com/users/Izzette/following{/other_user}","gists_url":"https://api.github.com/users/Izzette/gists{/gist_id}","starred_url":"https://api.github.com/users/Izzette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Izzette/subscriptions","organizations_url":"https://api.github.com/users/Izzette/orgs","repos_url":"https://api.github.com/users/Izzette/repos","events_url":"https://api.github.com/users/Izzette/events{/privacy}","received_events_url":"https://api.github.com/users/Izzette/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-07T09:59:12Z","updated_at":"2015-07-08T18:30:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sjgilbert/Unanimus/pulls/6","html_url":"https://github.com/sjgilbert/Unanimus/pull/6","diff_url":"https://github.com/sjgilbert/Unanimus/pull/6.diff","patch_url":"https://github.com/sjgilbert/Unanimus/pull/6.patch"},"body":"# Settings\r\nThis attempts to implement the basic functionality of relatively elaborate settings we will need to aid in restaurant selection.  It is not totally functional yet, but getting close.\r\n\r\n## JSON dependant\r\nThis package builds a setting tree from a `JSONObject`, and after modification, create a new `JSONObject` and save the current setting state.\r\nThis `JSONObject` could be stringified and pushed to the parse server as a field of User.\r\n\r\n## File system\r\nThis package is modeled after a file system.  It will support many kind of lookups and searches.  Objects elsewhere in the application can be given access to a \"directory\", and all of it's members.  It can also grant rights to access any subdirectories, and so it goes.\r\n* `SettingTree` is the container for the root of our settings.  Originally, I was planning on making it the only interface to our settings.  However, I now feel that direct access to setting objects is more sound.  Although direct access may puts a tiny bit more strain on the implementation of accessing settings elsewhere.\r\n* `ASetting` is the abstract class all setting objects extend.  This includes `SettingEdge`, `SettingNode`, and `SettingArray`.\r\n* `SettingEdge` is essentially a directory, it can hold any `Class<? extends ASetting>`.  It implements `Collection<ASetting>` so it is highly modular.  However, it should likely only be used to add wings when the divert from their default values.  Perhaps it is not good to implement `Collection<ASetting>` here.\r\n* `SettingNode` is the simple kind of file, it can have value.  Techincally. the value's type is `Object`, but in practice it can only be the types that JSONObjects can hold, and those are `boolean`, `String`, `int`, `long` and `double`.\r\n* `SettingArray` is a special type of file, one that can be indexed like an array.  It implements `Collection` so it is highly modular.\r\n* `SettingPath` allows you to lookup an instance of `ASetting` with a known path.\r\n\r\nAnyways, it's 5 AM and I've been coding all night.  We should talk about this later today.\r\n"},"comment":{"url":"https://api.github.com/repos/sjgilbert/Unanimus/issues/comments/119690172","html_url":"https://github.com/sjgilbert/Unanimus/pull/6#issuecomment-119690172","issue_url":"https://api.github.com/repos/sjgilbert/Unanimus/issues/6","id":119690172,"user":{"login":"Izzette","id":7987724,"avatar_url":"https://avatars.githubusercontent.com/u/7987724?v=3","gravatar_id":"","url":"https://api.github.com/users/Izzette","html_url":"https://github.com/Izzette","followers_url":"https://api.github.com/users/Izzette/followers","following_url":"https://api.github.com/users/Izzette/following{/other_user}","gists_url":"https://api.github.com/users/Izzette/gists{/gist_id}","starred_url":"https://api.github.com/users/Izzette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Izzette/subscriptions","organizations_url":"https://api.github.com/users/Izzette/orgs","repos_url":"https://api.github.com/users/Izzette/repos","events_url":"https://api.github.com/users/Izzette/events{/privacy}","received_events_url":"https://api.github.com/users/Izzette/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T18:30:32Z","updated_at":"2015-07-08T18:30:32Z","body":"Implementations may look like:\r\n```java\r\npublic class needsUser {\r\n\tpublic static String getUser() {\r\n\t\treturn (String) ((SettingNode)SettingTree.settings.getSetting(path)).get();\r\n\t}\r\n\t\r\n\tprivate final static SettingAbsolutePath path = new SettingAbsolutePath(R.string.user_name);\r\n}\r\n\r\nAfter next commit implementations will look like:\r\n```java\r\npublic class needsUser {\r\n\tpublic static String getUser() {\r\n\t\treturn SettingTree.settings.getSetting(path).get();\r\n\t}\r\n\t\r\n\tprivate final static SettingAbsolutePath<SettingNode<String>> path = new SettingAbsolutePath<SettingNode<String>> ();\r\n}\r\n```"}}