Class calitha.collections.ICollection
The interface for all list and set based collections.
It is based on the Java Collection interface. Differences are:
- additional calitha.collections.ICollection#forEach method
Defined in: ICollection.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
add(element)
Ensures that this collection contains the specified element.
|
|
addAll(collection)
Adds all of the elements in the specified collection to this collection.
|
|
clear()
Removes all of the elements from this collection.
|
|
contains(element)
Returns true if this collection contains the specified element.
|
|
containsAll(collection)
Returns true if this collection contains all of the elements in the specified collection.
|
|
equals(obj)
Compares the specified object with this collection for equality.
|
|
forEach(func, scope)
Executes a function for each element in this collection.
|
|
hashCode()
Returns the hash code value for this collection.
|
|
isEmpty()
Returns true if this collection contains no elements.
|
|
iterator()
Returns an iterator over the elements in this collection.
|
|
remove(element)
Removes a single instance of the specified element from this collection, if it is present.
|
|
removeAll(collection)
Removes all of this collection's elements that are also contained in the specified collection.
|
|
retainAll(collection)
Retains only the elements in this collection that are contained in the specified collection.
|
|
size()
Returns the number of elements in this collection.
|
|
toArray()
Returns an array containing all of the elements in this collection.
|
Method Detail
{Boolean}
add(element)
Ensures that this collection contains the specified element.
- Parameters:
- {Object} element
- element whose presence in this collection is to be ensured
- Returns:
- {Boolean} true if this collection changed as a result of the call
{Boolean}
addAll(collection)
Adds all of the elements in the specified collection to this collection.
- Parameters:
- {calitha.collections.ICollection} collection
- collection containing elements to be added to this collection
- Returns:
- {Boolean} true if this collection changed as a result of the call
clear()
Removes all of the elements from this collection.
{Boolean}
contains(element)
Returns true if this collection contains the specified element.
- Parameters:
- {Object} element
- element whose presence in this collection is to be tested
- Returns:
- {Boolean} true if this collection contains the specified element
{Boolean}
containsAll(collection)
Returns true if this collection contains all of the elements in the specified collection.
- Parameters:
- {calitha.collections.ICollection} collection
- collection to be checked for containment in this collection
- Returns:
- {Boolean} true if this collection contains all of the elements in the specified collection
{Boolean}
equals(obj)
Compares the specified object with this collection for equality.
- Parameters:
- {Object} obj
- object to be compared for equality with this collection
- Returns:
- {Boolean} true if the specified object is equal to this collection
forEach(func, scope)
Executes a function for each element in this collection.
- Parameters:
- {Function} func
- function to execute
- {Object?} scope
- optional scope for the function to run in
{Number}
hashCode()
Returns the hash code value for this collection.
- Returns:
- {Number} the hash code value for this collection
{Boolean}
isEmpty()
Returns true if this collection contains no elements.
- Returns:
- {Boolean} true if this collection contains no elements
{calitha.collections.IIterator}
iterator()
Returns an iterator over the elements in this collection.
- Returns:
- {calitha.collections.IIterator} an Iterator over the elements in this collection
{Object}
remove(element)
Removes a single instance of the specified element from this collection, if it is present.
- Parameters:
- {Object} element
- element to be removed from this collection, if present
- Returns:
- {Object} true if an element was removed as a result of this call
{Boolean}
removeAll(collection)
Removes all of this collection's elements that are also contained in the specified collection.
- Parameters:
- {calitha.collections.ICollection} collection
- collection containing elements to be removed from this collection
- Returns:
- {Boolean} true if this collection changed as a result of the call
{Boolean}
retainAll(collection)
Retains only the elements in this collection that are contained in the specified collection.
- Parameters:
- {calitha.collections.ICollection} collection
- collection containing elements to be retained in this collection
- Returns:
- {Boolean} true if this collection changed as a result of the call
{Number}
size()
Returns the number of elements in this collection.
- Returns:
- {Number} the number of elements in this collection
{Array}
toArray()
Returns an array containing all of the elements in this collection.
- Returns:
- {Array} an array containing all of the elements in this collection