Interface Media

All Known Implementing Classes:
AudioBook, EBook, VideoMaterial

public interface Media
Interface for materials with multimedia content. Demonstrates interface segregation principle and multiple inheritance through interfaces.

This interface defines behavior for audio and video materials, including duration, format, and playback capabilities.

Since:
2024-09-15
Version:
2.0
Author:
Navid Mohaghegh
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Quality levels for media content.
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    estimateDownloadTime(double mbps)
    Calculates estimated download time based on connection speed.
    int
    Gets the duration of the media in minutes.
    double
    Gets the file size in megabytes.
    Gets the file format of the media.
    default String
    Gets playback information as a formatted string.
    Gets the quality setting for the media.
    boolean
    Checks if the media requires an internet connection.
  • Method Details

    • getDuration

      int getDuration()
      Gets the duration of the media in minutes.
      Returns:
      duration in minutes
    • getFormat

      String getFormat()
      Gets the file format of the media.
      Returns:
      format string (e.g., "MP3", "MP4", "WAV")
    • getFileSize

      double getFileSize()
      Gets the file size in megabytes.
      Returns:
      size in MB
    • isStreamingOnly

      boolean isStreamingOnly()
      Checks if the media requires an internet connection.
      Returns:
      true if streaming required, false if downloadable
    • getQuality

      Media.MediaQuality getQuality()
      Gets the quality setting for the media.
      Returns:
      quality descriptor
    • getPlaybackInfo

      default String getPlaybackInfo()
      Gets playback information as a formatted string.
      Returns:
      playback details
    • estimateDownloadTime

      default int estimateDownloadTime(double mbps)
      Calculates estimated download time based on connection speed.
      Parameters:
      mbps - download speed in megabits per second
      Returns:
      estimated time in seconds