Class AudioPiece
java.lang.Object
yearreview.app.data.sources.audio.database.AudioData
yearreview.app.data.sources.audio.database.AudioPiece
- All Implemented Interfaces:
Comparable<AudioData>
,TopListCompatibleItem
- Author:
- ColdStone37
-
Nested Class Summary
Nested classes/interfaces inherited from class yearreview.app.data.sources.audio.database.AudioData
AudioData.Type
-
Field Summary
Modifier and TypeFieldDescriptionList of data associated to the piece.private final String
Sub text displayed alongside the name of the piece (mostly names of authors). -
Constructor Summary
ConstructorDescriptionAudioPiece
(String name, AudioData.Type type, List<AudioData> data) Constructs and AudioPiece from name, type and associated data. -
Method Summary
Modifier and TypeMethodDescriptionfilterData
(AudioData.Type type) Filters thedata
associated with the piece by a given type.Get the sub text of the piece.boolean
Gets whether the piece has a sub text.Methods inherited from class yearreview.app.data.sources.audio.database.AudioData
addCover, compareTo, getImage, getMainText
-
Field Details
-
data
List of data associated to the piece. -
subtext
Sub text displayed alongside the name of the piece (mostly names of authors).
-
-
Constructor Details
-
AudioPiece
Constructs and AudioPiece from name, type and associated data.- Parameters:
name
- name of the piecetype
- type of the piece (AudioData.Type.isPiece()
must be true)data
- data to store alongside the piece
-
-
Method Details
-
getSubText
Get the sub text of the piece.- Specified by:
getSubText
in interfaceTopListCompatibleItem
- Overrides:
getSubText
in classAudioData
- Returns:
- sub text
-
hasSubText
public boolean hasSubText()Gets whether the piece has a sub text. Pieces might not have a subtext if it could not be created from the associated data.- Specified by:
hasSubText
in interfaceTopListCompatibleItem
- Overrides:
hasSubText
in classAudioData
- Returns:
- true if the piece has a sub text, otherwise null
-
filterData
Filters thedata
associated with the piece by a given type.- Parameters:
type
- type to filter the data by- Returns:
- List of data filtered by the given type
-