Learn R Programming

bdpar (version 3.1.0)

ResourceHandler: Class that handles different types of resources

Description

Class that handles different types of resources.

Arguments

Methods


Method new()

Creates a ResourceHandler object.

Usage

ResourceHandler$new()


Method isLoadResource()

From the resource path, it is checked if they have already been loaded. In this case, the list of the requested resource is returned. Otherwise, the resource variable is added to the list of resources, and the resource list is returned. In the event that the resource file does not exist, NULL is returned.

Usage

ResourceHandler$isLoadResource(pathResource)

Arguments

pathResource

A (character) value. The resource file path.

Returns

The resources list is returned, if they exist.


Method getResources()

Gets of resources variable.

Usage

ResourceHandler$getResources()

Returns

The value of resources variable.


Method setResources()

Sets of resources variable.

Usage

ResourceHandler$setResources(resources)

Arguments

resources

The new value of resources.


Method getNamesResources()

Gets of names of resources

Usage

ResourceHandler$getNamesResources()

Returns

Value of names of resources.


Method clone()

The objects of this class are cloneable with this method.

Usage

ResourceHandler$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

It is a class that allows store the resources that are needed in the GenericPipes to avoid having to repeatedly read from the file. File resources of type json are read and stored in memory.