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

public class AudioPiece extends AudioData
An AudioPiece extends AudioData by adding a List of data associated to the piece and a subtext.
Author:
ColdStone37
  • Field Details

    • data

      private final List<AudioData> data
      List of data associated to the piece.
    • subtext

      private final String subtext
      Sub text displayed alongside the name of the piece (mostly names of authors).
  • Constructor Details

    • AudioPiece

      public AudioPiece(String name, AudioData.Type type, List<AudioData> data)
      Constructs and AudioPiece from name, type and associated data.
      Parameters:
      name - name of the piece
      type - type of the piece (AudioData.Type.isPiece() must be true)
      data - data to store alongside the piece
  • Method Details

    • getSubText

      public String getSubText()
      Get the sub text of the piece.
      Specified by:
      getSubText in interface TopListCompatibleItem
      Overrides:
      getSubText in class AudioData
      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 interface TopListCompatibleItem
      Overrides:
      hasSubText in class AudioData
      Returns:
      true if the piece has a sub text, otherwise null
    • filterData

      public final List<AudioData> filterData(AudioData.Type type)
      Filters the data 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