Class TopListElement
java.lang.Object
yearreview.app.data.processor.toplist.TopListElement
A TopListElement contains a
TopListCompatibleItem
and it's associated Values
.
The Values
can be updated using the addValue(yearreview.app.util.value.Value)
-function to make implementing the adapters
easier.- Author:
- ColdStone37
-
Field Summary
Modifier and TypeFieldDescriptionprivate static int
Counts the TopListElements already in existence.private final int
Identifier of the element.private final TopListCompatibleItem
Item to display information from.Values of the element, used for sorting and displaying. -
Constructor Summary
ConstructorDescriptionTopListElement
(TopListCompatibleItem item, List<Value> values) Constructs a TopListElement from an item and a list of Values.TopListElement
(TopListCompatibleItem item, Value value) Constructs a TopListElement from an item and a Value. -
Method Summary
-
Field Details
-
count
private static int countCounts the TopListElements already in existence. -
id
private final int idIdentifier of the element. Unique over all TopListElements. -
item
Item to display information from. -
values
Values of the element, used for sorting and displaying.
-
-
Constructor Details
-
TopListElement
Constructs a TopListElement from an item and a Value.- Parameters:
item
- item to get information fromvalue
- Value to associate to the item
-
TopListElement
Constructs a TopListElement from an item and a list of Values.- Parameters:
item
- item to get information fromvalues
- Values to associate to the item
-
-
Method Details
-
addValue
Adds a given Value to the internal Value of that type.- Parameters:
value
- Value to add to internal Value
-
getValue
Gets the Value associated to the item with a certain type.- Parameters:
type
- type of Value to get from the element- Returns:
- associated Value or null if no Value of that type exists
-
getItem
Gets the item of the element.- Returns:
- Item used to get information from
-