T
- type of the stored items.C
- type of the quantities associated with the items.public class BoundedSortedList<T,C extends Comparable<C>> extends Object
Constructor and Description |
---|
BoundedSortedList(int capacity)
Construct a new list.
|
BoundedSortedList(int capacity,
Comparator<C> comparator)
Construct a new list.
|
BoundedSortedList(int capacity,
int maxCapacity)
Construct a new list.
|
BoundedSortedList(int capacity,
int maxCapacity,
Comparator<C> comparator)
Construct a new list.
|
Modifier and Type | Method and Description |
---|---|
void |
add(T item,
C quantity)
Add an item and its associated quantity to the list.
|
List<T> |
getItems()
Get a items of this list.
|
public BoundedSortedList(int capacity)
capacity
- capacity (and maxCapacity) of the list.public BoundedSortedList(int capacity, Comparator<C> comparator)
capacity
- capacity (and maxCapacity) of the list.comparator
- comparator for the quantities.public BoundedSortedList(int capacity, int maxCapacity)
capacity
- capacity of the list (as perceived by users).maxCapacity
- real capacity of the underlying list to mitigate the anomaly described in Javadoc of the class.public BoundedSortedList(int capacity, int maxCapacity, Comparator<C> comparator)
capacity
- capacity of the list (as perceived by users).maxCapacity
- real capacity of the underlying list to mitigate the anomaly described in Javadoc of the class.comparator
- comparator for the quantities.Copyright © 2013-2016–2017 Graph Aware Limited. All rights reserved.