java.lang.Object
yearreview.app.data.sources.audio.database.AudioData
All Implemented Interfaces:
Comparable<AudioData>, TopListCompatibleItem
Direct Known Subclasses:
AudioPiece

public class AudioData extends Object implements Comparable<AudioData>, TopListCompatibleItem
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
  • Field Details

    • name

      public final String name
      Might store an artist-, album- or podcast-name.
    • type

      public final AudioData.Type type
      Type of data stored in this Object.
    • cover

      private ImageReference cover
      Image to display alongside this data if available.
  • Constructor Details

    • AudioData

      public AudioData(String name, AudioData.Type type)
      Constructs an AudioData-object with name and type.
      Parameters:
      name - data to store
      type - type of data stored in this object
    • AudioData

      public AudioData(String name, AudioData.Type type, ImageReference cover)
      Constructs an AudioData-object with name, type and image.
      Parameters:
      name - data to store
      type - type of data stored in this object
      cover - cover to display alongside the name
  • Method Details

    • compareTo

      public int compareTo(AudioData other)
      Compares AudioData-objects alphabetically by name.
      Specified by:
      compareTo in interface Comparable<AudioData>
      Parameters:
      other - AudioData-object to compare against
      Returns:
      result of alphabetical comparison
    • addCover

      public void addCover(ImageReference cover)
      Adds a cover to an AudioData-object after initialization.
      Parameters:
      cover - cover to add ti the data
    • getMainText

      public String getMainText()
      Gets the main text.
      Specified by:
      getMainText in interface TopListCompatibleItem
      Returns:
      main text
    • getSubText

      public String getSubText()
      Since no sub text is available null is returned.
      Specified by:
      getSubText in interface TopListCompatibleItem
      Returns:
      null
    • hasSubText

      public boolean hasSubText()
      Always returns false since AudioData does not provide a sub text.
      Specified by:
      hasSubText in interface TopListCompatibleItem
      Returns:
      false
    • getImage

      public ImageReference getImage()
      Gets the image associated the data. Might be null.
      Specified by:
      getImage in interface TopListCompatibleItem
      Returns:
      associated image