Class Dataset

java.lang.Object
gaiasky.util.datadesc.Dataset
All Implemented Interfaces:
Comparable<Dataset>

public class Dataset extends Object implements Comparable<Dataset>
Contains the metadata of a single dataset, constructed from a JSON file or object.
  • Field Details

    • key

      public String key
      Dataset key. It is a kebab-case string without whitespaces.
    • name

      public String name
      Common name of the dataset.
    • description

      public String description
      Text description of the dataset.
    • credits

      public String[] credits
      Credit(s) for this dataset. These usually point to the data sources.
    • replaces

      public String[] replaces
      Keys of the datasets that this dataset replaces, if any.
    • replacedBy

      public String replacedBy
      Contains the key of the dataset that replaces this one, if any. If this is non-null, the current dataset is obsolete.
    • provides

      public String provides
      The 'feature' that this dataset provides. For instance, all star catalogs would provide 'starfield'. This is useful to detect possible errors in the case of several datasets providing the same feature being enabled.
    • creator

      public String creator
      Creator of the dataset. Usually "Name - email" is sufficient.
    • file

      public String file
      URL (possibly with @mirror-url@ wildcard) of the gzipped dataset tarball.
    • datasetType

      public DatasetType datasetType
      Dataset type.
    • type

      public String type
      Dataset type string.
    • status

      public Dataset.DatasetStatus status
      Dataset status.
    • checkPath

      public Path checkPath
      Path of the dataset.json file for this dataset.
    • checkStr

      public String checkStr
      Path of the dataset.json file, as a string.
    • catalogFile

      public com.badlogic.gdx.files.FileHandle catalogFile
      File handle to the dataset.json file.
    • sizeString

      public String sizeString
      Dataset pretty size, as a string.
    • sizeBytes

      public long sizeBytes
      Dataset raw size in bytes. This is the package file (file size in server datasets, and the uncompressed disk size in installed datasets.
    • nObjectsStr

      public String nObjectsStr
      Number of objects, as a pretty string (i.e. 3B).
    • nObjects

      public long nObjects
      Raw number of objects.
    • sha256

      public String sha256
      SHA256 checksum.
    • exists

      public boolean exists
      Flag that signals whether the dataset is in the local file system.
    • myVersion

      public int myVersion
      Local dataset version.
    • serverVersion

      public int serverVersion
      Server dataset version.
    • minGsVersion

      public int minGsVersion
      Minimum Gaia Sky version needed for this dataset.
    • outdated

      public boolean outdated
      Flag that marks the dataset as outdated: replacedBy is not empty.
    • baseData

      public boolean baseData
      Flag set to true in the base data pack.
    • releaseNotes

      public String[] releaseNotes
      List of release notes for this version.
    • files

      public String[] files
      List of files or directories included in this dataset.
    • images

      public String[] images
      URLs to dataset images. These are displayed in the dataset manager.
    • server

      public Dataset server
      In case of local datasets, this links to the server description.
  • Constructor Details

    • Dataset

      public Dataset()
    • Dataset

      public Dataset(com.badlogic.gdx.utils.JsonReader reader, com.badlogic.gdx.utils.JsonValue source)
    • Dataset

      public Dataset(com.badlogic.gdx.utils.JsonReader reader, com.badlogic.gdx.utils.JsonValue source, com.badlogic.gdx.files.FileHandle localCatalogFile)
  • Method Details

    • verifyDatasetImage

      public static boolean verifyDatasetImage(@NotNull @NotNull com.badlogic.gdx.graphics.Texture tex)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isReplacedBy

      public boolean isReplacedBy(String key)
      Checks if the current dataset is replaced by the dataset with the given key.
      Parameters:
      key - The key.
      Returns:
      True if the current dataset is replaced by the dataset with the given key.
    • replaces

      public boolean replaces(String key)
      Checks whether the current dataset replaces the dataset with the given key.
      Parameters:
      key - The key.
      Returns:
      True if the current dataset replaces the dataset with the given key.
    • addReplacesEntry

      public void addReplacesEntry(String key)
      Adds the key to the replaces array of this dataset.
      Parameters:
      key - The key to add.
    • filter

      public boolean filter(String filterText)
      Filters the dataset using a given text. It checks the filter against name, description, key and type.
      Parameters:
      filterText - The filter text.
      Returns:
      True if the filter passes, false otherwise.
    • isStarDataset

      public boolean isStarDataset()
    • getLocalCopy

      public Dataset getLocalCopy()
    • copy

      public Dataset copy()
    • compareTo

      public int compareTo(Dataset other)
      Specified by:
      compareTo in interface Comparable<Dataset>