From: G?nther B. <br...@us...> - 2002-01-31 07:33:40
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/statemachine In directory usw-pr-cvs1:/tmp/cvs-serv28514 Added Files: DataObject.java Log Message: stores data by using a HashMap --- NEW FILE: DataObject.java --- /*********************************************************************** * * Copyright (c) 2001 IICM, Graz University of Technology * Schiesstattgasse 4a, A-8010 Graz, Austria. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License (LGPL) * as published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***********************************************************************/ package edu.iicm.xpg.statemachine; import java.util.HashMap; //---------------------------------------------------------------------- /** * @author Günther Brand * @version $revision$ */ public class DataObject { protected boolean finished_ = false; protected HashMap data_map_ = new HashMap(); //---------------------------------------------------------------------- /** * @return */ public boolean isFinished() { return finished_; } //---------------------------------------------------------------------- /** * @param key a description of the stored data * @param value the dataobject that should be stored */ public void putObject(String key, Object value) { if ( data_map_.containsKey(key) ) { System.err.println("\"" + key + "\" allready exists inDataObject"); return; } data_map_.put(key, value); } //---------------------------------------------------------------------- /** * @param key the identificator of the stored data * @return the dataobject */ public Object getObject(String key) { return data_map_.get(key); } //---------------------------------------------------------------------- /** * @param key the identificator of the stored data * @return the dataobject */ public Object takeObject(String key) { return data_map_.remove(key); } } |