package org.matheclipse.core.expression;

import java.util.ArrayList;
import java.util.List;

import org.matheclipse.core.eval.Range;
import org.matheclipse.core.interfaces.IAST;
import org.matheclipse.core.interfaces.IExpr;

/**
 * Create a range for a given IAST instance.
 * 
 */
public class ASTRange extends Range {
	/**
	 * Construct a range [start..end[ for a given IAST
	 * instance.
	 * 
	 * @param list
	 * @param start
	 * @param end
	 * @throws IndexOutOfBoundsException
	 *           if start or end aren't valid.
	 */
	public ASTRange(final IAST list, final int start, final int end) {
		super(list, start, end);
	}

	/**
	 * Construct a range [start..list.size()[ for a given
	 * IAST instance.
	 * 
	 * @param list
	 * @param start
	 * @throws IndexOutOfBoundsException
	 *           if start isn't valid.
	 */
	public ASTRange(final IAST list, final int start) {
		super(list, start);
	}

	/**
	 * ASTRange [0..list.size()[. This range includes all arguments
	 * of a function. The head of the function is stored at index 0
	 * 
	 * @param list
	 */
	public ASTRange(final IAST list) {
		super(list, 0);
	}

	/**
	 * Append this ranges elements to a new created List
	 * 
	 */
	public List toList() {
		ArrayList list = new ArrayList();
		return super.toList(list);
	}

}

 

Ads help maintain this website.