Class AudioData
java.lang.Object
yearreview.app.data.sources.audio.database.AudioData
- All Implemented Interfaces:
Comparable<AudioData>
,TopListCompatibleItem
- Direct Known Subclasses:
AudioPiece
Stores data about a
Piece
of audio (e.g. artists or albums).
An AudioPiece
extends this class and adds a List of AudioData that stores Data associated to the Piece.- Author:
- ColdStone37
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
An enum containing the different types of AudioData available. -
Field Summary
Modifier and TypeFieldDescriptionprivate ImageReference
Image to display alongside this data if available.final String
Might store an artist-, album- or podcast-name.final AudioData.Type
Type of data stored in this Object. -
Constructor Summary
ConstructorDescriptionAudioData
(String name, AudioData.Type type) Constructs an AudioData-object with name and type.AudioData
(String name, AudioData.Type type, ImageReference cover) Constructs an AudioData-object with name, type and image. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCover
(ImageReference cover) Adds a cover to an AudioData-object after initialization.int
Compares AudioData-objects alphabetically by name.getImage()
Gets the image associated the data.Gets the main text.Since no sub text is available null is returned.boolean
Always returns false since AudioData does not provide a sub text.
-
Field Details
-
name
Might store an artist-, album- or podcast-name. -
type
Type of data stored in this Object. -
cover
Image to display alongside this data if available.
-
-
Constructor Details
-
AudioData
Constructs an AudioData-object with name and type.- Parameters:
name
- data to storetype
- type of data stored in this object
-
AudioData
Constructs an AudioData-object with name, type and image.- Parameters:
name
- data to storetype
- type of data stored in this objectcover
- cover to display alongside the name
-
-
Method Details
-
compareTo
Compares AudioData-objects alphabetically by name.- Specified by:
compareTo
in interfaceComparable<AudioData>
- Parameters:
other
- AudioData-object to compare against- Returns:
- result of alphabetical comparison
-
addCover
Adds a cover to an AudioData-object after initialization.- Parameters:
cover
- cover to add ti the data
-
getMainText
Gets the main text.- Specified by:
getMainText
in interfaceTopListCompatibleItem
- Returns:
- main text
-
getSubText
Since no sub text is available null is returned.- Specified by:
getSubText
in interfaceTopListCompatibleItem
- Returns:
- null
-
hasSubText
public boolean hasSubText()Always returns false since AudioData does not provide a sub text.- Specified by:
hasSubText
in interfaceTopListCompatibleItem
- Returns:
- false
-
getImage
Gets the image associated the data. Might be null.- Specified by:
getImage
in interfaceTopListCompatibleItem
- Returns:
- associated image
-