package aalg.algebra;

import java.util.Iterator;

/**
 * Iterable that iterates all prime field elements.
 * @author Ing. Petr Ležák
 */
public class PrimeFieldIterable implements Iterable<PrimeFieldElement> {
	
	private final PrimeField field;
	
	/**
	 * Creates prime field iterable.
	 * @param field prime field
	 */
	public PrimeFieldIterable (final PrimeField field) {
		this.field = field;
	}

	@Override
	public Iterator<PrimeFieldElement> iterator() {
		return new PrimeFieldIterator(field.getPrime());
	}
	
}
