org/objectweb/proactive/ext/scilab/SciTask.java

00001 /* 
00002  * ################################################################
00003  * 
00004  * ProActive: The Java(TM) library for Parallel, Distributed, 
00005  *            Concurrent computing with Security and Mobility
00006  * 
00007  * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
00008  * Contact: proactive@objectweb.org
00009  * 
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2.1 of the License, or any later version.
00014  *  
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  * 
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00023  * USA
00024  *  
00025  *  Initial developer(s):               The ProActive Team
00026  *                        http://www.inria.fr/oasis/ProActive/contacts.html
00027  *  Contributor(s): 
00028  * 
00029  * ################################################################
00030  */ 
00031 package org.objectweb.proactive.ext.scilab;
00032 
00033 import java.io.File;
00034 import java.io.FileNotFoundException;
00035 import java.io.FileReader;
00036 import java.io.IOException;
00037 import java.io.Serializable;
00038 import java.util.ArrayList;
00039 
00040 import javasci.SciData;
00041 
00045 public class SciTask implements Serializable {
00046         
00047         private String id;
00048         private ArrayList<SciData> listDataIn;
00049         private ArrayList<SciData> listDataOut;
00050         private String job;
00051         private String jobInit;
00052 
00053         public SciTask(String id) {
00054                 this.id = id;
00055                 this.listDataIn = new ArrayList<SciData>();
00056                 this.listDataOut = new ArrayList<SciData>();
00057         }
00058         
00059         public String getJob() {
00060                 return job;
00061         }
00062 
00063         public void setJob(String job) {
00064                 this.job = job;
00065         }
00066         
00067         public void setJobInit(String jobInit){
00068                 this.jobInit = jobInit;
00069         }
00070         
00071         public void setJob(File fileJob) throws FileNotFoundException, IOException{
00072                 StringBuffer strBuffer = new StringBuffer();
00073         
00074                 FileReader reader = new FileReader(fileJob);
00075                 int c;
00076                 
00077                 while((c = reader.read()) != -1){
00078                         strBuffer.append((char)c);
00079                 }
00080                 this.job = strBuffer.toString();
00081                 
00082                 reader.close();
00083         }
00084 
00085         public ArrayList<SciData> getListDataIn() {
00086                 return listDataIn;
00087         }
00088 
00089         public void setListDataIn(ArrayList<SciData> listDataIn) {
00090                 this.listDataIn = listDataIn;
00091         }
00092 
00093         public void addDataIn(SciData data) {
00094                 this.listDataIn.add(data);
00095         }
00096         
00097         public ArrayList<SciData> getListDataOut() {
00098                 return listDataOut;
00099         }
00100 
00101         public void setListDataOut(ArrayList<SciData> listDataOut) {
00102                 this.listDataOut = listDataOut;
00103         }
00104         
00105         public void addDataOut(SciData data) {
00106                 this.listDataOut.add(data);
00107         }
00108 
00109         public String getId() {
00110                 return id;
00111         }
00112 
00113         public String getJobInit() {
00114                 return jobInit;
00115         }
00116         
00117 }

Generated on Mon Jan 22 15:16:10 2007 for ProActive by  doxygen 1.5.1