/*
 *  Copyright (C) 2010 reuillon
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.openmole.core.implementation.plan;

import java.util.Collection;
import java.util.Iterator;

import org.openmole.core.model.plan.IExploredPlan;
import org.openmole.core.model.plan.IFactorValues;

public class ExploredPlan implements IExploredPlan {

    Collection<IFactorValues> values;

    public ExploredPlan(Collection<IFactorValues> values) {
        super();
        this.values = values;
    }

    @Override
    public Iterator<IFactorValues> iterator() {
        return values.iterator();
    }
    
}

@@ -1207,16 +1207,774 @@
 );%0A    %7D
+%0A%0A    public String toCSV() %7B%0A        StringBuffer sb = new StringBuffer();%0A        StringBuffer sbn = new StringBuffer();%0A        int num = 0;%0A        while (this.iterator().hasNext()) %7B%0A            IFactorValues ifv = this.iterator().next();%0A            Iterator%3CString%3E it = ifv.getNames().iterator();%0A            while (it.hasNext()) %7B%0A                if (num == 0) %7B // first line for factor names%0A                    sbn.append(it.next()).append(%22,%22);%0A                    sbn.deleteCharAt(sb.length() - 1).append(%22%5Cn=%22);%0A                %7D%0A                sb.append(it.next()).append(%22,%22);%0A                sb.deleteCharAt(sb.length() - 1).append(%22%5Cn=%22);%0A%0A            %7D%0A%0A        %7D%0A        sbn.append(sb.toString());%0A%0A        return sbn.toString();%0A%0A    %7D
 %0A    %0A%7D%0A

add toCSV method to export design values in a csv format suitable for some export