1 /*******************************************************************************
2 * Copyright (c) 2007, 2011 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics;
14 import org.eclipse.core.runtime.jobs.ISchedulingRule;
17 * @author Tuukka Lehtonen
19 public class ObjectIdentitySchedulingRule implements ISchedulingRule {
21 private final Object object;
23 public ObjectIdentitySchedulingRule(Object object) {
25 throw new NullPointerException("null object");
29 public boolean contains(ISchedulingRule rule) {
30 if (rule instanceof ObjectIdentitySchedulingRule)
31 return object.equals(((ObjectIdentitySchedulingRule) rule).object);
35 public boolean isConflicting(ISchedulingRule rule) {
36 return contains(rule);