package com.health.control;
import java.util.Arrays;

import com.health.*;

/**
 * @author bjorn
 *
 */
public class ControlModule {
	private InputData[] data;
	private String script;

	private Table dataset;

	/**
	 * 
	 */
	public ControlModule() {
		this.data = null;
		this.script = null;
		this.dataset = null;
	}

    /**
     * @param data
     * @param script
     */
    public ControlModule(InputData[] data, String script) {
    	setData(data);
    	setScript(script);
    	this.dataset = null;
    }


	/**
	 * @return
	 */
	public InputData[] getData() {
		return data;
	}

	/**
	 * @param data
	 */
	public void setData(InputData[] data) {
		this.data = data;
	}

	/**
	 * @return
	 */
	public String getScript() {
		return script;
	}

	/**
	 * @param script
	 */
	public void setScript(String script) {
		this.script = script;
	}

	/**
	 * @return
	 */
	public Table getDataset() {
		return dataset;
	}

	/**
	 * @param dataset
	 */
	public void setDataset(Table dataset) {
		this.dataset = dataset;
	}

	/**
     * @return
     */
    public boolean startAnalysis() {
    	if(this.data == null || this.script == null) {
    		return false;
    	}

    	if(toInputModule()) {
    		toOutputModule();
    	}

    	return false;
    }	

    /**
     * 
     */
    public void getResults() {
    	toGUI();
    }

    /**
     * @return
     */
    private boolean toInputModule() {
    	//maakt input module aan..
    	//geef data..
    	//this.dataset =  gevuld Table object.

    	return false;
    }

    /**
     * 
     */
    private void toOutputModule() {
    	//maakt output module aan..
    	//geeft data..
    	//krijgt output dingen terug
    }

    /**
     * 
     */
    private void toGUI() {
    	//stuurt alles terug naar GUI
    }

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "ControlModule [data=" + Arrays.toString(data) + ", script="
				+ script + ", dataset=" + dataset + "]";
	}
    
}


@@ -506,17 +506,16 @@
 %0A    %7D%0A%0A
-%0A
 %09/**%0A%09 *
@@ -519,508 +519,38 @@
 %09 * 
-@return%0A%09 */%0A%09public InputData%5B%5D getData() %7B%0A%09%09return data;%0A%09%7D%0A%0A%09/**%0A%09 * @param data%0A%09 */%0A%09public void setData(InputData%5B%5D data) %7B%0A%09%09this.data = data;%0A%09%7D%0A%0A%09/**%0A%09 * @return%0A%09 */%0A%09public String getScript() %7B%0A%09%09return script;%0A%09%7D%0A%0A%09/**%0A%09 * @param script%0A%09 */%0A%09public void setScript(String script) %7B%0A%09%09this.script = script;%0A%09%7D%0A%0A%09/**%0A%09 * @return%0A%09 */%0A%09public Table getDataset() %7B%0A%09%09return dataset;%0A%09%7D%0A%0A%09/**%0A%09 * @param dataset%0A%09 */%0A%09public void setDataset(Table dataset) %7B%0A%09%09this.dataset = dataset;%0A%09%7D%0A%0A%09/**
+Start analysis based on script
 %0A   
@@ -691,19 +691,16 @@
 %7D%0A%0A    %09
-if(
 toInputM
@@ -706,26 +706,23 @@
 Module()
-) %7B
+;
 %0A    %09
-%09
 toOutput
@@ -730,23 +730,16 @@
 odule();
-%0A    %09%7D
 %0A%0A    %09r
@@ -766,32 +766,60 @@
 %0A    /**%0A     * 
+returns result of the script
 %0A     */%0A    pub
@@ -851,16 +851,8 @@
    %09
-toGUI();
 %0A   
@@ -862,39 +862,57 @@
 %0A    /**%0A     * 
-@return
+Send data to input module
 %0A     */%0A    pri
@@ -916,23 +916,20 @@
 private 
-boolean
+void
  toInput
@@ -1042,30 +1042,24 @@
 %0A    %09return
- false
 ;%0A    %7D%0A%0A   
@@ -1062,32 +1062,58 @@
 %0A    /**%0A     * 
+Send data to output module
 %0A     */%0A    pri
@@ -1145,192 +1145,518 @@
 ) %7B%0A
+%0A
     
-%09//maakt output module aan..%0A    %09//geeft data..%0A    %09//krijgt output dingen terug%0A    %7D%0A%0A    /**%0A     * %0A     */%0A    private void toGUI() %7B%0A    %09//stuurt alles terug naar GUI%0A    
+%7D%0A%0A%09/**%0A%09 * @return%0A%09 */%0A%09public InputData%5B%5D getData() %7B%0A%09%09return data;%0A%09%7D%0A%0A%09/**%0A%09 * @param data%0A%09 */%0A%09public void setData(InputData%5B%5D data) %7B%0A%09%09this.data = data;%0A%09%7D%0A%0A%09/**%0A%09 * @return%0A%09 */%0A%09public String getScript() %7B%0A%09%09return script;%0A%09%7D%0A%0A%09/**%0A%09 * @param script%0A%09 */%0A%09public void setScript(String script) %7B%0A%09%09this.script = script;%0A%09%7D%0A%0A%09/**%0A%09 * @return%0A%09 */%0A%09public Table getDataset() %7B%0A%09%09return dataset;%0A%09%7D%0A%0A%09/**%0A%09 * @param dataset%0A%09 */%0A%09public void setDataset(Table dataset) %7B%0A%09%09this.dataset = dataset;%0A%09
 %7D%0A%0A%09

Update of ControleModule class