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
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enum containing the different types of AudioData available. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ImageReferenceImage to display alongside this data if available.final StringMight store an artist-, album- or podcast-name.final AudioData.TypeType of data stored in this Object. -
Constructor Summary
ConstructorsConstructorDescriptionAudioData(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 TypeMethodDescriptionvoidaddCover(ImageReference cover) Adds a cover to an AudioData-object after initialization.intCompares 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.booleanAlways 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:
compareToin 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:
getMainTextin interfaceTopListCompatibleItem- Returns:
- main text
-
getSubText
Since no sub text is available null is returned.- Specified by:
getSubTextin interfaceTopListCompatibleItem- Returns:
- null
-
hasSubText
public boolean hasSubText()Always returns false since AudioData does not provide a sub text.- Specified by:
hasSubTextin interfaceTopListCompatibleItem- Returns:
- false
-
getImage
Gets the image associated the data. Might be null.- Specified by:
getImagein interfaceTopListCompatibleItem- Returns:
- associated image
-