Packages

package examples

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Package Members

  1. package crime

Deprecated Type Members

  1. case class Format(color: String, language: String, aspectRatio: Option[Double], duration: Option[Int]) extends Product with Serializable

    Represents the format attributes associated with a movie, such as its color, language, aspect ratio, and duration.

    Represents the format attributes associated with a movie, such as its color, language, aspect ratio, and duration. This case class is immutable and provides a concise way to model format details.

    The Format case class includes the following fields: - color (String): The color scheme of the movie (e.g., "Color", "Black and White"). - language (String): The language in which the movie is produced (e.g., "English", "French"). - aspectRatio (Option[Double]): An optional field representing the aspect ratio of the movie's visuals, which is expressed as a decimal (e.g., 1.85, 2.35). If not provided, this field is None. - duration (Option[Int]): An optional field representing the length of the movie in minutes. If not provided, this field is None.

    The toString method of the Format class provides a comma-separated string representation of its field values, including Option fields, which are displayed as None when not defined.

    color

    the color scheme of the movie's visuals.

    language

    the primary language of the movie.

    aspectRatio

    an optional aspect ratio for the movie's visuals.

    duration

    an optional runtime of the movie in minutes. Usage example:

    val format = Format("Color", "English", Some(1.85), Some(120))
    println(format) // Outputs: Color,English,Some(1.85),Some(120)
    
    val defaultFormat = Format("", "", None, None)
    println(defaultFormat) // Outputs: ,,,None,None
    Annotations
    @deprecated
    Deprecated

    (Since version 1.7.0) Example code: it moves out of the library, into the tests, in 2.0.0

  2. case class Movie(title: String, format: Format, production: Production, reviews: Reviews, director: Principal, actor1: Principal, actor2: Principal, actor3: Option[Principal], genres: AttributeSet, plotKeywords: AttributeSet, imdb: String) extends Product with Serializable

    The Movie case class represents a comprehensive set of data about a movie, including its title, format, production details, reviews, cast information, genres, plot keywords, and IMDb identifier.

    The Movie case class represents a comprehensive set of data about a movie, including its title, format, production details, reviews, cast information, genres, plot keywords, and IMDb identifier. It encapsulates essential and optional attributes about a movie in a structured format for easy parsing, manipulation, and serialization (e.g., CSV generation).

    title

    The title of the movie, represented as a string.

    format

    The format details of the movie, as a Format object. This includes information such as color, language, aspect ratio, and duration.

    production

    The production details of the movie, as a Production object. This includes attributes such as country, budget, gross earnings, and title year.

    reviews

    The reviews and aggregated feedback data for the movie, as a Reviews object. It includes IMDb score, social metrics, and review counts.

    director

    The director of the movie, represented as a Principal object, which includes the director's name and Facebook likes.

    actor1

    The first main actor in the movie, represented as a Principal object.

    actor2

    The second main actor in the movie, represented as a Principal object.

    actor3

    The third main actor in the movie, represented as an optional Principal object. If no third actor is present, this will be None.

    genres

    The list of genres for the movie, represented as an AttributeSet. This may include genres like Action, Drama, Comedy, etc.

    plotKeywords

    The set of plot-related keywords for the movie, represented as an AttributeSet. Keywords provide insights into the movie's storyline.

    imdb

    The unique IMDb identifier for the movie, represented as a string.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.7.0) Example code: it moves out of the library, into the tests, in 2.0.0

  3. case class Name(first: String, middle: Option[String], last: String, suffix: Option[String]) extends Product with Serializable

    A case class representing a person's name with optional middle name and suffix.

    A case class representing a person's name with optional middle name and suffix.

    first

    The first name of the person (mandatory).

    middle

    An optional middle name of the person.

    last

    The last name (or family name) of the person (mandatory).

    suffix

    An optional suffix, such as "Jr.", "Sr.", or other titles. The Name class overrides the toString method to provide a concatenated string representation of the full name. The full name includes the first name, optionally followed by the middle name, then the last name, and finally an optional suffix. Components are separated by a space. Example usage:

    val fullName = Name("John", Some("William"), "Doe", Some("Jr."))
    println(fullName.toString) // Output: "John William Doe Jr."
    
    val simpleName = Name("Jane", None, "Smith", None)
    println(simpleName.toString) // Output: "Jane Smith"
    Annotations
    @deprecated
    Deprecated

    (Since version 1.7.0) Example code: it moves out of the library, into the tests, in 2.0.0

  4. case class Principal(name: Name, facebookLikes: Int) extends Product with Serializable

    Represents a principal entity involved in a production.

    Represents a principal entity involved in a production. This entity is characterized by its name and the number of Facebook likes it has received. Typically, the Principal class is used to model contributors such as actors, directors, or other individuals associated with a movie or production.

    name

    the Name instance representing the principal's full name, which includes fields for the first name, middle name (optional), last name, and suffix (optional).

    facebookLikes

    the number of Facebook likes associated with the principal, which can serve as a measure of the individual's popularity or reach on social media.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.7.0) Example code: it moves out of the library, into the tests, in 2.0.0

    Example:
    1. val principal = Principal(Name("John", Some("A."), "Doe", None), 1200)
      println(principal) // Output: John A. Doe (1200 likes)
    Note

    The Principal class is part of a broader model for describing movies or productions, and may be used in conjunction with other classes such as Movie or Production. Additionally, a default instance of Principal may be provided in an accompanying companion object for known default values.

  5. case class Production(country: String, budget: Option[Int], gross: Option[Int], titleYear: Option[Int]) extends Product with Serializable

    The Production case class represents the metadata associated with a creative production, such as a film, including its country of origin, budget, gross revenue, and release year.

    The Production case class represents the metadata associated with a creative production, such as a film, including its country of origin, budget, gross revenue, and release year.

    Fields

    country

    the country where the production originated, as a non-null String.

    budget

    an optional Int representing the production's budget. If unavailable, it is None.

    gross

    an optional Int representing the total gross revenue of the production. If unavailable, it is None.

    titleYear

    an optional Int representing the year the production was released or titled. If unavailable, it is None.

    Methods

    • isKiwi: Determines if the production originates from New Zealand.

    Usage Example

    val production1 = Production("New Zealand", Some(1500000), Some(5000000), Some(2022))
    val production2 = Production("USA", None, None, None)
    
    println(production1.isKiwi) // Output: true
    println(production2.isKiwi) // Output: false
    Annotations
    @deprecated
    Deprecated

    (Since version 1.7.0) Example code: it moves out of the library, into the tests, in 2.0.0

  6. case class Rating(code: String, age: Option[Int]) extends Product with Serializable

    Represents a content rating, typically used to signify the suitability of media content (e.g., movies, shows) for different audiences.

    Represents a content rating, typically used to signify the suitability of media content (e.g., movies, shows) for different audiences. The Rating class consists of a code (e.g., "PG", "R", "G") and an optional age specification (e.g., "PG-13").

    code

    The code representing the general content rating (e.g., "PG", "R").

    age

    An optional integer specifying the age restriction for the content, if applicable (e.g., a value of 13 for "PG-13").

    Annotations
    @deprecated
    Deprecated

    (Since version 1.7.0) Example code: it moves out of the library, into the tests, in 2.0.0

  7. case class Reviews(imdbScore: Double, facebookLikes: Int, contentRating: Rating, numUsersReview: Option[Int], numUsersVoted: Int, numCriticReviews: Option[Int], totalFacebookLikes: Int) extends Product with Serializable

    The Reviews case class represents aggregated review and user feedback data for a movie, encapsulating information such as IMDb scores, social media metrics, content rating, and review counts.

    The Reviews case class represents aggregated review and user feedback data for a movie, encapsulating information such as IMDb scores, social media metrics, content rating, and review counts.

    imdbScore

    The IMDb score of the movie, typically ranging from 1 to 10 with up to one decimal place.

    facebookLikes

    The number of likes the movie has on Facebook, used as a measure of its popularity on the platform.

    contentRating

    The Rating object indicating the content rating of the movie (e.g., PG, R), which may also include age restrictions.

    numUsersReview

    An Option representing the number of user reviews submitted for the movie. A value of None indicates an unknown or unavailable count.

    numUsersVoted

    The total number of users who voted for the movie on IMDb.

    numCriticReviews

    An Option representing the number of critic reviews submitted for the movie. A value of None indicates an unknown or unavailable count.

    totalFacebookLikes

    The total combined Facebook likes of the movie's cast and crew, providing a broader measure of social media presence.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.7.0) Example code: it moves out of the library, into the tests, in 2.0.0

Deprecated Value Members

  1. object Format extends CellParsers with CsvGenerators with CsvRenderers with Serializable

    The Format object provides a predefined constant for representing a default Format instance.

    The Format object provides a predefined constant for representing a default Format instance. It serves as a utility object for commonly used instances of the Format case class.

    The default format instance (none) is initialized with empty or None values for fields, representing a situation where no specific format details are available.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.7.0) Example code: it moves out of the library, into the tests, in 2.0.0

    See also

    Format The case class representing the format attributes such as color, language, aspect ratio, and duration.

  2. object Movie extends CellParsers with CsvGenerators with CsvRenderers with Serializable

    The Movie object provides functionality for generating CSV representations of Movie instances.

    The Movie object provides functionality for generating CSV representations of Movie instances. It utilizes the CsvGenerators framework to define and create CSV generators for the various fields and nested components of the Movie class, as well as the Movie class itself.

    Overview

    The Movie object contains the following key elements:

    - **csvGenerators**: An instance of CsvGenerators that provides predefined CSV generators for standard data types such as Boolean, Int, Double, and String. It serves as the foundation for custom CSV generators.

    - **createMovieCvsGenerator**: A method that constructs a CsvGenerator specific to the Movie class. This generator supports serialization of Movie instances into CSV format, accounting for nested data structures and optional values.

    Dependencies

    This object imports the following from com.phasmidsoftware.tableparser.core.render.CsvGenerators: - Predefined implicit CSV generators for basic data types and utilities for creating additional generators.

    Key Method Descriptions

    - createMovieCvsGenerator:

    • Constructs and returns a CsvGenerator[Movie], facilitating the generation of CSV rows for Movie objects.
    • Custom generators are defined for various components of the Movie class, including:
      • StringList: A sequence of strings.
      • Option[Double]: Optional Double values.
      • Option[Int]: Optional Int values.
      • Option[String]: Optional String values.
      • Format: A case class representing the format of a Movie.
      • Production: A case class holding details about a Movie's production.
      • Rating: Represents a case class for the rating information of a Movie.
      • Reviews: A case class containing detailed review information.
      • Name: A case class for principal names.
      • Principal: A case class for individuals associated with a Movie.
      • Option[Principal]: An optional Principal.
      • AttributeSet: A case class for sets of attributes such as genres or plot keywords.
    • The resulting CsvGenerator[Movie] aggregates these component-level generators to enable CSV serialization of the entire Movie object.

    Usage

    To generate a CSV representation of Movie objects: 1. Invoke the createMovieCvsGenerator method within this object to obtain the appropriate CsvGenerator[Movie]. 2. Use the generated CsvGenerator to serialize a Movie instance into a CSV format.

    This utility is especially useful for exporting Movie data into a structured format, such as for persistence or integration with external systems that require CSV data.

    Example

    val movieCsvGenerator = Movie.createMovieCvsGenerator
    val movie = Movie("Inception", Format(...), Production(...), Reviews(...), ...)
    val csvRepresentation = movieCsvGenerator.generate(movie)
    Annotations
    @deprecated
    Deprecated

    (Since version 1.7.0) Example code: it moves out of the library, into the tests, in 2.0.0

  3. object Name extends CellParsers with CsvGenerators with CsvRenderers with Serializable

    Companion object for the Name case class, providing factory methods for parsing strings into Name instances.

    Companion object for the Name case class, providing factory methods for parsing strings into Name instances.

    This object handles the parsing of a formatted name string (e.g., "John A. Smith Jr.") into its respective components: first name, middle name/initial, last name, and optional suffix. It uses a regular expression to perform this parsing and validates the input.

    Regex Pattern

    The internal regular expression (rName) is designed to match and extract components of a name. While it works for most typical name formats, some complex or unconventional names in certain datasets (e.g., the Movie database) might not be parsed correctly. The components matched by the regex are:

    • First Name (mandatory)
    • Middle Name/Initial (optional)
    • Last Name (mandatory)
    • Suffix (optional)

    Factory Methods

    The apply method is overloaded to:

    • Parse a single string into a Name instance.
    • Throw an exception if the input string does not conform to the expected format.
    Annotations
    @deprecated
    Deprecated

    (Since version 1.7.0) Example code: it moves out of the library, into the tests, in 2.0.0

    Example:
    1. val name1 = Name("John Smith")             // Name("John", None, "Smith", None)
      val name2 = Name("John A. Smith")          // Name("John", Some("A."), "Smith", None)
      val name3 = Name("John Smith Jr.")         // Name("John", None, "Smith", Some("Jr."))
      val name4 = Name("John A. Smith Jr.")      // Name("John", Some("A."), "Smith", Some("Jr."))
      
      // An invalid name format will throw an exception
      val invalidName = Name("John")  // throws Exception: parse error in Name: 'John'

      Usage in Context

      The Name class and object are primarily used in parsing movie-related data structures and rendering them to/from CSVs:

      • The createMovieCvsGenerator method uses Name.apply to generate CSV entries for Name instances.
      • Rendering movie-related data via CsvRendererMovie involves the rendererName generator, built around Name.
    Note

    The Name case class has a corresponding custom toString implementation for formatted string representation.

  4. object Principal extends CellParsers with CsvGenerators with CsvRenderers with Serializable

    Companion object for the Principal case class, providing default values and utility objects related to principal entities in a production context.

    Companion object for the Principal case class, providing default values and utility objects related to principal entities in a production context.

    This object currently includes a predefined default instance:

    • nemo: The default Principal instance with a default Name ("ne mo") and facebookLikes value of 0.

    Usage

    The Principal object, along with its case class, is typically used to represent individuals such as actors, directors, or contributors in a production database system, with information about their name and popularity metrics.

    Predefined Instance

    • nemo: A convenient default Principal instance, used as a placeholder or fallback.
    Annotations
    @deprecated
    Deprecated

    (Since version 1.7.0) Example code: it moves out of the library, into the tests, in 2.0.0

    Example:
    1. Using the default Principal:

      println(Principal.nemo) // Output: ne mo (0 likes)

      Relation

      Works in conjunction with the Principal case class and is associated with other models in parsing, processing, and rendering movie-related data structures.

  5. object Production extends CellParsers with CsvGenerators with CsvRenderers with Serializable

    The Production object serves as a companion object for the Production case class.

    The Production object serves as a companion object for the Production case class. It provides predefined constants and utility methods related to the concept of a production, such as a film or other creative work.

    Overview

    - The Production object includes commonly used instances of the Production class. - It facilitates operations on and interactions with Production objects in a consistent manner.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.7.0) Example code: it moves out of the library, into the tests, in 2.0.0

    See also

    Production case class for the associated data structure and detailed behavior.

  6. object Rating extends CellParsers with CsvGenerators with CsvRenderers with Serializable

    Companion object for the Rating case class.

    Companion object for the Rating case class. This object provides utility methods to construct Rating instances and to parse rating strings into Rating.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.7.0) Example code: it moves out of the library, into the tests, in 2.0.0

  7. object Reviews extends CellParsers with CsvGenerators with CsvRenderers with Serializable

    The Reviews object contains utility members and predefined instances related to the Reviews case class.

    The Reviews object contains utility members and predefined instances related to the Reviews case class.

    This object is primarily used to define default or placeholder instances of Reviews, such as the none value, which represents a Reviews instance with default or empty data.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.7.0) Example code: it moves out of the library, into the tests, in 2.0.0

Ungrouped