001package de.monochromata.anaphors.cog;
002
003import de.monochromata.anaphors.ast.ASTBasedAnaphora;
004import de.monochromata.anaphors.ast.relatedexp.RelatedExpression;
005import de.monochromata.anaphors.cog.transform.CheckResult;
006import de.monochromata.anaphors.cog.transform.PreparatoryTransformation;
007
008/**
009 * A default resolution implementation.
010 *
011 * @param <N>  The node type in the AST
012 * @param <E>  The expression type
013 * @param <T>  The type type
014 * @param <B>  The binding type
015 * @param <TB> The type binding type
016 * @param <S>  The scope type (optional)
017 * @param <I>  The type used to represent identifiers
018 * @param <QI> The type used to represent qualified identifiers
019 * @param <R>  The sub-type of related expression to use
020 * @param <A>  The sub-type of AST-based anaphora to use
021 */
022public class DefaultResolution<N, E, T, B, TB extends B, S, I, QI, R extends RelatedExpression<N, T, B, TB, S, QI, R>, A extends ASTBasedAnaphora<N, E, T, B, TB, S, I, QI, R, A>>
023        implements Resolution<N, E, T, B, TB, S, I, QI, R, A> {
024
025    private final CheckResult<N, E, S> checkResult;
026    private final PreparatoryTransformation<N, E, T, B, TB, S, I, QI, R, A> preparatoryTransformation;
027    private final A preliminaryAnaphora;
028
029    /**
030     * Used in contract testing.
031     */
032    @SuppressWarnings("unused")
033    protected DefaultResolution() {
034        this(null, null, null);
035    }
036
037    public DefaultResolution(final CheckResult<N, E, S> checkResult,
038            final PreparatoryTransformation<N, E, T, B, TB, S, I, QI, R, A> preparatoryTransformation,
039            final A preliminaryAnaphora) {
040        this.checkResult = checkResult;
041        this.preparatoryTransformation = preparatoryTransformation;
042        this.preliminaryAnaphora = preliminaryAnaphora;
043    }
044
045    @Override
046    public CheckResult<N, E, S> getCheckResult() {
047        return checkResult;
048    }
049
050    @Override
051    public PreparatoryTransformation<N, E, T, B, TB, S, I, QI, R, A> getPreparatoryTransformation() {
052        return preparatoryTransformation;
053    }
054
055    @Override
056    public A getPreliminaryAnaphora() {
057        return preliminaryAnaphora;
058    }
059
060}