/******************************************************************************* * Copyright (c) 2007, 2011 Association for Decentralized Information Management * in Industry THTH ry. * 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: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ package org.simantics; import org.eclipse.core.runtime.jobs.ISchedulingRule; /** * @author Tuukka Lehtonen */ public class ObjectIdentitySchedulingRule implements ISchedulingRule { private final Object object; public ObjectIdentitySchedulingRule(Object object) { if (object == null) throw new NullPointerException("null object"); this.object = object; } public boolean contains(ISchedulingRule rule) { if (rule instanceof ObjectIdentitySchedulingRule) return object.equals(((ObjectIdentitySchedulingRule) rule).object); return false; } public boolean isConflicting(ISchedulingRule rule) { return contains(rule); } }