Class calitha.collections.ISortedSet
Extends
calitha.collections.ISet.
A Map that further provides a total ordering on its keys.
It is based on the Java SortedSet interface. Differences are:
- In Java it is the NavigableSet interface that has methods with extra inclusive parameters for subSet and such. Those methods have been put in this ISortedSet class to replace those same methods without the inclusive parameters. This is done because overloading methods with inheritance too would be too confusing. And the methods with inclusive parameters are more clear anyway.
Defined in: ISortedSet.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
A Set that further provides a total ordering on its elements.
|
|
first()
Returns the first (lowest) element currently in this set.
|
|
headSet(toElement, inclusive)
Returns a view of the portion of this set whose elements are less than
(or equal to, if inclusive is true) toElement.
|
|
last()
Returns the last (highest) element currently in this set.
|
|
subSet(fromElement, fromInclusive, toElement, toInclusive)
Returns a view of the portion of this set whose elements range from fromElement to toElement.
|
|
tailSet(fromElement, inclusive)
Returns a view of the portion of this set whose elements are greater than (or equal to,
if inclusive is true) fromElement.
|
- Methods borrowed from class calitha.collections.ICollection:
- add, addAll, clear, contains, containsAll, equals, forEach, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray
Method Detail
{calitha.collections.IComparator}
comparator()
A Set that further provides a total ordering on its elements.
- Returns:
- {calitha.collections.IComparator} the comparator used to order the elements in this set, or null if this set uses the natural ordering of its elements
{Object}
first()
Returns the first (lowest) element currently in this set.
- Returns:
- {Object} the first (lowest) element currently in this set
{calitha.collections.ISortedSet}
headSet(toElement, inclusive)
Returns a view of the portion of this set whose elements are less than
(or equal to, if inclusive is true) toElement.
- Parameters:
- {Object} toElement
- high endpoint of the returned set
- {Boolean} inclusive
- true if the high endpoint is to be included in the returned view
- Returns:
- {calitha.collections.ISortedSet} a view of the portion of this set whose elements are less than (or equal to, if inclusive is true) toElement
{Object}
last()
Returns the last (highest) element currently in this set.
- Returns:
- {Object} the last (highest) element currently in this set
{calitha.collections.ISortedSet}
subSet(fromElement, fromInclusive, toElement, toInclusive)
Returns a view of the portion of this set whose elements range from fromElement to toElement.
- Parameters:
- {Object} fromElement
- low endpoint of the returned set
- {Boolean} fromInclusive
- true if the low endpoint is to be included in the returned view
- {Object} toElement
- high endpoint of the returned set
- {Boolean} toInclusive
- true if the high endpoint is to be included in the returned view
- Returns:
- {calitha.collections.ISortedSet} a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive
{calitha.collections.ISortedSet}
tailSet(fromElement, inclusive)
Returns a view of the portion of this set whose elements are greater than (or equal to,
if inclusive is true) fromElement.
- Parameters:
- {Object} fromElement
- low endpoint of the returned set
- {Boolean} inclusive
- true if the low endpoint is to be included in the returned view
- Returns:
- {calitha.collections.ISortedSet} a view of the portion of this set whose elements are greater than or equal to fromElement