All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.imsweb.algorithms.Algorithm Maven / Gradle / Ivy

/*
 * Copyright (C) 2019 Information Management Services, Inc.
 */
package com.imsweb.algorithms;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * Abstraction of an "algorithm" that takes input fields, can be executed, and returns output fields.
 */
@SuppressWarnings("unused")
public interface Algorithm {

    /**
     * Returns the ID that uniquely identifiers this algorithm.
     */
    String getId();

    /**
     * Returns the algorithm name.
     */
    String getName();

    /**
     * Returns the algorithm version (if no version is applicable, you can use the string "N/A" or any value you want).
     */
    String getVersion();

    /**
     * Returns a URL (a website address) to online documentation resource (optional).
     */
    default String getDocumentationUrl() {
        return null;
    }

    /**
     * Returns the list of parameters (options) for this algorithm.
     */
    List> getParameters();

    /**
     * Returns the list of input fields for this algorithm.
     */
    List getInputFields();

    /**
     * Returns the list of output fields for this algorithm.
     */
    List getOutputFields();

    /**
     * Returns the list of unknown value, per field.
     */
    default Map> getUnknownValues() {
        return Collections.emptyMap();
    }

    /**
     * Executes this algorithm using the given input fields.
     */
    AlgorithmOutput execute(AlgorithmInput input);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy