Record Class DatasetDescription

java.lang.Object
java.lang.Record
org.variantsync.diffdetective.datasets.DatasetDescription
Record Components:
name - The name of the dataset that is used to identify it (e.g., "Linux").
repoURL - The url of the remote repository (e.g., the HTTPS url of a github repository).
domain - A description of the datasets domain (i.e., the software's purpose such as "operating system" or "database").
commits - The estimated number of commits in the repository as a string. Can be empty.

public record DatasetDescription(String name, String repoURL, String domain, String commits) extends Record
Description of a git repository dataset. Such a dataset should refer to a git repository of a C preprocessor based software product line.
Author:
Paul Bittner, Benjamin Moosherr
  • Field Details

    • name

      private final String name
      The field for the name record component.
    • repoURL

      private final String repoURL
      The field for the repoURL record component.
    • domain

      private final String domain
      The field for the domain record component.
    • commits

      private final String commits
      The field for the commits record component.
  • Constructor Details

    • DatasetDescription

      public DatasetDescription(String name, String repoURL, String domain, String commits)
      Creates an instance of a DatasetDescription record class.
      Parameters:
      name - the value for the name record component
      repoURL - the value for the repoURL record component
      domain - the value for the domain record component
      commits - the value for the commits record component
  • Method Details

    • summary

      public static DatasetDescription summary(String name, String repoURL)
    • fromMarkdown

      public static List<DatasetDescription> fromMarkdown(Path markdownFile) throws IOException
      Loads all dataset descriptions in the given markdown file. This expects the markdown file only be a table with the columns
      • Project name
      • Domain
      • Source code available (**y**es/**n**o)?: This should only be a "y" or "n"
      • Is it a git repository (**y**es/**n**o)?: This should only be a "y" or "n"
      • Repository URL
      • Clone URL
      • Estimated number of commits
      The first row is expected to be the header. The second row is expected to be a separator and is skipped on parsing. All further rows are expected to describe one dataset each.
      Parameters:
      markdownFile - Path to a markdown file containing dataset descriptions.
      Returns:
      All parsed dataset descriptions.
      Throws:
      IOException - If the file could not be read for some reason.
    • asLaTeXTable

      public static String asLaTeXTable(List<DatasetDescription> datasets)
      Turns the given descriptions into a LaTeX table to include in papers. Each dataset will be a row in the table.
      Parameters:
      datasets - The datasets to put into the LaTeX table.
      Returns:
      A LaTeX table giving an overview on all datasets.
    • isYes

      private static boolean isYes(String s)
      Returns true iff the given string equals "y" ignoring case and whitespace.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • repoURL

      public String repoURL()
      Returns the value of the repoURL record component.
      Returns:
      the value of the repoURL record component
    • domain

      public String domain()
      Returns the value of the domain record component.
      Returns:
      the value of the domain record component
    • commits

      public String commits()
      Returns the value of the commits record component.
      Returns:
      the value of the commits record component