]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics/src/org/simantics/ObjectIdentitySchedulingRule.java
SimanticsPlatform.startUp ensures updateness of installed feature groups
[simantics/platform.git] / bundles / org.simantics / src / org / simantics / ObjectIdentitySchedulingRule.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2011 Association for Decentralized Information Management
3  * in Industry THTH ry.
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
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics;
13
14 import org.eclipse.core.runtime.jobs.ISchedulingRule;
15
16 /**
17  * @author Tuukka Lehtonen
18  */
19 public class ObjectIdentitySchedulingRule implements ISchedulingRule {
20
21     private final Object object;
22
23     public ObjectIdentitySchedulingRule(Object object) {
24         if (object == null)
25             throw new NullPointerException("null object");
26         this.object = object;
27     }
28
29     public boolean contains(ISchedulingRule rule) {
30         if (rule instanceof ObjectIdentitySchedulingRule)
31             return object.equals(((ObjectIdentitySchedulingRule) rule).object);
32         return false;
33     }
34
35     public boolean isConflicting(ISchedulingRule rule) {
36         return contains(rule);
37     }
38
39 }