Generated by JsDoc Toolkit 2.3.2 on Sun Jun 13 2010 17:28:18 GMT+0200 (CEST)
HTML template: Codeview

Namespace calitha.collections

Version 1.0.

Defined in: _base.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
The collections namespace consists of static methods that supports the use of the collections framework.
Method Summary
Method Attributes Method Name and Description
<static>  
calitha.collections.caseInsenstiveStringComparator()
returns a comparator to compare string in a case insensitive way (only objects of type string).
<static>  
calitha.collections.makeNumberHashCompatible(number)
Makes a number with integer value compatible with hash-based collections.
<static>  
calitha.collections.makeStringHashCompatible(str)
Makes a string compativle with hash-based collections.
<static>  
calitha.collections.numberComparator()
returns a comparator to compare numbers.
<static>  
returns a comparator to compare case insensitive any object by getting its string representation.
<static>  
calitha.collections.objectAsStringComparator()
returns a comparator to compare any object by getting its string representation.
<static>  
calitha.collections.reverseNaturalOrder()
Returns a comparator that imposes the reverse of the natural ordering on a collection of objects that implement the IComparable interface.
<static>  
calitha.collections.reverseOrder(cmp)
Returns a comparator that imposes reverse ordering.
<static>  
calitha.collections.sort(list, comparator)
Sorts a list by using the comparator object/function.
<static>  
calitha.collections.stringComparator()
returns a comparator to compare string (only objects of type string).
Namespace Detail
calitha.collections
The collections namespace consists of static methods that supports the use of the collections framework. The methods operate or return collections or comparators. Probably the most important methods are those that make integer-based numbers and strings compatible as keys in hash-based collections.
Method Detail
<static> {calitha.collections.IComparator} calitha.collections.caseInsenstiveStringComparator()
returns a comparator to compare string in a case insensitive way (only objects of type string). The comparator can be used for tree-based collections.
Returns:
{calitha.collections.IComparator} comparator
<static> calitha.collections.makeNumberHashCompatible(number)
Makes a number with integer value compatible with hash-based collections. This is done by extending the object to include an equals and hashCode value. You can pass the Number.prototype to make all existing and new numbers compatible.
Parameters:
{Number} number
number to make compatible
<static> calitha.collections.makeStringHashCompatible(str)
Makes a string compativle with hash-based collections. This is done by extending the object to include an equals and hashCode value. You can pass String.prototype to make all existing and new strings compatible.
Parameters:
{String} str
string to make compatible
<static> {calitha.collections.IComparator} calitha.collections.numberComparator()
returns a comparator to compare numbers. The comparator can be used for tree-based collections.
Returns:
{calitha.collections.IComparator} comparator
<static> {calitha.collections.IComparator} calitha.collections.objectAsCaseInsensitiveStringComparator()
returns a comparator to compare case insensitive any object by getting its string representation. The comparator can be used for tree-based collections.
Returns:
{calitha.collections.IComparator} comparator
<static> {calitha.collections.IComparator} calitha.collections.objectAsStringComparator()
returns a comparator to compare any object by getting its string representation. The comparator can be used for tree-based collections.
Returns:
{calitha.collections.IComparator} comparator
<static> calitha.collections.reverseNaturalOrder()
Returns a comparator that imposes the reverse of the natural ordering on a collection of objects that implement the IComparable interface.
Returns:
a comparator that imposes the reverse of the natural ordering
<static> {calitha.collections.IComparator} calitha.collections.reverseOrder(cmp)
Returns a comparator that imposes reverse ordering. If a comparator is used, then the ordering is reversed on that comparator. Otherwise the elements must be IComparable and the natural ordering is reversed.
Parameters:
{calitha.collections.IComparator?} cmp
comparator optional comparator
Returns:
{calitha.collections.IComparator} comparator with reverse ordering
<static> calitha.collections.sort(list, comparator)
Sorts a list by using the comparator object/function. Or if the comparator is not specified, it uses the natural ordering which means the elements must be IComparable objects.
Parameters:
{calitha.collections.IList} list
list
{(calitha.collections.IComparator|Function)?} comparator
optional comparator
<static> {calitha.collections.IComparator} calitha.collections.stringComparator()
returns a comparator to compare string (only objects of type string). The comparator can be used for tree-based collections.
Returns:
{calitha.collections.IComparator} comparator