addSorted method
void
addSorted(
- E item
adds a new item to the list, maintaining the sort order
Implementation
void addSorted(E item) {
if (_compare == null || _items.isEmpty) {
add(item);
return;
}
int insertIndex = _findInsertionIndex(item);
insert(insertIndex, item);
}