<commit_before>package org.yamcs.algorithms;

import java.util.Arrays;
import java.util.List;

import org.yamcs.parameter.ParameterValue;
import org.yamcs.parameter.RawEngValue;

/**
 * The result of the algorithm execution consists of:
 * <ul>
 * <li>a list of input parameter values - optional - the list of parameters which have been used as input to the
 * algorithm.</li>
 * <li>a list of output parameter values - these are {@link ParameterValue} which are then propagated to the Yamcs
 * clients.</li>
 * <li>a return value - this is not an output parameter; used for command verifiers</li>
 * </ul>
 * 
 * @author nm
 *
 */
public class AlgorithmExecutionResult {
    final List<RawEngValue> inputValues;
    final List<ParameterValue> outputValues;
    final Object returnValue;

    public AlgorithmExecutionResult(List<RawEngValue> inputValues, Object returnValue,
            List<ParameterValue> outputValues) {
        this.inputValues = inputValues;
        this.returnValue = returnValue;
        this.outputValues = outputValues;
    }

    public AlgorithmExecutionResult(Object returnValue, List<ParameterValue> outputValues) {
        this(null, returnValue, outputValues);
    }
    public AlgorithmExecutionResult(List<ParameterValue> outputValues) {
        this(null, null, outputValues);
    }

    /**
     * Constructor for an algorithm result which returns exactly one value
     * 
     * @param outputValue
     */
    public AlgorithmExecutionResult(ParameterValue outputValue) {
        this(null, null, Arrays.asList(outputValue));
    }
}<commit_msg>Add AlgorithmExecutionResult getters #576<commit_after>package org.yamcs.algorithms;

import java.util.Arrays;
import java.util.List;

import org.yamcs.parameter.ParameterValue;
import org.yamcs.parameter.RawEngValue;

/**
 * The result of the algorithm execution consists of:
 * <ul>
 * <li>a list of input parameter values - optional - the list of parameters which have been used as input to the
 * algorithm.</li>
 * <li>a list of output parameter values - these are {@link ParameterValue} which are then propagated to the Yamcs
 * clients.</li>
 * <li>a return value - this is not an output parameter; used for command verifiers</li>
 * </ul>
 * 
 * @author nm
 *
 */
public class AlgorithmExecutionResult {
    final List<RawEngValue> inputValues;
    final List<ParameterValue> outputValues;
    final Object returnValue;

    public AlgorithmExecutionResult(List<RawEngValue> inputValues, Object returnValue,
            List<ParameterValue> outputValues) {
        this.inputValues = inputValues;
        this.returnValue = returnValue;
        this.outputValues = outputValues;
    }

    public AlgorithmExecutionResult(Object returnValue, List<ParameterValue> outputValues) {
        this(null, returnValue, outputValues);
    }

    public AlgorithmExecutionResult(List<ParameterValue> outputValues) {
        this(null, null, outputValues);
    }

    /**
     * Constructor for an algorithm result which returns exactly one value
     * 
     * @param outputValue
     */
    public AlgorithmExecutionResult(ParameterValue outputValue) {
        this(null, null, Arrays.asList(outputValue));
    }

    public List<RawEngValue> getInputValues() {
        return inputValues;
    }

    public List<ParameterValue> getOutputValues() {
        return outputValues;
    }

    public Object getReturnValue() {
        return returnValue;
    }
}
{'fraction_non_alphanumeric': 0.0872093023255814, 'fraction_numerical': 0.0008720930232558139, 'mean_word_length': 3.521681997371879, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3023032', 'n_tokens_mistral': 938, 'n_tokens_neox': 907, 'n_words': 278}