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
FieldsModifier and TypeFieldDescriptionList of data associated to the piece.private final StringSub text displayed alongside the name of the piece (mostly names of authors). -
Constructor Summary
ConstructorsConstructorDescriptionAudioPiece(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 thedataassociated with the piece by a given type.Get the sub text of the piece.booleanGets 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:
getSubTextin interfaceTopListCompatibleItem- Overrides:
getSubTextin 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:
hasSubTextin interfaceTopListCompatibleItem- Overrides:
hasSubTextin classAudioData- Returns:
- true if the piece has a sub text, otherwise null
-
filterData
Filters thedataassociated with the piece by a given type.- Parameters:
type- type to filter the data by- Returns:
- List of data filtered by the given type
-