org/objectweb/proactive/ext/scilab/SciResult.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.Serializable;
00034 import java.util.ArrayList;
00035 import java.util.HashMap;
00036 import java.util.Iterator;
00037 
00038 import javasci.SciData;
00039 
00043 public class SciResult implements Serializable{
00044         public static final int SUCCESS = 0, ABORT = 1;
00045         private String id;
00046         private int state;
00047         private HashMap<String, SciData> mapResult; //map of SciResult
00048         private long timeExecution;
00049         
00054         public SciResult(){
00055         }
00056         
00057         public SciResult(String id){
00058                 this.id = id;
00059                 mapResult = new HashMap<String, SciData>();
00060         }
00061         
00066         public void add(SciData data){
00067                 this.mapResult.put(data.getName(), data);
00068         }
00069         
00075         public SciData get(String name){
00076                 return this.mapResult.get(name);
00077         }
00078         
00083         public ArrayList<SciData> getList(){
00084                 ArrayList<SciData> listResult = new ArrayList<SciData>();
00085                 Iterator<SciData> it = this.mapResult.values().iterator();
00086                 
00087                 while(it.hasNext()){
00088                         listResult.add(it.next());
00089                 }
00090                 
00091                 return listResult;
00092         }
00093 
00094         public int getState() {
00095                 return state;
00096         }
00097 
00098         public void setState(int state) {
00099                 this.state = state;
00100         }
00101 
00102         public long getTimeExecution() {
00103                 return timeExecution;
00104         }
00105 
00106         public void setTimeExecution(long timeExecution) {
00107                 this.timeExecution = timeExecution;
00108         }
00109 
00110         public String getId() {
00111                 return id;
00112         }
00113 }

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