1 dojo.provide("calitha.collections.IList");
  2 dojo.require("calitha.collections.ICollection");
  3 dojo.require("calitha.exception.VirtualFunctionException");
  4 
  5 /**
  6  * @name calitha.collections.IList
  7  * @class An ordered collection (also known as a sequence).
  8  * <p>
  9  * It is based on the
 10  * <a href="http://java.sun.com/javase/6/docs/api/java/util/List.html">Java List interface</a>.
 11  * Differences are:
 12  * <p>
 13  * <ul>
 14  * <li>The Java remove method using an int index has been changed to {@link calitha.collections.IList#del}
 15  * <li>The Java add method using an int index has been changed to {@link calitha.collections.IList#insert}
 16  * <li>The Java addAll method using an int index has been changed to {@link calitha.collections.IList#insertAll}
 17  * </ul>
 18  * @extends calitha.collections.ICollection
 19  */
 20 dojo.declare("calitha.collections.IList", calitha.collections.ICollection,
 21 /** @lends calitha.collections.IList# */
 22 {
 23     /**
 24      * @function
 25      * @param index the index of the element to be removed 
 26      * @returns {Boolean} the element previously at the specified position 
 27      * @description Removes the element at the specified position in this list.
 28      */
 29     del: function(/**Number*/ index)
 30     {throw new calitha.exception.VirtualFunctionException(Error());}
 31     ,
 32     /**
 33      * @function
 34      * @param index index of the element to return 
 35      * @returns {Object} the element at the specified position in this list
 36      * @description Returns the element at the specified position in this list.
 37      */
 38     get: function(/**Number*/ index)
 39     {throw new calitha.exception.VirtualFunctionException(Error());}
 40     ,
 41     /**
 42      * @function
 43      * @param element element to search for 
 44      * @returns {Number} the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element
 45      * @description Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
 46      */
 47     indexOf: function(/**Object*/ element)
 48     {throw new calitha.exception.VirtualFunctionException(Error());}
 49     ,
 50     /**
 51      * @function
 52      * @param index index at which the specified element is to be inserted
 53      * @param element element to be inserted 
 54      * @description Inserts the specified element at the specified position in this list.
 55      */
 56     insert: function(/**Number*/ index, /**Object*/ element)
 57     {throw new calitha.exception.VirtualFunctionException(Error());}
 58     ,
 59     /**
 60      * @function
 61      * @param index index at which to insert the first element from the specified collection
 62      * @param collection collection containing elements to be added to this list 
 63      * @returns {Boolean} true if this list changed as a result of the call 
 64      * @description Inserts all of the elements in the specified collection into this list at the specified position.
 65      */
 66     insertAll: function(/**Number*/ index, /**calitha.collections.ICollection*/ collection)
 67     {throw new calitha.exception.VirtualFunctionException(Error());}
 68     ,
 69     /**
 70      * @function
 71      * @param element element to search for 
 72      * @returns {Number} the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element 
 73      * @description Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.
 74      */
 75     lastIndexOf: function(/**Object*/ element)
 76     {throw new calitha.exception.VirtualFunctionException(Error());}
 77     ,
 78     /**
 79      * @function
 80      * @param index optional index of first element to be returned from the list iterator. Default value is 0.
 81      * @returns {calitha.collections.IListIterator} a list iterator over the elements in this list (in proper sequence)
 82      * @description Returns a list iterator over the elements in this list (in proper sequence).
 83      */
 84     listIterator: function(/**Number?*/ index)
 85     {throw new calitha.exception.VirtualFunctionException(Error());}
 86     ,
 87     /**
 88      * @function
 89      * @param index index of the element to replace
 90      * @param element element to be stored at the specified position 
 91      * @returns {Object} the element previously at the specified position
 92      * @description Replaces the element at the specified position in this list with the specified element.
 93      */
 94     set: function(/**Number*/ index, /**Object*/ element)
 95     {throw new calitha.exception.VirtualFunctionException(Error());}
 96     ,
 97     /**
 98      * @function
 99      * @param comparator optional comparator that is a IComparator or a function  
100      * @description Sorts the specified list based on the comparator or IComparable elements if there is no comparator
101      */
102     sort: function(/**(calitha.collections.IComparator|Function)?*/ comparator)
103     {throw new calitha.exception.VirtualFunctionException(Error());}
104     ,
105     /**
106      * @function
107      * @param fromIndex low endpoint (inclusive) of the subList
108      * @oaran toIndex high endpoint (exclusive) of the subList 
109      * @returns {calitha.collections.IList} a view of the specified range within this list 
110      * @description Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
111      */
112     subList: function(/**Number*/ fromIndex, /**Number*/ toIndex)
113     {throw new calitha.exception.VirtualFunctionException(Error());}
114 });
115