Class TopListItem
java.lang.Object
yearreview.app.data.processor.toplist.TopListItem
- All Implemented Interfaces:
TopListCompatibleItem
Basic Implementation of
TopListCompatibleItem that can be used if no special functionality is needed.- Author:
- ColdStone37
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTopListItem(String main) Constructs a TopListItem with only main text givenTopListItem(String main, String sub) Constructs a TopListItem with only text givenTopListItem(String main, String sub, ImageReference img) Constructs a TopListItem from all Values. -
Method Summary
Modifier and TypeMethodDescriptiongetImage()Gets the Image that should be displayed alongside the data.Gets the main text.Gets the sub text.booleanGets whether the item has a sub text.
-
Field Details
-
mainText
Main text to display for the item. -
subText
Sub text to display for the item. -
img
Image to display alongside the item.
-
-
Constructor Details
-
TopListItem
Constructs a TopListItem from all Values.- Parameters:
main- main text to displaysub- sub text to displayimg- image to display alongside
-
TopListItem
Constructs a TopListItem with only text given- Parameters:
main- main text to displaysub- sub text to display
-
TopListItem
Constructs a TopListItem with only main text given- Parameters:
main- main text to display
-
-
Method Details
-
getMainText
Gets the main text.- Specified by:
getMainTextin interfaceTopListCompatibleItem- Returns:
- main text
-
getSubText
Gets the sub text. Value Does not necessarily need to be set (Can be checked using thehasSubText()-function).- Specified by:
getSubTextin interfaceTopListCompatibleItem- Returns:
- sub text
-
hasSubText
public boolean hasSubText()Gets whether the item has a sub text.- Specified by:
hasSubTextin interfaceTopListCompatibleItem- Returns:
- true if
subText != null, false otherwise
-
getImage
Gets the Image that should be displayed alongside the data. Might be null if it was not set.- Specified by:
getImagein interfaceTopListCompatibleItem- Returns:
- Reference to Image
-