Index: DCWoRMS/trunk/src/test/jobschema/TaskRequirementsNewImpl.java
===================================================================
--- DCWoRMS/trunk/src/test/jobschema/TaskRequirementsNewImpl.java	(revision 742)
+++ DCWoRMS/trunk/src/test/jobschema/TaskRequirementsNewImpl.java	(revision 742)
@@ -0,0 +1,151 @@
+package test.jobschema;
+
+import java.util.ArrayList;
+
+import org.qcg.broker.schemas.exception.NoSuchParamException;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceType;
+import org.qcg.broker.schemas.jobdesc.RequirementsType;
+import org.qcg.broker.schemas.jobdesc.ResourceRequirementsType;
+import org.qcg.broker.schemas.jobdesc.types.ComputingParameterName;
+import org.qcg.broker.schemas.jobdesc.wrapper.ComputingResourceJobDescParamExplorer;
+import org.qcg.broker.schemas.jobdesc.wrapper.impl.ComputingResourceParamExplorerImpl;
+import org.qcg.broker.schemas.jobdesc.wrapper.impl.TaskRequirementsImpl;
+
+public class TaskRequirementsNewImpl extends TaskRequirementsImpl{
+	protected double[] getDoubleValues(ComputingParameterName param, ValueType valueType) throws NoSuchParamException{
+		RequirementsType req = null;
+		ResourceRequirementsType taskResReq = null;
+		ComputingResourceType compRes = null;
+		double values[] = null;
+		double value = -1;
+		
+		ArrayList<Double> list = null;
+		ComputingResourceJobDescParamExplorer explorer = null;
+		
+		req = task.getRequirements();
+		if(req == null)
+			throw new NoSuchParamException("Requirements are not defined.");
+		
+		taskResReq = req.getResourceRequirements();
+		if(taskResReq == null)
+			throw new NoSuchParamException("Resource requirements are not defined.");
+		
+		list = new ArrayList<Double>();
+		explorer = new ComputingResourceParamExplorerImpl();
+		//explorer.setResourceTemplates(req.getResourceTemplates());
+		
+		
+		for(int i = 0; i < taskResReq.getComputingResourceCount(); i++){
+			compRes = taskResReq.getComputingResource(i);
+			explorer.explore(compRes);
+			
+			values = null;
+			value = -1;
+			try {
+				switch(param){
+					
+				case MEMORY: 
+						switch(valueType) {
+							case DOUBLE_VALUE: values = explorer.getMemory();
+								break;
+							case MIN_VALUE: value = explorer.getMinMemory();
+								break;
+							case MAX_VALUE: value = explorer.getMaxMemory();
+								break;
+						}
+						 
+						break;
+					
+					case FREEMEMORY: 
+						switch(valueType) {
+							case DOUBLE_VALUE: values = explorer.getFreememory();
+								break;
+							case MIN_VALUE: value = explorer.getMinFreememory();
+								break;
+							case MAX_VALUE: value = explorer.getMaxFreememory();
+								break;
+						}
+						
+						break;
+						
+					case CPUCOUNT: 
+						switch(valueType) {
+							case DOUBLE_VALUE: values = explorer.getCpucount();
+								break;
+							case MIN_VALUE: value = explorer.getMinCpucount(); 
+								break;
+							case MAX_VALUE: value = explorer.getMaxCpucount();
+								break;
+						}
+						 
+						break;
+						
+					case FREECPUS: 
+						switch(valueType) {
+							case DOUBLE_VALUE: values = explorer.getFreecpus();
+								break;
+							case MIN_VALUE: value = explorer.getMinFreecpus();
+								break;
+							case MAX_VALUE: value = explorer.getMaxFreecpus();
+								break;
+						}
+						
+						break;
+
+					case CPUSPEED: 
+						switch(valueType) {
+							case DOUBLE_VALUE: values = explorer.getCpuspeed();
+								break;
+							case MIN_VALUE: value = explorer.getMinCpuspeed();
+								break;
+							case MAX_VALUE: value = explorer.getMaxCpuspeed();
+								break;
+						}
+						
+						break;
+						
+					case DISKSPACE: 
+						switch(valueType) {
+							case DOUBLE_VALUE: values = explorer.getDiskspace();
+								break;
+							case MIN_VALUE: value = explorer.getMinDiskspace(); 
+								break;
+							case MAX_VALUE: value = explorer.getMaxDiskspace();
+								break;
+						}
+						 
+						break;
+
+					case FREEDISKSPACE: 
+						switch(valueType) {
+							case DOUBLE_VALUE: values = explorer.getFreediskspace();
+								break;
+							case MIN_VALUE: value = explorer.getMinFreediskspace();
+								break;
+							case MAX_VALUE: value = explorer.getMaxFreediskspace(); 
+								break;
+						}
+						
+						break;
+				}
+			} catch (NoSuchParamException e){
+				values = null;
+				value = -1;
+			}
+			
+			if(valueType == ValueType.DOUBLE_VALUE && values != null && values.length > 0){
+				list.add(values[0]);
+			} else if(valueType != ValueType.DOUBLE_VALUE && value != -1){
+				list.add(value);
+			}
+			
+		}
+		
+		values = new double[list.size()];
+		for(int i = 0; i < list.size(); i++){
+			values[i] = list.get(i);
+		}
+		
+		return values;
+	}
+}
