#include <SortedList.h>
Inheritance diagram for util::SortedList< T, comparator >:

The items added to the list will always maintain ascending sort order by default. The order may be changed using the second template parameter. The objects added to the list must have well-defined copy behavior plus the operators > (or <) and == defined. They must also provide a default (empty) constructor. Primitive types can be used as such with no special actions. The implementation guarantees O(log(N)) complexity for searches. The complexity for insertions is at worst O(log(N) + N).
Template parameters:
Public Methods | |
| SortedList (int initialSlots=16, int blockSize=16) | |
| Constructs a new sorted list with the given initial capacity and block size. | |
| void | addElement (const T &element) |
| Adds an element to the list. | |
| int | indexOf (const T &element) const |
| Get the index of the first occurrence of the given element. | |
| void | setMaximumSize (int size) |
| Restrict the maximum size of this list to size. | |
| int | getMaximumSize (void) |
| Get the maximum size of the list. | |
|
||||||||||||||||
|
Constructs a new sorted list with the given initial capacity and block size.
|
|
||||||||||
|
Adds an element to the list. The added element must be of some elementary type or define the operators >, >= and ==. It must also provide a default (parameterless) constructor.
Reimplemented from util::List< T >. |
|
||||||||||
|
Restrict the maximum size of this list to size. If the size of the list exceeds this value, the last element will be discarded.
|