com.supermap.data

Class Datasets

  • java.lang.Object
    • com.supermap.data.Datasets


  • public class Datasets
    extends java.lang.Object

    The datasets class.

    The Datasets is mainly used to manage datasets in workspace and perform some operations to dataset, for example, create dataset, rename and delete dataset etc.

    The datasets collection map contain one or several kinds of datasets, vector dataset, raster dataset or image dataset. The dataset type supported currently includes: tabular dataset, point dataset, line dataset, region dataset, text dataset and image dataset.

    If the return value of the isReadOnly() datasource that contains the dataset is true, you can't create or deleter dataset.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean contains(java.lang.String name)
      Check whether to contain the dataset of the specified name in this datasource.
      DatasetVector create(DatasetVectorInfo datasetInfo)
      Creates the vector dataset with the specified information of the vector dataset.
      Dataset createDatasetFromTemplate(java.lang.String name, Dataset desdataset)
      Creates a dataset according to the template
      boolean delete(int index)
      Delete the dataset with the specified index.
      boolean delete(java.lang.String name)
      Deletes the dataset with the specified name.
      Dataset get(int index)
      Returns the dataset with the specified index.
      Dataset get(java.lang.String name)
      Returns the dataset with the specified name.
      java.lang.String getAvailableDatasetName(java.lang.String name)
      Return a dataset name not used in the datasource.
      int getCount()
      Returns the count of the dataset in the Datasets.
      int indexOf(java.lang.String name)
      Returns the index of dataset in the dataset collection according to its name.
      boolean isAvailableDatasetName(java.lang.String name)
      Determines whether the name of the dataset passed in is valid.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getCount

        public int getCount()
        Returns the count of the dataset in the Datasets.
        Returns:
        the count of the dataset in the Datasets.
      • delete

        public boolean delete(java.lang.String name)
        Deletes the dataset with the specified name.

        This method is safe, with the thread safety level being level2.

        Parameters:
        name - The name of the specified dataset.
        Returns:
        Returns true if successful; otherwise, false.
      • isAvailableDatasetName

        public boolean isAvailableDatasetName(java.lang.String name)
        Determines whether the name of the dataset passed in is valid.

        The rules for the dataset name: The maximum length of the dataset name is 30 characters, the characters can be letters, Chinese characters, figures and underlines, it can not initial with number or underline, the dataset name can not conflict with the retained keywords of the database.

        Parameters:
        name - the name of the dataset to be checked.
        Returns:
        Returns true if the name is valid; Otherwise, returns false.
      • contains

        public boolean contains(java.lang.String name)
        Check whether to contain the dataset of the specified name in this datasource.
        Parameters:
        name - the name of the dataset.
        Returns:
        Returns true if the dataset of the specified name contains in this datasource; Otherwise, returns false.
      • getAvailableDatasetName

        public java.lang.String getAvailableDatasetName(java.lang.String name)
        Return a dataset name not used in the datasource. When creating dataset, the dataset name must be unique in the datasource. This method can return a valid name.

        The rules for the dataset name: The maximum length of the dataset name is 30 characters, the characters can be letters, Chinese characters, figures and underlines, it can not initial with number or underline, the dataset name can not conflict with the retained keywords of the database.

        Parameters:
        name - the name of the dataset.
        Returns:
        a string that can be used as the name of the dataset.
      • delete

        public boolean delete(int index)
        Delete the dataset with the specified index.

        This method is safe, with the thread safety level being level2.

        Parameters:
        index - the index of the specified dataset.
        Returns:
        Returns true if successful; otherwise, false.
      • get

        public Dataset get(java.lang.String name)
        Returns the dataset with the specified name.
        Parameters:
        name - The name of the specified dataset.
        Returns:
        the dataset with the specified name.
      • get

        public Dataset get(int index)
        Returns the dataset with the specified index.
        Parameters:
        index - the index of the specified dataset.
        Returns:
        the dataset with the specified index.
      • create

        public DatasetVector create(DatasetVectorInfo datasetInfo)
        Creates the vector dataset with the specified information of the vector dataset.

        This method is safe, with the thread safety level being level2.

        Parameters:
        datasetInfo - vector dataset information.
        Returns:
        the new build vector dataset object.
      • createDatasetFromTemplate

        public Dataset createDatasetFromTemplate(java.lang.String name,
                                                 Dataset desdataset)
        Creates a dataset according to the template
        Parameters:
        name - The new dataset name.
        desdataset - the template dataset
        Returns:
        The dataset.
      • indexOf

        public int indexOf(java.lang.String name)
        Returns the index of dataset in the dataset collection according to its name.
        Parameters:
        name - The dataset name
        Returns:
        It represent the position of the dataset in the dataset set.