package playingWithLists;

public interface List<Any> extends Iterable<Any>{
	
	// get returns the element at position idx
	// throws IndexOutOfBoundsException if
	// idx < 0 || idx >= size of list
	Any get(int idx);
	
	// set returns the current value at position idx,
	// and replaces it by a newVal.
	// throws IndexOutOfBoundsException if
	// idx < 0 || idx >= size of list
	Any set(int idx, Any newVal);
	
	// add inserts an element x at a given position idx.
	// all subsequent elements' index increases by 1.
	// throws IndexOutOfBoundsException if
	// idx < 0 || idx > size of list
	void add(int idx, Any x);
	
	// remove removes the element at a given position idx.
	// all subsequent elements' index decreases by 1.
	// throws IndexOutOfBoundsException if
	// idx < 0 || idx >= size of list	
	void remove(int idx);
}
