BiodbDbsInfo: A class for describing the available databases.

BiodbDbsInfoR Documentation

A class for describing the available databases.

Description

A class for describing the available databases.

A class for describing the available databases.

Details

The unique instance of this class is handle by the BiodbMain class and accessed through the getDbsInfo() method.

Methods

Public methods


Method new()

New instance initializer. The class must not be instantiated directly. Instead, access the BiodbDbsInfo instance through the BiodbMain instance using the getDbsInfo() method.

Usage
BiodbDbsInfo$new(cfg)
Arguments
cfg

The BiodbConfig instance.

Returns

Nothing.


Method define()

Define databases from a structured object, normally loaded from a YAML file.

Usage
BiodbDbsInfo$define(def, package = "biodb")
Arguments
def

A named list of database definitions. The names of the list will be the IDs of the databases.

package

The package to which belong the new definitions.

Returns

Nothing.


Method getIds()

Gets the database IDs.

Usage
BiodbDbsInfo$getIds()
Returns

A character vector containing all the IDs of the defined databases.


Method isDefined()

Tests if a database is defined.

Usage
BiodbDbsInfo$isDefined(db.id)
Arguments
db.id

A database ID, as a character string.

Returns

TRUE if the specified id corresponds to a defined database, FALSE otherwise.


Method checkIsDefined()

Checks if a database is defined. Throws an error if the specified id does not correspond to a defined database.

Usage
BiodbDbsInfo$checkIsDefined(db.id)
Arguments
db.id

A character vector of database IDs.

Returns

Nothing.


Method get()

Gets information on a database.

Usage
BiodbDbsInfo$get(db.id = NULL, drop = TRUE)
Arguments
db.id

Database IDs, as a character vector. If set to NULL, informations on all databases will be returned.

drop

If TRUE and only one database ID has been submitted, returns a single BiodbDbInfo instance instead of a list.

Returns

A list of BiodbDbInfo instances corresponding to the specified database IDs.


Method getAll()

Gets informations on all databases.

Usage
BiodbDbsInfo$getAll()
Returns

A list of all BiodbDbInfo instances."


Method print()

Prints informations about this instance, listing also all databases defined.

Usage
BiodbDbsInfo$print()
Returns

Nothing.


Method clone()

The objects of this class are cloneable with this method.

Usage
BiodbDbsInfo$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

BiodbMain and child class BiodbDbInfo.

Examples

# Create an instance with default settings:
mybiodb <- biodb::newInst()

# Getting the entry content type of a database:
db.inf <- mybiodb$getDbsInfo()$get('comp.csv.file')
cont.type <- db.inf$getPropertyValue('entry.content.type')

# Terminate instance.
mybiodb$terminate()


pkrog/biodb documentation built on Nov. 29, 2022, 4:24 a.m.