Author: ygrego Date: 2015-02-03 14:53:12 +0000 (Tue, 03 Feb 2015) New Revision: 760 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/760 Log: Adding of classes 'Collection', 'TunerCollection', respectively into 'Collection.js' and 'init.js'. Added: oipf/js/lib/Collection.js Modified: oipf/js/impl/ConfigurationObject.js oipf/js/initObj/init.js Modified: oipf/js/impl/ConfigurationObject.js =================================================================== --- oipf/js/impl/ConfigurationObject.js 2015-02-02 16:54:52 UTC (rev 759) +++ oipf/js/impl/ConfigurationObject.js 2015-02-03 14:53:12 UTC (rev 760) @@ -4,6 +4,7 @@ * provides an interface to the configuration and user settings facilities within the OITF. */ var ConfigurationObject = Class.extend({ + /* * Description: * Accesses the configuration object that sets defaults and shows system settings. @@ -37,15 +38,3 @@ }); - -/* -* Description: -* The LocalSystem object allows hardware settings related to the local device to be read and modified. -* Note: The standbyState property has been removed from this class. -* -*/ -var LocalSystem = Class.extend({ - - - -}) \ No newline at end of file Modified: oipf/js/initObj/init.js =================================================================== --- oipf/js/initObj/init.js 2015-02-02 16:54:52 UTC (rev 759) +++ oipf/js/initObj/init.js 2015-02-03 14:53:12 UTC (rev 760) @@ -8,12 +8,50 @@ /* * Description: +* The TunerCollection class represents a collection of Tuner objects. See Annex K for the definition of the collection template. +* +*/ +var TunerCollection = Collection.extend({ + + init : function(elements) { + + super.init(elements); + } + +}); + +/* +* Description: * The LocalSystem object allows hardware settings related to the local device to be read and modified. * * Note: The standbyState property has been removed from this class. */ var LocalSystem = Class.extend({ + /* + * Description: + * Get or set the overall system volume. Valid values for this property are in the range 0 - 100. The OITF SHALL store this setting persistently. + * + * Type: Integer + */ + volume: null, + + /* + * Description: + * Get or set the mute status of the default audio output(s). A value of true indicates that the default output(s) are currently muted. + * + * Type: Boolean + */ + mute: null, + + /* + * Description: + * A collection of Tuner objects representing the physical tuners available in the OITF. + * + * Visibility Type: readonly TunerCollection + */ + tuners: null, + init: function() { } @@ -165,5 +203,6 @@ } }); + var oipfObjectFactory = new OipfObjectFactory(); var metadata = data; \ No newline at end of file Added: oipf/js/lib/Collection.js =================================================================== --- oipf/js/lib/Collection.js (rev 0) +++ oipf/js/lib/Collection.js 2015-02-03 14:53:12 UTC (rev 760) @@ -0,0 +1,39 @@ +/*--------------------------------------------TO-DO: True implementation of a collection---------------------------------------- +* Description: The Collection< T > class is a parameterized class whose instances are (possibly zero-length) collections of values of +* type T. The properties and methods defined below SHALL be present on any instance of a Collection< T > class. +* Instances of a Collection< T > class SHALL support the use of array notation to access objects in the collection. +* Instances of a Collection< T > class SHALL be considered to be immutable, except by APIs defined on the collection. +* Attempts to insert items into instances of a Collection< T > class using array notation SHALL fail. +*/ +var Collection = Class.extend({ + + elts: null, + + /* + * Description: + * The number of items in the collection. + * + * Visibility Type: readonly Integer + */ + length: null, + + /* + * Description: + * Return the item at position index in the collection, or undefined if no item is present at that position. + * + * Argument: + * -index: The index of the item that SHALL be returned + * + */ + item: function(index) { + + return (this.length==0)? null: this.elts[index]; + }, + + init: function(elements) { + + this.length = elements.length; + this.elts = elements; + } + +}); \ No newline at end of file