package ast.representation;

/** Adding sequences (the constructor seq-add).
 * @author Juri Memmert and Gary T. Leavens
 * @since Mar 2, 2006
 *
 */
public class SequenceAdd extends Sequence
{
    private Sequence s1;
    private Sequence s2;

    /** Initialize this sequence to the sum of s1 and s2. */
    public SequenceAdd(Sequence s1, Sequence s2)
    {
        this.s1 = s1;
        this.s2 = s2;
    }

    /**
     * @see adt.representation.Sequence#getNth(long)
     */
    public double getNth(long aPosition)
    {
        return (s1.getNth(aPosition) + s2.getNth(aPosition));
    }
}
