Class TopListGenerator
java.lang.Object
yearreview.app.data.processor.toplist.TopListGenerator
Generates a TopList of
TopListElements
by sorting them by their associated Value
.- Author:
- ColdStone37
-
Field Summary
Modifier and TypeFieldDescriptionprivate final TopListAdapter
Adapter used to get theTopListElements
from aDataSource
.private final TopListElementComparator
Comparator used to sort theTopListElements
.private final int
Length of the TopList to generate. -
Constructor Summary
ConstructorDescriptionTopListGenerator
(TopListAdapter adapter, int topListLength, ValueType sortingValue) Constructs a new TopListGenerator from an Adapter and a length. -
Method Summary
Modifier and TypeMethodDescription
-
Field Details
-
adapter
Adapter used to get theTopListElements
from aDataSource
. -
topListLength
private final int topListLengthLength of the TopList to generate. -
comparator
Comparator used to sort theTopListElements
.
-
-
Constructor Details
-
TopListGenerator
Constructs a new TopListGenerator from an Adapter and a length.- Parameters:
adapter
- Adapter to use for getting the data from aDataSource
topListLength
- Length of the TopList to generatesortingValue
- type ofValue
to sort by
-
-
Method Details
-
getTopList
- Parameters:
t
- time until which to generate the TopList- Returns:
- TopList of the elements
-