package ast.representation;

/** Sequences generated from a strategy.
 * @author Juri Memmert and Gary T. Leavens
 * @since Mar 2, 2006
 *
 */
public class SequenceGenerator extends Sequence
{
    private Strategy rule;

    /** Initialize this sequence to be that generated by the given rule. */
    public SequenceGenerator(Strategy rule)
    {
        this.rule = rule;
    }

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