/* * Moonlight|3D * Copyright (C) 2006 The Moonlight|3D team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package ml.backend.cache; import java.util.HashMap; import java.util.Map; import ml.backend.sg.Node; public class Manager { private HashMap cachedSGNodes; public Manager() { cachedSGNodes=new HashMap(); } public void addNode(String identifier, Node node) { cachedSGNodes.put(identifier,node); } public Node getNode(String identifier) { return cachedSGNodes.get(identifier); } public Map getNodes() { return (HashMap) cachedSGNodes.clone(); } public void removeNode(String identifier) { cachedSGNodes.remove(identifier); } public void clear() { cachedSGNodes.clear(); } }