ExtractorFactory {bdpar}R Documentation

Class to handle the creation of Instance types

Description

ExtractorFactory class builds the appropriate Instance object according to the file extension. In the case of not finding the registered extension, the default extractor will be used if it has been previously configured.

Methods

Public methods


Method new()

Creates a ExtractorFactory object.

Usage
ExtractorFactory$new()

Method registerExtractor()

Adds an extractor to the list of extensions. If the extension is an empty string (""), the indicated extractor will be the default when there is no extractor associated with an extension.

Usage
ExtractorFactory$registerExtractor(extensions, extractor)
Arguments
extensions

A character array. The names of the extension option.

extractor

A Object value. The extractor of the new extension.


Method setExtractor()

Modifies the extractor of the one extension.

Usage
ExtractorFactory$setExtractor(extension, extractor)
Arguments
extension

A character value. The name of the extension option.

extractor

A Object value. The value of the new extractor.


Method setDefaultExtractor()

Modifies the extractor of the one extension. Assign NULL value to disable the default extractor.

Usage
ExtractorFactory$setDefaultExtractor(defaultExtractor)
Arguments
defaultExtractor

A Object value. The value of the default extractor.


Method removeExtractor()

Removes a specific extractor thought the extension.

Usage
ExtractorFactory$removeExtractor(extension)
Arguments
extension

A character value. The name of the extension to remove.


Method getAllExtractors()

Gets the list of extractors.

Usage
ExtractorFactory$getAllExtractors()
Returns

Value of extractors.


Method getDefaultExtractor()

Gets the default extractor.

Usage
ExtractorFactory$getDefaultExtractor()
Returns

Value of default extractor.


Method isSpecificExtractor()

Checks if exists an extractor for a specific extension.

Usage
ExtractorFactory$isSpecificExtractor(extension)
Arguments
extension

A character value. The name of the extension to check

Returns

Value of extractors.


Method createInstance()

Builds the Instance object according to the file extension. In the case of not finding the registered extension, the default extractor will be used if it has been previously configured.

Usage
ExtractorFactory$createInstance(path)
Arguments
path

A character value. Path of the file to create an Instance.

Returns

The Instance corresponding object according to the file extension.


Method reset()

Resets list of extractor to default state.

Usage
ExtractorFactory$reset()

Method print()

Prints pipeline representation. (Override print function)

Usage
ExtractorFactory$print(...)
Arguments
...

Further arguments passed to or from other methods.


Method clone()

The objects of this class are cloneable with this method.

Usage
ExtractorFactory$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

ExtractorEml, ExtractorSms, Instance


[Package bdpar version 3.1.0 Index]