# Class VideoMaterial

java.lang.Object
com.university.bookstore.model.Material
com.university.bookstore.model.VideoMaterial

All Implemented Interfaces:
  `Media`, `Comparable<Material>`

public class VideoMaterial extends Material implements Media
Represents video content (movies, documentaries, educational videos). Implements both Material and Media interfaces to demonstrate multiple inheritance.

Since:
  2024-09-15
Version:
  2.0
Author:
  Navid Mohaghegh

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `VideoMaterial.VideoType`
  Types of video content.

  ### Nested classes/interfaces inherited from class com.university.bookstore.model.Material

  `Material.MaterialType`

  ### Nested classes/interfaces inherited from interface com.university.bookstore.model.Media

  `Media.MediaQuality`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VideoMaterial(String id, String title, String director, double price, int year, int duration, String format, double fileSize, Media.MediaQuality quality, VideoMaterial.VideoType videoType, String rating, List<String> cast, boolean subtitlesAvailable, String aspectRatio)`
  Creates a new VideoMaterial.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getAspectRatio()`
  `List<String>`
  `getCast()`
  `double`
  `getCompressedSize(double compressionRatio)`
  Gets storage space required with compression.
  `String`
  `getCreator()`
  Abstract method to get the creator/author/artist of the material.
  `String`
  `getDirector()`
  `double`
  `getDiscountRate()`
  Hook method for discount rate.
  `String`
  `getDisplayInfo()`
  Abstract method to get a formatted display string.
  `int`
  `getDuration()`
  Gets the duration of the media in minutes.
  `double`
  `getFileSize()`
  Gets the file size in megabytes.
  `String`
  `getFormat()`
  Gets the file format of the media.
  `Media.MediaQuality`
  `getQuality()`
  Gets the quality setting for the media.
  `String`
  `getRating()`
  `double`
  `getStreamingBandwidth()`
  Gets bandwidth requirement for streaming in Mbps.
  `VideoMaterial.VideoType`
  `getVideoType()`
  `boolean`
  `hasSubtitles()`
  `boolean`
  `isFeatureLength()`
  Checks if this is a feature-length video.
  `boolean`
  `isStreamingOnly()`
  Checks if the media requires an internet connection.
  `String`
  `toString()`

  ### Methods inherited from class com.university.bookstore.model.Material

  `compareTo, equals, getDiscountedPrice, getId, getPrice, getTitle, getType, getYear, hashCode`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface com.university.bookstore.model.Media

  `estimateDownloadTime, getPlaybackInfo`

- ## Constructor Details

  - ### VideoMaterial

    public VideoMaterial(String id, String title, String director, double price, int year, int duration, String format, double fileSize, Media.MediaQuality quality, VideoMaterial.VideoType videoType, String rating, List<String> cast, boolean subtitlesAvailable, String aspectRatio)
    Creates a new VideoMaterial.
    Parameters:
      `id` - unique identifier (UPC/EAN code)
      `title` - video title
      `director` - director or producer
      `price` - price in dollars
      `year` - release year
      `duration` - duration in minutes
      `format` - video format (MP4, AVI, MKV, etc.)
      `fileSize` - size in megabytes
      `quality` - video quality
      `videoType` - type of video
      `rating` - content rating (G, PG, PG-13, R, etc.)
      `cast` - list of main cast members
      `subtitlesAvailable` - whether subtitles are included
      `aspectRatio` - aspect ratio (16:9, 4:3, etc.)

- ## Method Details

  - ### getCreator

    public String getCreator()
    Description copied from class: `Material`
    Abstract method to get the creator/author/artist of the material. Implementation varies by material type.
    Specified by:
      `getCreator` in class `Material`
    Returns:
      the creator's name

  - ### getDisplayInfo

    public String getDisplayInfo()
    Description copied from class: `Material`
    Abstract method to get a formatted display string. Each material type should provide its own formatting.
    Specified by:
      `getDisplayInfo` in class `Material`
    Returns:
      formatted display string

  - ### getDuration

    public int getDuration()
    Description copied from interface: `Media`
    Gets the duration of the media in minutes.
    Specified by:
      `getDuration` in interface `Media`
    Returns:
      duration in minutes

  - ### getFormat

    public String getFormat()
    Description copied from interface: `Media`
    Gets the file format of the media.
    Specified by:
      `getFormat` in interface `Media`
    Returns:
      format string (e.g., "MP3", "MP4", "WAV")

  - ### getFileSize

    public double getFileSize()
    Description copied from interface: `Media`
    Gets the file size in megabytes.
    Specified by:
      `getFileSize` in interface `Media`
    Returns:
      size in MB

  - ### isStreamingOnly

    public boolean isStreamingOnly()
    Description copied from interface: `Media`
    Checks if the media requires an internet connection.
    Specified by:
      `isStreamingOnly` in interface `Media`
    Returns:
      true if streaming required, false if downloadable

  - ### getQuality

    public Media.MediaQuality getQuality()
    Description copied from interface: `Media`
    Gets the quality setting for the media.
    Specified by:
      `getQuality` in interface `Media`
    Returns:
      quality descriptor

  - ### getDiscountRate

    public double getDiscountRate()
    Description copied from class: `Material`
    Hook method for discount rate. Default is no discount. Subclasses can override to provide type-specific discounts.
    Overrides:
      `getDiscountRate` in class `Material`
    Returns:
      discount rate between 0.0 and 1.0

  - ### isFeatureLength

    public boolean isFeatureLength()
    Checks if this is a feature-length video.
    Returns:
      true if duration >= 60 minutes

  - ### getStreamingBandwidth

    public double getStreamingBandwidth()
    Gets bandwidth requirement for streaming in Mbps.
    Returns:
      required bandwidth

  - ### getCompressedSize

    public double getCompressedSize(double compressionRatio)
    Gets storage space required with compression.
    Parameters:
      `compressionRatio` - compression ratio (0.5 = 50% compression)
    Returns:
      compressed size in MB

  - ### getDirector

    public String getDirector()

  - ### getVideoType

    public VideoMaterial.VideoType getVideoType()

  - ### getRating

    public String getRating()

  - ### getCast

    public List<String> getCast()

  - ### hasSubtitles

    public boolean hasSubtitles()

  - ### getAspectRatio

    public String getAspectRatio()

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Material`