1 dojo.provide("calitha.collections.ICollection"); 2 dojo.require("calitha.exception.VirtualFunctionException"); 3 4 /** 5 * @name calitha.collections.ICollection 6 * @class The interface for all list and set based collections. 7 * <p> 8 * It is based on the 9 * <a href="http://java.sun.com/javase/6/docs/api/java/util/Collection.html">Java Collection interface</a>. 10 * Differences are: 11 * <p> 12 * <ul> 13 * <li>additional {@link calitha.collections.ICollection#forEach} method 14 * </ul> 15 * 16 */ 17 dojo.declare("calitha.collections.ICollection", null, 18 /** @lends calitha.collections.ICollection#*/ 19 { 20 /** 21 * @function 22 * @param element element whose presence in this collection is to be ensured 23 * @returns {Boolean} true if this collection changed as a result of the call 24 * @description Ensures that this collection contains the specified element. 25 */ 26 add: function(/**Object*/ element) 27 {throw new calitha.exception.VirtualFunctionException(Error());} 28 , 29 /** 30 * @function 31 * @param collection collection containing elements to be added to this collection 32 * @returns {Boolean} true if this collection changed as a result of the call 33 * @description Adds all of the elements in the specified collection to this collection. 34 */ 35 addAll: function(/**calitha.collections.ICollection*/ collection) 36 {throw new calitha.exception.VirtualFunctionException(Error());} 37 , 38 /** 39 * @function 40 * @description Removes all of the elements from this collection. 41 */ 42 clear: function() 43 {throw new calitha.exception.VirtualFunctionException(Error());} 44 , 45 /** 46 * @function 47 * @param element element whose presence in this collection is to be tested 48 * @returns {Boolean} true if this collection contains the specified element 49 * @description Returns true if this collection contains the specified element. 50 */ 51 contains: function(/**Object*/ element) 52 {throw new calitha.exception.VirtualFunctionException(Error());} 53 , 54 /** 55 * @function 56 * @param collection collection to be checked for containment in this collection 57 * @returns {Boolean} true if this collection contains all of the elements in the specified collection 58 * @description Returns true if this collection contains all of the elements in the specified collection. 59 */ 60 containsAll: function(/**calitha.collections.ICollection*/ collection) 61 {throw new calitha.exception.VirtualFunctionException(Error());} 62 , 63 /** 64 * @function 65 * @param obj object to be compared for equality with this collection 66 * @returns {Boolean} true if the specified object is equal to this collection 67 * @description Compares the specified object with this collection for equality. 68 */ 69 equals: function(/**Object*/ obj) 70 {throw new calitha.exception.VirtualFunctionException(Error());} 71 , 72 /** 73 * @param func function to execute 74 * @param scope optional scope for the function to run in 75 * @function 76 * @description Executes a function for each element in this collection. 77 */ 78 forEach: function(/**Function*/ func, /**Object?*/ scope) 79 {throw new calitha.exception.VirtualFunctionException(Error());} 80 , 81 /** 82 * @function 83 * @returns {Number} the hash code value for this collection 84 * @description Returns the hash code value for this collection. 85 */ 86 hashCode: function() 87 {throw new calitha.exception.VirtualFunctionException(Error());} 88 , 89 /** 90 * @function 91 * @returns {Boolean} true if this collection contains no elements 92 * @description Returns true if this collection contains no elements. 93 */ 94 isEmpty: function() 95 {throw new calitha.exception.VirtualFunctionException(Error());} 96 , 97 /** 98 * @function 99 * @returns {calitha.collections.IIterator} an Iterator over the elements in this collection 100 * @description Returns an iterator over the elements in this collection. 101 */ 102 iterator: function() 103 {throw new calitha.exception.VirtualFunctionException(Error());} 104 , 105 /** 106 * @function 107 * @param element element to be removed from this collection, if present 108 * @returns {Object} true if an element was removed as a result of this call 109 * @description Removes a single instance of the specified element from this collection, if it is present. 110 */ 111 remove: function(/**Object*/ element) 112 {throw new calitha.exception.VirtualFunctionException(Error());} 113 , 114 /** 115 * @function 116 * @param collection collection containing elements to be removed from this collection 117 * @returns {Boolean} true if this collection changed as a result of the call 118 * @description Removes all of this collection's elements that are also contained in the specified collection. 119 */ 120 removeAll: function(/**calitha.collections.ICollection*/ collection) 121 {throw new calitha.exception.VirtualFunctionException(Error());} 122 , 123 /** 124 * @function 125 * @param collection collection containing elements to be retained in this collection 126 * @returns {Boolean} true if this collection changed as a result of the call 127 * @description Retains only the elements in this collection that are contained in the specified collection. 128 */ 129 retainAll: function(/**calitha.collections.ICollection*/ collection) 130 {throw new calitha.exception.VirtualFunctionException(Error());} 131 , 132 /** 133 * @function 134 * @returns {Number} the number of elements in this collection 135 * @description Returns the number of elements in this collection. 136 */ 137 size: function() 138 {throw new calitha.exception.VirtualFunctionException(Error());} 139 , 140 /** 141 * @function 142 * @returns {Array} an array containing all of the elements in this collection 143 * @description Returns an array containing all of the elements in this collection. 144 */ 145 toArray: function() 146 {throw new calitha.exception.VirtualFunctionException(Error());} 147 }); 148