/* * RandomValuesGenerator.java * * Created on October 31, 2006, 6:34 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package pack; import java.util.Iterator; /** * * @author andromeda */ public class RandomValuesGenerator implements Iterable{ double a; double h; int N; int quantity ; public RandomValuesGenerator(int quantity){ this(-3, 3, 3, quantity); } public RandomValuesGenerator(double a, double b, int N, int quantity){ this.a = a; this.h = b - a; this.N = N; this.quantity = quantity; } public Iterator iterator() { return new Iterator() { int n = 0; public boolean hasNext() { return n < N ; } public double[] next() { n++; double[] array = new double[quantity]; for(int i=0; i