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
FieldsModifier and TypeFieldDescriptionprivate final TopListAdapterAdapter used to get theTopListElementsfrom aDataSource.private final TopListElementComparatorComparator used to sort theTopListElements.private final intLength of the TopList to generate. -
Constructor Summary
ConstructorsConstructorDescriptionTopListGenerator(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 theTopListElementsfrom 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 aDataSourcetopListLength- Length of the TopList to generatesortingValue- type ofValueto sort by
-
-
Method Details
-
getTopList
- Parameters:
t- time until which to generate the TopList- Returns:
- TopList of the elements
-