The SortedKeyed class keeps its elements in ascending order.
inherits
State supers: Keyed
methods
deferred Enumerator between (Comparable, Comparable) (start, last); |
Enumerate the elements in an interval. nil at the either end signifies the first or the last element.
deferred Any lowest; |
Undocumented.
deferred Any highest; |
Undocumented.
deferred redeclare Any at Comparable object; |
Undocumented.
deferred redeclare Any member Comparable object; |
Undocumented.
deferred redeclare Any memq Comparable object; |
Undocumented.
inherits
State supers: SortedKeyed, MutableKeyed
methods
redeclare void add Comparable object; |
Undocumented.
redeclare void remove Comparable object; |
Undocumented.
inherits
State supers: Mapped, SortedKeyed
methods
deferred Enumerator valuesOfKeysBetween (Comparable, Comparable) (start, last) includeLeft: boolean incleft = TRUE includeRight: boolean incright = TRUE; |
Enumerate the values in an interval.
inherits
State supers: MutableSortedKeyed, MutableMapped
methods
deferred redeclare void set All value at Comparable key; |
Undocumented.
inherits
State supers: SortedKeyed
variables
The array we employ to actually store the contents.
methods
boolean (result)
verifySortedContents;
|
Undocumented.
id initWithSortedEnumerator Enumerator e post [self verifySortedContents]; |
Undocumented.
id initWithEnumerator Enumerator e; |
Undocumented.
ObjectArray allKeys; |
Undocumented.
(boolean, int) indexOf Comparable object; |
The guts of the binary search algorithm.
Any at Comparable object; |
Undocumented.
Enumerator valuesOfKeysBetween (Comparable, Comparable) (start, last) includeLeft: boolean incleft = TRUE includeRight: boolean incright = TRUE; |
Undocumented.
Any lowest pre [contents length] != 0; |
Undocumented.
Any highest pre [contents length] != 0; |
Undocumented.
inherits
State supers: MutableSortedKeyed, SortedObjectArray
methods
void
empty;
|
Undocumented.
void
freeze;
|
Undocumented.
void add Comparable object; |
Add an object.
Note that adding elements one-by-one to a MutableSortedObjectArray will work as an insertion sort, with quadratic performance. Use addElementsFrom with another sorted set instead, as it is much more efficient. Also, do not use addElementsFromEnumerator unless you know that the enumerator is sorted (and then use addElementsFromSortedEnumerator.
void addElementsFrom Collection object; |
addElementsFrom performs in time proportional to the *sum* of the number of elements in both collections, if the other collection is a SortedKeyed. Otherwise the complexity is equal to the *product* of the number of the elements.
void addElementsFromSortedEnumerator Enumerator j post [self verifySortedContents]; |
Undocumented.
void removeElementsFrom Collection object; |
Undocumented.
void removeElementsFromSortedEnumerator Enumerator j post [self verifySortedContents]; |
Undocumented.
void keepElementsFrom Collection object; |
Undocumented.