package eu.qualimaster.base.algorithm;

import java.util.List;
/**
 * Implementation of a general Tuple {@link IGeneralTuple}.
 * @author Cui Qin
 *
 */
public class GeneralTuple implements IGeneralTuple {
    private List<Object> values;
    /**
     * Creates a general Tuple.
     * @param values the list of values
     */
    public GeneralTuple(List<Object> values) {
        this.values = values;
    }
    /**
     * Creates a general Tuple.
     */
    public GeneralTuple() {
    }

    @Override
    public void setValues(List<Object> values) {
        this.values = values;
    }

    @Override
    public List<Object> getValues() {
        return values;
    }

    @Override
    public Object getValue(int index) {
        return values.get(index);
    }
    
    @Override
    public boolean isGeneralTuple() {
        return true;
    }

}

@@ -753,36 +753,64 @@
 t index) %7B%0D%0A    
+%09if(!values.isEmpty()) %7B%0D%0A
     
+%09%09
 return values.ge
@@ -820,16 +820,59 @@
 ndex);%0D%0A
+    %09%7D else %7B%0D%0A    %09%09return null;%0D%0A    %09%7D%0D%0A
     %7D%0D%0A 

check whether the value list is empty before accessing it