/FileExtraction/Java_unseen/cpn-io_cpn-js/backend/org.cpntools.accesscpn.engine.highlevel/src/org/cpntools/accesscpn/engine/highlevel/instance/adapter/PetriNetDataAdapter.java
/************************************************************************/
/* Access/CPN */
/* Copyright 2010-2011 AIS Group, Eindhoven University of Technology */
/*                                                                      */
/* 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 org.cpntools.accesscpn.engine.highlevel.instance.adapter;

import org.cpntools.accesscpn.model.PetriNet;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.ecore.util.EContentAdapter;

/**
 * @author mwesterg
 */
public class PetriNetDataAdapter extends EContentAdapter {
	protected PetriNet petriNet;

	@Override
	public void notifyChanged(final Notification notification) {
// System.out.println(notification);
		super.notifyChanged(notification);
	}

	/**
	 * @param target
	 */
	@Override
	public void setTarget(final Notifier target) {
		super.setTarget(target);
		if (target != null && target instanceof PetriNet) {
			petriNet = (PetriNet) target;
		}
	}

	/**
	 * @see org.eclipse.emf.common.notify.impl.AdapterImpl#isAdapterForType(java.lang.Object)
	 */
	@Override
	public boolean isAdapterForType(final Object type) {
		return getClass().equals(type);
	}

	/**
	 * @return
	 */
	public PetriNet getPetriNet() {
		return petriNet;
	}
}
