blob: e854100002b70e4404b81c6695b009f9812c77cc [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004-2008 Peter Pasztor, Akos Horvath, Gergely Varro, Istvan Rath and Daniel Varro
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Peter Pasztor, Akos Horvath, Gergely Varro, Istvan Rath - initial API and implementation
*******************************************************************************/
package org.eclipse.viatra2.gtasm.interpreter.executionEnvironment;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.emf.common.util.EList;
import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.definitions.ASMFunction;
public class ASMFunctionContent extends
HashMap<ASMFunction, HashMap<EList<Object>, Object>> {
/**
* Stores the ASMFunction values
*
* @author Peter Pasztor
*/
private static final long serialVersionUID = 1L;
private static ASMFunctionContent _instance = new ASMFunctionContent();
public static ASMFunctionContent getInstance() {
return _instance;
}
private ASMFunctionContent() {
super();
}
private final Set<ASMFunctionContentChangeListener> listeners = new HashSet<ASMFunctionContentChangeListener>();
public void addListener(ASMFunction f, ASMFunctionContentChangeListener l) {
listeners.add(l);
}
public void removeListener(ASMFunction f, ASMFunctionContentChangeListener l) {
listeners.remove(l);
}
public void notifyListeners(ASMFunction f, EList<Object> key, Object newValue) {
for (ASMFunctionContentChangeListener l : listeners)
l.valueChanged(f, key, newValue);
}
}